likec4 1.14.0 → 1.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1064) hide show
  1. package/dist/__app__/src/chunks/{-index-overview-Cvy2bmWn.js → -index-overview-BwT9t8VB.js} +2 -2
  2. package/dist/__app__/src/chunks/{main-l0NUY_pP.js → main-Q7z-4OPp.js} +179 -117
  3. package/dist/__app__/src/chunks/{mantine-BQY2cnn-.js → mantine-Dx0sIYv1.js} +8 -10
  4. package/dist/__app__/src/main.js +1 -1
  5. package/dist/__app__/src/style.css +1 -1
  6. package/dist/__app__/webcomponent/webcomponent.js +182 -122
  7. package/dist/chunks/prompt.mjs +1 -1
  8. package/dist/cli/index.mjs +17 -17
  9. package/dist/index.d.mts +74 -22
  10. package/dist/index.d.ts +74 -22
  11. package/dist/index.mjs +1 -1
  12. package/dist/shared/likec4.CozyJbyo.mjs +1824 -0
  13. package/icons/all.d.ts +0 -1
  14. package/icons/all.js +0 -2
  15. package/icons/aws/activate.js +9 -9
  16. package/icons/aws/alexa-for-business.js +10 -10
  17. package/icons/aws/amplify.js +2 -2
  18. package/icons/aws/apache-mxnet-on-aws.js +5 -5
  19. package/icons/aws/api-gateway.js +5 -5
  20. package/icons/aws/app-config.js +5 -5
  21. package/icons/aws/app-flow.js +5 -5
  22. package/icons/aws/app-mesh.js +4 -4
  23. package/icons/aws/app-runner.js +5 -5
  24. package/icons/aws/app-stream.js +10 -10
  25. package/icons/aws/app-sync.js +7 -7
  26. package/icons/aws/application-auto-scaling.js +4 -4
  27. package/icons/aws/application-composer.js +6 -6
  28. package/icons/aws/application-cost-profiler.js +4 -4
  29. package/icons/aws/application-discovery-service.js +10 -10
  30. package/icons/aws/application-migration-service.js +10 -10
  31. package/icons/aws/artifact.js +9 -9
  32. package/icons/aws/athena.js +7 -7
  33. package/icons/aws/audit-manager.js +5 -5
  34. package/icons/aws/augmented-ai-a2i.js +4 -4
  35. package/icons/aws/aurora.js +5 -5
  36. package/icons/aws/auto-scaling.js +2 -2
  37. package/icons/aws/backint-agent.js +5 -5
  38. package/icons/aws/backup.js +4 -4
  39. package/icons/aws/batch.js +5 -5
  40. package/icons/aws/billing-conductor.js +7 -7
  41. package/icons/aws/bottlerocket.js +5 -5
  42. package/icons/aws/braket.js +10 -10
  43. package/icons/aws/budgets.js +7 -7
  44. package/icons/aws/certificate-manager.js +10 -10
  45. package/icons/aws/chatbot.js +10 -10
  46. package/icons/aws/chime-sdk.js +4 -4
  47. package/icons/aws/chime-voice-connector.js +5 -5
  48. package/icons/aws/chime.js +4 -4
  49. package/icons/aws/clean-rooms.js +5 -5
  50. package/icons/aws/client-vpn.js +7 -7
  51. package/icons/aws/cloud-control-api.js +8 -8
  52. package/icons/aws/cloud-development-kit.js +7 -7
  53. package/icons/aws/cloud-directory.js +8 -8
  54. package/icons/aws/cloud-formation.js +6 -6
  55. package/icons/aws/cloud-front.js +2 -2
  56. package/icons/aws/cloud-hsm.js +4 -4
  57. package/icons/aws/cloud-map.js +2 -2
  58. package/icons/aws/cloud-search.js +2 -2
  59. package/icons/aws/cloud-shell.js +4 -4
  60. package/icons/aws/cloud-trail.js +8 -8
  61. package/icons/aws/cloud-wan.js +2 -2
  62. package/icons/aws/cloud-watch.js +2 -2
  63. package/icons/aws/cloud9.js +2 -2
  64. package/icons/aws/code-artifact.js +4 -4
  65. package/icons/aws/code-build.js +4 -4
  66. package/icons/aws/code-catalyst.js +10 -10
  67. package/icons/aws/code-commit.js +8 -8
  68. package/icons/aws/code-deploy.js +4 -4
  69. package/icons/aws/code-guru.js +4 -4
  70. package/icons/aws/code-pipeline.js +10 -10
  71. package/icons/aws/code-star.js +2 -2
  72. package/icons/aws/code-whisperer.js +6 -6
  73. package/icons/aws/cognito.js +9 -9
  74. package/icons/aws/command-line-interface.js +9 -9
  75. package/icons/aws/comprehend-medical.js +5 -5
  76. package/icons/aws/comprehend.js +5 -5
  77. package/icons/aws/compute-optimizer.js +4 -4
  78. package/icons/aws/config.js +2 -2
  79. package/icons/aws/connect.js +2 -2
  80. package/icons/aws/console-mobile-application.js +2 -2
  81. package/icons/aws/control-tower.js +2 -2
  82. package/icons/aws/corretto.js +5 -5
  83. package/icons/aws/cost-and-usage-report.js +5 -5
  84. package/icons/aws/cost-explorer.js +2 -2
  85. package/icons/aws/data-exchange.js +9 -9
  86. package/icons/aws/data-pipeline.js +5 -5
  87. package/icons/aws/data-sync.js +8 -8
  88. package/icons/aws/data-zone.js +8 -8
  89. package/icons/aws/database-migration-service.js +9 -9
  90. package/icons/aws/deep-composer.js +9 -9
  91. package/icons/aws/deep-learning-amis.js +5 -5
  92. package/icons/aws/deep-learning-containers.js +7 -7
  93. package/icons/aws/deep-lens.js +10 -10
  94. package/icons/aws/deep-racer.js +2 -2
  95. package/icons/aws/detective.js +6 -6
  96. package/icons/aws/dev-ops-guru.js +5 -5
  97. package/icons/aws/device-farm.js +7 -7
  98. package/icons/aws/direct-connect.js +7 -7
  99. package/icons/aws/directory-service.js +9 -9
  100. package/icons/aws/distro-for-open-telemetry.js +10 -10
  101. package/icons/aws/document-db.js +5 -5
  102. package/icons/aws/dynamo-db.js +2 -2
  103. package/icons/aws/ec2-auto-scaling.js +2 -2
  104. package/icons/aws/ec2-image-builder.js +7 -7
  105. package/icons/aws/ec2.js +2 -2
  106. package/icons/aws/ecs-anywhere.js +10 -10
  107. package/icons/aws/efs.js +4 -4
  108. package/icons/aws/eks-anywhere.js +4 -4
  109. package/icons/aws/eks-cloud.js +5 -5
  110. package/icons/aws/eks-distro.js +2 -2
  111. package/icons/aws/elasti-cache.js +7 -7
  112. package/icons/aws/elastic-beanstalk.js +7 -7
  113. package/icons/aws/elastic-block-store.js +4 -4
  114. package/icons/aws/elastic-container-registry.js +6 -6
  115. package/icons/aws/elastic-container-service.js +6 -6
  116. package/icons/aws/elastic-disaster-recovery.js +10 -10
  117. package/icons/aws/elastic-fabric-adapter.js +5 -5
  118. package/icons/aws/elastic-inference.js +2 -2
  119. package/icons/aws/elastic-kubernetes-service.js +5 -5
  120. package/icons/aws/elastic-load-balancing.js +5 -5
  121. package/icons/aws/elastic-transcoder.js +5 -5
  122. package/icons/aws/elemental-appliances-software.js +5 -5
  123. package/icons/aws/elemental-conductor.js +2 -2
  124. package/icons/aws/elemental-delta.js +5 -5
  125. package/icons/aws/elemental-link.js +7 -7
  126. package/icons/aws/elemental-live.js +5 -5
  127. package/icons/aws/elemental-media-connect.js +2 -2
  128. package/icons/aws/elemental-media-convert.js +4 -4
  129. package/icons/aws/elemental-media-live.js +4 -4
  130. package/icons/aws/elemental-media-package.js +4 -4
  131. package/icons/aws/elemental-media-store.js +4 -4
  132. package/icons/aws/elemental-media-tailor.js +6 -6
  133. package/icons/aws/elemental-server.js +10 -10
  134. package/icons/aws/emr.js +4 -4
  135. package/icons/aws/event-bridge.js +7 -7
  136. package/icons/aws/express-workflows.js +7 -7
  137. package/icons/aws/fargate.js +5 -5
  138. package/icons/aws/fault-injection-simulator.js +5 -5
  139. package/icons/aws/file-cache.js +5 -5
  140. package/icons/aws/fin-space.js +5 -5
  141. package/icons/aws/firewall-manager.js +4 -4
  142. package/icons/aws/forecast.js +10 -10
  143. package/icons/aws/fraud-detector.js +10 -10
  144. package/icons/aws/free-rtos.js +5 -5
  145. package/icons/aws/fsx-for-lustre.js +8 -8
  146. package/icons/aws/fsx-for-net-app-ontap.js +5 -5
  147. package/icons/aws/fsx-for-open-zfs.js +5 -5
  148. package/icons/aws/fsx-for-wfs.js +9 -9
  149. package/icons/aws/fsx.js +2 -2
  150. package/icons/aws/game-kit.js +10 -10
  151. package/icons/aws/game-lift.js +5 -5
  152. package/icons/aws/game-sparks.js +7 -7
  153. package/icons/aws/genomics-cli.js +10 -10
  154. package/icons/aws/global-accelerator.js +4 -4
  155. package/icons/aws/glue-data-brew.js +6 -6
  156. package/icons/aws/glue-elastic-views.js +5 -5
  157. package/icons/aws/glue.js +4 -4
  158. package/icons/aws/ground-station.js +7 -7
  159. package/icons/aws/guard-duty.js +2 -2
  160. package/icons/aws/health-lake.js +10 -10
  161. package/icons/aws/honeycode.js +5 -5
  162. package/icons/aws/iam-identity-center.js +7 -7
  163. package/icons/aws/identity-and-access-management.js +10 -10
  164. package/icons/aws/inspector.js +6 -6
  165. package/icons/aws/interactive-video-service.js +7 -7
  166. package/icons/aws/io-t-1-click.js +2 -2
  167. package/icons/aws/io-t-analytics.js +5 -5
  168. package/icons/aws/io-t-button.js +5 -5
  169. package/icons/aws/io-t-core.js +7 -7
  170. package/icons/aws/io-t-device-defender.js +9 -9
  171. package/icons/aws/io-t-device-management.js +7 -7
  172. package/icons/aws/io-t-edu-kit.js +2 -2
  173. package/icons/aws/io-t-events.js +6 -6
  174. package/icons/aws/io-t-express-link.js +5 -5
  175. package/icons/aws/io-t-fleet-wise.js +10 -10
  176. package/icons/aws/io-t-greengrass.js +7 -7
  177. package/icons/aws/io-t-robo-runner.js +10 -10
  178. package/icons/aws/io-t-site-wise.js +5 -5
  179. package/icons/aws/io-t-things-graph.js +2 -2
  180. package/icons/aws/io-t-twin-maker.js +12 -5
  181. package/icons/aws/iq.js +4 -4
  182. package/icons/aws/kendra.js +7 -7
  183. package/icons/aws/key-management-service.js +10 -10
  184. package/icons/aws/keyspaces.js +10 -10
  185. package/icons/aws/kinesis-data-analytics.js +8 -8
  186. package/icons/aws/kinesis-data-streams.js +9 -9
  187. package/icons/aws/kinesis-firehose.js +10 -10
  188. package/icons/aws/kinesis-video-streams.js +10 -10
  189. package/icons/aws/kinesis.js +9 -9
  190. package/icons/aws/lake-formation.js +2 -2
  191. package/icons/aws/lambda.js +5 -5
  192. package/icons/aws/launch-wizard.js +2 -2
  193. package/icons/aws/lex.js +5 -5
  194. package/icons/aws/license-manager.js +5 -5
  195. package/icons/aws/lightsail.js +5 -5
  196. package/icons/aws/local-zones.js +5 -5
  197. package/icons/aws/location-service.js +2 -2
  198. package/icons/aws/lookout-for-equipment.js +10 -10
  199. package/icons/aws/lookout-for-metrics.js +10 -10
  200. package/icons/aws/lookout-for-vision.js +10 -10
  201. package/icons/aws/lumberyard.js +4 -4
  202. package/icons/aws/macie.js +8 -8
  203. package/icons/aws/mainframe-modernization.js +10 -10
  204. package/icons/aws/managed-blockchain.js +2 -2
  205. package/icons/aws/managed-grafana.js +9 -9
  206. package/icons/aws/managed-service-for-prometheus.js +9 -9
  207. package/icons/aws/managed-services.js +2 -2
  208. package/icons/aws/managed-streaming-for-apache-kafka.js +5 -5
  209. package/icons/aws/managed-workflows-for-apache-airflow.js +4 -4
  210. package/icons/aws/management-console.js +10 -10
  211. package/icons/aws/memory-db-for-redis.js +10 -10
  212. package/icons/aws/migration-evaluator.js +4 -4
  213. package/icons/aws/migration-hub.js +8 -8
  214. package/icons/aws/monitron.js +5 -5
  215. package/icons/aws/mq.js +5 -5
  216. package/icons/aws/neptune.js +5 -5
  217. package/icons/aws/network-firewall.js +5 -5
  218. package/icons/aws/neuron.js +5 -5
  219. package/icons/aws/nice-dcv.js +2 -2
  220. package/icons/aws/nice-engin-frame.js +9 -9
  221. package/icons/aws/nimble-studio.js +7 -7
  222. package/icons/aws/nitro-enclaves.js +5 -5
  223. package/icons/aws/omics.js +10 -10
  224. package/icons/aws/open-3d-engine.js +5 -5
  225. package/icons/aws/open-search-service.js +7 -7
  226. package/icons/aws/ops-works.js +5 -5
  227. package/icons/aws/organizations.js +7 -7
  228. package/icons/aws/outposts-family.js +2 -2
  229. package/icons/aws/outposts-rack.js +10 -10
  230. package/icons/aws/outposts-servers.js +9 -9
  231. package/icons/aws/panorama.js +10 -10
  232. package/icons/aws/parallel-cluster.js +5 -5
  233. package/icons/aws/personal-health-dashboard.js +4 -4
  234. package/icons/aws/personalize.js +7 -7
  235. package/icons/aws/pinpoint-apis.js +8 -8
  236. package/icons/aws/pinpoint.js +8 -8
  237. package/icons/aws/polly.js +8 -8
  238. package/icons/aws/private-5g.js +9 -9
  239. package/icons/aws/private-certificate-authority.js +22 -11
  240. package/icons/aws/private-link.js +10 -10
  241. package/icons/aws/professional-services.js +7 -7
  242. package/icons/aws/proton.js +10 -10
  243. package/icons/aws/quantum-ledger-database.js +5 -5
  244. package/icons/aws/quick-sight.js +5 -5
  245. package/icons/aws/rds-on-vmware.js +5 -5
  246. package/icons/aws/rds.js +5 -5
  247. package/icons/aws/re-post.js +5 -5
  248. package/icons/aws/red-hat-open-shift-service-on-aws.js +5 -5
  249. package/icons/aws/redshift.js +7 -7
  250. package/icons/aws/rekognition.js +6 -6
  251. package/icons/aws/reserved-instance-reporting.js +7 -7
  252. package/icons/aws/resilience-hub.js +10 -10
  253. package/icons/aws/resource-access-manager.js +6 -6
  254. package/icons/aws/resource-explorer.js +7 -7
  255. package/icons/aws/robo-maker.js +10 -10
  256. package/icons/aws/route-53.js +5 -5
  257. package/icons/aws/s3-on-outposts.js +4 -4
  258. package/icons/aws/sage-maker-ground-truth.js +5 -5
  259. package/icons/aws/sage-maker-studio-lab.js +5 -5
  260. package/icons/aws/sage-maker.js +5 -5
  261. package/icons/aws/savings-plans.js +10 -10
  262. package/icons/aws/secrets-manager.js +10 -10
  263. package/icons/aws/security-hub.js +4 -4
  264. package/icons/aws/security-lake.js +7 -7
  265. package/icons/aws/server-migration-service.js +7 -7
  266. package/icons/aws/serverless-application-repository.js +10 -10
  267. package/icons/aws/service-catalog.js +5 -5
  268. package/icons/aws/service-management-connector.js +23 -12
  269. package/icons/aws/shield.js +7 -7
  270. package/icons/aws/signer.js +5 -5
  271. package/icons/aws/sim-space-weaver.js +4 -4
  272. package/icons/aws/simple-email-service.js +5 -5
  273. package/icons/aws/simple-notification-service.js +7 -7
  274. package/icons/aws/simple-queue-service.js +9 -9
  275. package/icons/aws/simple-storage-service-glacier.js +5 -5
  276. package/icons/aws/simple-storage-service.js +8 -8
  277. package/icons/aws/site-to-site-vpn.js +9 -9
  278. package/icons/aws/snowball-edge.js +4 -4
  279. package/icons/aws/snowball.js +5 -5
  280. package/icons/aws/snowcone.js +10 -10
  281. package/icons/aws/snowmobile.js +5 -5
  282. package/icons/aws/step-functions.js +5 -5
  283. package/icons/aws/storage-gateway.js +10 -10
  284. package/icons/aws/sumerian.js +4 -4
  285. package/icons/aws/supply-chain.js +7 -7
  286. package/icons/aws/support.js +2 -2
  287. package/icons/aws/systems-manager.js +10 -10
  288. package/icons/aws/tensor-flow-on-aws.js +5 -5
  289. package/icons/aws/textract.js +10 -10
  290. package/icons/aws/thinkbox-deadline.js +7 -7
  291. package/icons/aws/thinkbox-frost.js +4 -4
  292. package/icons/aws/thinkbox-krakatoa.js +10 -10
  293. package/icons/aws/thinkbox-sequoia.js +2 -2
  294. package/icons/aws/thinkbox-stoke.js +2 -2
  295. package/icons/aws/thinkbox-xmesh.js +2 -2
  296. package/icons/aws/timestream.js +7 -7
  297. package/icons/aws/tools-and-sdks.js +5 -5
  298. package/icons/aws/torch-serve.js +10 -10
  299. package/icons/aws/training-certification.js +5 -5
  300. package/icons/aws/transcribe.js +5 -5
  301. package/icons/aws/transfer-family.js +5 -5
  302. package/icons/aws/transit-gateway.js +7 -7
  303. package/icons/aws/translate.js +10 -10
  304. package/icons/aws/trusted-advisor.js +5 -5
  305. package/icons/aws/verified-access.js +7 -7
  306. package/icons/aws/verified-permissions.js +5 -5
  307. package/icons/aws/virtual-private-cloud.js +2 -2
  308. package/icons/aws/vmware-cloud-on-aws.js +5 -5
  309. package/icons/aws/vpc-lattice.js +5 -5
  310. package/icons/aws/waf.js +5 -5
  311. package/icons/aws/wavelength.js +6 -6
  312. package/icons/aws/well-architected-tool.js +5 -5
  313. package/icons/aws/wickr.js +2 -2
  314. package/icons/aws/work-docs-sdk.js +5 -5
  315. package/icons/aws/work-docs.js +5 -5
  316. package/icons/aws/work-link.js +2 -2
  317. package/icons/aws/work-mail.js +5 -5
  318. package/icons/aws/work-spaces-family.js +5 -5
  319. package/icons/aws/x-ray.js +7 -7
  320. package/icons/azure/abs-member.js +24 -13
  321. package/icons/azure/active-directory-connect-health.js +39 -22
  322. package/icons/azure/activity-log.js +5 -5
  323. package/icons/azure/administrative-units.js +43 -21
  324. package/icons/azure/advisor.js +5 -5
  325. package/icons/azure/ai-studio.js +6 -6
  326. package/icons/azure/aks-istio.js +55 -22
  327. package/icons/azure/alerts.js +12 -12
  328. package/icons/azure/all-resources.js +5 -5
  329. package/icons/azure/analysis-services.js +57 -24
  330. package/icons/azure/anomaly-detector.js +18 -7
  331. package/icons/azure/api-center.js +21 -10
  332. package/icons/azure/api-connections.js +42 -20
  333. package/icons/azure/api-management-services.js +42 -20
  334. package/icons/azure/api-proxy.js +7 -7
  335. package/icons/azure/app-compliance-automation.js +29 -18
  336. package/icons/azure/app-configuration.js +21 -10
  337. package/icons/azure/app-registrations.js +19 -19
  338. package/icons/azure/app-service-certificates.js +21 -10
  339. package/icons/azure/app-service-domains.js +5 -5
  340. package/icons/azure/app-service-environments.js +20 -9
  341. package/icons/azure/app-service-plans.js +45 -23
  342. package/icons/azure/app-services.js +51 -29
  343. package/icons/azure/app-space-component.js +5 -5
  344. package/icons/azure/app-space.js +9 -9
  345. package/icons/azure/applens.js +11 -11
  346. package/icons/azure/application-gateway-containers.js +65 -44
  347. package/icons/azure/application-gateways.js +47 -15
  348. package/icons/azure/application-group.js +5 -5
  349. package/icons/azure/application-insights.js +27 -16
  350. package/icons/azure/application-security-groups.js +23 -12
  351. package/icons/azure/aquila.js +42 -42
  352. package/icons/azure/arc-data-services.js +21 -10
  353. package/icons/azure/arc-kubernetes.js +109 -43
  354. package/icons/azure/arc-machines.js +5 -5
  355. package/icons/azure/arc-sql-managed-instance.js +34 -13
  356. package/icons/azure/arc-sql-server.js +9 -9
  357. package/icons/azure/atm-multistack.js +2 -2
  358. package/icons/azure/auto-scale.js +23 -12
  359. package/icons/azure/automanaged-vm.js +18 -18
  360. package/icons/azure/automation-accounts.js +4 -4
  361. package/icons/azure/availability-sets.js +35 -13
  362. package/icons/azure/avs-vm.js +6 -6
  363. package/icons/azure/azure-a.js +10 -10
  364. package/icons/azure/azure-ad-b2c.js +34 -34
  365. package/icons/azure/azure-api-for-fhir.js +21 -10
  366. package/icons/azure/azure-applied-ai-services.js +48 -27
  367. package/icons/azure/azure-arc.js +29 -29
  368. package/icons/azure/azure-attestation.js +18 -18
  369. package/icons/azure/azure-backup-center.js +7 -7
  370. package/icons/azure/azure-chaos-studio.js +62 -28
  371. package/icons/azure/azure-cloud-shell.js +24 -13
  372. package/icons/azure/azure-communication-services.js +40 -18
  373. package/icons/azure/azure-communications-gateway.js +16 -5
  374. package/icons/azure/azure-compute-galleries.js +20 -9
  375. package/icons/azure/azure-cosmos-db.js +16 -10
  376. package/icons/azure/azure-data-catalog.js +41 -19
  377. package/icons/azure/azure-data-explorer-clusters.js +74 -30
  378. package/icons/azure/azure-database-maria-db-server.js +29 -18
  379. package/icons/azure/azure-database-migration-services.js +45 -24
  380. package/icons/azure/azure-database-my-sql-server.js +21 -10
  381. package/icons/azure/azure-database-postgre-sql-server-group.js +2 -2
  382. package/icons/azure/azure-database-postgre-sql-server.js +4 -4
  383. package/icons/azure/azure-databox-gateway.js +19 -8
  384. package/icons/azure/azure-deployment-environments.js +38 -21
  385. package/icons/azure/azure-dev-ops.js +4 -4
  386. package/icons/azure/azure-dev-tunnels.js +42 -14
  387. package/icons/azure/azure-edge-hardware-center.js +23 -12
  388. package/icons/azure/azure-experimentation-studio.js +27 -16
  389. package/icons/azure/azure-fileshares.js +20 -20
  390. package/icons/azure/azure-firewall-manager.js +34 -23
  391. package/icons/azure/azure-hcp-cache.js +14 -14
  392. package/icons/azure/azure-hpc-workbenches.js +80 -36
  393. package/icons/azure/azure-hybrid-center.js +19 -8
  394. package/icons/azure/azure-information-protection.js +73 -29
  395. package/icons/azure/azure-io-t-operations.js +19 -8
  396. package/icons/azure/azure-lighthouse.js +5 -5
  397. package/icons/azure/azure-load-testing.js +38 -16
  398. package/icons/azure/azure-managed-grafana.js +5 -5
  399. package/icons/azure/azure-maps-accounts.js +11 -11
  400. package/icons/azure/azure-media-service.js +48 -31
  401. package/icons/azure/azure-migrate.js +24 -13
  402. package/icons/azure/azure-monitor-dashboard.js +16 -5
  403. package/icons/azure/azure-monitor-pipeline.js +76 -32
  404. package/icons/azure/azure-monitors-for-sap-solutions.js +45 -23
  405. package/icons/azure/azure-net-app-files.js +6 -6
  406. package/icons/azure/azure-network-function-manager-functions.js +73 -20
  407. package/icons/azure/azure-network-function-manager.js +64 -31
  408. package/icons/azure/azure-object-understanding.js +19 -8
  409. package/icons/azure/azure-open-ai.js +10 -10
  410. package/icons/azure/azure-operator-5g-core.js +49 -27
  411. package/icons/azure/azure-operator-insights.js +19 -8
  412. package/icons/azure/azure-operator-nexus.js +67 -34
  413. package/icons/azure/azure-operator-service-manager.js +21 -10
  414. package/icons/azure/azure-orbital.js +14 -14
  415. package/icons/azure/azure-programmable-connectivity.js +57 -34
  416. package/icons/azure/azure-purview-accounts.js +75 -31
  417. package/icons/azure/azure-quotas.js +25 -14
  418. package/icons/azure/azure-sentinel.js +4 -4
  419. package/icons/azure/azure-service-bus.js +19 -8
  420. package/icons/azure/azure-sphere.js +34 -23
  421. package/icons/azure/azure-spring-apps.js +75 -31
  422. package/icons/azure/azure-sql-edge.js +32 -21
  423. package/icons/azure/azure-sql-server-stretch-databases.js +55 -27
  424. package/icons/azure/azure-sql-vm.js +8 -8
  425. package/icons/azure/azure-sql.js +11 -11
  426. package/icons/azure/azure-stack-edge.js +23 -12
  427. package/icons/azure/azure-stack-hci-sizer.js +54 -21
  428. package/icons/azure/azure-stack.js +4 -4
  429. package/icons/azure/azure-storage-mover.js +89 -27
  430. package/icons/azure/azure-support-center-blue.js +39 -17
  431. package/icons/azure/azure-sustainability.js +53 -20
  432. package/icons/azure/azure-synapse-analytics.js +31 -20
  433. package/icons/azure/azure-video-indexer.js +42 -20
  434. package/icons/azure/azure-virtual-desktop.js +2 -2
  435. package/icons/azure/azure-vmware-solution.js +40 -18
  436. package/icons/azure/azure-workbooks.js +28 -22
  437. package/icons/azure/azurite.js +7 -7
  438. package/icons/azure/backlog.js +24 -24
  439. package/icons/azure/backup-vault.js +39 -17
  440. package/icons/azure/bare-metal-infrastructure.js +42 -20
  441. package/icons/azure/bastions.js +7 -7
  442. package/icons/azure/batch-accounts.js +4 -4
  443. package/icons/azure/batch-ai.js +7 -7
  444. package/icons/azure/biz-talk.js +11 -11
  445. package/icons/azure/blob-block.js +5 -5
  446. package/icons/azure/blob-page.js +2 -2
  447. package/icons/azure/blockchain-applications.js +21 -10
  448. package/icons/azure/blueprints.js +4 -4
  449. package/icons/azure/bot-services.js +6 -6
  450. package/icons/azure/branch.js +16 -5
  451. package/icons/azure/browser.js +6 -6
  452. package/icons/azure/bug.js +5 -5
  453. package/icons/azure/builds.js +7 -7
  454. package/icons/azure/cache-redis.js +11 -11
  455. package/icons/azure/cache.js +4 -4
  456. package/icons/azure/capacity.js +4 -4
  457. package/icons/azure/cdn-profiles.js +18 -7
  458. package/icons/azure/central-service-instance-for-sap.js +18 -7
  459. package/icons/azure/ceres.js +16 -16
  460. package/icons/azure/change-analysis.js +28 -28
  461. package/icons/azure/client-apps.js +4 -4
  462. package/icons/azure/cloud-services-classic.js +21 -10
  463. package/icons/azure/cloud-services-extended-support.js +50 -22
  464. package/icons/azure/cloud-test.js +7 -7
  465. package/icons/azure/code-optimization.js +13 -13
  466. package/icons/azure/code.js +30 -30
  467. package/icons/azure/cognitive-search.js +4 -4
  468. package/icons/azure/cognitive-services-decisions.js +74 -29
  469. package/icons/azure/cognitive-services.js +4 -4
  470. package/icons/azure/collaborative-service.js +63 -18
  471. package/icons/azure/commit.js +9 -9
  472. package/icons/azure/community-images.js +51 -18
  473. package/icons/azure/compliance-center.js +35 -13
  474. package/icons/azure/compliance.js +5 -5
  475. package/icons/azure/compute-fleet.js +19 -8
  476. package/icons/azure/computer-vision.js +20 -9
  477. package/icons/azure/conditional-access.js +5 -5
  478. package/icons/azure/confidential-ledgers.js +59 -26
  479. package/icons/azure/connected-cache.js +56 -34
  480. package/icons/azure/connected-vehicle-platform.js +77 -32
  481. package/icons/azure/connections.js +8 -8
  482. package/icons/azure/container-apps-environments.js +40 -18
  483. package/icons/azure/container-instances.js +4 -4
  484. package/icons/azure/container-registries.js +20 -9
  485. package/icons/azure/container-services-deprecated.js +125 -48
  486. package/icons/azure/content-moderators.js +35 -13
  487. package/icons/azure/content-safety.js +21 -10
  488. package/icons/azure/controls-horizontal.js +8 -8
  489. package/icons/azure/controls.js +26 -26
  490. package/icons/azure/cost-alerts.js +12 -12
  491. package/icons/azure/cost-analysis.js +4 -4
  492. package/icons/azure/cost-budgets.js +14 -14
  493. package/icons/azure/cost-export.js +19 -8
  494. package/icons/azure/cost-management-and-billing.js +20 -10
  495. package/icons/azure/cost-management.js +18 -7
  496. package/icons/azure/custom-ip-prefix.js +22 -5
  497. package/icons/azure/custom-vision.js +19 -8
  498. package/icons/azure/customer-lockbox-for-microsoft-azure.js +43 -21
  499. package/icons/azure/dashboard-hub.js +68 -35
  500. package/icons/azure/dashboard.js +5 -5
  501. package/icons/azure/data-box.js +5 -5
  502. package/icons/azure/data-collection-rules.js +35 -13
  503. package/icons/azure/data-factories.js +11 -5
  504. package/icons/azure/data-lake-analytics.js +19 -8
  505. package/icons/azure/data-lake-storage-gen1.js +28 -17
  506. package/icons/azure/data-lake-store-gen1.js +23 -12
  507. package/icons/azure/data-share-invitations.js +26 -15
  508. package/icons/azure/data-shares.js +22 -22
  509. package/icons/azure/database-instance-for-sap.js +36 -25
  510. package/icons/azure/ddo-s-protection-plans.js +18 -7
  511. package/icons/azure/dedicated-hsm.js +21 -10
  512. package/icons/azure/defender-cm-local-manager.js +78 -34
  513. package/icons/azure/defender-dcs-controller.js +60 -27
  514. package/icons/azure/defender-distributer-control-system.js +41 -19
  515. package/icons/azure/defender-engineering-station.js +78 -34
  516. package/icons/azure/defender-external-management.js +88 -44
  517. package/icons/azure/defender-freezer-monitor.js +137 -71
  518. package/icons/azure/defender-historian.js +5 -5
  519. package/icons/azure/defender-hmi.js +28 -17
  520. package/icons/azure/defender-industrial-packaging-system.js +49 -27
  521. package/icons/azure/defender-industrial-printer.js +33 -16
  522. package/icons/azure/defender-industrial-robot.js +122 -56
  523. package/icons/azure/defender-industrial-scale-system.js +42 -20
  524. package/icons/azure/defender-marquee.js +54 -24
  525. package/icons/azure/defender-meter.js +89 -34
  526. package/icons/azure/defender-plc.js +32 -21
  527. package/icons/azure/defender-pneumatic-device.js +46 -24
  528. package/icons/azure/defender-programable-board.js +87 -43
  529. package/icons/azure/defender-relay.js +30 -12
  530. package/icons/azure/defender-robot-controller.js +72 -28
  531. package/icons/azure/defender-rtu.js +5 -5
  532. package/icons/azure/defender-sensor.js +23 -12
  533. package/icons/azure/defender-slot.js +2 -2
  534. package/icons/azure/defender-web-guiding-system.js +188 -89
  535. package/icons/azure/detonation.js +22 -11
  536. package/icons/azure/dev-console.js +6 -6
  537. package/icons/azure/dev-ops-starter.js +7 -7
  538. package/icons/azure/dev-test-labs.js +7 -7
  539. package/icons/azure/device-compliance.js +46 -24
  540. package/icons/azure/device-configuration.js +56 -23
  541. package/icons/azure/device-enrollment.js +59 -27
  542. package/icons/azure/device-provisioning-services.js +23 -12
  543. package/icons/azure/device-security-apple.js +20 -9
  544. package/icons/azure/device-security-google.js +19 -8
  545. package/icons/azure/device-security-windows.js +20 -9
  546. package/icons/azure/device-update-io-t-hub.js +18 -7
  547. package/icons/azure/devices.js +23 -23
  548. package/icons/azure/diagnostics-settings.js +20 -9
  549. package/icons/azure/digital-twins.js +58 -25
  550. package/icons/azure/disk-encryption-sets.js +9 -9
  551. package/icons/azure/disk-pool.js +7 -7
  552. package/icons/azure/disks-classic.js +46 -35
  553. package/icons/azure/disks-snapshots.js +49 -27
  554. package/icons/azure/disks.js +5 -5
  555. package/icons/azure/dns-private-resolver.js +19 -8
  556. package/icons/azure/dns-security-policy.js +6 -6
  557. package/icons/azure/dns-zones.js +5 -5
  558. package/icons/azure/download.js +5 -5
  559. package/icons/azure/e-books.js +5 -5
  560. package/icons/azure/edge-management.js +35 -24
  561. package/icons/azure/education.js +2 -2
  562. package/icons/azure/elastic-job-agents.js +25 -14
  563. package/icons/azure/elastic-san.js +2 -2
  564. package/icons/azure/endpoint-analytics.js +23 -12
  565. package/icons/azure/enterprise-applications.js +42 -31
  566. package/icons/azure/entra-connect-health.js +33 -16
  567. package/icons/azure/entra-connect-sync.js +28 -28
  568. package/icons/azure/entra-connect.js +10 -10
  569. package/icons/azure/entra-domain-services.js +36 -30
  570. package/icons/azure/entra-global-secure-access.js +65 -26
  571. package/icons/azure/entra-id-protection.js +36 -25
  572. package/icons/azure/entra-identity-custom-roles.js +7 -7
  573. package/icons/azure/entra-identity-licenses.js +64 -31
  574. package/icons/azure/entra-identity-roles-and-administrators.js +44 -22
  575. package/icons/azure/entra-internet-access.js +69 -36
  576. package/icons/azure/entra-managed-identities.js +17 -11
  577. package/icons/azure/entra-private-access.js +77 -33
  578. package/icons/azure/entra-privleged-identity-management.js +39 -33
  579. package/icons/azure/entra-verified-id.js +39 -17
  580. package/icons/azure/error.js +9 -9
  581. package/icons/azure/event-grid-domains.js +24 -14
  582. package/icons/azure/event-grid-subscriptions.js +43 -33
  583. package/icons/azure/event-grid-topics.js +33 -11
  584. package/icons/azure/exchange-access.js +6 -6
  585. package/icons/azure/exchange-on-premises-access.js +22 -11
  586. package/icons/azure/express-route-circuits.js +44 -22
  587. package/icons/azure/express-route-direct.js +19 -8
  588. package/icons/azure/express-route-traffic-collector.js +30 -19
  589. package/icons/azure/extended-security-updates.js +18 -7
  590. package/icons/azure/extensions.js +11 -11
  591. package/icons/azure/face-apis.js +4 -4
  592. package/icons/azure/feature-previews.js +11 -11
  593. package/icons/azure/fhir-service.js +20 -20
  594. package/icons/azure/file.js +5 -5
  595. package/icons/azure/files.js +2 -2
  596. package/icons/azure/firewalls.js +4 -4
  597. package/icons/azure/folder-blank.js +18 -7
  598. package/icons/azure/folder-website.js +80 -41
  599. package/icons/azure/form-recognizers.js +5 -5
  600. package/icons/azure/free-services.js +7 -7
  601. package/icons/azure/front-door-and-cdn-profiles.js +19 -8
  602. package/icons/azure/ftp.js +5 -5
  603. package/icons/azure/function-apps.js +17 -17
  604. package/icons/azure/gear.js +11 -11
  605. package/icons/azure/genomics-accounts.js +23 -12
  606. package/icons/azure/genomics.js +8 -8
  607. package/icons/azure/globe-error.js +14 -14
  608. package/icons/azure/globe-success.js +5 -5
  609. package/icons/azure/globe-warning.js +5 -5
  610. package/icons/azure/groups.js +18 -18
  611. package/icons/azure/guide.js +6 -6
  612. package/icons/azure/hd-insight-clusters.js +54 -21
  613. package/icons/azure/hdi-aks-cluster.js +7 -7
  614. package/icons/azure/heart.js +6 -6
  615. package/icons/azure/help-and-support.js +37 -15
  616. package/icons/azure/host-groups.js +13 -13
  617. package/icons/azure/host-pools.js +6 -6
  618. package/icons/azure/hosts.js +13 -13
  619. package/icons/azure/ic-m-troubleshooting.js +5 -5
  620. package/icons/azure/identity-governance.js +23 -12
  621. package/icons/azure/identity-multi-factor-authentication.js +58 -12
  622. package/icons/azure/image-definitions.js +21 -10
  623. package/icons/azure/image-templates.js +18 -7
  624. package/icons/azure/image-versions.js +29 -18
  625. package/icons/azure/image.js +2 -2
  626. package/icons/azure/images.js +9 -9
  627. package/icons/azure/immersive-readers.js +37 -15
  628. package/icons/azure/import-export-jobs.js +10 -10
  629. package/icons/azure/industrial-io-t.js +75 -31
  630. package/icons/azure/information.js +5 -5
  631. package/icons/azure/infrastructure-backup.js +51 -29
  632. package/icons/azure/input-output.js +6 -6
  633. package/icons/azure/instance-pools.js +22 -11
  634. package/icons/azure/integration-accounts.js +35 -13
  635. package/icons/azure/integration-environments.js +5 -5
  636. package/icons/azure/integration-service-environments.js +58 -26
  637. package/icons/azure/internet-analyzer-profiles.js +23 -12
  638. package/icons/azure/intune-app-protection.js +50 -17
  639. package/icons/azure/intune-for-education.js +48 -15
  640. package/icons/azure/intune-trends.js +29 -18
  641. package/icons/azure/intune.js +9 -9
  642. package/icons/azure/io-t-edge.js +15 -15
  643. package/icons/azure/io-t-hub.js +2 -2
  644. package/icons/azure/ip-address-manager.js +31 -20
  645. package/icons/azure/ip-groups.js +11 -5
  646. package/icons/azure/journey-hub.js +21 -21
  647. package/icons/azure/key-vaults.js +6 -6
  648. package/icons/azure/keys.js +7 -7
  649. package/icons/azure/kubernetes-services.js +126 -49
  650. package/icons/azure/lab-accounts.js +37 -15
  651. package/icons/azure/lab-services.js +7 -7
  652. package/icons/azure/language-understanding.js +20 -9
  653. package/icons/azure/language.js +10 -10
  654. package/icons/azure/launch-portal.js +19 -8
  655. package/icons/azure/learn.js +4 -4
  656. package/icons/azure/load-balancer-hub.js +20 -9
  657. package/icons/azure/load-balancers.js +4 -4
  658. package/icons/azure/load-test.js +27 -16
  659. package/icons/azure/load-testing.js +7 -7
  660. package/icons/azure/local-network-gateways.js +15 -4
  661. package/icons/azure/location.js +5 -5
  662. package/icons/azure/log-analytics-query-pack.js +21 -10
  663. package/icons/azure/log-analytics-workspaces.js +40 -18
  664. package/icons/azure/log-streaming.js +20 -9
  665. package/icons/azure/logic-apps-custom-connector.js +57 -24
  666. package/icons/azure/logic-apps.js +23 -12
  667. package/icons/azure/machine-learning-studio-classic-web-services.js +24 -13
  668. package/icons/azure/machine-learning-studio-web-service-plans.js +52 -30
  669. package/icons/azure/machine-learning-studio-workspaces.js +24 -13
  670. package/icons/azure/machine-learning.js +5 -5
  671. package/icons/azure/machines-azure-arc.js +12 -12
  672. package/icons/azure/maintenance-configuration.js +7 -7
  673. package/icons/azure/managed-applications-center.js +24 -13
  674. package/icons/azure/managed-database.js +47 -25
  675. package/icons/azure/managed-desktop.js +17 -17
  676. package/icons/azure/managed-file-shares.js +21 -21
  677. package/icons/azure/managed-identities.js +40 -18
  678. package/icons/azure/managed-instance-apache-cassandra.js +83 -32
  679. package/icons/azure/managed-service-fabric.js +30 -19
  680. package/icons/azure/management-groups.js +18 -7
  681. package/icons/azure/management-portal.js +19 -13
  682. package/icons/azure/marketplace-management.js +21 -10
  683. package/icons/azure/marketplace.js +17 -17
  684. package/icons/azure/med-tech-service.js +49 -27
  685. package/icons/azure/media-file.js +15 -15
  686. package/icons/azure/media.js +9 -9
  687. package/icons/azure/mesh-applications.js +7 -7
  688. package/icons/azure/metrics-advisor.js +18 -7
  689. package/icons/azure/metrics.js +11 -11
  690. package/icons/azure/microsoft-defender-easm.js +11 -11
  691. package/icons/azure/microsoft-defender-for-cloud.js +25 -14
  692. package/icons/azure/microsoft-defender-for-io-t.js +19 -8
  693. package/icons/azure/microsoft-dev-box.js +41 -41
  694. package/icons/azure/mindaro.js +20 -20
  695. package/icons/azure/mission-landing-zone.js +5 -5
  696. package/icons/azure/mobile-engagement.js +34 -23
  697. package/icons/azure/mobile-networks.js +18 -7
  698. package/icons/azure/mobile.js +7 -7
  699. package/icons/azure/modular-data-center.js +42 -20
  700. package/icons/azure/module.js +2 -2
  701. package/icons/azure/monitor-health-models.js +57 -24
  702. package/icons/azure/monitor.js +6 -6
  703. package/icons/azure/multi-tenancy.js +51 -18
  704. package/icons/azure/multifactor-authentication.js +16 -16
  705. package/icons/azure/my-customers.js +18 -18
  706. package/icons/azure/nat.js +13 -2
  707. package/icons/azure/network-interfaces.js +18 -7
  708. package/icons/azure/network-managers.js +18 -7
  709. package/icons/azure/network-security-groups.js +22 -11
  710. package/icons/azure/network-security-perimeters.js +40 -18
  711. package/icons/azure/network-watcher.js +2 -2
  712. package/icons/azure/notification-hub-namespaces.js +18 -7
  713. package/icons/azure/notification-hubs.js +4 -4
  714. package/icons/azure/offers.js +6 -6
  715. package/icons/azure/on-premises-data-gateways.js +18 -7
  716. package/icons/azure/open-supply-chain-platform.js +90 -33
  717. package/icons/azure/operation-log-classic.js +19 -8
  718. package/icons/azure/oracle-database.js +40 -18
  719. package/icons/azure/os-images-classic.js +37 -15
  720. package/icons/azure/osconfig.js +23 -12
  721. package/icons/azure/partner-namespace.js +5 -5
  722. package/icons/azure/partner-registration.js +35 -13
  723. package/icons/azure/partner-topic.js +20 -9
  724. package/icons/azure/peering-service.js +5 -5
  725. package/icons/azure/peerings.js +20 -9
  726. package/icons/azure/personalizers.js +69 -25
  727. package/icons/azure/plans.js +4 -4
  728. package/icons/azure/policy.js +2 -2
  729. package/icons/azure/power-bi-embedded.js +21 -21
  730. package/icons/azure/power-platform.js +22 -22
  731. package/icons/azure/power-up.js +2 -2
  732. package/icons/azure/power.js +5 -5
  733. package/icons/azure/powershell.js +14 -14
  734. package/icons/azure/preview-features.js +44 -22
  735. package/icons/azure/private-endpoints.js +34 -23
  736. package/icons/azure/private-link-service.js +7 -7
  737. package/icons/azure/private-link-services.js +24 -24
  738. package/icons/azure/private-link.js +7 -7
  739. package/icons/azure/production-ready-database.js +5 -5
  740. package/icons/azure/public-ip-addresses-classic.js +33 -16
  741. package/icons/azure/public-ip-addresses.js +15 -15
  742. package/icons/azure/public-ip-prefixes.js +59 -27
  743. package/icons/azure/qn-a-makers.js +21 -10
  744. package/icons/azure/quickstart-center.js +50 -28
  745. package/icons/azure/recent.js +23 -23
  746. package/icons/azure/recovery-services-vaults.js +44 -22
  747. package/icons/azure/region-management.js +4 -4
  748. package/icons/azure/relays.js +13 -13
  749. package/icons/azure/remote-rendering.js +25 -25
  750. package/icons/azure/reservations.js +20 -20
  751. package/icons/azure/reserved-ip-addresses-classic.js +27 -10
  752. package/icons/azure/resource-explorer.js +16 -16
  753. package/icons/azure/resource-graph-explorer.js +54 -21
  754. package/icons/azure/resource-group-list.js +7 -7
  755. package/icons/azure/resource-guard.js +6 -6
  756. package/icons/azure/resource-linked.js +23 -12
  757. package/icons/azure/resource-management-private-link.js +25 -8
  758. package/icons/azure/resources-provider.js +2 -2
  759. package/icons/azure/restore-points-collections.js +57 -24
  760. package/icons/azure/restore-points.js +57 -24
  761. package/icons/azure/route-filters.js +4 -4
  762. package/icons/azure/route-tables.js +40 -18
  763. package/icons/azure/rtos.js +8 -8
  764. package/icons/azure/savings-plans.js +37 -15
  765. package/icons/azure/scheduler-job-collections.js +2 -2
  766. package/icons/azure/scheduler.js +24 -24
  767. package/icons/azure/scvmm-management-servers.js +24 -13
  768. package/icons/azure/search-grid.js +5 -5
  769. package/icons/azure/search.js +4 -4
  770. package/icons/azure/security-baselines.js +20 -9
  771. package/icons/azure/security.js +4 -4
  772. package/icons/azure/send-grid-accounts.js +29 -12
  773. package/icons/azure/server-farm.js +38 -27
  774. package/icons/azure/serverless-search.js +33 -22
  775. package/icons/azure/service-catalog-mad.js +25 -8
  776. package/icons/azure/service-endpoint-policies.js +31 -20
  777. package/icons/azure/service-fabric-clusters.js +69 -25
  778. package/icons/azure/service-health.js +21 -10
  779. package/icons/azure/service-providers.js +54 -21
  780. package/icons/azure/shared-image-galleries.js +19 -8
  781. package/icons/azure/signal-r.js +7 -7
  782. package/icons/azure/software-as-a-service.js +41 -19
  783. package/icons/azure/software-updates.js +11 -11
  784. package/icons/azure/solutions.js +4 -4
  785. package/icons/azure/sonic-dash.js +35 -13
  786. package/icons/azure/spatial-anchor-accounts.js +73 -29
  787. package/icons/azure/speech-services.js +19 -8
  788. package/icons/azure/spot-vm.js +11 -11
  789. package/icons/azure/spot-vmss.js +23 -12
  790. package/icons/azure/sql-data-warehouses.js +50 -22
  791. package/icons/azure/sql-database.js +28 -17
  792. package/icons/azure/sql-elastic-pools.js +17 -6
  793. package/icons/azure/sql-managed-instance.js +46 -24
  794. package/icons/azure/sql-server-registries.js +42 -31
  795. package/icons/azure/sql-server.js +5 -5
  796. package/icons/azure/ssd.js +11 -5
  797. package/icons/azure/ssh-keys.js +9 -9
  798. package/icons/azure/ssis-lift-and-shift-ir.js +19 -19
  799. package/icons/azure/stack-hci-premium.js +99 -33
  800. package/icons/azure/static-apps.js +6 -6
  801. package/icons/azure/stor-simple-data-managers.js +2 -2
  802. package/icons/azure/stor-simple-device-managers.js +30 -19
  803. package/icons/azure/storage-accounts-classic.js +27 -10
  804. package/icons/azure/storage-accounts.js +5 -5
  805. package/icons/azure/storage-actions.js +44 -22
  806. package/icons/azure/storage-azure-files.js +26 -9
  807. package/icons/azure/storage-container.js +11 -5
  808. package/icons/azure/storage-explorer.js +29 -18
  809. package/icons/azure/storage-functions.js +26 -9
  810. package/icons/azure/storage-queue.js +8 -2
  811. package/icons/azure/storage-sync-services.js +42 -20
  812. package/icons/azure/stream-analytics-jobs.js +5 -5
  813. package/icons/azure/subnet.js +15 -15
  814. package/icons/azure/subscriptions.js +5 -5
  815. package/icons/azure/system-topic.js +107 -28
  816. package/icons/azure/table.js +5 -5
  817. package/icons/azure/tag.js +4 -4
  818. package/icons/azure/tags.js +5 -5
  819. package/icons/azure/targets-management.js +21 -10
  820. package/icons/azure/template-specs.js +5 -5
  821. package/icons/azure/templates.js +4 -4
  822. package/icons/azure/tenant-properties.js +60 -21
  823. package/icons/azure/tenant-status.js +7 -7
  824. package/icons/azure/test-base.js +7 -7
  825. package/icons/azure/tfs-vc-repository.js +87 -32
  826. package/icons/azure/time-series-data-sets.js +35 -24
  827. package/icons/azure/time-series-insights-access-policies.js +15 -15
  828. package/icons/azure/time-series-insights-environments.js +13 -13
  829. package/icons/azure/time-series-insights-event-sources.js +36 -15
  830. package/icons/azure/toolbox.js +5 -5
  831. package/icons/azure/traffic-manager-profiles.js +23 -12
  832. package/icons/azure/translator-text.js +9 -9
  833. package/icons/azure/troubleshoot.js +9 -9
  834. package/icons/azure/universal-print.js +57 -18
  835. package/icons/azure/update-management-center.js +106 -40
  836. package/icons/azure/updates.js +6 -6
  837. package/icons/azure/user-privacy.js +33 -22
  838. package/icons/azure/user-settings.js +40 -18
  839. package/icons/azure/user-subscriptions.js +46 -24
  840. package/icons/azure/users.js +14 -14
  841. package/icons/azure/verifiable-credentials.js +32 -32
  842. package/icons/azure/verification-as-a-service.js +13 -13
  843. package/icons/azure/versions.js +18 -18
  844. package/icons/azure/video-analyzers.js +6 -6
  845. package/icons/azure/virtual-clusters.js +41 -19
  846. package/icons/azure/virtual-enclaves.js +4 -4
  847. package/icons/azure/virtual-instance-for-sap.js +27 -16
  848. package/icons/azure/virtual-machine.js +35 -13
  849. package/icons/azure/virtual-machines-classic.js +37 -15
  850. package/icons/azure/virtual-network-gateways.js +23 -12
  851. package/icons/azure/virtual-networks-classic.js +44 -22
  852. package/icons/azure/virtual-networks.js +46 -24
  853. package/icons/azure/virtual-router.js +2 -2
  854. package/icons/azure/virtual-visits-builder.js +17 -11
  855. package/icons/azure/virtual-wan-hub.js +26 -9
  856. package/icons/azure/virtual-wans.js +4 -4
  857. package/icons/azure/vm-app-definitions.js +7 -7
  858. package/icons/azure/vm-app-versions.js +59 -26
  859. package/icons/azure/vm-image-version.js +77 -33
  860. package/icons/azure/vm-images-classic.js +37 -15
  861. package/icons/azure/vm-scale-sets.js +34 -12
  862. package/icons/azure/wac-installer.js +31 -14
  863. package/icons/azure/wac.js +9 -9
  864. package/icons/azure/web-app-database.js +63 -46
  865. package/icons/azure/web-application-firewall-policies-waf.js +16 -10
  866. package/icons/azure/web-jobs.js +16 -16
  867. package/icons/azure/web-slots.js +4 -4
  868. package/icons/azure/web-test.js +54 -37
  869. package/icons/azure/website-power.js +55 -27
  870. package/icons/azure/website-staging.js +4 -4
  871. package/icons/azure/windows-notification-services.js +34 -23
  872. package/icons/azure/windows10-core-services.js +24 -13
  873. package/icons/azure/workbooks.js +2 -2
  874. package/icons/azure/worker-container-app.js +34 -12
  875. package/icons/azure/workflow.js +33 -22
  876. package/icons/azure/workspace-gateway.js +47 -25
  877. package/icons/azure/workspaces.js +4 -4
  878. package/icons/gcp/advanced-solutions-lab.js +72 -36
  879. package/icons/gcp/ai-hub.js +8 -8
  880. package/icons/gcp/api-analytics.js +6 -6
  881. package/icons/gcp/api-monetization.js +11 -11
  882. package/icons/gcp/apigee-api-platform.js +11 -11
  883. package/icons/gcp/app-engine.js +9 -9
  884. package/icons/gcp/assured-workloads.js +19 -13
  885. package/icons/gcp/auto-ml-tables.js +2 -2
  886. package/icons/gcp/auto-ml-translation.js +4 -4
  887. package/icons/gcp/auto-ml-video-intelligence.js +5 -5
  888. package/icons/gcp/auto-ml-vision.js +8 -8
  889. package/icons/gcp/auto-ml.js +5 -5
  890. package/icons/gcp/big-query.js +12 -12
  891. package/icons/gcp/bigtable.js +19 -19
  892. package/icons/gcp/cloud-apis.js +11 -11
  893. package/icons/gcp/cloud-armor.js +13 -13
  894. package/icons/gcp/cloud-audit-logs.js +31 -16
  895. package/icons/gcp/cloud-build.js +5 -5
  896. package/icons/gcp/cloud-cdn.js +16 -16
  897. package/icons/gcp/cloud-code.js +10 -10
  898. package/icons/gcp/cloud-composer.js +15 -9
  899. package/icons/gcp/cloud-data-fusion.js +8 -8
  900. package/icons/gcp/cloud-deployment-manager.js +13 -13
  901. package/icons/gcp/cloud-dns.js +13 -13
  902. package/icons/gcp/cloud-endpoints.js +21 -13
  903. package/icons/gcp/cloud-firewall-rules.js +7 -7
  904. package/icons/gcp/cloud-functions.js +37 -17
  905. package/icons/gcp/cloud-gpu.js +7 -7
  906. package/icons/gcp/cloud-healthcare-api.js +42 -9
  907. package/icons/gcp/cloud-hsm.js +15 -9
  908. package/icons/gcp/cloud-interconnect.js +11 -11
  909. package/icons/gcp/cloud-jobs-api.js +10 -10
  910. package/icons/gcp/cloud-load-balancing.js +13 -13
  911. package/icons/gcp/cloud-logging.js +30 -14
  912. package/icons/gcp/cloud-monitoring.js +12 -12
  913. package/icons/gcp/cloud-nat.js +12 -12
  914. package/icons/gcp/cloud-natural-language-api.js +34 -11
  915. package/icons/gcp/cloud-network.js +19 -13
  916. package/icons/gcp/cloud-optimization-ai-fleet-routing-api.js +32 -20
  917. package/icons/gcp/cloud-routes.js +5 -5
  918. package/icons/gcp/cloud-run.js +7 -7
  919. package/icons/gcp/cloud-scheduler.js +22 -9
  920. package/icons/gcp/cloud-spanner.js +6 -6
  921. package/icons/gcp/cloud-sql.js +9 -9
  922. package/icons/gcp/cloud-storage.js +16 -16
  923. package/icons/gcp/cloud-tasks.js +92 -20
  924. package/icons/gcp/cloud-test-lab.js +13 -13
  925. package/icons/gcp/cloud-tpu.js +64 -26
  926. package/icons/gcp/cloud-vision-api.js +36 -12
  927. package/icons/gcp/cloud-vpn.js +11 -11
  928. package/icons/gcp/compute-engine.js +19 -13
  929. package/icons/gcp/container-registry.js +114 -23
  930. package/icons/gcp/data-catalog.js +11 -11
  931. package/icons/gcp/data-labeling.js +27 -15
  932. package/icons/gcp/data-loss-prevention-api.js +19 -13
  933. package/icons/gcp/data-studio.js +24 -12
  934. package/icons/gcp/dataflow.js +22 -16
  935. package/icons/gcp/datapol.js +41 -20
  936. package/icons/gcp/dataprep.js +8 -8
  937. package/icons/gcp/dataproc.js +14 -14
  938. package/icons/gcp/datastore.js +35 -35
  939. package/icons/gcp/developer-portal.js +7 -7
  940. package/icons/gcp/error-reporting.js +38 -10
  941. package/icons/gcp/filestore.js +15 -7
  942. package/icons/gcp/firestore.js +25 -9
  943. package/icons/gcp/genomics.js +19 -19
  944. package/icons/gcp/google-kubernetes-engine.js +13 -13
  945. package/icons/gcp/identity-aware-proxy.js +12 -12
  946. package/icons/gcp/identity-platform.js +12 -12
  947. package/icons/gcp/iot-edge.js +35 -35
  948. package/icons/gcp/key-access-justifications.js +7 -7
  949. package/icons/gcp/kuberun.js +2 -2
  950. package/icons/gcp/managed-service-for-microsoft-active-directory.js +49 -14
  951. package/icons/gcp/memorystore.js +12 -12
  952. package/icons/gcp/my-cloud.js +5 -5
  953. package/icons/gcp/network-security.js +18 -12
  954. package/icons/gcp/network-tiers.js +44 -14
  955. package/icons/gcp/os-inventory-management.js +7 -7
  956. package/icons/gcp/partner-interconnect.js +12 -12
  957. package/icons/gcp/phishing-protection.js +27 -15
  958. package/icons/gcp/premium-network-tier.js +10 -10
  959. package/icons/gcp/profiler.js +15 -7
  960. package/icons/gcp/pub-sub.js +23 -23
  961. package/icons/gcp/quantum-engine.js +6 -6
  962. package/icons/gcp/quotas.js +32 -16
  963. package/icons/gcp/recommendations-ai.js +48 -16
  964. package/icons/gcp/runtime-config.js +31 -15
  965. package/icons/gcp/security-command-center.js +8 -8
  966. package/icons/gcp/security-health-advisor.js +26 -8
  967. package/icons/gcp/service-discovery.js +34 -24
  968. package/icons/gcp/speech-to-text.js +89 -17
  969. package/icons/gcp/text-to-speech.js +8 -8
  970. package/icons/gcp/tools-for-powershell.js +11 -11
  971. package/icons/gcp/trace.js +11 -11
  972. package/icons/gcp/traffic-director.js +38 -14
  973. package/icons/gcp/transfer-appliance.js +19 -7
  974. package/icons/gcp/virtual-private-cloud.js +21 -15
  975. package/icons/gcp/web-risk.js +43 -15
  976. package/icons/gcp/web-security-scanner.js +10 -10
  977. package/icons/tech/aarch64.js +2 -2
  978. package/icons/tech/ant-design.js +10 -10
  979. package/icons/tech/apache.js +119 -53
  980. package/icons/tech/apple-safari.js +5 -5
  981. package/icons/tech/argo-cd.js +21 -21
  982. package/icons/tech/astro.js +15 -15
  983. package/icons/tech/autodesk-maya.js +140 -51
  984. package/icons/tech/azure-devops.js +2 -2
  985. package/icons/tech/azure-sql-database.js +7 -7
  986. package/icons/tech/azure.js +11 -11
  987. package/icons/tech/bamboo.js +11 -11
  988. package/icons/tech/behance.js +2 -2
  989. package/icons/tech/bitbucket.js +2 -2
  990. package/icons/tech/bootstrap.js +27 -27
  991. package/icons/tech/chrome.js +25 -25
  992. package/icons/tech/clion.js +8 -8
  993. package/icons/tech/cloudflare-workers.js +53 -53
  994. package/icons/tech/confluence.js +11 -11
  995. package/icons/tech/d3js.js +40 -40
  996. package/icons/tech/data-grip.js +38 -38
  997. package/icons/tech/data-spell.js +32 -32
  998. package/icons/tech/dropwizard.js +24 -24
  999. package/icons/tech/eclipse-ceylon.js +4 -4
  1000. package/icons/tech/eclipse-ide.js +31 -25
  1001. package/icons/tech/elixir.js +25 -25
  1002. package/icons/tech/file-zilla.js +19 -8
  1003. package/icons/tech/firefox.js +206 -182
  1004. package/icons/tech/flutter.js +2 -2
  1005. package/icons/tech/gimp.js +55 -43
  1006. package/icons/tech/github-codespaces.js +24 -24
  1007. package/icons/tech/gitpod.js +5 -5
  1008. package/icons/tech/go-land.js +15 -9
  1009. package/icons/tech/go.js +46 -37
  1010. package/icons/tech/grafana.js +5 -5
  1011. package/icons/tech/hardhat.js +6 -6
  1012. package/icons/tech/inkscape.js +192 -153
  1013. package/icons/tech/insomnia.js +10 -10
  1014. package/icons/tech/intellij-idea.js +9 -9
  1015. package/icons/tech/jeet.js +68 -40
  1016. package/icons/tech/jekyll.js +87 -42
  1017. package/icons/tech/jetbrains.js +34 -34
  1018. package/icons/tech/jira-align.js +18 -18
  1019. package/icons/tech/jira.js +18 -18
  1020. package/icons/tech/json.js +6 -6
  1021. package/icons/tech/kotlin.js +4 -4
  1022. package/icons/tech/ktor.js +7 -7
  1023. package/icons/tech/linux.js +47 -47
  1024. package/icons/tech/matlab.js +4 -4
  1025. package/icons/tech/maven.js +66 -66
  1026. package/icons/tech/minitab.js +5 -5
  1027. package/icons/tech/modx.js +14 -7
  1028. package/icons/tech/moodle.js +17 -11
  1029. package/icons/tech/nerog.js +35 -35
  1030. package/icons/tech/net.js +36 -36
  1031. package/icons/tech/ocaml.js +29 -29
  1032. package/icons/tech/opera.js +15 -15
  1033. package/icons/tech/photon-engine.js +2 -2
  1034. package/icons/tech/php-storm.js +23 -11
  1035. package/icons/tech/php.js +2 -2
  1036. package/icons/tech/powershell.js +7 -7
  1037. package/icons/tech/processing.js +5 -5
  1038. package/icons/tech/pycharm.js +10 -10
  1039. package/icons/tech/python-poetry.js +14 -14
  1040. package/icons/tech/python.js +13 -13
  1041. package/icons/tech/qodana.js +9 -9
  1042. package/icons/tech/r.js +4 -4
  1043. package/icons/tech/ren-py.js +202 -196
  1044. package/icons/tech/rider.js +12 -6
  1045. package/icons/tech/rollup-js.js +20 -20
  1046. package/icons/tech/ruby-mine.js +6 -6
  1047. package/icons/tech/ruby.js +38 -32
  1048. package/icons/tech/sdl.js +5 -5
  1049. package/icons/tech/solid-js.js +30 -30
  1050. package/icons/tech/sqlite.js +7 -7
  1051. package/icons/tech/tower.js +164 -152
  1052. package/icons/tech/v8.js +29 -29
  1053. package/icons/tech/vala.js +21 -21
  1054. package/icons/tech/vitejs.js +16 -16
  1055. package/icons/tech/vscode.js +11 -11
  1056. package/icons/tech/weblate.js +23 -23
  1057. package/icons/tech/webstorm.js +12 -12
  1058. package/icons/tech/xcode.js +331 -283
  1059. package/package.json +21 -21
  1060. package/react/index.d.ts +28 -6
  1061. package/react/index.mjs +190 -131
  1062. package/react/style.css +1 -1
  1063. package/dist/shared/likec4.CZCHc9Ry.mjs +0 -1816
  1064. package/icons/azure/arc-postgre-sql.js +0 -62
@@ -0,0 +1,1824 @@
1
+ import*as z0 from"node:fs";import{writeFileSync as B0,statSync as aO,readFileSync as ug,appendFileSync as cO,createReadStream as q0,createWriteStream as j0,existsSync as uO}from"node:fs";import Zr,{sep as lO,resolve as dO,basename as fO}from"node:path";import{fileURLToPath as lg,pathToFileURL as hO}from"node:url";import{isatty as pO}from"tty";import{Graphviz as dg}from"@hpcc-js/wasm-graphviz";import*as gO from"node:util";import{formatWithOptions as mO,debuglog as yO,stripVTControlCharacters as vO,inspect as U0,promisify as wO,callbackify as Do,aborted as bO}from"node:util";import Ne,{platform as EO,hrtime as ld,execPath as DO,execArgv as TO}from"node:process";import*as fg from"node:tty";import G0 from"node:tty";import{ChildProcess as W0,spawnSync as RO,spawn as SO}from"node:child_process";import{StringDecoder as H0}from"node:string_decoder";import*as kO from"child_process";import*as $O from"path";import*as CO from"fs";import{setTimeout as V0,scheduler as K0,setImmediate as _O}from"node:timers/promises";import{constants as bs}from"node:os";import{once as vn,addAbortListener as Y0,EventEmitter as AO,on as dd,setMaxListeners as xO}from"node:events";import{serialize as IO}from"node:v8";import{Transform as PO,getDefaultHighWaterMark as fd,PassThrough as X0,Readable as Es,Writable as hg,Duplex as pg}from"node:stream";import{Buffer as gg}from"node:buffer";import{finished as Ii}from"node:stream/promises";import{createLogger as NO}from"vite";import{Buffer as mg}from"buffer";import*as OO from"util";import*as FO from"os";import*as LO from"crypto";import*as MO from"net";import*as zO from"url";function BO(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function sr(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return BO(t,e,n);throw new Error("Wrong number of arguments")}function qO(t){return e=>!t(e)}function Pi(t){return t==null}function J0(t){return Array.isArray(t)}function jO(...t){return sr(UO,t)}var UO=(t,e)=>e.every(n=>n(t));function GO(...t){return sr(WO,t)}var WO=(t,e)=>e.some(n=>n(t));function Ze(t,e){if(typeof t>"u"||t==null)throw new Error(e??`Expected defined value, but received ${t}`);return t}function we(t,e){if(!t)throw new Error(e??"Invariant failed")}function Ie(t){throw new Error(`NonExhaustive value: ${t}`)}function HO(t,e){return e?e+"."+t:t}const VO=["solid","dashed","dotted","none"];var To;(t=>{t.Group="@group"})(To||(To={}));const KO=["rectangle","person","browser","mobile","cylinder","storage","queue"],Na="primary",yg="rectangle";function Z0(t){return"element"in t}function Q0(t){return"expanded"in t}function eE(t){return"custom"in t&&(hd(t.custom.expr)||vg(t.custom.expr))}function tE(t){return"wildcard"in t}function nE(t){return"elementKind"in t&&"isEqual"in t}function rE(t){return"elementTag"in t&&"isEqual"in t}function hd(t){return Z0(t)||tE(t)||nE(t)||rE(t)||Q0(t)}function vg(t){return"where"in t&&hd(t.where.expr)}function iE(t){return hd(t)||vg(t)||eE(t)}function sE(t){return"source"in t&&"target"in t}function oE(t){return"inout"in t}function aE(t){return"incoming"in t}function cE(t){return"outgoing"in t}function wg(t){return sE(t)||oE(t)||aE(t)||cE(t)}function uE(t){return"where"in t&&wg(t.where.expr)}function lE(t){return"customRelation"in t}function YO(t){return wg(t)||uE(t)||lE(t)}const ye={__proto__:null,isCustomElement:eE,isCustomRelationExpr:lE,isElement:hd,isElementKindExpr:nE,isElementPredicateExpr:iE,isElementRef:Z0,isElementTagExpr:rE,isElementWhere:vg,isExpandedElementExpr:Q0,isInOut:oE,isIncoming:aE,isOutgoing:cE,isRelation:sE,isRelationExpression:wg,isRelationPredicateExpr:YO,isRelationWhere:uE,isWildcard:tE},XO=t=>"tag"in t,JO=t=>"kind"in t,ZO=t=>"not"in t,bg=t=>"and"in t,Eg=t=>"or"in t;function Ro(t){switch(!0){case XO(t):{if("eq"in t.tag){const n=t.tag.eq;return r=>Array.isArray(r.tags)&&r.tags.includes(n)}const e=t.tag.neq;return n=>!Array.isArray(n.tags)||!n.tags.includes(e)}case JO(t):{if("eq"in t.kind){const n=t.kind.eq;return r=>r.kind===n}const e=t.kind.neq;return n=>Pi(n.kind)||n.kind!==e}case ZO(t):{const e=Ro(t.not);return qO(e)}case bg(t):{const e=t.and.map(Ro);return jO(e)}case Eg(t):{const e=t.or.map(Ro);return GO(e)}default:Ie(t)}}const dE="dashed",So="normal",Ds="gray",QO=["amber","blue","gray","slate","green","indigo","muted","primary","red","secondary","sky"];function fE(t){return t in QO}function hE(t){return"include"in t&&Array.isArray(t.include)||"exclude"in t&&Array.isArray(t.exclude)}function e2(t){return"style"in t&&"targets"in t}function pE(t){return"styleId"in t}function t2(t){return t==="TB"||t==="BT"||t==="LR"||t==="RL"}function gE(t){return"direction"in t}function Dg(t){return"title"in t&&"groupRules"in t&&Array.isArray(t.groupRules)}function n2(t){return"include"in t&&Array.isArray(t.include)}function r2(t){return"__parallel"in t&&J0(t.__parallel)}function i2(t){return t.__==="dynamic"}function Oa(t){return Pi(t.__)||t.__==="element"}function mE(t){return Oa(t)&&"extends"in t}function Tg(t){return Oa(t)&&"viewOf"in t}function yE(t,e){const n=`step-${String(t).padStart(2,"0")}`;return e?`${n}.${e}`:n}function vE(t){return t.startsWith("step-")}function wE(t){if(!vE(t))throw new Error(`Invalid step edge id: ${t}`);return parseFloat(t.slice(5))}var pd;(t=>{function e(n){return n.kind===To.Group}t.isNodesGroup=e})(pd||(pd={}));function Rg(t){return t.__==="dynamic"}function s2(t){return Pi(t.__)||t.__==="element"}var bE;(t=>{function e(n){return n.kind===To.Group}t.isNodesGroup=e})(bE||(bE={}));function Sg(t){if(t===null||typeof t!="object")return!1;const e=Object.getPrototypeOf(t);return e!==null&&e!==Object.prototype&&Object.getPrototypeOf(e)!==null||Symbol.iterator in t?!1:Symbol.toStringTag in t?Object.prototype.toString.call(t)==="[object Module]":!0}function kg(t,e,n=".",r){if(!Sg(e))return kg(t,{},n,r);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(r&&r(i,s,o,n)||(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:Sg(o)&&Sg(i[s])?i[s]=kg(o,i[s],(n?`${n}.`:"")+s.toString(),r):i[s]=o))}return i}function o2(t){return(...e)=>e.reduce((n,r)=>kg(n,r,"",t),{})}const Fa=o2();var a2={done:!1,hasNext:!1};function c2(t,...e){let n=t,r=e.map(s=>"lazy"in s?u2(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!l2(n)){let c=e[i];n=c(n),i+=1;continue}let s=[];for(let c=i;c<e.length;c++){let u=r[c];if(u===void 0||(s.push(u),u.isSingle))break}let o=[];for(let c of n)if(EE(c,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function EE(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=a2,s=!1;for(let[o,a]of n.entries()){let{index:c,items:u}=a;if(u.push(r),i=a(r,c,u),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(EE(l,e,n.slice(o+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function u2(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function l2(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function La(...t){return sr(Object.values,t)}function d2(...t){return sr(f2,t,h2)}var f2=(t,e)=>t.length<e.length?t.map((n,r)=>[n,e[r]]):e.map((n,r)=>[t[r],n]),h2=t=>(e,n)=>({hasNext:!0,next:[e,t[n]],done:n>=t.length-1});function p2(...t){return sr(g2,t)}function g2(t,e){let n=[];for(let[r,i]of t.entries()){if(!e(i,r,t))break;n.push(i)}return n}function gd(...t){return sr(m2,t)}var m2=(t,e)=>t.length>=e;function y2(t,e){let n=Math.ceil(t),r=Math.floor(e);if(r<n)throw new RangeError(`randomInteger: The range [${t.toString()},${e.toString()}] contains no integer`);return Math.floor(Math.random()*(r-n+1)+n)}function v2(...t){return sr(w2,t)}function w2(t,e){let n={};for(let[r,i]of Object.entries(t))e(i,r,t)&&(n[r]=i);return n}function md(...t){return sr(b2,t,E2)}var b2=(t,e)=>t.map(e),E2=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function DE(...t){return sr(D2,t)}function D2(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function T2(...t){return sr(R2,t)}function R2(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function Ts(t){return typeof t=="string"}function TE(t){return!!t}function RE(t){return typeof t=="function"}function S2(t){return t!=null}function SE(...t){return sr(Object.fromEntries,t)}function k2(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $g={exports:{}},kE;function $2(){if(kE)return $g.exports;kE=1;var t=function(e,n){var r,i,s=1,o=0,a=0,c=String.alphabet;function u(l,d,f){if(f){for(r=d;f=u(l,r),f<76&&f>65;)++r;return+l.slice(d-1,r)}return f=c&&c.indexOf(l.charAt(d)),f>-1?f+76:(f=l.charCodeAt(d)||0,f<45||f>127?f:f<46?65:f<48?f-1:f<58?f+18:f<65?f-11:f<91?f+11:f<97?f-37:f<123?f+5:f-63)}if((e+="")!=(n+="")){for(;s;)if(i=u(e,o++),s=u(n,a++),i<76&&s<76&&i>66&&s>66&&(i=u(e,o,o),s=u(n,a,o=r),a=r),i!=s)return i<s?-1:1}return 0};try{$g.exports=t}catch{String.naturalCompare=t}return $g.exports}var C2=$2();const _2=k2(C2);function yd(t,e){return t===e?0:Ts(t)?Ts(e)?_2(t,e):1:Ts(e)?-1:0}function vd(t){return t!=null&&typeof t=="string"}function Rs(t){return!!t&&Array.isArray(t)&&t.length>0}function ko(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1):t}function Cr(...t){const e=vd(t[0])?t[0]:t[0].id;return(vd(t[1])?t[1]:t[1].id).startsWith(e+".")}function Ma(t,e){const n=vd(t)?t:t.id,r=vd(e)?e:e.id;return n===r||r.startsWith(n+".")||n.startsWith(r+".")}function A2(t){const e=t.flatMap(n=>[r=>r.id===n.id,r=>Cr(n,r)]);return n=>e.some(r=>r(n))}function Ss(t,e){const n=kt(t),r=kt(e);if(n===r)return n;if(!n||!r)return null;const i=t.split("."),s=e.split(".");let o=null;for(;i.length>1&&s.length>1&&i[0]&&i[0]===s[0];)o=o?`${o}.${i[0]}`:i[0],i.shift(),s.shift();return o}function kt(t){const e=t.lastIndexOf(".");return e>0?t.slice(0,e):null}function $E(t){const e=t+".";return n=>!!n.parent&&(n.parent===t||n.parent.startsWith(e))}function Qr(t){const e=t.split(".");return e.pop(),e.length===0?[]:e.reduce((n,r,i)=>i===0?(n.push(r),n):(n.unshift(`${n[0]}.${r}`),n),[])}function $o(t,e){const n=t.split(".").length,r=e.split(".").length;switch(!0){case n>r:return 1;case n<r:return-1;default:return 0}}function za(t,e){return $o(t.id,e.id)}function x2(t){return t.map(e=>({item:e,fqn:e.id.split(".")})).sort((e,n)=>e.fqn.length-n.fqn.length).map(({item:e})=>e)}function Ba(t){if(Ts(t)){const e=t;switch(!0){case e.startsWith("tag is not #"):return{tag:{neq:e.replace("tag is not #","")}};case e.startsWith("tag is #"):return{tag:{eq:e.replace("tag is #","")}};case e.startsWith("kind is not "):return{kind:{neq:e.replace("kind is not ","")}};case e.startsWith("kind is "):return{kind:{eq:e.replace("kind is ","")}};default:throw new Error(`Unknown where operator: ${t}`)}}if(t.and)return{and:md(t.and,Ba)};if(t.or)return{or:md(t.or,Ba)};if(t.not)return{not:Ba(t.not)};throw new Error(`Unknown where operator: ${t}`)}function I2(...t){return e=>{let n=or(t[0]);const r=iE(n);if(t.length===2){const i=t[1].where?Ba(t[1].where):void 0;i&&(n={where:{expr:n,condition:i}});const s=t[1].with;s&&(r?n={custom:{...s,expr:n}}:n={customRelation:{...s,relation:n}})}return e.include(n),e}}function P2(...t){return e=>{let n=or(t[0]);if(t.length===2&&t[1].where){const r=Ba(t[1].where);n={where:{expr:n,condition:r}}}return e.exclude(n),e}}function or(t){if(!Ts(t))return t;if(t==="*")return{wildcard:!0};if(t.startsWith("->"))return t.endsWith("->")?{inout:or(t.replace(/->/g,"").trim())}:{incoming:or(t.replace("-> ",""))};if(t.endsWith(" ->"))return{outgoing:or(t.replace(" ->",""))};if(t.includes(" <-> ")){const[e,n]=t.split(" <-> ");return{source:or(e),target:or(n),isBidirectional:!0}}if(t.includes(" -> ")){const[e,n]=t.split(" -> ");return{source:or(e),target:or(n)}}return t.endsWith("._")?{expanded:t.replace("._","")}:t.endsWith(".*")?{element:t.replace(".*",""),isDescedants:!0}:{element:t,isDescedants:!1}}function N2(t,{notation:e,...n}){return r=>r.style({targets:(J0(t)?t:[t]).map(i=>or(i)),...e?{notation:e}:{},style:{...n}})}function O2(t){return e=>e.autoLayout(t)}function F2(...t){return e=>t.reduce((n,r)=>r(n),e)}function CE(t,e=new Map,n=[],r={styles:[]},i=new Map){const s=()=>({tags:t.tags??[],elements:{...t.elements},relationships:{...t.relationships}}),o=u=>!u||!gd(u,1)?null:md(u,l=>typeof l=="string"?{url:l}:l),a=u=>{const l={autoLayout(d){return u.rules.push({direction:d}),l},exclude(d){return u.rules.push({exclude:[d]}),l},include(d){return u.rules.push({include:[d]}),l},style(d){return u.rules.push(d),l}};return l},c={get Types(){throw new Error("Types are not available in runtime")},clone:()=>CE(structuredClone(t),structuredClone(e),structuredClone(n),structuredClone(r),structuredClone(i)),__model:()=>({addElement:u=>{const l=kt(u.id);if(l&&we(e.get(l),`Parent element with id "${l}" not found for element with id "${u.id}"`),e.has(u.id))throw new Error(`Element with id "${u.id}" already exists`);return e.set(u.id,u),c},addRelation(u){const l=e.get(u.source);we(l,`Element with id "${u.source}" not found`);const d=e.get(u.target);return we(d,`Element with id "${u.target}" not found`),we(!Ma(l,d),"Cannot create relationship between elements in the same hierarchy"),n.push({id:`rel${n.length+1}`,...u}),c},fqn(u){return u},addSourcelessRelation(){throw new Error("Can be called only in nested model")}}),__views:()=>({addView:u=>(Tg(u)&&we(e.get(u.viewOf),`Invalid view ${u.id}, wlement with id "${u.viewOf}" not found`),i.set(u.id,u),c)}),build:()=>({specification:s(),elements:SE(Array.from(e.entries())),relations:DE(n,u=>[u.id,u]),globals:{styles:DE(r.styles,u=>[u.id,u])},views:SE(Array.from(i.entries()))}),helpers:()=>({model:{model:(...u)=>l=>{const d=l.__model();for(const f of u)f(d);return l},rel:(u,l,d)=>f=>{const{title:h="",links:p=[],...g}=Fa(typeof d=="string"?{title:d}:{...d},{title:null,links:null}),y=o(p);return f.addRelation({source:u,target:l,title:h,...y&&{links:y},...g}),f},relTo:(u,l)=>d=>{const{title:f="",links:h=[],...p}=Fa(typeof l=="string"?{title:l}:{...l},{title:null,links:null}),g=o(h);return d.addSourcelessRelation({target:u,title:f,...g&&{links:g},...p}),d},...T2(t.elements,({style:u,...l},d)=>(f,h)=>{const p=g=>{const{links:y,icon:m,style:w,title:E,...k}=typeof h=="string"?{title:h}:{...h},A=o(y),I=m??u?.icon,x=g.fqn(f);return g.addElement({id:x,kind:d,title:E??ko(x),description:null,technology:null,tags:null,color:u?.color??Na,shape:u?.shape??yg,style:v2({border:u?.border,opacity:u?.opacity,...w},S2),links:A,...I&&{icon:I},...l,...k}),g};return p.with=(...g)=>y=>{p(y);const m={...y,fqn:w=>`${y.fqn(f)}.${w}`,addSourcelessRelation:w=>y.addRelation({...w,source:y.fqn(f)})};for(const w of g)w(m);return y},p})},views:{views:(...u)=>l=>{const d=l.__views();for(const f of u)f(d);return l},view:(u,l,d)=>(RE(l)&&(d=l,l={}),f=>{const{links:h=[],title:p=null,...g}=typeof l=="string"?{title:l}:{...l},y=o(h),m={id:u,__:"element",title:p,description:null,tags:null,rules:[],links:y,customColorDefinitions:{},...g};return f.addView(m),d&&d(a(m)),f}),viewOf:(u,l,d,f)=>(RE(d)&&(f=d,d={}),h=>{const{links:p=[],title:g=null,...y}=typeof d=="string"?{title:d}:{...d},m=o(p),w={id:u,__:"element",viewOf:l,title:g,description:null,tags:null,rules:[],links:m,customColorDefinitions:{},...y};return h.addView(w),f&&f(a(w)),h}),$autoLayout:O2,$exclude:P2,$expr:or,$include:I2,$rules:F2,$style:N2}}),with:(...u)=>u.reduce((l,d)=>d(l),c).clone()};return c}var Cg;(t=>{function e(n){const r=CE(n);return{...r.helpers(),builder:r}}t.forSpecification=e})(Cg||(Cg={}));const{min:L2,max:M2}=Math,ks=(t,e=0,n=1)=>L2(M2(e,t),n),_g=t=>{t._clipped=!1,t._unclipped=t.slice(0);for(let e=0;e<=3;e++)e<3?((t[e]<0||t[e]>255)&&(t._clipped=!0),t[e]=ks(t[e],0,255)):e===3&&(t[e]=ks(t[e],0,1));return t},_E={};for(let t of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])_E[`[object ${t}]`]=t.toLowerCase();function Ae(t){return _E[Object.prototype.toString.call(t)]||"object"}const Se=(t,e=null)=>t.length>=3?Array.prototype.slice.call(t):Ae(t[0])=="object"&&e?e.split("").filter(n=>t[0][n]!==void 0).map(n=>t[0][n]):t[0].slice(0),Co=t=>{if(t.length<2)return null;const e=t.length-1;return Ae(t[e])=="string"?t[e].toLowerCase():null},{PI:wd,min:AE,max:xE}=Math,jn=t=>Math.round(t*100)/100,Ag=t=>Math.round(t*100)/100,ei=wd*2,xg=wd/3,z2=wd/180,B2=180/wd;function IE(t){return[...t.slice(0,3).reverse(),...t.slice(3)]}const Re={format:{},autodetect:[]};class re{constructor(...e){const n=this;if(Ae(e[0])==="object"&&e[0].constructor&&e[0].constructor===this.constructor)return e[0];let r=Co(e),i=!1;if(!r){i=!0,Re.sorted||(Re.autodetect=Re.autodetect.sort((s,o)=>o.p-s.p),Re.sorted=!0);for(let s of Re.autodetect)if(r=s.test(...e),r)break}if(Re.format[r]){const s=Re.format[r].apply(null,i?e:e.slice(0,-1));n._rgb=_g(s)}else throw new Error("unknown format: "+e);n._rgb.length===3&&n._rgb.push(1)}toString(){return Ae(this.hex)=="function"?this.hex():`[${this._rgb.join(",")}]`}}const q2="3.1.2",Pe=(...t)=>new re(...t);Pe.version=q2;const _o={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",cyan:"#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",laserlemon:"#ffff54",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrod:"#fafad2",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",maroon2:"#7f0000",maroon3:"#b03060",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",purple2:"#7f007f",purple3:"#a020f0",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",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},j2=/^#?([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/,U2=/^#?([A-Fa-f0-9]{8}|[A-Fa-f0-9]{4})$/,PE=t=>{if(t.match(j2)){(t.length===4||t.length===7)&&(t=t.substr(1)),t.length===3&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const e=parseInt(t,16),n=e>>16,r=e>>8&255,i=e&255;return[n,r,i,1]}if(t.match(U2)){(t.length===5||t.length===9)&&(t=t.substr(1)),t.length===4&&(t=t.split(""),t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]+t[3]+t[3]);const e=parseInt(t,16),n=e>>24&255,r=e>>16&255,i=e>>8&255,s=Math.round((e&255)/255*100)/100;return[n,r,i,s]}throw new Error(`unknown hex color: ${t}`)},{round:bd}=Math,NE=(...t)=>{let[e,n,r,i]=Se(t,"rgba"),s=Co(t)||"auto";i===void 0&&(i=1),s==="auto"&&(s=i<1?"rgba":"rgb"),e=bd(e),n=bd(n),r=bd(r);let o="000000"+(e<<16|n<<8|r).toString(16);o=o.substr(o.length-6);let a="0"+bd(i*255).toString(16);switch(a=a.substr(a.length-2),s.toLowerCase()){case"rgba":return`#${o}${a}`;case"argb":return`#${a}${o}`;default:return`#${o}`}};re.prototype.name=function(){const t=NE(this._rgb,"rgb");for(let e of Object.keys(_o))if(_o[e]===t)return e.toLowerCase();return t},Re.format.named=t=>{if(t=t.toLowerCase(),_o[t])return PE(_o[t]);throw new Error("unknown color name: "+t)},Re.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Ae(t)==="string"&&_o[t.toLowerCase()])return"named"}}),re.prototype.alpha=function(t,e=!1){return t!==void 0&&Ae(t)==="number"?e?(this._rgb[3]=t,this):new re([this._rgb[0],this._rgb[1],this._rgb[2],t],"rgb"):this._rgb[3]},re.prototype.clipped=function(){return this._rgb._clipped||!1};const _r={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}},G2=new Map([["a",[1.0985,.35585]],["b",[1.0985,.35585]],["c",[.98074,1.18232]],["d50",[.96422,.82521]],["d55",[.95682,.92149]],["d65",[.95047,1.08883]],["e",[1,1,1]],["f2",[.99186,.67393]],["f7",[.95041,1.08747]],["f11",[1.00962,.6435]],["icc",[.96422,.82521]]]);function ti(t){const e=G2.get(String(t).toLowerCase());if(!e)throw new Error("unknown Lab illuminant "+t);_r.labWhitePoint=t,_r.Xn=e[0],_r.Zn=e[1]}function qa(){return _r.labWhitePoint}const Ig=(...t)=>{t=Se(t,"lab");const[e,n,r]=t,[i,s,o]=W2(e,n,r),[a,c,u]=OE(i,s,o);return[a,c,u,t.length>3?t[3]:1]},W2=(t,e,n)=>{const{kE:r,kK:i,kKE:s,Xn:o,Yn:a,Zn:c}=_r,u=(t+16)/116,l=.002*e+u,d=u-.005*n,f=l*l*l,h=d*d*d,p=f>r?f:(116*l-16)/i,g=t>s?Math.pow((t+16)/116,3):t/i,y=h>r?h:(116*d-16)/i,m=p*o,w=g*a,E=y*c;return[m,w,E]},Pg=t=>{const e=Math.sign(t);return t=Math.abs(t),(t<=.0031308?t*12.92:1.055*Math.pow(t,1/2.4)-.055)*e},OE=(t,e,n)=>{const{MtxAdaptMa:r,MtxAdaptMaI:i,MtxXYZ2RGB:s,RefWhiteRGB:o,Xn:a,Yn:c,Zn:u}=_r,l=a*r.m00+c*r.m10+u*r.m20,d=a*r.m01+c*r.m11+u*r.m21,f=a*r.m02+c*r.m12+u*r.m22,h=o.X*r.m00+o.Y*r.m10+o.Z*r.m20,p=o.X*r.m01+o.Y*r.m11+o.Z*r.m21,g=o.X*r.m02+o.Y*r.m12+o.Z*r.m22,y=(t*r.m00+e*r.m10+n*r.m20)*(h/l),m=(t*r.m01+e*r.m11+n*r.m21)*(p/d),w=(t*r.m02+e*r.m12+n*r.m22)*(g/f),E=y*i.m00+m*i.m10+w*i.m20,k=y*i.m01+m*i.m11+w*i.m21,A=y*i.m02+m*i.m12+w*i.m22,I=Pg(E*s.m00+k*s.m10+A*s.m20),x=Pg(E*s.m01+k*s.m11+A*s.m21),_=Pg(E*s.m02+k*s.m12+A*s.m22);return[I*255,x*255,_*255]},Ng=(...t)=>{const[e,n,r,...i]=Se(t,"rgb"),[s,o,a]=FE(e,n,r),[c,u,l]=H2(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function H2(t,e,n){const{Xn:r,Yn:i,Zn:s,kE:o,kK:a}=_r,c=t/r,u=e/i,l=n/s,d=c>o?Math.pow(c,1/3):(a*c+16)/116,f=u>o?Math.pow(u,1/3):(a*u+16)/116,h=l>o?Math.pow(l,1/3):(a*l+16)/116;return[116*f-16,500*(d-f),200*(f-h)]}function Og(t){const e=Math.sign(t);return t=Math.abs(t),(t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4))*e}const FE=(t,e,n)=>{t=Og(t/255),e=Og(e/255),n=Og(n/255);const{MtxRGB2XYZ:r,MtxAdaptMa:i,MtxAdaptMaI:s,Xn:o,Yn:a,Zn:c,As:u,Bs:l,Cs:d}=_r;let f=t*r.m00+e*r.m10+n*r.m20,h=t*r.m01+e*r.m11+n*r.m21,p=t*r.m02+e*r.m12+n*r.m22;const g=o*i.m00+a*i.m10+c*i.m20,y=o*i.m01+a*i.m11+c*i.m21,m=o*i.m02+a*i.m12+c*i.m22;let w=f*i.m00+h*i.m10+p*i.m20,E=f*i.m01+h*i.m11+p*i.m21,k=f*i.m02+h*i.m12+p*i.m22;return w*=g/u,E*=y/l,k*=m/d,f=w*s.m00+E*s.m10+k*s.m20,h=w*s.m01+E*s.m11+k*s.m21,p=w*s.m02+E*s.m12+k*s.m22,[f,h,p]};re.prototype.lab=function(){return Ng(this._rgb)};const V2=(...t)=>new re(...t,"lab");Object.assign(Pe,{lab:V2,getLabWhitePoint:qa,setLabWhitePoint:ti}),Re.format.lab=Ig,Re.autodetect.push({p:2,test:(...t)=>{if(t=Se(t,"lab"),Ae(t)==="array"&&t.length===3)return"lab"}}),re.prototype.darken=function(t=1){const e=this,n=e.lab();return n[0]-=_r.Kn*t,new re(n,"lab").alpha(e.alpha(),!0)},re.prototype.brighten=function(t=1){return this.darken(-t)},re.prototype.darker=re.prototype.darken,re.prototype.brighter=re.prototype.brighten,re.prototype.get=function(t){const[e,n]=t.split("."),r=this[e]();if(n){const i=e.indexOf(n)-(e.substr(0,2)==="ok"?2:0);if(i>-1)return r[i];throw new Error(`unknown channel ${n} in mode ${e}`)}else return r};const{pow:K2}=Math,Y2=1e-7,X2=20;re.prototype.luminance=function(t,e="rgb"){if(t!==void 0&&Ae(t)==="number"){if(t===0)return new re([0,0,0,this._rgb[3]],"rgb");if(t===1)return new re([255,255,255,this._rgb[3]],"rgb");let n=this.luminance(),r=X2;const i=(o,a)=>{const c=o.interpolate(a,.5,e),u=c.luminance();return Math.abs(t-u)<Y2||!r--?c:u>t?i(o,c):i(c,a)},s=(n>t?i(new re([0,0,0]),this):i(this,new re([255,255,255]))).rgb();return new re([...s,this._rgb[3]])}return J2(...this._rgb.slice(0,3))};const J2=(t,e,n)=>(t=Fg(t),e=Fg(e),n=Fg(n),.2126*t+.7152*e+.0722*n),Fg=t=>(t/=255,t<=.03928?t/12.92:K2((t+.055)/1.055,2.4)),Kt={},Ao=(t,e,n=.5,...r)=>{let i=r[0]||"lrgb";if(!Kt[i]&&!r.length&&(i=Object.keys(Kt)[0]),!Kt[i])throw new Error(`interpolation mode ${i} is not defined`);return Ae(t)!=="object"&&(t=new re(t)),Ae(e)!=="object"&&(e=new re(e)),Kt[i](t,e,n).alpha(t.alpha()+n*(e.alpha()-t.alpha()))};re.prototype.mix=re.prototype.interpolate=function(t,e=.5,...n){return Ao(this,t,e,...n)},re.prototype.premultiply=function(t=!1){const e=this._rgb,n=e[3];return t?(this._rgb=[e[0]*n,e[1]*n,e[2]*n,n],this):new re([e[0]*n,e[1]*n,e[2]*n,n],"rgb")};const{sin:Z2,cos:Q2}=Math,LE=(...t)=>{let[e,n,r]=Se(t,"lch");return isNaN(r)&&(r=0),r=r*z2,[e,Q2(r)*n,Z2(r)*n]},Lg=(...t)=>{t=Se(t,"lch");const[e,n,r]=t,[i,s,o]=LE(e,n,r),[a,c,u]=Ig(i,s,o);return[a,c,u,t.length>3?t[3]:1]},eF=(...t)=>{const e=IE(Se(t,"hcl"));return Lg(...e)},{sqrt:tF,atan2:nF,round:rF}=Math,ME=(...t)=>{const[e,n,r]=Se(t,"lab"),i=tF(n*n+r*r);let s=(nF(r,n)*B2+360)%360;return rF(i*1e4)===0&&(s=Number.NaN),[e,i,s]},Mg=(...t)=>{const[e,n,r,...i]=Se(t,"rgb"),[s,o,a]=Ng(e,n,r),[c,u,l]=ME(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};re.prototype.lch=function(){return Mg(this._rgb)},re.prototype.hcl=function(){return IE(Mg(this._rgb))};const iF=(...t)=>new re(...t,"lch"),sF=(...t)=>new re(...t,"hcl");Object.assign(Pe,{lch:iF,hcl:sF}),Re.format.lch=Lg,Re.format.hcl=eF,["lch","hcl"].forEach(t=>Re.autodetect.push({p:2,test:(...e)=>{if(e=Se(e,t),Ae(e)==="array"&&e.length===3)return t}})),re.prototype.saturate=function(t=1){const e=this,n=e.lch();return n[1]+=_r.Kn*t,n[1]<0&&(n[1]=0),new re(n,"lch").alpha(e.alpha(),!0)},re.prototype.desaturate=function(t=1){return this.saturate(-t)},re.prototype.set=function(t,e,n=!1){const[r,i]=t.split("."),s=this[r]();if(i){const o=r.indexOf(i)-(r.substr(0,2)==="ok"?2:0);if(o>-1){if(Ae(e)=="string")switch(e.charAt(0)){case"+":s[o]+=+e;break;case"-":s[o]+=+e;break;case"*":s[o]*=+e.substr(1);break;case"/":s[o]/=+e.substr(1);break;default:s[o]=+e}else if(Ae(e)==="number")s[o]=e;else throw new Error("unsupported value for Color.set");const a=new re(s,r);return n?(this._rgb=a._rgb,this):a}throw new Error(`unknown channel ${i} in mode ${r}`)}else return s},re.prototype.tint=function(t=.5,...e){return Ao(this,"white",t,...e)},re.prototype.shade=function(t=.5,...e){return Ao(this,"black",t,...e)};const oF=(t,e,n)=>{const r=t._rgb,i=e._rgb;return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"rgb")};Kt.rgb=oF;const{sqrt:zg,pow:xo}=Math,aF=(t,e,n)=>{const[r,i,s]=t._rgb,[o,a,c]=e._rgb;return new re(zg(xo(r,2)*(1-n)+xo(o,2)*n),zg(xo(i,2)*(1-n)+xo(a,2)*n),zg(xo(s,2)*(1-n)+xo(c,2)*n),"rgb")};Kt.lrgb=aF;const cF=(t,e,n)=>{const r=t.lab(),i=e.lab();return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"lab")};Kt.lab=cF;const Io=(t,e,n,r)=>{let i,s;r==="hsl"?(i=t.hsl(),s=e.hsl()):r==="hsv"?(i=t.hsv(),s=e.hsv()):r==="hcg"?(i=t.hcg(),s=e.hcg()):r==="hsi"?(i=t.hsi(),s=e.hsi()):r==="lch"||r==="hcl"?(r="hcl",i=t.hcl(),s=e.hcl()):r==="oklch"&&(i=t.oklch().reverse(),s=e.oklch().reverse());let o,a,c,u,l,d;(r.substr(0,1)==="h"||r==="oklch")&&([o,c,l]=i,[a,u,d]=s);let f,h,p,g;return!isNaN(o)&&!isNaN(a)?(a>o&&a-o>180?g=a-(o+360):a<o&&o-a>180?g=a+360-o:g=a-o,h=o+n*g):isNaN(o)?isNaN(a)?h=Number.NaN:(h=a,(l==1||l==0)&&r!="hsv"&&(f=u)):(h=o,(d==1||d==0)&&r!="hsv"&&(f=c)),f===void 0&&(f=c+n*(u-c)),p=l+n*(d-l),r==="oklch"?new re([p,f,h],r):new re([h,f,p],r)},zE=(t,e,n)=>Io(t,e,n,"lch");Kt.lch=zE,Kt.hcl=zE;const uF=t=>{if(Ae(t)=="number"&&t>=0&&t<=16777215){const e=t>>16,n=t>>8&255,r=t&255;return[e,n,r,1]}throw new Error("unknown num color: "+t)},lF=(...t)=>{const[e,n,r]=Se(t,"rgb");return(e<<16)+(n<<8)+r};re.prototype.num=function(){return lF(this._rgb)};const dF=(...t)=>new re(...t,"num");Object.assign(Pe,{num:dF}),Re.format.num=uF,Re.autodetect.push({p:5,test:(...t)=>{if(t.length===1&&Ae(t[0])==="number"&&t[0]>=0&&t[0]<=16777215)return"num"}});const fF=(t,e,n)=>{const r=t.num(),i=e.num();return new re(r+n*(i-r),"num")};Kt.num=fF;const{floor:hF}=Math,pF=(...t)=>{t=Se(t,"hcg");let[e,n,r]=t,i,s,o;r=r*255;const a=n*255;if(n===0)i=s=o=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const c=hF(e),u=e-c,l=r*(1-n),d=l+a*(1-u),f=l+a*u,h=l+a;switch(c){case 0:[i,s,o]=[h,f,l];break;case 1:[i,s,o]=[d,h,l];break;case 2:[i,s,o]=[l,h,f];break;case 3:[i,s,o]=[l,d,h];break;case 4:[i,s,o]=[f,l,h];break;case 5:[i,s,o]=[h,l,d];break}}return[i,s,o,t.length>3?t[3]:1]},gF=(...t)=>{const[e,n,r]=Se(t,"rgb"),i=AE(e,n,r),s=xE(e,n,r),o=s-i,a=o*100/255,c=i/(255-o)*100;let u;return o===0?u=Number.NaN:(e===s&&(u=(n-r)/o),n===s&&(u=2+(r-e)/o),r===s&&(u=4+(e-n)/o),u*=60,u<0&&(u+=360)),[u,a,c]};re.prototype.hcg=function(){return gF(this._rgb)};const mF=(...t)=>new re(...t,"hcg");Pe.hcg=mF,Re.format.hcg=pF,Re.autodetect.push({p:1,test:(...t)=>{if(t=Se(t,"hcg"),Ae(t)==="array"&&t.length===3)return"hcg"}});const yF=(t,e,n)=>Io(t,e,n,"hcg");Kt.hcg=yF;const{cos:Po}=Math,vF=(...t)=>{t=Se(t,"hsi");let[e,n,r]=t,i,s,o;return isNaN(e)&&(e=0),isNaN(n)&&(n=0),e>360&&(e-=360),e<0&&(e+=360),e/=360,e<1/3?(o=(1-n)/3,i=(1+n*Po(ei*e)/Po(xg-ei*e))/3,s=1-(o+i)):e<2/3?(e-=1/3,i=(1-n)/3,s=(1+n*Po(ei*e)/Po(xg-ei*e))/3,o=1-(i+s)):(e-=2/3,s=(1-n)/3,o=(1+n*Po(ei*e)/Po(xg-ei*e))/3,i=1-(s+o)),i=ks(r*i*3),s=ks(r*s*3),o=ks(r*o*3),[i*255,s*255,o*255,t.length>3?t[3]:1]},{min:wF,sqrt:bF,acos:EF}=Math,DF=(...t)=>{let[e,n,r]=Se(t,"rgb");e/=255,n/=255,r/=255;let i;const s=wF(e,n,r),o=(e+n+r)/3,a=o>0?1-s/o:0;return a===0?i=NaN:(i=(e-n+(e-r))/2,i/=bF((e-n)*(e-n)+(e-r)*(n-r)),i=EF(i),r>n&&(i=ei-i),i/=ei),[i*360,a,o]};re.prototype.hsi=function(){return DF(this._rgb)};const TF=(...t)=>new re(...t,"hsi");Pe.hsi=TF,Re.format.hsi=vF,Re.autodetect.push({p:2,test:(...t)=>{if(t=Se(t,"hsi"),Ae(t)==="array"&&t.length===3)return"hsi"}});const RF=(t,e,n)=>Io(t,e,n,"hsi");Kt.hsi=RF;const Bg=(...t)=>{t=Se(t,"hsl");const[e,n,r]=t;let i,s,o;if(n===0)i=s=o=r*255;else{const a=[0,0,0],c=[0,0,0],u=r<.5?r*(1+n):r+n-r*n,l=2*r-u,d=e/360;a[0]=d+1/3,a[1]=d,a[2]=d-1/3;for(let f=0;f<3;f++)a[f]<0&&(a[f]+=1),a[f]>1&&(a[f]-=1),6*a[f]<1?c[f]=l+(u-l)*6*a[f]:2*a[f]<1?c[f]=u:3*a[f]<2?c[f]=l+(u-l)*(2/3-a[f])*6:c[f]=l;[i,s,o]=[c[0]*255,c[1]*255,c[2]*255]}return t.length>3?[i,s,o,t[3]]:[i,s,o,1]},BE=(...t)=>{t=Se(t,"rgba");let[e,n,r]=t;e/=255,n/=255,r/=255;const i=AE(e,n,r),s=xE(e,n,r),o=(s+i)/2;let a,c;return s===i?(a=0,c=Number.NaN):a=o<.5?(s-i)/(s+i):(s-i)/(2-s-i),e==s?c=(n-r)/(s-i):n==s?c=2+(r-e)/(s-i):r==s&&(c=4+(e-n)/(s-i)),c*=60,c<0&&(c+=360),t.length>3&&t[3]!==void 0?[c,a,o,t[3]]:[c,a,o]};re.prototype.hsl=function(){return BE(this._rgb)};const SF=(...t)=>new re(...t,"hsl");Pe.hsl=SF,Re.format.hsl=Bg,Re.autodetect.push({p:2,test:(...t)=>{if(t=Se(t,"hsl"),Ae(t)==="array"&&t.length===3)return"hsl"}});const kF=(t,e,n)=>Io(t,e,n,"hsl");Kt.hsl=kF;const{floor:$F}=Math,CF=(...t)=>{t=Se(t,"hsv");let[e,n,r]=t,i,s,o;if(r*=255,n===0)i=s=o=r;else{e===360&&(e=0),e>360&&(e-=360),e<0&&(e+=360),e/=60;const a=$F(e),c=e-a,u=r*(1-n),l=r*(1-n*c),d=r*(1-n*(1-c));switch(a){case 0:[i,s,o]=[r,d,u];break;case 1:[i,s,o]=[l,r,u];break;case 2:[i,s,o]=[u,r,d];break;case 3:[i,s,o]=[u,l,r];break;case 4:[i,s,o]=[d,u,r];break;case 5:[i,s,o]=[r,u,l];break}}return[i,s,o,t.length>3?t[3]:1]},{min:_F,max:AF}=Math,xF=(...t)=>{t=Se(t,"rgb");let[e,n,r]=t;const i=_F(e,n,r),s=AF(e,n,r),o=s-i;let a,c,u;return u=s/255,s===0?(a=Number.NaN,c=0):(c=o/s,e===s&&(a=(n-r)/o),n===s&&(a=2+(r-e)/o),r===s&&(a=4+(e-n)/o),a*=60,a<0&&(a+=360)),[a,c,u]};re.prototype.hsv=function(){return xF(this._rgb)};const IF=(...t)=>new re(...t,"hsv");Pe.hsv=IF,Re.format.hsv=CF,Re.autodetect.push({p:2,test:(...t)=>{if(t=Se(t,"hsv"),Ae(t)==="array"&&t.length===3)return"hsv"}});const PF=(t,e,n)=>Io(t,e,n,"hsv");Kt.hsv=PF;function Ed(t,e){let n=t.length;Array.isArray(t[0])||(t=[t]),Array.isArray(e[0])||(e=e.map(o=>[o]));let r=e[0].length,i=e[0].map((o,a)=>e.map(c=>c[a])),s=t.map(o=>i.map(a=>Array.isArray(o)?o.reduce((c,u,l)=>c+u*(a[l]||0),0):a.reduce((c,u)=>c+u*o,0)));return n===1&&(s=s[0]),r===1?s.map(o=>o[0]):s}const qg=(...t)=>{t=Se(t,"lab");const[e,n,r,...i]=t,[s,o,a]=NF([e,n,r]),[c,u,l]=OE(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]};function NF(t){var e=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],n=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],r=Ed(n,t);return Ed(e,r.map(i=>i**3))}const jg=(...t)=>{const[e,n,r,...i]=Se(t,"rgb"),s=FE(e,n,r);return[...OF(s),...i.length>0&&i[0]<1?[i[0]]:[]]};function OF(t){const e=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],n=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],r=Ed(e,t);return Ed(n,r.map(i=>Math.cbrt(i)))}re.prototype.oklab=function(){return jg(this._rgb)};const FF=(...t)=>new re(...t,"oklab");Object.assign(Pe,{oklab:FF}),Re.format.oklab=qg,Re.autodetect.push({p:2,test:(...t)=>{if(t=Se(t,"oklab"),Ae(t)==="array"&&t.length===3)return"oklab"}});const LF=(t,e,n)=>{const r=t.oklab(),i=e.oklab();return new re(r[0]+n*(i[0]-r[0]),r[1]+n*(i[1]-r[1]),r[2]+n*(i[2]-r[2]),"oklab")};Kt.oklab=LF;const MF=(t,e,n)=>Io(t,e,n,"oklch");Kt.oklch=MF;const{pow:Ug,sqrt:Gg,PI:Wg,cos:qE,sin:jE,atan2:zF}=Math,BF=(t,e="lrgb",n=null)=>{const r=t.length;n||(n=Array.from(new Array(r)).map(()=>1));const i=r/n.reduce(function(d,f){return d+f});if(n.forEach((d,f)=>{n[f]*=i}),t=t.map(d=>new re(d)),e==="lrgb")return qF(t,n);const s=t.shift(),o=s.get(e),a=[];let c=0,u=0;for(let d=0;d<o.length;d++)if(o[d]=(o[d]||0)*n[0],a.push(isNaN(o[d])?0:n[0]),e.charAt(d)==="h"&&!isNaN(o[d])){const f=o[d]/180*Wg;c+=qE(f)*n[0],u+=jE(f)*n[0]}let l=s.alpha()*n[0];t.forEach((d,f)=>{const h=d.get(e);l+=d.alpha()*n[f+1];for(let p=0;p<o.length;p++)if(!isNaN(h[p]))if(a[p]+=n[f+1],e.charAt(p)==="h"){const g=h[p]/180*Wg;c+=qE(g)*n[f+1],u+=jE(g)*n[f+1]}else o[p]+=h[p]*n[f+1]});for(let d=0;d<o.length;d++)if(e.charAt(d)==="h"){let f=zF(u/a[d],c/a[d])/Wg*180;for(;f<0;)f+=360;for(;f>=360;)f-=360;o[d]=f}else o[d]=o[d]/a[d];return l/=r,new re(o,e).alpha(l>.99999?1:l,!0)},qF=(t,e)=>{const n=t.length,r=[0,0,0,0];for(let i=0;i<t.length;i++){const s=t[i],o=e[i]/n,a=s._rgb;r[0]+=Ug(a[0],2)*o,r[1]+=Ug(a[1],2)*o,r[2]+=Ug(a[2],2)*o,r[3]+=a[3]*o}return r[0]=Gg(r[0]),r[1]=Gg(r[1]),r[2]=Gg(r[2]),r[3]>.9999999&&(r[3]=1),new re(_g(r))},{pow:jF}=Math;function Dd(t){let e="rgb",n=Pe("#ccc"),r=0,i=[0,1],s=[],o=[0,0],a=!1,c=[],u=!1,l=0,d=1,f=!1,h={},p=!0,g=1;const y=function(x){if(x=x||["#fff","#000"],x&&Ae(x)==="string"&&Pe.brewer&&Pe.brewer[x.toLowerCase()]&&(x=Pe.brewer[x.toLowerCase()]),Ae(x)==="array"){x.length===1&&(x=[x[0],x[0]]),x=x.slice(0);for(let _=0;_<x.length;_++)x[_]=Pe(x[_]);s.length=0;for(let _=0;_<x.length;_++)s.push(_/(x.length-1))}return A(),c=x},m=function(x){if(a!=null){const _=a.length-1;let P=0;for(;P<_&&x>=a[P];)P++;return P-1}return 0};let w=x=>x,E=x=>x;const k=function(x,_){let P,O;if(_==null&&(_=!1),isNaN(x)||x===null)return n;_?O=x:a&&a.length>2?O=m(x)/(a.length-2):d!==l?O=(x-l)/(d-l):O=1,O=E(O),_||(O=w(O)),g!==1&&(O=jF(O,g)),O=o[0]+O*(1-o[0]-o[1]),O=ks(O,0,1);const C=Math.floor(O*1e4);if(p&&h[C])P=h[C];else{if(Ae(c)==="array")for(let D=0;D<s.length;D++){const R=s[D];if(O<=R){P=c[D];break}if(O>=R&&D===s.length-1){P=c[D];break}if(O>R&&O<s[D+1]){O=(O-R)/(s[D+1]-R),P=Pe.interpolate(c[D],c[D+1],O,e);break}}else Ae(c)==="function"&&(P=c(O));p&&(h[C]=P)}return P};var A=()=>h={};y(t);const I=function(x){const _=Pe(k(x));return u&&_[u]?_[u]():_};return I.classes=function(x){if(x!=null){if(Ae(x)==="array")a=x,i=[x[0],x[x.length-1]];else{const _=Pe.analyze(i);x===0?a=[_.min,_.max]:a=Pe.limits(_,"e",x)}return I}return a},I.domain=function(x){if(!arguments.length)return i;l=x[0],d=x[x.length-1],s=[];const _=c.length;if(x.length===_&&l!==d)for(let P of Array.from(x))s.push((P-l)/(d-l));else{for(let P=0;P<_;P++)s.push(P/(_-1));if(x.length>2){const P=x.map((C,D)=>D/(x.length-1)),O=x.map(C=>(C-l)/(d-l));O.every((C,D)=>P[D]===C)||(E=C=>{if(C<=0||C>=1)return C;let D=0;for(;C>=O[D+1];)D++;const R=(C-O[D])/(O[D+1]-O[D]);return P[D]+R*(P[D+1]-P[D])})}}return i=[l,d],I},I.mode=function(x){return arguments.length?(e=x,A(),I):e},I.range=function(x,_){return y(x),I},I.out=function(x){return u=x,I},I.spread=function(x){return arguments.length?(r=x,I):r},I.correctLightness=function(x){return x==null&&(x=!0),f=x,A(),f?w=function(_){const P=k(0,!0).lab()[0],O=k(1,!0).lab()[0],C=P>O;let D=k(_,!0).lab()[0];const R=P+(O-P)*_;let L=D-R,W=0,V=1,Z=20;for(;Math.abs(L)>.01&&Z-- >0;)(function(){return C&&(L*=-1),L<0?(W=_,_+=(V-_)*.5):(V=_,_+=(W-_)*.5),D=k(_,!0).lab()[0],L=D-R})();return _}:w=_=>_,I},I.padding=function(x){return x!=null?(Ae(x)==="number"&&(x=[x,x]),o=x,I):o},I.colors=function(x,_){arguments.length<2&&(_="hex");let P=[];if(arguments.length===0)P=c.slice(0);else if(x===1)P=[I(.5)];else if(x>1){const O=i[0],C=i[1]-O;P=UF(0,x).map(D=>I(O+D/(x-1)*C))}else{t=[];let O=[];if(a&&a.length>2)for(let C=1,D=a.length,R=1<=D;R?C<D:C>D;R?C++:C--)O.push((a[C-1]+a[C])*.5);else O=i;P=O.map(C=>I(C))}return Pe[_]&&(P=P.map(O=>O[_]())),P},I.cache=function(x){return x!=null?(p=x,I):p},I.gamma=function(x){return x!=null?(g=x,I):g},I.nodata=function(x){return x!=null?(n=Pe(x),I):n},I}function UF(t,e,n){let r=[],i=t<e,s=e;for(let o=t;i?o<s:o>s;i?o++:o--)r.push(o);return r}const GF=function(t){let e=[1,1];for(let n=1;n<t;n++){let r=[1];for(let i=1;i<=e.length;i++)r[i]=(e[i]||0)+e[i-1];e=r}return e},WF=function(t){let e,n,r,i;if(t=t.map(s=>new re(s)),t.length===2)[n,r]=t.map(s=>s.lab()),e=function(s){const o=[0,1,2].map(a=>n[a]+s*(r[a]-n[a]));return new re(o,"lab")};else if(t.length===3)[n,r,i]=t.map(s=>s.lab()),e=function(s){const o=[0,1,2].map(a=>(1-s)*(1-s)*n[a]+2*(1-s)*s*r[a]+s*s*i[a]);return new re(o,"lab")};else if(t.length===4){let s;[n,r,i,s]=t.map(o=>o.lab()),e=function(o){const a=[0,1,2].map(c=>(1-o)*(1-o)*(1-o)*n[c]+3*(1-o)*(1-o)*o*r[c]+3*(1-o)*o*o*i[c]+o*o*o*s[c]);return new re(a,"lab")}}else if(t.length>=5){let s,o,a;s=t.map(c=>c.lab()),a=t.length-1,o=GF(a),e=function(c){const u=1-c,l=[0,1,2].map(d=>s.reduce((f,h,p)=>f+o[p]*u**(a-p)*c**p*h[d],0));return new re(l,"lab")}}else throw new RangeError("No point in running bezier with only one color.");return e},HF=t=>{const e=WF(t);return e.scale=()=>Dd(e),e},{round:UE}=Math;re.prototype.rgb=function(t=!0){return t===!1?this._rgb.slice(0,3):this._rgb.slice(0,3).map(UE)},re.prototype.rgba=function(t=!0){return this._rgb.slice(0,4).map((e,n)=>n<3?t===!1?e:UE(e):e)};const VF=(...t)=>new re(...t,"rgb");Object.assign(Pe,{rgb:VF}),Re.format.rgb=(...t)=>{const e=Se(t,"rgba");return e[3]===void 0&&(e[3]=1),e},Re.autodetect.push({p:3,test:(...t)=>{if(t=Se(t,"rgba"),Ae(t)==="array"&&(t.length===3||t.length===4&&Ae(t[3])=="number"&&t[3]>=0&&t[3]<=1))return"rgb"}});const ar=(t,e,n)=>{if(!ar[n])throw new Error("unknown blend mode "+n);return ar[n](t,e)},Ni=t=>(e,n)=>{const r=Pe(n).rgb(),i=Pe(e).rgb();return Pe.rgb(t(r,i))},Oi=t=>(e,n)=>{const r=[];return r[0]=t(e[0],n[0]),r[1]=t(e[1],n[1]),r[2]=t(e[2],n[2]),r},KF=t=>t,YF=(t,e)=>t*e/255,XF=(t,e)=>t>e?e:t,JF=(t,e)=>t>e?t:e,ZF=(t,e)=>255*(1-(1-t/255)*(1-e/255)),QF=(t,e)=>e<128?2*t*e/255:255*(1-2*(1-t/255)*(1-e/255)),eL=(t,e)=>255*(1-(1-e/255)/(t/255)),tL=(t,e)=>t===255?255:(t=255*(e/255)/(1-t/255),t>255?255:t);ar.normal=Ni(Oi(KF)),ar.multiply=Ni(Oi(YF)),ar.screen=Ni(Oi(ZF)),ar.overlay=Ni(Oi(QF)),ar.darken=Ni(Oi(XF)),ar.lighten=Ni(Oi(JF)),ar.dodge=Ni(Oi(tL)),ar.burn=Ni(Oi(eL));const{pow:nL,sin:rL,cos:iL}=Math;function sL(t=300,e=-1.5,n=1,r=1,i=[0,1]){let s=0,o;Ae(i)==="array"?o=i[1]-i[0]:(o=0,i=[i,i]);const a=function(c){const u=ei*((t+120)/360+e*c),l=nL(i[0]+o*c,r),d=(s!==0?n[0]+c*s:n)*l*(1-l)/2,f=iL(u),h=rL(u),p=l+d*(-.14861*f+1.78277*h),g=l+d*(-.29227*f-.90649*h),y=l+d*(1.97294*f);return Pe(_g([p*255,g*255,y*255,1]))};return a.start=function(c){return c==null?t:(t=c,a)},a.rotations=function(c){return c==null?e:(e=c,a)},a.gamma=function(c){return c==null?r:(r=c,a)},a.hue=function(c){return c==null?n:(n=c,Ae(n)==="array"?(s=n[1]-n[0],s===0&&(n=n[1])):s=0,a)},a.lightness=function(c){return c==null?i:(Ae(c)==="array"?(i=c,o=c[1]-c[0]):(i=[c,c],o=0),a)},a.scale=()=>Pe.scale(a),a.hue(n),a}const oL="0123456789abcdef",{floor:aL,random:cL}=Math,uL=()=>{let t="#";for(let e=0;e<6;e++)t+=oL.charAt(aL(cL()*16));return new re(t,"hex")},{log:GE,pow:lL,floor:dL,abs:fL}=Math;function WE(t,e=null){const n={min:Number.MAX_VALUE,max:Number.MAX_VALUE*-1,sum:0,values:[],count:0};return Ae(t)==="object"&&(t=Object.values(t)),t.forEach(r=>{e&&Ae(r)==="object"&&(r=r[e]),r!=null&&!isNaN(r)&&(n.values.push(r),n.sum+=r,r<n.min&&(n.min=r),r>n.max&&(n.max=r),n.count+=1)}),n.domain=[n.min,n.max],n.limits=(r,i)=>HE(n,r,i),n}function HE(t,e="equal",n=7){Ae(t)=="array"&&(t=WE(t));const{min:r,max:i}=t,s=t.values.sort((a,c)=>a-c);if(n===1)return[r,i];const o=[];if(e.substr(0,1)==="c"&&(o.push(r),o.push(i)),e.substr(0,1)==="e"){o.push(r);for(let a=1;a<n;a++)o.push(r+a/n*(i-r));o.push(i)}else if(e.substr(0,1)==="l"){if(r<=0)throw new Error("Logarithmic scales are only possible for values > 0");const a=Math.LOG10E*GE(r),c=Math.LOG10E*GE(i);o.push(r);for(let u=1;u<n;u++)o.push(lL(10,a+u/n*(c-a)));o.push(i)}else if(e.substr(0,1)==="q"){o.push(r);for(let a=1;a<n;a++){const c=(s.length-1)*a/n,u=dL(c);if(u===c)o.push(s[u]);else{const l=c-u;o.push(s[u]*(1-l)+s[u+1]*l)}}o.push(i)}else if(e.substr(0,1)==="k"){let a;const c=s.length,u=new Array(c),l=new Array(n);let d=!0,f=0,h=null;h=[],h.push(r);for(let y=1;y<n;y++)h.push(r+y/n*(i-r));for(h.push(i);d;){for(let m=0;m<n;m++)l[m]=0;for(let m=0;m<c;m++){const w=s[m];let E=Number.MAX_VALUE,k;for(let A=0;A<n;A++){const I=fL(h[A]-w);I<E&&(E=I,k=A),l[k]++,u[m]=k}}const y=new Array(n);for(let m=0;m<n;m++)y[m]=null;for(let m=0;m<c;m++)a=u[m],y[a]===null?y[a]=s[m]:y[a]+=s[m];for(let m=0;m<n;m++)y[m]*=1/l[m];d=!1;for(let m=0;m<n;m++)if(y[m]!==h[m]){d=!0;break}h=y,f++,f>200&&(d=!1)}const p={};for(let y=0;y<n;y++)p[y]=[];for(let y=0;y<c;y++)a=u[y],p[a].push(s[y]);let g=[];for(let y=0;y<n;y++)g.push(p[y][0]),g.push(p[y][p[y].length-1]);g=g.sort((y,m)=>y-m),o.push(g[0]);for(let y=1;y<g.length;y+=2){const m=g[y];!isNaN(m)&&o.indexOf(m)===-1&&o.push(m)}}return o}const hL=(t,e)=>{t=new re(t),e=new re(e);const n=t.luminance(),r=e.luminance();return n>r?(n+.05)/(r+.05):(r+.05)/(n+.05)},VE=.027,pL=5e-4,gL=.1,KE=1.14,Td=.022,YE=1.414,mL=(t,e)=>{t=new re(t),e=new re(e),t.alpha()<1&&(t=Ao(e,t,t.alpha(),"rgb"));const n=XE(...t.rgb()),r=XE(...e.rgb()),i=n>=Td?n:n+Math.pow(Td-n,YE),s=r>=Td?r:r+Math.pow(Td-r,YE),o=Math.pow(s,.56)-Math.pow(i,.57),a=Math.pow(s,.65)-Math.pow(i,.62),c=Math.abs(s-i)<pL?0:i<s?o*KE:a*KE;return(Math.abs(c)<gL?0:c>0?c-VE:c+VE)*100};function XE(t,e,n){return .2126729*Math.pow(t/255,2.4)+.7151522*Math.pow(e/255,2.4)+.072175*Math.pow(n/255,2.4)}const{sqrt:ni,pow:$t,min:yL,max:vL,atan2:JE,abs:ZE,cos:Rd,sin:QE,exp:wL,PI:eD}=Math;function bL(t,e,n=1,r=1,i=1){var s=function(at){return 360*at/(2*eD)},o=function(at){return 2*eD*at/360};t=new re(t),e=new re(e);const[a,c,u]=Array.from(t.lab()),[l,d,f]=Array.from(e.lab()),h=(a+l)/2,p=ni($t(c,2)+$t(u,2)),g=ni($t(d,2)+$t(f,2)),y=(p+g)/2,m=.5*(1-ni($t(y,7)/($t(y,7)+$t(25,7)))),w=c*(1+m),E=d*(1+m),k=ni($t(w,2)+$t(u,2)),A=ni($t(E,2)+$t(f,2)),I=(k+A)/2,x=s(JE(u,w)),_=s(JE(f,E)),P=x>=0?x:x+360,O=_>=0?_:_+360,C=ZE(P-O)>180?(P+O+360)/2:(P+O)/2,D=1-.17*Rd(o(C-30))+.24*Rd(o(2*C))+.32*Rd(o(3*C+6))-.2*Rd(o(4*C-63));let R=O-P;R=ZE(R)<=180?R:O<=P?R+360:R-360,R=2*ni(k*A)*QE(o(R)/2);const L=l-a,W=A-k,V=1+.015*$t(h-50,2)/ni(20+$t(h-50,2)),Z=1+.045*I,Fe=1+.015*I*D,se=30*wL(-$t((C-275)/25,2)),K=-(2*ni($t(I,7)/($t(I,7)+$t(25,7))))*QE(2*o(se)),Te=ni($t(L/(n*V),2)+$t(W/(r*Z),2)+$t(R/(i*Fe),2)+K*(W/(r*Z))*(R/(i*Fe)));return vL(0,yL(100,Te))}function EL(t,e,n="lab"){t=new re(t),e=new re(e);const r=t.get(n),i=e.get(n);let s=0;for(let o in r){const a=(r[o]||0)-(i[o]||0);s+=a*a}return Math.sqrt(s)}const DL=(...t)=>{try{return new re(...t),!0}catch{return!1}},TL={cool(){return Dd([Pe.hsl(180,1,.9),Pe.hsl(250,.7,.4)])},hot(){return Dd(["#000","#f00","#ff0","#fff"]).mode("rgb")}},Hg={OrRd:["#fff7ec","#fee8c8","#fdd49e","#fdbb84","#fc8d59","#ef6548","#d7301f","#b30000","#7f0000"],PuBu:["#fff7fb","#ece7f2","#d0d1e6","#a6bddb","#74a9cf","#3690c0","#0570b0","#045a8d","#023858"],BuPu:["#f7fcfd","#e0ecf4","#bfd3e6","#9ebcda","#8c96c6","#8c6bb1","#88419d","#810f7c","#4d004b"],Oranges:["#fff5eb","#fee6ce","#fdd0a2","#fdae6b","#fd8d3c","#f16913","#d94801","#a63603","#7f2704"],BuGn:["#f7fcfd","#e5f5f9","#ccece6","#99d8c9","#66c2a4","#41ae76","#238b45","#006d2c","#00441b"],YlOrBr:["#ffffe5","#fff7bc","#fee391","#fec44f","#fe9929","#ec7014","#cc4c02","#993404","#662506"],YlGn:["#ffffe5","#f7fcb9","#d9f0a3","#addd8e","#78c679","#41ab5d","#238443","#006837","#004529"],Reds:["#fff5f0","#fee0d2","#fcbba1","#fc9272","#fb6a4a","#ef3b2c","#cb181d","#a50f15","#67000d"],RdPu:["#fff7f3","#fde0dd","#fcc5c0","#fa9fb5","#f768a1","#dd3497","#ae017e","#7a0177","#49006a"],Greens:["#f7fcf5","#e5f5e0","#c7e9c0","#a1d99b","#74c476","#41ab5d","#238b45","#006d2c","#00441b"],YlGnBu:["#ffffd9","#edf8b1","#c7e9b4","#7fcdbb","#41b6c4","#1d91c0","#225ea8","#253494","#081d58"],Purples:["#fcfbfd","#efedf5","#dadaeb","#bcbddc","#9e9ac8","#807dba","#6a51a3","#54278f","#3f007d"],GnBu:["#f7fcf0","#e0f3db","#ccebc5","#a8ddb5","#7bccc4","#4eb3d3","#2b8cbe","#0868ac","#084081"],Greys:["#ffffff","#f0f0f0","#d9d9d9","#bdbdbd","#969696","#737373","#525252","#252525","#000000"],YlOrRd:["#ffffcc","#ffeda0","#fed976","#feb24c","#fd8d3c","#fc4e2a","#e31a1c","#bd0026","#800026"],PuRd:["#f7f4f9","#e7e1ef","#d4b9da","#c994c7","#df65b0","#e7298a","#ce1256","#980043","#67001f"],Blues:["#f7fbff","#deebf7","#c6dbef","#9ecae1","#6baed6","#4292c6","#2171b5","#08519c","#08306b"],PuBuGn:["#fff7fb","#ece2f0","#d0d1e6","#a6bddb","#67a9cf","#3690c0","#02818a","#016c59","#014636"],Viridis:["#440154","#482777","#3f4a8a","#31678e","#26838f","#1f9d8a","#6cce5a","#b6de2b","#fee825"],Spectral:["#9e0142","#d53e4f","#f46d43","#fdae61","#fee08b","#ffffbf","#e6f598","#abdda4","#66c2a5","#3288bd","#5e4fa2"],RdYlGn:["#a50026","#d73027","#f46d43","#fdae61","#fee08b","#ffffbf","#d9ef8b","#a6d96a","#66bd63","#1a9850","#006837"],RdBu:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#f7f7f7","#d1e5f0","#92c5de","#4393c3","#2166ac","#053061"],PiYG:["#8e0152","#c51b7d","#de77ae","#f1b6da","#fde0ef","#f7f7f7","#e6f5d0","#b8e186","#7fbc41","#4d9221","#276419"],PRGn:["#40004b","#762a83","#9970ab","#c2a5cf","#e7d4e8","#f7f7f7","#d9f0d3","#a6dba0","#5aae61","#1b7837","#00441b"],RdYlBu:["#a50026","#d73027","#f46d43","#fdae61","#fee090","#ffffbf","#e0f3f8","#abd9e9","#74add1","#4575b4","#313695"],BrBG:["#543005","#8c510a","#bf812d","#dfc27d","#f6e8c3","#f5f5f5","#c7eae5","#80cdc1","#35978f","#01665e","#003c30"],RdGy:["#67001f","#b2182b","#d6604d","#f4a582","#fddbc7","#ffffff","#e0e0e0","#bababa","#878787","#4d4d4d","#1a1a1a"],PuOr:["#7f3b08","#b35806","#e08214","#fdb863","#fee0b6","#f7f7f7","#d8daeb","#b2abd2","#8073ac","#542788","#2d004b"],Set2:["#66c2a5","#fc8d62","#8da0cb","#e78ac3","#a6d854","#ffd92f","#e5c494","#b3b3b3"],Accent:["#7fc97f","#beaed4","#fdc086","#ffff99","#386cb0","#f0027f","#bf5b17","#666666"],Set1:["#e41a1c","#377eb8","#4daf4a","#984ea3","#ff7f00","#ffff33","#a65628","#f781bf","#999999"],Set3:["#8dd3c7","#ffffb3","#bebada","#fb8072","#80b1d3","#fdb462","#b3de69","#fccde5","#d9d9d9","#bc80bd","#ccebc5","#ffed6f"],Dark2:["#1b9e77","#d95f02","#7570b3","#e7298a","#66a61e","#e6ab02","#a6761d","#666666"],Paired:["#a6cee3","#1f78b4","#b2df8a","#33a02c","#fb9a99","#e31a1c","#fdbf6f","#ff7f00","#cab2d6","#6a3d9a","#ffff99","#b15928"],Pastel2:["#b3e2cd","#fdcdac","#cbd5e8","#f4cae4","#e6f5c9","#fff2ae","#f1e2cc","#cccccc"],Pastel1:["#fbb4ae","#b3cde3","#ccebc5","#decbe4","#fed9a6","#ffffcc","#e5d8bd","#fddaec","#f2f2f2"]},tD=Object.keys(Hg),nD=new Map(tD.map(t=>[t.toLowerCase(),t])),RL=typeof Proxy=="function"?new Proxy(Hg,{get(t,e){const n=e.toLowerCase();if(nD.has(n))return t[nD.get(n)]},getOwnPropertyNames(){return Object.getOwnPropertyNames(tD)}}):Hg,SL=(...t)=>{t=Se(t,"cmyk");const[e,n,r,i]=t,s=t.length>4?t[4]:1;return i===1?[0,0,0,s]:[e>=1?0:255*(1-e)*(1-i),n>=1?0:255*(1-n)*(1-i),r>=1?0:255*(1-r)*(1-i),s]},{max:rD}=Math,kL=(...t)=>{let[e,n,r]=Se(t,"rgb");e=e/255,n=n/255,r=r/255;const i=1-rD(e,rD(n,r)),s=i<1?1/(1-i):0,o=(1-e-i)*s,a=(1-n-i)*s,c=(1-r-i)*s;return[o,a,c,i]};re.prototype.cmyk=function(){return kL(this._rgb)};const $L=(...t)=>new re(...t,"cmyk");Object.assign(Pe,{cmyk:$L}),Re.format.cmyk=SL,Re.autodetect.push({p:2,test:(...t)=>{if(t=Se(t,"cmyk"),Ae(t)==="array"&&t.length===4)return"cmyk"}});const CL=(...t)=>{const e=Se(t,"hsla");let n=Co(t)||"lsa";return e[0]=jn(e[0]||0)+"deg",e[1]=jn(e[1]*100)+"%",e[2]=jn(e[2]*100)+"%",n==="hsla"||e.length>3&&e[3]<1?(e[3]="/ "+(e.length>3?e[3]:1),n="hsla"):e.length=3,`${n.substr(0,3)}(${e.join(" ")})`},_L=(...t)=>{const e=Se(t,"lab");let n=Co(t)||"lab";return e[0]=jn(e[0])+"%",e[1]=jn(e[1]),e[2]=jn(e[2]),n==="laba"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lab(${e.join(" ")})`},AL=(...t)=>{const e=Se(t,"lch");let n=Co(t)||"lab";return e[0]=jn(e[0])+"%",e[1]=jn(e[1]),e[2]=isNaN(e[2])?"none":jn(e[2])+"deg",n==="lcha"||e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`lch(${e.join(" ")})`},xL=(...t)=>{const e=Se(t,"lab");return e[0]=jn(e[0]*100)+"%",e[1]=Ag(e[1]),e[2]=Ag(e[2]),e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklab(${e.join(" ")})`},iD=(...t)=>{const[e,n,r,...i]=Se(t,"rgb"),[s,o,a]=jg(e,n,r),[c,u,l]=ME(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},IL=(...t)=>{const e=Se(t,"lch");return e[0]=jn(e[0]*100)+"%",e[1]=Ag(e[1]),e[2]=isNaN(e[2])?"none":jn(e[2])+"deg",e.length>3&&e[3]<1?e[3]="/ "+(e.length>3?e[3]:1):e.length=3,`oklch(${e.join(" ")})`},{round:Vg}=Math,PL=(...t)=>{const e=Se(t,"rgba");let n=Co(t)||"rgb";if(n.substr(0,3)==="hsl")return CL(BE(e),n);if(n.substr(0,3)==="lab"){const r=qa();ti("d50");const i=_L(Ng(e),n);return ti(r),i}if(n.substr(0,3)==="lch"){const r=qa();ti("d50");const i=AL(Mg(e),n);return ti(r),i}return n.substr(0,5)==="oklab"?xL(jg(e)):n.substr(0,5)==="oklch"?IL(iD(e)):(e[0]=Vg(e[0]),e[1]=Vg(e[1]),e[2]=Vg(e[2]),(n==="rgba"||e.length>3&&e[3]<1)&&(e[3]="/ "+(e.length>3?e[3]:1),n="rgba"),`${n.substr(0,3)}(${e.slice(0,n==="rgb"?3:4).join(" ")})`)},sD=(...t)=>{t=Se(t,"lch");const[e,n,r,...i]=t,[s,o,a]=LE(e,n,r),[c,u,l]=qg(s,o,a);return[c,u,l,...i.length>0&&i[0]<1?[i[0]]:[]]},ri=/((?:-?\d+)|(?:-?\d+(?:\.\d+)?)%|none)/.source,cr=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%?)|none)/.source,Sd=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)%)|none)/.source,Un=/\s*/.source,No=/\s+/.source,Kg=/\s*,\s*/.source,kd=/((?:-?(?:\d+(?:\.\d*)?|\.\d+)(?:deg)?)|none)/.source,Oo=/\s*(?:\/\s*((?:[01]|[01]?\.\d+)|\d+(?:\.\d+)?%))?/.source,oD=new RegExp("^rgba?\\("+Un+[ri,ri,ri].join(No)+Oo+"\\)$"),aD=new RegExp("^rgb\\("+Un+[ri,ri,ri].join(Kg)+Un+"\\)$"),cD=new RegExp("^rgba\\("+Un+[ri,ri,ri,cr].join(Kg)+Un+"\\)$"),uD=new RegExp("^hsla?\\("+Un+[kd,Sd,Sd].join(No)+Oo+"\\)$"),lD=new RegExp("^hsl?\\("+Un+[kd,Sd,Sd].join(Kg)+Un+"\\)$"),dD=/^hsla\(\s*(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)%\s*,\s*(-?\d+(?:\.\d+)?)%\s*,\s*([01]|[01]?\.\d+)\)$/,fD=new RegExp("^lab\\("+Un+[cr,cr,cr].join(No)+Oo+"\\)$"),hD=new RegExp("^lch\\("+Un+[cr,cr,kd].join(No)+Oo+"\\)$"),pD=new RegExp("^oklab\\("+Un+[cr,cr,cr].join(No)+Oo+"\\)$"),gD=new RegExp("^oklch\\("+Un+[cr,cr,kd].join(No)+Oo+"\\)$"),{round:mD}=Math,Fo=t=>t.map((e,n)=>n<=2?ks(mD(e),0,255):e),Ct=(t,e=0,n=100,r=!1)=>(typeof t=="string"&&t.endsWith("%")&&(t=parseFloat(t.substring(0,t.length-1))/100,r?t=e+(t+1)*.5*(n-e):t=e+t*(n-e)),+t),rn=(t,e)=>t==="none"?e:t,Yg=t=>{if(t=t.toLowerCase().trim(),t==="transparent")return[0,0,0,0];let e;if(Re.format.named)try{return Re.format.named(t)}catch{}if((e=t.match(oD))||(e=t.match(aD))){let n=e.slice(1,4);for(let i=0;i<3;i++)n[i]=+Ct(rn(n[i],0),0,255);n=Fo(n);const r=e[4]!==void 0?+Ct(e[4],0,1):1;return n[3]=r,n}if(e=t.match(cD)){const n=e.slice(1,5);for(let r=0;r<4;r++)n[r]=+Ct(n[r],0,255);return n}if((e=t.match(uD))||(e=t.match(lD))){const n=e.slice(1,4);n[0]=+rn(n[0].replace("deg",""),0),n[1]=+Ct(rn(n[1],0),0,100)*.01,n[2]=+Ct(rn(n[2],0),0,100)*.01;const r=Fo(Bg(n)),i=e[4]!==void 0?+Ct(e[4],0,1):1;return r[3]=i,r}if(e=t.match(dD)){const n=e.slice(1,4);n[1]*=.01,n[2]*=.01;const r=Bg(n);for(let i=0;i<3;i++)r[i]=mD(r[i]);return r[3]=+e[4],r}if(e=t.match(fD)){const n=e.slice(1,4);n[0]=Ct(rn(n[0],0),0,100),n[1]=Ct(rn(n[1],0),-125,125,!0),n[2]=Ct(rn(n[2],0),-125,125,!0);const r=qa();ti("d50");const i=Fo(Ig(n));ti(r);const s=e[4]!==void 0?+Ct(e[4],0,1):1;return i[3]=s,i}if(e=t.match(hD)){const n=e.slice(1,4);n[0]=Ct(n[0],0,100),n[1]=Ct(rn(n[1],0),0,150,!1),n[2]=+rn(n[2].replace("deg",""),0);const r=qa();ti("d50");const i=Fo(Lg(n));ti(r);const s=e[4]!==void 0?+Ct(e[4],0,1):1;return i[3]=s,i}if(e=t.match(pD)){const n=e.slice(1,4);n[0]=Ct(rn(n[0],0),0,1),n[1]=Ct(rn(n[1],0),-.4,.4,!0),n[2]=Ct(rn(n[2],0),-.4,.4,!0);const r=Fo(qg(n)),i=e[4]!==void 0?+Ct(e[4],0,1):1;return r[3]=i,r}if(e=t.match(gD)){const n=e.slice(1,4);n[0]=Ct(rn(n[0],0),0,1),n[1]=Ct(rn(n[1],0),0,.4,!1),n[2]=+rn(n[2].replace("deg",""),0);const r=Fo(sD(n)),i=e[4]!==void 0?+Ct(e[4],0,1):1;return r[3]=i,r}};Yg.test=t=>oD.test(t)||uD.test(t)||fD.test(t)||hD.test(t)||pD.test(t)||gD.test(t)||aD.test(t)||cD.test(t)||lD.test(t)||dD.test(t)||t==="transparent",re.prototype.css=function(t){return PL(this._rgb,t)};const NL=(...t)=>new re(...t,"css");Pe.css=NL,Re.format.css=Yg,Re.autodetect.push({p:5,test:(t,...e)=>{if(!e.length&&Ae(t)==="string"&&Yg.test(t))return"css"}}),Re.format.gl=(...t)=>{const e=Se(t,"rgba");return e[0]*=255,e[1]*=255,e[2]*=255,e};const OL=(...t)=>new re(...t,"gl");Pe.gl=OL,re.prototype.gl=function(){const t=this._rgb;return[t[0]/255,t[1]/255,t[2]/255,t[3]]},re.prototype.hex=function(t){return NE(this._rgb,t)};const FL=(...t)=>new re(...t,"hex");Pe.hex=FL,Re.format.hex=PE,Re.autodetect.push({p:4,test:(t,...e)=>{if(!e.length&&Ae(t)==="string"&&[3,4,5,6,7,8,9].indexOf(t.length)>=0)return"hex"}});const{log:$d}=Math,yD=t=>{const e=t/100;let n,r,i;return e<66?(n=255,r=e<6?0:-155.25485562709179-.44596950469579133*(r=e-2)+104.49216199393888*$d(r),i=e<20?0:-254.76935184120902+.8274096064007395*(i=e-10)+115.67994401066147*$d(i)):(n=351.97690566805693+.114206453784165*(n=e-55)-40.25366309332127*$d(n),r=325.4494125711974+.07943456536662342*(r=e-50)-28.0852963507957*$d(r),i=255),[n,r,i,1]},{round:LL}=Math,ML=(...t)=>{const e=Se(t,"rgb"),n=e[0],r=e[2];let i=1e3,s=4e4;const o=.4;let a;for(;s-i>o;){a=(s+i)*.5;const c=yD(a);c[2]/c[0]>=r/n?s=a:i=a}return LL(a)};re.prototype.temp=re.prototype.kelvin=re.prototype.temperature=function(){return ML(this._rgb)};const Xg=(...t)=>new re(...t,"temp");Object.assign(Pe,{temp:Xg,kelvin:Xg,temperature:Xg}),Re.format.temp=Re.format.kelvin=Re.format.temperature=yD,re.prototype.oklch=function(){return iD(this._rgb)};const zL=(...t)=>new re(...t,"oklch");Object.assign(Pe,{oklch:zL}),Re.format.oklch=sD,Re.autodetect.push({p:2,test:(...t)=>{if(t=Se(t,"oklch"),Ae(t)==="array"&&t.length===3)return"oklch"}}),Object.assign(Pe,{analyze:WE,average:BF,bezier:HF,blend:ar,brewer:RL,Color:re,colors:_o,contrast:hL,contrastAPCA:mL,cubehelix:sL,deltaE:bL,distance:EL,input:Re,interpolate:Ao,limits:HE,mix:Ao,random:uL,scale:Dd,scales:TL,valid:DL});const Jg=[.96,.907,.805,.697,.605,.547,.518,.445,.395,.34],vD=[.32,.16,.08,.04,0,0,.04,.08,.16,.32];function BL(t){const e=t.get("hsl.l");return Jg.reduce((n,r)=>Math.abs(r-e)<Math.abs(n-e)?r:n)}function qL(t){const e=Pe(t),n=BL(e),r=Jg.findIndex(s=>s===n),i=Jg.map(s=>e.set("hsl.l",s)).map(s=>Pe(s)).map((s,o)=>{const a=vD[o]-vD[r];return a>=0?s.saturate(a):s.desaturate(a*-1)});return{baseColorIndex:r,colors:i}}function jL(t){return qL(t).colors.map(e=>e.hex())}const wD={fill:"#3b82f6",stroke:"#2563eb",hiContrast:"#eff6ff",loContrast:"#bfdbfe"},bD={fill:"#0284c7",stroke:"#0369a1",hiContrast:"#f0f9ff",loContrast:"#B6ECF7"},ED={fill:"#64748b",stroke:"#475569",hiContrast:"#f8fafc",loContrast:"#cbd5e1"},DD={primary:wD,blue:wD,secondary:bD,sky:bD,muted:ED,slate:ED,gray:{fill:"#737373",stroke:"#525252",hiContrast:"#fafafa",loContrast:"#d4d4d4"},red:{fill:"#AC4D39",stroke:"#853A2D",hiContrast:"#FBD3CB",loContrast:"#f5b2a3"},green:{fill:"#428a4f",stroke:"#2d5d39",hiContrast:"#f8fafc",loContrast:"#c2f0c2"},amber:{fill:"#A35829",stroke:"#7E451D",hiContrast:"#FFE0C2",loContrast:"#f9b27c"},indigo:{fill:"#6366f1",stroke:"#4f46e5",hiContrast:"#eef2ff",loContrast:"#c7d2fe"}},UL={lineColor:"#6E6E6E",labelBgColor:"#18191b",labelColor:"#C6C6C6"},TD={lineColor:"#64748b",labelBgColor:"#0f172a",labelColor:"#cbd5e1"},RD={lineColor:"#3b82f6",labelBgColor:"#172554",labelColor:"#60a5fa"},SD={lineColor:"#0ea5e9",labelBgColor:"#082f49",labelColor:"#38bdf8"},kD={amber:{lineColor:"#b45309",labelBgColor:"#78350f",labelColor:"#FFE0C2"},blue:RD,gray:UL,green:{lineColor:"#15803d",labelBgColor:"#052e16",labelColor:"#22c55e"},indigo:{lineColor:"#6366f1",labelBgColor:"#1e1b4b",labelColor:"#818cf8"},muted:TD,primary:RD,red:{lineColor:"#AC4D39",labelBgColor:"#b91c1c",labelColor:"#f5b2a3"},secondary:SD,sky:SD,slate:TD},Gn={elements:DD,relationships:kD,font:"Arial",shadow:"#0a0a0a"};function GL(t){if(t.match(/^#([0-9a-f]{3}){1,2}$/i)){const e=jL(t);return{elements:{fill:e[6],stroke:e[7],hiContrast:e[0],loContrast:e[1]},relationships:{lineColor:e[4],labelColor:e[3],labelBgColor:e[9]}}}else return{elements:Gn.elements.primary,relationships:Gn.relationships.primary}}function it(t){return Ts(t)?t:t.id}let ja=class x0{constructor(e,n){this.view=e,this.model=n;for(const r of e.nodes){const i=new x0.Element(r,this);this._elements.set(r.id,i),Pi(r.parent)&&this._rootElements.add(i)}this._connections=new Map(e.edges.map(r=>[r.id,new x0.Connection(r,this)]))}_rootElements=new Set;_elements=new Map;_connections;get isDynamic(){return this.view.__==="dynamic"}get id(){return this.view.id}get title(){return this.view.title}get viewOf(){if(Pi(this.view.__)||this.view.__==="element"){const e=this.view;return e.viewOf?this.model.element(e.viewOf):null}return null}get tags(){return this.view.tags??[]}roots(){return[...this._rootElements]}elements(){return[...this._elements.values()]}element(e){return Ze(this._elements.get(e),`LikeC4DiagramModel.Element ${e} in view ${this.view.id} not found`)}hasElement(e){return this._elements.has(e)}connections(){return[...this._connections.values()]}connection(e){return Ze(this._connections.get(e),`Connection ${e} in view ${this.view.id} not found`)}findConnections(e,n,r="direct"){const i=it(e),s=it(n);return this.connections().filter(o=>o.source.id===i&&o.target.id===s||r==="both"&&o.source.id===s&&o.target.id===i)}parent(e){const n=this.element(it(e));return n.node.parent?this.element(n.node.parent):null}children(e){return this.element(it(e)).node.children.map(n=>this.element(n))}siblings(e){const n=it(e),r=this.parent(n);return(r?this.children(r):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=it(e);const r=[];let i;for(;i=this.parent(n);)r.push(i),n=i.id;return r}descendants(e){return this.children(e).flatMap(n=>[n,...this.descendants(n.id)])}incoming(e,n="all"){const r=this.element(it(e)),i=r.node.inEdges.map(s=>this.connection(s));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.target.id===r.id:s.target.id!==r.id)}incomers(e,n="all"){return this.incoming(e,n).map(r=>r.source)}outgoing(e,n="all"){const r=this.element(it(e)),i=r.node.outEdges.map(s=>this.connection(s));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.source.id===r.id:s.source.id!==r.id)}outgoers(e,n="all"){return this.outgoing(e,n).map(r=>r.target)}};(t=>{class e{constructor(i,s){this.node=i,this.view=s}get id(){return this.node.id}get title(){return this.node.title}get kind(){return this.node.kind}get isRoot(){return Pi(this.node.parent)}get hasNested(){return this.node.children.length>0}get shape(){return this.node.shape}get color(){return this.node.color}get tags(){return this.node.tags??[]}get level(){return this.node.level}get depth(){return this.node.depth??0}model(){return this.view.model.element(this.id)}parent(){return this.node.parent?this.view.element(this.node.parent):null}metadata(i,s){return this.model().metadata(i)??s}hasMetadata(i){return this.model().hasMetadata(i)}ancestors(){return this.view.ancestors(this)}siblings(){return this.view.siblings(this)}descendants(){return this.view.descendants(this)}children(){return this.view.children(this)}incoming(i="all"){return this.view.incoming(this,i)}incomers(i="all"){return this.view.incomers(this,i)}outgoing(i="all"){return this.view.outgoing(this,i)}outgoers(i="all"){return this.view.outgoers(this,i)}connectionsTo(i){return this.view.findConnections(this,i)}}t.Element=e;class n{constructor(i,s){this.edge=i,this.view=s}get id(){return this.edge.id}get source(){return this.view.element(this.edge.source)}get target(){return this.view.element(this.edge.target)}get tags(){return this.edge.tags??[]}get color(){return this.edge.color??Ds}relationships(){return this.edge.relations.map(i=>Ze(this.view.model.relationship(i)))}}t.Connection=n})(ja||(ja={}));let Cd=class I0{constructor(e,n){this.view=e,this.model=n;for(const r of e.nodes){const i=new I0.Element(r,this);this._elements.set(r.id,i),Pi(r.parent)&&this._rootElements.add(i)}this._connections=new Map(e.edges.map(r=>[r.id,new I0.Connection(r,this)]))}_rootElements=new Set;_elements=new Map;_connections;get id(){return this.view.id}get title(){return this.view.title}get viewOf(){return this.view.__!=="dynamic"&&this.view.viewOf?this.model.element(this.view.viewOf):null}get tags(){return this.view.tags??[]}roots(){return[...this._rootElements]}elements(){return[...this._elements.values()]}element(e){return Ze(this._elements.get(e),`LikeC4ViewModel.Element ${e} in view ${this.id} not found`)}hasElement(e){return this._elements.has(e)}connections(){return[...this._connections.values()]}connection(e){return Ze(this._connections.get(e),`Connection ${e} in view ${this.id} not found`)}findConnections(e,n,r="direct"){const i=it(e),s=it(n);return this.connections().filter(o=>o.source.id===i&&o.target.id===s||r==="both"&&o.source.id===s&&o.target.id===i)}parent(e){const n=this.element(it(e));return n.node.parent?this.element(n.node.parent):null}children(e){return this.element(it(e)).node.children.map(n=>this.element(n))}siblings(e){const n=it(e),r=this.parent(n);return(r?this.children(r):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=it(e);const r=[];let i;for(;i=this.parent(n);)r.push(i),n=i.id;return r}descendants(e){return this.children(e).flatMap(n=>[n,...this.descendants(n.id)])}incoming(e,n="all"){const r=this.element(it(e)),i=r.node.inEdges.map(s=>Ze(this._connections.get(s),`Edge ${s} not found`));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.target.id===r.id:s.target.id!==r.id)}incomers(e,n="all"){return[...new Set(this.incoming(e,n).map(r=>r.source))]}outgoing(e,n="all"){const r=this.element(it(e)),i=r.node.outEdges.map(s=>Ze(this._connections.get(s),`Edge ${s} not found`));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.source.id===r.id:s.source.id!==r.id)}outgoers(e,n="all"){return[...new Set(this.outgoing(e,n).map(r=>r.target))]}};(t=>{class e{constructor(i,s){this.node=i,this.viewmodel=s}get id(){return this.node.id}get title(){return this.node.title}get kind(){return this.node.kind}get isRoot(){return Pi(this.node.parent)}get hasNested(){return this.node.children.length>0}get shape(){return this.node.shape}get color(){return this.node.color}get tags(){return this.node.tags??[]}model(){return this.viewmodel.model.element(this.id)}parent(){return this.node.parent?this.viewmodel.element(this.node.parent):null}metadata(i,s){return this.model().metadata(i)??s}hasMetadata(i){return this.model().hasMetadata(i)}ancestors(){return this.viewmodel.ancestors(this)}siblings(){return this.viewmodel.siblings(this)}descendants(){return this.viewmodel.descendants(this)}children(){return this.viewmodel.children(this)}incoming(i="all"){return this.viewmodel.incoming(this,i)}incomers(i="all"){return this.viewmodel.incomers(this,i)}outgoing(i="all"){return this.viewmodel.outgoing(this,i)}outgoers(i="all"){return this.viewmodel.outgoers(this,i)}connectionsTo(i){return this.viewmodel.findConnections(this,i)}}t.Element=e;class n{constructor(i,s){this.edge=i,this.viewmodel=s}get id(){return this.edge.id}get source(){return this.viewmodel.element(this.edge.source)}get target(){return this.viewmodel.element(this.edge.target)}get tags(){return this.edge.tags??[]}relationships(){return this.edge.relations.map(i=>Ze(this.viewmodel.model.relationship(i)))}}t.Connection=n})(Cd||(Cd={}));let Ua=class P0{constructor(e,n,r,i,s,o){this.type=e,this.sourcemodel=n;for(const a of r)this.addElement(a);for(const a of i)this.addRelation(a);this._views=new Map(La(s).map(a=>[a.id,new o(a,this)]))}_elements=new Map;_parents=new Map;_children=new Map;_rootElements=new Set;_relations=new Map;_incoming=new Map;_outgoing=new Map;_internal=new Map;_cacheAscendingSiblings=new Map;_views;roots(){return[...this._rootElements]}elements(){return[...this._elements.values()]}element(e){return Ze(this._elements.get(e),`Element ${e} not found`)}relationships(){return[...this._relations.values()]}relationship(e){return Ze(this._relations.get(e),`Relation ${e} not found`)}views(){return[...this._views.values()]}view(e){return Ze(this._views.get(e),`View ${e} not found`)}parent(e){const n=it(e);return this._parents.get(n)||null}children(e){const n=it(e);return this._childrenOf(n)}siblings(e){const n=it(e),r=this._parents.get(n);return(r?this._childrenOf(r.id):this.roots()).filter(i=>i.id!==n)}ancestors(e){let n=Ts(e)?e:e.id;const r=[];let i;for(;i=this._parents.get(n);)r.push(i),n=i.id;return r}descendants(e){const n=it(e);return this._childrenOf(n).flatMap(r=>[r,...this.descendants(r.id)])}incoming(e,n="all"){const r=it(e),i=Array.from(this._incomingTo(r));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.target.id===r:s.target.id!==r)}incomers(e,n="all"){return[...new Set(this.incoming(e,n).map(r=>r.source))]}outgoing(e,n="all"){const r=it(e),i=Array.from(this._outgoingFrom(r));return n==="all"||i.length===0?i:i.filter(s=>n==="direct"?s.source.id===r:s.source.id!==r)}outgoers(e,n="all"){return[...new Set(this.outgoing(e,n).map(r=>r.target))]}internal(e){const n=it(e);return Array.from(this._internalOf(n))}ascendingSiblings(e){const n=it(e);let r=this._cacheAscendingSiblings.get(n);return r||(r=[...this.siblings(n),...this.ancestors(n).flatMap(i=>this.siblings(i.id))],this._cacheAscendingSiblings.set(n,r)),r.slice()}viewsWithElement(e){const n=it(e);return[...this._views.values()].filter(r=>r.hasElement(n))}addElement(e){if(this._elements.has(e.id))throw new Error(`Element ${e.id} already exists`);const n=new P0.ElementModel(e,this);this._elements.set(n.id,n);const r=kt(n.id);r?(this._parents.set(n.id,this.element(r)),this._childrenOf(r).push(n)):this._rootElements.add(n)}addRelation(e){if(this._relations.has(e.id))throw new Error(`Relation ${e.id} already exists`);const n=new P0.Relationship(e,this);this._relations.set(n.id,n),this._incomingTo(e.target).add(n),this._outgoingFrom(e.source).add(n);const r=Ss(e.source,e.target);if(r)for(const i of[r,...Qr(r)])this._internalOf(i).add(n);for(const i of Qr(e.source)){if(i===r)break;this._outgoingFrom(i).add(n)}for(const i of Qr(e.target)){if(i===r)break;this._incomingTo(i).add(n)}}_childrenOf(e){let n=this._children.get(e);return n||(n=[],this._children.set(e,n)),n}_incomingTo(e){let n=this._incoming.get(e);return n||(n=new Set,this._incoming.set(e,n)),n}_outgoingFrom(e){let n=this._outgoing.get(e);return n||(n=new Set,this._outgoing.set(e,n)),n}_internalOf(e){let n=this._internal.get(e);return n||(n=new Set,this._internal.set(e,n)),n}};(t=>{function e(c){return c.__==="layouted"?t.layouted(c):t.computed(c)}t.create=e;function n(c){return new t("computed",c,La(c.elements),La(c.relations),c.views,Cd)}t.computed=n;function r(c){return new t("layouted",c,La(c.elements),La(c.relations),c.views,ja)}t.layouted=r;function i(c){return c instanceof t}t.isModel=i,(c=>{function u(l){return l instanceof ja}c.isLayouted=u})(t.ViewModel||(t.ViewModel={}));function s(c){return c.type==="layouted"}t.isLayouted=s;class o{constructor(u,l){this.relationship=u,this.model=l}get id(){return this.relationship.id}get title(){return this.relationship.title}get kind(){return this.relationship.kind??null}get tags(){return this.relationship.tags??[]}get source(){return this.model.element(this.relationship.source)}get target(){return this.model.element(this.relationship.target)}metadata(u,l){return this.relationship.metadata?.[u]??l}hasMetadata(u){return TE(this.relationship.metadata?.[u])}}t.Relationship=o;class a{constructor(u,l){this.element=u,this.model=l}get id(){return this.element.id}get title(){return this.element.title}get kind(){return this.element.kind}get isRoot(){return kt(this.element.id)===null}get hasNested(){return this.model.children(this).length>0}get shape(){return this.element.shape??yg}get color(){return this.element.color??Na}get tags(){return this.element.tags??[]}parent(){return this.model.parent(this)}metadata(u,l){return this.element.metadata?.[u]??l}hasMetadata(u){return TE(this.element.metadata?.[u])}ancestors(){return this.model.ancestors(this)}siblings(){return this.model.siblings(this)}descendants(){return this.model.descendants(this)}children(){return this.model.children(this)}viewsOf(){return this.model.views().filter(u=>u.viewOf?.id===this.id)}views(){return this.model.viewsWithElement(this)}incoming(u){return this.model.incoming(this,u)}incomers(u){return this.model.incomers(this,u)}outgoing(u){return this.model.outgoing(this,u)}outgoers(u){return this.model.outgoers(this,u)}internal(){return this.model.internal(this)}ascendingSiblings(){return this.model.ascendingSiblings(this)}}t.ElementModel=a})(Ua||(Ua={}));function WL(t,e,n){return t.length===0||e.length===0?[]:(n??=Object.is,c2(d2(t,e),p2(([r,i])=>n(r,i)),md(([r,i])=>r)))}const HL="LIKEC4_DELAY";function $D(...t){let e=100;return t.length===2?e=y2(t[0],t[1]):t.length===1&&(e=t[0]),new Promise(n=>{setTimeout(()=>{n(HL)},e??100)})}const Ga=(t,e)=>{const n=Ss(t.source,t.target),r=Ss(e.source,e.target);if(n&&!r)return 1;if(!n&&r)return-1;const i=n&&r?$o(n,r):0;if(i!==0)return i;const s=$o(t.source,e.source);return s!==0?s:$o(t.target,e.target)};function vt(t){return typeof t=="object"&&t!==null&&typeof t.$type=="string"}function Wn(t){return typeof t=="object"&&t!==null&&typeof t.$refText=="string"}function VL(t){return typeof t=="object"&&t!==null&&typeof t.name=="string"&&typeof t.type=="string"&&typeof t.path=="string"}function _d(t){return typeof t=="object"&&t!==null&&vt(t.container)&&Wn(t.reference)&&typeof t.message=="string"}class CD{constructor(){this.subtypes={},this.allSubtypes={}}isInstance(e,n){return vt(e)&&this.isSubtype(e.$type,n)}isSubtype(e,n){if(e===n)return!0;let r=this.subtypes[e];r||(r=this.subtypes[e]={});const i=r[n];if(i!==void 0)return i;{const s=this.computeIsSubtype(e,n);return r[n]=s,s}}getAllSubTypes(e){const n=this.allSubtypes[e];if(n)return n;{const r=this.getAllTypes(),i=[];for(const s of r)this.isSubtype(s,e)&&i.push(s);return this.allSubtypes[e]=i,i}}}function ii(t){return typeof t=="object"&&t!==null&&Array.isArray(t.content)}function $s(t){return typeof t=="object"&&t!==null&&typeof t.tokenType=="object"}function _D(t){return ii(t)&&typeof t.fullText=="string"}class xt{constructor(e,n){this.startFn=e,this.nextFn=n}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),[Symbol.iterator]:()=>e};return e}[Symbol.iterator](){return this.iterator()}isEmpty(){return!!this.iterator().next().done}count(){const e=this.iterator();let n=0,r=e.next();for(;!r.done;)n++,r=e.next();return n}toArray(){const e=[],n=this.iterator();let r;do r=n.next(),r.value!==void 0&&e.push(r.value);while(!r.done);return e}toSet(){return new Set(this)}toMap(e,n){const r=this.map(i=>[e?e(i):i,n?n(i):i]);return new Map(r)}toString(){return this.join()}concat(e){return new xt(()=>({first:this.startFn(),firstDone:!1,iterator:e[Symbol.iterator]()}),n=>{let r;if(!n.firstDone){do if(r=this.nextFn(n.first),!r.done)return r;while(!r.done);n.firstDone=!0}do if(r=n.iterator.next(),!r.done)return r;while(!r.done);return Yt})}join(e=","){const n=this.iterator();let r="",i,s=!1;do i=n.next(),i.done||(s&&(r+=e),r+=KL(i.value)),s=!0;while(!i.done);return r}indexOf(e,n=0){const r=this.iterator();let i=0,s=r.next();for(;!s.done;){if(i>=n&&s.value===e)return i;s=r.next(),i++}return-1}every(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(!e(r.value))return!1;r=n.next()}return!0}some(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return!0;r=n.next()}return!1}forEach(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;)e(i.value,r),i=n.next(),r++}map(e){return new xt(this.startFn,n=>{const{done:r,value:i}=this.nextFn(n);return r?Yt:{done:!1,value:e(i)}})}filter(e){return new xt(this.startFn,n=>{let r;do if(r=this.nextFn(n),!r.done&&e(r.value))return r;while(!r.done);return Yt})}nonNullable(){return this.filter(e=>e!=null)}reduce(e,n){const r=this.iterator();let i=n,s=r.next();for(;!s.done;)i===void 0?i=s.value:i=e(i,s.value),s=r.next();return i}reduceRight(e,n){return this.recursiveReduce(this.iterator(),e,n)}recursiveReduce(e,n,r){const i=e.next();if(i.done)return r;const s=this.recursiveReduce(e,n,r);return s===void 0?i.value:n(s,i.value)}find(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(e(r.value))return r.value;r=n.next()}}findIndex(e){const n=this.iterator();let r=0,i=n.next();for(;!i.done;){if(e(i.value))return r;i=n.next(),r++}return-1}includes(e){const n=this.iterator();let r=n.next();for(;!r.done;){if(r.value===e)return!0;r=n.next()}return!1}flatMap(e){return new xt(()=>({this:this.startFn()}),n=>{do{if(n.iterator){const s=n.iterator.next();if(s.done)n.iterator=void 0;else return s}const{done:r,value:i}=this.nextFn(n.this);if(!r){const s=e(i);if(Ad(s))n.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}}while(n.iterator);return Yt})}flat(e){if(e===void 0&&(e=1),e<=0)return this;const n=e>1?this.flat(e-1):this;return new xt(()=>({this:n.startFn()}),r=>{do{if(r.iterator){const o=r.iterator.next();if(o.done)r.iterator=void 0;else return o}const{done:i,value:s}=n.nextFn(r.this);if(!i)if(Ad(s))r.iterator=s[Symbol.iterator]();else return{done:!1,value:s}}while(r.iterator);return Yt})}head(){const n=this.iterator().next();if(!n.done)return n.value}tail(e=1){return new xt(()=>{const n=this.startFn();for(let r=0;r<e;r++)if(this.nextFn(n).done)return n;return n},this.nextFn)}limit(e){return new xt(()=>({size:0,state:this.startFn()}),n=>(n.size++,n.size>e?Yt:this.nextFn(n.state)))}distinct(e){return new xt(()=>({set:new Set,internalState:this.startFn()}),n=>{let r;do if(r=this.nextFn(n.internalState),!r.done){const i=e?e(r.value):r.value;if(!n.set.has(i))return n.set.add(i),r}while(!r.done);return Yt})}exclude(e,n){const r=new Set;for(const i of e){const s=n?n(i):i;r.add(s)}return this.filter(i=>{const s=n?n(i):i;return!r.has(s)})}}function KL(t){return typeof t=="string"?t:typeof t>"u"?"undefined":typeof t.toString=="function"?t.toString():Object.prototype.toString.call(t)}function Ad(t){return!!t&&typeof t[Symbol.iterator]=="function"}const Lo=new xt(()=>{},()=>Yt),Yt=Object.freeze({done:!0,value:void 0});function Qe(...t){if(t.length===1){const e=t[0];if(e instanceof xt)return e;if(Ad(e))return new xt(()=>e[Symbol.iterator](),n=>n.next());if(typeof e.length=="number")return new xt(()=>({index:0}),n=>n.index<e.length?{done:!1,value:e[n.index++]}:Yt)}return t.length>1?new xt(()=>({collIndex:0,arrIndex:0}),e=>{do{if(e.iterator){const n=e.iterator.next();if(!n.done)return n;e.iterator=void 0}if(e.array){if(e.arrIndex<e.array.length)return{done:!1,value:e.array[e.arrIndex++]};e.array=void 0,e.arrIndex=0}if(e.collIndex<t.length){const n=t[e.collIndex++];Ad(n)?e.iterator=n[Symbol.iterator]():n&&typeof n.length=="number"&&(e.array=n)}}while(e.iterator||e.array||e.collIndex<t.length);return Yt}):Lo}class Mo extends xt{constructor(e,n,r){super(()=>({iterators:r?.includeRoot?[[e][Symbol.iterator]()]:[n(e)[Symbol.iterator]()],pruned:!1}),i=>{for(i.pruned&&(i.iterators.pop(),i.pruned=!1);i.iterators.length>0;){const o=i.iterators[i.iterators.length-1].next();if(o.done)i.iterators.pop();else return i.iterators.push(n(o.value)[Symbol.iterator]()),o}return Yt})}iterator(){const e={state:this.startFn(),next:()=>this.nextFn(e.state),prune:()=>{e.state.pruned=!0},[Symbol.iterator]:()=>e};return e}}var Zg;(function(t){function e(s){return s.reduce((o,a)=>o+a,0)}t.sum=e;function n(s){return s.reduce((o,a)=>o*a,0)}t.product=n;function r(s){return s.reduce((o,a)=>Math.min(o,a))}t.min=r;function i(s){return s.reduce((o,a)=>Math.max(o,a))}t.max=i})(Zg||(Zg={}));function Wa(t){return new Mo(t,e=>ii(e)?e.content:[],{includeRoot:!0})}function AD(t){return Wa(t).filter($s)}function xD(t,e){for(;t.container;)if(t=t.container,t===e)return!0;return!1}function xd(t){return{start:{character:t.startColumn-1,line:t.startLine-1},end:{character:t.endColumn,line:t.endLine-1}}}function Ha(t){if(!t)return;const{offset:e,end:n,range:r}=t;return{range:r,offset:e,end:n,length:n-e}}var Ar;(function(t){t[t.Before=0]="Before",t[t.After=1]="After",t[t.OverlapFront=2]="OverlapFront",t[t.OverlapBack=3]="OverlapBack",t[t.Inside=4]="Inside",t[t.Outside=5]="Outside"})(Ar||(Ar={}));function ID(t,e){if(t.end.line<e.start.line||t.end.line===e.start.line&&t.end.character<=e.start.character)return Ar.Before;if(t.start.line>e.end.line||t.start.line===e.end.line&&t.start.character>=e.end.character)return Ar.After;const n=t.start.line>e.start.line||t.start.line===e.start.line&&t.start.character>=e.start.character,r=t.end.line<e.end.line||t.end.line===e.end.line&&t.end.character<=e.end.character;return n&&r?Ar.Inside:n?Ar.OverlapBack:r?Ar.OverlapFront:Ar.Outside}function Qg(t,e){return ID(t,e)>Ar.After}const em=/^[\w\p{L}]$/u;function Fi(t,e,n=em){if(t){if(e>0){const r=e-t.offset,i=t.text.charAt(r);n.test(i)||e--}return nm(t,e)}}function Id(t,e){if(t){const n=ND(t,!0);if(n&&tm(n,e))return n;if(_D(t)){const r=t.content.findIndex(i=>!i.hidden);for(let i=r-1;i>=0;i--){const s=t.content[i];if(tm(s,e))return s}}}}function tm(t,e){return $s(t)&&e.includes(t.tokenType.name)}function nm(t,e){if($s(t))return t;if(ii(t)){const n=PD(t,e,!1);if(n)return nm(n,e)}}function Pd(t,e){if($s(t))return t;if(ii(t)){const n=PD(t,e,!0);if(n)return Pd(n,e)}}function PD(t,e,n){let r=0,i=t.content.length-1,s;for(;r<=i;){const o=Math.floor((r+i)/2),a=t.content[o];if(a.offset<=e&&a.end>e)return a;a.end<=e?(s=n?a:void 0,r=o+1):i=o-1}return s}function ND(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);for(;r>0;){r--;const i=n.content[r];if(e||!i.hidden)return i}t=n}}function OD(t,e=!0){for(;t.container;){const n=t.container;let r=n.content.indexOf(t);const i=n.content.length-1;for(;r<i;){r++;const s=n.content[r];if(e||!s.hidden)return s}t=n}}function YL(t){if(t.range.start.character===0)return t;const e=t.range.start.line;let n=t,r;for(;t.container;){const i=t.container,s=r??i.content.indexOf(t);if(s===0?(t=i,r=void 0):(r=s-1,t=i.content[r]),t.range.start.line!==e)break;n=t}return n}function FD(t,e){const n=XL(t,e);return n?n.parent.content.slice(n.a+1,n.b):[]}function XL(t,e){const n=LD(t),r=LD(e);let i;for(let s=0;s<n.length&&s<r.length;s++){const o=n[s],a=r[s];if(o.parent===a.parent)i={parent:o.parent,a:o.index,b:a.index};else break}return i}function LD(t){const e=[];for(;t.container;){const n=t.container,r=n.content.indexOf(t);e.push({parent:n,index:r}),t=n}return e.reverse()}const JL={__proto__:null,DefaultNameRegexp:em,get RangeComparison(){return Ar},compareRange:ID,findCommentNode:Id,findDeclarationNodeAtOffset:Fi,findLeafNodeAtOffset:nm,findLeafNodeBeforeOffset:Pd,flattenCst:AD,getInteriorNodes:FD,getNextNode:OD,getPreviousNode:ND,getStartlineNode:YL,inRange:Qg,isChildNode:xD,isCommentNode:tm,streamCst:Wa,toDocumentSegment:Ha,tokenToRange:xd};class MD extends Error{constructor(e,n){super(e?`${n} at ${e.range.start.line}:${e.range.start.character}`:n)}}function Nd(t){throw new Error("Error! The input value was not handled.")}const Od="AbstractRule",Fd="AbstractType",rm="Condition",zD="TypeDefinition",im="ValueLiteral",Va="AbstractElement";function sm(t){return ze.isInstance(t,Va)}const Ld="ArrayLiteral",Ka="ArrayType";function ZL(t){return ze.isInstance(t,Ka)}const Ya="BooleanLiteral";function QL(t){return ze.isInstance(t,Ya)}const Xa="Conjunction";function eM(t){return ze.isInstance(t,Xa)}const Ja="Disjunction";function tM(t){return ze.isInstance(t,Ja)}const Md="Grammar",om="GrammarImport",Za="InferredType";function BD(t){return ze.isInstance(t,Za)}const Qa="Interface";function qD(t){return ze.isInstance(t,Qa)}const am="NamedArgument",ec="Negation";function nM(t){return ze.isInstance(t,ec)}const zd="NumberLiteral",Bd="Parameter",tc="ParameterReference";function rM(t){return ze.isInstance(t,tc)}const nc="ParserRule";function Xt(t){return ze.isInstance(t,nc)}const rc="ReferenceType";function iM(t){return ze.isInstance(t,rc)}const qd="ReturnType";function sM(t){return ze.isInstance(t,qd)}const ic="SimpleType";function jD(t){return ze.isInstance(t,ic)}const jd="StringLiteral",zo="TerminalRule";function si(t){return ze.isInstance(t,zo)}const sc="Type";function cm(t){return ze.isInstance(t,sc)}const um="TypeAttribute",oc="UnionType";function oM(t){return ze.isInstance(t,oc)}const ac="Action";function Cs(t){return ze.isInstance(t,ac)}const cc="Alternatives";function lm(t){return ze.isInstance(t,cc)}const uc="Assignment";function xr(t){return ze.isInstance(t,uc)}const lc="CharacterRange";function aM(t){return ze.isInstance(t,lc)}const dc="CrossReference";function fc(t){return ze.isInstance(t,dc)}const hc="EndOfFile";function cM(t){return ze.isInstance(t,hc)}const pc="Group";function Li(t){return ze.isInstance(t,pc)}const gc="Keyword";function Ir(t){return ze.isInstance(t,gc)}const mc="NegatedToken";function uM(t){return ze.isInstance(t,mc)}const yc="RegexToken";function lM(t){return ze.isInstance(t,yc)}const vc="RuleCall";function oi(t){return ze.isInstance(t,vc)}const wc="TerminalAlternatives";function dM(t){return ze.isInstance(t,wc)}const bc="TerminalGroup";function fM(t){return ze.isInstance(t,bc)}const Ec="TerminalRuleCall";function UD(t){return ze.isInstance(t,Ec)}const Dc="UnorderedGroup";function dm(t){return ze.isInstance(t,Dc)}const Tc="UntilToken";function hM(t){return ze.isInstance(t,Tc)}const Rc="Wildcard";function pM(t){return ze.isInstance(t,Rc)}class GD extends CD{getAllTypes(){return[Va,Od,Fd,ac,cc,Ld,Ka,uc,Ya,lc,rm,Xa,dc,Ja,hc,Md,om,pc,Za,Qa,gc,am,mc,ec,zd,Bd,tc,nc,rc,yc,qd,vc,ic,jd,wc,bc,zo,Ec,sc,um,zD,oc,Dc,Tc,im,Rc]}computeIsSubtype(e,n){switch(e){case ac:case cc:case uc:case lc:case dc:case hc:case pc:case gc:case mc:case yc:case vc:case wc:case bc:case Ec:case Dc:case Tc:case Rc:return this.isSubtype(Va,n);case Ld:case zd:case jd:return this.isSubtype(im,n);case Ka:case rc:case ic:case oc:return this.isSubtype(zD,n);case Ya:return this.isSubtype(rm,n)||this.isSubtype(im,n);case Xa:case Ja:case ec:case tc:return this.isSubtype(rm,n);case Za:case Qa:case sc:return this.isSubtype(Fd,n);case nc:return this.isSubtype(Od,n)||this.isSubtype(Fd,n);case zo:return this.isSubtype(Od,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"Action:type":case"CrossReference:type":case"Interface:superTypes":case"ParserRule:returnType":case"SimpleType:typeRef":return Fd;case"Grammar:hiddenTokens":case"ParserRule:hiddenTokens":case"RuleCall:rule":return Od;case"Grammar:usedGrammars":return Md;case"NamedArgument:parameter":case"ParameterReference:parameter":return Bd;case"TerminalRuleCall:rule":return zo;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case Va:return{name:Va,properties:[{name:"cardinality"},{name:"lookahead"}]};case Ld:return{name:Ld,properties:[{name:"elements",defaultValue:[]}]};case Ka:return{name:Ka,properties:[{name:"elementType"}]};case Ya:return{name:Ya,properties:[{name:"true",defaultValue:!1}]};case Xa:return{name:Xa,properties:[{name:"left"},{name:"right"}]};case Ja:return{name:Ja,properties:[{name:"left"},{name:"right"}]};case Md:return{name:Md,properties:[{name:"definesHiddenTokens",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"imports",defaultValue:[]},{name:"interfaces",defaultValue:[]},{name:"isDeclared",defaultValue:!1},{name:"name"},{name:"rules",defaultValue:[]},{name:"types",defaultValue:[]},{name:"usedGrammars",defaultValue:[]}]};case om:return{name:om,properties:[{name:"path"}]};case Za:return{name:Za,properties:[{name:"name"}]};case Qa:return{name:Qa,properties:[{name:"attributes",defaultValue:[]},{name:"name"},{name:"superTypes",defaultValue:[]}]};case am:return{name:am,properties:[{name:"calledByName",defaultValue:!1},{name:"parameter"},{name:"value"}]};case ec:return{name:ec,properties:[{name:"value"}]};case zd:return{name:zd,properties:[{name:"value"}]};case Bd:return{name:Bd,properties:[{name:"name"}]};case tc:return{name:tc,properties:[{name:"parameter"}]};case nc:return{name:nc,properties:[{name:"dataType"},{name:"definesHiddenTokens",defaultValue:!1},{name:"definition"},{name:"entry",defaultValue:!1},{name:"fragment",defaultValue:!1},{name:"hiddenTokens",defaultValue:[]},{name:"inferredType"},{name:"name"},{name:"parameters",defaultValue:[]},{name:"returnType"},{name:"wildcard",defaultValue:!1}]};case rc:return{name:rc,properties:[{name:"referenceType"}]};case qd:return{name:qd,properties:[{name:"name"}]};case ic:return{name:ic,properties:[{name:"primitiveType"},{name:"stringType"},{name:"typeRef"}]};case jd:return{name:jd,properties:[{name:"value"}]};case zo:return{name:zo,properties:[{name:"definition"},{name:"fragment",defaultValue:!1},{name:"hidden",defaultValue:!1},{name:"name"},{name:"type"}]};case sc:return{name:sc,properties:[{name:"name"},{name:"type"}]};case um:return{name:um,properties:[{name:"defaultValue"},{name:"isOptional",defaultValue:!1},{name:"name"},{name:"type"}]};case oc:return{name:oc,properties:[{name:"types",defaultValue:[]}]};case ac:return{name:ac,properties:[{name:"cardinality"},{name:"feature"},{name:"inferredType"},{name:"lookahead"},{name:"operator"},{name:"type"}]};case cc:return{name:cc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case uc:return{name:uc,properties:[{name:"cardinality"},{name:"feature"},{name:"lookahead"},{name:"operator"},{name:"terminal"}]};case lc:return{name:lc,properties:[{name:"cardinality"},{name:"left"},{name:"lookahead"},{name:"right"}]};case dc:return{name:dc,properties:[{name:"cardinality"},{name:"deprecatedSyntax",defaultValue:!1},{name:"lookahead"},{name:"terminal"},{name:"type"}]};case hc:return{name:hc,properties:[{name:"cardinality"},{name:"lookahead"}]};case pc:return{name:pc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"guardCondition"},{name:"lookahead"}]};case gc:return{name:gc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"value"}]};case mc:return{name:mc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case yc:return{name:yc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"regex"}]};case vc:return{name:vc,properties:[{name:"arguments",defaultValue:[]},{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case wc:return{name:wc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case bc:return{name:bc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Ec:return{name:Ec,properties:[{name:"cardinality"},{name:"lookahead"},{name:"rule"}]};case Dc:return{name:Dc,properties:[{name:"cardinality"},{name:"elements",defaultValue:[]},{name:"lookahead"}]};case Tc:return{name:Tc,properties:[{name:"cardinality"},{name:"lookahead"},{name:"terminal"}]};case Rc:return{name:Rc,properties:[{name:"cardinality"},{name:"lookahead"}]};default:return{name:e,properties:[]}}}}const ze=new GD;function fm(t){for(const[e,n]of Object.entries(t))e.startsWith("$")||(Array.isArray(n)?n.forEach((r,i)=>{vt(r)&&(r.$container=t,r.$containerProperty=e,r.$containerIndex=i)}):vt(n)&&(n.$container=t,n.$containerProperty=e))}function wn(t,e){let n=t;for(;n;){if(e(n))return n;n=n.$container}}function Sc(t,e){let n=t;for(;n;){if(e(n))return!0;n=n.$container}return!1}function sn(t){const n=Ud(t).$document;if(!n)throw new Error("AST node has no document.");return n}function Ud(t){for(;t.$container;)t=t.$container;return t}function kc(t,e){if(!t)throw new Error("Node must be an AstNode.");const n=e?.range;return new xt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),r=>{for(;r.keyIndex<r.keys.length;){const i=r.keys[r.keyIndex];if(!i.startsWith("$")){const s=t[i];if(vt(s)){if(r.keyIndex++,hm(s,n))return{done:!1,value:s}}else if(Array.isArray(s)){for(;r.arrayIndex<s.length;){const o=r.arrayIndex++,a=s[o];if(vt(a)&&hm(a,n))return{done:!1,value:a}}r.arrayIndex=0}}r.keyIndex++}return Yt})}function Pr(t,e){if(!t)throw new Error("Root node must be an AstNode.");return new Mo(t,n=>kc(n,e))}function ai(t,e){if(t){if(e?.range&&!hm(t,e.range))return new Mo(t,()=>[])}else throw new Error("Root node must be an AstNode.");return new Mo(t,n=>kc(n,e),{includeRoot:!0})}function hm(t,e){var n;if(!e)return!0;const r=(n=t.$cstNode)===null||n===void 0?void 0:n.range;return r?Qg(r,e):!1}function Gd(t){return new xt(()=>({keys:Object.keys(t),keyIndex:0,arrayIndex:0}),e=>{for(;e.keyIndex<e.keys.length;){const n=e.keys[e.keyIndex];if(!n.startsWith("$")){const r=t[n];if(Wn(r))return e.keyIndex++,{done:!1,value:{reference:r,container:t,property:n}};if(Array.isArray(r)){for(;e.arrayIndex<r.length;){const i=e.arrayIndex++,s=r[i];if(Wn(s))return{done:!1,value:{reference:s,container:t,property:n,index:i}}}e.arrayIndex=0}}e.keyIndex++}return Yt})}function gM(t,e=sn(t).parseResult.value){const n=[];return ai(e).forEach(r=>{Gd(r).forEach(i=>{i.reference.ref===t&&n.push(i.reference)})}),Qe(n)}function pm(t,e){const n=t.getTypeMetaData(e.$type),r=e;for(const i of n.properties)i.defaultValue!==void 0&&r[i.name]===void 0&&(r[i.name]=WD(i.defaultValue))}function WD(t){return Array.isArray(t)?[...t.map(WD)]:t}function gm(t,e){const n={$type:t.$type};for(const[r,i]of Object.entries(t))if(!r.startsWith("$"))if(vt(i))n[r]=gm(i,e);else if(Wn(i))n[r]=e(n,r,i.$refNode,i.$refText);else if(Array.isArray(i)){const s=[];for(const o of i)vt(o)?s.push(gm(o,e)):Wn(o)?s.push(e(n,r,o.$refNode,o.$refText)):s.push(o);n[r]=s}else n[r]=i;return fm(n),n}const Wd={__proto__:null,assignMandatoryProperties:pm,copyAstNode:gm,findLocalReferences:gM,findRootNode:Ud,getContainerOfType:wn,getDocument:sn,hasContainerOfType:Sc,linkContentToContainer:fm,streamAllContents:Pr,streamAst:ai,streamContents:kc,streamReferences:Gd};function De(t){return t.charCodeAt(0)}function mm(t,e){Array.isArray(t)?t.forEach(function(n){e.push(n)}):e.push(t)}function $c(t,e){if(t[e]===!0)throw"duplicate flag "+e;t[e],t[e]=!0}function Bo(t){if(t===void 0)throw Error("Internal Error - Should never get here!");return!0}function mM(){throw Error("Internal Error - Should never get here!")}function HD(t){return t.type==="Character"}const Hd=[];for(let t=De("0");t<=De("9");t++)Hd.push(t);const Vd=[De("_")].concat(Hd);for(let t=De("a");t<=De("z");t++)Vd.push(t);for(let t=De("A");t<=De("Z");t++)Vd.push(t);const VD=[De(" "),De("\f"),De(`
2
+ `),De("\r"),De(" "),De("\v"),De(" "),De("\xA0"),De("\u1680"),De("\u2000"),De("\u2001"),De("\u2002"),De("\u2003"),De("\u2004"),De("\u2005"),De("\u2006"),De("\u2007"),De("\u2008"),De("\u2009"),De("\u200A"),De("\u2028"),De("\u2029"),De("\u202F"),De("\u205F"),De("\u3000"),De("\uFEFF")],yM=/[0-9a-fA-F]/,Kd=/[0-9]/,vM=/[1-9]/;class KD{constructor(){this.idx=0,this.input="",this.groupIdx=0}saveState(){return{idx:this.idx,input:this.input,groupIdx:this.groupIdx}}restoreState(e){this.idx=e.idx,this.input=e.input,this.groupIdx=e.groupIdx}pattern(e){this.idx=0,this.input=e,this.groupIdx=0,this.consumeChar("/");const n=this.disjunction();this.consumeChar("/");const r={type:"Flags",loc:{begin:this.idx,end:e.length},global:!1,ignoreCase:!1,multiLine:!1,unicode:!1,sticky:!1};for(;this.isRegExpFlag();)switch(this.popChar()){case"g":$c(r,"global");break;case"i":$c(r,"ignoreCase");break;case"m":$c(r,"multiLine");break;case"u":$c(r,"unicode");break;case"y":$c(r,"sticky");break}if(this.idx!==this.input.length)throw Error("Redundant input: "+this.input.substring(this.idx));return{type:"Pattern",flags:r,value:n,loc:this.loc(0)}}disjunction(){const e=[],n=this.idx;for(e.push(this.alternative());this.peekChar()==="|";)this.consumeChar("|"),e.push(this.alternative());return{type:"Disjunction",value:e,loc:this.loc(n)}}alternative(){const e=[],n=this.idx;for(;this.isTerm();)e.push(this.term());return{type:"Alternative",value:e,loc:this.loc(n)}}term(){return this.isAssertion()?this.assertion():this.atom()}assertion(){const e=this.idx;switch(this.popChar()){case"^":return{type:"StartAnchor",loc:this.loc(e)};case"$":return{type:"EndAnchor",loc:this.loc(e)};case"\\":switch(this.popChar()){case"b":return{type:"WordBoundary",loc:this.loc(e)};case"B":return{type:"NonWordBoundary",loc:this.loc(e)}}throw Error("Invalid Assertion Escape");case"(":this.consumeChar("?");let n;switch(this.popChar()){case"=":n="Lookahead";break;case"!":n="NegativeLookahead";break}Bo(n);const r=this.disjunction();return this.consumeChar(")"),{type:n,value:r,loc:this.loc(e)}}return mM()}quantifier(e=!1){let n;const r=this.idx;switch(this.popChar()){case"*":n={atLeast:0,atMost:1/0};break;case"+":n={atLeast:1,atMost:1/0};break;case"?":n={atLeast:0,atMost:1};break;case"{":const i=this.integerIncludingZero();switch(this.popChar()){case"}":n={atLeast:i,atMost:i};break;case",":let s;this.isDigit()?(s=this.integerIncludingZero(),n={atLeast:i,atMost:s}):n={atLeast:i,atMost:1/0},this.consumeChar("}");break}if(e===!0&&n===void 0)return;Bo(n);break}if(!(e===!0&&n===void 0)&&Bo(n))return this.peekChar(0)==="?"?(this.consumeChar("?"),n.greedy=!1):n.greedy=!0,n.type="Quantifier",n.loc=this.loc(r),n}atom(){let e;const n=this.idx;switch(this.peekChar()){case".":e=this.dotAll();break;case"\\":e=this.atomEscape();break;case"[":e=this.characterClass();break;case"(":e=this.group();break}if(e===void 0&&this.isPatternCharacter()&&(e=this.patternCharacter()),Bo(e))return e.loc=this.loc(n),this.isQuantifier()&&(e.quantifier=this.quantifier()),e}dotAll(){return this.consumeChar("."),{type:"Set",complement:!0,value:[De(`
3
+ `),De("\r"),De("\u2028"),De("\u2029")]}}atomEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":return this.decimalEscapeAtom();case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}decimalEscapeAtom(){return{type:"GroupBackReference",value:this.positiveInteger()}}characterClassEscape(){let e,n=!1;switch(this.popChar()){case"d":e=Hd;break;case"D":e=Hd,n=!0;break;case"s":e=VD;break;case"S":e=VD,n=!0;break;case"w":e=Vd;break;case"W":e=Vd,n=!0;break}if(Bo(e))return{type:"Set",value:e,complement:n}}controlEscapeAtom(){let e;switch(this.popChar()){case"f":e=De("\f");break;case"n":e=De(`
4
+ `);break;case"r":e=De("\r");break;case"t":e=De(" ");break;case"v":e=De("\v");break}if(Bo(e))return{type:"Character",value:e}}controlLetterEscapeAtom(){this.consumeChar("c");const e=this.popChar();if(/[a-zA-Z]/.test(e)===!1)throw Error("Invalid ");return{type:"Character",value:e.toUpperCase().charCodeAt(0)-64}}nulCharacterAtom(){return this.consumeChar("0"),{type:"Character",value:De("\0")}}hexEscapeSequenceAtom(){return this.consumeChar("x"),this.parseHexDigits(2)}regExpUnicodeEscapeSequenceAtom(){return this.consumeChar("u"),this.parseHexDigits(4)}identityEscapeAtom(){const e=this.popChar();return{type:"Character",value:De(e)}}classPatternCharacterAtom(){switch(this.peekChar()){case`
5
+ `:case"\r":case"\u2028":case"\u2029":case"\\":case"]":throw Error("TBD");default:const e=this.popChar();return{type:"Character",value:De(e)}}}characterClass(){const e=[];let n=!1;for(this.consumeChar("["),this.peekChar(0)==="^"&&(this.consumeChar("^"),n=!0);this.isClassAtom();){const r=this.classAtom();if(r.type,HD(r)&&this.isRangeDash()){this.consumeChar("-");const i=this.classAtom();if(i.type,HD(i)){if(i.value<r.value)throw Error("Range out of order in character class");e.push({from:r.value,to:i.value})}else mm(r.value,e),e.push(De("-")),mm(i.value,e)}else mm(r.value,e)}return this.consumeChar("]"),{type:"Set",complement:n,value:e}}classAtom(){switch(this.peekChar()){case"]":case`
6
+ `:case"\r":case"\u2028":case"\u2029":throw Error("TBD");case"\\":return this.classEscape();default:return this.classPatternCharacterAtom()}}classEscape(){switch(this.consumeChar("\\"),this.peekChar()){case"b":return this.consumeChar("b"),{type:"Character",value:De("\b")};case"d":case"D":case"s":case"S":case"w":case"W":return this.characterClassEscape();case"f":case"n":case"r":case"t":case"v":return this.controlEscapeAtom();case"c":return this.controlLetterEscapeAtom();case"0":return this.nulCharacterAtom();case"x":return this.hexEscapeSequenceAtom();case"u":return this.regExpUnicodeEscapeSequenceAtom();default:return this.identityEscapeAtom()}}group(){let e=!0;switch(this.consumeChar("("),this.peekChar(0)){case"?":this.consumeChar("?"),this.consumeChar(":"),e=!1;break;default:this.groupIdx++;break}const n=this.disjunction();this.consumeChar(")");const r={type:"Group",capturing:e,value:n};return e&&(r.idx=this.groupIdx),r}positiveInteger(){let e=this.popChar();if(vM.test(e)===!1)throw Error("Expecting a positive integer");for(;Kd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}integerIncludingZero(){let e=this.popChar();if(Kd.test(e)===!1)throw Error("Expecting an integer");for(;Kd.test(this.peekChar(0));)e+=this.popChar();return parseInt(e,10)}patternCharacter(){const e=this.popChar();switch(e){case`
7
+ `:case"\r":case"\u2028":case"\u2029":case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":throw Error("TBD");default:return{type:"Character",value:De(e)}}}isRegExpFlag(){switch(this.peekChar(0)){case"g":case"i":case"m":case"u":case"y":return!0;default:return!1}}isRangeDash(){return this.peekChar()==="-"&&this.isClassAtom(1)}isDigit(){return Kd.test(this.peekChar(0))}isClassAtom(e=0){switch(this.peekChar(e)){case"]":case`
8
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}isTerm(){return this.isAtom()||this.isAssertion()}isAtom(){if(this.isPatternCharacter())return!0;switch(this.peekChar(0)){case".":case"\\":case"[":case"(":return!0;default:return!1}}isAssertion(){switch(this.peekChar(0)){case"^":case"$":return!0;case"\\":switch(this.peekChar(1)){case"b":case"B":return!0;default:return!1}case"(":return this.peekChar(1)==="?"&&(this.peekChar(2)==="="||this.peekChar(2)==="!");default:return!1}}isQuantifier(){const e=this.saveState();try{return this.quantifier(!0)!==void 0}catch{return!1}finally{this.restoreState(e)}}isPatternCharacter(){switch(this.peekChar()){case"^":case"$":case"\\":case".":case"*":case"+":case"?":case"(":case")":case"[":case"|":case"/":case`
9
+ `:case"\r":case"\u2028":case"\u2029":return!1;default:return!0}}parseHexDigits(e){let n="";for(let i=0;i<e;i++){const s=this.popChar();if(yM.test(s)===!1)throw Error("Expecting a HexDecimal digits");n+=s}return{type:"Character",value:parseInt(n,16)}}peekChar(e=0){return this.input[this.idx+e]}popChar(){const e=this.peekChar(0);return this.consumeChar(void 0),e}consumeChar(e){if(e!==void 0&&this.input[this.idx]!==e)throw Error("Expected: '"+e+"' but found: '"+this.input[this.idx]+"' at offset: "+this.idx);if(this.idx>=this.input.length)throw Error("Unexpected end of input");this.idx++}loc(e){return{begin:e,end:this.idx}}}class Yd{visitChildren(e){for(const n in e){const r=e[n];e.hasOwnProperty(n)&&(r.type!==void 0?this.visit(r):Array.isArray(r)&&r.forEach(i=>{this.visit(i)},this))}}visit(e){switch(e.type){case"Pattern":this.visitPattern(e);break;case"Flags":this.visitFlags(e);break;case"Disjunction":this.visitDisjunction(e);break;case"Alternative":this.visitAlternative(e);break;case"StartAnchor":this.visitStartAnchor(e);break;case"EndAnchor":this.visitEndAnchor(e);break;case"WordBoundary":this.visitWordBoundary(e);break;case"NonWordBoundary":this.visitNonWordBoundary(e);break;case"Lookahead":this.visitLookahead(e);break;case"NegativeLookahead":this.visitNegativeLookahead(e);break;case"Character":this.visitCharacter(e);break;case"Set":this.visitSet(e);break;case"Group":this.visitGroup(e);break;case"GroupBackReference":this.visitGroupBackReference(e);break;case"Quantifier":this.visitQuantifier(e);break}this.visitChildren(e)}visitPattern(e){}visitFlags(e){}visitDisjunction(e){}visitAlternative(e){}visitStartAnchor(e){}visitEndAnchor(e){}visitWordBoundary(e){}visitNonWordBoundary(e){}visitLookahead(e){}visitNegativeLookahead(e){}visitCharacter(e){}visitSet(e){}visitGroup(e){}visitGroupBackReference(e){}visitQuantifier(e){}}const YD=/\r?\n/gm,wM=new KD;class bM extends Yd{constructor(){super(...arguments),this.isStarting=!0,this.endRegexpStack=[],this.multiline=!1}get endRegex(){return this.endRegexpStack.join("")}reset(e){this.multiline=!1,this.regex=e,this.startRegexp="",this.isStarting=!0,this.endRegexpStack=[]}visitGroup(e){e.quantifier&&(this.isStarting=!1,this.endRegexpStack=[])}visitCharacter(e){const n=String.fromCharCode(e.value);if(!this.multiline&&n===`
10
+ `&&(this.multiline=!0),e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const r=Xd(n);this.endRegexpStack.push(r),this.isStarting&&(this.startRegexp+=r)}}visitSet(e){if(!this.multiline){const n=this.regex.substring(e.loc.begin,e.loc.end),r=new RegExp(n);this.multiline=!!`
11
+ `.match(r)}if(e.quantifier)this.isStarting=!1,this.endRegexpStack=[];else{const n=this.regex.substring(e.loc.begin,e.loc.end);this.endRegexpStack.push(n),this.isStarting&&(this.startRegexp+=n)}}visitChildren(e){e.type==="Group"&&e.quantifier||super.visitChildren(e)}}const ym=new bM;function EM(t){try{return typeof t=="string"&&(t=new RegExp(t)),t=t.toString(),ym.reset(t),ym.visit(wM.pattern(t)),ym.multiline}catch{return!1}}const DM=`\f
12
+ \r \v \xA0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF`.split("");function vm(t){const e=typeof t=="string"?new RegExp(t):t;return DM.some(n=>e.test(n))}function Xd(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function TM(t){return Array.prototype.map.call(t,e=>/\w/.test(e)?`[${e.toLowerCase()}${e.toUpperCase()}]`:Xd(e)).join("")}function RM(t,e){const n=SM(t),r=e.match(n);return!!r&&r[0].length>0}function SM(t){typeof t=="string"&&(t=new RegExp(t));const e=t,n=t.source;let r=0;function i(){let s="",o;function a(u){s+=n.substr(r,u),r+=u}function c(u){s+="(?:"+n.substr(r,u)+"|$)",r+=u}for(;r<n.length;)switch(n[r]){case"\\":switch(n[r+1]){case"c":c(3);break;case"x":c(4);break;case"u":e.unicode?n[r+2]==="{"?c(n.indexOf("}",r)-r+1):c(6):c(2);break;case"p":case"P":e.unicode?c(n.indexOf("}",r)-r+1):c(2);break;case"k":c(n.indexOf(">",r)-r+1);break;default:c(2);break}break;case"[":o=/\[(?:\\.|.)*?\]/g,o.lastIndex=r,o=o.exec(n)||[],c(o[0].length);break;case"|":case"^":case"$":case"*":case"+":case"?":a(1);break;case"{":o=/\{\d+,?\d*\}/g,o.lastIndex=r,o=o.exec(n),o?a(o[0].length):c(1);break;case"(":if(n[r+1]==="?")switch(n[r+2]){case":":s+="(?:",r+=3,s+=i()+"|$)";break;case"=":s+="(?=",r+=3,s+=i()+")";break;case"!":o=r,r+=3,i(),s+=n.substr(o,r-o);break;case"<":switch(n[r+3]){case"=":case"!":o=r,r+=4,i(),s+=n.substr(o,r-o);break;default:a(n.indexOf(">",r)-r+1),s+=i()+"|$)";break}break}else a(1),s+=i()+"|$)";break;case")":return++r,s;default:c(1);break}return s}return new RegExp(i(),t.flags)}function Jd(t){return t.rules.find(e=>Xt(e)&&e.entry)}function XD(t){return t.rules.filter(e=>si(e)&&e.hidden)}function wm(t,e){const n=new Set,r=Jd(t);if(!r)return new Set(t.rules);const i=[r].concat(XD(t));for(const o of i)JD(o,n,e);const s=new Set;for(const o of t.rules)(n.has(o.name)||si(o)&&o.hidden)&&s.add(o);return s}function JD(t,e,n){e.add(t.name),Pr(t).forEach(r=>{if(oi(r)||n&&UD(r)){const i=r.rule.ref;i&&!e.has(i.name)&&JD(i,e,n)}})}function bm(t){if(t.terminal)return t.terminal;if(t.type.ref){const e=Rm(t.type.ref);return e?.terminal}}function ZD(t){return t.hidden&&!vm(Ac(t))}function qo(t,e){return!t||!e?[]:Em(t,e,t.astNode,!0)}function An(t,e,n){if(!t||!e)return;const r=Em(t,e,t.astNode,!0);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Em(t,e,n,r){if(!r){const i=wn(t.grammarSource,xr);if(i&&i.feature===e)return[t]}return ii(t)&&t.astNode===n?t.content.flatMap(i=>Em(i,e,n,!1)):[]}function Dm(t,e){return t?Tm(t,e,t?.astNode):[]}function Cc(t,e,n){if(!t)return;const r=Tm(t,e,t?.astNode);if(r.length!==0)return n!==void 0?n=Math.max(0,Math.min(n,r.length-1)):n=0,r[n]}function Tm(t,e,n){if(t.astNode!==n)return[];if(Ir(t.grammarSource)&&t.grammarSource.value===e)return[t];const r=Wa(t).iterator();let i;const s=[];do if(i=r.next(),!i.done){const o=i.value;o.astNode===n?Ir(o.grammarSource)&&o.grammarSource.value===e&&s.push(o):r.prune()}while(!i.done);return s}function QD(t){var e;const n=t.astNode;for(;n===((e=t.container)===null||e===void 0?void 0:e.astNode);){const r=wn(t.grammarSource,xr);if(r)return r;t=t.container}}function Rm(t){let e=t;return BD(e)&&(Cs(e.$container)?e=e.$container.$container:Xt(e.$container)?e=e.$container:Nd(e.$container)),eT(t,e,new Map)}function eT(t,e,n){var r;function i(s,o){let a;return wn(s,xr)||(a=eT(o,o,n)),n.set(t,a),a}if(n.has(t))return n.get(t);n.set(t,void 0);for(const s of Pr(e)){if(xr(s)&&s.feature.toLowerCase()==="name")return n.set(t,s),s;if(oi(s)&&Xt(s.rule.ref))return i(s,s.rule.ref);if(jD(s)&&(!((r=s.typeRef)===null||r===void 0)&&r.ref))return i(s,s.typeRef.ref)}}function tT(t){const e=t.$container;if(Li(e)){const n=e.elements,r=n.indexOf(t);for(let i=r-1;i>=0;i--){const s=n[i];if(Cs(s))return s;{const o=Pr(n[i]).find(Cs);if(o)return o}}}if(sm(e))return tT(e)}function jo(t,e){return t==="?"||t==="*"||Li(e)&&!!e.guardCondition}function nT(t){return t==="*"||t==="+"}function kM(t){return t==="+="}function Zd(t){return rT(t,new Set)}function rT(t,e){if(e.has(t))return!0;e.add(t);for(const n of Pr(t))if(oi(n)){if(!n.rule.ref||Xt(n.rule.ref)&&!rT(n.rule.ref,e))return!1}else{if(xr(n))return!1;if(Cs(n))return!1}return!!t.definition}function $M(t){return Sm(t.type,new Set)}function Sm(t,e){if(e.has(t))return!0;if(e.add(t),ZL(t))return!1;if(iM(t))return!1;if(oM(t))return t.types.every(n=>Sm(n,e));if(jD(t)){if(t.primitiveType!==void 0)return!0;if(t.stringType!==void 0)return!0;if(t.typeRef!==void 0){const n=t.typeRef.ref;return cm(n)?Sm(n.type,e):!1}else return!1}else return!1}function _s(t){if(t.inferredType)return t.inferredType.name;if(t.dataType)return t.dataType;if(t.returnType){const e=t.returnType.ref;if(e){if(Xt(e))return e.name;if(qD(e)||cm(e))return e.name}}}function _c(t){var e;if(Xt(t))return Zd(t)?t.name:(e=_s(t))!==null&&e!==void 0?e:t.name;if(qD(t)||cm(t)||sM(t))return t.name;if(Cs(t)){const n=iT(t);if(n)return n}else if(BD(t))return t.name;throw new Error("Cannot get name of Unknown Type")}function iT(t){var e;if(t.inferredType)return t.inferredType.name;if(!((e=t.type)===null||e===void 0)&&e.ref)return _c(t.type.ref)}function CM(t){var e,n,r;return si(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":Zd(t)?t.name:(r=_s(t))!==null&&r!==void 0?r:t.name}function sT(t){var e,n,r;return si(t)?(n=(e=t.type)===null||e===void 0?void 0:e.name)!==null&&n!==void 0?n:"string":(r=_s(t))!==null&&r!==void 0?r:t.name}function Ac(t){const e={s:!1,i:!1,u:!1},n=Uo(t.definition,e),r=Object.entries(e).filter(([,i])=>i).map(([i])=>i).join("");return new RegExp(n,r)}const km=/[\s\S]/.source;function Uo(t,e){if(dM(t))return _M(t);if(fM(t))return AM(t);if(aM(t))return PM(t);if(UD(t)){const n=t.rule.ref;if(!n)throw new Error("Missing rule reference.");return ci(Uo(n.definition),{cardinality:t.cardinality,lookahead:t.lookahead})}else{if(uM(t))return IM(t);if(hM(t))return xM(t);if(lM(t)){const n=t.regex.lastIndexOf("/"),r=t.regex.substring(1,n),i=t.regex.substring(n+1);return e&&(e.i=i.includes("i"),e.s=i.includes("s"),e.u=i.includes("u")),ci(r,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}else{if(pM(t))return ci(km,{cardinality:t.cardinality,lookahead:t.lookahead});throw new Error(`Invalid terminal element: ${t?.$type}`)}}}function _M(t){return ci(t.elements.map(e=>Uo(e)).join("|"),{cardinality:t.cardinality,lookahead:t.lookahead})}function AM(t){return ci(t.elements.map(e=>Uo(e)).join(""),{cardinality:t.cardinality,lookahead:t.lookahead})}function xM(t){return ci(`${km}*?${Uo(t.terminal)}`,{cardinality:t.cardinality,lookahead:t.lookahead})}function IM(t){return ci(`(?!${Uo(t.terminal)})${km}*?`,{cardinality:t.cardinality,lookahead:t.lookahead})}function PM(t){return t.right?ci(`[${$m(t.left)}-${$m(t.right)}]`,{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1}):ci($m(t.left),{cardinality:t.cardinality,lookahead:t.lookahead,wrap:!1})}function $m(t){return Xd(t.value)}function ci(t,e){var n;return(e.wrap!==!1||e.lookahead)&&(t=`(${(n=e.lookahead)!==null&&n!==void 0?n:""}${t})`),e.cardinality?`${t}${e.cardinality}`:t}const Qd={__proto__:null,findAssignment:QD,findNameAssignment:Rm,findNodeForKeyword:Cc,findNodeForProperty:An,findNodesForKeyword:Dm,findNodesForKeywordInternal:Tm,findNodesForProperty:qo,getActionAtElement:tT,getActionType:iT,getAllReachableRules:wm,getCrossReferenceTerminal:bm,getEntryRule:Jd,getExplicitRuleType:_s,getHiddenRules:XD,getRuleType:sT,getRuleTypeName:CM,getTypeName:_c,isArrayCardinality:nT,isArrayOperator:kM,isCommentTerminal:ZD,isDataType:$M,isDataTypeRule:Zd,isOptionalCardinality:jo,terminalRegex:Ac};function NM(t){const e=[],n=t.Grammar;for(const r of n.rules)si(r)&&ZD(r)&&EM(Ac(r))&&e.push(r.name);return{multilineCommentRules:e,nameRegexp:em}}var oT=typeof global=="object"&&global&&global.Object===Object&&global,OM=typeof self=="object"&&self&&self.Object===Object&&self,Nr=oT||OM||Function("return this")(),Hn=Nr.Symbol,aT=Object.prototype,FM=aT.hasOwnProperty,LM=aT.toString,xc=Hn?Hn.toStringTag:void 0;function MM(t){var e=FM.call(t,xc),n=t[xc];try{t[xc]=void 0;var r=!0}catch{}var i=LM.call(t);return r&&(e?t[xc]=n:delete t[xc]),i}var zM=Object.prototype,BM=zM.toString;function qM(t){return BM.call(t)}var jM="[object Null]",UM="[object Undefined]",cT=Hn?Hn.toStringTag:void 0;function Mi(t){return t==null?t===void 0?UM:jM:cT&&cT in Object(t)?MM(t):qM(t)}function ur(t){return t!=null&&typeof t=="object"}var GM="[object Symbol]";function Ic(t){return typeof t=="symbol"||ur(t)&&Mi(t)==GM}function ef(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var Be=Array.isArray,WM=1/0,uT=Hn?Hn.prototype:void 0,lT=uT?uT.toString:void 0;function dT(t){if(typeof t=="string")return t;if(Be(t))return ef(t,dT)+"";if(Ic(t))return lT?lT.call(t):"";var e=t+"";return e=="0"&&1/t==-WM?"-0":e}var HM=/\s/;function VM(t){for(var e=t.length;e--&&HM.test(t.charAt(e)););return e}var KM=/^\s+/;function YM(t){return t&&t.slice(0,VM(t)+1).replace(KM,"")}function Vn(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var fT=NaN,XM=/^[-+]0x[0-9a-f]+$/i,JM=/^0b[01]+$/i,ZM=/^0o[0-7]+$/i,QM=parseInt;function e3(t){if(typeof t=="number")return t;if(Ic(t))return fT;if(Vn(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Vn(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=YM(t);var n=JM.test(t);return n||ZM.test(t)?QM(t.slice(2),n?2:8):XM.test(t)?fT:+t}var hT=1/0,t3=17976931348623157e292;function n3(t){if(!t)return t===0?t:0;if(t=e3(t),t===hT||t===-hT){var e=t<0?-1:1;return e*t3}return t===t?t:0}function tf(t){var e=n3(t),n=e%1;return e===e?n?e-n:e:0}function As(t){return t}var r3="[object AsyncFunction]",i3="[object Function]",s3="[object GeneratorFunction]",o3="[object Proxy]";function ui(t){if(!Vn(t))return!1;var e=Mi(t);return e==i3||e==s3||e==r3||e==o3}var Cm=Nr["__core-js_shared__"],pT=function(){var t=/[^.]+$/.exec(Cm&&Cm.keys&&Cm.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function a3(t){return!!pT&&pT in t}var c3=Function.prototype,u3=c3.toString;function xs(t){if(t!=null){try{return u3.call(t)}catch{}try{return t+""}catch{}}return""}var l3=/[\\^$.*+?()[\]{}|]/g,d3=/^\[object .+?Constructor\]$/,f3=Function.prototype,h3=Object.prototype,p3=f3.toString,g3=h3.hasOwnProperty,m3=RegExp("^"+p3.call(g3).replace(l3,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function y3(t){if(!Vn(t)||a3(t))return!1;var e=ui(t)?m3:d3;return e.test(xs(t))}function v3(t,e){return t?.[e]}function Is(t,e){var n=v3(t,e);return y3(n)?n:void 0}var _m=Is(Nr,"WeakMap"),gT=Object.create,w3=function(){function t(){}return function(e){if(!Vn(e))return{};if(gT)return gT(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}}();function b3(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Pt(){}function E3(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var D3=800,T3=16,R3=Date.now;function S3(t){var e=0,n=0;return function(){var r=R3(),i=T3-(r-n);if(n=r,i>0){if(++e>=D3)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function k3(t){return function(){return t}}var nf=function(){try{var t=Is(Object,"defineProperty");return t({},"",{}),t}catch{}}(),$3=nf?function(t,e){return nf(t,"toString",{configurable:!0,enumerable:!1,value:k3(e),writable:!0})}:As,C3=S3($3);function mT(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}function yT(t,e,n,r){for(var i=t.length,s=n+-1;++s<i;)if(e(t[s],s,t))return s;return-1}function _3(t){return t!==t}function A3(t,e,n){for(var r=n-1,i=t.length;++r<i;)if(t[r]===e)return r;return-1}function Am(t,e,n){return e===e?A3(t,e,n):yT(t,_3,n)}function vT(t,e){var n=t==null?0:t.length;return!!n&&Am(t,e,0)>-1}var x3=9007199254740991,I3=/^(?:0|[1-9]\d*)$/;function rf(t,e){var n=typeof t;return e=e??x3,!!e&&(n=="number"||n!="symbol"&&I3.test(t))&&t>-1&&t%1==0&&t<e}function xm(t,e,n){e=="__proto__"&&nf?nf(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function Pc(t,e){return t===e||t!==t&&e!==e}var P3=Object.prototype,N3=P3.hasOwnProperty;function sf(t,e,n){var r=t[e];(!(N3.call(t,e)&&Pc(r,n))||n===void 0&&!(e in t))&&xm(t,e,n)}function Im(t,e,n,r){var i=!n;n||(n={});for(var s=-1,o=e.length;++s<o;){var a=e[s],c=void 0;c===void 0&&(c=t[a]),i?xm(n,a,c):sf(n,a,c)}return n}var wT=Math.max;function O3(t,e,n){return e=wT(e===void 0?t.length-1:e,0),function(){for(var r=arguments,i=-1,s=wT(r.length-e,0),o=Array(s);++i<s;)o[i]=r[e+i];i=-1;for(var a=Array(e+1);++i<e;)a[i]=r[i];return a[e]=n(o),b3(t,this,a)}}function Pm(t,e){return C3(O3(t,e,As),t+"")}var F3=9007199254740991;function Nm(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=F3}function Or(t){return t!=null&&Nm(t.length)&&!ui(t)}function bT(t,e,n){if(!Vn(n))return!1;var r=typeof e;return(r=="number"?Or(n)&&rf(e,n.length):r=="string"&&e in n)?Pc(n[e],t):!1}function L3(t){return Pm(function(e,n){var r=-1,i=n.length,s=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(s=t.length>3&&typeof s=="function"?(i--,s):void 0,o&&bT(n[0],n[1],o)&&(s=i<3?void 0:s,i=1),e=Object(e);++r<i;){var a=n[r];a&&t(e,a,r,s)}return e})}var M3=Object.prototype;function Nc(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||M3;return t===n}function z3(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var B3="[object Arguments]";function ET(t){return ur(t)&&Mi(t)==B3}var DT=Object.prototype,q3=DT.hasOwnProperty,j3=DT.propertyIsEnumerable,of=ET(function(){return arguments}())?ET:function(t){return ur(t)&&q3.call(t,"callee")&&!j3.call(t,"callee")},U3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function li(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var n=function r(){return this instanceof r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};n.prototype=e.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(t).forEach(function(r){var i=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return t[r]}})}),n}function G3(){return!1}var TT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,RT=TT&&typeof module=="object"&&module&&!module.nodeType&&module,W3=RT&&RT.exports===TT,ST=W3?Nr.Buffer:void 0,H3=ST?ST.isBuffer:void 0,Oc=H3||G3,V3="[object Arguments]",K3="[object Array]",Y3="[object Boolean]",X3="[object Date]",J3="[object Error]",Z3="[object Function]",Q3="[object Map]",e8="[object Number]",t8="[object Object]",n8="[object RegExp]",r8="[object Set]",i8="[object String]",s8="[object WeakMap]",o8="[object ArrayBuffer]",a8="[object DataView]",c8="[object Float32Array]",u8="[object Float64Array]",l8="[object Int8Array]",d8="[object Int16Array]",f8="[object Int32Array]",h8="[object Uint8Array]",p8="[object Uint8ClampedArray]",g8="[object Uint16Array]",m8="[object Uint32Array]",st={};st[c8]=st[u8]=st[l8]=st[d8]=st[f8]=st[h8]=st[p8]=st[g8]=st[m8]=!0,st[V3]=st[K3]=st[o8]=st[Y3]=st[a8]=st[X3]=st[J3]=st[Z3]=st[Q3]=st[e8]=st[t8]=st[n8]=st[r8]=st[i8]=st[s8]=!1;function y8(t){return ur(t)&&Nm(t.length)&&!!st[Mi(t)]}function af(t){return function(e){return t(e)}}var kT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Fc=kT&&typeof module=="object"&&module&&!module.nodeType&&module,v8=Fc&&Fc.exports===kT,Om=v8&&oT.process,zi=function(){try{var t=Fc&&Fc.require&&Fc.require("util").types;return t||Om&&Om.binding&&Om.binding("util")}catch{}}(),$T=zi&&zi.isTypedArray,Fm=$T?af($T):y8,w8=Object.prototype,b8=w8.hasOwnProperty;function CT(t,e){var n=Be(t),r=!n&&of(t),i=!n&&!r&&Oc(t),s=!n&&!r&&!i&&Fm(t),o=n||r||i||s,a=o?z3(t.length,String):[],c=a.length;for(var u in t)(e||b8.call(t,u))&&!(o&&(u=="length"||i&&(u=="offset"||u=="parent")||s&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||rf(u,c)))&&a.push(u);return a}function _T(t,e){return function(n){return t(e(n))}}var E8=_T(Object.keys,Object),D8=Object.prototype,T8=D8.hasOwnProperty;function AT(t){if(!Nc(t))return E8(t);var e=[];for(var n in Object(t))T8.call(t,n)&&n!="constructor"&&e.push(n);return e}function Kn(t){return Or(t)?CT(t):AT(t)}var R8=Object.prototype,S8=R8.hasOwnProperty,xn=L3(function(t,e){if(Nc(e)||Or(e)){Im(e,Kn(e),t);return}for(var n in e)S8.call(e,n)&&sf(t,n,e[n])});function k8(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var $8=Object.prototype,C8=$8.hasOwnProperty;function _8(t){if(!Vn(t))return k8(t);var e=Nc(t),n=[];for(var r in t)r=="constructor"&&(e||!C8.call(t,r))||n.push(r);return n}function xT(t){return Or(t)?CT(t,!0):_8(t)}var A8=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,x8=/^\w*$/;function Lm(t,e){if(Be(t))return!1;var n=typeof t;return n=="number"||n=="symbol"||n=="boolean"||t==null||Ic(t)?!0:x8.test(t)||!A8.test(t)||e!=null&&t in Object(e)}var Lc=Is(Object,"create");function I8(){this.__data__=Lc?Lc(null):{},this.size=0}function P8(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var N8="__lodash_hash_undefined__",O8=Object.prototype,F8=O8.hasOwnProperty;function L8(t){var e=this.__data__;if(Lc){var n=e[t];return n===N8?void 0:n}return F8.call(e,t)?e[t]:void 0}var M8=Object.prototype,z8=M8.hasOwnProperty;function B8(t){var e=this.__data__;return Lc?e[t]!==void 0:z8.call(e,t)}var q8="__lodash_hash_undefined__";function j8(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Lc&&e===void 0?q8:e,this}function Ps(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ps.prototype.clear=I8,Ps.prototype.delete=P8,Ps.prototype.get=L8,Ps.prototype.has=B8,Ps.prototype.set=j8;function U8(){this.__data__=[],this.size=0}function cf(t,e){for(var n=t.length;n--;)if(Pc(t[n][0],e))return n;return-1}var G8=Array.prototype,W8=G8.splice;function H8(t){var e=this.__data__,n=cf(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():W8.call(e,n,1),--this.size,!0}function V8(t){var e=this.__data__,n=cf(e,t);return n<0?void 0:e[n][1]}function K8(t){return cf(this.__data__,t)>-1}function Y8(t,e){var n=this.__data__,r=cf(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function di(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}di.prototype.clear=U8,di.prototype.delete=H8,di.prototype.get=V8,di.prototype.has=K8,di.prototype.set=Y8;var Mc=Is(Nr,"Map");function X8(){this.size=0,this.__data__={hash:new Ps,map:new(Mc||di),string:new Ps}}function J8(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function uf(t,e){var n=t.__data__;return J8(e)?n[typeof e=="string"?"string":"hash"]:n.map}function Z8(t){var e=uf(this,t).delete(t);return this.size-=e?1:0,e}function Q8(t){return uf(this,t).get(t)}function ez(t){return uf(this,t).has(t)}function tz(t,e){var n=uf(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function fi(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}fi.prototype.clear=X8,fi.prototype.delete=Z8,fi.prototype.get=Q8,fi.prototype.has=ez,fi.prototype.set=tz;var nz="Expected a function";function Mm(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(nz);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],s=n.cache;if(s.has(i))return s.get(i);var o=t.apply(this,r);return n.cache=s.set(i,o)||s,o};return n.cache=new(Mm.Cache||fi),n}Mm.Cache=fi;var rz=500;function iz(t){var e=Mm(t,function(r){return n.size===rz&&n.clear(),r}),n=e.cache;return e}var sz=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oz=/\\(\\)?/g,az=iz(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(sz,function(n,r,i,s){e.push(i?s.replace(oz,"$1"):r||n)}),e});function cz(t){return t==null?"":dT(t)}function lf(t,e){return Be(t)?t:Lm(t,e)?[t]:az(cz(t))}var uz=1/0;function zc(t){if(typeof t=="string"||Ic(t))return t;var e=t+"";return e=="0"&&1/t==-uz?"-0":e}function zm(t,e){e=lf(e,t);for(var n=0,r=e.length;t!=null&&n<r;)t=t[zc(e[n++])];return n&&n==r?t:void 0}function lz(t,e,n){var r=t==null?void 0:zm(t,e);return r===void 0?n:r}function Bm(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}var IT=Hn?Hn.isConcatSpreadable:void 0;function dz(t){return Be(t)||of(t)||!!(IT&&t&&t[IT])}function qm(t,e,n,r,i){var s=-1,o=t.length;for(n||(n=dz),i||(i=[]);++s<o;){var a=t[s];n(a)?Bm(i,a):r||(i[i.length]=a)}return i}function Yn(t){var e=t==null?0:t.length;return e?qm(t):[]}var PT=_T(Object.getPrototypeOf,Object);function NT(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}function fz(t,e,n,r){var i=-1,s=t==null?0:t.length;for(r&&s&&(n=t[++i]);++i<s;)n=e(n,t[i],i,t);return n}function hz(){this.__data__=new di,this.size=0}function pz(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function gz(t){return this.__data__.get(t)}function mz(t){return this.__data__.has(t)}var yz=200;function vz(t,e){var n=this.__data__;if(n instanceof di){var r=n.__data__;if(!Mc||r.length<yz-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new fi(r)}return n.set(t,e),this.size=n.size,this}function Fr(t){var e=this.__data__=new di(t);this.size=e.size}Fr.prototype.clear=hz,Fr.prototype.delete=pz,Fr.prototype.get=gz,Fr.prototype.has=mz,Fr.prototype.set=vz;function wz(t,e){return t&&Im(e,Kn(e),t)}var OT=typeof exports=="object"&&exports&&!exports.nodeType&&exports,FT=OT&&typeof module=="object"&&module&&!module.nodeType&&module,bz=FT&&FT.exports===OT,LT=bz?Nr.Buffer:void 0,MT=LT?LT.allocUnsafe:void 0;function Ez(t,e){var n=t.length,r=MT?MT(n):new t.constructor(n);return t.copy(r),r}function jm(t,e){for(var n=-1,r=t==null?0:t.length,i=0,s=[];++n<r;){var o=t[n];e(o,n,t)&&(s[i++]=o)}return s}function zT(){return[]}var Dz=Object.prototype,Tz=Dz.propertyIsEnumerable,BT=Object.getOwnPropertySymbols,Um=BT?function(t){return t==null?[]:(t=Object(t),jm(BT(t),function(e){return Tz.call(t,e)}))}:zT;function Rz(t,e){return Im(t,Um(t),e)}var Sz=Object.getOwnPropertySymbols,kz=Sz?function(t){for(var e=[];t;)Bm(e,Um(t)),t=PT(t);return e}:zT;function qT(t,e,n){var r=e(t);return Be(t)?r:Bm(r,n(t))}function Gm(t){return qT(t,Kn,Um)}function $z(t){return qT(t,xT,kz)}var Wm=Is(Nr,"DataView"),Hm=Is(Nr,"Promise"),Go=Is(Nr,"Set"),jT="[object Map]",Cz="[object Object]",UT="[object Promise]",GT="[object Set]",WT="[object WeakMap]",HT="[object DataView]",_z=xs(Wm),Az=xs(Mc),xz=xs(Hm),Iz=xs(Go),Pz=xs(_m),Xn=Mi;(Wm&&Xn(new Wm(new ArrayBuffer(1)))!=HT||Mc&&Xn(new Mc)!=jT||Hm&&Xn(Hm.resolve())!=UT||Go&&Xn(new Go)!=GT||_m&&Xn(new _m)!=WT)&&(Xn=function(t){var e=Mi(t),n=e==Cz?t.constructor:void 0,r=n?xs(n):"";if(r)switch(r){case _z:return HT;case Az:return jT;case xz:return UT;case Iz:return GT;case Pz:return WT}return e});var Nz=Object.prototype,Oz=Nz.hasOwnProperty;function Fz(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&Oz.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var df=Nr.Uint8Array;function Lz(t){var e=new t.constructor(t.byteLength);return new df(e).set(new df(t)),e}function Mz(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}var zz=/\w*$/;function Bz(t){var e=new t.constructor(t.source,zz.exec(t));return e.lastIndex=t.lastIndex,e}var VT=Hn?Hn.prototype:void 0,KT=VT?VT.valueOf:void 0;function qz(t){return KT?Object(KT.call(t)):{}}function jz(t,e){var n=t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var Uz="[object Boolean]",Gz="[object Date]",Wz="[object Map]",Hz="[object Number]",Vz="[object RegExp]",Kz="[object Set]",Yz="[object String]",Xz="[object Symbol]",Jz="[object ArrayBuffer]",Zz="[object DataView]",Qz="[object Float32Array]",eB="[object Float64Array]",tB="[object Int8Array]",nB="[object Int16Array]",rB="[object Int32Array]",iB="[object Uint8Array]",sB="[object Uint8ClampedArray]",oB="[object Uint16Array]",aB="[object Uint32Array]";function cB(t,e,n){var r=t.constructor;switch(e){case Jz:return Lz(t);case Uz:case Gz:return new r(+t);case Zz:return Mz(t);case Qz:case eB:case tB:case nB:case rB:case iB:case sB:case oB:case aB:return jz(t);case Wz:return new r;case Hz:case Yz:return new r(t);case Vz:return Bz(t);case Kz:return new r;case Xz:return qz(t)}}function uB(t){return typeof t.constructor=="function"&&!Nc(t)?w3(PT(t)):{}}var lB="[object Map]";function dB(t){return ur(t)&&Xn(t)==lB}var YT=zi&&zi.isMap,fB=YT?af(YT):dB,hB="[object Set]";function pB(t){return ur(t)&&Xn(t)==hB}var XT=zi&&zi.isSet,gB=XT?af(XT):pB,JT="[object Arguments]",mB="[object Array]",yB="[object Boolean]",vB="[object Date]",wB="[object Error]",ZT="[object Function]",bB="[object GeneratorFunction]",EB="[object Map]",DB="[object Number]",QT="[object Object]",TB="[object RegExp]",RB="[object Set]",SB="[object String]",kB="[object Symbol]",$B="[object WeakMap]",CB="[object ArrayBuffer]",_B="[object DataView]",AB="[object Float32Array]",xB="[object Float64Array]",IB="[object Int8Array]",PB="[object Int16Array]",NB="[object Int32Array]",OB="[object Uint8Array]",FB="[object Uint8ClampedArray]",LB="[object Uint16Array]",MB="[object Uint32Array]",rt={};rt[JT]=rt[mB]=rt[CB]=rt[_B]=rt[yB]=rt[vB]=rt[AB]=rt[xB]=rt[IB]=rt[PB]=rt[NB]=rt[EB]=rt[DB]=rt[QT]=rt[TB]=rt[RB]=rt[SB]=rt[kB]=rt[OB]=rt[FB]=rt[LB]=rt[MB]=!0,rt[wB]=rt[ZT]=rt[$B]=!1;function ff(t,e,n,r,i,s){var o;if(o!==void 0)return o;if(!Vn(t))return t;var a=Be(t);if(a)return o=Fz(t),E3(t,o);var c=Xn(t),u=c==ZT||c==bB;if(Oc(t))return Ez(t);if(c==QT||c==JT||u&&!i)return o=u?{}:uB(t),Rz(t,wz(o,t));if(!rt[c])return i?t:{};o=cB(t,c),s||(s=new Fr);var l=s.get(t);if(l)return l;s.set(t,o),gB(t)?t.forEach(function(h){o.add(ff(h,e,n,h,t,s))}):fB(t)&&t.forEach(function(h,p){o.set(p,ff(h,e,n,p,t,s))});var d=Gm,f=a?void 0:d(t);return mT(f||t,function(h,p){f&&(p=h,h=t[p]),sf(o,p,ff(h,e,n,p,t,s))}),o}var zB=4;function jt(t){return ff(t,zB)}function Bc(t){for(var e=-1,n=t==null?0:t.length,r=0,i=[];++e<n;){var s=t[e];s&&(i[r++]=s)}return i}var BB="__lodash_hash_undefined__";function qB(t){return this.__data__.set(t,BB),this}function jB(t){return this.__data__.has(t)}function Wo(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new fi;++e<n;)this.add(t[e])}Wo.prototype.add=Wo.prototype.push=qB,Wo.prototype.has=jB;function eR(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function Vm(t,e){return t.has(e)}var UB=1,GB=2;function tR(t,e,n,r,i,s){var o=n&UB,a=t.length,c=e.length;if(a!=c&&!(o&&c>a))return!1;var u=s.get(t),l=s.get(e);if(u&&l)return u==e&&l==t;var d=-1,f=!0,h=n&GB?new Wo:void 0;for(s.set(t,e),s.set(e,t);++d<a;){var p=t[d],g=e[d];if(r)var y=o?r(g,p,d,e,t,s):r(p,g,d,t,e,s);if(y!==void 0){if(y)continue;f=!1;break}if(h){if(!eR(e,function(m,w){if(!Vm(h,w)&&(p===m||i(p,m,n,r,s)))return h.push(w)})){f=!1;break}}else if(!(p===g||i(p,g,n,r,s))){f=!1;break}}return s.delete(t),s.delete(e),f}function WB(t){var e=-1,n=Array(t.size);return t.forEach(function(r,i){n[++e]=[i,r]}),n}function Km(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var HB=1,VB=2,KB="[object Boolean]",YB="[object Date]",XB="[object Error]",JB="[object Map]",ZB="[object Number]",QB="[object RegExp]",e4="[object Set]",t4="[object String]",n4="[object Symbol]",r4="[object ArrayBuffer]",i4="[object DataView]",nR=Hn?Hn.prototype:void 0,Ym=nR?nR.valueOf:void 0;function s4(t,e,n,r,i,s,o){switch(n){case i4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case r4:return!(t.byteLength!=e.byteLength||!s(new df(t),new df(e)));case KB:case YB:case ZB:return Pc(+t,+e);case XB:return t.name==e.name&&t.message==e.message;case QB:case t4:return t==e+"";case JB:var a=WB;case e4:var c=r&HB;if(a||(a=Km),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;r|=VB,o.set(t,e);var l=tR(a(t),a(e),r,i,s,o);return o.delete(t),l;case n4:if(Ym)return Ym.call(t)==Ym.call(e)}return!1}var o4=1,a4=Object.prototype,c4=a4.hasOwnProperty;function u4(t,e,n,r,i,s){var o=n&o4,a=Gm(t),c=a.length,u=Gm(e),l=u.length;if(c!=l&&!o)return!1;for(var d=c;d--;){var f=a[d];if(!(o?f in e:c4.call(e,f)))return!1}var h=s.get(t),p=s.get(e);if(h&&p)return h==e&&p==t;var g=!0;s.set(t,e),s.set(e,t);for(var y=o;++d<c;){f=a[d];var m=t[f],w=e[f];if(r)var E=o?r(w,m,f,e,t,s):r(m,w,f,t,e,s);if(!(E===void 0?m===w||i(m,w,n,r,s):E)){g=!1;break}y||(y=f=="constructor")}if(g&&!y){var k=t.constructor,A=e.constructor;k!=A&&"constructor"in t&&"constructor"in e&&!(typeof k=="function"&&k instanceof k&&typeof A=="function"&&A instanceof A)&&(g=!1)}return s.delete(t),s.delete(e),g}var l4=1,rR="[object Arguments]",iR="[object Array]",hf="[object Object]",d4=Object.prototype,sR=d4.hasOwnProperty;function f4(t,e,n,r,i,s){var o=Be(t),a=Be(e),c=o?iR:Xn(t),u=a?iR:Xn(e);c=c==rR?hf:c,u=u==rR?hf:u;var l=c==hf,d=u==hf,f=c==u;if(f&&Oc(t)){if(!Oc(e))return!1;o=!0,l=!1}if(f&&!l)return s||(s=new Fr),o||Fm(t)?tR(t,e,n,r,i,s):s4(t,e,c,n,r,i,s);if(!(n&l4)){var h=l&&sR.call(t,"__wrapped__"),p=d&&sR.call(e,"__wrapped__");if(h||p){var g=h?t.value():t,y=p?e.value():e;return s||(s=new Fr),i(g,y,n,r,s)}}return f?(s||(s=new Fr),u4(t,e,n,r,i,s)):!1}function Xm(t,e,n,r,i){return t===e?!0:t==null||e==null||!ur(t)&&!ur(e)?t!==t&&e!==e:f4(t,e,n,r,Xm,i)}var h4=1,p4=2;function g4(t,e,n,r){var i=n.length,s=i;if(t==null)return!s;for(t=Object(t);i--;){var o=n[i];if(o[2]?o[1]!==t[o[0]]:!(o[0]in t))return!1}for(;++i<s;){o=n[i];var a=o[0],c=t[a],u=o[1];if(o[2]){if(c===void 0&&!(a in t))return!1}else{var l=new Fr,d;if(!(d===void 0?Xm(u,c,h4|p4,r,l):d))return!1}}return!0}function oR(t){return t===t&&!Vn(t)}function m4(t){for(var e=Kn(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,oR(i)]}return e}function aR(t,e){return function(n){return n==null?!1:n[t]===e&&(e!==void 0||t in Object(n))}}function y4(t){var e=m4(t);return e.length==1&&e[0][2]?aR(e[0][0],e[0][1]):function(n){return n===t||g4(n,t,e)}}function v4(t,e){return t!=null&&e in Object(t)}function cR(t,e,n){e=lf(e,t);for(var r=-1,i=e.length,s=!1;++r<i;){var o=zc(e[r]);if(!(s=t!=null&&n(t,o)))break;t=t[o]}return s||++r!=i?s:(i=t==null?0:t.length,!!i&&Nm(i)&&rf(o,i)&&(Be(t)||of(t)))}function w4(t,e){return t!=null&&cR(t,e,v4)}var b4=1,E4=2;function D4(t,e){return Lm(t)&&oR(e)?aR(zc(t),e):function(n){var r=lz(n,t);return r===void 0&&r===e?w4(n,t):Xm(e,r,b4|E4)}}function T4(t){return function(e){return e?.[t]}}function R4(t){return function(e){return zm(e,t)}}function S4(t){return Lm(t)?T4(zc(t)):R4(t)}function lr(t){return typeof t=="function"?t:t==null?As:typeof t=="object"?Be(t)?D4(t[0],t[1]):y4(t):S4(t)}function k4(t,e,n,r){for(var i=-1,s=t==null?0:t.length;++i<s;){var o=t[i];e(r,o,n(o),t)}return r}function $4(t){return function(e,n,r){for(var i=-1,s=Object(e),o=r(e),a=o.length;a--;){var c=o[++i];if(n(s[c],c,s)===!1)break}return e}}var C4=$4();function _4(t,e){return t&&C4(t,e,Kn)}function A4(t,e){return function(n,r){if(n==null)return n;if(!Or(n))return t(n,r);for(var i=n.length,s=-1,o=Object(n);++s<i&&r(o[s],s,o)!==!1;);return n}}var Ns=A4(_4);function x4(t,e,n,r){return Ns(t,function(i,s,o){e(r,i,n(i),o)}),r}function I4(t,e){return function(n,r){var i=Be(n)?k4:x4,s=e?e():{};return i(n,t,lr(r),s)}}var uR=Object.prototype,P4=uR.hasOwnProperty,Jm=Pm(function(t,e){t=Object(t);var n=-1,r=e.length,i=r>2?e[2]:void 0;for(i&&bT(e[0],e[1],i)&&(r=1);++n<r;)for(var s=e[n],o=xT(s),a=-1,c=o.length;++a<c;){var u=o[a],l=t[u];(l===void 0||Pc(l,uR[u])&&!P4.call(t,u))&&(t[u]=s[u])}return t});function lR(t){return ur(t)&&Or(t)}var N4=200;function O4(t,e,n,r){var i=-1,s=vT,o=!0,a=t.length,c=[],u=e.length;if(!a)return c;e.length>=N4&&(s=Vm,o=!1,e=new Wo(e));e:for(;++i<a;){var l=t[i],d=l;if(l=l!==0?l:0,o&&d===d){for(var f=u;f--;)if(e[f]===d)continue e;c.push(l)}else s(e,d,r)||c.push(l)}return c}var pf=Pm(function(t,e){return lR(t)?O4(t,qm(e,1,lR,!0)):[]});function Ho(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}function Ut(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:tf(e),NT(t,e<0?0:e,r)):[]}function qc(t,e,n){var r=t==null?0:t.length;return r?(e=e===void 0?1:tf(e),e=r-e,NT(t,0,e<0?0:e)):[]}function F4(t){return typeof t=="function"?t:As}function ve(t,e){var n=Be(t)?mT:Ns;return n(t,F4(e))}function L4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function M4(t,e){var n=!0;return Ns(t,function(r,i,s){return n=!!e(r,i,s),n}),n}function dr(t,e,n){var r=Be(t)?L4:M4;return r(t,lr(e))}function dR(t,e){var n=[];return Ns(t,function(r,i,s){e(r,i,s)&&n.push(r)}),n}function In(t,e){var n=Be(t)?jm:dR;return n(t,lr(e))}function z4(t){return function(e,n,r){var i=Object(e);if(!Or(e)){var s=lr(n);e=Kn(e),n=function(a){return s(i[a],a,i)}}var o=t(e,n,r);return o>-1?i[s?e[o]:o]:void 0}}var B4=Math.max;function q4(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=n==null?0:tf(n);return i<0&&(i=B4(r+i,0)),yT(t,lr(e),i)}var Vo=z4(q4);function fr(t){return t&&t.length?t[0]:void 0}function j4(t,e){var n=-1,r=Or(t)?Array(t.length):[];return Ns(t,function(i,s,o){r[++n]=e(i,s,o)}),r}function de(t,e){var n=Be(t)?ef:j4;return n(t,lr(e))}function Pn(t,e){return qm(de(t,e))}var U4=Object.prototype,G4=U4.hasOwnProperty,W4=I4(function(t,e,n){G4.call(t,n)?t[n].push(e):xm(t,n,[e])}),H4=Object.prototype,V4=H4.hasOwnProperty;function K4(t,e){return t!=null&&V4.call(t,e)}function be(t,e){return t!=null&&cR(t,e,K4)}var Y4="[object String]";function bn(t){return typeof t=="string"||!Be(t)&&ur(t)&&Mi(t)==Y4}function X4(t,e){return ef(e,function(n){return t[n]})}function Nt(t){return t==null?[]:X4(t,Kn(t))}var J4=Math.max;function on(t,e,n,r){t=Or(t)?t:Nt(t),n=n&&!r?tf(n):0;var i=t.length;return n<0&&(n=J4(i+n,0)),bn(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&Am(t,e,n)>-1}function fR(t,e,n){var r=t==null?0:t.length;if(!r)return-1;var i=0;return Am(t,e,i)}var Z4="[object Map]",Q4="[object Set]",e6=Object.prototype,t6=e6.hasOwnProperty;function tt(t){if(t==null)return!0;if(Or(t)&&(Be(t)||typeof t=="string"||typeof t.splice=="function"||Oc(t)||Fm(t)||of(t)))return!t.length;var e=Xn(t);if(e==Z4||e==Q4)return!t.size;if(Nc(t))return!AT(t).length;for(var n in t)if(t6.call(t,n))return!1;return!0}var n6="[object RegExp]";function r6(t){return ur(t)&&Mi(t)==n6}var hR=zi&&zi.isRegExp,hi=hR?af(hR):r6;function pi(t){return t===void 0}function i6(t,e){return t<e}function s6(t,e,n){for(var r=-1,i=t.length;++r<i;){var s=t[r],o=e(s);if(o!=null&&(a===void 0?o===o&&!Ic(o):n(o,a)))var a=o,c=s}return c}function o6(t){return t&&t.length?s6(t,As,i6):void 0}var a6="Expected a function";function c6(t){if(typeof t!="function")throw new TypeError(a6);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}function u6(t,e,n,r){if(!Vn(t))return t;e=lf(e,t);for(var i=-1,s=e.length,o=s-1,a=t;a!=null&&++i<s;){var c=zc(e[i]),u=n;if(c==="__proto__"||c==="constructor"||c==="prototype")return t;if(i!=o){var l=a[c];u=void 0,u===void 0&&(u=Vn(l)?l:rf(e[i+1])?[]:{})}sf(a,c,u),a=a[c]}return t}function l6(t,e,n){for(var r=-1,i=e.length,s={};++r<i;){var o=e[r],a=zm(t,o);n(a,o)&&u6(s,lf(o,t),a)}return s}function hr(t,e){if(t==null)return{};var n=ef($z(t),function(r){return[r]});return e=lr(e),l6(t,n,function(r,i){return e(r,i[0])})}function d6(t,e,n,r,i){return i(t,function(s,o,a){n=r?(r=!1,s):e(n,s,o,a)}),n}function an(t,e,n){var r=Be(t)?fz:d6,i=arguments.length<3;return r(t,lr(e),n,i,Ns)}function gf(t,e){var n=Be(t)?jm:dR;return n(t,c6(lr(e)))}function f6(t,e){var n;return Ns(t,function(r,i,s){return n=e(r,i,s),!n}),!!n}function pR(t,e,n){var r=Be(t)?eR:f6;return r(t,lr(e))}var h6=1/0,p6=Go&&1/Km(new Go([,-0]))[1]==h6?function(t){return new Go(t)}:Pt,g6=200;function gR(t,e,n){var r=-1,i=vT,s=t.length,o=!0,a=[],c=a;if(s>=g6){var u=e?null:p6(t);if(u)return Km(u);o=!1,i=Vm,c=new Wo}else c=e?[]:a;e:for(;++r<s;){var l=t[r],d=e?e(l):l;if(l=l!==0?l:0,o&&d===d){for(var f=c.length;f--;)if(c[f]===d)continue e;e&&c.push(d),a.push(l)}else i(c,d,n)||(c!==a&&c.push(d),a.push(l))}return a}function Zm(t){return t&&t.length?gR(t):[]}function m6(t,e){return t&&t.length?gR(t,lr(e)):[]}function Qm(t){console&&console.error&&console.error(`Error: ${t}`)}function mR(t){console&&console.warn&&console.warn(`Warning: ${t}`)}function yR(t){const e=new Date().getTime(),n=t();return{time:new Date().getTime()-e,value:n}}function vR(t){function e(){}e.prototype=t;const n=new e;function r(){return typeof n.bar}return r(),r(),t}function y6(t){return v6(t)?t.LABEL:t.name}function v6(t){return bn(t.LABEL)&&t.LABEL!==""}class Lr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){this._definition=e}accept(e){e.visit(this),ve(this.definition,n=>{n.accept(e)})}}class cn extends Lr{constructor(e){super([]),this.idx=1,xn(this,hr(e,n=>n!==void 0))}set definition(e){}get definition(){return this.referencedRule!==void 0?this.referencedRule.definition:[]}accept(e){e.visit(this)}}class Ko extends Lr{constructor(e){super(e.definition),this.orgText="",xn(this,hr(e,n=>n!==void 0))}}class En extends Lr{constructor(e){super(e.definition),this.ignoreAmbiguities=!1,xn(this,hr(e,n=>n!==void 0))}}class Gt extends Lr{constructor(e){super(e.definition),this.idx=1,xn(this,hr(e,n=>n!==void 0))}}class Nn extends Lr{constructor(e){super(e.definition),this.idx=1,xn(this,hr(e,n=>n!==void 0))}}class On extends Lr{constructor(e){super(e.definition),this.idx=1,xn(this,hr(e,n=>n!==void 0))}}class wt extends Lr{constructor(e){super(e.definition),this.idx=1,xn(this,hr(e,n=>n!==void 0))}}class Dn extends Lr{constructor(e){super(e.definition),this.idx=1,xn(this,hr(e,n=>n!==void 0))}}class Tn extends Lr{get definition(){return this._definition}set definition(e){this._definition=e}constructor(e){super(e.definition),this.idx=1,this.ignoreAmbiguities=!1,this.hasPredicates=!1,xn(this,hr(e,n=>n!==void 0))}}class ot{constructor(e){this.idx=1,xn(this,hr(e,n=>n!==void 0))}accept(e){e.visit(this)}}function w6(t){return de(t,mf)}function mf(t){function e(n){return de(n,mf)}if(t instanceof cn){const n={type:"NonTerminal",name:t.nonTerminalName,idx:t.idx};return bn(t.label)&&(n.label=t.label),n}else{if(t instanceof En)return{type:"Alternative",definition:e(t.definition)};if(t instanceof Gt)return{type:"Option",idx:t.idx,definition:e(t.definition)};if(t instanceof Nn)return{type:"RepetitionMandatory",idx:t.idx,definition:e(t.definition)};if(t instanceof On)return{type:"RepetitionMandatoryWithSeparator",idx:t.idx,separator:mf(new ot({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof Dn)return{type:"RepetitionWithSeparator",idx:t.idx,separator:mf(new ot({terminalType:t.separator})),definition:e(t.definition)};if(t instanceof wt)return{type:"Repetition",idx:t.idx,definition:e(t.definition)};if(t instanceof Tn)return{type:"Alternation",idx:t.idx,definition:e(t.definition)};if(t instanceof ot){const n={type:"Terminal",name:t.terminalType.name,label:y6(t.terminalType),idx:t.idx};bn(t.label)&&(n.terminalLabel=t.label);const r=t.terminalType.PATTERN;return t.terminalType.PATTERN&&(n.pattern=hi(r)?r.source:r),n}else{if(t instanceof Ko)return{type:"Rule",name:t.name,orgText:t.orgText,definition:e(t.definition)};throw Error("non exhaustive match")}}}class Yo{visit(e){const n=e;switch(n.constructor){case cn:return this.visitNonTerminal(n);case En:return this.visitAlternative(n);case Gt:return this.visitOption(n);case Nn:return this.visitRepetitionMandatory(n);case On:return this.visitRepetitionMandatoryWithSeparator(n);case Dn:return this.visitRepetitionWithSeparator(n);case wt:return this.visitRepetition(n);case Tn:return this.visitAlternation(n);case ot:return this.visitTerminal(n);case Ko:return this.visitRule(n);default:throw Error("non exhaustive match")}}visitNonTerminal(e){}visitAlternative(e){}visitOption(e){}visitRepetition(e){}visitRepetitionMandatory(e){}visitRepetitionMandatoryWithSeparator(e){}visitRepetitionWithSeparator(e){}visitAlternation(e){}visitTerminal(e){}visitRule(e){}}function b6(t){return t instanceof En||t instanceof Gt||t instanceof wt||t instanceof Nn||t instanceof On||t instanceof Dn||t instanceof ot||t instanceof Ko}function yf(t,e=[]){return t instanceof Gt||t instanceof wt||t instanceof Dn?!0:t instanceof Tn?pR(t.definition,r=>yf(r,e)):t instanceof cn&&on(e,t)?!1:t instanceof Lr?(t instanceof cn&&e.push(t),dr(t.definition,r=>yf(r,e))):!1}function E6(t){return t instanceof Tn}function Mr(t){if(t instanceof cn)return"SUBRULE";if(t instanceof Gt)return"OPTION";if(t instanceof Tn)return"OR";if(t instanceof Nn)return"AT_LEAST_ONE";if(t instanceof On)return"AT_LEAST_ONE_SEP";if(t instanceof Dn)return"MANY_SEP";if(t instanceof wt)return"MANY";if(t instanceof ot)return"CONSUME";throw Error("non exhaustive match")}class vf{walk(e,n=[]){ve(e.definition,(r,i)=>{const s=Ut(e.definition,i+1);if(r instanceof cn)this.walkProdRef(r,s,n);else if(r instanceof ot)this.walkTerminal(r,s,n);else if(r instanceof En)this.walkFlat(r,s,n);else if(r instanceof Gt)this.walkOption(r,s,n);else if(r instanceof Nn)this.walkAtLeastOne(r,s,n);else if(r instanceof On)this.walkAtLeastOneSep(r,s,n);else if(r instanceof Dn)this.walkManySep(r,s,n);else if(r instanceof wt)this.walkMany(r,s,n);else if(r instanceof Tn)this.walkOr(r,s,n);else throw Error("non exhaustive match")})}walkTerminal(e,n,r){}walkProdRef(e,n,r){}walkFlat(e,n,r){const i=n.concat(r);this.walk(e,i)}walkOption(e,n,r){const i=n.concat(r);this.walk(e,i)}walkAtLeastOne(e,n,r){const i=[new Gt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkAtLeastOneSep(e,n,r){const i=wR(e,n,r);this.walk(e,i)}walkMany(e,n,r){const i=[new Gt({definition:e.definition})].concat(n,r);this.walk(e,i)}walkManySep(e,n,r){const i=wR(e,n,r);this.walk(e,i)}walkOr(e,n,r){const i=n.concat(r);ve(e.definition,s=>{const o=new En({definition:[s]});this.walk(o,i)})}}function wR(t,e,n){return[new Gt({definition:[new ot({terminalType:t.separator})].concat(t.definition)})].concat(e,n)}function jc(t){if(t instanceof cn)return jc(t.referencedRule);if(t instanceof ot)return R6(t);if(b6(t))return D6(t);if(E6(t))return T6(t);throw Error("non exhaustive match")}function D6(t){let e=[];const n=t.definition;let r=0,i=n.length>r,s,o=!0;for(;i&&o;)s=n[r],o=yf(s),e=e.concat(jc(s)),r=r+1,i=n.length>r;return Zm(e)}function T6(t){const e=de(t.definition,n=>jc(n));return Zm(Yn(e))}function R6(t){return[t.terminalType]}const bR="_~IN~_";class S6 extends vf{constructor(e){super(),this.topProd=e,this.follows={}}startWalking(){return this.walk(this.topProd),this.follows}walkTerminal(e,n,r){}walkProdRef(e,n,r){const i=$6(e.referencedRule,e.idx)+this.topProd.name,s=n.concat(r),o=new En({definition:s}),a=jc(o);this.follows[i]=a}}function k6(t){const e={};return ve(t,n=>{const r=new S6(n).startWalking();xn(e,r)}),e}function $6(t,e){return t.name+e+bR}let wf={};const C6=new KD;function bf(t){const e=t.toString();if(wf.hasOwnProperty(e))return wf[e];{const n=C6.pattern(e);return wf[e]=n,n}}function _6(){wf={}}const ER="Complement Sets are not supported for first char optimization",Ef=`Unable to use "first char" lexer optimizations:
13
+ `;function A6(t,e=!1){try{const n=bf(t);return ey(n.value,{},n.flags.ignoreCase)}catch(n){if(n.message===ER)e&&mR(`${Ef} Unable to optimize: < ${t.toString()} >
14
+ Complement Sets cannot be automatically optimized.
15
+ This will disable the lexer's first char optimizations.
16
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#COMPLEMENT for details.`);else{let r="";e&&(r=`
17
+ This will disable the lexer's first char optimizations.
18
+ See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#REGEXP_PARSING for details.`),Qm(`${Ef}
19
+ Failed parsing: < ${t.toString()} >
20
+ Using the @chevrotain/regexp-to-ast library
21
+ Please open an issue at: https://github.com/chevrotain/chevrotain/issues`+r)}}return[]}function ey(t,e,n){switch(t.type){case"Disjunction":for(let i=0;i<t.value.length;i++)ey(t.value[i],e,n);break;case"Alternative":const r=t.value;for(let i=0;i<r.length;i++){const s=r[i];switch(s.type){case"EndAnchor":case"GroupBackReference":case"Lookahead":case"NegativeLookahead":case"StartAnchor":case"WordBoundary":case"NonWordBoundary":continue}const o=s;switch(o.type){case"Character":Df(o.value,e,n);break;case"Set":if(o.complement===!0)throw Error(ER);ve(o.value,c=>{if(typeof c=="number")Df(c,e,n);else{const u=c;if(n===!0)for(let l=u.from;l<=u.to;l++)Df(l,e,n);else{for(let l=u.from;l<=u.to&&l<Gc;l++)Df(l,e,n);if(u.to>=Gc){const l=u.from>=Gc?u.from:Gc,d=u.to,f=Bi(l),h=Bi(d);for(let p=f;p<=h;p++)e[p]=p}}}});break;case"Group":ey(o.value,e,n);break;default:throw Error("Non Exhaustive Match")}const a=o.quantifier!==void 0&&o.quantifier.atLeast===0;if(o.type==="Group"&&ty(o)===!1||o.type!=="Group"&&a===!1)break}break;default:throw Error("non exhaustive match!")}return Nt(e)}function Df(t,e,n){const r=Bi(t);e[r]=r,n===!0&&x6(t,e)}function x6(t,e){const n=String.fromCharCode(t),r=n.toUpperCase();if(r!==n){const i=Bi(r.charCodeAt(0));e[i]=i}else{const i=n.toLowerCase();if(i!==n){const s=Bi(i.charCodeAt(0));e[s]=s}}}function DR(t,e){return Vo(t.value,n=>{if(typeof n=="number")return on(e,n);{const r=n;return Vo(e,i=>r.from<=i&&i<=r.to)!==void 0}})}function ty(t){const e=t.quantifier;return e&&e.atLeast===0?!0:t.value?Be(t.value)?dr(t.value,ty):ty(t.value):!1}class I6 extends Yd{constructor(e){super(),this.targetCharCodes=e,this.found=!1}visitChildren(e){if(this.found!==!0){switch(e.type){case"Lookahead":this.visitLookahead(e);return;case"NegativeLookahead":this.visitNegativeLookahead(e);return}super.visitChildren(e)}}visitCharacter(e){on(this.targetCharCodes,e.value)&&(this.found=!0)}visitSet(e){e.complement?DR(e,this.targetCharCodes)===void 0&&(this.found=!0):DR(e,this.targetCharCodes)!==void 0&&(this.found=!0)}}function ny(t,e){if(e instanceof RegExp){const n=bf(e),r=new I6(t);return r.visit(n),r.found}else return Vo(e,n=>on(t,n.charCodeAt(0)))!==void 0}const Os="PATTERN",Uc="defaultMode",Tf="modes";let TR=typeof new RegExp("(?:)").sticky=="boolean";function P6(t,e){e=Jm(e,{useSticky:TR,debug:!1,safeMode:!1,positionTracking:"full",lineTerminatorCharacters:["\r",`
22
+ `],tracer:(w,E)=>E()});const n=e.tracer;n("initCharCodeToOptimizedIndexMap",()=>{n5()});let r;n("Reject Lexer.NA",()=>{r=gf(t,w=>w[Os]===Rn.NA)});let i=!1,s;n("Transform Patterns",()=>{i=!1,s=de(r,w=>{const E=w[Os];if(hi(E)){const k=E.source;return k.length===1&&k!=="^"&&k!=="$"&&k!=="."&&!E.ignoreCase?k:k.length===2&&k[0]==="\\"&&!on(["d","D","s","S","t","r","n","t","0","c","b","B","f","v","w","W"],k[1])?k[1]:e.useSticky?SR(E):RR(E)}else{if(ui(E))return i=!0,{exec:E};if(typeof E=="object")return i=!0,E;if(typeof E=="string"){if(E.length===1)return E;{const k=E.replace(/[\\^$.*+?()[\]{}|]/g,"\\$&"),A=new RegExp(k);return e.useSticky?SR(A):RR(A)}}else throw Error("non exhaustive match")}})});let o,a,c,u,l;n("misc mapping",()=>{o=de(r,w=>w.tokenTypeIdx),a=de(r,w=>{const E=w.GROUP;if(E!==Rn.SKIPPED){if(bn(E))return E;if(pi(E))return!1;throw Error("non exhaustive match")}}),c=de(r,w=>{const E=w.LONGER_ALT;if(E)return Be(E)?de(E,A=>fR(r,A)):[fR(r,E)]}),u=de(r,w=>w.PUSH_MODE),l=de(r,w=>be(w,"POP_MODE"))});let d;n("Line Terminator Handling",()=>{const w=CR(e.lineTerminatorCharacters);d=de(r,E=>!1),e.positionTracking!=="onlyOffset"&&(d=de(r,E=>be(E,"LINE_BREAKS")?!!E.LINE_BREAKS:$R(E,w)===!1&&ny(w,E.PATTERN)))});let f,h,p,g;n("Misc Mapping #2",()=>{f=de(r,kR),h=de(s,Q6),p=an(r,(w,E)=>{const k=E.GROUP;return bn(k)&&k!==Rn.SKIPPED&&(w[k]=[]),w},{}),g=de(s,(w,E)=>({pattern:s[E],longerAlt:c[E],canLineTerminator:d[E],isCustom:f[E],short:h[E],group:a[E],push:u[E],pop:l[E],tokenTypeIdx:o[E],tokenType:r[E]}))});let y=!0,m=[];return e.safeMode||n("First Char Optimization",()=>{m=an(r,(w,E,k)=>{if(typeof E.PATTERN=="string"){const A=E.PATTERN.charCodeAt(0),I=Bi(A);ry(w,I,g[k])}else if(Be(E.START_CHARS_HINT)){let A;ve(E.START_CHARS_HINT,I=>{const x=typeof I=="string"?I.charCodeAt(0):I,_=Bi(x);A!==_&&(A=_,ry(w,_,g[k]))})}else if(hi(E.PATTERN))if(E.PATTERN.unicode)y=!1,e.ensureOptimizations&&Qm(`${Ef} Unable to analyze < ${E.PATTERN.toString()} > pattern.
23
+ The regexp unicode flag is not currently supported by the regexp-to-ast library.
24
+ This will disable the lexer's first char optimizations.
25
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNICODE_OPTIMIZE`);else{const A=A6(E.PATTERN,e.ensureOptimizations);tt(A)&&(y=!1),ve(A,I=>{ry(w,I,g[k])})}else e.ensureOptimizations&&Qm(`${Ef} TokenType: <${E.name}> is using a custom token pattern without providing <start_chars_hint> parameter.
26
+ This will disable the lexer's first char optimizations.
27
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_OPTIMIZE`),y=!1;return w},[])}),{emptyGroups:p,patternIdxToConfig:g,charCodeToPatternIdxToConfig:m,hasCustom:i,canBeOptimized:y}}function N6(t,e){let n=[];const r=F6(t);n=n.concat(r.errors);const i=L6(r.valid),s=i.valid;return n=n.concat(i.errors),n=n.concat(O6(s)),n=n.concat(W6(s)),n=n.concat(H6(s,e)),n=n.concat(V6(s)),n}function O6(t){let e=[];const n=In(t,r=>hi(r[Os]));return e=e.concat(z6(n)),e=e.concat(j6(n)),e=e.concat(U6(n)),e=e.concat(G6(n)),e=e.concat(B6(n)),e}function F6(t){const e=In(t,i=>!be(i,Os)),n=de(e,i=>({message:"Token Type: ->"+i.name+"<- missing static 'PATTERN' property",type:bt.MISSING_PATTERN,tokenTypes:[i]})),r=pf(t,e);return{errors:n,valid:r}}function L6(t){const e=In(t,i=>{const s=i[Os];return!hi(s)&&!ui(s)&&!be(s,"exec")&&!bn(s)}),n=de(e,i=>({message:"Token Type: ->"+i.name+"<- static 'PATTERN' can only be a RegExp, a Function matching the {CustomPatternMatcherFunc} type or an Object matching the {ICustomPattern} interface.",type:bt.INVALID_PATTERN,tokenTypes:[i]})),r=pf(t,e);return{errors:n,valid:r}}const M6=/[^\\][$]/;function z6(t){class e extends Yd{constructor(){super(...arguments),this.found=!1}visitEndAnchor(s){this.found=!0}}const n=In(t,i=>{const s=i.PATTERN;try{const o=bf(s),a=new e;return a.visit(o),a.found}catch{return M6.test(s.source)}});return de(n,i=>({message:`Unexpected RegExp Anchor Error:
28
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain end of input anchor '$'
29
+ See chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:bt.EOI_ANCHOR_FOUND,tokenTypes:[i]}))}function B6(t){const e=In(t,r=>r.PATTERN.test(""));return de(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' must not match an empty string",type:bt.EMPTY_MATCH_PATTERN,tokenTypes:[r]}))}const q6=/[^\\[][\^]|^\^/;function j6(t){class e extends Yd{constructor(){super(...arguments),this.found=!1}visitStartAnchor(s){this.found=!0}}const n=In(t,i=>{const s=i.PATTERN;try{const o=bf(s),a=new e;return a.visit(o),a.found}catch{return q6.test(s.source)}});return de(n,i=>({message:`Unexpected RegExp Anchor Error:
30
+ Token Type: ->`+i.name+`<- static 'PATTERN' cannot contain start of input anchor '^'
31
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#ANCHORS for details.`,type:bt.SOI_ANCHOR_FOUND,tokenTypes:[i]}))}function U6(t){const e=In(t,r=>{const i=r[Os];return i instanceof RegExp&&(i.multiline||i.global)});return de(e,r=>({message:"Token Type: ->"+r.name+"<- static 'PATTERN' may NOT contain global('g') or multiline('m')",type:bt.UNSUPPORTED_FLAGS_FOUND,tokenTypes:[r]}))}function G6(t){const e=[];let n=de(t,s=>an(t,(o,a)=>(s.PATTERN.source===a.PATTERN.source&&!on(e,a)&&a.PATTERN!==Rn.NA&&(e.push(a),o.push(a)),o),[]));n=Bc(n);const r=In(n,s=>s.length>1);return de(r,s=>{const o=de(s,c=>c.name);return{message:`The same RegExp pattern ->${fr(s).PATTERN}<-has been used in all of the following Token Types: ${o.join(", ")} <-`,type:bt.DUPLICATE_PATTERNS_FOUND,tokenTypes:s}})}function W6(t){const e=In(t,r=>{if(!be(r,"GROUP"))return!1;const i=r.GROUP;return i!==Rn.SKIPPED&&i!==Rn.NA&&!bn(i)});return de(e,r=>({message:"Token Type: ->"+r.name+"<- static 'GROUP' can only be Lexer.SKIPPED/Lexer.NA/A String",type:bt.INVALID_GROUP_TYPE_FOUND,tokenTypes:[r]}))}function H6(t,e){const n=In(t,i=>i.PUSH_MODE!==void 0&&!on(e,i.PUSH_MODE));return de(n,i=>({message:`Token Type: ->${i.name}<- static 'PUSH_MODE' value cannot refer to a Lexer Mode ->${i.PUSH_MODE}<-which does not exist`,type:bt.PUSH_MODE_DOES_NOT_EXIST,tokenTypes:[i]}))}function V6(t){const e=[],n=an(t,(r,i,s)=>{const o=i.PATTERN;return o===Rn.NA||(bn(o)?r.push({str:o,idx:s,tokenType:i}):hi(o)&&Y6(o)&&r.push({str:o.source,idx:s,tokenType:i})),r},[]);return ve(t,(r,i)=>{ve(n,({str:s,idx:o,tokenType:a})=>{if(i<o&&K6(s,r.PATTERN)){const c=`Token: ->${a.name}<- can never be matched.
32
+ Because it appears AFTER the Token Type ->${r.name}<-in the lexer's definition.
33
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#UNREACHABLE`;e.push({message:c,type:bt.UNREACHABLE_PATTERN,tokenTypes:[r,a]})}})}),e}function K6(t,e){if(hi(e)){const n=e.exec(t);return n!==null&&n.index===0}else{if(ui(e))return e(t,0,[],{});if(be(e,"exec"))return e.exec(t,0,[],{});if(typeof e=="string")return e===t;throw Error("non exhaustive match")}}function Y6(t){return Vo([".","\\","[","]","|","^","$","(",")","?","*","+","{"],n=>t.source.indexOf(n)!==-1)===void 0}function RR(t){const e=t.ignoreCase?"i":"";return new RegExp(`^(?:${t.source})`,e)}function SR(t){const e=t.ignoreCase?"iy":"y";return new RegExp(`${t.source}`,e)}function X6(t,e,n){const r=[];return be(t,Uc)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Uc+`> property in its definition
34
+ `,type:bt.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE}),be(t,Tf)||r.push({message:"A MultiMode Lexer cannot be initialized without a <"+Tf+`> property in its definition
35
+ `,type:bt.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY}),be(t,Tf)&&be(t,Uc)&&!be(t.modes,t.defaultMode)&&r.push({message:`A MultiMode Lexer cannot be initialized with a ${Uc}: <${t.defaultMode}>which does not exist
36
+ `,type:bt.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST}),be(t,Tf)&&ve(t.modes,(i,s)=>{ve(i,(o,a)=>{if(pi(o))r.push({message:`A Lexer cannot be initialized using an undefined Token Type. Mode:<${s}> at index: <${a}>
37
+ `,type:bt.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED});else if(be(o,"LONGER_ALT")){const c=Be(o.LONGER_ALT)?o.LONGER_ALT:[o.LONGER_ALT];ve(c,u=>{!pi(u)&&!on(i,u)&&r.push({message:`A MultiMode Lexer cannot be initialized with a longer_alt <${u.name}> on token <${o.name}> outside of mode <${s}>
38
+ `,type:bt.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE})})}})}),r}function J6(t,e,n){const r=[];let i=!1;const s=Bc(Yn(Nt(t.modes))),o=gf(s,c=>c[Os]===Rn.NA),a=CR(n);return e&&ve(o,c=>{const u=$R(c,a);if(u!==!1){const d={message:t5(c,u),type:u.issue,tokenType:c};r.push(d)}else be(c,"LINE_BREAKS")?c.LINE_BREAKS===!0&&(i=!0):ny(a,c.PATTERN)&&(i=!0)}),e&&!i&&r.push({message:`Warning: No LINE_BREAKS Found.
39
+ This Lexer has been defined to track line and column information,
40
+ But none of the Token Types can be identified as matching a line terminator.
41
+ See https://chevrotain.io/docs/guide/resolving_lexer_errors.html#LINE_BREAKS
42
+ for details.`,type:bt.NO_LINE_BREAKS_FLAGS}),r}function Z6(t){const e={},n=Kn(t);return ve(n,r=>{const i=t[r];if(Be(i))e[r]=[];else throw Error("non exhaustive match")}),e}function kR(t){const e=t.PATTERN;if(hi(e))return!1;if(ui(e))return!0;if(be(e,"exec"))return!0;if(bn(e))return!1;throw Error("non exhaustive match")}function Q6(t){return bn(t)&&t.length===1?t.charCodeAt(0):!1}const e5={test:function(t){const e=t.length;for(let n=this.lastIndex;n<e;n++){const r=t.charCodeAt(n);if(r===10)return this.lastIndex=n+1,!0;if(r===13)return t.charCodeAt(n+1)===10?this.lastIndex=n+2:this.lastIndex=n+1,!0}return!1},lastIndex:0};function $R(t,e){if(be(t,"LINE_BREAKS"))return!1;if(hi(t.PATTERN)){try{ny(e,t.PATTERN)}catch(n){return{issue:bt.IDENTIFY_TERMINATOR,errMsg:n.message}}return!1}else{if(bn(t.PATTERN))return!1;if(kR(t))return{issue:bt.CUSTOM_LINE_BREAK};throw Error("non exhaustive match")}}function t5(t,e){if(e.issue===bt.IDENTIFY_TERMINATOR)return`Warning: unable to identify line terminator usage in pattern.
43
+ The problem is in the <${t.name}> Token Type
44
+ Root cause: ${e.errMsg}.
45
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#IDENTIFY_TERMINATOR`;if(e.issue===bt.CUSTOM_LINE_BREAK)return`Warning: A Custom Token Pattern should specify the <line_breaks> option.
46
+ The problem is in the <${t.name}> Token Type
47
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#CUSTOM_LINE_BREAK`;throw Error("non exhaustive match")}function CR(t){return de(t,n=>bn(n)?n.charCodeAt(0):n)}function ry(t,e,n){t[e]===void 0?t[e]=[n]:t[e].push(n)}const Gc=256;let Rf=[];function Bi(t){return t<Gc?t:Rf[t]}function n5(){if(tt(Rf)){Rf=new Array(65536);for(let t=0;t<65536;t++)Rf[t]=t>255?255+~~(t/255):t}}function Wc(t,e){const n=t.tokenTypeIdx;return n===e.tokenTypeIdx?!0:e.isParent===!0&&e.categoryMatchesMap[n]===!0}function Sf(t,e){return t.tokenTypeIdx===e.tokenTypeIdx}let _R=1;const AR={};function Hc(t){const e=r5(t);i5(e),o5(e),s5(e),ve(e,n=>{n.isParent=n.categoryMatches.length>0})}function r5(t){let e=jt(t),n=t,r=!0;for(;r;){n=Bc(Yn(de(n,s=>s.CATEGORIES)));const i=pf(n,e);e=e.concat(i),tt(i)?r=!1:n=i}return e}function i5(t){ve(t,e=>{IR(e)||(AR[_R]=e,e.tokenTypeIdx=_R++),PR(e)&&!Be(e.CATEGORIES)&&(e.CATEGORIES=[e.CATEGORIES]),PR(e)||(e.CATEGORIES=[]),a5(e)||(e.categoryMatches=[]),c5(e)||(e.categoryMatchesMap={})})}function s5(t){ve(t,e=>{e.categoryMatches=[],ve(e.categoryMatchesMap,(n,r)=>{e.categoryMatches.push(AR[r].tokenTypeIdx)})})}function o5(t){ve(t,e=>{xR([],e)})}function xR(t,e){ve(t,n=>{e.categoryMatchesMap[n.tokenTypeIdx]=!0}),ve(e.CATEGORIES,n=>{const r=t.concat(e);on(r,n)||xR(r,n)})}function IR(t){return be(t,"tokenTypeIdx")}function PR(t){return be(t,"CATEGORIES")}function a5(t){return be(t,"categoryMatches")}function c5(t){return be(t,"categoryMatchesMap")}function u5(t){return be(t,"tokenTypeIdx")}const l5={buildUnableToPopLexerModeMessage(t){return`Unable to pop Lexer Mode after encountering Token ->${t.image}<- The Mode Stack is empty`},buildUnexpectedCharactersMessage(t,e,n,r,i){return`unexpected character: ->${t.charAt(e)}<- at offset: ${e}, skipped ${n} characters.`}};var bt;(function(t){t[t.MISSING_PATTERN=0]="MISSING_PATTERN",t[t.INVALID_PATTERN=1]="INVALID_PATTERN",t[t.EOI_ANCHOR_FOUND=2]="EOI_ANCHOR_FOUND",t[t.UNSUPPORTED_FLAGS_FOUND=3]="UNSUPPORTED_FLAGS_FOUND",t[t.DUPLICATE_PATTERNS_FOUND=4]="DUPLICATE_PATTERNS_FOUND",t[t.INVALID_GROUP_TYPE_FOUND=5]="INVALID_GROUP_TYPE_FOUND",t[t.PUSH_MODE_DOES_NOT_EXIST=6]="PUSH_MODE_DOES_NOT_EXIST",t[t.MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE=7]="MULTI_MODE_LEXER_WITHOUT_DEFAULT_MODE",t[t.MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY=8]="MULTI_MODE_LEXER_WITHOUT_MODES_PROPERTY",t[t.MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST=9]="MULTI_MODE_LEXER_DEFAULT_MODE_VALUE_DOES_NOT_EXIST",t[t.LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED=10]="LEXER_DEFINITION_CANNOT_CONTAIN_UNDEFINED",t[t.SOI_ANCHOR_FOUND=11]="SOI_ANCHOR_FOUND",t[t.EMPTY_MATCH_PATTERN=12]="EMPTY_MATCH_PATTERN",t[t.NO_LINE_BREAKS_FLAGS=13]="NO_LINE_BREAKS_FLAGS",t[t.UNREACHABLE_PATTERN=14]="UNREACHABLE_PATTERN",t[t.IDENTIFY_TERMINATOR=15]="IDENTIFY_TERMINATOR",t[t.CUSTOM_LINE_BREAK=16]="CUSTOM_LINE_BREAK",t[t.MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE=17]="MULTI_MODE_LEXER_LONGER_ALT_NOT_IN_CURRENT_MODE"})(bt||(bt={}));const Vc={deferDefinitionErrorsHandling:!1,positionTracking:"full",lineTerminatorsPattern:/\n|\r\n?/g,lineTerminatorCharacters:[`
48
+ `,"\r"],ensureOptimizations:!1,safeMode:!1,errorMessageProvider:l5,traceInitPerf:!1,skipValidations:!1,recoveryEnabled:!0};Object.freeze(Vc);class Rn{constructor(e,n=Vc){if(this.lexerDefinition=e,this.lexerDefinitionErrors=[],this.lexerDefinitionWarning=[],this.patternIdxToConfig={},this.charCodeToPatternIdxToConfig={},this.modes=[],this.emptyGroups={},this.trackStartLines=!0,this.trackEndLines=!0,this.hasCustom=!1,this.canModeBeOptimized={},this.TRACE_INIT=(i,s)=>{if(this.traceInitPerf===!0){this.traceInitIndent++;const o=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${o}--> <${i}>`);const{time:a,value:c}=yR(s),u=a>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&u(`${o}<-- <${i}> time: ${a}ms`),this.traceInitIndent--,c}else return s()},typeof n=="boolean")throw Error(`The second argument to the Lexer constructor is now an ILexerConfig Object.
49
+ a boolean 2nd argument is no longer supported`);this.config=xn({},Vc,n);const r=this.config.traceInitPerf;r===!0?(this.traceInitMaxIdent=1/0,this.traceInitPerf=!0):typeof r=="number"&&(this.traceInitMaxIdent=r,this.traceInitPerf=!0),this.traceInitIndent=-1,this.TRACE_INIT("Lexer Constructor",()=>{let i,s=!0;this.TRACE_INIT("Lexer Config handling",()=>{if(this.config.lineTerminatorsPattern===Vc.lineTerminatorsPattern)this.config.lineTerminatorsPattern=e5;else if(this.config.lineTerminatorCharacters===Vc.lineTerminatorCharacters)throw Error(`Error: Missing <lineTerminatorCharacters> property on the Lexer config.
50
+ For details See: https://chevrotain.io/docs/guide/resolving_lexer_errors.html#MISSING_LINE_TERM_CHARS`);if(n.safeMode&&n.ensureOptimizations)throw Error('"safeMode" and "ensureOptimizations" flags are mutually exclusive.');this.trackStartLines=/full|onlyStart/i.test(this.config.positionTracking),this.trackEndLines=/full/i.test(this.config.positionTracking),Be(e)?i={modes:{defaultMode:jt(e)},defaultMode:Uc}:(s=!1,i=jt(e))}),this.config.skipValidations===!1&&(this.TRACE_INIT("performRuntimeChecks",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(X6(i,this.trackStartLines,this.config.lineTerminatorCharacters))}),this.TRACE_INIT("performWarningRuntimeChecks",()=>{this.lexerDefinitionWarning=this.lexerDefinitionWarning.concat(J6(i,this.trackStartLines,this.config.lineTerminatorCharacters))})),i.modes=i.modes?i.modes:{},ve(i.modes,(a,c)=>{i.modes[c]=gf(a,u=>pi(u))});const o=Kn(i.modes);if(ve(i.modes,(a,c)=>{this.TRACE_INIT(`Mode: <${c}> processing`,()=>{if(this.modes.push(c),this.config.skipValidations===!1&&this.TRACE_INIT("validatePatterns",()=>{this.lexerDefinitionErrors=this.lexerDefinitionErrors.concat(N6(a,o))}),tt(this.lexerDefinitionErrors)){Hc(a);let u;this.TRACE_INIT("analyzeTokenTypes",()=>{u=P6(a,{lineTerminatorCharacters:this.config.lineTerminatorCharacters,positionTracking:n.positionTracking,ensureOptimizations:n.ensureOptimizations,safeMode:n.safeMode,tracer:this.TRACE_INIT})}),this.patternIdxToConfig[c]=u.patternIdxToConfig,this.charCodeToPatternIdxToConfig[c]=u.charCodeToPatternIdxToConfig,this.emptyGroups=xn({},this.emptyGroups,u.emptyGroups),this.hasCustom=u.hasCustom||this.hasCustom,this.canModeBeOptimized[c]=u.canBeOptimized}})}),this.defaultMode=i.defaultMode,!tt(this.lexerDefinitionErrors)&&!this.config.deferDefinitionErrorsHandling){const c=de(this.lexerDefinitionErrors,u=>u.message).join(`-----------------------
51
+ `);throw new Error(`Errors detected in definition of Lexer:
52
+ `+c)}ve(this.lexerDefinitionWarning,a=>{mR(a.message)}),this.TRACE_INIT("Choosing sub-methods implementations",()=>{if(TR?(this.chopInput=As,this.match=this.matchWithTest):(this.updateLastIndex=Pt,this.match=this.matchWithExec),s&&(this.handleModes=Pt),this.trackStartLines===!1&&(this.computeNewColumn=As),this.trackEndLines===!1&&(this.updateTokenEndLineColumnLocation=Pt),/full/i.test(this.config.positionTracking))this.createTokenInstance=this.createFullToken;else if(/onlyStart/i.test(this.config.positionTracking))this.createTokenInstance=this.createStartOnlyToken;else if(/onlyOffset/i.test(this.config.positionTracking))this.createTokenInstance=this.createOffsetOnlyToken;else throw Error(`Invalid <positionTracking> config option: "${this.config.positionTracking}"`);this.hasCustom?(this.addToken=this.addTokenUsingPush,this.handlePayload=this.handlePayloadWithCustom):(this.addToken=this.addTokenUsingMemberAccess,this.handlePayload=this.handlePayloadNoCustom)}),this.TRACE_INIT("Failed Optimization Warnings",()=>{const a=an(this.canModeBeOptimized,(c,u,l)=>(u===!1&&c.push(l),c),[]);if(n.ensureOptimizations&&!tt(a))throw Error(`Lexer Modes: < ${a.join(", ")} > cannot be optimized.
53
+ Disable the "ensureOptimizations" lexer config flag to silently ignore this and run the lexer in an un-optimized mode.
54
+ Or inspect the console log for details on how to resolve these issues.`)}),this.TRACE_INIT("clearRegExpParserCache",()=>{_6()}),this.TRACE_INIT("toFastProperties",()=>{vR(this)})})}tokenize(e,n=this.defaultMode){if(!tt(this.lexerDefinitionErrors)){const i=de(this.lexerDefinitionErrors,s=>s.message).join(`-----------------------
55
+ `);throw new Error(`Unable to Tokenize because Errors detected in definition of Lexer:
56
+ `+i)}return this.tokenizeInternal(e,n)}tokenizeInternal(e,n){let r,i,s,o,a,c,u,l,d,f,h,p,g,y,m;const w=e,E=w.length;let k=0,A=0;const I=this.hasCustom?0:Math.floor(e.length/10),x=new Array(I),_=[];let P=this.trackStartLines?1:void 0,O=this.trackStartLines?1:void 0;const C=Z6(this.emptyGroups),D=this.trackStartLines,R=this.config.lineTerminatorsPattern;let L=0,W=[],V=[];const Z=[],Fe=[];Object.freeze(Fe);let se;function K(){return W}function Te(ne){const fe=Bi(ne),Ee=V[fe];return Ee===void 0?Fe:Ee}const at=ne=>{if(Z.length===1&&ne.tokenType.PUSH_MODE===void 0){const fe=this.config.errorMessageProvider.buildUnableToPopLexerModeMessage(ne);_.push({offset:ne.startOffset,line:ne.startLine,column:ne.startColumn,length:ne.image.length,message:fe})}else{Z.pop();const fe=Ho(Z);W=this.patternIdxToConfig[fe],V=this.charCodeToPatternIdxToConfig[fe],L=W.length;const Ee=this.canModeBeOptimized[fe]&&this.config.safeMode===!1;V&&Ee?se=Te:se=K}};function H(ne){Z.push(ne),V=this.charCodeToPatternIdxToConfig[ne],W=this.patternIdxToConfig[ne],L=W.length,L=W.length;const fe=this.canModeBeOptimized[ne]&&this.config.safeMode===!1;V&&fe?se=Te:se=K}H.call(this,n);let Y;const Q=this.config.recoveryEnabled;for(;k<E;){c=null;const ne=w.charCodeAt(k),fe=se(ne),Ee=fe.length;for(r=0;r<Ee;r++){Y=fe[r];const me=Y.pattern;u=null;const ae=Y.short;if(ae!==!1?ne===ae&&(c=me):Y.isCustom===!0?(m=me.exec(w,k,x,C),m!==null?(c=m[0],m.payload!==void 0&&(u=m.payload)):c=null):(this.updateLastIndex(me,k),c=this.match(me,e,k)),c!==null){if(a=Y.longerAlt,a!==void 0){const M=a.length;for(s=0;s<M;s++){const U=W[a[s]],oe=U.pattern;if(l=null,U.isCustom===!0?(m=oe.exec(w,k,x,C),m!==null?(o=m[0],m.payload!==void 0&&(l=m.payload)):o=null):(this.updateLastIndex(oe,k),o=this.match(oe,e,k)),o&&o.length>c.length){c=o,u=l,Y=U;break}}}break}}if(c!==null){if(d=c.length,f=Y.group,f!==void 0&&(h=Y.tokenTypeIdx,p=this.createTokenInstance(c,k,h,Y.tokenType,P,O,d),this.handlePayload(p,u),f===!1?A=this.addToken(x,A,p):C[f].push(p)),e=this.chopInput(e,d),k=k+d,O=this.computeNewColumn(O,d),D===!0&&Y.canLineTerminator===!0){let me=0,ae,M;R.lastIndex=0;do ae=R.test(c),ae===!0&&(M=R.lastIndex-1,me++);while(ae===!0);me!==0&&(P=P+me,O=d-M,this.updateTokenEndLineColumnLocation(p,f,M,me,P,O,d))}this.handleModes(Y,at,H,p)}else{const me=k,ae=P,M=O;let U=Q===!1;for(;U===!1&&k<E;)for(e=this.chopInput(e,1),k++,i=0;i<L;i++){const oe=W[i],G=oe.pattern,Le=oe.short;if(Le!==!1?w.charCodeAt(k)===Le&&(U=!0):oe.isCustom===!0?U=G.exec(w,k,x,C)!==null:(this.updateLastIndex(G,k),U=G.exec(e)!==null),U===!0)break}if(g=k-me,O=this.computeNewColumn(O,g),y=this.config.errorMessageProvider.buildUnexpectedCharactersMessage(w,me,g,ae,M),_.push({offset:me,line:ae,column:M,length:g,message:y}),Q===!1)break}}return this.hasCustom||(x.length=A),{tokens:x,groups:C,errors:_}}handleModes(e,n,r,i){if(e.pop===!0){const s=e.push;n(i),s!==void 0&&r.call(this,s)}else e.push!==void 0&&r.call(this,e.push)}chopInput(e,n){return e.substring(n)}updateLastIndex(e,n){e.lastIndex=n}updateTokenEndLineColumnLocation(e,n,r,i,s,o,a){let c,u;n!==void 0&&(c=r===a-1,u=c?-1:0,i===1&&c===!0||(e.endLine=s+u,e.endColumn=o-1+-u))}computeNewColumn(e,n){return e+n}createOffsetOnlyToken(e,n,r,i){return{image:e,startOffset:n,tokenTypeIdx:r,tokenType:i}}createStartOnlyToken(e,n,r,i,s,o){return{image:e,startOffset:n,startLine:s,startColumn:o,tokenTypeIdx:r,tokenType:i}}createFullToken(e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:n+a-1,startLine:s,endLine:s,startColumn:o,endColumn:o+a-1,tokenTypeIdx:r,tokenType:i}}addTokenUsingPush(e,n,r){return e.push(r),n}addTokenUsingMemberAccess(e,n,r){return e[n]=r,n++,n}handlePayloadNoCustom(e,n){}handlePayloadWithCustom(e,n){n!==null&&(e.payload=n)}matchWithTest(e,n,r){return e.test(n)===!0?n.substring(r,e.lastIndex):null}matchWithExec(e,n){const r=e.exec(n);return r!==null?r[0]:null}}Rn.SKIPPED="This marks a skipped Token pattern, this means each token identified by it willbe consumed and then thrown into oblivion, this can be used to for example to completely ignore whitespace.",Rn.NA=/NOT_APPLICABLE/;function Xo(t){return NR(t)?t.LABEL:t.name}function NR(t){return bn(t.LABEL)&&t.LABEL!==""}const d5="parent",OR="categories",FR="label",LR="group",MR="push_mode",zR="pop_mode",BR="longer_alt",qR="line_breaks",jR="start_chars_hint";function UR(t){return f5(t)}function f5(t){const e=t.pattern,n={};if(n.name=t.name,pi(e)||(n.PATTERN=e),be(t,d5))throw`The parent property is no longer supported.
57
+ See: https://github.com/chevrotain/chevrotain/issues/564#issuecomment-349062346 for details.`;return be(t,OR)&&(n.CATEGORIES=t[OR]),Hc([n]),be(t,FR)&&(n.LABEL=t[FR]),be(t,LR)&&(n.GROUP=t[LR]),be(t,zR)&&(n.POP_MODE=t[zR]),be(t,MR)&&(n.PUSH_MODE=t[MR]),be(t,BR)&&(n.LONGER_ALT=t[BR]),be(t,qR)&&(n.LINE_BREAKS=t[qR]),be(t,jR)&&(n.START_CHARS_HINT=t[jR]),n}const qi=UR({name:"EOF",pattern:Rn.NA});Hc([qi]);function iy(t,e,n,r,i,s,o,a){return{image:e,startOffset:n,endOffset:r,startLine:i,endLine:s,startColumn:o,endColumn:a,tokenTypeIdx:t.tokenTypeIdx,tokenType:t}}function GR(t,e){return Wc(t,e)}const Jo={buildMismatchTokenMessage({expected:t,actual:e,previous:n,ruleName:r}){return`Expecting ${NR(t)?`--> ${Xo(t)} <--`:`token of type --> ${t.name} <--`} but found --> '${e.image}' <--`},buildNotAllInputParsedMessage({firstRedundant:t,ruleName:e}){return"Redundant input, expecting EOF but found: "+t.image},buildNoViableAltMessage({expectedPathsPerAlt:t,actual:e,previous:n,customUserDescription:r,ruleName:i}){const s="Expecting: ",a=`
58
+ but found: '`+fr(e).image+"'";if(r)return s+r+a;{const c=an(t,(f,h)=>f.concat(h),[]),u=de(c,f=>`[${de(f,h=>Xo(h)).join(", ")}]`),d=`one of these possible Token sequences:
59
+ ${de(u,(f,h)=>` ${h+1}. ${f}`).join(`
60
+ `)}`;return s+d+a}},buildEarlyExitMessage({expectedIterationPaths:t,actual:e,customUserDescription:n,ruleName:r}){const i="Expecting: ",o=`
61
+ but found: '`+fr(e).image+"'";if(n)return i+n+o;{const c=`expecting at least one iteration which starts with one of these possible Token sequences::
62
+ <${de(t,u=>`[${de(u,l=>Xo(l)).join(",")}]`).join(" ,")}>`;return i+c+o}}};Object.freeze(Jo);const h5={buildRuleNotFoundError(t,e){return"Invalid grammar, reference to a rule which is not defined: ->"+e.nonTerminalName+`<-
63
+ inside top level rule: ->`+t.name+"<-"}},Fs={buildDuplicateFoundError(t,e){function n(l){return l instanceof ot?l.terminalType.name:l instanceof cn?l.nonTerminalName:""}const r=t.name,i=fr(e),s=i.idx,o=Mr(i),a=n(i),c=s>0;let u=`->${o}${c?s:""}<- ${a?`with argument: ->${a}<-`:""}
64
+ appears more than once (${e.length} times) in the top level rule: ->${r}<-.
65
+ For further details see: https://chevrotain.io/docs/FAQ.html#NUMERICAL_SUFFIXES
66
+ `;return u=u.replace(/[ \t]+/g," "),u=u.replace(/\s\s+/g,`
67
+ `),u},buildNamespaceConflictError(t){return`Namespace conflict found in grammar.
68
+ The grammar has both a Terminal(Token) and a Non-Terminal(Rule) named: <${t.name}>.
69
+ To resolve this make sure each Terminal and Non-Terminal names are unique
70
+ This is easy to accomplish by using the convention that Terminal names start with an uppercase letter
71
+ and Non-Terminal names start with a lower case letter.`},buildAlternationPrefixAmbiguityError(t){const e=de(t.prefixPath,i=>Xo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;return`Ambiguous alternatives: <${t.ambiguityIndices.join(" ,")}> due to common lookahead prefix
72
+ in <OR${n}> inside <${t.topLevelRule.name}> Rule,
73
+ <${e}> may appears as a prefix path in all these alternatives.
74
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#COMMON_PREFIX
75
+ For Further details.`},buildAlternationAmbiguityError(t){const e=de(t.prefixPath,i=>Xo(i)).join(", "),n=t.alternation.idx===0?"":t.alternation.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(" ,")}> in <OR${n}> inside <${t.topLevelRule.name}> Rule,
76
+ <${e}> may appears as a prefix path in all these alternatives.
77
+ `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
78
+ For Further details.`,r},buildEmptyRepetitionError(t){let e=Mr(t.repetition);return t.repetition.idx!==0&&(e+=t.repetition.idx),`The repetition <${e}> within Rule <${t.topLevelRule.name}> can never consume any tokens.
79
+ This could lead to an infinite loop.`},buildTokenNameError(t){return"deprecated"},buildEmptyAlternationError(t){return`Ambiguous empty alternative: <${t.emptyChoiceIdx+1}> in <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
80
+ Only the last alternative may be an empty alternative.`},buildTooManyAlternativesError(t){return`An Alternation cannot have more than 256 alternatives:
81
+ <OR${t.alternation.idx}> inside <${t.topLevelRule.name}> Rule.
82
+ has ${t.alternation.definition.length+1} alternatives.`},buildLeftRecursionError(t){const e=t.topLevelRule.name,n=de(t.leftRecursionPath,s=>s.name),r=`${e} --> ${n.concat([e]).join(" --> ")}`;return`Left Recursion found in grammar.
83
+ rule: <${e}> can be invoked from itself (directly or indirectly)
84
+ without consuming any Tokens. The grammar path that causes this is:
85
+ ${r}
86
+ To fix this refactor your grammar to remove the left recursion.
87
+ see: https://en.wikipedia.org/wiki/LL_parser#Left_factoring.`},buildInvalidRuleNameError(t){return"deprecated"},buildDuplicateRuleNameError(t){let e;return t.topLevelRule instanceof Ko?e=t.topLevelRule.name:e=t.topLevelRule,`Duplicate definition, rule: ->${e}<- is already defined in the grammar: ->${t.grammarName}<-`}};function p5(t,e){const n=new g5(t,e);return n.resolveRefs(),n.errors}class g5 extends Yo{constructor(e,n){super(),this.nameToTopRule=e,this.errMsgProvider=n,this.errors=[]}resolveRefs(){ve(Nt(this.nameToTopRule),e=>{this.currTopLevel=e,e.accept(this)})}visitNonTerminal(e){const n=this.nameToTopRule[e.nonTerminalName];if(n)e.referencedRule=n;else{const r=this.errMsgProvider.buildRuleNotFoundError(this.currTopLevel,e);this.errors.push({message:r,type:un.UNRESOLVED_SUBRULE_REF,ruleName:this.currTopLevel.name,unresolvedRefName:e.nonTerminalName})}}}class m5 extends vf{constructor(e,n){super(),this.topProd=e,this.path=n,this.possibleTokTypes=[],this.nextProductionName="",this.nextProductionOccurrence=0,this.found=!1,this.isAtEndOfPath=!1}startWalking(){if(this.found=!1,this.path.ruleStack[0]!==this.topProd.name)throw Error("The path does not start with the walker's top Rule!");return this.ruleStack=jt(this.path.ruleStack).reverse(),this.occurrenceStack=jt(this.path.occurrenceStack).reverse(),this.ruleStack.pop(),this.occurrenceStack.pop(),this.updateExpectedNext(),this.walk(this.topProd),this.possibleTokTypes}walk(e,n=[]){this.found||super.walk(e,n)}walkProdRef(e,n,r){if(e.referencedRule.name===this.nextProductionName&&e.idx===this.nextProductionOccurrence){const i=n.concat(r);this.updateExpectedNext(),this.walk(e.referencedRule,i)}}updateExpectedNext(){tt(this.ruleStack)?(this.nextProductionName="",this.nextProductionOccurrence=0,this.isAtEndOfPath=!0):(this.nextProductionName=this.ruleStack.pop(),this.nextProductionOccurrence=this.occurrenceStack.pop())}}class y5 extends m5{constructor(e,n){super(e,n),this.path=n,this.nextTerminalName="",this.nextTerminalOccurrence=0,this.nextTerminalName=this.path.lastTok.name,this.nextTerminalOccurrence=this.path.lastTokOccurrence}walkTerminal(e,n,r){if(this.isAtEndOfPath&&e.terminalType.name===this.nextTerminalName&&e.idx===this.nextTerminalOccurrence&&!this.found){const i=n.concat(r),s=new En({definition:i});this.possibleTokTypes=jc(s),this.found=!0}}}class kf extends vf{constructor(e,n){super(),this.topRule=e,this.occurrence=n,this.result={token:void 0,occurrence:void 0,isEndOfRule:void 0}}startWalking(){return this.walk(this.topRule),this.result}}class v5 extends kf{walkMany(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ot&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkMany(e,n,r)}}class WR extends kf{walkManySep(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ot&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkManySep(e,n,r)}}class w5 extends kf{walkAtLeastOne(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ot&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOne(e,n,r)}}class HR extends kf{walkAtLeastOneSep(e,n,r){if(e.idx===this.occurrence){const i=fr(n.concat(r));this.result.isEndOfRule=i===void 0,i instanceof ot&&(this.result.token=i.terminalType,this.result.occurrence=i.idx)}else super.walkAtLeastOneSep(e,n,r)}}function sy(t,e,n=[]){n=jt(n);let r=[],i=0;function s(a){return a.concat(Ut(t,i+1))}function o(a){const c=sy(s(a),e,n);return r.concat(c)}for(;n.length<e&&i<t.length;){const a=t[i];if(a instanceof En)return o(a.definition);if(a instanceof cn)return o(a.definition);if(a instanceof Gt)r=o(a.definition);else if(a instanceof Nn){const c=a.definition.concat([new wt({definition:a.definition})]);return o(c)}else if(a instanceof On){const c=[new En({definition:a.definition}),new wt({definition:[new ot({terminalType:a.separator})].concat(a.definition)})];return o(c)}else if(a instanceof Dn){const c=a.definition.concat([new wt({definition:[new ot({terminalType:a.separator})].concat(a.definition)})]);r=o(c)}else if(a instanceof wt){const c=a.definition.concat([new wt({definition:a.definition})]);r=o(c)}else{if(a instanceof Tn)return ve(a.definition,c=>{tt(c.definition)===!1&&(r=o(c.definition))}),r;if(a instanceof ot)n.push(a.terminalType);else throw Error("non exhaustive match")}i++}return r.push({partialPath:n,suffixDef:Ut(t,i)}),r}function VR(t,e,n,r){const i="EXIT_NONE_TERMINAL",s=[i],o="EXIT_ALTERNATIVE";let a=!1;const c=e.length,u=c-r-1,l=[],d=[];for(d.push({idx:-1,def:t,ruleStack:[],occurrenceStack:[]});!tt(d);){const f=d.pop();if(f===o){a&&Ho(d).idx<=u&&d.pop();continue}const h=f.def,p=f.idx,g=f.ruleStack,y=f.occurrenceStack;if(tt(h))continue;const m=h[0];if(m===i){const w={idx:p,def:Ut(h),ruleStack:qc(g),occurrenceStack:qc(y)};d.push(w)}else if(m instanceof ot)if(p<c-1){const w=p+1,E=e[w];if(n(E,m.terminalType)){const k={idx:w,def:Ut(h),ruleStack:g,occurrenceStack:y};d.push(k)}}else if(p===c-1)l.push({nextTokenType:m.terminalType,nextTokenOccurrence:m.idx,ruleStack:g,occurrenceStack:y}),a=!0;else throw Error("non exhaustive match");else if(m instanceof cn){const w=jt(g);w.push(m.nonTerminalName);const E=jt(y);E.push(m.idx);const k={idx:p,def:m.definition.concat(s,Ut(h)),ruleStack:w,occurrenceStack:E};d.push(k)}else if(m instanceof Gt){const w={idx:p,def:Ut(h),ruleStack:g,occurrenceStack:y};d.push(w),d.push(o);const E={idx:p,def:m.definition.concat(Ut(h)),ruleStack:g,occurrenceStack:y};d.push(E)}else if(m instanceof Nn){const w=new wt({definition:m.definition,idx:m.idx}),E=m.definition.concat([w],Ut(h)),k={idx:p,def:E,ruleStack:g,occurrenceStack:y};d.push(k)}else if(m instanceof On){const w=new ot({terminalType:m.separator}),E=new wt({definition:[w].concat(m.definition),idx:m.idx}),k=m.definition.concat([E],Ut(h)),A={idx:p,def:k,ruleStack:g,occurrenceStack:y};d.push(A)}else if(m instanceof Dn){const w={idx:p,def:Ut(h),ruleStack:g,occurrenceStack:y};d.push(w),d.push(o);const E=new ot({terminalType:m.separator}),k=new wt({definition:[E].concat(m.definition),idx:m.idx}),A=m.definition.concat([k],Ut(h)),I={idx:p,def:A,ruleStack:g,occurrenceStack:y};d.push(I)}else if(m instanceof wt){const w={idx:p,def:Ut(h),ruleStack:g,occurrenceStack:y};d.push(w),d.push(o);const E=new wt({definition:m.definition,idx:m.idx}),k=m.definition.concat([E],Ut(h)),A={idx:p,def:k,ruleStack:g,occurrenceStack:y};d.push(A)}else if(m instanceof Tn)for(let w=m.definition.length-1;w>=0;w--){const E=m.definition[w],k={idx:p,def:E.definition.concat(Ut(h)),ruleStack:g,occurrenceStack:y};d.push(k),d.push(o)}else if(m instanceof En)d.push({idx:p,def:m.definition.concat(Ut(h)),ruleStack:g,occurrenceStack:y});else if(m instanceof Ko)d.push(b5(m,p,g,y));else throw Error("non exhaustive match")}return l}function b5(t,e,n,r){const i=jt(n);i.push(t.name);const s=jt(r);return s.push(1),{idx:e,def:t.definition,ruleStack:i,occurrenceStack:s}}var ft;(function(t){t[t.OPTION=0]="OPTION",t[t.REPETITION=1]="REPETITION",t[t.REPETITION_MANDATORY=2]="REPETITION_MANDATORY",t[t.REPETITION_MANDATORY_WITH_SEPARATOR=3]="REPETITION_MANDATORY_WITH_SEPARATOR",t[t.REPETITION_WITH_SEPARATOR=4]="REPETITION_WITH_SEPARATOR",t[t.ALTERNATION=5]="ALTERNATION"})(ft||(ft={}));function oy(t){if(t instanceof Gt||t==="Option")return ft.OPTION;if(t instanceof wt||t==="Repetition")return ft.REPETITION;if(t instanceof Nn||t==="RepetitionMandatory")return ft.REPETITION_MANDATORY;if(t instanceof On||t==="RepetitionMandatoryWithSeparator")return ft.REPETITION_MANDATORY_WITH_SEPARATOR;if(t instanceof Dn||t==="RepetitionWithSeparator")return ft.REPETITION_WITH_SEPARATOR;if(t instanceof Tn||t==="Alternation")return ft.ALTERNATION;throw Error("non exhaustive match")}function KR(t){const{occurrence:e,rule:n,prodType:r,maxLookahead:i}=t,s=oy(r);return s===ft.ALTERNATION?$f(e,n,i):Cf(e,n,s,i)}function E5(t,e,n,r,i,s){const o=$f(t,e,n),a=ZR(o)?Sf:Wc;return s(o,r,a,i)}function D5(t,e,n,r,i,s){const o=Cf(t,e,i,n),a=ZR(o)?Sf:Wc;return s(o[0],a,r)}function T5(t,e,n,r){const i=t.length,s=dr(t,o=>dr(o,a=>a.length===1));if(e)return function(o){const a=de(o,c=>c.GATE);for(let c=0;c<i;c++){const u=t[c],l=u.length,d=a[c];if(!(d!==void 0&&d.call(this)===!1))e:for(let f=0;f<l;f++){const h=u[f],p=h.length;for(let g=0;g<p;g++){const y=this.LA(g+1);if(n(y,h[g])===!1)continue e}return c}}};if(s&&!r){const o=de(t,c=>Yn(c)),a=an(o,(c,u,l)=>(ve(u,d=>{be(c,d.tokenTypeIdx)||(c[d.tokenTypeIdx]=l),ve(d.categoryMatches,f=>{be(c,f)||(c[f]=l)})}),c),{});return function(){const c=this.LA(1);return a[c.tokenTypeIdx]}}else return function(){for(let o=0;o<i;o++){const a=t[o],c=a.length;e:for(let u=0;u<c;u++){const l=a[u],d=l.length;for(let f=0;f<d;f++){const h=this.LA(f+1);if(n(h,l[f])===!1)continue e}return o}}}}function R5(t,e,n){const r=dr(t,s=>s.length===1),i=t.length;if(r&&!n){const s=Yn(t);if(s.length===1&&tt(s[0].categoryMatches)){const a=s[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===a}}else{const o=an(s,(a,c,u)=>(a[c.tokenTypeIdx]=!0,ve(c.categoryMatches,l=>{a[l]=!0}),a),[]);return function(){const a=this.LA(1);return o[a.tokenTypeIdx]===!0}}}else return function(){e:for(let s=0;s<i;s++){const o=t[s],a=o.length;for(let c=0;c<a;c++){const u=this.LA(c+1);if(e(u,o[c])===!1)continue e}return!0}return!1}}class S5 extends vf{constructor(e,n,r){super(),this.topProd=e,this.targetOccurrence=n,this.targetProdType=r}startWalking(){return this.walk(this.topProd),this.restDef}checkIsTarget(e,n,r,i){return e.idx===this.targetOccurrence&&this.targetProdType===n?(this.restDef=r.concat(i),!0):!1}walkOption(e,n,r){this.checkIsTarget(e,ft.OPTION,n,r)||super.walkOption(e,n,r)}walkAtLeastOne(e,n,r){this.checkIsTarget(e,ft.REPETITION_MANDATORY,n,r)||super.walkOption(e,n,r)}walkAtLeastOneSep(e,n,r){this.checkIsTarget(e,ft.REPETITION_MANDATORY_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}walkMany(e,n,r){this.checkIsTarget(e,ft.REPETITION,n,r)||super.walkOption(e,n,r)}walkManySep(e,n,r){this.checkIsTarget(e,ft.REPETITION_WITH_SEPARATOR,n,r)||super.walkOption(e,n,r)}}class YR extends Yo{constructor(e,n,r){super(),this.targetOccurrence=e,this.targetProdType=n,this.targetRef=r,this.result=[]}checkIsTarget(e,n){e.idx===this.targetOccurrence&&this.targetProdType===n&&(this.targetRef===void 0||e===this.targetRef)&&(this.result=e.definition)}visitOption(e){this.checkIsTarget(e,ft.OPTION)}visitRepetition(e){this.checkIsTarget(e,ft.REPETITION)}visitRepetitionMandatory(e){this.checkIsTarget(e,ft.REPETITION_MANDATORY)}visitRepetitionMandatoryWithSeparator(e){this.checkIsTarget(e,ft.REPETITION_MANDATORY_WITH_SEPARATOR)}visitRepetitionWithSeparator(e){this.checkIsTarget(e,ft.REPETITION_WITH_SEPARATOR)}visitAlternation(e){this.checkIsTarget(e,ft.ALTERNATION)}}function XR(t){const e=new Array(t);for(let n=0;n<t;n++)e[n]=[];return e}function ay(t){let e=[""];for(let n=0;n<t.length;n++){const r=t[n],i=[];for(let s=0;s<e.length;s++){const o=e[s];i.push(o+"_"+r.tokenTypeIdx);for(let a=0;a<r.categoryMatches.length;a++){const c="_"+r.categoryMatches[a];i.push(o+c)}}e=i}return e}function k5(t,e,n){for(let r=0;r<t.length;r++){if(r===n)continue;const i=t[r];for(let s=0;s<e.length;s++){const o=e[s];if(i[o]===!0)return!1}}return!0}function JR(t,e){const n=de(t,o=>sy([o],1)),r=XR(n.length),i=de(n,o=>{const a={};return ve(o,c=>{const u=ay(c.partialPath);ve(u,l=>{a[l]=!0})}),a});let s=n;for(let o=1;o<=e;o++){const a=s;s=XR(a.length);for(let c=0;c<a.length;c++){const u=a[c];for(let l=0;l<u.length;l++){const d=u[l].partialPath,f=u[l].suffixDef,h=ay(d);if(k5(i,h,c)||tt(f)||d.length===e){const g=r[c];if(cy(g,d)===!1){g.push(d);for(let y=0;y<h.length;y++){const m=h[y];i[c][m]=!0}}}else{const g=sy(f,o+1,d);s[c]=s[c].concat(g),ve(g,y=>{const m=ay(y.partialPath);ve(m,w=>{i[c][w]=!0})})}}}}return r}function $f(t,e,n,r){const i=new YR(t,ft.ALTERNATION,r);return e.accept(i),JR(i.result,n)}function Cf(t,e,n,r){const i=new YR(t,n);e.accept(i);const s=i.result,a=new S5(e,t,n).startWalking(),c=new En({definition:s}),u=new En({definition:a});return JR([c,u],r)}function cy(t,e){e:for(let n=0;n<t.length;n++){const r=t[n];if(r.length===e.length){for(let i=0;i<r.length;i++){const s=e[i],o=r[i];if((s===o||o.categoryMatchesMap[s.tokenTypeIdx]!==void 0)===!1)continue e}return!0}}return!1}function $5(t,e){return t.length<e.length&&dr(t,(n,r)=>{const i=e[r];return n===i||i.categoryMatchesMap[n.tokenTypeIdx]})}function ZR(t){return dr(t,e=>dr(e,n=>dr(n,r=>tt(r.categoryMatches))))}function C5(t){const e=t.lookaheadStrategy.validate({rules:t.rules,tokenTypes:t.tokenTypes,grammarName:t.grammarName});return de(e,n=>Object.assign({type:un.CUSTOM_LOOKAHEAD_VALIDATION},n))}function _5(t,e,n,r){const i=Pn(t,c=>A5(c,n)),s=j5(t,e,n),o=Pn(t,c=>M5(c,n)),a=Pn(t,c=>P5(c,t,r,n));return i.concat(s,o,a)}function A5(t,e){const n=new I5;t.accept(n);const r=n.allProductions,i=W4(r,x5),s=hr(i,a=>a.length>1);return de(Nt(s),a=>{const c=fr(a),u=e.buildDuplicateFoundError(t,a),l=Mr(c),d={message:u,type:un.DUPLICATE_PRODUCTIONS,ruleName:t.name,dslName:l,occurrence:c.idx},f=QR(c);return f&&(d.parameter=f),d})}function x5(t){return`${Mr(t)}_#_${t.idx}_#_${QR(t)}`}function QR(t){return t instanceof ot?t.terminalType.name:t instanceof cn?t.nonTerminalName:""}class I5 extends Yo{constructor(){super(...arguments),this.allProductions=[]}visitNonTerminal(e){this.allProductions.push(e)}visitOption(e){this.allProductions.push(e)}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}visitAlternation(e){this.allProductions.push(e)}visitTerminal(e){this.allProductions.push(e)}}function P5(t,e,n,r){const i=[];if(an(e,(o,a)=>a.name===t.name?o+1:o,0)>1){const o=r.buildDuplicateRuleNameError({topLevelRule:t,grammarName:n});i.push({message:o,type:un.DUPLICATE_RULE_NAME,ruleName:t.name})}return i}function N5(t,e,n){const r=[];let i;return on(e,t)||(i=`Invalid rule override, rule: ->${t}<- cannot be overridden in the grammar: ->${n}<-as it is not defined in any of the super grammars `,r.push({message:i,type:un.INVALID_RULE_OVERRIDE,ruleName:t})),r}function e1(t,e,n,r=[]){const i=[],s=_f(e.definition);if(tt(s))return[];{const o=t.name;on(s,t)&&i.push({message:n.buildLeftRecursionError({topLevelRule:t,leftRecursionPath:r}),type:un.LEFT_RECURSION,ruleName:o});const c=pf(s,r.concat([t])),u=Pn(c,l=>{const d=jt(r);return d.push(l),e1(t,l,n,d)});return i.concat(u)}}function _f(t){let e=[];if(tt(t))return e;const n=fr(t);if(n instanceof cn)e.push(n.referencedRule);else if(n instanceof En||n instanceof Gt||n instanceof Nn||n instanceof On||n instanceof Dn||n instanceof wt)e=e.concat(_f(n.definition));else if(n instanceof Tn)e=Yn(de(n.definition,s=>_f(s.definition)));else if(!(n instanceof ot))throw Error("non exhaustive match");const r=yf(n),i=t.length>1;if(r&&i){const s=Ut(t);return e.concat(_f(s))}else return e}class uy extends Yo{constructor(){super(...arguments),this.alternations=[]}visitAlternation(e){this.alternations.push(e)}}function O5(t,e){const n=new uy;t.accept(n);const r=n.alternations;return Pn(r,s=>{const o=qc(s.definition);return Pn(o,(a,c)=>{const u=VR([a],[],Wc,1);return tt(u)?[{message:e.buildEmptyAlternationError({topLevelRule:t,alternation:s,emptyChoiceIdx:c}),type:un.NONE_LAST_EMPTY_ALT,ruleName:t.name,occurrence:s.idx,alternative:c+1}]:[]})})}function F5(t,e,n){const r=new uy;t.accept(r);let i=r.alternations;return i=gf(i,o=>o.ignoreAmbiguities===!0),Pn(i,o=>{const a=o.idx,c=o.maxLookahead||e,u=$f(a,t,c,o),l=B5(u,o,t,n),d=q5(u,o,t,n);return l.concat(d)})}class L5 extends Yo{constructor(){super(...arguments),this.allProductions=[]}visitRepetitionWithSeparator(e){this.allProductions.push(e)}visitRepetitionMandatory(e){this.allProductions.push(e)}visitRepetitionMandatoryWithSeparator(e){this.allProductions.push(e)}visitRepetition(e){this.allProductions.push(e)}}function M5(t,e){const n=new uy;t.accept(n);const r=n.alternations;return Pn(r,s=>s.definition.length>255?[{message:e.buildTooManyAlternativesError({topLevelRule:t,alternation:s}),type:un.TOO_MANY_ALTS,ruleName:t.name,occurrence:s.idx}]:[])}function z5(t,e,n){const r=[];return ve(t,i=>{const s=new L5;i.accept(s);const o=s.allProductions;ve(o,a=>{const c=oy(a),u=a.maxLookahead||e,l=a.idx,f=Cf(l,i,c,u)[0];if(tt(Yn(f))){const h=n.buildEmptyRepetitionError({topLevelRule:i,repetition:a});r.push({message:h,type:un.NO_NON_EMPTY_LOOKAHEAD,ruleName:i.name})}})}),r}function B5(t,e,n,r){const i=[],s=an(t,(a,c,u)=>(e.definition[u].ignoreAmbiguities===!0||ve(c,l=>{const d=[u];ve(t,(f,h)=>{u!==h&&cy(f,l)&&e.definition[h].ignoreAmbiguities!==!0&&d.push(h)}),d.length>1&&!cy(i,l)&&(i.push(l),a.push({alts:d,path:l}))}),a),[]);return de(s,a=>{const c=de(a.alts,l=>l+1);return{message:r.buildAlternationAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:c,prefixPath:a.path}),type:un.AMBIGUOUS_ALTS,ruleName:n.name,occurrence:e.idx,alternatives:a.alts}})}function q5(t,e,n,r){const i=an(t,(o,a,c)=>{const u=de(a,l=>({idx:c,path:l}));return o.concat(u)},[]);return Bc(Pn(i,o=>{if(e.definition[o.idx].ignoreAmbiguities===!0)return[];const c=o.idx,u=o.path,l=In(i,f=>e.definition[f.idx].ignoreAmbiguities!==!0&&f.idx<c&&$5(f.path,u));return de(l,f=>{const h=[f.idx+1,c+1],p=e.idx===0?"":e.idx;return{message:r.buildAlternationPrefixAmbiguityError({topLevelRule:n,alternation:e,ambiguityIndices:h,prefixPath:f.path}),type:un.AMBIGUOUS_PREFIX_ALTS,ruleName:n.name,occurrence:p,alternatives:h}})}))}function j5(t,e,n){const r=[],i=de(e,s=>s.name);return ve(t,s=>{const o=s.name;if(on(i,o)){const a=n.buildNamespaceConflictError(s);r.push({message:a,type:un.CONFLICT_TOKENS_RULES_NAMESPACE,ruleName:o})}}),r}function U5(t){const e=Jm(t,{errMsgProvider:h5}),n={};return ve(t.rules,r=>{n[r.name]=r}),p5(n,e.errMsgProvider)}function G5(t){return t=Jm(t,{errMsgProvider:Fs}),_5(t.rules,t.tokenTypes,t.errMsgProvider,t.grammarName)}const t1="MismatchedTokenException",n1="NoViableAltException",r1="EarlyExitException",i1="NotAllInputParsedException",s1=[t1,n1,r1,i1];Object.freeze(s1);function Af(t){return on(s1,t.name)}class xf extends Error{constructor(e,n){super(e),this.token=n,this.resyncedTokens=[],Object.setPrototypeOf(this,new.target.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}class o1 extends xf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=t1}}class W5 extends xf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=n1}}class H5 extends xf{constructor(e,n){super(e,n),this.name=i1}}class V5 extends xf{constructor(e,n,r){super(e,n),this.previousToken=r,this.name=r1}}const ly={},a1="InRuleRecoveryException";class K5 extends Error{constructor(e){super(e),this.name=a1}}class Y5{initRecoverable(e){this.firstAfterRepMap={},this.resyncFollows={},this.recoveryEnabled=be(e,"recoveryEnabled")?e.recoveryEnabled:gi.recoveryEnabled,this.recoveryEnabled&&(this.attemptInRepetitionRecovery=X5)}getTokenToInsert(e){const n=iy(e,"",NaN,NaN,NaN,NaN,NaN,NaN);return n.isInsertedInRecovery=!0,n}canTokenTypeBeInsertedInRecovery(e){return!0}canTokenTypeBeDeletedInRecovery(e){return!0}tryInRepetitionRecovery(e,n,r,i){const s=this.findReSyncTokenType(),o=this.exportLexerState(),a=[];let c=!1;const u=this.LA(1);let l=this.LA(1);const d=()=>{const f=this.LA(0),h=this.errorMessageProvider.buildMismatchTokenMessage({expected:i,actual:u,previous:f,ruleName:this.getCurrRuleFullName()}),p=new o1(h,u,this.LA(0));p.resyncedTokens=qc(a),this.SAVE_ERROR(p)};for(;!c;)if(this.tokenMatcher(l,i)){d();return}else if(r.call(this)){d(),e.apply(this,n);return}else this.tokenMatcher(l,s)?c=!0:(l=this.SKIP_TOKEN(),this.addToResyncTokens(l,a));this.importLexerState(o)}shouldInRepetitionRecoveryBeTried(e,n,r){return!(r===!1||this.tokenMatcher(this.LA(1),e)||this.isBackTracking()||this.canPerformInRuleRecovery(e,this.getFollowsForInRuleRecovery(e,n)))}getFollowsForInRuleRecovery(e,n){const r=this.getCurrentGrammarPath(e,n);return this.getNextPossibleTokenTypes(r)}tryInRuleRecovery(e,n){if(this.canRecoverWithSingleTokenInsertion(e,n))return this.getTokenToInsert(e);if(this.canRecoverWithSingleTokenDeletion(e)){const r=this.SKIP_TOKEN();return this.consumeToken(),r}throw new K5("sad sad panda")}canPerformInRuleRecovery(e,n){return this.canRecoverWithSingleTokenInsertion(e,n)||this.canRecoverWithSingleTokenDeletion(e)}canRecoverWithSingleTokenInsertion(e,n){if(!this.canTokenTypeBeInsertedInRecovery(e)||tt(n))return!1;const r=this.LA(1);return Vo(n,s=>this.tokenMatcher(r,s))!==void 0}canRecoverWithSingleTokenDeletion(e){return this.canTokenTypeBeDeletedInRecovery(e)?this.tokenMatcher(this.LA(2),e):!1}isInCurrentRuleReSyncSet(e){const n=this.getCurrFollowKey(),r=this.getFollowSetFromFollowKey(n);return on(r,e)}findReSyncTokenType(){const e=this.flattenFollowSet();let n=this.LA(1),r=2;for(;;){const i=Vo(e,s=>GR(n,s));if(i!==void 0)return i;n=this.LA(r),r++}}getCurrFollowKey(){if(this.RULE_STACK.length===1)return ly;const e=this.getLastExplicitRuleShortName(),n=this.getLastExplicitRuleOccurrenceIndex(),r=this.getPreviousExplicitRuleShortName();return{ruleName:this.shortRuleNameToFullName(e),idxInCallingRule:n,inRule:this.shortRuleNameToFullName(r)}}buildFullFollowKeyStack(){const e=this.RULE_STACK,n=this.RULE_OCCURRENCE_STACK;return de(e,(r,i)=>i===0?ly:{ruleName:this.shortRuleNameToFullName(r),idxInCallingRule:n[i],inRule:this.shortRuleNameToFullName(e[i-1])})}flattenFollowSet(){const e=de(this.buildFullFollowKeyStack(),n=>this.getFollowSetFromFollowKey(n));return Yn(e)}getFollowSetFromFollowKey(e){if(e===ly)return[qi];const n=e.ruleName+e.idxInCallingRule+bR+e.inRule;return this.resyncFollows[n]}addToResyncTokens(e,n){return this.tokenMatcher(e,qi)||n.push(e),n}reSyncTo(e){const n=[];let r=this.LA(1);for(;this.tokenMatcher(r,e)===!1;)r=this.SKIP_TOKEN(),this.addToResyncTokens(r,n);return qc(n)}attemptInRepetitionRecovery(e,n,r,i,s,o,a){}getCurrentGrammarPath(e,n){const r=this.getHumanReadableRuleStack(),i=jt(this.RULE_OCCURRENCE_STACK);return{ruleStack:r,occurrenceStack:i,lastTok:e,lastTokOccurrence:n}}getHumanReadableRuleStack(){return de(this.RULE_STACK,e=>this.shortRuleNameToFullName(e))}}function X5(t,e,n,r,i,s,o){const a=this.getKeyForAutomaticLookahead(r,i);let c=this.firstAfterRepMap[a];if(c===void 0){const f=this.getCurrRuleFullName(),h=this.getGAstProductions()[f];c=new s(h,i).startWalking(),this.firstAfterRepMap[a]=c}let u=c.token,l=c.occurrence;const d=c.isEndOfRule;this.RULE_STACK.length===1&&d&&u===void 0&&(u=qi,l=1),!(u===void 0||l===void 0)&&this.shouldInRepetitionRecoveryBeTried(u,l,o)&&this.tryInRepetitionRecovery(t,e,n,u)}const J5=4,ji=8,c1=1<<ji,u1=2<<ji,dy=3<<ji,fy=4<<ji,hy=5<<ji,If=6<<ji;function py(t,e,n){return n|e|t}class gy{constructor(e){var n;this.maxLookahead=(n=e?.maxLookahead)!==null&&n!==void 0?n:gi.maxLookahead}validate(e){const n=this.validateNoLeftRecursion(e.rules);if(tt(n)){const r=this.validateEmptyOrAlternatives(e.rules),i=this.validateAmbiguousAlternationAlternatives(e.rules,this.maxLookahead),s=this.validateSomeNonEmptyLookaheadPath(e.rules,this.maxLookahead);return[...n,...r,...i,...s]}return n}validateNoLeftRecursion(e){return Pn(e,n=>e1(n,n,Fs))}validateEmptyOrAlternatives(e){return Pn(e,n=>O5(n,Fs))}validateAmbiguousAlternationAlternatives(e,n){return Pn(e,r=>F5(r,n,Fs))}validateSomeNonEmptyLookaheadPath(e,n){return z5(e,n,Fs)}buildLookaheadForAlternation(e){return E5(e.prodOccurrence,e.rule,e.maxLookahead,e.hasPredicates,e.dynamicTokensEnabled,T5)}buildLookaheadForOptional(e){return D5(e.prodOccurrence,e.rule,e.maxLookahead,e.dynamicTokensEnabled,oy(e.prodType),R5)}}class Z5{initLooksAhead(e){this.dynamicTokensEnabled=be(e,"dynamicTokensEnabled")?e.dynamicTokensEnabled:gi.dynamicTokensEnabled,this.maxLookahead=be(e,"maxLookahead")?e.maxLookahead:gi.maxLookahead,this.lookaheadStrategy=be(e,"lookaheadStrategy")?e.lookaheadStrategy:new gy({maxLookahead:this.maxLookahead}),this.lookAheadFuncsCache=new Map}preComputeLookaheadFunctions(e){ve(e,n=>{this.TRACE_INIT(`${n.name} Rule Lookahead`,()=>{const{alternation:r,repetition:i,option:s,repetitionMandatory:o,repetitionMandatoryWithSeparator:a,repetitionWithSeparator:c}=eq(n);ve(r,u=>{const l=u.idx===0?"":u.idx;this.TRACE_INIT(`${Mr(u)}${l}`,()=>{const d=this.lookaheadStrategy.buildLookaheadForAlternation({prodOccurrence:u.idx,rule:n,maxLookahead:u.maxLookahead||this.maxLookahead,hasPredicates:u.hasPredicates,dynamicTokensEnabled:this.dynamicTokensEnabled}),f=py(this.fullRuleNameToShort[n.name],c1,u.idx);this.setLaFuncCache(f,d)})}),ve(i,u=>{this.computeLookaheadFunc(n,u.idx,dy,"Repetition",u.maxLookahead,Mr(u))}),ve(s,u=>{this.computeLookaheadFunc(n,u.idx,u1,"Option",u.maxLookahead,Mr(u))}),ve(o,u=>{this.computeLookaheadFunc(n,u.idx,fy,"RepetitionMandatory",u.maxLookahead,Mr(u))}),ve(a,u=>{this.computeLookaheadFunc(n,u.idx,If,"RepetitionMandatoryWithSeparator",u.maxLookahead,Mr(u))}),ve(c,u=>{this.computeLookaheadFunc(n,u.idx,hy,"RepetitionWithSeparator",u.maxLookahead,Mr(u))})})})}computeLookaheadFunc(e,n,r,i,s,o){this.TRACE_INIT(`${o}${n===0?"":n}`,()=>{const a=this.lookaheadStrategy.buildLookaheadForOptional({prodOccurrence:n,rule:e,maxLookahead:s||this.maxLookahead,dynamicTokensEnabled:this.dynamicTokensEnabled,prodType:i}),c=py(this.fullRuleNameToShort[e.name],r,n);this.setLaFuncCache(c,a)})}getKeyForAutomaticLookahead(e,n){const r=this.getLastExplicitRuleShortName();return py(r,e,n)}getLaFuncFromCache(e){return this.lookAheadFuncsCache.get(e)}setLaFuncCache(e,n){this.lookAheadFuncsCache.set(e,n)}}class Q5 extends Yo{constructor(){super(...arguments),this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}reset(){this.dslMethods={option:[],alternation:[],repetition:[],repetitionWithSeparator:[],repetitionMandatory:[],repetitionMandatoryWithSeparator:[]}}visitOption(e){this.dslMethods.option.push(e)}visitRepetitionWithSeparator(e){this.dslMethods.repetitionWithSeparator.push(e)}visitRepetitionMandatory(e){this.dslMethods.repetitionMandatory.push(e)}visitRepetitionMandatoryWithSeparator(e){this.dslMethods.repetitionMandatoryWithSeparator.push(e)}visitRepetition(e){this.dslMethods.repetition.push(e)}visitAlternation(e){this.dslMethods.alternation.push(e)}}const Pf=new Q5;function eq(t){Pf.reset(),t.accept(Pf);const e=Pf.dslMethods;return Pf.reset(),e}function l1(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.endOffset=e.endOffset):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset)}function d1(t,e){isNaN(t.startOffset)===!0?(t.startOffset=e.startOffset,t.startColumn=e.startColumn,t.startLine=e.startLine,t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine):t.endOffset<e.endOffset&&(t.endOffset=e.endOffset,t.endColumn=e.endColumn,t.endLine=e.endLine)}function tq(t,e,n){t.children[n]===void 0?t.children[n]=[e]:t.children[n].push(e)}function nq(t,e,n){t.children[e]===void 0?t.children[e]=[n]:t.children[e].push(n)}const rq="name";function f1(t,e){Object.defineProperty(t,rq,{enumerable:!1,configurable:!0,writable:!1,value:e})}function iq(t,e){const n=Kn(t),r=n.length;for(let i=0;i<r;i++){const s=n[i],o=t[s],a=o.length;for(let c=0;c<a;c++){const u=o[c];u.tokenTypeIdx===void 0&&this[u.name](u.children,e)}}}function sq(t,e){const n=function(){};f1(n,t+"BaseSemantics");const r={visit:function(i,s){if(Be(i)&&(i=i[0]),!pi(i))return this[i.name](i.children,s)},validateVisitor:function(){const i=aq(this,e);if(!tt(i)){const s=de(i,o=>o.msg);throw Error(`Errors Detected in CST Visitor <${this.constructor.name}>:
88
+ ${s.join(`
89
+
90
+ `).replace(/\n/g,`
91
+ `)}`)}}};return n.prototype=r,n.prototype.constructor=n,n._RULE_NAMES=e,n}function oq(t,e,n){const r=function(){};f1(r,t+"BaseSemanticsWithDefaults");const i=Object.create(n.prototype);return ve(e,s=>{i[s]=iq}),r.prototype=i,r.prototype.constructor=r,r}var my;(function(t){t[t.REDUNDANT_METHOD=0]="REDUNDANT_METHOD",t[t.MISSING_METHOD=1]="MISSING_METHOD"})(my||(my={}));function aq(t,e){return cq(t,e)}function cq(t,e){const n=In(e,i=>ui(t[i])===!1),r=de(n,i=>({msg:`Missing visitor method: <${i}> on ${t.constructor.name} CST Visitor.`,type:my.MISSING_METHOD,methodName:i}));return Bc(r)}class uq{initTreeBuilder(e){if(this.CST_STACK=[],this.outputCst=e.outputCst,this.nodeLocationTracking=be(e,"nodeLocationTracking")?e.nodeLocationTracking:gi.nodeLocationTracking,!this.outputCst)this.cstInvocationStateUpdate=Pt,this.cstFinallyStateUpdate=Pt,this.cstPostTerminal=Pt,this.cstPostNonTerminal=Pt,this.cstPostRule=Pt;else if(/full/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=d1,this.setNodeLocationFromNode=d1,this.cstPostRule=Pt,this.setInitialNodeLocation=this.setInitialNodeLocationFullRecovery):(this.setNodeLocationFromToken=Pt,this.setNodeLocationFromNode=Pt,this.cstPostRule=this.cstPostRuleFull,this.setInitialNodeLocation=this.setInitialNodeLocationFullRegular);else if(/onlyOffset/i.test(this.nodeLocationTracking))this.recoveryEnabled?(this.setNodeLocationFromToken=l1,this.setNodeLocationFromNode=l1,this.cstPostRule=Pt,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRecovery):(this.setNodeLocationFromToken=Pt,this.setNodeLocationFromNode=Pt,this.cstPostRule=this.cstPostRuleOnlyOffset,this.setInitialNodeLocation=this.setInitialNodeLocationOnlyOffsetRegular);else if(/none/i.test(this.nodeLocationTracking))this.setNodeLocationFromToken=Pt,this.setNodeLocationFromNode=Pt,this.cstPostRule=Pt,this.setInitialNodeLocation=Pt;else throw Error(`Invalid <nodeLocationTracking> config option: "${e.nodeLocationTracking}"`)}setInitialNodeLocationOnlyOffsetRecovery(e){e.location={startOffset:NaN,endOffset:NaN}}setInitialNodeLocationOnlyOffsetRegular(e){e.location={startOffset:this.LA(1).startOffset,endOffset:NaN}}setInitialNodeLocationFullRecovery(e){e.location={startOffset:NaN,startLine:NaN,startColumn:NaN,endOffset:NaN,endLine:NaN,endColumn:NaN}}setInitialNodeLocationFullRegular(e){const n=this.LA(1);e.location={startOffset:n.startOffset,startLine:n.startLine,startColumn:n.startColumn,endOffset:NaN,endLine:NaN,endColumn:NaN}}cstInvocationStateUpdate(e){const n={name:e,children:Object.create(null)};this.setInitialNodeLocation(n),this.CST_STACK.push(n)}cstFinallyStateUpdate(){this.CST_STACK.pop()}cstPostRuleFull(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?(r.endOffset=n.endOffset,r.endLine=n.endLine,r.endColumn=n.endColumn):(r.startOffset=NaN,r.startLine=NaN,r.startColumn=NaN)}cstPostRuleOnlyOffset(e){const n=this.LA(0),r=e.location;r.startOffset<=n.startOffset?r.endOffset=n.endOffset:r.startOffset=NaN}cstPostTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];tq(r,n,e),this.setNodeLocationFromToken(r.location,n)}cstPostNonTerminal(e,n){const r=this.CST_STACK[this.CST_STACK.length-1];nq(r,n,e),this.setNodeLocationFromNode(r.location,e.location)}getBaseCstVisitorConstructor(){if(pi(this.baseCstVisitorConstructor)){const e=sq(this.className,Kn(this.gastProductionsCache));return this.baseCstVisitorConstructor=e,e}return this.baseCstVisitorConstructor}getBaseCstVisitorConstructorWithDefaults(){if(pi(this.baseCstVisitorWithDefaultsConstructor)){const e=oq(this.className,Kn(this.gastProductionsCache),this.getBaseCstVisitorConstructor());return this.baseCstVisitorWithDefaultsConstructor=e,e}return this.baseCstVisitorWithDefaultsConstructor}getLastExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-1]}getPreviousExplicitRuleShortName(){const e=this.RULE_STACK;return e[e.length-2]}getLastExplicitRuleOccurrenceIndex(){const e=this.RULE_OCCURRENCE_STACK;return e[e.length-1]}}class lq{initLexerAdapter(){this.tokVector=[],this.tokVectorLength=0,this.currIdx=-1}set input(e){if(this.selfAnalysisDone!==!0)throw Error("Missing <performSelfAnalysis> invocation at the end of the Parser's constructor.");this.reset(),this.tokVector=e,this.tokVectorLength=e.length}get input(){return this.tokVector}SKIP_TOKEN(){return this.currIdx<=this.tokVector.length-2?(this.consumeToken(),this.LA(1)):Ff}LA(e){const n=this.currIdx+e;return n<0||this.tokVectorLength<=n?Ff:this.tokVector[n]}consumeToken(){this.currIdx++}exportLexerState(){return this.currIdx}importLexerState(e){this.currIdx=e}resetLexerState(){this.currIdx=-1}moveToTerminatedState(){this.currIdx=this.tokVector.length-1}getLexerPosition(){return this.exportLexerState()}}class dq{ACTION(e){return e.call(this)}consume(e,n,r){return this.consumeInternal(n,e,r)}subrule(e,n,r){return this.subruleInternal(n,e,r)}option(e,n){return this.optionInternal(n,e)}or(e,n){return this.orInternal(n,e)}many(e,n){return this.manyInternal(e,n)}atLeastOne(e,n){return this.atLeastOneInternal(e,n)}CONSUME(e,n){return this.consumeInternal(e,0,n)}CONSUME1(e,n){return this.consumeInternal(e,1,n)}CONSUME2(e,n){return this.consumeInternal(e,2,n)}CONSUME3(e,n){return this.consumeInternal(e,3,n)}CONSUME4(e,n){return this.consumeInternal(e,4,n)}CONSUME5(e,n){return this.consumeInternal(e,5,n)}CONSUME6(e,n){return this.consumeInternal(e,6,n)}CONSUME7(e,n){return this.consumeInternal(e,7,n)}CONSUME8(e,n){return this.consumeInternal(e,8,n)}CONSUME9(e,n){return this.consumeInternal(e,9,n)}SUBRULE(e,n){return this.subruleInternal(e,0,n)}SUBRULE1(e,n){return this.subruleInternal(e,1,n)}SUBRULE2(e,n){return this.subruleInternal(e,2,n)}SUBRULE3(e,n){return this.subruleInternal(e,3,n)}SUBRULE4(e,n){return this.subruleInternal(e,4,n)}SUBRULE5(e,n){return this.subruleInternal(e,5,n)}SUBRULE6(e,n){return this.subruleInternal(e,6,n)}SUBRULE7(e,n){return this.subruleInternal(e,7,n)}SUBRULE8(e,n){return this.subruleInternal(e,8,n)}SUBRULE9(e,n){return this.subruleInternal(e,9,n)}OPTION(e){return this.optionInternal(e,0)}OPTION1(e){return this.optionInternal(e,1)}OPTION2(e){return this.optionInternal(e,2)}OPTION3(e){return this.optionInternal(e,3)}OPTION4(e){return this.optionInternal(e,4)}OPTION5(e){return this.optionInternal(e,5)}OPTION6(e){return this.optionInternal(e,6)}OPTION7(e){return this.optionInternal(e,7)}OPTION8(e){return this.optionInternal(e,8)}OPTION9(e){return this.optionInternal(e,9)}OR(e){return this.orInternal(e,0)}OR1(e){return this.orInternal(e,1)}OR2(e){return this.orInternal(e,2)}OR3(e){return this.orInternal(e,3)}OR4(e){return this.orInternal(e,4)}OR5(e){return this.orInternal(e,5)}OR6(e){return this.orInternal(e,6)}OR7(e){return this.orInternal(e,7)}OR8(e){return this.orInternal(e,8)}OR9(e){return this.orInternal(e,9)}MANY(e){this.manyInternal(0,e)}MANY1(e){this.manyInternal(1,e)}MANY2(e){this.manyInternal(2,e)}MANY3(e){this.manyInternal(3,e)}MANY4(e){this.manyInternal(4,e)}MANY5(e){this.manyInternal(5,e)}MANY6(e){this.manyInternal(6,e)}MANY7(e){this.manyInternal(7,e)}MANY8(e){this.manyInternal(8,e)}MANY9(e){this.manyInternal(9,e)}MANY_SEP(e){this.manySepFirstInternal(0,e)}MANY_SEP1(e){this.manySepFirstInternal(1,e)}MANY_SEP2(e){this.manySepFirstInternal(2,e)}MANY_SEP3(e){this.manySepFirstInternal(3,e)}MANY_SEP4(e){this.manySepFirstInternal(4,e)}MANY_SEP5(e){this.manySepFirstInternal(5,e)}MANY_SEP6(e){this.manySepFirstInternal(6,e)}MANY_SEP7(e){this.manySepFirstInternal(7,e)}MANY_SEP8(e){this.manySepFirstInternal(8,e)}MANY_SEP9(e){this.manySepFirstInternal(9,e)}AT_LEAST_ONE(e){this.atLeastOneInternal(0,e)}AT_LEAST_ONE1(e){return this.atLeastOneInternal(1,e)}AT_LEAST_ONE2(e){this.atLeastOneInternal(2,e)}AT_LEAST_ONE3(e){this.atLeastOneInternal(3,e)}AT_LEAST_ONE4(e){this.atLeastOneInternal(4,e)}AT_LEAST_ONE5(e){this.atLeastOneInternal(5,e)}AT_LEAST_ONE6(e){this.atLeastOneInternal(6,e)}AT_LEAST_ONE7(e){this.atLeastOneInternal(7,e)}AT_LEAST_ONE8(e){this.atLeastOneInternal(8,e)}AT_LEAST_ONE9(e){this.atLeastOneInternal(9,e)}AT_LEAST_ONE_SEP(e){this.atLeastOneSepFirstInternal(0,e)}AT_LEAST_ONE_SEP1(e){this.atLeastOneSepFirstInternal(1,e)}AT_LEAST_ONE_SEP2(e){this.atLeastOneSepFirstInternal(2,e)}AT_LEAST_ONE_SEP3(e){this.atLeastOneSepFirstInternal(3,e)}AT_LEAST_ONE_SEP4(e){this.atLeastOneSepFirstInternal(4,e)}AT_LEAST_ONE_SEP5(e){this.atLeastOneSepFirstInternal(5,e)}AT_LEAST_ONE_SEP6(e){this.atLeastOneSepFirstInternal(6,e)}AT_LEAST_ONE_SEP7(e){this.atLeastOneSepFirstInternal(7,e)}AT_LEAST_ONE_SEP8(e){this.atLeastOneSepFirstInternal(8,e)}AT_LEAST_ONE_SEP9(e){this.atLeastOneSepFirstInternal(9,e)}RULE(e,n,r=Lf){if(on(this.definedRulesNames,e)){const o={message:Fs.buildDuplicateRuleNameError({topLevelRule:e,grammarName:this.className}),type:un.DUPLICATE_RULE_NAME,ruleName:e};this.definitionErrors.push(o)}this.definedRulesNames.push(e);const i=this.defineRule(e,n,r);return this[e]=i,i}OVERRIDE_RULE(e,n,r=Lf){const i=N5(e,this.definedRulesNames,this.className);this.definitionErrors=this.definitionErrors.concat(i);const s=this.defineRule(e,n,r);return this[e]=s,s}BACKTRACK(e,n){return function(){this.isBackTrackingStack.push(1);const r=this.saveRecogState();try{return e.apply(this,n),!0}catch(i){if(Af(i))return!1;throw i}finally{this.reloadRecogState(r),this.isBackTrackingStack.pop()}}}getGAstProductions(){return this.gastProductionsCache}getSerializedGastProductions(){return w6(Nt(this.gastProductionsCache))}}class fq{initRecognizerEngine(e,n){if(this.className=this.constructor.name,this.shortRuleNameToFull={},this.fullRuleNameToShort={},this.ruleShortNameIdx=256,this.tokenMatcher=Sf,this.subruleIdx=0,this.definedRulesNames=[],this.tokensMap={},this.isBackTrackingStack=[],this.RULE_STACK=[],this.RULE_OCCURRENCE_STACK=[],this.gastProductionsCache={},be(n,"serializedGrammar"))throw Error(`The Parser's configuration can no longer contain a <serializedGrammar> property.
92
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_6-0-0
93
+ For Further details.`);if(Be(e)){if(tt(e))throw Error(`A Token Vocabulary cannot be empty.
94
+ Note that the first argument for the parser constructor
95
+ is no longer a Token vector (since v4.0).`);if(typeof e[0].startOffset=="number")throw Error(`The Parser constructor no longer accepts a token vector as the first argument.
96
+ See: https://chevrotain.io/docs/changes/BREAKING_CHANGES.html#_4-0-0
97
+ For Further details.`)}if(Be(e))this.tokensMap=an(e,(s,o)=>(s[o.name]=o,s),{});else if(be(e,"modes")&&dr(Yn(Nt(e.modes)),u5)){const s=Yn(Nt(e.modes)),o=Zm(s);this.tokensMap=an(o,(a,c)=>(a[c.name]=c,a),{})}else if(Vn(e))this.tokensMap=jt(e);else throw new Error("<tokensDictionary> argument must be An Array of Token constructors, A dictionary of Token constructors or an IMultiModeLexerDefinition");this.tokensMap.EOF=qi;const r=be(e,"modes")?Yn(Nt(e.modes)):Nt(e),i=dr(r,s=>tt(s.categoryMatches));this.tokenMatcher=i?Sf:Wc,Hc(Nt(this.tokensMap))}defineRule(e,n,r){if(this.selfAnalysisDone)throw Error(`Grammar rule <${e}> may not be defined after the 'performSelfAnalysis' method has been called'
98
+ Make sure that all grammar rule definitions are done before 'performSelfAnalysis' is called.`);const i=be(r,"resyncEnabled")?r.resyncEnabled:Lf.resyncEnabled,s=be(r,"recoveryValueFunc")?r.recoveryValueFunc:Lf.recoveryValueFunc,o=this.ruleShortNameIdx<<J5+ji;this.ruleShortNameIdx++,this.shortRuleNameToFull[o]=e,this.fullRuleNameToShort[e]=o;let a;return this.outputCst===!0?a=function(...l){try{this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l);const d=this.CST_STACK[this.CST_STACK.length-1];return this.cstPostRule(d),d}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}}:a=function(...l){try{return this.ruleInvocationStateUpdate(o,e,this.subruleIdx),n.apply(this,l)}catch(d){return this.invokeRuleCatch(d,i,s)}finally{this.ruleFinallyStateUpdate()}},Object.assign(a,{ruleName:e,originalGrammarAction:n})}invokeRuleCatch(e,n,r){const i=this.RULE_STACK.length===1,s=n&&!this.isBackTracking()&&this.recoveryEnabled;if(Af(e)){const o=e;if(s){const a=this.findReSyncTokenType();if(this.isInCurrentRuleReSyncSet(a))if(o.resyncedTokens=this.reSyncTo(a),this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];return c.recoveredNode=!0,c}else return r(e);else{if(this.outputCst){const c=this.CST_STACK[this.CST_STACK.length-1];c.recoveredNode=!0,o.partialCstResult=c}throw o}}else{if(i)return this.moveToTerminatedState(),r(e);throw o}}else throw e}optionInternal(e,n){const r=this.getKeyForAutomaticLookahead(u1,n);return this.optionInternalLogic(e,n,r)}optionInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof e!="function"){s=e.DEF;const o=e.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=e;if(i.call(this)===!0)return s.call(this)}atLeastOneInternal(e,n){const r=this.getKeyForAutomaticLookahead(fy,e);return this.atLeastOneInternalLogic(e,n,r)}atLeastOneInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const o=n.GATE;if(o!==void 0){const a=i;i=()=>o.call(this)&&a.call(this)}}else s=n;if(i.call(this)===!0){let o=this.doSingleRepetition(s);for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s)}else throw this.raiseEarlyExitException(e,ft.REPETITION_MANDATORY,n.ERR_MSG);this.attemptInRepetitionRecovery(this.atLeastOneInternal,[e,n],i,fy,e,w5)}atLeastOneSepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(If,e);this.atLeastOneSepFirstInternalLogic(e,n,r)}atLeastOneSepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,HR],a,If,e,HR)}else throw this.raiseEarlyExitException(e,ft.REPETITION_MANDATORY_WITH_SEPARATOR,n.ERR_MSG)}manyInternal(e,n){const r=this.getKeyForAutomaticLookahead(dy,e);return this.manyInternalLogic(e,n,r)}manyInternalLogic(e,n,r){let i=this.getLaFuncFromCache(r),s;if(typeof n!="function"){s=n.DEF;const a=n.GATE;if(a!==void 0){const c=i;i=()=>a.call(this)&&c.call(this)}}else s=n;let o=!0;for(;i.call(this)===!0&&o===!0;)o=this.doSingleRepetition(s);this.attemptInRepetitionRecovery(this.manyInternal,[e,n],i,dy,e,v5,o)}manySepFirstInternal(e,n){const r=this.getKeyForAutomaticLookahead(hy,e);this.manySepFirstInternalLogic(e,n,r)}manySepFirstInternalLogic(e,n,r){const i=n.DEF,s=n.SEP;if(this.getLaFuncFromCache(r).call(this)===!0){i.call(this);const a=()=>this.tokenMatcher(this.LA(1),s);for(;this.tokenMatcher(this.LA(1),s)===!0;)this.CONSUME(s),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,s,a,i,WR],a,hy,e,WR)}}repetitionSepSecondInternal(e,n,r,i,s){for(;r();)this.CONSUME(n),i.call(this);this.attemptInRepetitionRecovery(this.repetitionSepSecondInternal,[e,n,r,i,s],r,If,e,s)}doSingleRepetition(e){const n=this.getLexerPosition();return e.call(this),this.getLexerPosition()>n}orInternal(e,n){const r=this.getKeyForAutomaticLookahead(c1,n),i=Be(e)?e:e.DEF,o=this.getLaFuncFromCache(r).call(this,i);if(o!==void 0)return i[o].ALT.call(this);this.raiseNoAltException(n,e.ERR_MSG)}ruleFinallyStateUpdate(){if(this.RULE_STACK.pop(),this.RULE_OCCURRENCE_STACK.pop(),this.cstFinallyStateUpdate(),this.RULE_STACK.length===0&&this.isAtEndOfInput()===!1){const e=this.LA(1),n=this.errorMessageProvider.buildNotAllInputParsedMessage({firstRedundant:e,ruleName:this.getCurrRuleFullName()});this.SAVE_ERROR(new H5(n,e))}}subruleInternal(e,n,r){let i;try{const s=r!==void 0?r.ARGS:void 0;return this.subruleIdx=n,i=e.apply(this,s),this.cstPostNonTerminal(i,r!==void 0&&r.LABEL!==void 0?r.LABEL:e.ruleName),i}catch(s){throw this.subruleInternalError(s,r,e.ruleName)}}subruleInternalError(e,n,r){throw Af(e)&&e.partialCstResult!==void 0&&(this.cstPostNonTerminal(e.partialCstResult,n!==void 0&&n.LABEL!==void 0?n.LABEL:r),delete e.partialCstResult),e}consumeInternal(e,n,r){let i;try{const s=this.LA(1);this.tokenMatcher(s,e)===!0?(this.consumeToken(),i=s):this.consumeInternalError(e,s,r)}catch(s){i=this.consumeInternalRecovery(e,n,s)}return this.cstPostTerminal(r!==void 0&&r.LABEL!==void 0?r.LABEL:e.name,i),i}consumeInternalError(e,n,r){let i;const s=this.LA(0);throw r!==void 0&&r.ERR_MSG?i=r.ERR_MSG:i=this.errorMessageProvider.buildMismatchTokenMessage({expected:e,actual:n,previous:s,ruleName:this.getCurrRuleFullName()}),this.SAVE_ERROR(new o1(i,n,s))}consumeInternalRecovery(e,n,r){if(this.recoveryEnabled&&r.name==="MismatchedTokenException"&&!this.isBackTracking()){const i=this.getFollowsForInRuleRecovery(e,n);try{return this.tryInRuleRecovery(e,i)}catch(s){throw s.name===a1?r:s}}else throw r}saveRecogState(){const e=this.errors,n=jt(this.RULE_STACK);return{errors:e,lexerState:this.exportLexerState(),RULE_STACK:n,CST_STACK:this.CST_STACK}}reloadRecogState(e){this.errors=e.errors,this.importLexerState(e.lexerState),this.RULE_STACK=e.RULE_STACK}ruleInvocationStateUpdate(e,n,r){this.RULE_OCCURRENCE_STACK.push(r),this.RULE_STACK.push(e),this.cstInvocationStateUpdate(n)}isBackTracking(){return this.isBackTrackingStack.length!==0}getCurrRuleFullName(){const e=this.getLastExplicitRuleShortName();return this.shortRuleNameToFull[e]}shortRuleNameToFullName(e){return this.shortRuleNameToFull[e]}isAtEndOfInput(){return this.tokenMatcher(this.LA(1),qi)}reset(){this.resetLexerState(),this.subruleIdx=0,this.isBackTrackingStack=[],this.errors=[],this.RULE_STACK=[],this.CST_STACK=[],this.RULE_OCCURRENCE_STACK=[]}}class hq{initErrorHandler(e){this._errors=[],this.errorMessageProvider=be(e,"errorMessageProvider")?e.errorMessageProvider:gi.errorMessageProvider}SAVE_ERROR(e){if(Af(e))return e.context={ruleStack:this.getHumanReadableRuleStack(),ruleOccurrenceStack:jt(this.RULE_OCCURRENCE_STACK)},this._errors.push(e),e;throw Error("Trying to save an Error which is not a RecognitionException")}get errors(){return jt(this._errors)}set errors(e){this._errors=e}raiseEarlyExitException(e,n,r){const i=this.getCurrRuleFullName(),s=this.getGAstProductions()[i],a=Cf(e,s,n,this.maxLookahead)[0],c=[];for(let l=1;l<=this.maxLookahead;l++)c.push(this.LA(l));const u=this.errorMessageProvider.buildEarlyExitMessage({expectedIterationPaths:a,actual:c,previous:this.LA(0),customUserDescription:r,ruleName:i});throw this.SAVE_ERROR(new V5(u,this.LA(1),this.LA(0)))}raiseNoAltException(e,n){const r=this.getCurrRuleFullName(),i=this.getGAstProductions()[r],s=$f(e,i,this.maxLookahead),o=[];for(let u=1;u<=this.maxLookahead;u++)o.push(this.LA(u));const a=this.LA(0),c=this.errorMessageProvider.buildNoViableAltMessage({expectedPathsPerAlt:s,actual:o,previous:a,customUserDescription:n,ruleName:this.getCurrRuleFullName()});throw this.SAVE_ERROR(new W5(c,this.LA(1),a))}}class pq{initContentAssist(){}computeContentAssist(e,n){const r=this.gastProductionsCache[e];if(pi(r))throw Error(`Rule ->${e}<- does not exist in this grammar.`);return VR([r],n,this.tokenMatcher,this.maxLookahead)}getNextPossibleTokenTypes(e){const n=fr(e.ruleStack),i=this.getGAstProductions()[n];return new y5(i,e).startWalking()}}const Nf={description:"This Object indicates the Parser is during Recording Phase"};Object.freeze(Nf);const h1=!0,p1=Math.pow(2,ji)-1,g1=UR({name:"RECORDING_PHASE_TOKEN",pattern:Rn.NA});Hc([g1]);const m1=iy(g1,`This IToken indicates the Parser is in Recording Phase
99
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,-1,-1,-1,-1,-1,-1);Object.freeze(m1);const gq={name:`This CSTNode indicates the Parser is in Recording Phase
100
+ See: https://chevrotain.io/docs/guide/internals.html#grammar-recording for details`,children:{}};class mq{initGastRecorder(e){this.recordingProdStack=[],this.RECORDING_PHASE=!1}enableRecording(){this.RECORDING_PHASE=!0,this.TRACE_INIT("Enable Recording",()=>{for(let e=0;e<10;e++){const n=e>0?e:"";this[`CONSUME${n}`]=function(r,i){return this.consumeInternalRecord(r,e,i)},this[`SUBRULE${n}`]=function(r,i){return this.subruleInternalRecord(r,e,i)},this[`OPTION${n}`]=function(r){return this.optionInternalRecord(r,e)},this[`OR${n}`]=function(r){return this.orInternalRecord(r,e)},this[`MANY${n}`]=function(r){this.manyInternalRecord(e,r)},this[`MANY_SEP${n}`]=function(r){this.manySepFirstInternalRecord(e,r)},this[`AT_LEAST_ONE${n}`]=function(r){this.atLeastOneInternalRecord(e,r)},this[`AT_LEAST_ONE_SEP${n}`]=function(r){this.atLeastOneSepFirstInternalRecord(e,r)}}this.consume=function(e,n,r){return this.consumeInternalRecord(n,e,r)},this.subrule=function(e,n,r){return this.subruleInternalRecord(n,e,r)},this.option=function(e,n){return this.optionInternalRecord(n,e)},this.or=function(e,n){return this.orInternalRecord(n,e)},this.many=function(e,n){this.manyInternalRecord(e,n)},this.atLeastOne=function(e,n){this.atLeastOneInternalRecord(e,n)},this.ACTION=this.ACTION_RECORD,this.BACKTRACK=this.BACKTRACK_RECORD,this.LA=this.LA_RECORD})}disableRecording(){this.RECORDING_PHASE=!1,this.TRACE_INIT("Deleting Recording methods",()=>{const e=this;for(let n=0;n<10;n++){const r=n>0?n:"";delete e[`CONSUME${r}`],delete e[`SUBRULE${r}`],delete e[`OPTION${r}`],delete e[`OR${r}`],delete e[`MANY${r}`],delete e[`MANY_SEP${r}`],delete e[`AT_LEAST_ONE${r}`],delete e[`AT_LEAST_ONE_SEP${r}`]}delete e.consume,delete e.subrule,delete e.option,delete e.or,delete e.many,delete e.atLeastOne,delete e.ACTION,delete e.BACKTRACK,delete e.LA})}ACTION_RECORD(e){}BACKTRACK_RECORD(e,n){return()=>!0}LA_RECORD(e){return Ff}topLevelRuleRecord(e,n){try{const r=new Ko({definition:[],name:e});return r.name=e,this.recordingProdStack.push(r),n.call(this),this.recordingProdStack.pop(),r}catch(r){if(r.KNOWN_RECORDER_ERROR!==!0)try{r.message=r.message+`
101
+ This error was thrown during the "grammar recording phase" For more info see:
102
+ https://chevrotain.io/docs/guide/internals.html#grammar-recording`}catch{throw r}throw r}}optionInternalRecord(e,n){return Kc.call(this,Gt,e,n)}atLeastOneInternalRecord(e,n){Kc.call(this,Nn,n,e)}atLeastOneSepFirstInternalRecord(e,n){Kc.call(this,On,n,e,h1)}manyInternalRecord(e,n){Kc.call(this,wt,n,e)}manySepFirstInternalRecord(e,n){Kc.call(this,Dn,n,e,h1)}orInternalRecord(e,n){return yq.call(this,e,n)}subruleInternalRecord(e,n,r){if(Of(n),!e||be(e,"ruleName")===!1){const a=new Error(`<SUBRULE${y1(n)}> argument is invalid expecting a Parser method reference but got: <${JSON.stringify(e)}>
103
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw a.KNOWN_RECORDER_ERROR=!0,a}const i=Ho(this.recordingProdStack),s=e.ruleName,o=new cn({idx:n,nonTerminalName:s,label:r?.LABEL,referencedRule:void 0});return i.definition.push(o),this.outputCst?gq:Nf}consumeInternalRecord(e,n,r){if(Of(n),!IR(e)){const o=new Error(`<CONSUME${y1(n)}> argument is invalid expecting a TokenType reference but got: <${JSON.stringify(e)}>
104
+ inside top level rule: <${this.recordingProdStack[0].name}>`);throw o.KNOWN_RECORDER_ERROR=!0,o}const i=Ho(this.recordingProdStack),s=new ot({idx:n,terminalType:e,label:r?.LABEL});return i.definition.push(s),m1}}function Kc(t,e,n,r=!1){Of(n);const i=Ho(this.recordingProdStack),s=ui(e)?e:e.DEF,o=new t({definition:[],idx:n});return r&&(o.separator=e.SEP),be(e,"MAX_LOOKAHEAD")&&(o.maxLookahead=e.MAX_LOOKAHEAD),this.recordingProdStack.push(o),s.call(this),i.definition.push(o),this.recordingProdStack.pop(),Nf}function yq(t,e){Of(e);const n=Ho(this.recordingProdStack),r=Be(t)===!1,i=r===!1?t:t.DEF,s=new Tn({definition:[],idx:e,ignoreAmbiguities:r&&t.IGNORE_AMBIGUITIES===!0});be(t,"MAX_LOOKAHEAD")&&(s.maxLookahead=t.MAX_LOOKAHEAD);const o=pR(i,a=>ui(a.GATE));return s.hasPredicates=o,n.definition.push(s),ve(i,a=>{const c=new En({definition:[]});s.definition.push(c),be(a,"IGNORE_AMBIGUITIES")?c.ignoreAmbiguities=a.IGNORE_AMBIGUITIES:be(a,"GATE")&&(c.ignoreAmbiguities=!0),this.recordingProdStack.push(c),a.ALT.call(this),this.recordingProdStack.pop()}),Nf}function y1(t){return t===0?"":`${t}`}function Of(t){if(t<0||t>p1){const e=new Error(`Invalid DSL Method idx value: <${t}>
105
+ Idx value must be a none negative value smaller than ${p1+1}`);throw e.KNOWN_RECORDER_ERROR=!0,e}}class vq{initPerformanceTracer(e){if(be(e,"traceInitPerf")){const n=e.traceInitPerf,r=typeof n=="number";this.traceInitMaxIdent=r?n:1/0,this.traceInitPerf=r?n>0:n}else this.traceInitMaxIdent=0,this.traceInitPerf=gi.traceInitPerf;this.traceInitIndent=-1}TRACE_INIT(e,n){if(this.traceInitPerf===!0){this.traceInitIndent++;const r=new Array(this.traceInitIndent+1).join(" ");this.traceInitIndent<this.traceInitMaxIdent&&console.log(`${r}--> <${e}>`);const{time:i,value:s}=yR(n),o=i>10?console.warn:console.log;return this.traceInitIndent<this.traceInitMaxIdent&&o(`${r}<-- <${e}> time: ${i}ms`),this.traceInitIndent--,s}else return n()}}function wq(t,e){e.forEach(n=>{const r=n.prototype;Object.getOwnPropertyNames(r).forEach(i=>{if(i==="constructor")return;const s=Object.getOwnPropertyDescriptor(r,i);s&&(s.get||s.set)?Object.defineProperty(t.prototype,i,s):t.prototype[i]=n.prototype[i]})})}const Ff=iy(qi,"",NaN,NaN,NaN,NaN,NaN,NaN);Object.freeze(Ff);const gi=Object.freeze({recoveryEnabled:!1,maxLookahead:3,dynamicTokensEnabled:!1,outputCst:!0,errorMessageProvider:Jo,nodeLocationTracking:"none",traceInitPerf:!1,skipValidations:!1}),Lf=Object.freeze({recoveryValueFunc:()=>{},resyncEnabled:!0});var un;(function(t){t[t.INVALID_RULE_NAME=0]="INVALID_RULE_NAME",t[t.DUPLICATE_RULE_NAME=1]="DUPLICATE_RULE_NAME",t[t.INVALID_RULE_OVERRIDE=2]="INVALID_RULE_OVERRIDE",t[t.DUPLICATE_PRODUCTIONS=3]="DUPLICATE_PRODUCTIONS",t[t.UNRESOLVED_SUBRULE_REF=4]="UNRESOLVED_SUBRULE_REF",t[t.LEFT_RECURSION=5]="LEFT_RECURSION",t[t.NONE_LAST_EMPTY_ALT=6]="NONE_LAST_EMPTY_ALT",t[t.AMBIGUOUS_ALTS=7]="AMBIGUOUS_ALTS",t[t.CONFLICT_TOKENS_RULES_NAMESPACE=8]="CONFLICT_TOKENS_RULES_NAMESPACE",t[t.INVALID_TOKEN_NAME=9]="INVALID_TOKEN_NAME",t[t.NO_NON_EMPTY_LOOKAHEAD=10]="NO_NON_EMPTY_LOOKAHEAD",t[t.AMBIGUOUS_PREFIX_ALTS=11]="AMBIGUOUS_PREFIX_ALTS",t[t.TOO_MANY_ALTS=12]="TOO_MANY_ALTS",t[t.CUSTOM_LOOKAHEAD_VALIDATION=13]="CUSTOM_LOOKAHEAD_VALIDATION"})(un||(un={}));function v1(t=void 0){return function(){return t}}class cd{static performSelfAnalysis(e){throw Error("The **static** `performSelfAnalysis` method has been deprecated. \nUse the **instance** method with the same name instead.")}performSelfAnalysis(){this.TRACE_INIT("performSelfAnalysis",()=>{let e;this.selfAnalysisDone=!0;const n=this.className;this.TRACE_INIT("toFastProps",()=>{vR(this)}),this.TRACE_INIT("Grammar Recording",()=>{try{this.enableRecording(),ve(this.definedRulesNames,i=>{const o=this[i].originalGrammarAction;let a;this.TRACE_INIT(`${i} Rule`,()=>{a=this.topLevelRuleRecord(i,o)}),this.gastProductionsCache[i]=a})}finally{this.disableRecording()}});let r=[];if(this.TRACE_INIT("Grammar Resolving",()=>{r=U5({rules:Nt(this.gastProductionsCache)}),this.definitionErrors=this.definitionErrors.concat(r)}),this.TRACE_INIT("Grammar Validations",()=>{if(tt(r)&&this.skipValidations===!1){const i=G5({rules:Nt(this.gastProductionsCache),tokenTypes:Nt(this.tokensMap),errMsgProvider:Fs,grammarName:n}),s=C5({lookaheadStrategy:this.lookaheadStrategy,rules:Nt(this.gastProductionsCache),tokenTypes:Nt(this.tokensMap),grammarName:n});this.definitionErrors=this.definitionErrors.concat(i,s)}}),tt(this.definitionErrors)&&(this.recoveryEnabled&&this.TRACE_INIT("computeAllProdsFollows",()=>{const i=k6(Nt(this.gastProductionsCache));this.resyncFollows=i}),this.TRACE_INIT("ComputeLookaheadFunctions",()=>{var i,s;(s=(i=this.lookaheadStrategy).initialize)===null||s===void 0||s.call(i,{rules:Nt(this.gastProductionsCache)}),this.preComputeLookaheadFunctions(Nt(this.gastProductionsCache))})),!cd.DEFER_DEFINITION_ERRORS_HANDLING&&!tt(this.definitionErrors))throw e=de(this.definitionErrors,i=>i.message),new Error(`Parser Definition Errors detected:
106
+ ${e.join(`
107
+ -------------------------------
108
+ `)}`)})}constructor(e,n){this.definitionErrors=[],this.selfAnalysisDone=!1;const r=this;if(r.initErrorHandler(n),r.initLexerAdapter(),r.initLooksAhead(n),r.initRecognizerEngine(e,n),r.initRecoverable(n),r.initTreeBuilder(n),r.initContentAssist(),r.initGastRecorder(n),r.initPerformanceTracer(n),be(n,"ignoredIssues"))throw new Error(`The <ignoredIssues> IParserConfig property has been deprecated.
109
+ Please use the <IGNORE_AMBIGUITIES> flag on the relevant DSL method instead.
110
+ See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#IGNORING_AMBIGUITIES
111
+ For further details.`);this.skipValidations=be(n,"skipValidations")?n.skipValidations:gi.skipValidations}}cd.DEFER_DEFINITION_ERRORS_HANDLING=!1,wq(cd,[Y5,Z5,uq,lq,fq,dq,hq,pq,mq,vq]);class bq extends cd{constructor(e,n=gi){const r=jt(n);r.outputCst=!1,super(e,r)}}function Zo(t,e,n){return`${t.name}_${e}_${n}`}const Ui=1,Eq=2,w1=4,b1=5,Yc=7,Dq=8,Tq=9,Rq=10,Sq=11,E1=12;class yy{constructor(e){this.target=e}isEpsilon(){return!1}}class vy extends yy{constructor(e,n){super(e),this.tokenType=n}}class D1 extends yy{constructor(e){super(e)}isEpsilon(){return!0}}class wy extends yy{constructor(e,n,r){super(e),this.rule=n,this.followState=r}isEpsilon(){return!0}}function kq(t){const e={decisionMap:{},decisionStates:[],ruleToStartState:new Map,ruleToStopState:new Map,states:[]};$q(e,t);const n=t.length;for(let r=0;r<n;r++){const i=t[r],s=Ls(e,i,i);s!==void 0&&Mq(e,i,s)}return e}function $q(t,e){const n=e.length;for(let r=0;r<n;r++){const i=e[r],s=Mt(t,i,void 0,{type:Eq}),o=Mt(t,i,void 0,{type:Yc});s.stop=o,t.ruleToStartState.set(i,s),t.ruleToStopState.set(i,o)}}function T1(t,e,n){return n instanceof ot?by(t,e,n.terminalType,n):n instanceof cn?Lq(t,e,n):n instanceof Tn?Iq(t,e,n):n instanceof Gt?Pq(t,e,n):n instanceof wt?Cq(t,e,n):n instanceof Dn?_q(t,e,n):n instanceof Nn?Aq(t,e,n):n instanceof On?xq(t,e,n):Ls(t,e,n)}function Cq(t,e,n){const r=Mt(t,e,n,{type:b1});Gi(t,r);const i=Qo(t,e,r,n,Ls(t,e,n));return S1(t,e,n,i)}function _q(t,e,n){const r=Mt(t,e,n,{type:b1});Gi(t,r);const i=Qo(t,e,r,n,Ls(t,e,n)),s=by(t,e,n.separator,n);return S1(t,e,n,i,s)}function Aq(t,e,n){const r=Mt(t,e,n,{type:w1});Gi(t,r);const i=Qo(t,e,r,n,Ls(t,e,n));return R1(t,e,n,i)}function xq(t,e,n){const r=Mt(t,e,n,{type:w1});Gi(t,r);const i=Qo(t,e,r,n,Ls(t,e,n)),s=by(t,e,n.separator,n);return R1(t,e,n,i,s)}function Iq(t,e,n){const r=Mt(t,e,n,{type:Ui});Gi(t,r);const i=de(n.definition,o=>T1(t,e,o));return Qo(t,e,r,n,...i)}function Pq(t,e,n){const r=Mt(t,e,n,{type:Ui});Gi(t,r);const i=Qo(t,e,r,n,Ls(t,e,n));return Nq(t,e,n,i)}function Ls(t,e,n){const r=In(de(n.definition,i=>T1(t,e,i)),i=>i!==void 0);return r.length===1?r[0]:r.length===0?void 0:Fq(t,r)}function R1(t,e,n,r,i){const s=r.left,o=r.right,a=Mt(t,e,n,{type:Sq});Gi(t,a);const c=Mt(t,e,n,{type:E1});return s.loopback=a,c.loopback=a,t.decisionMap[Zo(e,i?"RepetitionMandatoryWithSeparator":"RepetitionMandatory",n.idx)]=a,_t(o,a),i===void 0?(_t(a,s),_t(a,c)):(_t(a,c),_t(a,i.left),_t(i.right,s)),{left:s,right:c}}function S1(t,e,n,r,i){const s=r.left,o=r.right,a=Mt(t,e,n,{type:Rq});Gi(t,a);const c=Mt(t,e,n,{type:E1}),u=Mt(t,e,n,{type:Tq});return a.loopback=u,c.loopback=u,_t(a,s),_t(a,c),_t(o,u),i!==void 0?(_t(u,c),_t(u,i.left),_t(i.right,s)):_t(u,a),t.decisionMap[Zo(e,i?"RepetitionWithSeparator":"Repetition",n.idx)]=a,{left:a,right:c}}function Nq(t,e,n,r){const i=r.left,s=r.right;return _t(i,s),t.decisionMap[Zo(e,"Option",n.idx)]=i,r}function Gi(t,e){return t.decisionStates.push(e),e.decision=t.decisionStates.length-1,e.decision}function Qo(t,e,n,r,...i){const s=Mt(t,e,r,{type:Dq,start:n});n.end=s;for(const a of i)a!==void 0?(_t(n,a.left),_t(a.right,s)):_t(n,s);const o={left:n,right:s};return t.decisionMap[Zo(e,Oq(r),r.idx)]=n,o}function Oq(t){if(t instanceof Tn)return"Alternation";if(t instanceof Gt)return"Option";if(t instanceof wt)return"Repetition";if(t instanceof Dn)return"RepetitionWithSeparator";if(t instanceof Nn)return"RepetitionMandatory";if(t instanceof On)return"RepetitionMandatoryWithSeparator";throw new Error("Invalid production type encountered")}function Fq(t,e){const n=e.length;for(let s=0;s<n-1;s++){const o=e[s];let a;o.left.transitions.length===1&&(a=o.left.transitions[0]);const c=a instanceof wy,u=a,l=e[s+1].left;o.left.type===Ui&&o.right.type===Ui&&a!==void 0&&(c&&u.followState===o.right||a.target===o.right)?(c?u.followState=l:a.target=l,zq(t,o.right)):_t(o.right,l)}const r=e[0],i=e[n-1];return{left:r.left,right:i.right}}function by(t,e,n,r){const i=Mt(t,e,r,{type:Ui}),s=Mt(t,e,r,{type:Ui});return Ey(i,new vy(s,n)),{left:i,right:s}}function Lq(t,e,n){const r=n.referencedRule,i=t.ruleToStartState.get(r),s=Mt(t,e,n,{type:Ui}),o=Mt(t,e,n,{type:Ui}),a=new wy(i,r,o);return Ey(s,a),{left:s,right:o}}function Mq(t,e,n){const r=t.ruleToStartState.get(e);_t(r,n.left);const i=t.ruleToStopState.get(e);return _t(n.right,i),{left:r,right:i}}function _t(t,e){const n=new D1(e);Ey(t,n)}function Mt(t,e,n,r){const i=Object.assign({atn:t,production:n,epsilonOnlyTransitions:!1,rule:e,transitions:[],nextTokenWithinRule:[],stateNumber:t.states.length},r);return t.states.push(i),i}function Ey(t,e){t.transitions.length===0&&(t.epsilonOnlyTransitions=e.isEpsilon()),t.transitions.push(e)}function zq(t,e){t.states.splice(t.states.indexOf(e),1)}const Mf={};class Dy{constructor(){this.map={},this.configs=[]}get size(){return this.configs.length}finalize(){this.map={}}add(e){const n=k1(e);n in this.map||(this.map[n]=this.configs.length,this.configs.push(e))}get elements(){return this.configs}get alts(){return de(this.configs,e=>e.alt)}get key(){let e="";for(const n in this.map)e+=n+":";return e}}function k1(t,e=!0){return`${e?`a${t.alt}`:""}s${t.state.stateNumber}:${t.stack.map(n=>n.stateNumber.toString()).join("_")}`}function Bq(t,e){const n={};return r=>{const i=r.toString();let s=n[i];return s!==void 0||(s={atnStartState:t,decision:e,states:{}},n[i]=s),s}}class $1{constructor(){this.predicates=[]}is(e){return e>=this.predicates.length||this.predicates[e]}set(e,n){this.predicates[e]=n}toString(){let e="";const n=this.predicates.length;for(let r=0;r<n;r++)e+=this.predicates[r]===!0?"1":"0";return e}}const C1=new $1;class qq extends gy{constructor(e){var n;super(),this.logging=(n=e?.logging)!==null&&n!==void 0?n:r=>console.log(r)}initialize(e){this.atn=kq(e.rules),this.dfas=jq(this.atn)}validateAmbiguousAlternationAlternatives(){return[]}validateEmptyOrAlternatives(){return[]}buildLookaheadForAlternation(e){const{prodOccurrence:n,rule:r,hasPredicates:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=Zo(r,"Alternation",n),l=this.atn.decisionMap[c].decision,d=de(KR({maxLookahead:1,occurrence:n,prodType:"Alternation",rule:r}),f=>de(f,h=>h[0]));if(_1(d,!1)&&!s){const f=an(d,(h,p,g)=>(ve(p,y=>{y&&(h[y.tokenTypeIdx]=g,ve(y.categoryMatches,m=>{h[m]=g}))}),h),{});return i?function(h){var p;const g=this.LA(1),y=f[g.tokenTypeIdx];if(h!==void 0&&y!==void 0){const m=(p=h[y])===null||p===void 0?void 0:p.GATE;if(m!==void 0&&m.call(this)===!1)return}return y}:function(){const h=this.LA(1);return f[h.tokenTypeIdx]}}else return i?function(f){const h=new $1,p=f===void 0?0:f.length;for(let y=0;y<p;y++){const m=f?.[y].GATE;h.set(y,m===void 0||m.call(this))}const g=Ty.call(this,o,l,h,a);return typeof g=="number"?g:void 0}:function(){const f=Ty.call(this,o,l,C1,a);return typeof f=="number"?f:void 0}}buildLookaheadForOptional(e){const{prodOccurrence:n,rule:r,prodType:i,dynamicTokensEnabled:s}=e,o=this.dfas,a=this.logging,c=Zo(r,i,n),l=this.atn.decisionMap[c].decision,d=de(KR({maxLookahead:1,occurrence:n,prodType:i,rule:r}),f=>de(f,h=>h[0]));if(_1(d)&&d[0][0]&&!s){const f=d[0],h=Yn(f);if(h.length===1&&tt(h[0].categoryMatches)){const g=h[0].tokenTypeIdx;return function(){return this.LA(1).tokenTypeIdx===g}}else{const p=an(h,(g,y)=>(y!==void 0&&(g[y.tokenTypeIdx]=!0,ve(y.categoryMatches,m=>{g[m]=!0})),g),{});return function(){const g=this.LA(1);return p[g.tokenTypeIdx]===!0}}}return function(){const f=Ty.call(this,o,l,C1,a);return typeof f=="object"?!1:f===0}}}function _1(t,e=!0){const n=new Set;for(const r of t){const i=new Set;for(const s of r){if(s===void 0){if(e)break;return!1}const o=[s.tokenTypeIdx].concat(s.categoryMatches);for(const a of o)if(n.has(a)){if(!i.has(a))return!1}else n.add(a),i.add(a)}}return!0}function jq(t){const e=t.decisionStates.length,n=Array(e);for(let r=0;r<e;r++)n[r]=Bq(t.decisionStates[r],r);return n}function Ty(t,e,n,r){const i=t[e](n);let s=i.start;if(s===void 0){const a=Qq(i.atnStartState);s=I1(i,A1(a)),i.start=s}return Uq.apply(this,[i,s,n,r])}function Uq(t,e,n,r){let i=e,s=1;const o=[];let a=this.LA(s++);for(;;){let c=Yq(i,a);if(c===void 0&&(c=Gq.apply(this,[t,i,a,s,n,r])),c===Mf)return Kq(o,i,a);if(c.isAcceptState===!0)return c.prediction;i=c,o.push(a),a=this.LA(s++)}}function Gq(t,e,n,r,i,s){const o=Xq(e.configs,n,i);if(o.size===0)return x1(t,e,n,Mf),Mf;let a=A1(o);const c=Zq(o,i);if(c!==void 0)a.isAcceptState=!0,a.prediction=c,a.configs.uniqueAlt=c;else if(rj(o)){const u=o6(o.alts);a.isAcceptState=!0,a.prediction=u,a.configs.uniqueAlt=u,Wq.apply(this,[t,r,o.alts,s])}return a=x1(t,e,n,a),a}function Wq(t,e,n,r){const i=[];for(let u=1;u<=e;u++)i.push(this.LA(u).tokenType);const s=t.atnStartState,o=s.rule,a=s.production,c=Hq({topLevelRule:o,ambiguityIndices:n,production:a,prefixPath:i});r(c)}function Hq(t){const e=de(t.prefixPath,i=>Xo(i)).join(", "),n=t.production.idx===0?"":t.production.idx;let r=`Ambiguous Alternatives Detected: <${t.ambiguityIndices.join(", ")}> in <${Vq(t.production)}${n}> inside <${t.topLevelRule.name}> Rule,
112
+ <${e}> may appears as a prefix path in all these alternatives.
113
+ `;return r=r+`See: https://chevrotain.io/docs/guide/resolving_grammar_errors.html#AMBIGUOUS_ALTERNATIVES
114
+ For Further details.`,r}function Vq(t){if(t instanceof cn)return"SUBRULE";if(t instanceof Gt)return"OPTION";if(t instanceof Tn)return"OR";if(t instanceof Nn)return"AT_LEAST_ONE";if(t instanceof On)return"AT_LEAST_ONE_SEP";if(t instanceof Dn)return"MANY_SEP";if(t instanceof wt)return"MANY";if(t instanceof ot)return"CONSUME";throw Error("non exhaustive match")}function Kq(t,e,n){const r=Pn(e.configs.elements,s=>s.state.transitions),i=m6(r.filter(s=>s instanceof vy).map(s=>s.tokenType),s=>s.tokenTypeIdx);return{actualToken:n,possibleTokenTypes:i,tokenPath:t}}function Yq(t,e){return t.edges[e.tokenTypeIdx]}function Xq(t,e,n){const r=new Dy,i=[];for(const o of t.elements){if(n.is(o.alt)===!1)continue;if(o.state.type===Yc){i.push(o);continue}const a=o.state.transitions.length;for(let c=0;c<a;c++){const u=o.state.transitions[c],l=Jq(u,e);l!==void 0&&r.add({state:l,alt:o.alt,stack:o.stack})}}let s;if(i.length===0&&r.size===1&&(s=r),s===void 0){s=new Dy;for(const o of r.elements)zf(o,s)}if(i.length>0&&!tj(s))for(const o of i)s.add(o);return s}function Jq(t,e){if(t instanceof vy&&GR(e,t.tokenType))return t.target}function Zq(t,e){let n;for(const r of t.elements)if(e.is(r.alt)===!0){if(n===void 0)n=r.alt;else if(n!==r.alt)return}return n}function A1(t){return{configs:t,edges:{},isAcceptState:!1,prediction:-1}}function x1(t,e,n,r){return r=I1(t,r),e.edges[n.tokenTypeIdx]=r,r}function I1(t,e){if(e===Mf)return e;const n=e.configs.key,r=t.states[n];return r!==void 0?r:(e.configs.finalize(),t.states[n]=e,e)}function Qq(t){const e=new Dy,n=t.transitions.length;for(let r=0;r<n;r++){const s={state:t.transitions[r].target,alt:r,stack:[]};zf(s,e)}return e}function zf(t,e){const n=t.state;if(n.type===Yc){if(t.stack.length>0){const i=[...t.stack],o={state:i.pop(),alt:t.alt,stack:i};zf(o,e)}else e.add(t);return}n.epsilonOnlyTransitions||e.add(t);const r=n.transitions.length;for(let i=0;i<r;i++){const s=n.transitions[i],o=ej(t,s);o!==void 0&&zf(o,e)}}function ej(t,e){if(e instanceof D1)return{state:e.target,alt:t.alt,stack:t.stack};if(e instanceof wy){const n=[...t.stack,e.followState];return{state:e.target,alt:t.alt,stack:n}}}function tj(t){for(const e of t.elements)if(e.state.type===Yc)return!0;return!1}function nj(t){for(const e of t.elements)if(e.state.type!==Yc)return!1;return!0}function rj(t){if(nj(t))return!0;const e=ij(t.elements);return sj(e)&&!oj(e)}function ij(t){const e=new Map;for(const n of t){const r=k1(n,!1);let i=e.get(r);i===void 0&&(i={},e.set(r,i)),i[n.alt]=!0}return e}function sj(t){for(const e of Array.from(t.values()))if(Object.keys(e).length>1)return!0;return!1}function oj(t){for(const e of Array.from(t.values()))if(Object.keys(e).length===1)return!0;return!1}var P1;(function(t){function e(n){return typeof n=="string"}t.is=e})(P1||(P1={}));var Ry;(function(t){function e(n){return typeof n=="string"}t.is=e})(Ry||(Ry={}));var N1;(function(t){t.MIN_VALUE=-2147483648,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(N1||(N1={}));var Bf;(function(t){t.MIN_VALUE=0,t.MAX_VALUE=2147483647;function e(n){return typeof n=="number"&&t.MIN_VALUE<=n&&n<=t.MAX_VALUE}t.is=e})(Bf||(Bf={}));var He;(function(t){function e(r,i){return r===Number.MAX_VALUE&&(r=Bf.MAX_VALUE),i===Number.MAX_VALUE&&(i=Bf.MAX_VALUE),{line:r,character:i}}t.create=e;function n(r){let i=r;return B.objectLiteral(i)&&B.uinteger(i.line)&&B.uinteger(i.character)}t.is=n})(He||(He={}));var Me;(function(t){function e(r,i,s,o){if(B.uinteger(r)&&B.uinteger(i)&&B.uinteger(s)&&B.uinteger(o))return{start:He.create(r,i),end:He.create(s,o)};if(He.is(r)&&He.is(i))return{start:r,end:i};throw new Error(`Range#create called with invalid arguments[${r}, ${i}, ${s}, ${o}]`)}t.create=e;function n(r){let i=r;return B.objectLiteral(i)&&He.is(i.start)&&He.is(i.end)}t.is=n})(Me||(Me={}));var qf;(function(t){function e(r,i){return{uri:r,range:i}}t.create=e;function n(r){let i=r;return B.objectLiteral(i)&&Me.is(i.range)&&(B.string(i.uri)||B.undefined(i.uri))}t.is=n})(qf||(qf={}));var O1;(function(t){function e(r,i,s,o){return{targetUri:r,targetRange:i,targetSelectionRange:s,originSelectionRange:o}}t.create=e;function n(r){let i=r;return B.objectLiteral(i)&&Me.is(i.targetRange)&&B.string(i.targetUri)&&Me.is(i.targetSelectionRange)&&(Me.is(i.originSelectionRange)||B.undefined(i.originSelectionRange))}t.is=n})(O1||(O1={}));var Sy;(function(t){function e(r,i,s,o){return{red:r,green:i,blue:s,alpha:o}}t.create=e;function n(r){const i=r;return B.objectLiteral(i)&&B.numberRange(i.red,0,1)&&B.numberRange(i.green,0,1)&&B.numberRange(i.blue,0,1)&&B.numberRange(i.alpha,0,1)}t.is=n})(Sy||(Sy={}));var F1;(function(t){function e(r,i){return{range:r,color:i}}t.create=e;function n(r){const i=r;return B.objectLiteral(i)&&Me.is(i.range)&&Sy.is(i.color)}t.is=n})(F1||(F1={}));var L1;(function(t){function e(r,i,s){return{label:r,textEdit:i,additionalTextEdits:s}}t.create=e;function n(r){const i=r;return B.objectLiteral(i)&&B.string(i.label)&&(B.undefined(i.textEdit)||Sn.is(i))&&(B.undefined(i.additionalTextEdits)||B.typedArray(i.additionalTextEdits,Sn.is))}t.is=n})(L1||(L1={}));var M1;(function(t){t.Comment="comment",t.Imports="imports",t.Region="region"})(M1||(M1={}));var z1;(function(t){function e(r,i,s,o,a,c){const u={startLine:r,endLine:i};return B.defined(s)&&(u.startCharacter=s),B.defined(o)&&(u.endCharacter=o),B.defined(a)&&(u.kind=a),B.defined(c)&&(u.collapsedText=c),u}t.create=e;function n(r){const i=r;return B.objectLiteral(i)&&B.uinteger(i.startLine)&&B.uinteger(i.startLine)&&(B.undefined(i.startCharacter)||B.uinteger(i.startCharacter))&&(B.undefined(i.endCharacter)||B.uinteger(i.endCharacter))&&(B.undefined(i.kind)||B.string(i.kind))}t.is=n})(z1||(z1={}));var ky;(function(t){function e(r,i){return{location:r,message:i}}t.create=e;function n(r){let i=r;return B.defined(i)&&qf.is(i.location)&&B.string(i.message)}t.is=n})(ky||(ky={}));var Xc;(function(t){t.Error=1,t.Warning=2,t.Information=3,t.Hint=4})(Xc||(Xc={}));var B1;(function(t){t.Unnecessary=1,t.Deprecated=2})(B1||(B1={}));var q1;(function(t){function e(n){const r=n;return B.objectLiteral(r)&&B.string(r.href)}t.is=e})(q1||(q1={}));var jf;(function(t){function e(r,i,s,o,a,c){let u={range:r,message:i};return B.defined(s)&&(u.severity=s),B.defined(o)&&(u.code=o),B.defined(a)&&(u.source=a),B.defined(c)&&(u.relatedInformation=c),u}t.create=e;function n(r){var i;let s=r;return B.defined(s)&&Me.is(s.range)&&B.string(s.message)&&(B.number(s.severity)||B.undefined(s.severity))&&(B.integer(s.code)||B.string(s.code)||B.undefined(s.code))&&(B.undefined(s.codeDescription)||B.string((i=s.codeDescription)===null||i===void 0?void 0:i.href))&&(B.string(s.source)||B.undefined(s.source))&&(B.undefined(s.relatedInformation)||B.typedArray(s.relatedInformation,ky.is))}t.is=n})(jf||(jf={}));var ea;(function(t){function e(r,i,...s){let o={title:r,command:i};return B.defined(s)&&s.length>0&&(o.arguments=s),o}t.create=e;function n(r){let i=r;return B.defined(i)&&B.string(i.title)&&B.string(i.command)}t.is=n})(ea||(ea={}));var Sn;(function(t){function e(s,o){return{range:s,newText:o}}t.replace=e;function n(s,o){return{range:{start:s,end:s},newText:o}}t.insert=n;function r(s){return{range:s,newText:""}}t.del=r;function i(s){const o=s;return B.objectLiteral(o)&&B.string(o.newText)&&Me.is(o.range)}t.is=i})(Sn||(Sn={}));var $y;(function(t){function e(r,i,s){const o={label:r};return i!==void 0&&(o.needsConfirmation=i),s!==void 0&&(o.description=s),o}t.create=e;function n(r){const i=r;return B.objectLiteral(i)&&B.string(i.label)&&(B.boolean(i.needsConfirmation)||i.needsConfirmation===void 0)&&(B.string(i.description)||i.description===void 0)}t.is=n})($y||($y={}));var ta;(function(t){function e(n){const r=n;return B.string(r)}t.is=e})(ta||(ta={}));var j1;(function(t){function e(s,o,a){return{range:s,newText:o,annotationId:a}}t.replace=e;function n(s,o,a){return{range:{start:s,end:s},newText:o,annotationId:a}}t.insert=n;function r(s,o){return{range:s,newText:"",annotationId:o}}t.del=r;function i(s){const o=s;return Sn.is(o)&&($y.is(o.annotationId)||ta.is(o.annotationId))}t.is=i})(j1||(j1={}));var Cy;(function(t){function e(r,i){return{textDocument:r,edits:i}}t.create=e;function n(r){let i=r;return B.defined(i)&&Py.is(i.textDocument)&&Array.isArray(i.edits)}t.is=n})(Cy||(Cy={}));var _y;(function(t){function e(r,i,s){let o={kind:"create",uri:r};return i!==void 0&&(i.overwrite!==void 0||i.ignoreIfExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind==="create"&&B.string(i.uri)&&(i.options===void 0||(i.options.overwrite===void 0||B.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||B.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ta.is(i.annotationId))}t.is=n})(_y||(_y={}));var Ay;(function(t){function e(r,i,s,o){let a={kind:"rename",oldUri:r,newUri:i};return s!==void 0&&(s.overwrite!==void 0||s.ignoreIfExists!==void 0)&&(a.options=s),o!==void 0&&(a.annotationId=o),a}t.create=e;function n(r){let i=r;return i&&i.kind==="rename"&&B.string(i.oldUri)&&B.string(i.newUri)&&(i.options===void 0||(i.options.overwrite===void 0||B.boolean(i.options.overwrite))&&(i.options.ignoreIfExists===void 0||B.boolean(i.options.ignoreIfExists)))&&(i.annotationId===void 0||ta.is(i.annotationId))}t.is=n})(Ay||(Ay={}));var xy;(function(t){function e(r,i,s){let o={kind:"delete",uri:r};return i!==void 0&&(i.recursive!==void 0||i.ignoreIfNotExists!==void 0)&&(o.options=i),s!==void 0&&(o.annotationId=s),o}t.create=e;function n(r){let i=r;return i&&i.kind==="delete"&&B.string(i.uri)&&(i.options===void 0||(i.options.recursive===void 0||B.boolean(i.options.recursive))&&(i.options.ignoreIfNotExists===void 0||B.boolean(i.options.ignoreIfNotExists)))&&(i.annotationId===void 0||ta.is(i.annotationId))}t.is=n})(xy||(xy={}));var Iy;(function(t){function e(n){let r=n;return r&&(r.changes!==void 0||r.documentChanges!==void 0)&&(r.documentChanges===void 0||r.documentChanges.every(i=>B.string(i.kind)?_y.is(i)||Ay.is(i)||xy.is(i):Cy.is(i)))}t.is=e})(Iy||(Iy={}));var U1;(function(t){function e(r){return{uri:r}}t.create=e;function n(r){let i=r;return B.defined(i)&&B.string(i.uri)}t.is=n})(U1||(U1={}));var G1;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return B.defined(i)&&B.string(i.uri)&&B.integer(i.version)}t.is=n})(G1||(G1={}));var Py;(function(t){function e(r,i){return{uri:r,version:i}}t.create=e;function n(r){let i=r;return B.defined(i)&&B.string(i.uri)&&(i.version===null||B.integer(i.version))}t.is=n})(Py||(Py={}));var W1;(function(t){function e(r,i,s,o){return{uri:r,languageId:i,version:s,text:o}}t.create=e;function n(r){let i=r;return B.defined(i)&&B.string(i.uri)&&B.string(i.languageId)&&B.integer(i.version)&&B.string(i.text)}t.is=n})(W1||(W1={}));var Ny;(function(t){t.PlainText="plaintext",t.Markdown="markdown";function e(n){const r=n;return r===t.PlainText||r===t.Markdown}t.is=e})(Ny||(Ny={}));var Jc;(function(t){function e(n){const r=n;return B.objectLiteral(n)&&Ny.is(r.kind)&&B.string(r.value)}t.is=e})(Jc||(Jc={}));var Ot;(function(t){t.Text=1,t.Method=2,t.Function=3,t.Constructor=4,t.Field=5,t.Variable=6,t.Class=7,t.Interface=8,t.Module=9,t.Property=10,t.Unit=11,t.Value=12,t.Enum=13,t.Keyword=14,t.Snippet=15,t.Color=16,t.File=17,t.Reference=18,t.Folder=19,t.EnumMember=20,t.Constant=21,t.Struct=22,t.Event=23,t.Operator=24,t.TypeParameter=25})(Ot||(Ot={}));var pr;(function(t){t.PlainText=1,t.Snippet=2})(pr||(pr={}));var H1;(function(t){t.Deprecated=1})(H1||(H1={}));var V1;(function(t){function e(r,i,s){return{newText:r,insert:i,replace:s}}t.create=e;function n(r){const i=r;return i&&B.string(i.newText)&&Me.is(i.insert)&&Me.is(i.replace)}t.is=n})(V1||(V1={}));var K1;(function(t){t.asIs=1,t.adjustIndentation=2})(K1||(K1={}));var Y1;(function(t){function e(n){const r=n;return r&&(B.string(r.detail)||r.detail===void 0)&&(B.string(r.description)||r.description===void 0)}t.is=e})(Y1||(Y1={}));var X1;(function(t){function e(n){return{label:n}}t.create=e})(X1||(X1={}));var J1;(function(t){function e(n,r){return{items:n||[],isIncomplete:!!r}}t.create=e})(J1||(J1={}));var Uf;(function(t){function e(r){return r.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}t.fromPlainText=e;function n(r){const i=r;return B.string(i)||B.objectLiteral(i)&&B.string(i.language)&&B.string(i.value)}t.is=n})(Uf||(Uf={}));var Z1;(function(t){function e(n){let r=n;return!!r&&B.objectLiteral(r)&&(Jc.is(r.contents)||Uf.is(r.contents)||B.typedArray(r.contents,Uf.is))&&(n.range===void 0||Me.is(n.range))}t.is=e})(Z1||(Z1={}));var Q1;(function(t){function e(n,r){return r?{label:n,documentation:r}:{label:n}}t.create=e})(Q1||(Q1={}));var eS;(function(t){function e(n,r,...i){let s={label:n};return B.defined(r)&&(s.documentation=r),B.defined(i)?s.parameters=i:s.parameters=[],s}t.create=e})(eS||(eS={}));var tS;(function(t){t.Text=1,t.Read=2,t.Write=3})(tS||(tS={}));var nS;(function(t){function e(n,r){let i={range:n};return B.number(r)&&(i.kind=r),i}t.create=e})(nS||(nS={}));var gr;(function(t){t.File=1,t.Module=2,t.Namespace=3,t.Package=4,t.Class=5,t.Method=6,t.Property=7,t.Field=8,t.Constructor=9,t.Enum=10,t.Interface=11,t.Function=12,t.Variable=13,t.Constant=14,t.String=15,t.Number=16,t.Boolean=17,t.Array=18,t.Object=19,t.Key=20,t.Null=21,t.EnumMember=22,t.Struct=23,t.Event=24,t.Operator=25,t.TypeParameter=26})(gr||(gr={}));var rS;(function(t){t.Deprecated=1})(rS||(rS={}));var iS;(function(t){function e(n,r,i,s,o){let a={name:n,kind:r,location:{uri:s,range:i}};return o&&(a.containerName=o),a}t.create=e})(iS||(iS={}));var sS;(function(t){function e(n,r,i,s){return s!==void 0?{name:n,kind:r,location:{uri:i,range:s}}:{name:n,kind:r,location:{uri:i}}}t.create=e})(sS||(sS={}));var oS;(function(t){function e(r,i,s,o,a,c){let u={name:r,detail:i,kind:s,range:o,selectionRange:a};return c!==void 0&&(u.children=c),u}t.create=e;function n(r){let i=r;return i&&B.string(i.name)&&B.number(i.kind)&&Me.is(i.range)&&Me.is(i.selectionRange)&&(i.detail===void 0||B.string(i.detail))&&(i.deprecated===void 0||B.boolean(i.deprecated))&&(i.children===void 0||Array.isArray(i.children))&&(i.tags===void 0||Array.isArray(i.tags))}t.is=n})(oS||(oS={}));var aS;(function(t){t.Empty="",t.QuickFix="quickfix",t.Refactor="refactor",t.RefactorExtract="refactor.extract",t.RefactorInline="refactor.inline",t.RefactorRewrite="refactor.rewrite",t.Source="source",t.SourceOrganizeImports="source.organizeImports",t.SourceFixAll="source.fixAll"})(aS||(aS={}));var Gf;(function(t){t.Invoked=1,t.Automatic=2})(Gf||(Gf={}));var cS;(function(t){function e(r,i,s){let o={diagnostics:r};return i!=null&&(o.only=i),s!=null&&(o.triggerKind=s),o}t.create=e;function n(r){let i=r;return B.defined(i)&&B.typedArray(i.diagnostics,jf.is)&&(i.only===void 0||B.typedArray(i.only,B.string))&&(i.triggerKind===void 0||i.triggerKind===Gf.Invoked||i.triggerKind===Gf.Automatic)}t.is=n})(cS||(cS={}));var uS;(function(t){function e(r,i,s){let o={title:r},a=!0;return typeof i=="string"?(a=!1,o.kind=i):ea.is(i)?o.command=i:o.edit=i,a&&s!==void 0&&(o.kind=s),o}t.create=e;function n(r){let i=r;return i&&B.string(i.title)&&(i.diagnostics===void 0||B.typedArray(i.diagnostics,jf.is))&&(i.kind===void 0||B.string(i.kind))&&(i.edit!==void 0||i.command!==void 0)&&(i.command===void 0||ea.is(i.command))&&(i.isPreferred===void 0||B.boolean(i.isPreferred))&&(i.edit===void 0||Iy.is(i.edit))}t.is=n})(uS||(uS={}));var lS;(function(t){function e(r,i){let s={range:r};return B.defined(i)&&(s.data=i),s}t.create=e;function n(r){let i=r;return B.defined(i)&&Me.is(i.range)&&(B.undefined(i.command)||ea.is(i.command))}t.is=n})(lS||(lS={}));var dS;(function(t){function e(r,i){return{tabSize:r,insertSpaces:i}}t.create=e;function n(r){let i=r;return B.defined(i)&&B.uinteger(i.tabSize)&&B.boolean(i.insertSpaces)}t.is=n})(dS||(dS={}));var fS;(function(t){function e(r,i,s){return{range:r,target:i,data:s}}t.create=e;function n(r){let i=r;return B.defined(i)&&Me.is(i.range)&&(B.undefined(i.target)||B.string(i.target))}t.is=n})(fS||(fS={}));var hS;(function(t){function e(r,i){return{range:r,parent:i}}t.create=e;function n(r){let i=r;return B.objectLiteral(i)&&Me.is(i.range)&&(i.parent===void 0||t.is(i.parent))}t.is=n})(hS||(hS={}));var We;(function(t){t.namespace="namespace",t.type="type",t.class="class",t.enum="enum",t.interface="interface",t.struct="struct",t.typeParameter="typeParameter",t.parameter="parameter",t.variable="variable",t.property="property",t.enumMember="enumMember",t.event="event",t.function="function",t.method="method",t.macro="macro",t.keyword="keyword",t.modifier="modifier",t.comment="comment",t.string="string",t.number="number",t.regexp="regexp",t.operator="operator",t.decorator="decorator"})(We||(We={}));var ht;(function(t){t.declaration="declaration",t.definition="definition",t.readonly="readonly",t.static="static",t.deprecated="deprecated",t.abstract="abstract",t.async="async",t.modification="modification",t.documentation="documentation",t.defaultLibrary="defaultLibrary"})(ht||(ht={}));var pS;(function(t){function e(n){const r=n;return B.objectLiteral(r)&&(r.resultId===void 0||typeof r.resultId=="string")&&Array.isArray(r.data)&&(r.data.length===0||typeof r.data[0]=="number")}t.is=e})(pS||(pS={}));var gS;(function(t){function e(r,i){return{range:r,text:i}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&B.string(i.text)}t.is=n})(gS||(gS={}));var mS;(function(t){function e(r,i,s){return{range:r,variableName:i,caseSensitiveLookup:s}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&B.boolean(i.caseSensitiveLookup)&&(B.string(i.variableName)||i.variableName===void 0)}t.is=n})(mS||(mS={}));var yS;(function(t){function e(r,i){return{range:r,expression:i}}t.create=e;function n(r){const i=r;return i!=null&&Me.is(i.range)&&(B.string(i.expression)||i.expression===void 0)}t.is=n})(yS||(yS={}));var vS;(function(t){function e(r,i){return{frameId:r,stoppedLocation:i}}t.create=e;function n(r){const i=r;return B.defined(i)&&Me.is(r.stoppedLocation)}t.is=n})(vS||(vS={}));var Oy;(function(t){t.Type=1,t.Parameter=2;function e(n){return n===1||n===2}t.is=e})(Oy||(Oy={}));var Fy;(function(t){function e(r){return{value:r}}t.create=e;function n(r){const i=r;return B.objectLiteral(i)&&(i.tooltip===void 0||B.string(i.tooltip)||Jc.is(i.tooltip))&&(i.location===void 0||qf.is(i.location))&&(i.command===void 0||ea.is(i.command))}t.is=n})(Fy||(Fy={}));var wS;(function(t){function e(r,i,s){const o={position:r,label:i};return s!==void 0&&(o.kind=s),o}t.create=e;function n(r){const i=r;return B.objectLiteral(i)&&He.is(i.position)&&(B.string(i.label)||B.typedArray(i.label,Fy.is))&&(i.kind===void 0||Oy.is(i.kind))&&i.textEdits===void 0||B.typedArray(i.textEdits,Sn.is)&&(i.tooltip===void 0||B.string(i.tooltip)||Jc.is(i.tooltip))&&(i.paddingLeft===void 0||B.boolean(i.paddingLeft))&&(i.paddingRight===void 0||B.boolean(i.paddingRight))}t.is=n})(wS||(wS={}));var bS;(function(t){function e(n){return{kind:"snippet",value:n}}t.createSnippet=e})(bS||(bS={}));var ES;(function(t){function e(n,r,i,s){return{insertText:n,filterText:r,range:i,command:s}}t.create=e})(ES||(ES={}));var DS;(function(t){function e(n){return{items:n}}t.create=e})(DS||(DS={}));var TS;(function(t){t.Invoked=0,t.Automatic=1})(TS||(TS={}));var RS;(function(t){function e(n,r){return{range:n,text:r}}t.create=e})(RS||(RS={}));var SS;(function(t){function e(n,r){return{triggerKind:n,selectedCompletionInfo:r}}t.create=e})(SS||(SS={}));var kS;(function(t){function e(n){const r=n;return B.objectLiteral(r)&&Ry.is(r.uri)&&B.string(r.name)}t.is=e})(kS||(kS={}));var $S;(function(t){function e(s,o,a,c){return new aj(s,o,a,c)}t.create=e;function n(s){let o=s;return!!(B.defined(o)&&B.string(o.uri)&&(B.undefined(o.languageId)||B.string(o.languageId))&&B.uinteger(o.lineCount)&&B.func(o.getText)&&B.func(o.positionAt)&&B.func(o.offsetAt))}t.is=n;function r(s,o){let a=s.getText(),c=i(o,(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),u=a.length;for(let l=c.length-1;l>=0;l--){let d=c[l],f=s.offsetAt(d.range.start),h=s.offsetAt(d.range.end);if(h<=u)a=a.substring(0,f)+d.newText+a.substring(h,a.length);else throw new Error("Overlapping edit");u=f}return a}t.applyEdits=r;function i(s,o){if(s.length<=1)return s;const a=s.length/2|0,c=s.slice(0,a),u=s.slice(a);i(c,o),i(u,o);let l=0,d=0,f=0;for(;l<c.length&&d<u.length;)o(c[l],u[d])<=0?s[f++]=c[l++]:s[f++]=u[d++];for(;l<c.length;)s[f++]=c[l++];for(;d<u.length;)s[f++]=u[d++];return s}})($S||($S={}));let aj=class{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){let n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){this._content=e.text,this._version=n,this._lineOffsets=void 0}getLineOffsets(){if(this._lineOffsets===void 0){let e=[],n=this._content,r=!0;for(let i=0;i<n.length;i++){r&&(e.push(i),r=!1);let s=n.charAt(i);r=s==="\r"||s===`
115
+ `,s==="\r"&&i+1<n.length&&n.charAt(i+1)===`
116
+ `&&i++}r&&n.length>0&&e.push(n.length),this._lineOffsets=e}return this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return He.create(0,e);for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return He.create(s,e-n[s])}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}};var B;(function(t){const e=Object.prototype.toString;function n(h){return typeof h<"u"}t.defined=n;function r(h){return typeof h>"u"}t.undefined=r;function i(h){return h===!0||h===!1}t.boolean=i;function s(h){return e.call(h)==="[object String]"}t.string=s;function o(h){return e.call(h)==="[object Number]"}t.number=o;function a(h,p,g){return e.call(h)==="[object Number]"&&p<=h&&h<=g}t.numberRange=a;function c(h){return e.call(h)==="[object Number]"&&-2147483648<=h&&h<=2147483647}t.integer=c;function u(h){return e.call(h)==="[object Number]"&&0<=h&&h<=2147483647}t.uinteger=u;function l(h){return e.call(h)==="[object Function]"}t.func=l;function d(h){return h!==null&&typeof h=="object"}t.objectLiteral=d;function f(h,p){return Array.isArray(h)&&h.every(p)}t.typedArray=f})(B||(B={}));class cj{constructor(){this.nodeStack=[]}get current(){return this.nodeStack[this.nodeStack.length-1]}buildRootNode(e){return this.rootNode=new _S(e),this.rootNode.root=this.rootNode,this.nodeStack=[this.rootNode],this.rootNode}buildCompositeNode(e){const n=new My;return n.grammarSource=e,n.root=this.rootNode,this.current.content.push(n),this.nodeStack.push(n),n}buildLeafNode(e,n){const r=new Ly(e.startOffset,e.image.length,xd(e),e.tokenType,!1);return r.grammarSource=n,r.root=this.rootNode,this.current.content.push(r),r}removeNode(e){const n=e.container;if(n){const r=n.content.indexOf(e);r>=0&&n.content.splice(r,1)}}construct(e){const n=this.current;typeof e.$type=="string"&&(this.current.astNode=e),e.$cstNode=n;const r=this.nodeStack.pop();r?.content.length===0&&this.removeNode(r)}addHiddenTokens(e){for(const n of e){const r=new Ly(n.startOffset,n.image.length,xd(n),n.tokenType,!0);r.root=this.rootNode,this.addHiddenToken(this.rootNode,r)}}addHiddenToken(e,n){const{offset:r,end:i}=n;for(let s=0;s<e.content.length;s++){const o=e.content[s],{offset:a,end:c}=o;if(ii(o)&&r>a&&i<c){this.addHiddenToken(o,n);return}else if(i<=a){e.content.splice(s,0,n);return}}e.content.push(n)}}class CS{get parent(){return this.container}get feature(){return this.grammarSource}get hidden(){return!1}get astNode(){var e,n;const r=typeof((e=this._astNode)===null||e===void 0?void 0:e.$type)=="string"?this._astNode:(n=this.container)===null||n===void 0?void 0:n.astNode;if(!r)throw new Error("This node has no associated AST element");return r}set astNode(e){this._astNode=e}get element(){return this.astNode}get text(){return this.root.fullText.substring(this.offset,this.end)}}class Ly extends CS{get offset(){return this._offset}get length(){return this._length}get end(){return this._offset+this._length}get hidden(){return this._hidden}get tokenType(){return this._tokenType}get range(){return this._range}constructor(e,n,r,i,s=!1){super(),this._hidden=s,this._offset=e,this._tokenType=i,this._length=n,this._range=r}}class My extends CS{constructor(){super(...arguments),this.content=new O0(this)}get children(){return this.content}get offset(){var e,n;return(n=(e=this.firstNonHiddenNode)===null||e===void 0?void 0:e.offset)!==null&&n!==void 0?n:0}get length(){return this.end-this.offset}get end(){var e,n;return(n=(e=this.lastNonHiddenNode)===null||e===void 0?void 0:e.end)!==null&&n!==void 0?n:0}get range(){const e=this.firstNonHiddenNode,n=this.lastNonHiddenNode;if(e&&n){if(this._rangeCache===void 0){const{range:r}=e,{range:i}=n;this._rangeCache={start:r.start,end:i.end.line<r.start.line?r.start:i.end}}return this._rangeCache}else return{start:He.create(0,0),end:He.create(0,0)}}get firstNonHiddenNode(){for(const e of this.content)if(!e.hidden)return e;return this.content[0]}get lastNonHiddenNode(){for(let e=this.content.length-1;e>=0;e--){const n=this.content[e];if(!n.hidden)return n}return this.content[this.content.length-1]}}class O0 extends Array{constructor(e){super(),this.parent=e,Object.setPrototypeOf(this,O0.prototype)}push(...e){return this.addParents(e),super.push(...e)}unshift(...e){return this.addParents(e),super.unshift(...e)}splice(e,n,...r){return this.addParents(r),super.splice(e,n,...r)}addParents(e){for(const n of e)n.container=this.parent}}class _S extends My{get text(){return this._text.substring(this.offset,this.end)}get fullText(){return this._text}constructor(e){super(),this._text="",this._text=e??""}}const zy=Symbol("Datatype");function By(t){return t.$type===zy}const AS="\u200B",xS=t=>t.endsWith(AS)?t:t+AS;class IS{constructor(e){this._unorderedGroups=new Map,this.allRules=new Map,this.lexer=e.parser.Lexer;const n=this.lexer.definition;this.wrapper=new hj(n,Object.assign(Object.assign({},e.parser.ParserConfig),{errorMessageProvider:e.parser.ParserErrorMessageProvider}))}alternatives(e,n){this.wrapper.wrapOr(e,n)}optional(e,n){this.wrapper.wrapOption(e,n)}many(e,n){this.wrapper.wrapMany(e,n)}atLeastOne(e,n){this.wrapper.wrapAtLeastOne(e,n)}getRule(e){return this.allRules.get(e)}isRecording(){return this.wrapper.IS_RECORDING}get unorderedGroups(){return this._unorderedGroups}getRuleStack(){return this.wrapper.RULE_STACK}finalize(){this.wrapper.wrapSelfAnalysis()}}class uj extends IS{get current(){return this.stack[this.stack.length-1]}constructor(e){super(e),this.nodeBuilder=new cj,this.stack=[],this.assignmentMap=new Map,this.linker=e.references.Linker,this.converter=e.parser.ValueConverter,this.astReflection=e.shared.AstReflection}rule(e,n){const r=this.computeRuleType(e),i=this.wrapper.DEFINE_RULE(xS(e.name),this.startImplementation(r,n).bind(this));return this.allRules.set(e.name,i),e.entry&&(this.mainRule=i),i}computeRuleType(e){if(!e.fragment){if(Zd(e))return zy;{const n=_s(e);return n??e.name}}}parse(e,n={}){this.nodeBuilder.buildRootNode(e);const r=this.lexer.tokenize(e);this.wrapper.input=r.tokens;const i=n.rule?this.allRules.get(n.rule):this.mainRule;if(!i)throw new Error(n.rule?`No rule found with name '${n.rule}'`:"No main rule available.");const s=i.call(this.wrapper,{});return this.nodeBuilder.addHiddenTokens(r.hidden),this.unorderedGroups.clear(),{value:s,lexerErrors:r.errors,lexerReport:r.report,parserErrors:this.wrapper.errors}}startImplementation(e,n){return r=>{if(!this.isRecording()){const s={$type:e};this.stack.push(s),e===zy&&(s.value="")}let i;try{i=n(r)}catch{i=void 0}return!this.isRecording()&&i===void 0&&(i=this.construct()),i}}consume(e,n,r){const i=this.wrapper.wrapConsume(e,n);if(!this.isRecording()&&this.isValidToken(i)){const s=this.nodeBuilder.buildLeafNode(i,r),{assignment:o,isCrossRef:a}=this.getAssignment(r),c=this.current;if(o){const u=Ir(r)?i.image:this.converter.convert(i.image,s);this.assign(o.operator,o.feature,u,s,a)}else if(By(c)){let u=i.image;Ir(r)||(u=this.converter.convert(u,s).toString()),c.value+=u}}}isValidToken(e){return!e.isInsertedInRecovery&&!isNaN(e.startOffset)&&typeof e.endOffset=="number"&&!isNaN(e.endOffset)}subrule(e,n,r,i){let s;this.isRecording()||(s=this.nodeBuilder.buildCompositeNode(r));const o=this.wrapper.wrapSubrule(e,n,i);!this.isRecording()&&s&&s.length>0&&this.performSubruleAssignment(o,r,s)}performSubruleAssignment(e,n,r){const{assignment:i,isCrossRef:s}=this.getAssignment(n);if(i)this.assign(i.operator,i.feature,e,r,s);else if(!i){const o=this.current;if(By(o))o.value+=e.toString();else if(typeof e=="object"&&e){const a=e.$type,c=this.assignWithoutOverride(e,o);a&&(c.$type=a);const u=c;this.stack.pop(),this.stack.push(u)}}}action(e,n){if(!this.isRecording()){let r=this.current;if(n.feature&&n.operator){r=this.construct(),this.nodeBuilder.buildCompositeNode(n).content.push(r.$cstNode);const s={$type:e};this.stack.push(s),this.assign(n.operator,n.feature,r,r.$cstNode,!1)}else r.$type=e}}construct(){if(this.isRecording())return;const e=this.current;return fm(e),this.nodeBuilder.construct(e),this.stack.pop(),By(e)?this.converter.convert(e.value,e.$cstNode):(pm(this.astReflection,e),e)}getAssignment(e){if(!this.assignmentMap.has(e)){const n=wn(e,xr);this.assignmentMap.set(e,{assignment:n,isCrossRef:n?fc(n.terminal):!1})}return this.assignmentMap.get(e)}assign(e,n,r,i,s){const o=this.current;let a;switch(s&&typeof r=="string"?a=this.linker.buildReference(o,n,i,r):a=r,e){case"=":{o[n]=a;break}case"?=":{o[n]=!0;break}case"+=":Array.isArray(o[n])||(o[n]=[]),o[n].push(a)}}assignWithoutOverride(e,n){for(const[i,s]of Object.entries(n)){const o=e[i];o===void 0?e[i]=s:Array.isArray(o)&&Array.isArray(s)&&(s.push(...o),e[i]=s)}const r=e.$cstNode;return r&&(r.astNode=void 0,e.$cstNode=void 0),e}get definitionErrors(){return this.wrapper.definitionErrors}}class lj{buildMismatchTokenMessage(e){return Jo.buildMismatchTokenMessage(e)}buildNotAllInputParsedMessage(e){return Jo.buildNotAllInputParsedMessage(e)}buildNoViableAltMessage(e){return Jo.buildNoViableAltMessage(e)}buildEarlyExitMessage(e){return Jo.buildEarlyExitMessage(e)}}class PS extends lj{buildMismatchTokenMessage({expected:e,actual:n}){return`Expecting ${e.LABEL?"`"+e.LABEL+"`":e.name.endsWith(":KW")?`keyword '${e.name.substring(0,e.name.length-3)}'`:`token of type '${e.name}'`} but found \`${n.image}\`.`}buildNotAllInputParsedMessage({firstRedundant:e}){return`Expecting end of file but found \`${e.image}\`.`}}class dj extends IS{constructor(){super(...arguments),this.tokens=[],this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}action(){}construct(){}parse(e){this.resetState();const n=this.lexer.tokenize(e,{mode:"partial"});return this.tokens=n.tokens,this.wrapper.input=[...this.tokens],this.mainRule.call(this.wrapper,{}),this.unorderedGroups.clear(),{tokens:this.tokens,elementStack:[...this.lastElementStack],tokenIndex:this.nextTokenIndex}}rule(e,n){const r=this.wrapper.DEFINE_RULE(xS(e.name),this.startImplementation(n).bind(this));return this.allRules.set(e.name,r),e.entry&&(this.mainRule=r),r}resetState(){this.elementStack=[],this.lastElementStack=[],this.nextTokenIndex=0,this.stackSize=0}startImplementation(e){return n=>{const r=this.keepStackSize();try{e(n)}finally{this.resetStackSize(r)}}}removeUnexpectedElements(){this.elementStack.splice(this.stackSize)}keepStackSize(){const e=this.elementStack.length;return this.stackSize=e,e}resetStackSize(e){this.removeUnexpectedElements(),this.stackSize=e}consume(e,n,r){this.wrapper.wrapConsume(e,n),this.isRecording()||(this.lastElementStack=[...this.elementStack,r],this.nextTokenIndex=this.currIdx+1)}subrule(e,n,r,i){this.before(r),this.wrapper.wrapSubrule(e,n,i),this.after(r)}before(e){this.isRecording()||this.elementStack.push(e)}after(e){if(!this.isRecording()){const n=this.elementStack.lastIndexOf(e);n>=0&&this.elementStack.splice(n)}}get currIdx(){return this.wrapper.currIdx}}const fj={recoveryEnabled:!0,nodeLocationTracking:"full",skipValidations:!0,errorMessageProvider:new PS};class hj extends bq{constructor(e,n){const r=n&&"maxLookahead"in n;super(e,Object.assign(Object.assign(Object.assign({},fj),{lookaheadStrategy:r?new gy({maxLookahead:n.maxLookahead}):new qq}),n))}get IS_RECORDING(){return this.RECORDING_PHASE}DEFINE_RULE(e,n){return this.RULE(e,n)}wrapSelfAnalysis(){this.performSelfAnalysis()}wrapConsume(e,n){return this.consume(e,n)}wrapSubrule(e,n,r){return this.subrule(e,n,{ARGS:[r]})}wrapOr(e,n){this.or(e,n)}wrapOption(e,n){this.option(e,n)}wrapMany(e,n){this.many(e,n)}wrapAtLeastOne(e,n){this.atLeastOne(e,n)}}function NS(t,e,n){return pj({parser:e,tokens:n,ruleNames:new Map},t),e}function pj(t,e){const n=wm(e,!1),r=Qe(e.rules).filter(Xt).filter(i=>n.has(i));for(const i of r){const s=Object.assign(Object.assign({},t),{consume:1,optional:1,subrule:1,many:1,or:1});t.parser.rule(i,Ms(s,i.definition))}}function Ms(t,e,n=!1){let r;if(Ir(e))r=Ej(t,e);else if(Cs(e))r=gj(t,e);else if(xr(e))r=Ms(t,e.terminal);else if(fc(e))r=OS(t,e);else if(oi(e))r=mj(t,e);else if(lm(e))r=vj(t,e);else if(dm(e))r=wj(t,e);else if(Li(e))r=bj(t,e);else if(cM(e)){const i=t.consume++;r=()=>t.parser.consume(i,qi,e)}else throw new MD(e.$cstNode,`Unexpected element type: ${e.$type}`);return FS(t,n?void 0:Wf(e),r,e.cardinality)}function gj(t,e){const n=_c(e);return()=>t.parser.action(n,e)}function mj(t,e){const n=e.rule.ref;if(Xt(n)){const r=t.subrule++,i=e.arguments.length>0?yj(n,e.arguments):()=>({});return s=>t.parser.subrule(r,LS(t,n),e,i(s))}else if(si(n)){const r=t.consume++,i=qy(t,n.name);return()=>t.parser.consume(r,i,e)}else if(n)Nd();else throw new MD(e.$cstNode,`Undefined rule type: ${e.$type}`)}function yj(t,e){const n=e.map(r=>mi(r.value));return r=>{const i={};for(let s=0;s<n.length;s++){const o=t.parameters[s],a=n[s];i[o.name]=a(r)}return i}}function mi(t){if(tM(t)){const e=mi(t.left),n=mi(t.right);return r=>e(r)||n(r)}else if(eM(t)){const e=mi(t.left),n=mi(t.right);return r=>e(r)&&n(r)}else if(nM(t)){const e=mi(t.value);return n=>!e(n)}else if(rM(t)){const e=t.parameter.ref.name;return n=>n!==void 0&&n[e]===!0}else if(QL(t)){const e=!!t.true;return()=>e}Nd()}function vj(t,e){if(e.elements.length===1)return Ms(t,e.elements[0]);{const n=[];for(const i of e.elements){const s={ALT:Ms(t,i,!0)},o=Wf(i);o&&(s.GATE=mi(o)),n.push(s)}const r=t.or++;return i=>t.parser.alternatives(r,n.map(s=>{const o={ALT:()=>s.ALT(i)},a=s.GATE;return a&&(o.GATE=()=>a(i)),o}))}}function wj(t,e){if(e.elements.length===1)return Ms(t,e.elements[0]);const n=[];for(const a of e.elements){const c={ALT:Ms(t,a,!0)},u=Wf(a);u&&(c.GATE=mi(u)),n.push(c)}const r=t.or++,i=(a,c)=>{const u=c.getRuleStack().join("-");return`uGroup_${a}_${u}`},s=a=>t.parser.alternatives(r,n.map((c,u)=>{const l={ALT:()=>!0},d=t.parser;l.ALT=()=>{if(c.ALT(a),!d.isRecording()){const h=i(r,d);d.unorderedGroups.get(h)||d.unorderedGroups.set(h,[]);const p=d.unorderedGroups.get(h);typeof p?.[u]>"u"&&(p[u]=!0)}};const f=c.GATE;return f?l.GATE=()=>f(a):l.GATE=()=>{const h=d.unorderedGroups.get(i(r,d));return!h?.[u]},l})),o=FS(t,Wf(e),s,"*");return a=>{o(a),t.parser.isRecording()||t.parser.unorderedGroups.delete(i(r,t.parser))}}function bj(t,e){const n=e.elements.map(r=>Ms(t,r));return r=>n.forEach(i=>i(r))}function Wf(t){if(Li(t))return t.guardCondition}function OS(t,e,n=e.terminal){if(n)if(oi(n)&&Xt(n.rule.ref)){const r=t.subrule++;return i=>t.parser.subrule(r,LS(t,n.rule.ref),e,i)}else if(oi(n)&&si(n.rule.ref)){const r=t.consume++,i=qy(t,n.rule.ref.name);return()=>t.parser.consume(r,i,e)}else if(Ir(n)){const r=t.consume++,i=qy(t,n.value);return()=>t.parser.consume(r,i,e)}else throw new Error("Could not build cross reference parser");else{if(!e.type.ref)throw new Error("Could not resolve reference to type: "+e.type.$refText);const r=Rm(e.type.ref),i=r?.terminal;if(!i)throw new Error("Could not find name assignment for type: "+_c(e.type.ref));return OS(t,e,i)}}function Ej(t,e){const n=t.consume++,r=t.tokens[e.value];if(!r)throw new Error("Could not find token for keyword: "+e.value);return()=>t.parser.consume(n,r,e)}function FS(t,e,n,r){const i=e&&mi(e);if(!r)if(i){const s=t.or++;return o=>t.parser.alternatives(s,[{ALT:()=>n(o),GATE:()=>i(o)},{ALT:v1(),GATE:()=>!i(o)}])}else return n;if(r==="*"){const s=t.many++;return o=>t.parser.many(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else if(r==="+"){const s=t.many++;if(i){const o=t.or++;return a=>t.parser.alternatives(o,[{ALT:()=>t.parser.atLeastOne(s,{DEF:()=>n(a)}),GATE:()=>i(a)},{ALT:v1(),GATE:()=>!i(a)}])}else return o=>t.parser.atLeastOne(s,{DEF:()=>n(o)})}else if(r==="?"){const s=t.optional++;return o=>t.parser.optional(s,{DEF:()=>n(o),GATE:i?()=>i(o):void 0})}else Nd()}function LS(t,e){const n=Dj(t,e),r=t.parser.getRule(n);if(!r)throw new Error(`Rule "${n}" not found."`);return r}function Dj(t,e){if(Xt(e))return e.name;if(t.ruleNames.has(e))return t.ruleNames.get(e);{let n=e,r=n.$container,i=e.$type;for(;!Xt(r);)(Li(r)||lm(r)||dm(r))&&(i=r.elements.indexOf(n).toString()+":"+i),n=r,r=r.$container;return i=r.name+":"+i,t.ruleNames.set(e,i),i}}function qy(t,e){const n=t.tokens[e];if(!n)throw new Error(`Token "${e}" not found."`);return n}function Tj(t){const e=t.Grammar,n=t.parser.Lexer,r=new dj(t);return NS(e,r,n.definition),r.finalize(),r}function Rj(t){const e=Sj(t);return e.finalize(),e}function Sj(t){const e=t.Grammar,n=t.parser.Lexer,r=new uj(t);return NS(e,r,n.definition)}class kj{constructor(){this.diagnostics=[]}buildTokens(e,n){const r=Qe(wm(e,!1)),i=this.buildTerminalTokens(r),s=this.buildKeywordTokens(r,i,n);return i.forEach(o=>{const a=o.PATTERN;typeof a=="object"&&a&&"test"in a&&vm(a)?s.unshift(o):s.push(o)}),s}flushLexingReport(e){return{diagnostics:this.popDiagnostics()}}popDiagnostics(){const e=[...this.diagnostics];return this.diagnostics=[],e}buildTerminalTokens(e){return e.filter(si).filter(n=>!n.fragment).map(n=>this.buildTerminalToken(n)).toArray()}buildTerminalToken(e){const n=Ac(e),r=this.requiresCustomPattern(n)?this.regexPatternFunction(n):n,i={name:e.name,PATTERN:r,LINE_BREAKS:!0};return e.hidden&&(i.GROUP=vm(n)?Rn.SKIPPED:"hidden"),i}requiresCustomPattern(e){return e.flags.includes("u")||e.flags.includes("s")?!0:!!(e.source.includes("?<=")||e.source.includes("?<!"))}regexPatternFunction(e){const n=new RegExp(e,e.flags+"y");return(r,i)=>(n.lastIndex=i,n.exec(r))}buildKeywordTokens(e,n,r){return e.filter(Xt).flatMap(i=>Pr(i).filter(Ir)).distinct(i=>i.value).toArray().sort((i,s)=>s.value.length-i.value.length).map(i=>this.buildKeywordToken(i,n,!!r?.caseInsensitive))}buildKeywordToken(e,n,r){return{name:e.value,PATTERN:this.buildKeywordPattern(e,r),LONGER_ALT:this.findLongerAlt(e,n)}}buildKeywordPattern(e,n){return n?new RegExp(TM(e.value)):e.value}findLongerAlt(e,n){return n.reduce((r,i)=>{const s=i?.PATTERN;return s?.source&&RM("^"+s.source+"$",e.value)&&r.push(i),r},[])}}class $j{convert(e,n){let r=n.grammarSource;if(fc(r)&&(r=bm(r)),oi(r)){const i=r.rule.ref;if(!i)throw new Error("This cst node was not parsed by a rule.");return this.runConverter(i,e,n)}return e}runConverter(e,n,r){var i;switch(e.name.toUpperCase()){case"INT":return yi.convertInt(n);case"STRING":return yi.convertString(n);case"ID":return yi.convertID(n)}switch((i=sT(e))===null||i===void 0?void 0:i.toLowerCase()){case"number":return yi.convertNumber(n);case"boolean":return yi.convertBoolean(n);case"bigint":return yi.convertBigint(n);case"date":return yi.convertDate(n);default:return n}}}var yi;(function(t){function e(u){let l="";for(let d=1;d<u.length-1;d++){const f=u.charAt(d);if(f==="\\"){const h=u.charAt(++d);l+=n(h)}else l+=f}return l}t.convertString=e;function n(u){switch(u){case"b":return"\b";case"f":return"\f";case"n":return`
117
+ `;case"r":return"\r";case"t":return" ";case"v":return"\v";case"0":return"\0";default:return u}}function r(u){return u.charAt(0)==="^"?u.substring(1):u}t.convertID=r;function i(u){return parseInt(u)}t.convertInt=i;function s(u){return BigInt(u)}t.convertBigint=s;function o(u){return new Date(u)}t.convertDate=o;function a(u){return Number(u)}t.convertNumber=a;function c(u){return u.toLowerCase()==="true"}t.convertBoolean=c})(yi||(yi={}));var zs={},Hf={},MS;function Bs(){if(MS)return Hf;MS=1,Object.defineProperty(Hf,"__esModule",{value:!0});let t;function e(){if(t===void 0)throw new Error("No runtime abstraction layer installed");return t}return function(n){function r(i){if(i===void 0)throw new Error("No runtime abstraction layer provided");t=i}n.install=r}(e||(e={})),Hf.default=e,Hf}var Wt={},zS;function Zc(){if(zS)return Wt;zS=1,Object.defineProperty(Wt,"__esModule",{value:!0}),Wt.stringArray=Wt.array=Wt.func=Wt.error=Wt.number=Wt.string=Wt.boolean=void 0;function t(a){return a===!0||a===!1}Wt.boolean=t;function e(a){return typeof a=="string"||a instanceof String}Wt.string=e;function n(a){return typeof a=="number"||a instanceof Number}Wt.number=n;function r(a){return a instanceof Error}Wt.error=r;function i(a){return typeof a=="function"}Wt.func=i;function s(a){return Array.isArray(a)}Wt.array=s;function o(a){return s(a)&&a.every(c=>e(c))}return Wt.stringArray=o,Wt}var qs={},BS;function na(){if(BS)return qs;BS=1,Object.defineProperty(qs,"__esModule",{value:!0}),qs.Emitter=qs.Event=void 0;const t=Bs();var e;(function(i){const s={dispose(){}};i.None=function(){return s}})(e||(qs.Event=e={}));class n{add(s,o=null,a){this._callbacks||(this._callbacks=[],this._contexts=[]),this._callbacks.push(s),this._contexts.push(o),Array.isArray(a)&&a.push({dispose:()=>this.remove(s,o)})}remove(s,o=null){if(!this._callbacks)return;let a=!1;for(let c=0,u=this._callbacks.length;c<u;c++)if(this._callbacks[c]===s)if(this._contexts[c]===o){this._callbacks.splice(c,1),this._contexts.splice(c,1);return}else a=!0;if(a)throw new Error("When adding a listener with a context, you should remove it with the same context")}invoke(...s){if(!this._callbacks)return[];const o=[],a=this._callbacks.slice(0),c=this._contexts.slice(0);for(let u=0,l=a.length;u<l;u++)try{o.push(a[u].apply(c[u],s))}catch(d){(0,t.default)().console.error(d)}return o}isEmpty(){return!this._callbacks||this._callbacks.length===0}dispose(){this._callbacks=void 0,this._contexts=void 0}}class r{constructor(s){this._options=s}get event(){return this._event||(this._event=(s,o,a)=>{this._callbacks||(this._callbacks=new n),this._options&&this._options.onFirstListenerAdd&&this._callbacks.isEmpty()&&this._options.onFirstListenerAdd(this),this._callbacks.add(s,o);const c={dispose:()=>{this._callbacks&&(this._callbacks.remove(s,o),c.dispose=r._noop,this._options&&this._options.onLastListenerRemove&&this._callbacks.isEmpty()&&this._options.onLastListenerRemove(this))}};return Array.isArray(a)&&a.push(c),c}),this._event}fire(s){this._callbacks&&this._callbacks.invoke.call(this._callbacks,s)}dispose(){this._callbacks&&(this._callbacks.dispose(),this._callbacks=void 0)}}return qs.Emitter=r,r._noop=function(){},qs}var qS;function Vf(){if(qS)return zs;qS=1,Object.defineProperty(zs,"__esModule",{value:!0}),zs.CancellationTokenSource=zs.CancellationToken=void 0;const t=Bs(),e=Zc(),n=na();var r;(function(a){a.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:n.Event.None}),a.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:n.Event.None});function c(u){const l=u;return l&&(l===a.None||l===a.Cancelled||e.boolean(l.isCancellationRequested)&&!!l.onCancellationRequested)}a.is=c})(r||(zs.CancellationToken=r={}));const i=Object.freeze(function(a,c){const u=(0,t.default)().timer.setTimeout(a.bind(c),0);return{dispose(){u.dispose()}}});class s{constructor(){this._isCancelled=!1}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?i:(this._emitter||(this._emitter=new n.Emitter),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=void 0)}}class o{get token(){return this._token||(this._token=new s),this._token}cancel(){this._token?this._token.cancel():this._token=r.Cancelled}dispose(){this._token?this._token instanceof s&&this._token.dispose():this._token=r.None}}return zs.CancellationTokenSource=o,zs}var ct=Vf();function Cj(){return new Promise(t=>{typeof setImmediate>"u"?setTimeout(t,0):setImmediate(t)})}let jS=0,_j=10;const Kf=Symbol("OperationCancelled");function Yf(t){return t===Kf}async function zt(t){if(t===ct.CancellationToken.None)return;const e=Date.now();if(e-jS>=_j&&(jS=e,await Cj()),t.isCancellationRequested)throw Kf}class jy{constructor(){this.promise=new Promise((e,n)=>{this.resolve=r=>(e(r),this),this.reject=r=>(n(r),this)})}}class ud{constructor(e,n,r,i){this._uri=e,this._languageId=n,this._version=r,this._content=i,this._lineOffsets=void 0}get uri(){return this._uri}get languageId(){return this._languageId}get version(){return this._version}getText(e){if(e){const n=this.offsetAt(e.start),r=this.offsetAt(e.end);return this._content.substring(n,r)}return this._content}update(e,n){for(let r of e)if(ud.isIncremental(r)){const i=GS(r.range),s=this.offsetAt(i.start),o=this.offsetAt(i.end);this._content=this._content.substring(0,s)+r.text+this._content.substring(o,this._content.length);const a=Math.max(i.start.line,0),c=Math.max(i.end.line,0);let u=this._lineOffsets;const l=US(r.text,!1,s);if(c-a===l.length)for(let f=0,h=l.length;f<h;f++)u[f+a+1]=l[f];else l.length<1e4?u.splice(a+1,c-a,...l):this._lineOffsets=u=u.slice(0,a+1).concat(l,u.slice(c+1));const d=r.text.length-(o-s);if(d!==0)for(let f=a+1+l.length,h=u.length;f<h;f++)u[f]=u[f]+d}else if(ud.isFull(r))this._content=r.text,this._lineOffsets=void 0;else throw new Error("Unknown change event received");this._version=n}getLineOffsets(){return this._lineOffsets===void 0&&(this._lineOffsets=US(this._content,!0)),this._lineOffsets}positionAt(e){e=Math.max(Math.min(e,this._content.length),0);let n=this.getLineOffsets(),r=0,i=n.length;if(i===0)return{line:0,character:e};for(;r<i;){let o=Math.floor((r+i)/2);n[o]>e?i=o:r=o+1}let s=r-1;return{line:s,character:e-n[s]}}offsetAt(e){let n=this.getLineOffsets();if(e.line>=n.length)return this._content.length;if(e.line<0)return 0;let r=n[e.line],i=e.line+1<n.length?n[e.line+1]:this._content.length;return Math.max(Math.min(r+e.character,i),r)}get lineCount(){return this.getLineOffsets().length}static isIncremental(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range!==void 0&&(n.rangeLength===void 0||typeof n.rangeLength=="number")}static isFull(e){let n=e;return n!=null&&typeof n.text=="string"&&n.range===void 0&&n.rangeLength===void 0}}var Xf;(function(t){function e(i,s,o,a){return new ud(i,s,o,a)}t.create=e;function n(i,s,o){if(i instanceof ud)return i.update(s,o),i;throw new Error("TextDocument.update: document must be created by TextDocument.create")}t.update=n;function r(i,s){let o=i.getText(),a=Uy(s.map(Aj),(l,d)=>{let f=l.range.start.line-d.range.start.line;return f===0?l.range.start.character-d.range.start.character:f}),c=0;const u=[];for(const l of a){let d=i.offsetAt(l.range.start);if(d<c)throw new Error("Overlapping edit");d>c&&u.push(o.substring(c,d)),l.newText.length&&u.push(l.newText),c=i.offsetAt(l.range.end)}return u.push(o.substr(c)),u.join("")}t.applyEdits=r})(Xf||(Xf={}));function Uy(t,e){if(t.length<=1)return t;const n=t.length/2|0,r=t.slice(0,n),i=t.slice(n);Uy(r,e),Uy(i,e);let s=0,o=0,a=0;for(;s<r.length&&o<i.length;)e(r[s],i[o])<=0?t[a++]=r[s++]:t[a++]=i[o++];for(;s<r.length;)t[a++]=r[s++];for(;o<i.length;)t[a++]=i[o++];return t}function US(t,e,n=0){const r=e?[n]:[];for(let i=0;i<t.length;i++){let s=t.charCodeAt(i);(s===13||s===10)&&(s===13&&i+1<t.length&&t.charCodeAt(i+1)===10&&i++,r.push(n+i+1))}return r}function GS(t){const e=t.start,n=t.end;return e.line>n.line||e.line===n.line&&e.character>n.character?{start:n,end:e}:t}function Aj(t){const e=GS(t.range);return e!==t.range?{newText:t.newText,range:e}:t}var WS;(()=>{var t={470:i=>{function s(c){if(typeof c!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(c))}function o(c,u){for(var l,d="",f=0,h=-1,p=0,g=0;g<=c.length;++g){if(g<c.length)l=c.charCodeAt(g);else{if(l===47)break;l=47}if(l===47){if(!(h===g-1||p===1))if(h!==g-1&&p===2){if(d.length<2||f!==2||d.charCodeAt(d.length-1)!==46||d.charCodeAt(d.length-2)!==46){if(d.length>2){var y=d.lastIndexOf("/");if(y!==d.length-1){y===-1?(d="",f=0):f=(d=d.slice(0,y)).length-1-d.lastIndexOf("/"),h=g,p=0;continue}}else if(d.length===2||d.length===1){d="",f=0,h=g,p=0;continue}}u&&(d.length>0?d+="/..":d="..",f=2)}else d.length>0?d+="/"+c.slice(h+1,g):d=c.slice(h+1,g),f=g-h-1;h=g,p=0}else l===46&&p!==-1?++p:p=-1}return d}var a={resolve:function(){for(var c,u="",l=!1,d=arguments.length-1;d>=-1&&!l;d--){var f;d>=0?f=arguments[d]:(c===void 0&&(c=process.cwd()),f=c),s(f),f.length!==0&&(u=f+"/"+u,l=f.charCodeAt(0)===47)}return u=o(u,!l),l?u.length>0?"/"+u:"/":u.length>0?u:"."},normalize:function(c){if(s(c),c.length===0)return".";var u=c.charCodeAt(0)===47,l=c.charCodeAt(c.length-1)===47;return(c=o(c,!u)).length!==0||u||(c="."),c.length>0&&l&&(c+="/"),u?"/"+c:c},isAbsolute:function(c){return s(c),c.length>0&&c.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var c,u=0;u<arguments.length;++u){var l=arguments[u];s(l),l.length>0&&(c===void 0?c=l:c+="/"+l)}return c===void 0?".":a.normalize(c)},relative:function(c,u){if(s(c),s(u),c===u||(c=a.resolve(c))===(u=a.resolve(u)))return"";for(var l=1;l<c.length&&c.charCodeAt(l)===47;++l);for(var d=c.length,f=d-l,h=1;h<u.length&&u.charCodeAt(h)===47;++h);for(var p=u.length-h,g=f<p?f:p,y=-1,m=0;m<=g;++m){if(m===g){if(p>g){if(u.charCodeAt(h+m)===47)return u.slice(h+m+1);if(m===0)return u.slice(h+m)}else f>g&&(c.charCodeAt(l+m)===47?y=m:m===0&&(y=0));break}var w=c.charCodeAt(l+m);if(w!==u.charCodeAt(h+m))break;w===47&&(y=m)}var E="";for(m=l+y+1;m<=d;++m)m!==d&&c.charCodeAt(m)!==47||(E.length===0?E+="..":E+="/..");return E.length>0?E+u.slice(h+y):(h+=y,u.charCodeAt(h)===47&&++h,u.slice(h))},_makeLong:function(c){return c},dirname:function(c){if(s(c),c.length===0)return".";for(var u=c.charCodeAt(0),l=u===47,d=-1,f=!0,h=c.length-1;h>=1;--h)if((u=c.charCodeAt(h))===47){if(!f){d=h;break}}else f=!1;return d===-1?l?"/":".":l&&d===1?"//":c.slice(0,d)},basename:function(c,u){if(u!==void 0&&typeof u!="string")throw new TypeError('"ext" argument must be a string');s(c);var l,d=0,f=-1,h=!0;if(u!==void 0&&u.length>0&&u.length<=c.length){if(u.length===c.length&&u===c)return"";var p=u.length-1,g=-1;for(l=c.length-1;l>=0;--l){var y=c.charCodeAt(l);if(y===47){if(!h){d=l+1;break}}else g===-1&&(h=!1,g=l+1),p>=0&&(y===u.charCodeAt(p)?--p==-1&&(f=l):(p=-1,f=g))}return d===f?f=g:f===-1&&(f=c.length),c.slice(d,f)}for(l=c.length-1;l>=0;--l)if(c.charCodeAt(l)===47){if(!h){d=l+1;break}}else f===-1&&(h=!1,f=l+1);return f===-1?"":c.slice(d,f)},extname:function(c){s(c);for(var u=-1,l=0,d=-1,f=!0,h=0,p=c.length-1;p>=0;--p){var g=c.charCodeAt(p);if(g!==47)d===-1&&(f=!1,d=p+1),g===46?u===-1?u=p:h!==1&&(h=1):u!==-1&&(h=-1);else if(!f){l=p+1;break}}return u===-1||d===-1||h===0||h===1&&u===d-1&&u===l+1?"":c.slice(u,d)},format:function(c){if(c===null||typeof c!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof c);return function(u,l){var d=l.dir||l.root,f=l.base||(l.name||"")+(l.ext||"");return d?d===l.root?d+f:d+"/"+f:f}(0,c)},parse:function(c){s(c);var u={root:"",dir:"",base:"",ext:"",name:""};if(c.length===0)return u;var l,d=c.charCodeAt(0),f=d===47;f?(u.root="/",l=1):l=0;for(var h=-1,p=0,g=-1,y=!0,m=c.length-1,w=0;m>=l;--m)if((d=c.charCodeAt(m))!==47)g===-1&&(y=!1,g=m+1),d===46?h===-1?h=m:w!==1&&(w=1):h!==-1&&(w=-1);else if(!y){p=m+1;break}return h===-1||g===-1||w===0||w===1&&h===g-1&&h===p+1?g!==-1&&(u.base=u.name=p===0&&f?c.slice(1,g):c.slice(p,g)):(p===0&&f?(u.name=c.slice(1,h),u.base=c.slice(1,g)):(u.name=c.slice(p,h),u.base=c.slice(p,g)),u.ext=c.slice(h,g)),p>0?u.dir=c.slice(0,p-1):f&&(u.dir="/"),u},sep:"/",delimiter:":",win32:null,posix:null};a.posix=a,i.exports=a}},e={};function n(i){var s=e[i];if(s!==void 0)return s.exports;var o=e[i]={exports:{}};return t[i](o,o.exports,n),o.exports}n.d=(i,s)=>{for(var o in s)n.o(s,o)&&!n.o(i,o)&&Object.defineProperty(i,o,{enumerable:!0,get:s[o]})},n.o=(i,s)=>Object.prototype.hasOwnProperty.call(i,s),n.r=i=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})};var r={};(()=>{let i;n.r(r),n.d(r,{URI:()=>f,Utils:()=>O}),typeof process=="object"?i=process.platform==="win32":typeof navigator=="object"&&(i=navigator.userAgent.indexOf("Windows")>=0);const s=/^\w[\w\d+.-]*$/,o=/^\//,a=/^\/\//;function c(C,D){if(!C.scheme&&D)throw new Error(`[UriError]: Scheme is missing: {scheme: "", authority: "${C.authority}", path: "${C.path}", query: "${C.query}", fragment: "${C.fragment}"}`);if(C.scheme&&!s.test(C.scheme))throw new Error("[UriError]: Scheme contains illegal characters.");if(C.path){if(C.authority){if(!o.test(C.path))throw new Error('[UriError]: If a URI contains an authority component, then the path component must either be empty or begin with a slash ("/") character')}else if(a.test(C.path))throw new Error('[UriError]: If a URI does not contain an authority component, then the path cannot begin with two slash characters ("//")')}}const u="",l="/",d=/^(([^:/?#]+?):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?/;class f{static isUri(D){return D instanceof f||!!D&&typeof D.authority=="string"&&typeof D.fragment=="string"&&typeof D.path=="string"&&typeof D.query=="string"&&typeof D.scheme=="string"&&typeof D.fsPath=="string"&&typeof D.with=="function"&&typeof D.toString=="function"}scheme;authority;path;query;fragment;constructor(D,R,L,W,V,Z=!1){typeof D=="object"?(this.scheme=D.scheme||u,this.authority=D.authority||u,this.path=D.path||u,this.query=D.query||u,this.fragment=D.fragment||u):(this.scheme=function(Fe,se){return Fe||se?Fe:"file"}(D,Z),this.authority=R||u,this.path=function(Fe,se){switch(Fe){case"https":case"http":case"file":se?se[0]!==l&&(se=l+se):se=l}return se}(this.scheme,L||u),this.query=W||u,this.fragment=V||u,c(this,Z))}get fsPath(){return w(this)}with(D){if(!D)return this;let{scheme:R,authority:L,path:W,query:V,fragment:Z}=D;return R===void 0?R=this.scheme:R===null&&(R=u),L===void 0?L=this.authority:L===null&&(L=u),W===void 0?W=this.path:W===null&&(W=u),V===void 0?V=this.query:V===null&&(V=u),Z===void 0?Z=this.fragment:Z===null&&(Z=u),R===this.scheme&&L===this.authority&&W===this.path&&V===this.query&&Z===this.fragment?this:new p(R,L,W,V,Z)}static parse(D,R=!1){const L=d.exec(D);return L?new p(L[2]||u,I(L[4]||u),I(L[5]||u),I(L[7]||u),I(L[9]||u),R):new p(u,u,u,u,u)}static file(D){let R=u;if(i&&(D=D.replace(/\\/g,l)),D[0]===l&&D[1]===l){const L=D.indexOf(l,2);L===-1?(R=D.substring(2),D=l):(R=D.substring(2,L),D=D.substring(L)||l)}return new p("file",R,D,u,u)}static from(D){const R=new p(D.scheme,D.authority,D.path,D.query,D.fragment);return c(R,!0),R}toString(D=!1){return E(this,D)}toJSON(){return this}static revive(D){if(D){if(D instanceof f)return D;{const R=new p(D);return R._formatted=D.external,R._fsPath=D._sep===h?D.fsPath:null,R}}return D}}const h=i?1:void 0;class p extends f{_formatted=null;_fsPath=null;get fsPath(){return this._fsPath||(this._fsPath=w(this)),this._fsPath}toString(D=!1){return D?E(this,!0):(this._formatted||(this._formatted=E(this,!1)),this._formatted)}toJSON(){const D={$mid:1};return this._fsPath&&(D.fsPath=this._fsPath,D._sep=h),this._formatted&&(D.external=this._formatted),this.path&&(D.path=this.path),this.scheme&&(D.scheme=this.scheme),this.authority&&(D.authority=this.authority),this.query&&(D.query=this.query),this.fragment&&(D.fragment=this.fragment),D}}const g={58:"%3A",47:"%2F",63:"%3F",35:"%23",91:"%5B",93:"%5D",64:"%40",33:"%21",36:"%24",38:"%26",39:"%27",40:"%28",41:"%29",42:"%2A",43:"%2B",44:"%2C",59:"%3B",61:"%3D",32:"%20"};function y(C,D,R){let L,W=-1;for(let V=0;V<C.length;V++){const Z=C.charCodeAt(V);if(Z>=97&&Z<=122||Z>=65&&Z<=90||Z>=48&&Z<=57||Z===45||Z===46||Z===95||Z===126||D&&Z===47||R&&Z===91||R&&Z===93||R&&Z===58)W!==-1&&(L+=encodeURIComponent(C.substring(W,V)),W=-1),L!==void 0&&(L+=C.charAt(V));else{L===void 0&&(L=C.substr(0,V));const Fe=g[Z];Fe!==void 0?(W!==-1&&(L+=encodeURIComponent(C.substring(W,V)),W=-1),L+=Fe):W===-1&&(W=V)}}return W!==-1&&(L+=encodeURIComponent(C.substring(W))),L!==void 0?L:C}function m(C){let D;for(let R=0;R<C.length;R++){const L=C.charCodeAt(R);L===35||L===63?(D===void 0&&(D=C.substr(0,R)),D+=g[L]):D!==void 0&&(D+=C[R])}return D!==void 0?D:C}function w(C,D){let R;return R=C.authority&&C.path.length>1&&C.scheme==="file"?`//${C.authority}${C.path}`:C.path.charCodeAt(0)===47&&(C.path.charCodeAt(1)>=65&&C.path.charCodeAt(1)<=90||C.path.charCodeAt(1)>=97&&C.path.charCodeAt(1)<=122)&&C.path.charCodeAt(2)===58?C.path[1].toLowerCase()+C.path.substr(2):C.path,i&&(R=R.replace(/\//g,"\\")),R}function E(C,D){const R=D?m:y;let L="",{scheme:W,authority:V,path:Z,query:Fe,fragment:se}=C;if(W&&(L+=W,L+=":"),(V||W==="file")&&(L+=l,L+=l),V){let K=V.indexOf("@");if(K!==-1){const Te=V.substr(0,K);V=V.substr(K+1),K=Te.lastIndexOf(":"),K===-1?L+=R(Te,!1,!1):(L+=R(Te.substr(0,K),!1,!1),L+=":",L+=R(Te.substr(K+1),!1,!0)),L+="@"}V=V.toLowerCase(),K=V.lastIndexOf(":"),K===-1?L+=R(V,!1,!0):(L+=R(V.substr(0,K),!1,!0),L+=V.substr(K))}if(Z){if(Z.length>=3&&Z.charCodeAt(0)===47&&Z.charCodeAt(2)===58){const K=Z.charCodeAt(1);K>=65&&K<=90&&(Z=`/${String.fromCharCode(K+32)}:${Z.substr(3)}`)}else if(Z.length>=2&&Z.charCodeAt(1)===58){const K=Z.charCodeAt(0);K>=65&&K<=90&&(Z=`${String.fromCharCode(K+32)}:${Z.substr(2)}`)}L+=R(Z,!0,!1)}return Fe&&(L+="?",L+=R(Fe,!1,!1)),se&&(L+="#",L+=D?se:y(se,!1,!1)),L}function k(C){try{return decodeURIComponent(C)}catch{return C.length>3?C.substr(0,3)+k(C.substr(3)):C}}const A=/(%[0-9A-Za-z][0-9A-Za-z])+/g;function I(C){return C.match(A)?C.replace(A,D=>k(D)):C}var x=n(470);const _=x.posix||x,P="/";var O;(function(C){C.joinPath=function(D,...R){return D.with({path:_.join(D.path,...R)})},C.resolvePath=function(D,...R){let L=D.path,W=!1;L[0]!==P&&(L=P+L,W=!0);let V=_.resolve(L,...R);return W&&V[0]===P&&!D.authority&&(V=V.substring(1)),D.with({path:V})},C.dirname=function(D){if(D.path.length===0||D.path===P)return D;let R=_.dirname(D.path);return R.length===1&&R.charCodeAt(0)===46&&(R=""),D.with({path:R})},C.basename=function(D){return _.basename(D.path)},C.extname=function(D){return _.extname(D.path)}})(O||(O={}))})(),WS=r})();const{URI:Jt,Utils:Qc}=WS;var Et;(function(t){t.basename=Qc.basename,t.dirname=Qc.dirname,t.extname=Qc.extname,t.joinPath=Qc.joinPath,t.resolvePath=Qc.resolvePath;function e(i,s){return i?.toString()===s?.toString()}t.equals=e;function n(i,s){const o=typeof i=="string"?i:i.path,a=typeof s=="string"?s:s.path,c=o.split("/").filter(h=>h.length>0),u=a.split("/").filter(h=>h.length>0);let l=0;for(;l<c.length&&c[l]===u[l];l++);const d="../".repeat(c.length-l),f=u.slice(l).join("/");return d+f}t.relative=n;function r(i){return Jt.parse(i.toString()).toString()}t.normalize=r})(Et||(Et={}));var Ve;(function(t){t[t.Changed=0]="Changed",t[t.Parsed=1]="Parsed",t[t.IndexedContent=2]="IndexedContent",t[t.ComputedScopes=3]="ComputedScopes",t[t.Linked=4]="Linked",t[t.IndexedReferences=5]="IndexedReferences",t[t.Validated=6]="Validated"})(Ve||(Ve={}));class xj{constructor(e){this.serviceRegistry=e.ServiceRegistry,this.textDocuments=e.workspace.TextDocuments,this.fileSystemProvider=e.workspace.FileSystemProvider}async fromUri(e,n=ct.CancellationToken.None){const r=await this.fileSystemProvider.readFile(e);return this.createAsync(e,r,n)}fromTextDocument(e,n,r){return n=n??Jt.parse(e.uri),ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromString(e,n,r){return ct.CancellationToken.is(r)?this.createAsync(n,e,r):this.create(n,e,r)}fromModel(e,n){return this.create(n,{$model:e})}create(e,n,r){if(typeof n=="string"){const i=this.parse(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else if("$model"in n){const i={value:n.$model,parserErrors:[],lexerErrors:[]};return this.createLangiumDocument(i,e)}else{const i=this.parse(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}async createAsync(e,n,r){if(typeof n=="string"){const i=await this.parseAsync(e,n,r);return this.createLangiumDocument(i,e,void 0,n)}else{const i=await this.parseAsync(e,n.getText(),r);return this.createLangiumDocument(i,e,n)}}createLangiumDocument(e,n,r,i){let s;if(r)s={parseResult:e,uri:n,state:Ve.Parsed,references:[],textDocument:r};else{const o=this.createTextDocumentGetter(n,i);s={parseResult:e,uri:n,state:Ve.Parsed,references:[],get textDocument(){return o()}}}return e.value.$document=s,s}async update(e,n){var r,i;const s=(r=e.parseResult.value.$cstNode)===null||r===void 0?void 0:r.root.fullText,o=(i=this.textDocuments)===null||i===void 0?void 0:i.get(e.uri.toString()),a=o?o.getText():await this.fileSystemProvider.readFile(e.uri);if(o)Object.defineProperty(e,"textDocument",{value:o});else{const c=this.createTextDocumentGetter(e.uri,a);Object.defineProperty(e,"textDocument",{get:c})}return s!==a&&(e.parseResult=await this.parseAsync(e.uri,a,n),e.parseResult.value.$document=e),e.state=Ve.Parsed,e}parse(e,n,r){return this.serviceRegistry.getServices(e).parser.LangiumParser.parse(n,r)}parseAsync(e,n,r){return this.serviceRegistry.getServices(e).parser.AsyncParser.parse(n,r)}createTextDocumentGetter(e,n){const r=this.serviceRegistry;let i;return()=>i??(i=Xf.create(e.toString(),r.getServices(e).LanguageMetaData.languageId,0,n??""))}}class Ij{constructor(e){this.documentMap=new Map,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.serviceRegistry=e.ServiceRegistry}get all(){return Qe(this.documentMap.values())}addDocument(e){const n=e.uri.toString();if(this.documentMap.has(n))throw new Error(`A document with the URI '${n}' is already present.`);this.documentMap.set(n,e)}getDocument(e){const n=e.toString();return this.documentMap.get(n)}async getOrCreateDocument(e,n){let r=this.getDocument(e);return r||(r=await this.langiumDocumentFactory.fromUri(e,n),this.addDocument(r),r)}createDocument(e,n,r){if(r)return this.langiumDocumentFactory.fromString(n,e,r).then(i=>(this.addDocument(i),i));{const i=this.langiumDocumentFactory.fromString(n,e);return this.addDocument(i),i}}hasDocument(e){return this.documentMap.has(e.toString())}invalidateDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(this.serviceRegistry.getServices(e).references.Linker.unlink(r),r.state=Ve.Changed,r.precomputedScopes=void 0,r.diagnostics=void 0),r}deleteDocument(e){const n=e.toString(),r=this.documentMap.get(n);return r&&(r.state=Ve.Changed,this.documentMap.delete(n)),r}}const Gy=Symbol("ref_resolving");class Pj{constructor(e){this.reflection=e.shared.AstReflection,this.langiumDocuments=()=>e.shared.workspace.LangiumDocuments,this.scopeProvider=e.references.ScopeProvider,this.astNodeLocator=e.workspace.AstNodeLocator}async link(e,n=ct.CancellationToken.None){for(const r of ai(e.parseResult.value))await zt(n),Gd(r).forEach(i=>this.doLink(i,e))}doLink(e,n){var r;const i=e.reference;if(i._ref===void 0){i._ref=Gy;try{const s=this.getCandidate(e);if(_d(s))i._ref=s;else if(i._nodeDescription=s,this.langiumDocuments().hasDocument(s.documentUri)){const o=this.loadAstNode(s);i._ref=o??this.createLinkingError(e,s)}else i._ref=void 0}catch(s){console.error(`An error occurred while resolving reference to '${i.$refText}':`,s);const o=(r=s.message)!==null&&r!==void 0?r:String(s);i._ref=Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${i.$refText}': ${o}`})}n.references.push(i)}}unlink(e){for(const n of e.references)delete n._ref,delete n._nodeDescription;e.references=[]}getCandidate(e){const r=this.scopeProvider.getScope(e).getElement(e.reference.$refText);return r??this.createLinkingError(e)}buildReference(e,n,r,i){const s=this,o={$refNode:r,$refText:i,get ref(){var a;if(vt(this._ref))return this._ref;if(VL(this._nodeDescription)){const c=s.loadAstNode(this._nodeDescription);this._ref=c??s.createLinkingError({reference:o,container:e,property:n},this._nodeDescription)}else if(this._ref===void 0){this._ref=Gy;const c=Ud(e).$document,u=s.getLinkedNode({reference:o,container:e,property:n});if(u.error&&c&&c.state<Ve.ComputedScopes)return this._ref=void 0;this._ref=(a=u.node)!==null&&a!==void 0?a:u.error,this._nodeDescription=u.descr,c?.references.push(this)}else if(this._ref===Gy)throw new Error(`Cyclic reference resolution detected: ${s.astNodeLocator.getAstNodePath(e)}/${n} (symbol '${i}')`);return vt(this._ref)?this._ref:void 0},get $nodeDescription(){return this._nodeDescription},get error(){return _d(this._ref)?this._ref:void 0}};return o}getLinkedNode(e){var n;try{const r=this.getCandidate(e);if(_d(r))return{error:r};const i=this.loadAstNode(r);return i?{node:i,descr:r}:{descr:r,error:this.createLinkingError(e,r)}}catch(r){console.error(`An error occurred while resolving reference to '${e.reference.$refText}':`,r);const i=(n=r.message)!==null&&n!==void 0?n:String(r);return{error:Object.assign(Object.assign({},e),{message:`An error occurred while resolving reference to '${e.reference.$refText}': ${i}`})}}}loadAstNode(e){if(e.node)return e.node;const n=this.langiumDocuments().getDocument(e.documentUri);if(n)return this.astNodeLocator.getAstNode(n.parseResult.value,e.path)}createLinkingError(e,n){const r=Ud(e.container).$document;r&&r.state<Ve.ComputedScopes&&console.warn(`Attempted reference resolution before document reached ComputedScopes state (${r.uri}).`);const i=this.reflection.getReferenceType(e);return Object.assign(Object.assign({},e),{message:`Could not resolve reference to ${i} named '${e.reference.$refText}'.`,targetDescription:n})}}function HS(t){return typeof t.name=="string"}class Nj{getName(e){if(HS(e))return e.name}getNameNode(e){return An(e.$cstNode,"name")}}class Oj{constructor(e){this.nameProvider=e.references.NameProvider,this.index=e.shared.workspace.IndexManager,this.nodeLocator=e.workspace.AstNodeLocator}findDeclaration(e){if(e){const n=QD(e),r=e.astNode;if(n&&r){const i=r[n.feature];if(Wn(i))return i.ref;if(Array.isArray(i)){for(const s of i)if(Wn(s)&&s.$refNode&&s.$refNode.offset<=e.offset&&s.$refNode.end>=e.end)return s.ref}}if(r){const i=this.nameProvider.getNameNode(r);if(i&&(i===e||xD(e,i)))return r}}}findDeclarationNode(e){const n=this.findDeclaration(e);if(n?.$cstNode){const r=this.nameProvider.getNameNode(n);return r??n.$cstNode}}findReferences(e,n){const r=[];if(n.includeDeclaration){const s=this.getReferenceToSelf(e);s&&r.push(s)}let i=this.index.findAllReferences(e,this.nodeLocator.getAstNodePath(e));return n.documentUri&&(i=i.filter(s=>Et.equals(s.sourceUri,n.documentUri))),r.push(...i),Qe(r)}getReferenceToSelf(e){const n=this.nameProvider.getNameNode(e);if(n){const r=sn(e),i=this.nodeLocator.getAstNodePath(e);return{sourceUri:r.uri,sourcePath:i,targetUri:r.uri,targetPath:i,segment:Ha(n),local:!0}}}}class zr{constructor(e){if(this.map=new Map,e)for(const[n,r]of e)this.add(n,r)}get size(){return Zg.sum(Qe(this.map.values()).map(e=>e.length))}clear(){this.map.clear()}delete(e,n){if(n===void 0)return this.map.delete(e);{const r=this.map.get(e);if(r){const i=r.indexOf(n);if(i>=0)return r.length===1?this.map.delete(e):r.splice(i,1),!0}return!1}}get(e){var n;return(n=this.map.get(e))!==null&&n!==void 0?n:[]}has(e,n){if(n===void 0)return this.map.has(e);{const r=this.map.get(e);return r?r.indexOf(n)>=0:!1}}add(e,n){return this.map.has(e)?this.map.get(e).push(n):this.map.set(e,[n]),this}addAll(e,n){return this.map.has(e)?this.map.get(e).push(...n):this.map.set(e,Array.from(n)),this}forEach(e){this.map.forEach((n,r)=>n.forEach(i=>e(i,r,this)))}[Symbol.iterator](){return this.entries().iterator()}entries(){return Qe(this.map.entries()).flatMap(([e,n])=>n.map(r=>[e,r]))}keys(){return Qe(this.map.keys())}values(){return Qe(this.map.values()).flat()}entriesGroupedByKey(){return Qe(this.map.entries())}}class VS{get size(){return this.map.size}constructor(e){if(this.map=new Map,this.inverse=new Map,e)for(const[n,r]of e)this.set(n,r)}clear(){this.map.clear(),this.inverse.clear()}set(e,n){return this.map.set(e,n),this.inverse.set(n,e),this}get(e){return this.map.get(e)}getKey(e){return this.inverse.get(e)}delete(e){const n=this.map.get(e);return n!==void 0?(this.map.delete(e),this.inverse.delete(n),!0):!1}}class KS{constructor(e){this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider}async computeExports(e,n=ct.CancellationToken.None){return this.computeExportsForNode(e.parseResult.value,e,void 0,n)}async computeExportsForNode(e,n,r=kc,i=ct.CancellationToken.None){const s=[];this.exportNode(e,s,n);for(const o of r(e))await zt(i),this.exportNode(o,s,n);return s}exportNode(e,n,r){const i=this.nameProvider.getName(e);i&&n.push(this.descriptions.createDescription(e,i,r))}async computeLocalScopes(e,n=ct.CancellationToken.None){const r=e.parseResult.value,i=new zr;for(const s of Pr(r))await zt(n),this.processNode(s,e,i);return i}processNode(e,n,r){const i=e.$container;if(i){const s=this.nameProvider.getName(e);s&&r.add(i,this.descriptions.createDescription(e,s,n))}}}class eu{constructor(e,n,r){var i;this.elements=e,this.outerScope=n,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1}getAllElements(){return this.outerScope?this.elements.concat(this.outerScope.getAllElements()):this.elements}getElement(e){const n=this.caseInsensitive?this.elements.find(r=>r.name.toLowerCase()===e.toLowerCase()):this.elements.find(r=>r.name===e);if(n)return n;if(this.outerScope)return this.outerScope.getElement(e)}}class YS{constructor(e,n,r){var i;this.elements=new Map,this.caseInsensitive=(i=r?.caseInsensitive)!==null&&i!==void 0?i:!1;for(const s of e){const o=this.caseInsensitive?s.name.toLowerCase():s.name;this.elements.set(o,s)}this.outerScope=n}getElement(e){const n=this.caseInsensitive?e.toLowerCase():e,r=this.elements.get(n);if(r)return r;if(this.outerScope)return this.outerScope.getElement(e)}getAllElements(){let e=Qe(this.elements.values());return this.outerScope&&(e=e.concat(this.outerScope.getAllElements())),e}}const XS={getElement(){},getAllElements(){return Lo}};class JS{constructor(){this.toDispose=[],this.isDisposed=!1}onDispose(e){this.toDispose.push(e)}dispose(){this.throwIfDisposed(),this.clear(),this.isDisposed=!0,this.toDispose.forEach(e=>e.dispose())}throwIfDisposed(){if(this.isDisposed)throw new Error("This cache has already been disposed")}}class Fj extends JS{constructor(){super(...arguments),this.cache=new Map}has(e){return this.throwIfDisposed(),this.cache.has(e)}set(e,n){this.throwIfDisposed(),this.cache.set(e,n)}get(e,n){if(this.throwIfDisposed(),this.cache.has(e))return this.cache.get(e);if(n){const r=n();return this.cache.set(e,r),r}else return}delete(e){return this.throwIfDisposed(),this.cache.delete(e)}clear(){this.throwIfDisposed(),this.cache.clear()}}class Lj extends JS{constructor(e){super(),this.cache=new Map,this.converter=e??(n=>n)}has(e,n){return this.throwIfDisposed(),this.cacheForContext(e).has(n)}set(e,n,r){this.throwIfDisposed(),this.cacheForContext(e).set(n,r)}get(e,n,r){this.throwIfDisposed();const i=this.cacheForContext(e);if(i.has(n))return i.get(n);if(r){const s=r();return i.set(n,s),s}else return}delete(e,n){return this.throwIfDisposed(),this.cacheForContext(e).delete(n)}clear(e){if(this.throwIfDisposed(),e){const n=this.converter(e);this.cache.delete(n)}else this.cache.clear()}cacheForContext(e){const n=this.converter(e);let r=this.cache.get(n);return r||(r=new Map,this.cache.set(n,r)),r}}class ZS extends Fj{constructor(e){super(),this.onDispose(e.workspace.DocumentBuilder.onUpdate(()=>{this.clear()}))}}class QS{constructor(e){this.reflection=e.shared.AstReflection,this.nameProvider=e.references.NameProvider,this.descriptions=e.workspace.AstNodeDescriptionProvider,this.indexManager=e.shared.workspace.IndexManager,this.globalScopeCache=new ZS(e.shared)}getScope(e){const n=[],r=this.reflection.getReferenceType(e),i=sn(e.container).precomputedScopes;if(i){let o=e.container;do{const a=i.get(o);a.length>0&&n.push(Qe(a).filter(c=>this.reflection.isSubtype(c.type,r))),o=o.$container}while(o)}let s=this.getGlobalScope(r,e);for(let o=n.length-1;o>=0;o--)s=this.createScope(n[o],s);return s}createScope(e,n,r){return new eu(Qe(e),n,r)}createScopeForNodes(e,n,r){const i=Qe(e).map(s=>{const o=this.nameProvider.getName(s);if(o)return this.descriptions.createDescription(s,o)}).nonNullable();return new eu(i,n,r)}getGlobalScope(e,n){return this.globalScopeCache.get(e,()=>new YS(this.indexManager.allElements(e)))}}function Mj(t){return typeof t.$comment=="string"}function ek(t){return typeof t=="object"&&!!t&&("$ref"in t||"$error"in t)}class zj{constructor(e){this.ignoreProperties=new Set(["$container","$containerProperty","$containerIndex","$document","$cstNode"]),this.langiumDocuments=e.shared.workspace.LangiumDocuments,this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider,this.commentProvider=e.documentation.CommentProvider}serialize(e,n){const r=n??{},i=n?.replacer,s=(a,c)=>this.replacer(a,c,r),o=i?(a,c)=>i(a,c,s):s;try{return this.currentDocument=sn(e),JSON.stringify(e,o,n?.space)}finally{this.currentDocument=void 0}}deserialize(e,n){const r=n??{},i=JSON.parse(e);return this.linkNode(i,i,r),i}replacer(e,n,{refText:r,sourceText:i,textRegions:s,comments:o,uriConverter:a}){var c,u,l,d;if(!this.ignoreProperties.has(e))if(Wn(n)){const f=n.ref,h=r?n.$refText:void 0;if(f){const p=sn(f);let g="";this.currentDocument&&this.currentDocument!==p&&(a?g=a(p.uri,n):g=p.uri.toString());const y=this.astNodeLocator.getAstNodePath(f);return{$ref:`${g}#${y}`,$refText:h}}else return{$error:(u=(c=n.error)===null||c===void 0?void 0:c.message)!==null&&u!==void 0?u:"Could not resolve reference",$refText:h}}else if(vt(n)){let f;if(s&&(f=this.addAstNodeRegionWithAssignmentsTo(Object.assign({},n)),(!e||n.$document)&&f?.$textRegion&&(f.$textRegion.documentURI=(l=this.currentDocument)===null||l===void 0?void 0:l.uri.toString())),i&&!e&&(f??(f=Object.assign({},n)),f.$sourceText=(d=n.$cstNode)===null||d===void 0?void 0:d.text),o){f??(f=Object.assign({},n));const h=this.commentProvider.getComment(n);h&&(f.$comment=h.replace(/\r/g,""))}return f??n}else return n}addAstNodeRegionWithAssignmentsTo(e){const n=r=>({offset:r.offset,end:r.end,length:r.length,range:r.range});if(e.$cstNode){const r=e.$textRegion=n(e.$cstNode),i=r.assignments={};return Object.keys(e).filter(s=>!s.startsWith("$")).forEach(s=>{const o=qo(e.$cstNode,s).map(n);o.length!==0&&(i[s]=o)}),e}}linkNode(e,n,r,i,s,o){for(const[c,u]of Object.entries(e))if(Array.isArray(u))for(let l=0;l<u.length;l++){const d=u[l];ek(d)?u[l]=this.reviveReference(e,c,n,d,r):vt(d)&&this.linkNode(d,n,r,e,c,l)}else ek(u)?e[c]=this.reviveReference(e,c,n,u,r):vt(u)&&this.linkNode(u,n,r,e,c);const a=e;a.$container=i,a.$containerProperty=s,a.$containerIndex=o}reviveReference(e,n,r,i,s){let o=i.$refText,a=i.$error;if(i.$ref){const c=this.getRefNode(r,i.$ref,s.uriConverter);if(vt(c))return o||(o=this.nameProvider.getName(c)),{$refText:o??"",ref:c};a=c}if(a){const c={$refText:o??""};return c.error={container:e,property:n,message:a,reference:c},c}else return}getRefNode(e,n,r){try{const i=n.indexOf("#");if(i===0){const c=this.astNodeLocator.getAstNode(e,n.substring(1));return c||"Could not resolve path: "+n}if(i<0){const c=r?r(n):Jt.parse(n),u=this.langiumDocuments.getDocument(c);return u?u.parseResult.value:"Could not find document for URI: "+n}const s=r?r(n.substring(0,i)):Jt.parse(n.substring(0,i)),o=this.langiumDocuments.getDocument(s);if(!o)return"Could not find document for URI: "+n;if(i===n.length-1)return o.parseResult.value;const a=this.astNodeLocator.getAstNode(o.parseResult.value,n.substring(i+1));return a||"Could not resolve URI: "+n}catch(i){return String(i)}}}class Bj{get map(){return this.fileExtensionMap}constructor(e){this.languageIdMap=new Map,this.fileExtensionMap=new Map,this.textDocuments=e?.workspace.TextDocuments}register(e){const n=e.LanguageMetaData;for(const r of n.fileExtensions)this.fileExtensionMap.has(r)&&console.warn(`The file extension ${r} is used by multiple languages. It is now assigned to '${n.languageId}'.`),this.fileExtensionMap.set(r,e);this.languageIdMap.set(n.languageId,e),this.languageIdMap.size===1?this.singleton=e:this.singleton=void 0}getServices(e){var n,r;if(this.singleton!==void 0)return this.singleton;if(this.languageIdMap.size===0)throw new Error("The service registry is empty. Use `register` to register the services of a language.");const i=(r=(n=this.textDocuments)===null||n===void 0?void 0:n.get(e))===null||r===void 0?void 0:r.languageId;if(i!==void 0){const a=this.languageIdMap.get(i);if(a)return a}const s=Et.extname(e),o=this.fileExtensionMap.get(s);if(!o)throw i?new Error(`The service registry contains no services for the extension '${s}' for language '${i}'.`):new Error(`The service registry contains no services for the extension '${s}'.`);return o}hasServices(e){try{return this.getServices(e),!0}catch{return!1}}get all(){return Array.from(this.languageIdMap.values())}}function tu(t){return{code:t}}var Jf;(function(t){t.all=["fast","slow","built-in"]})(Jf||(Jf={}));class qj{constructor(e){this.entries=new zr,this.reflection=e.shared.AstReflection}register(e,n=this,r="fast"){if(r==="built-in")throw new Error("The 'built-in' category is reserved for lexer, parser, and linker errors.");for(const[i,s]of Object.entries(e)){const o=s;if(Array.isArray(o))for(const a of o){const c={check:this.wrapValidationException(a,n),category:r};this.addEntry(i,c)}else if(typeof o=="function"){const a={check:this.wrapValidationException(o,n),category:r};this.addEntry(i,a)}}}wrapValidationException(e,n){return async(r,i,s)=>{try{await e.call(n,r,i,s)}catch(o){if(Yf(o))throw o;console.error("An error occurred during validation:",o);const a=o instanceof Error?o.message:String(o);o instanceof Error&&o.stack&&console.error(o.stack),i("error","An error occurred during validation: "+a,{node:r})}}}addEntry(e,n){if(e==="AstNode"){this.entries.add("AstNode",n);return}for(const r of this.reflection.getAllSubTypes(e))this.entries.add(r,n)}getChecks(e,n){let r=Qe(this.entries.get(e)).concat(this.entries.get("AstNode"));return n&&(r=r.filter(i=>n.includes(i.category))),r.map(i=>i.check)}}class jj{constructor(e){this.validationRegistry=e.validation.ValidationRegistry,this.metadata=e.LanguageMetaData}async validateDocument(e,n={},r=ct.CancellationToken.None){const i=e.parseResult,s=[];if(await zt(r),(!n.categories||n.categories.includes("built-in"))&&(this.processLexingErrors(i,s,n),n.stopAfterLexingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.LexingError})||(this.processParsingErrors(i,s,n),n.stopAfterParsingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.ParsingError}))||(this.processLinkingErrors(e,s,n),n.stopAfterLinkingErrors&&s.some(o=>{var a;return((a=o.data)===null||a===void 0?void 0:a.code)===mr.LinkingError}))))return s;try{s.push(...await this.validateAst(i.value,n,r))}catch(o){if(Yf(o))throw o;console.error("An error occurred during validation:",o)}return await zt(r),s}processLexingErrors(e,n,r){var i,s,o;const a=[...e.lexerErrors,...(s=(i=e.lexerReport)===null||i===void 0?void 0:i.diagnostics)!==null&&s!==void 0?s:[]];for(const c of a){const u=(o=c.severity)!==null&&o!==void 0?o:"error",l={severity:Wy(u),range:{start:{line:c.line-1,character:c.column-1},end:{line:c.line-1,character:c.column+c.length-1}},message:c.message,data:Gj(u),source:this.getSource()};n.push(l)}}processParsingErrors(e,n,r){for(const i of e.parserErrors){let s;if(isNaN(i.token.startOffset)){if("previousToken"in i){const o=i.previousToken;if(isNaN(o.startOffset)){const a={line:0,character:0};s={start:a,end:a}}else{const a={line:o.endLine-1,character:o.endColumn};s={start:a,end:a}}}}else s=xd(i.token);if(s){const o={severity:Wy("error"),range:s,message:i.message,data:tu(mr.ParsingError),source:this.getSource()};n.push(o)}}}processLinkingErrors(e,n,r){for(const i of e.references){const s=i.error;if(s){const o={node:s.container,property:s.property,index:s.index,data:{code:mr.LinkingError,containerType:s.container.$type,property:s.property,refText:s.reference.$refText}};n.push(this.toDiagnostic("error",s.message,o))}}}async validateAst(e,n,r=ct.CancellationToken.None){const i=[],s=(o,a,c)=>{i.push(this.toDiagnostic(o,a,c))};return await Promise.all(ai(e).map(async o=>{await zt(r);const a=this.validationRegistry.getChecks(o.$type,n.categories);for(const c of a)await c(o,s,r)})),i}toDiagnostic(e,n,r){return{message:n,range:Uj(r),severity:Wy(e),code:r.code,codeDescription:r.codeDescription,tags:r.tags,relatedInformation:r.relatedInformation,data:r.data,source:this.getSource()}}getSource(){return this.metadata.languageId}}function Uj(t){if(t.range)return t.range;let e;return typeof t.property=="string"?e=An(t.node.$cstNode,t.property,t.index):typeof t.keyword=="string"&&(e=Cc(t.node.$cstNode,t.keyword,t.index)),e??(e=t.node.$cstNode),e?e.range:{start:{line:0,character:0},end:{line:0,character:0}}}function Wy(t){switch(t){case"error":return 1;case"warning":return 2;case"info":return 3;case"hint":return 4;default:throw new Error("Invalid diagnostic severity: "+t)}}function Gj(t){switch(t){case"error":return tu(mr.LexingError);case"warning":return tu(mr.LexingWarning);case"info":return tu(mr.LexingInfo);case"hint":return tu(mr.LexingHint);default:throw new Error("Invalid diagnostic severity: "+t)}}var mr;(function(t){t.LexingError="lexing-error",t.LexingWarning="lexing-warning",t.LexingInfo="lexing-info",t.LexingHint="lexing-hint",t.ParsingError="parsing-error",t.LinkingError="linking-error"})(mr||(mr={}));class Wj{constructor(e){this.astNodeLocator=e.workspace.AstNodeLocator,this.nameProvider=e.references.NameProvider}createDescription(e,n,r){const i=r??sn(e);n??(n=this.nameProvider.getName(e));const s=this.astNodeLocator.getAstNodePath(e);if(!n)throw new Error(`Node at path ${s} has no name.`);let o;const a=()=>{var c;return o??(o=Ha((c=this.nameProvider.getNameNode(e))!==null&&c!==void 0?c:e.$cstNode))};return{node:e,name:n,get nameSegment(){return a()},selectionSegment:Ha(e.$cstNode),type:e.$type,documentUri:i.uri,path:s}}}class Hj{constructor(e){this.nodeLocator=e.workspace.AstNodeLocator}async createDescriptions(e,n=ct.CancellationToken.None){const r=[],i=e.parseResult.value;for(const s of ai(i))await zt(n),Gd(s).filter(o=>!_d(o)).forEach(o=>{const a=this.createDescription(o);a&&r.push(a)});return r}createDescription(e){const n=e.reference.$nodeDescription,r=e.reference.$refNode;if(!n||!r)return;const i=sn(e.container).uri;return{sourceUri:i,sourcePath:this.nodeLocator.getAstNodePath(e.container),targetUri:n.documentUri,targetPath:n.path,segment:Ha(r),local:Et.equals(n.documentUri,i)}}}class Vj{constructor(){this.segmentSeparator="/",this.indexSeparator="@"}getAstNodePath(e){if(e.$container){const n=this.getAstNodePath(e.$container),r=this.getPathSegment(e);return n+this.segmentSeparator+r}return""}getPathSegment({$containerProperty:e,$containerIndex:n}){if(!e)throw new Error("Missing '$containerProperty' in AST node.");return n!==void 0?e+this.indexSeparator+n:e}getAstNode(e,n){return n.split(this.segmentSeparator).reduce((i,s)=>{if(!i||s.length===0)return i;const o=s.indexOf(this.indexSeparator);if(o>0){const a=s.substring(0,o),c=parseInt(s.substring(o+1)),u=i[a];return u?.[c]}return i[s]},e)}}var Kj=na();class Yj{constructor(e){this._ready=new jy,this.settings={},this.workspaceConfig=!1,this.onConfigurationSectionUpdateEmitter=new Kj.Emitter,this.serviceRegistry=e.ServiceRegistry}get ready(){return this._ready.promise}initialize(e){var n,r;this.workspaceConfig=(r=(n=e.capabilities.workspace)===null||n===void 0?void 0:n.configuration)!==null&&r!==void 0?r:!1}async initialized(e){if(this.workspaceConfig){if(e.register){const n=this.serviceRegistry.all;e.register({section:n.map(r=>this.toSectionName(r.LanguageMetaData.languageId))})}if(e.fetchConfiguration){const n=this.serviceRegistry.all.map(i=>({section:this.toSectionName(i.LanguageMetaData.languageId)})),r=await e.fetchConfiguration(n);n.forEach((i,s)=>{this.updateSectionConfiguration(i.section,r[s])})}}this._ready.resolve()}updateConfiguration(e){e.settings&&Object.keys(e.settings).forEach(n=>{const r=e.settings[n];this.updateSectionConfiguration(n,r),this.onConfigurationSectionUpdateEmitter.fire({section:n,configuration:r})})}updateSectionConfiguration(e,n){this.settings[e]=n}async getConfiguration(e,n){await this.ready;const r=this.toSectionName(e);if(this.settings[r])return this.settings[r][n]}toSectionName(e){return`${e}`}get onConfigurationSectionUpdate(){return this.onConfigurationSectionUpdateEmitter.event}}var js;(function(t){function e(n){return{dispose:async()=>await n()}}t.create=e})(js||(js={}));class Xj{constructor(e){this.updateBuildOptions={validation:{categories:["built-in","fast"]}},this.updateListeners=[],this.buildPhaseListeners=new zr,this.documentPhaseListeners=new zr,this.buildState=new Map,this.documentBuildWaiters=new Map,this.currentState=Ve.Changed,this.langiumDocuments=e.workspace.LangiumDocuments,this.langiumDocumentFactory=e.workspace.LangiumDocumentFactory,this.textDocuments=e.workspace.TextDocuments,this.indexManager=e.workspace.IndexManager,this.serviceRegistry=e.ServiceRegistry}async build(e,n={},r=ct.CancellationToken.None){var i,s;for(const o of e){const a=o.uri.toString();if(o.state===Ve.Validated){if(typeof n.validation=="boolean"&&n.validation)o.state=Ve.IndexedReferences,o.diagnostics=void 0,this.buildState.delete(a);else if(typeof n.validation=="object"){const c=this.buildState.get(a),u=(i=c?.result)===null||i===void 0?void 0:i.validationChecks;if(u){const d=((s=n.validation.categories)!==null&&s!==void 0?s:Jf.all).filter(f=>!u.includes(f));d.length>0&&(this.buildState.set(a,{completed:!1,options:{validation:Object.assign(Object.assign({},n.validation),{categories:d})},result:c.result}),o.state=Ve.IndexedReferences)}}}else this.buildState.delete(a)}this.currentState=Ve.Changed,await this.emitUpdate(e.map(o=>o.uri),[]),await this.buildDocuments(e,n,r)}async update(e,n,r=ct.CancellationToken.None){this.currentState=Ve.Changed;for(const o of n)this.langiumDocuments.deleteDocument(o),this.buildState.delete(o.toString()),this.indexManager.remove(o);for(const o of e){if(!this.langiumDocuments.invalidateDocument(o)){const c=this.langiumDocumentFactory.fromModel({$type:"INVALID"},o);c.state=Ve.Changed,this.langiumDocuments.addDocument(c)}this.buildState.delete(o.toString())}const i=Qe(e).concat(n).map(o=>o.toString()).toSet();this.langiumDocuments.all.filter(o=>!i.has(o.uri.toString())&&this.shouldRelink(o,i)).forEach(o=>{this.serviceRegistry.getServices(o.uri).references.Linker.unlink(o),o.state=Math.min(o.state,Ve.ComputedScopes),o.diagnostics=void 0}),await this.emitUpdate(e,n),await zt(r);const s=this.sortDocuments(this.langiumDocuments.all.filter(o=>{var a;return o.state<Ve.Linked||!(!((a=this.buildState.get(o.uri.toString()))===null||a===void 0)&&a.completed)}).toArray());await this.buildDocuments(s,this.updateBuildOptions,r)}async emitUpdate(e,n){await Promise.all(this.updateListeners.map(r=>r(e,n)))}sortDocuments(e){let n=0,r=e.length-1;for(;n<r;){for(;n<e.length&&this.hasTextDocument(e[n]);)n++;for(;r>=0&&!this.hasTextDocument(e[r]);)r--;n<r&&([e[n],e[r]]=[e[r],e[n]])}return e}hasTextDocument(e){var n;return!!(!((n=this.textDocuments)===null||n===void 0)&&n.get(e.uri))}shouldRelink(e,n){return e.references.some(r=>r.error!==void 0)?!0:this.indexManager.isAffected(e,n)}onUpdate(e){return this.updateListeners.push(e),js.create(()=>{const n=this.updateListeners.indexOf(e);n>=0&&this.updateListeners.splice(n,1)})}async buildDocuments(e,n,r){this.prepareBuild(e,n),await this.runCancelable(e,Ve.Parsed,r,s=>this.langiumDocumentFactory.update(s,r)),await this.runCancelable(e,Ve.IndexedContent,r,s=>this.indexManager.updateContent(s,r)),await this.runCancelable(e,Ve.ComputedScopes,r,async s=>{const o=this.serviceRegistry.getServices(s.uri).references.ScopeComputation;s.precomputedScopes=await o.computeLocalScopes(s,r)}),await this.runCancelable(e,Ve.Linked,r,s=>this.serviceRegistry.getServices(s.uri).references.Linker.link(s,r)),await this.runCancelable(e,Ve.IndexedReferences,r,s=>this.indexManager.updateReferences(s,r));const i=e.filter(s=>this.shouldValidate(s));await this.runCancelable(i,Ve.Validated,r,s=>this.validate(s,r));for(const s of e){const o=this.buildState.get(s.uri.toString());o&&(o.completed=!0)}}prepareBuild(e,n){for(const r of e){const i=r.uri.toString(),s=this.buildState.get(i);(!s||s.completed)&&this.buildState.set(i,{completed:!1,options:n,result:s?.result})}}async runCancelable(e,n,r,i){const s=e.filter(a=>a.state<n);for(const a of s)await zt(r),await i(a),a.state=n,await this.notifyDocumentPhase(a,n,r);const o=e.filter(a=>a.state===n);await this.notifyBuildPhase(o,n,r),this.currentState=n}onBuildPhase(e,n){return this.buildPhaseListeners.add(e,n),js.create(()=>{this.buildPhaseListeners.delete(e,n)})}onDocumentPhase(e,n){return this.documentPhaseListeners.add(e,n),js.create(()=>{this.documentPhaseListeners.delete(e,n)})}waitUntil(e,n,r){let i;if(n&&"path"in n?i=n:r=n,r??(r=ct.CancellationToken.None),i){const s=this.langiumDocuments.getDocument(i);if(s&&s.state>e)return Promise.resolve(i)}return this.currentState>=e?Promise.resolve(void 0):r.isCancellationRequested?Promise.reject(Kf):new Promise((s,o)=>{const a=this.onBuildPhase(e,()=>{if(a.dispose(),c.dispose(),i){const u=this.langiumDocuments.getDocument(i);s(u?.uri)}else s(void 0)}),c=r.onCancellationRequested(()=>{a.dispose(),c.dispose(),o(Kf)})})}async notifyDocumentPhase(e,n,r){const i=this.documentPhaseListeners.get(n);for(const s of i)try{await s(e,r)}catch(o){if(!Yf(o))throw o}}async notifyBuildPhase(e,n,r){if(e.length===0)return;const i=this.buildPhaseListeners.get(n);for(const s of i)await zt(r),await s(e,r)}shouldValidate(e){return!!this.getBuildOptions(e).validation}async validate(e,n){var r,i;const s=this.serviceRegistry.getServices(e.uri).validation.DocumentValidator,o=this.getBuildOptions(e).validation,a=typeof o=="object"?o:void 0,c=await s.validateDocument(e,a,n);e.diagnostics?e.diagnostics.push(...c):e.diagnostics=c;const u=this.buildState.get(e.uri.toString());if(u){(r=u.result)!==null&&r!==void 0||(u.result={});const l=(i=a?.categories)!==null&&i!==void 0?i:Jf.all;u.result.validationChecks?u.result.validationChecks.push(...l):u.result.validationChecks=[...l]}}getBuildOptions(e){var n,r;return(r=(n=this.buildState.get(e.uri.toString()))===null||n===void 0?void 0:n.options)!==null&&r!==void 0?r:{}}}class Jj{constructor(e){this.symbolIndex=new Map,this.symbolByTypeIndex=new Lj,this.referenceIndex=new Map,this.documents=e.workspace.LangiumDocuments,this.serviceRegistry=e.ServiceRegistry,this.astReflection=e.AstReflection}findAllReferences(e,n){const r=sn(e).uri,i=[];return this.referenceIndex.forEach(s=>{s.forEach(o=>{Et.equals(o.targetUri,r)&&o.targetPath===n&&i.push(o)})}),Qe(i)}allElements(e,n){let r=Qe(this.symbolIndex.keys());return n&&(r=r.filter(i=>!n||n.has(i))),r.map(i=>this.getFileDescriptions(i,e)).flat()}getFileDescriptions(e,n){var r;return n?this.symbolByTypeIndex.get(e,n,()=>{var s;return((s=this.symbolIndex.get(e))!==null&&s!==void 0?s:[]).filter(a=>this.astReflection.isSubtype(a.type,n))}):(r=this.symbolIndex.get(e))!==null&&r!==void 0?r:[]}remove(e){const n=e.toString();this.symbolIndex.delete(n),this.symbolByTypeIndex.clear(n),this.referenceIndex.delete(n)}async updateContent(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).references.ScopeComputation.computeExports(e,n),s=e.uri.toString();this.symbolIndex.set(s,i),this.symbolByTypeIndex.clear(s)}async updateReferences(e,n=ct.CancellationToken.None){const i=await this.serviceRegistry.getServices(e.uri).workspace.ReferenceDescriptionProvider.createDescriptions(e,n);this.referenceIndex.set(e.uri.toString(),i)}isAffected(e,n){const r=this.referenceIndex.get(e.uri.toString());return r?r.some(i=>!i.local&&n.has(i.targetUri.toString())):!1}}class tk{constructor(e){this.initialBuildOptions={},this._ready=new jy,this.serviceRegistry=e.ServiceRegistry,this.langiumDocuments=e.workspace.LangiumDocuments,this.documentBuilder=e.workspace.DocumentBuilder,this.fileSystemProvider=e.workspace.FileSystemProvider,this.mutex=e.workspace.WorkspaceLock}get ready(){return this._ready.promise}initialize(e){var n;this.folders=(n=e.workspaceFolders)!==null&&n!==void 0?n:void 0}initialized(e){return this.mutex.write(n=>{var r;return this.initializeWorkspace((r=this.folders)!==null&&r!==void 0?r:[],n)})}async initializeWorkspace(e,n=ct.CancellationToken.None){const r=await this.performStartup(e);await zt(n),await this.documentBuilder.build(r,this.initialBuildOptions,n)}async performStartup(e){const n=this.serviceRegistry.all.flatMap(s=>s.LanguageMetaData.fileExtensions),r=[],i=s=>{r.push(s),this.langiumDocuments.hasDocument(s.uri)||this.langiumDocuments.addDocument(s)};return await this.loadAdditionalDocuments(e,i),await Promise.all(e.map(s=>[s,this.getRootFolder(s)]).map(async s=>this.traverseFolder(...s,n,i))),this._ready.resolve(),r}loadAdditionalDocuments(e,n){return Promise.resolve()}getRootFolder(e){return Jt.parse(e.uri)}async traverseFolder(e,n,r,i){const s=await this.fileSystemProvider.readDirectory(n);await Promise.all(s.map(async o=>{if(this.includeEntry(e,o,r)){if(o.isDirectory)await this.traverseFolder(e,o.uri,r,i);else if(o.isFile){const a=await this.langiumDocuments.getOrCreateDocument(o.uri);i(a)}}}))}includeEntry(e,n,r){const i=Et.basename(n.uri);if(i.startsWith("."))return!1;if(n.isDirectory)return i!=="node_modules"&&i!=="out";if(n.isFile){const s=Et.extname(n.uri);return r.includes(s)}return!1}}const Zj={mode:"full"};class Qj{constructor(e){this.tokenBuilder=e.parser.TokenBuilder;const n=this.tokenBuilder.buildTokens(e.Grammar,{caseInsensitive:e.LanguageMetaData.caseInsensitive});this.tokenTypes=this.toTokenTypeDictionary(n);const r=rk(n)?Object.values(n):n;this.chevrotainLexer=new Rn(r,{positionTracking:"full"})}get definition(){return this.tokenTypes}tokenize(e,n=Zj){var r,i,s;const o=this.chevrotainLexer.tokenize(e);return{tokens:o.tokens,errors:o.errors,hidden:(r=o.groups.hidden)!==null&&r!==void 0?r:[],report:(s=(i=this.tokenBuilder).flushLexingReport)===null||s===void 0?void 0:s.call(i,e)}}toTokenTypeDictionary(e){if(rk(e))return e;const n=nk(e)?Object.values(e.modes).flat():e,r={};return n.forEach(i=>r[i.name]=i),r}}function eU(t){return Array.isArray(t)&&(t.length===0||"name"in t[0])}function nk(t){return t&&"modes"in t&&"defaultMode"in t}function rk(t){return!eU(t)&&!nk(t)}function tU(t,e,n){let r,i;typeof t=="string"?(i=e,r=n):(i=t.range.start,r=e),i||(i=He.create(0,0));const s=ik(t),o=Vy(r),a=iU({lines:s,position:i,options:o});return uU({index:0,tokens:a,position:i})}function nU(t,e){const n=Vy(e),r=ik(t);if(r.length===0)return!1;const i=r[0],s=r[r.length-1],o=n.start,a=n.end;return!!o?.exec(i)&&!!a?.exec(s)}function ik(t){let e="";return typeof t=="string"?e=t:e=t.text,e.split(YD)}const sk=/\s*(@([\p{L}][\p{L}\p{N}]*)?)/uy,rU=/\{(@[\p{L}][\p{L}\p{N}]*)(\s*)([^\r\n}]+)?\}/gu;function iU(t){var e,n,r;const i=[];let s=t.position.line,o=t.position.character;for(let a=0;a<t.lines.length;a++){const c=a===0,u=a===t.lines.length-1;let l=t.lines[a],d=0;if(c&&t.options.start){const h=(e=t.options.start)===null||e===void 0?void 0:e.exec(l);h&&(d=h.index+h[0].length)}else{const h=(n=t.options.line)===null||n===void 0?void 0:n.exec(l);h&&(d=h.index+h[0].length)}if(u){const h=(r=t.options.end)===null||r===void 0?void 0:r.exec(l);h&&(l=l.substring(0,h.index))}if(l=l.substring(0,cU(l)),Hy(l,d)>=l.length){if(i.length>0){const h=He.create(s,o);i.push({type:"break",content:"",range:Me.create(h,h)})}}else{sk.lastIndex=d;const h=sk.exec(l);if(h){const p=h[0],g=h[1],y=He.create(s,o+d),m=He.create(s,o+d+p.length);i.push({type:"tag",content:g,range:Me.create(y,m)}),d+=p.length,d=Hy(l,d)}if(d<l.length){const p=l.substring(d),g=Array.from(p.matchAll(rU));i.push(...sU(g,p,s,o+d))}}s++,o=0}return i.length>0&&i[i.length-1].type==="break"?i.slice(0,-1):i}function sU(t,e,n,r){const i=[];if(t.length===0){const s=He.create(n,r),o=He.create(n,r+e.length);i.push({type:"text",content:e,range:Me.create(s,o)})}else{let s=0;for(const a of t){const c=a.index,u=e.substring(s,c);u.length>0&&i.push({type:"text",content:e.substring(s,c),range:Me.create(He.create(n,s+r),He.create(n,c+r))});let l=u.length+1;const d=a[1];if(i.push({type:"inline-tag",content:d,range:Me.create(He.create(n,s+l+r),He.create(n,s+l+d.length+r))}),l+=d.length,a.length===4){l+=a[2].length;const f=a[3];i.push({type:"text",content:f,range:Me.create(He.create(n,s+l+r),He.create(n,s+l+f.length+r))})}else i.push({type:"text",content:"",range:Me.create(He.create(n,s+l+r),He.create(n,s+l+r))});s=c+a[0].length}const o=e.substring(s);o.length>0&&i.push({type:"text",content:o,range:Me.create(He.create(n,s+r),He.create(n,s+r+o.length))})}return i}const oU=/\S/,aU=/\s*$/;function Hy(t,e){const n=t.substring(e).match(oU);return n?e+n.index:t.length}function cU(t){const e=t.match(aU);if(e&&typeof e.index=="number")return e.index}function uU(t){var e,n,r,i;const s=He.create(t.position.line,t.position.character);if(t.tokens.length===0)return new uk([],Me.create(s,s));const o=[];for(;t.index<t.tokens.length;){const u=lU(t,o[o.length-1]);u&&o.push(u)}const a=(n=(e=o[0])===null||e===void 0?void 0:e.range.start)!==null&&n!==void 0?n:s,c=(i=(r=o[o.length-1])===null||r===void 0?void 0:r.range.end)!==null&&i!==void 0?i:s;return new uk(o,Me.create(a,c))}function lU(t,e){const n=t.tokens[t.index];if(n.type==="tag")return ak(t,!1);if(n.type==="text"||n.type==="inline-tag")return ok(t);dU(n,e),t.index++}function dU(t,e){if(e){const n=new lk("",t.range);"inlines"in e?e.inlines.push(n):e.content.inlines.push(n)}}function ok(t){let e=t.tokens[t.index];const n=e;let r=e;const i=[];for(;e&&e.type!=="break"&&e.type!=="tag";)i.push(fU(t)),r=e,e=t.tokens[t.index];return new Xy(i,Me.create(n.range.start,r.range.end))}function fU(t){return t.tokens[t.index].type==="inline-tag"?ak(t,!0):ck(t)}function ak(t,e){const n=t.tokens[t.index++],r=n.content.substring(1),i=t.tokens[t.index];if(i?.type==="text")if(e){const s=ck(t);return new Yy(r,new Xy([s],s.range),e,Me.create(n.range.start,s.range.end))}else{const s=ok(t);return new Yy(r,s,e,Me.create(n.range.start,s.range.end))}else{const s=n.range;return new Yy(r,new Xy([],s),e,s)}}function ck(t){const e=t.tokens[t.index++];return new lk(e.content,e.range)}function Vy(t){if(!t)return Vy({start:"/**",end:"*/",line:"*"});const{start:e,end:n,line:r}=t;return{start:Ky(e,!0),end:Ky(n,!1),line:Ky(r,!0)}}function Ky(t,e){if(typeof t=="string"||typeof t=="object"){const n=typeof t=="string"?Xd(t):t.source;return e?new RegExp(`^\\s*${n}`):new RegExp(`\\s*${n}\\s*$`)}else return t}class uk{constructor(e,n){this.elements=e,this.range=n}getTag(e){return this.getAllTags().find(n=>n.name===e)}getTags(e){return this.getAllTags().filter(n=>n.name===e)}getAllTags(){return this.elements.filter(e=>"name"in e)}toString(){let e="";for(const n of this.elements)if(e.length===0)e=n.toString();else{const r=n.toString();e+=dk(e)+r}return e.trim()}toMarkdown(e){let n="";for(const r of this.elements)if(n.length===0)n=r.toMarkdown(e);else{const i=r.toMarkdown(e);n+=dk(n)+i}return n.trim()}}class Yy{constructor(e,n,r,i){this.name=e,this.content=n,this.inline=r,this.range=i}toString(){let e=`@${this.name}`;const n=this.content.toString();return this.content.inlines.length===1?e=`${e} ${n}`:this.content.inlines.length>1&&(e=`${e}
118
+ ${n}`),this.inline?`{${e}}`:e}toMarkdown(e){var n,r;return(r=(n=e?.renderTag)===null||n===void 0?void 0:n.call(e,this))!==null&&r!==void 0?r:this.toMarkdownDefault(e)}toMarkdownDefault(e){const n=this.content.toMarkdown(e);if(this.inline){const s=hU(this.name,n,e??{});if(typeof s=="string")return s}let r="";e?.tag==="italic"||e?.tag===void 0?r="*":e?.tag==="bold"?r="**":e?.tag==="bold-italic"&&(r="***");let i=`${r}@${this.name}${r}`;return this.content.inlines.length===1?i=`${i} \u2014 ${n}`:this.content.inlines.length>1&&(i=`${i}
119
+ ${n}`),this.inline?`{${i}}`:i}}function hU(t,e,n){var r,i;if(t==="linkplain"||t==="linkcode"||t==="link"){const s=e.indexOf(" ");let o=e;if(s>0){const c=Hy(e,s);o=e.substring(c),e=e.substring(0,s)}return(t==="linkcode"||t==="link"&&n.link==="code")&&(o=`\`${o}\``),(i=(r=n.renderLink)===null||r===void 0?void 0:r.call(n,e,o))!==null&&i!==void 0?i:pU(e,o)}}function pU(t,e){try{return Jt.parse(t,!0),`[${e}](${t})`}catch{return t}}class Xy{constructor(e,n){this.inlines=e,this.range=n}toString(){let e="";for(let n=0;n<this.inlines.length;n++){const r=this.inlines[n],i=this.inlines[n+1];e+=r.toString(),i&&i.range.start.line>r.range.start.line&&(e+=`
120
+ `)}return e}toMarkdown(e){let n="";for(let r=0;r<this.inlines.length;r++){const i=this.inlines[r],s=this.inlines[r+1];n+=i.toMarkdown(e),s&&s.range.start.line>i.range.start.line&&(n+=`
121
+ `)}return n}}class lk{constructor(e,n){this.text=e,this.range=n}toString(){return this.text}toMarkdown(){return this.text}}function dk(t){return t.endsWith(`
122
+ `)?`
123
+ `:`
124
+
125
+ `}class gU{constructor(e){this.indexManager=e.shared.workspace.IndexManager,this.commentProvider=e.documentation.CommentProvider}getDocumentation(e){const n=this.commentProvider.getComment(e);if(n&&nU(n))return tU(n).toMarkdown({renderLink:(i,s)=>this.documentationLinkRenderer(e,i,s),renderTag:i=>this.documentationTagRenderer(e,i)})}documentationLinkRenderer(e,n,r){var i;const s=(i=this.findNameInPrecomputedScopes(e,n))!==null&&i!==void 0?i:this.findNameInGlobalScope(e,n);if(s&&s.nameSegment){const o=s.nameSegment.range.start.line+1,a=s.nameSegment.range.start.character+1,c=s.documentUri.with({fragment:`L${o},${a}`});return`[${r}](${c.toString()})`}else return}documentationTagRenderer(e,n){}findNameInPrecomputedScopes(e,n){const i=sn(e).precomputedScopes;if(!i)return;let s=e;do{const a=i.get(s).find(c=>c.name===n);if(a)return a;s=s.$container}while(s)}findNameInGlobalScope(e,n){return this.indexManager.allElements().find(i=>i.name===n)}}class mU{constructor(e){this.grammarConfig=()=>e.parser.GrammarConfig}getComment(e){var n;return Mj(e)?e.$comment:(n=Id(e.$cstNode,this.grammarConfig().multilineCommentRules))===null||n===void 0?void 0:n.text}}class yU{constructor(e){this.syncParser=e.parser.LangiumParser}parse(e,n){return Promise.resolve(this.syncParser.parse(e))}}class vU{constructor(){this.previousTokenSource=new ct.CancellationTokenSource,this.writeQueue=[],this.readQueue=[],this.done=!0}write(e){this.cancelWrite();const n=new ct.CancellationTokenSource;return this.previousTokenSource=n,this.enqueue(this.writeQueue,e,n.token)}read(e){return this.enqueue(this.readQueue,e)}enqueue(e,n,r=ct.CancellationToken.None){const i=new jy,s={action:n,deferred:i,cancellationToken:r};return e.push(s),this.performNextOperation(),i.promise}async performNextOperation(){if(!this.done)return;const e=[];if(this.writeQueue.length>0)e.push(this.writeQueue.shift());else if(this.readQueue.length>0)e.push(...this.readQueue.splice(0,this.readQueue.length));else return;this.done=!1,await Promise.all(e.map(async({action:n,deferred:r,cancellationToken:i})=>{try{const s=await Promise.resolve().then(()=>n(i));r.resolve(s)}catch(s){Yf(s)?r.resolve(void 0):r.reject(s)}})),this.done=!0,this.performNextOperation()}cancelWrite(){this.previousTokenSource.cancel()}}class wU{constructor(e){this.grammarElementIdMap=new VS,this.tokenTypeIdMap=new VS,this.grammar=e.Grammar,this.lexer=e.parser.Lexer,this.linker=e.references.Linker}dehydrate(e){return{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport?this.dehydrateLexerReport(e.lexerReport):void 0,parserErrors:e.parserErrors.map(n=>Object.assign(Object.assign({},n),{message:n.message})),value:this.dehydrateAstNode(e.value,this.createDehyrationContext(e.value))}}dehydrateLexerReport(e){return e}createDehyrationContext(e){const n=new Map,r=new Map;for(const i of ai(e))n.set(i,{});if(e.$cstNode)for(const i of Wa(e.$cstNode))r.set(i,{});return{astNodes:n,cstNodes:r}}dehydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode!==void 0&&(r.$cstNode=this.dehydrateCstNode(e.$cstNode,n));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)vt(a)?o.push(this.dehydrateAstNode(a,n)):Wn(a)?o.push(this.dehydrateReference(a,n)):o.push(a)}else vt(s)?r[i]=this.dehydrateAstNode(s,n):Wn(s)?r[i]=this.dehydrateReference(s,n):s!==void 0&&(r[i]=s);return r}dehydrateReference(e,n){const r={};return r.$refText=e.$refText,e.$refNode&&(r.$refNode=n.cstNodes.get(e.$refNode)),r}dehydrateCstNode(e,n){const r=n.cstNodes.get(e);return _D(e)?r.fullText=e.fullText:r.grammarSource=this.getGrammarElementId(e.grammarSource),r.hidden=e.hidden,r.astNode=n.astNodes.get(e.astNode),ii(e)?r.content=e.content.map(i=>this.dehydrateCstNode(i,n)):$s(e)&&(r.tokenType=e.tokenType.name,r.offset=e.offset,r.length=e.length,r.startLine=e.range.start.line,r.startColumn=e.range.start.character,r.endLine=e.range.end.line,r.endColumn=e.range.end.character),r}hydrate(e){const n=e.value,r=this.createHydrationContext(n);return"$cstNode"in n&&this.hydrateCstNode(n.$cstNode,r),{lexerErrors:e.lexerErrors,lexerReport:e.lexerReport,parserErrors:e.parserErrors,value:this.hydrateAstNode(n,r)}}createHydrationContext(e){const n=new Map,r=new Map;for(const s of ai(e))n.set(s,{});let i;if(e.$cstNode)for(const s of Wa(e.$cstNode)){let o;"fullText"in s?(o=new _S(s.fullText),i=o):"content"in s?o=new My:"tokenType"in s&&(o=this.hydrateCstLeafNode(s)),o&&(r.set(s,o),o.root=i)}return{astNodes:n,cstNodes:r}}hydrateAstNode(e,n){const r=n.astNodes.get(e);r.$type=e.$type,r.$containerIndex=e.$containerIndex,r.$containerProperty=e.$containerProperty,e.$cstNode&&(r.$cstNode=n.cstNodes.get(e.$cstNode));for(const[i,s]of Object.entries(e))if(!i.startsWith("$"))if(Array.isArray(s)){const o=[];r[i]=o;for(const a of s)vt(a)?o.push(this.setParent(this.hydrateAstNode(a,n),r)):Wn(a)?o.push(this.hydrateReference(a,r,i,n)):o.push(a)}else vt(s)?r[i]=this.setParent(this.hydrateAstNode(s,n),r):Wn(s)?r[i]=this.hydrateReference(s,r,i,n):s!==void 0&&(r[i]=s);return r}setParent(e,n){return e.$container=n,e}hydrateReference(e,n,r,i){return this.linker.buildReference(n,r,i.cstNodes.get(e.$refNode),e.$refText)}hydrateCstNode(e,n,r=0){const i=n.cstNodes.get(e);if(typeof e.grammarSource=="number"&&(i.grammarSource=this.getGrammarElement(e.grammarSource)),i.astNode=n.astNodes.get(e.astNode),ii(i))for(const s of e.content){const o=this.hydrateCstNode(s,n,r++);i.content.push(o)}return i}hydrateCstLeafNode(e){const n=this.getTokenType(e.tokenType),r=e.offset,i=e.length,s=e.startLine,o=e.startColumn,a=e.endLine,c=e.endColumn,u=e.hidden;return new Ly(r,i,{start:{line:s,character:o},end:{line:a,character:c}},n,u)}getTokenType(e){return this.lexer.definition[e]}getGrammarElementId(e){return this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap(),this.grammarElementIdMap.get(e)}getGrammarElement(e){this.grammarElementIdMap.size===0&&this.createGrammarElementIdMap();const n=this.grammarElementIdMap.getKey(e);if(n)return n;throw new Error("Invalid grammar element id: "+e)}createGrammarElementIdMap(){let e=0;for(const n of ai(this.grammar))sm(n)&&this.grammarElementIdMap.set(n,e++)}}function fk(t){return{documentation:{CommentProvider:e=>new mU(e),DocumentationProvider:e=>new gU(e)},parser:{AsyncParser:e=>new yU(e),GrammarConfig:e=>NM(e),LangiumParser:e=>Rj(e),CompletionParser:e=>Tj(e),ValueConverter:()=>new $j,TokenBuilder:()=>new kj,Lexer:e=>new Qj(e),ParserErrorMessageProvider:()=>new PS},workspace:{AstNodeLocator:()=>new Vj,AstNodeDescriptionProvider:e=>new Wj(e),ReferenceDescriptionProvider:e=>new Hj(e)},references:{Linker:e=>new Pj(e),NameProvider:()=>new Nj,ScopeProvider:e=>new QS(e),ScopeComputation:e=>new KS(e),References:e=>new Oj(e)},serializer:{Hydrator:e=>new wU(e),JsonSerializer:e=>new zj(e)},validation:{DocumentValidator:e=>new jj(e),ValidationRegistry:e=>new qj(e)},shared:()=>t.shared}}function hk(t){return{ServiceRegistry:e=>new Bj(e),workspace:{LangiumDocuments:e=>new Ij(e),LangiumDocumentFactory:e=>new xj(e),DocumentBuilder:e=>new Xj(e),IndexManager:e=>new Jj(e),WorkspaceManager:e=>new tk(e),FileSystemProvider:e=>t.fileSystemProvider(e),WorkspaceLock:()=>new vU,ConfigurationProvider:e=>new Yj(e)}}}var Zf;(function(t){t.merge=(e,n)=>eh(eh({},e),n)})(Zf||(Zf={}));function Qf(t,e,n,r,i,s,o,a,c){const u=[t,e,n,r,i,s,o,a,c].reduce(eh,{});return gk(u)}const pk=Symbol("isProxy");function Jy(t){if(t&&t[pk])for(const e of Object.values(t))Jy(e);return t}function gk(t,e){const n=new Proxy({},{deleteProperty:()=>!1,set:()=>{throw new Error("Cannot set property on injected service container")},get:(r,i)=>i===pk?!0:yk(r,i,t,e||n),getOwnPropertyDescriptor:(r,i)=>(yk(r,i,t,e||n),Object.getOwnPropertyDescriptor(r,i)),has:(r,i)=>i in t,ownKeys:()=>[...Object.getOwnPropertyNames(t)]});return n}const mk=Symbol();function yk(t,e,n,r){if(e in t){if(t[e]instanceof Error)throw new Error("Construction failure. Please make sure that your dependencies are constructable.",{cause:t[e]});if(t[e]===mk)throw new Error('Cycle detected. Please make "'+String(e)+'" lazy. Visit https://langium.org/docs/reference/configuration-services/#resolving-cyclic-dependencies');return t[e]}else if(e in n){const i=n[e];t[e]=mk;try{t[e]=typeof i=="function"?i(r):gk(i,r)}catch(s){throw t[e]=s instanceof Error?s:void 0,s}return t[e]}else return}function eh(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=eh(i,r):t[n]=r}}return t}class bU{readFile(){throw new Error("No file system is available.")}async readDirectory(){return[]}}const vk={fileSystemProvider:()=>new bU},EU={Grammar:()=>{},LanguageMetaData:()=>({caseInsensitive:!1,fileExtensions:[".langium"],languageId:"langium"})},DU={AstReflection:()=>new GD};function TU(){const t=Qf(hk(vk),DU),e=Qf(fk({shared:t}),EU);return t.ServiceRegistry.register(e),e}function RU(t){var e;const n=TU(),r=n.serializer.JsonSerializer.deserialize(t);return n.shared.workspace.LangiumDocumentFactory.fromModel(r,Jt.parse(`memory://${(e=r.name)!==null&&e!==void 0?e:"grammar"}.langium`)),r}var SU={done:!0,hasNext:!1},ra={done:!1,hasNext:!1},wk=()=>SU,kU=t=>({hasNext:!0,next:t,done:!1});function Ke(t,...e){let n=t,r=e.map(s=>"lazy"in s?$U(s):void 0),i=0;for(;i<e.length;){if(r[i]===void 0||!CU(n)){let c=e[i];n=c(n),i+=1;continue}let s=[];for(let c=i;c<e.length;c++){let u=r[c];if(u===void 0||(s.push(u),u.isSingle))break}let o=[];for(let c of n)if(bk(c,o,s))break;let{isSingle:a}=s.at(-1);n=a?o[0]:o,i+=s.length}return n}function bk(t,e,n){if(n.length===0)return e.push(t),!1;let r=t,i=ra,s=!1;for(let[o,a]of n.entries()){let{index:c,items:u}=a;if(u.push(r),i=a(r,c,u),a.index+=1,i.hasNext){if(i.hasMany??!1){for(let l of i.next)if(bk(l,e,n.slice(o+1)))return!0;return s}r=i.next}if(!i.hasNext)break;i.done&&(s=!0)}return i.hasNext&&e.push(r),s}function $U(t){let{lazy:e,lazyArgs:n}=t,r=e(...n);return Object.assign(r,{isSingle:e.single??!1,index:0,items:[]})}function CU(t){return typeof t=="string"||typeof t=="object"&&t!==null&&Symbol.iterator in t}function Zy(t,e){let n=e.length-t.length;if(n===1){let[r,...i]=e;return Ke(r,{lazy:t,lazyArgs:i})}if(n===0){let r={lazy:t,lazyArgs:e};return Object.assign(i=>Ke(i,r),r)}throw new Error("Wrong number of arguments")}function Br(...t){return Zy(_U,t)}function _U(){let t=new Set;return e=>t.has(e)?ra:(t.add(e),{done:!1,hasNext:!0,next:e})}function AU(t,e,n){let r=i=>t(i,...e);return n===void 0?r:Object.assign(r,{lazy:n,lazyArgs:e})}function Ye(t,e,n){let r=t.length-e.length;if(r===0)return t(...e);if(r===1)return AU(t,e,n);throw new Error("Wrong number of arguments")}function th(...t){return Ye(Object.values,t)}function xU(...t){return Ye(IU,t)}function IU(t,e){return e(t),t}function PU(...t){return Ye(NU,t,OU)}var NU=(t,e)=>e<0?[]:t.slice(0,e);function OU(t){if(t<=0)return wk;let e=t;return n=>(e-=1,{done:e<=0,hasNext:!0,next:n})}function qr(...t){return Ye(FU,t)}var FU=(t,e)=>t.length>=e,Ek={asc:(t,e)=>t>e,desc:(t,e)=>t<e};function LU(t,e){let[n,...r]=e;if(!MU(n)){let s=Qy(...r);return t(n,s)}let i=Qy(n,...r);return s=>t(s,i)}function Qy(t,e,...n){let r=typeof t=="function"?t:t[0],i=typeof t=="function"?"asc":t[1],{[i]:s}=Ek,o=e===void 0?void 0:Qy(e,...n);return(a,c)=>{let u=r(a),l=r(c);return s(u,l)?1:s(l,u)?-1:o?.(a,c)??0}}function MU(t){if(Dk(t))return!0;if(typeof t!="object"||!Array.isArray(t))return!1;let[e,n,...r]=t;return Dk(e)&&typeof n=="string"&&n in Ek&&r.length===0}var Dk=t=>typeof t=="function"&&t.length===1;function ia(...t){return Ye(zU,t)}function zU(t,e){let n=[...t];return n.sort(e),n}function BU(...t){return LU(qU,t)}var qU=(t,e)=>[...t].sort(e);function Tk(...t){return Ye(jU,t)}var jU=(t,e,n)=>t.reduce(e,n);function nh(...t){return Ye(UU,t)}function UU(t){return[...t].reverse()}function ev(...t){return e=>Ke(e,...t)}function yr(...t){return Ye(GU,t)}var GU=(t,e)=>t[e];function Rk(...t){return Ye(WU,t)}function WU(t,e){if(!qr(e,1))return{...t};if(!qr(e,2)){let{[e[0]]:r,...i}=t;return i}let n={...t};for(let r of e)delete n[r];return n}function Sk(...t){return Ye(HU,t)}function HU(t,e){let n={...t};for(let[r,i]of Object.entries(n))e(i,r,t)&&delete n[r];return n}function kn(...t){return Ye(VU,t)}var VU=t=>t.length===1?t[0]:void 0;function kk(...t){return Ye(KU,t)}function KU(t,e){let n={};for(let r of e)r in t&&(n[r]=t[r]);return n}function sa(...t){return Ye(YU,t)}var YU=t=>t.at(-1);function ut(...t){return Ye(XU,t,JU)}var XU=(t,e)=>t.map(e),JU=t=>(e,n,r)=>({done:!1,hasNext:!0,next:t(e,n,r)});function vi(...t){return Ye(ZU,t)}function ZU(t,e){let n={};for(let[r,i]of t.entries()){let[s,o]=e(i,r,t);n[s]=o}return n}function Wi(...t){return Ye(QU,t)}function QU(t,e){let n={};for(let[r,i]of Object.entries(t)){let s=e(i,r,t);n[r]=s}return n}function Hi(t){return typeof t=="string"}function ce(t){return!!t}function e9(t){return t!==null}function jr(t){return t!=null}function t9(t){return e=>!t(e)}function Dt(t){return t==null}function rh(t){return typeof t=="number"&&!Number.isNaN(t)}function $k(t){return Array.isArray(t)}function Ft(t){return t!==void 0}function Vi(t){return t===void 0?!0:typeof t=="string"||Array.isArray(t)?t.length===0:Object.keys(t).length===0}function tv(t){return t instanceof Error}function ih(...t){return Ye(n9,t)}function n9(t,e){let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);n[s]=i}return n}function r9(...t){return Zy(i9,t)}function i9(t){if(t.length===0)return wk;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);return n=>{let r=e.get(n);return r===void 0||r===0?ra:(r===1?e.delete(n):e.set(n,r-1),{hasNext:!0,next:n,done:e.size===0})}}function Ki(...t){return Ye(s9,t,o9)}var s9=(t,e)=>t.flatMap(e),o9=t=>(e,n,r)=>{let i=t(e,n,r);return Array.isArray(i)?{done:!1,hasNext:!0,hasMany:!0,next:i}:{done:!1,hasNext:!0,next:i}};function Ck(...t){return Ye(a9,t,c9)}function a9(t,e){return t.forEach(e),t}var c9=t=>(e,n,r)=>(t(e,n,r),{done:!1,hasNext:!0,next:e});function sh(...t){return Ye(u9,t)}var u9=(t,e)=>{let n={};for(let[r,i]of t.entries()){let s=e(i,r,t);if(s!==void 0){let{[s]:o}=n;o===void 0&&(o=[],n[s]=o),o.push(i)}}return n};function nt(...t){return Ye(l9,t,d9)}var l9=(t,e)=>t.filter(e),d9=t=>(e,n,r)=>t(e,n,r)?{done:!1,hasNext:!0,next:e}:ra,_k=t=>Object.assign(t,{single:!0});function Ak(...t){return Ye(f9,t,_k(h9))}var f9=(t,e)=>t.find(e),h9=t=>(e,n,r)=>t(e,n,r)?{done:!0,hasNext:!0,next:e}:ra;function p9(...t){return Ye(g9,t)}var g9=(t,e)=>{for(let n=t.length-1;n>=0;n--){let r=t[n];if(e(r,n,t))return r}};function oa(...t){return Ye(m9,t,_k(y9))}var m9=([t])=>t,y9=()=>v9,v9=t=>({hasNext:!0,next:t,done:!0});function Us(...t){return Ye(Object.entries,t)}function w9(...t){return Ye(b9,t)}var b9=(t,e)=>[...t,...e];function E9(t,{waitMs:e,timing:n="trailing",maxWaitMs:r}){if(r!==void 0&&e!==void 0&&r<e)throw new Error(`debounce: maxWaitMs (${r.toString()}) cannot be less than waitMs (${e.toString()})`);let i,s,o,a,c=()=>{if(s!==void 0){let f=s;s=void 0,clearTimeout(f)}if(o===void 0)throw new Error("REMEDA[debounce]: latestCallArgs was unexpectedly undefined.");let d=o;o=void 0,a=t(...d)},u=()=>{if(i===void 0)return;let d=i;i=void 0,clearTimeout(d),o!==void 0&&c()},l=d=>{o=d,r!==void 0&&s===void 0&&(s=setTimeout(c,r))};return{call:(...d)=>{if(i===void 0)n==="trailing"?l(d):a=t(...d);else{n!=="leading"&&l(d);let f=i;i=void 0,clearTimeout(f)}return i=setTimeout(u,e??r??0),a},cancel:()=>{if(i!==void 0){let d=i;i=void 0,clearTimeout(d)}if(s!==void 0){let d=s;s=void 0,clearTimeout(d)}o=void 0},flush:()=>(u(),a),get isPending(){return i!==void 0},get cachedValue(){return a}}}function xk(...t){return Zy(D9,t)}function D9(t){if(t.length===0)return kU;let e=new Map;for(let n of t)e.set(n,(e.get(n)??0)+1);return n=>{let r=e.get(n);return r===void 0||r===0?{done:!1,hasNext:!0,next:n}:(e.set(n,r-1),ra)}}function Ik(...t){return Ye(T9,t)}var T9=(t,e)=>e.every(n=>n(t));function nv(...t){return Ye(R9,t)}var R9=(t,e)=>e.some(n=>n(t));function S9(...t){return Ye(k9,t)}function k9(t,e){if(e<1)throw new RangeError(`chunk: A chunk size of '${e.toString()}' would result in an infinite array`);if(t.length===0)return[];if(e>=t.length)return[[...t]];let n=Math.ceil(t.length/e),r=new Array(n);if(e===1)for(let[i,s]of t.entries())r[i]=[s];else for(let i=0;i<n;i+=1){let s=i*e;r[i]=t.slice(s,s+e)}return r}function Pk(...t){return Ye($9,t)}var $9=(t,{min:e,max:n})=>e!==void 0&&t<e?e:n!==void 0&&t>n?n:t,C9={reset:[0,0],bold:[1,22,"\x1B[22m\x1B[1m"],dim:[2,22,"\x1B[22m\x1B[2m"],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29],black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],gray:[90,39],bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]},_9=Object.entries(C9);function rv(t){return String(t)}rv.open="",rv.close="";function A9(t=!1){let e=typeof process<"u"?process:void 0,n=e?.env||{},r=e?.argv||[];return!("NO_COLOR"in n||r.includes("--no-color"))&&("FORCE_COLOR"in n||r.includes("--color")||e?.platform==="win32"||t&&n.TERM!=="dumb"||"CI"in n)||typeof window<"u"&&!!window.chrome}function x9(t=!1){let e=A9(t),n=(o,a,c,u)=>{let l="",d=0;do l+=o.substring(d,u)+c,d=u+a.length,u=o.indexOf(a,d);while(~u);return l+o.substring(d)},r=(o,a,c=o)=>{let u=l=>{let d=String(l),f=d.indexOf(a,o.length);return~f?o+n(d,a,c,f)+a:o+d+a};return u.open=o,u.close=a,u},i={isColorSupported:e},s=o=>`\x1B[${o}m`;for(let[o,a]of _9)i[o]=e?r(s(a[0]),s(a[1]),a[2]):rv;return i}var lt=x9(pO(1)),Gs={};const I9=li(gO);var Tt={},Nk;function iv(){if(Nk)return Tt;Nk=1,Object.defineProperty(Tt,"__esModule",{value:!0}),Tt.thenable=Tt.typedArray=Tt.stringArray=Tt.array=Tt.func=Tt.error=Tt.number=Tt.string=Tt.boolean=void 0;function t(u){return u===!0||u===!1}Tt.boolean=t;function e(u){return typeof u=="string"||u instanceof String}Tt.string=e;function n(u){return typeof u=="number"||u instanceof Number}Tt.number=n;function r(u){return u instanceof Error}Tt.error=r;function i(u){return typeof u=="function"}Tt.func=i;function s(u){return Array.isArray(u)}Tt.array=s;function o(u){return s(u)&&u.every(l=>e(l))}Tt.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}Tt.typedArray=a;function c(u){return u&&i(u.then)}return Tt.thenable=c,Tt}var qe={},Ws={},Hs={},oh={};const P9=li(OO);var sv={},pe={},Ok;function Fk(){if(Ok)return pe;Ok=1,Object.defineProperty(pe,"__esModule",{value:!0}),pe.Message=pe.NotificationType9=pe.NotificationType8=pe.NotificationType7=pe.NotificationType6=pe.NotificationType5=pe.NotificationType4=pe.NotificationType3=pe.NotificationType2=pe.NotificationType1=pe.NotificationType0=pe.NotificationType=pe.RequestType9=pe.RequestType8=pe.RequestType7=pe.RequestType6=pe.RequestType5=pe.RequestType4=pe.RequestType3=pe.RequestType2=pe.RequestType1=pe.RequestType=pe.RequestType0=pe.AbstractMessageSignature=pe.ParameterStructures=pe.ResponseError=pe.ErrorCodes=void 0;const t=Zc();var e;(function(D){D.ParseError=-32700,D.InvalidRequest=-32600,D.MethodNotFound=-32601,D.InvalidParams=-32602,D.InternalError=-32603,D.jsonrpcReservedErrorRangeStart=-32099,D.serverErrorStart=-32099,D.MessageWriteError=-32099,D.MessageReadError=-32098,D.PendingResponseRejected=-32097,D.ConnectionInactive=-32096,D.ServerNotInitialized=-32002,D.UnknownErrorCode=-32001,D.jsonrpcReservedErrorRangeEnd=-32e3,D.serverErrorEnd=-32e3})(e||(pe.ErrorCodes=e={}));class n extends Error{constructor(R,L,W){super(L),this.code=t.number(R)?R:e.UnknownErrorCode,this.data=W,Object.setPrototypeOf(this,n.prototype)}toJson(){const R={code:this.code,message:this.message};return this.data!==void 0&&(R.data=this.data),R}}pe.ResponseError=n;class r{constructor(R){this.kind=R}static is(R){return R===r.auto||R===r.byName||R===r.byPosition}toString(){return this.kind}}pe.ParameterStructures=r,r.auto=new r("auto"),r.byPosition=new r("byPosition"),r.byName=new r("byName");class i{constructor(R,L){this.method=R,this.numberOfParams=L}get parameterStructures(){return r.auto}}pe.AbstractMessageSignature=i;class s extends i{constructor(R){super(R,0)}}pe.RequestType0=s;class o extends i{constructor(R,L=r.auto){super(R,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}pe.RequestType=o;class a extends i{constructor(R,L=r.auto){super(R,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}pe.RequestType1=a;class c extends i{constructor(R){super(R,2)}}pe.RequestType2=c;class u extends i{constructor(R){super(R,3)}}pe.RequestType3=u;class l extends i{constructor(R){super(R,4)}}pe.RequestType4=l;class d extends i{constructor(R){super(R,5)}}pe.RequestType5=d;class f extends i{constructor(R){super(R,6)}}pe.RequestType6=f;class h extends i{constructor(R){super(R,7)}}pe.RequestType7=h;class p extends i{constructor(R){super(R,8)}}pe.RequestType8=p;class g extends i{constructor(R){super(R,9)}}pe.RequestType9=g;class y extends i{constructor(R,L=r.auto){super(R,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}pe.NotificationType=y;class m extends i{constructor(R){super(R,0)}}pe.NotificationType0=m;class w extends i{constructor(R,L=r.auto){super(R,1),this._parameterStructures=L}get parameterStructures(){return this._parameterStructures}}pe.NotificationType1=w;class E extends i{constructor(R){super(R,2)}}pe.NotificationType2=E;class k extends i{constructor(R){super(R,3)}}pe.NotificationType3=k;class A extends i{constructor(R){super(R,4)}}pe.NotificationType4=A;class I extends i{constructor(R){super(R,5)}}pe.NotificationType5=I;class x extends i{constructor(R){super(R,6)}}pe.NotificationType6=x;class _ extends i{constructor(R){super(R,7)}}pe.NotificationType7=_;class P extends i{constructor(R){super(R,8)}}pe.NotificationType8=P;class O extends i{constructor(R){super(R,9)}}pe.NotificationType9=O;var C;return function(D){function R(V){const Z=V;return Z&&t.string(Z.method)&&(t.string(Z.id)||t.number(Z.id))}D.isRequest=R;function L(V){const Z=V;return Z&&t.string(Z.method)&&V.id===void 0}D.isNotification=L;function W(V){const Z=V;return Z&&(Z.result!==void 0||!!Z.error)&&(t.string(Z.id)||t.number(Z.id)||Z.id===null)}D.isResponse=W}(C||(pe.Message=C={})),pe}var wi={},Lk;function Mk(){if(Lk)return wi;Lk=1;var t;Object.defineProperty(wi,"__esModule",{value:!0}),wi.LRUCache=wi.LinkedMap=wi.Touch=void 0;var e;(function(i){i.None=0,i.First=1,i.AsOld=i.First,i.Last=2,i.AsNew=i.Last})(e||(wi.Touch=e={}));class n{constructor(){this[t]="LinkedMap",this._map=new Map,this._head=void 0,this._tail=void 0,this._size=0,this._state=0}clear(){this._map.clear(),this._head=void 0,this._tail=void 0,this._size=0,this._state++}isEmpty(){return!this._head&&!this._tail}get size(){return this._size}get first(){return this._head?.value}get last(){return this._tail?.value}has(s){return this._map.has(s)}get(s,o=e.None){const a=this._map.get(s);if(a)return o!==e.None&&this.touch(a,o),a.value}set(s,o,a=e.None){let c=this._map.get(s);if(c)c.value=o,a!==e.None&&this.touch(c,a);else{switch(c={key:s,value:o,next:void 0,previous:void 0},a){case e.None:this.addItemLast(c);break;case e.First:this.addItemFirst(c);break;case e.Last:this.addItemLast(c);break;default:this.addItemLast(c);break}this._map.set(s,c),this._size++}return this}delete(s){return!!this.remove(s)}remove(s){const o=this._map.get(s);if(o)return this._map.delete(s),this.removeItem(o),this._size--,o.value}shift(){if(!this._head&&!this._tail)return;if(!this._head||!this._tail)throw new Error("Invalid list");const s=this._head;return this._map.delete(s.key),this.removeItem(s),this._size--,s.value}forEach(s,o){const a=this._state;let c=this._head;for(;c;){if(o?s.bind(o)(c.value,c.key,this):s(c.value,c.key,this),this._state!==a)throw new Error("LinkedMap got modified during iteration.");c=c.next}}keys(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.key,done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}values(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:o.value,done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}entries(){const s=this._state;let o=this._head;const a={[Symbol.iterator]:()=>a,next:()=>{if(this._state!==s)throw new Error("LinkedMap got modified during iteration.");if(o){const c={value:[o.key,o.value],done:!1};return o=o.next,c}else return{value:void 0,done:!0}}};return a}[(t=Symbol.toStringTag,Symbol.iterator)](){return this.entries()}trimOld(s){if(s>=this.size)return;if(s===0){this.clear();return}let o=this._head,a=this.size;for(;o&&a>s;)this._map.delete(o.key),o=o.next,a--;this._head=o,this._size=a,o&&(o.previous=void 0),this._state++}addItemFirst(s){if(!this._head&&!this._tail)this._tail=s;else if(this._head)s.next=this._head,this._head.previous=s;else throw new Error("Invalid list");this._head=s,this._state++}addItemLast(s){if(!this._head&&!this._tail)this._head=s;else if(this._tail)s.previous=this._tail,this._tail.next=s;else throw new Error("Invalid list");this._tail=s,this._state++}removeItem(s){if(s===this._head&&s===this._tail)this._head=void 0,this._tail=void 0;else if(s===this._head){if(!s.next)throw new Error("Invalid list");s.next.previous=void 0,this._head=s.next}else if(s===this._tail){if(!s.previous)throw new Error("Invalid list");s.previous.next=void 0,this._tail=s.previous}else{const o=s.next,a=s.previous;if(!o||!a)throw new Error("Invalid list");o.previous=a,a.next=o}s.next=void 0,s.previous=void 0,this._state++}touch(s,o){if(!this._head||!this._tail)throw new Error("Invalid list");if(!(o!==e.First&&o!==e.Last)){if(o===e.First){if(s===this._head)return;const a=s.next,c=s.previous;s===this._tail?(c.next=void 0,this._tail=c):(a.previous=c,c.next=a),s.previous=void 0,s.next=this._head,this._head.previous=s,this._head=s,this._state++}else if(o===e.Last){if(s===this._tail)return;const a=s.next,c=s.previous;s===this._head?(a.previous=void 0,this._head=a):(a.previous=c,c.next=a),s.next=void 0,s.previous=this._tail,this._tail.next=s,this._tail=s,this._state++}}}toJSON(){const s=[];return this.forEach((o,a)=>{s.push([a,o])}),s}fromJSON(s){this.clear();for(const[o,a]of s)this.set(o,a)}}wi.LinkedMap=n;class r extends n{constructor(s,o=1){super(),this._limit=s,this._ratio=Math.min(Math.max(0,o),1)}get limit(){return this._limit}set limit(s){this._limit=s,this.checkTrim()}get ratio(){return this._ratio}set ratio(s){this._ratio=Math.min(Math.max(0,s),1),this.checkTrim()}get(s,o=e.AsNew){return super.get(s,o)}peek(s){return super.get(s,e.None)}set(s,o){return super.set(s,o,e.Last),this.checkTrim(),this}checkTrim(){this.size>this._limit&&this.trimOld(Math.round(this._limit*this._ratio))}}return wi.LRUCache=r,wi}var nu={},zk;function N9(){if(zk)return nu;zk=1,Object.defineProperty(nu,"__esModule",{value:!0}),nu.Disposable=void 0;var t;return function(e){function n(r){return{dispose:r}}e.create=n}(t||(nu.Disposable=t={})),nu}var Vs={},Bk;function O9(){if(Bk)return Vs;Bk=1,Object.defineProperty(Vs,"__esModule",{value:!0}),Vs.SharedArrayReceiverStrategy=Vs.SharedArraySenderStrategy=void 0;const t=Vf();var e;(function(o){o.Continue=0,o.Cancelled=1})(e||(e={}));class n{constructor(){this.buffers=new Map}enableCancellation(a){if(a.id===null)return;const c=new SharedArrayBuffer(4),u=new Int32Array(c,0,1);u[0]=e.Continue,this.buffers.set(a.id,c),a.$cancellationData=c}async sendCancellation(a,c){const u=this.buffers.get(c);if(u===void 0)return;const l=new Int32Array(u,0,1);Atomics.store(l,0,e.Cancelled)}cleanup(a){this.buffers.delete(a)}dispose(){this.buffers.clear()}}Vs.SharedArraySenderStrategy=n;class r{constructor(a){this.data=new Int32Array(a,0,1)}get isCancellationRequested(){return Atomics.load(this.data,0)===e.Cancelled}get onCancellationRequested(){throw new Error("Cancellation over SharedArrayBuffer doesn't support cancellation events")}}class i{constructor(a){this.token=new r(a)}cancel(){}dispose(){}}class s{constructor(){this.kind="request"}createCancellationTokenSource(a){const c=a.$cancellationData;return c===void 0?new t.CancellationTokenSource:new i(c)}}return Vs.SharedArrayReceiverStrategy=s,Vs}var bi={},ru={},qk;function jk(){if(qk)return ru;qk=1,Object.defineProperty(ru,"__esModule",{value:!0}),ru.Semaphore=void 0;const t=Bs();class e{constructor(r=1){if(r<=0)throw new Error("Capacity must be greater than 0");this._capacity=r,this._active=0,this._waiting=[]}lock(r){return new Promise((i,s)=>{this._waiting.push({thunk:r,resolve:i,reject:s}),this.runNext()})}get active(){return this._active}runNext(){this._waiting.length===0||this._active===this._capacity||(0,t.default)().timer.setImmediate(()=>this.doRunNext())}doRunNext(){if(this._waiting.length===0||this._active===this._capacity)return;const r=this._waiting.shift();if(this._active++,this._active>this._capacity)throw new Error("To many thunks active");try{const i=r.thunk();i instanceof Promise?i.then(s=>{this._active--,r.resolve(s),this.runNext()},s=>{this._active--,r.reject(s),this.runNext()}):(this._active--,r.resolve(i),this.runNext())}catch(i){this._active--,r.reject(i),this.runNext()}}}return ru.Semaphore=e,ru}var Uk;function F9(){if(Uk)return bi;Uk=1,Object.defineProperty(bi,"__esModule",{value:!0}),bi.ReadableStreamMessageReader=bi.AbstractMessageReader=bi.MessageReader=void 0;const t=Bs(),e=Zc(),n=na(),r=jk();var i;(function(c){function u(l){let d=l;return d&&e.func(d.listen)&&e.func(d.dispose)&&e.func(d.onError)&&e.func(d.onClose)&&e.func(d.onPartialMessage)}c.is=u})(i||(bi.MessageReader=i={}));class s{constructor(){this.errorEmitter=new n.Emitter,this.closeEmitter=new n.Emitter,this.partialMessageEmitter=new n.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(u){this.errorEmitter.fire(this.asError(u))}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}get onPartialMessage(){return this.partialMessageEmitter.event}firePartialMessage(u){this.partialMessageEmitter.fire(u)}asError(u){return u instanceof Error?u:new Error(`Reader received error. Reason: ${e.string(u.message)?u.message:"unknown"}`)}}bi.AbstractMessageReader=s;var o;(function(c){function u(l){let d,f;const h=new Map;let p;const g=new Map;if(l===void 0||typeof l=="string")d=l??"utf-8";else{if(d=l.charset??"utf-8",l.contentDecoder!==void 0&&(f=l.contentDecoder,h.set(f.name,f)),l.contentDecoders!==void 0)for(const y of l.contentDecoders)h.set(y.name,y);if(l.contentTypeDecoder!==void 0&&(p=l.contentTypeDecoder,g.set(p.name,p)),l.contentTypeDecoders!==void 0)for(const y of l.contentTypeDecoders)g.set(y.name,y)}return p===void 0&&(p=(0,t.default)().applicationJson.decoder,g.set(p.name,p)),{charset:d,contentDecoder:f,contentDecoders:h,contentTypeDecoder:p,contentTypeDecoders:g}}c.fromOptions=u})(o||(o={}));class a extends s{constructor(u,l){super(),this.readable=u,this.options=o.fromOptions(l),this.buffer=(0,t.default)().messageBuffer.create(this.options.charset),this._partialMessageTimeout=1e4,this.nextMessageLength=-1,this.messageToken=0,this.readSemaphore=new r.Semaphore(1)}set partialMessageTimeout(u){this._partialMessageTimeout=u}get partialMessageTimeout(){return this._partialMessageTimeout}listen(u){this.nextMessageLength=-1,this.messageToken=0,this.partialMessageTimer=void 0,this.callback=u;const l=this.readable.onData(d=>{this.onData(d)});return this.readable.onError(d=>this.fireError(d)),this.readable.onClose(()=>this.fireClose()),l}onData(u){try{for(this.buffer.append(u);;){if(this.nextMessageLength===-1){const d=this.buffer.tryReadHeaders(!0);if(!d)return;const f=d.get("content-length");if(!f){this.fireError(new Error(`Header must provide a Content-Length property.
126
+ ${JSON.stringify(Object.fromEntries(d))}`));return}const h=parseInt(f);if(isNaN(h)){this.fireError(new Error(`Content-Length value must be a number. Got ${f}`));return}this.nextMessageLength=h}const l=this.buffer.tryReadBody(this.nextMessageLength);if(l===void 0){this.setPartialMessageTimer();return}this.clearPartialMessageTimer(),this.nextMessageLength=-1,this.readSemaphore.lock(async()=>{const d=this.options.contentDecoder!==void 0?await this.options.contentDecoder.decode(l):l,f=await this.options.contentTypeDecoder.decode(d,this.options);this.callback(f)}).catch(d=>{this.fireError(d)})}}catch(l){this.fireError(l)}}clearPartialMessageTimer(){this.partialMessageTimer&&(this.partialMessageTimer.dispose(),this.partialMessageTimer=void 0)}setPartialMessageTimer(){this.clearPartialMessageTimer(),!(this._partialMessageTimeout<=0)&&(this.partialMessageTimer=(0,t.default)().timer.setTimeout((u,l)=>{this.partialMessageTimer=void 0,u===this.messageToken&&(this.firePartialMessage({messageToken:u,waitingTime:l}),this.setPartialMessageTimer())},this._partialMessageTimeout,this.messageToken,this._partialMessageTimeout))}}return bi.ReadableStreamMessageReader=a,bi}var Ei={},Gk;function L9(){if(Gk)return Ei;Gk=1,Object.defineProperty(Ei,"__esModule",{value:!0}),Ei.WriteableStreamMessageWriter=Ei.AbstractMessageWriter=Ei.MessageWriter=void 0;const t=Bs(),e=Zc(),n=jk(),r=na(),i="Content-Length: ",s=`\r
127
+ `;var o;(function(l){function d(f){let h=f;return h&&e.func(h.dispose)&&e.func(h.onClose)&&e.func(h.onError)&&e.func(h.write)}l.is=d})(o||(Ei.MessageWriter=o={}));class a{constructor(){this.errorEmitter=new r.Emitter,this.closeEmitter=new r.Emitter}dispose(){this.errorEmitter.dispose(),this.closeEmitter.dispose()}get onError(){return this.errorEmitter.event}fireError(d,f,h){this.errorEmitter.fire([this.asError(d),f,h])}get onClose(){return this.closeEmitter.event}fireClose(){this.closeEmitter.fire(void 0)}asError(d){return d instanceof Error?d:new Error(`Writer received error. Reason: ${e.string(d.message)?d.message:"unknown"}`)}}Ei.AbstractMessageWriter=a;var c;(function(l){function d(f){return f===void 0||typeof f=="string"?{charset:f??"utf-8",contentTypeEncoder:(0,t.default)().applicationJson.encoder}:{charset:f.charset??"utf-8",contentEncoder:f.contentEncoder,contentTypeEncoder:f.contentTypeEncoder??(0,t.default)().applicationJson.encoder}}l.fromOptions=d})(c||(c={}));class u extends a{constructor(d,f){super(),this.writable=d,this.options=c.fromOptions(f),this.errorCount=0,this.writeSemaphore=new n.Semaphore(1),this.writable.onError(h=>this.fireError(h)),this.writable.onClose(()=>this.fireClose())}async write(d){return this.writeSemaphore.lock(async()=>this.options.contentTypeEncoder.encode(d,this.options).then(h=>this.options.contentEncoder!==void 0?this.options.contentEncoder.encode(h):h).then(h=>{const p=[];return p.push(i,h.byteLength.toString(),s),p.push(s),this.doWrite(d,p,h)},h=>{throw this.fireError(h),h}))}async doWrite(d,f,h){try{return await this.writable.write(f.join(""),"ascii"),this.writable.write(h)}catch(p){return this.handleError(p,d),Promise.reject(p)}}handleError(d,f){this.errorCount++,this.fireError(d,f,this.errorCount)}end(){this.writable.end()}}return Ei.WriteableStreamMessageWriter=u,Ei}var iu={},Wk;function M9(){if(Wk)return iu;Wk=1,Object.defineProperty(iu,"__esModule",{value:!0}),iu.AbstractMessageBuffer=void 0;const t=13,e=10,n=`\r
128
+ `;class r{constructor(s="utf-8"){this._encoding=s,this._chunks=[],this._totalLength=0}get encoding(){return this._encoding}append(s){const o=typeof s=="string"?this.fromString(s,this._encoding):s;this._chunks.push(o),this._totalLength+=o.byteLength}tryReadHeaders(s=!1){if(this._chunks.length===0)return;let o=0,a=0,c=0,u=0;e:for(;a<this._chunks.length;){const h=this._chunks[a];for(c=0;c<h.length;){switch(h[c]){case t:switch(o){case 0:o=1;break;case 2:o=3;break;default:o=0}break;case e:switch(o){case 1:o=2;break;case 3:o=4,c++;break e;default:o=0}break;default:o=0}c++}u+=h.byteLength,a++}if(o!==4)return;const l=this._read(u+c),d=new Map,f=this.toString(l,"ascii").split(n);if(f.length<2)return d;for(let h=0;h<f.length-2;h++){const p=f[h],g=p.indexOf(":");if(g===-1)throw new Error(`Message header must separate key and value using ':'
129
+ ${p}`);const y=p.substr(0,g),m=p.substr(g+1).trim();d.set(s?y.toLowerCase():y,m)}return d}tryReadBody(s){if(!(this._totalLength<s))return this._read(s)}get numberOfBytes(){return this._totalLength}_read(s){if(s===0)return this.emptyBuffer();if(s>this._totalLength)throw new Error("Cannot read so many bytes!");if(this._chunks[0].byteLength===s){const u=this._chunks[0];return this._chunks.shift(),this._totalLength-=s,this.asNative(u)}if(this._chunks[0].byteLength>s){const u=this._chunks[0],l=this.asNative(u,s);return this._chunks[0]=u.slice(s),this._totalLength-=s,l}const o=this.allocNative(s);let a=0,c=0;for(;s>0;){const u=this._chunks[c];if(u.byteLength>s){const l=u.slice(0,s);o.set(l,a),a+=s,this._chunks[c]=u.slice(s),this._totalLength-=s,s-=s}else o.set(u,a),a+=u.byteLength,this._chunks.shift(),this._totalLength-=u.byteLength,s-=u.byteLength}return o}}return iu.AbstractMessageBuffer=r,iu}var ov={},Hk;function z9(){return Hk||(Hk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.ConnectionOptions=t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.RequestCancellationReceiverStrategy=t.IdCancellationReceiverStrategy=t.ConnectionStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=t.NullLogger=t.ProgressType=t.ProgressToken=void 0;const e=Bs(),n=Zc(),r=Fk(),i=Mk(),s=na(),o=Vf();var a;(function(R){R.type=new r.NotificationType("$/cancelRequest")})(a||(a={}));var c;(function(R){function L(W){return typeof W=="string"||typeof W=="number"}R.is=L})(c||(t.ProgressToken=c={}));var u;(function(R){R.type=new r.NotificationType("$/progress")})(u||(u={}));class l{constructor(){}}t.ProgressType=l;var d;(function(R){function L(W){return n.func(W)}R.is=L})(d||(d={})),t.NullLogger=Object.freeze({error:()=>{},warn:()=>{},info:()=>{},log:()=>{}});var f;(function(R){R[R.Off=0]="Off",R[R.Messages=1]="Messages",R[R.Compact=2]="Compact",R[R.Verbose=3]="Verbose"})(f||(t.Trace=f={}));var h;(function(R){R.Off="off",R.Messages="messages",R.Compact="compact",R.Verbose="verbose"})(h||(t.TraceValues=h={})),function(R){function L(V){if(!n.string(V))return R.Off;switch(V=V.toLowerCase(),V){case"off":return R.Off;case"messages":return R.Messages;case"compact":return R.Compact;case"verbose":return R.Verbose;default:return R.Off}}R.fromString=L;function W(V){switch(V){case R.Off:return"off";case R.Messages:return"messages";case R.Compact:return"compact";case R.Verbose:return"verbose";default:return"off"}}R.toString=W}(f||(t.Trace=f={}));var p;(function(R){R.Text="text",R.JSON="json"})(p||(t.TraceFormat=p={})),function(R){function L(W){return n.string(W)?(W=W.toLowerCase(),W==="json"?R.JSON:R.Text):R.Text}R.fromString=L}(p||(t.TraceFormat=p={}));var g;(function(R){R.type=new r.NotificationType("$/setTrace")})(g||(t.SetTraceNotification=g={}));var y;(function(R){R.type=new r.NotificationType("$/logTrace")})(y||(t.LogTraceNotification=y={}));var m;(function(R){R[R.Closed=1]="Closed",R[R.Disposed=2]="Disposed",R[R.AlreadyListening=3]="AlreadyListening"})(m||(t.ConnectionErrors=m={}));class w extends Error{constructor(L,W){super(W),this.code=L,Object.setPrototypeOf(this,w.prototype)}}t.ConnectionError=w;var E;(function(R){function L(W){const V=W;return V&&n.func(V.cancelUndispatched)}R.is=L})(E||(t.ConnectionStrategy=E={}));var k;(function(R){function L(W){const V=W;return V&&(V.kind===void 0||V.kind==="id")&&n.func(V.createCancellationTokenSource)&&(V.dispose===void 0||n.func(V.dispose))}R.is=L})(k||(t.IdCancellationReceiverStrategy=k={}));var A;(function(R){function L(W){const V=W;return V&&V.kind==="request"&&n.func(V.createCancellationTokenSource)&&(V.dispose===void 0||n.func(V.dispose))}R.is=L})(A||(t.RequestCancellationReceiverStrategy=A={}));var I;(function(R){R.Message=Object.freeze({createCancellationTokenSource(W){return new o.CancellationTokenSource}});function L(W){return k.is(W)||A.is(W)}R.is=L})(I||(t.CancellationReceiverStrategy=I={}));var x;(function(R){R.Message=Object.freeze({sendCancellation(W,V){return W.sendNotification(a.type,{id:V})},cleanup(W){}});function L(W){const V=W;return V&&n.func(V.sendCancellation)&&n.func(V.cleanup)}R.is=L})(x||(t.CancellationSenderStrategy=x={}));var _;(function(R){R.Message=Object.freeze({receiver:I.Message,sender:x.Message});function L(W){const V=W;return V&&I.is(V.receiver)&&x.is(V.sender)}R.is=L})(_||(t.CancellationStrategy=_={}));var P;(function(R){function L(W){const V=W;return V&&n.func(V.handleMessage)}R.is=L})(P||(t.MessageStrategy=P={}));var O;(function(R){function L(W){const V=W;return V&&(_.is(V.cancellationStrategy)||E.is(V.connectionStrategy)||P.is(V.messageStrategy))}R.is=L})(O||(t.ConnectionOptions=O={}));var C;(function(R){R[R.New=1]="New",R[R.Listening=2]="Listening",R[R.Closed=3]="Closed",R[R.Disposed=4]="Disposed"})(C||(C={}));function D(R,L,W,V){const Z=W!==void 0?W:t.NullLogger;let Fe=0,se=0,K=0;const Te="2.0";let at;const H=new Map;let Y;const Q=new Map,ne=new Map;let fe,Ee=new i.LinkedMap,me=new Map,ae=new Set,M=new Map,U=f.Off,oe=p.Text,G,Le=C.New;const yt=new s.Emitter,gn=new s.Emitter,tr=new s.Emitter,nr=new s.Emitter,rr=new s.Emitter,Bt=V&&V.cancellationStrategy?V.cancellationStrategy:_.Message;function _n(S){if(S===null)throw new Error("Can't send requests with id null since the response can't be correlated.");return"req-"+S.toString()}function Xr(S){return S===null?"res-unknown-"+(++K).toString():"res-"+S.toString()}function zn(){return"not-"+(++se).toString()}function mn(S,j){r.Message.isRequest(j)?S.set(_n(j.id),j):r.Message.isResponse(j)?S.set(Xr(j.id),j):S.set(zn(),j)}function Bn(S){}function tn(){return Le===C.Listening}function X(){return Le===C.Closed}function J(){return Le===C.Disposed}function ue(){(Le===C.New||Le===C.Listening)&&(Le=C.Closed,gn.fire(void 0))}function qt(S){yt.fire([S,void 0,void 0])}function Lt(S){yt.fire(S)}R.onClose(ue),R.onError(qt),L.onClose(ue),L.onError(Lt);function Sr(){fe||Ee.size===0||(fe=(0,e.default)().timer.setImmediate(()=>{fe=void 0,fs()}))}function _i(S){r.Message.isRequest(S)?ps(S):r.Message.isNotification(S)?Ai(S):r.Message.isResponse(S)?gs(S):xi(S)}function fs(){if(Ee.size===0)return;const S=Ee.shift();try{const j=V?.messageStrategy;P.is(j)?j.handleMessage(S,_i):_i(S)}finally{Sr()}}const hs=S=>{try{if(r.Message.isNotification(S)&&S.method===a.type.method){const j=S.params.id,te=_n(j),ie=Ee.get(te);if(r.Message.isRequest(ie)){const _e=V?.connectionStrategy,je=_e&&_e.cancelUndispatched?_e.cancelUndispatched(ie,Bn):void 0;if(je&&(je.error!==void 0||je.result!==void 0)){Ee.delete(te),M.delete(j),je.id=ie.id,kr(je,S.method,Date.now()),L.write(je).catch(()=>Z.error("Sending response for canceled message failed."));return}}const xe=M.get(j);if(xe!==void 0){xe.cancel(),Jr(S);return}else ae.add(j)}mn(Ee,S)}finally{Sr()}};function ps(S){if(J())return;function j($e,Je,Ue){const It={jsonrpc:Te,id:S.id};$e instanceof r.ResponseError?It.error=$e.toJson():It.result=$e===void 0?null:$e,kr(It,Je,Ue),L.write(It).catch(()=>Z.error("Sending response failed."))}function te($e,Je,Ue){const It={jsonrpc:Te,id:S.id,error:$e.toJson()};kr(It,Je,Ue),L.write(It).catch(()=>Z.error("Sending response failed."))}function ie($e,Je,Ue){$e===void 0&&($e=null);const It={jsonrpc:Te,id:S.id,result:$e};kr(It,Je,Ue),L.write(It).catch(()=>Z.error("Sending response failed."))}vs(S);const xe=H.get(S.method);let _e,je;xe&&(_e=xe.type,je=xe.handler);const he=Date.now();if(je||at){const $e=S.id??String(Date.now()),Je=k.is(Bt.receiver)?Bt.receiver.createCancellationTokenSource($e):Bt.receiver.createCancellationTokenSource(S);S.id!==null&&ae.has(S.id)&&Je.cancel(),S.id!==null&&M.set($e,Je);try{let Ue;if(je)if(S.params===void 0){if(_e!==void 0&&_e.numberOfParams!==0){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${S.method} defines ${_e.numberOfParams} params but received none.`),S.method,he);return}Ue=je(Je.token)}else if(Array.isArray(S.params)){if(_e!==void 0&&_e.parameterStructures===r.ParameterStructures.byName){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by name but received parameters by position`),S.method,he);return}Ue=je(...S.params,Je.token)}else{if(_e!==void 0&&_e.parameterStructures===r.ParameterStructures.byPosition){te(new r.ResponseError(r.ErrorCodes.InvalidParams,`Request ${S.method} defines parameters by position but received parameters by name`),S.method,he);return}Ue=je(S.params,Je.token)}else at&&(Ue=at(S.method,S.params,Je.token));const It=Ue;Ue?It.then?It.then(nn=>{M.delete($e),j(nn,S.method,he)},nn=>{M.delete($e),nn instanceof r.ResponseError?te(nn,S.method,he):nn&&n.string(nn.message)?te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${nn.message}`),S.method,he):te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,he)}):(M.delete($e),j(Ue,S.method,he)):(M.delete($e),ie(Ue,S.method,he))}catch(Ue){M.delete($e),Ue instanceof r.ResponseError?j(Ue,S.method,he):Ue&&n.string(Ue.message)?te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${S.method} failed with message: ${Ue.message}`),S.method,he):te(new r.ResponseError(r.ErrorCodes.InternalError,`Request ${S.method} failed unexpectedly without providing any details.`),S.method,he)}}else te(new r.ResponseError(r.ErrorCodes.MethodNotFound,`Unhandled method ${S.method}`),S.method,he)}function gs(S){if(!J())if(S.id===null)S.error?Z.error(`Received response message without id: Error is:
130
+ ${JSON.stringify(S.error,void 0,4)}`):Z.error("Received response message without id. No further error information provided.");else{const j=S.id,te=me.get(j);if(ws(S,te),te!==void 0){me.delete(j);try{if(S.error){const ie=S.error;te.reject(new r.ResponseError(ie.code,ie.message,ie.data))}else if(S.result!==void 0)te.resolve(S.result);else throw new Error("Should never happen.")}catch(ie){ie.message?Z.error(`Response handler '${te.method}' failed with message: ${ie.message}`):Z.error(`Response handler '${te.method}' failed unexpectedly.`)}}}}function Ai(S){if(J())return;let j,te;if(S.method===a.type.method){const ie=S.params.id;ae.delete(ie),Jr(S);return}else{const ie=Q.get(S.method);ie&&(te=ie.handler,j=ie.type)}if(te||Y)try{if(Jr(S),te)if(S.params===void 0)j!==void 0&&j.numberOfParams!==0&&j.parameterStructures!==r.ParameterStructures.byName&&Z.error(`Notification ${S.method} defines ${j.numberOfParams} params but received none.`),te();else if(Array.isArray(S.params)){const ie=S.params;S.method===u.type.method&&ie.length===2&&c.is(ie[0])?te({token:ie[0],value:ie[1]}):(j!==void 0&&(j.parameterStructures===r.ParameterStructures.byName&&Z.error(`Notification ${S.method} defines parameters by name but received parameters by position`),j.numberOfParams!==S.params.length&&Z.error(`Notification ${S.method} defines ${j.numberOfParams} params but received ${ie.length} arguments`)),te(...ie))}else j!==void 0&&j.parameterStructures===r.ParameterStructures.byPosition&&Z.error(`Notification ${S.method} defines parameters by position but received parameters by name`),te(S.params);else Y&&Y(S.method,S.params)}catch(ie){ie.message?Z.error(`Notification handler '${S.method}' failed with message: ${ie.message}`):Z.error(`Notification handler '${S.method}' failed unexpectedly.`)}else tr.fire(S)}function xi(S){if(!S){Z.error("Received empty message.");return}Z.error(`Received message which is neither a response nor a notification message:
131
+ ${JSON.stringify(S,null,4)}`);const j=S;if(n.string(j.id)||n.number(j.id)){const te=j.id,ie=me.get(te);ie&&ie.reject(new Error("The received response has neither a result nor an error property."))}}function yn(S){if(S!=null)switch(U){case f.Verbose:return JSON.stringify(S,null,4);case f.Compact:return JSON.stringify(S);default:return}}function ms(S){if(!(U===f.Off||!G))if(oe===p.Text){let j;(U===f.Verbose||U===f.Compact)&&S.params&&(j=`Params: ${yn(S.params)}
132
+
133
+ `),G.log(`Sending request '${S.method} - (${S.id})'.`,j)}else qn("send-request",S)}function ys(S){if(!(U===f.Off||!G))if(oe===p.Text){let j;(U===f.Verbose||U===f.Compact)&&(S.params?j=`Params: ${yn(S.params)}
134
+
135
+ `:j=`No parameters provided.
136
+
137
+ `),G.log(`Sending notification '${S.method}'.`,j)}else qn("send-notification",S)}function kr(S,j,te){if(!(U===f.Off||!G))if(oe===p.Text){let ie;(U===f.Verbose||U===f.Compact)&&(S.error&&S.error.data?ie=`Error data: ${yn(S.error.data)}
138
+
139
+ `:S.result?ie=`Result: ${yn(S.result)}
140
+
141
+ `:S.error===void 0&&(ie=`No result returned.
142
+
143
+ `)),G.log(`Sending response '${j} - (${S.id})'. Processing request took ${Date.now()-te}ms`,ie)}else qn("send-response",S)}function vs(S){if(!(U===f.Off||!G))if(oe===p.Text){let j;(U===f.Verbose||U===f.Compact)&&S.params&&(j=`Params: ${yn(S.params)}
144
+
145
+ `),G.log(`Received request '${S.method} - (${S.id})'.`,j)}else qn("receive-request",S)}function Jr(S){if(!(U===f.Off||!G||S.method===y.type.method))if(oe===p.Text){let j;(U===f.Verbose||U===f.Compact)&&(S.params?j=`Params: ${yn(S.params)}
146
+
147
+ `:j=`No parameters provided.
148
+
149
+ `),G.log(`Received notification '${S.method}'.`,j)}else qn("receive-notification",S)}function ws(S,j){if(!(U===f.Off||!G))if(oe===p.Text){let te;if((U===f.Verbose||U===f.Compact)&&(S.error&&S.error.data?te=`Error data: ${yn(S.error.data)}
150
+
151
+ `:S.result?te=`Result: ${yn(S.result)}
152
+
153
+ `:S.error===void 0&&(te=`No result returned.
154
+
155
+ `)),j){const ie=S.error?` Request failed: ${S.error.message} (${S.error.code}).`:"";G.log(`Received response '${j.method} - (${S.id})' in ${Date.now()-j.timerStart}ms.${ie}`,te)}else G.log(`Received response ${S.id} without active response promise.`,te)}else qn("receive-response",S)}function qn(S,j){if(!G||U===f.Off)return;const te={isLSPMessage:!0,type:S,message:j,timestamp:Date.now()};G.log(te)}function ir(){if(X())throw new w(m.Closed,"Connection is closed.");if(J())throw new w(m.Disposed,"Connection is disposed.")}function Eo(){if(tn())throw new w(m.AlreadyListening,"Connection is already listening")}function z(){if(!tn())throw new Error("Call listen() first.")}function T(S){return S===void 0?null:S}function N(S){if(S!==null)return S}function v(S){return S!=null&&!Array.isArray(S)&&typeof S=="object"}function $(S,j){switch(S){case r.ParameterStructures.auto:return v(j)?N(j):[T(j)];case r.ParameterStructures.byName:if(!v(j))throw new Error("Received parameters by name but param is not an object literal.");return N(j);case r.ParameterStructures.byPosition:return[T(j)];default:throw new Error(`Unknown parameter structure ${S.toString()}`)}}function b(S,j){let te;const ie=S.numberOfParams;switch(ie){case 0:te=void 0;break;case 1:te=$(S.parameterStructures,j[0]);break;default:te=[];for(let xe=0;xe<j.length&&xe<ie;xe++)te.push(T(j[xe]));if(j.length<ie)for(let xe=j.length;xe<ie;xe++)te.push(null);break}return te}const F={sendNotification:(S,...j)=>{ir();let te,ie;if(n.string(S)){te=S;const _e=j[0];let je=0,he=r.ParameterStructures.auto;r.ParameterStructures.is(_e)&&(je=1,he=_e);let $e=j.length;const Je=$e-je;switch(Je){case 0:ie=void 0;break;case 1:ie=$(he,j[je]);break;default:if(he===r.ParameterStructures.byName)throw new Error(`Received ${Je} parameters for 'by Name' notification parameter structure.`);ie=j.slice(je,$e).map(Ue=>T(Ue));break}}else{const _e=j;te=S.method,ie=b(S,_e)}const xe={jsonrpc:Te,method:te,params:ie};return ys(xe),L.write(xe).catch(_e=>{throw Z.error("Sending notification failed."),_e})},onNotification:(S,j)=>{ir();let te;return n.func(S)?Y=S:j&&(n.string(S)?(te=S,Q.set(S,{type:void 0,handler:j})):(te=S.method,Q.set(S.method,{type:S,handler:j}))),{dispose:()=>{te!==void 0?Q.delete(te):Y=void 0}}},onProgress:(S,j,te)=>{if(ne.has(j))throw new Error(`Progress handler for token ${j} already registered`);return ne.set(j,te),{dispose:()=>{ne.delete(j)}}},sendProgress:(S,j,te)=>F.sendNotification(u.type,{token:j,value:te}),onUnhandledProgress:nr.event,sendRequest:(S,...j)=>{ir(),z();let te,ie,xe;if(n.string(S)){te=S;const $e=j[0],Je=j[j.length-1];let Ue=0,It=r.ParameterStructures.auto;r.ParameterStructures.is($e)&&(Ue=1,It=$e);let nn=j.length;o.CancellationToken.is(Je)&&(nn=nn-1,xe=Je);const $r=nn-Ue;switch($r){case 0:ie=void 0;break;case 1:ie=$(It,j[Ue]);break;default:if(It===r.ParameterStructures.byName)throw new Error(`Received ${$r} parameters for 'by Name' request parameter structure.`);ie=j.slice(Ue,nn).map(oO=>T(oO));break}}else{const $e=j;te=S.method,ie=b(S,$e);const Je=S.numberOfParams;xe=o.CancellationToken.is($e[Je])?$e[Je]:void 0}const _e=Fe++;let je;xe&&(je=xe.onCancellationRequested(()=>{const $e=Bt.sender.sendCancellation(F,_e);return $e===void 0?(Z.log(`Received no promise from cancellation strategy when cancelling id ${_e}`),Promise.resolve()):$e.catch(()=>{Z.log(`Sending cancellation messages for id ${_e} failed`)})}));const he={jsonrpc:Te,id:_e,method:te,params:ie};return ms(he),typeof Bt.sender.enableCancellation=="function"&&Bt.sender.enableCancellation(he),new Promise(async($e,Je)=>{const Ue=$r=>{$e($r),Bt.sender.cleanup(_e),je?.dispose()},It=$r=>{Je($r),Bt.sender.cleanup(_e),je?.dispose()},nn={method:te,timerStart:Date.now(),resolve:Ue,reject:It};try{await L.write(he),me.set(_e,nn)}catch($r){throw Z.error("Sending request failed."),nn.reject(new r.ResponseError(r.ErrorCodes.MessageWriteError,$r.message?$r.message:"Unknown reason")),$r}})},onRequest:(S,j)=>{ir();let te=null;return d.is(S)?(te=void 0,at=S):n.string(S)?(te=null,j!==void 0&&(te=S,H.set(S,{handler:j,type:void 0}))):j!==void 0&&(te=S.method,H.set(S.method,{type:S,handler:j})),{dispose:()=>{te!==null&&(te!==void 0?H.delete(te):at=void 0)}}},hasPendingResponse:()=>me.size>0,trace:async(S,j,te)=>{let ie=!1,xe=p.Text;te!==void 0&&(n.boolean(te)?ie=te:(ie=te.sendNotification||!1,xe=te.traceFormat||p.Text)),U=S,oe=xe,U===f.Off?G=void 0:G=j,ie&&!X()&&!J()&&await F.sendNotification(g.type,{value:f.toString(S)})},onError:yt.event,onClose:gn.event,onUnhandledNotification:tr.event,onDispose:rr.event,end:()=>{L.end()},dispose:()=>{if(J())return;Le=C.Disposed,rr.fire(void 0);const S=new r.ResponseError(r.ErrorCodes.PendingResponseRejected,"Pending response rejected since connection got disposed");for(const j of me.values())j.reject(S);me=new Map,M=new Map,ae=new Set,Ee=new i.LinkedMap,n.func(L.dispose)&&L.dispose(),n.func(R.dispose)&&R.dispose()},listen:()=>{ir(),Eo(),Le=C.Listening,R.listen(hs)},inspect:()=>{(0,e.default)().console.log("inspect")}};return F.onNotification(y.type,S=>{if(U===f.Off||!G)return;const j=U===f.Verbose||U===f.Compact;G.log(S.message,j?S.verbose:void 0)}),F.onNotification(u.type,S=>{const j=ne.get(S.token);j?j(S.value):nr.fire(S)}),F}t.createMessageConnection=D}(ov)),ov}var Vk;function av(){return Vk||(Vk=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.ProgressType=t.ProgressToken=t.createMessageConnection=t.NullLogger=t.ConnectionOptions=t.ConnectionStrategy=t.AbstractMessageBuffer=t.WriteableStreamMessageWriter=t.AbstractMessageWriter=t.MessageWriter=t.ReadableStreamMessageReader=t.AbstractMessageReader=t.MessageReader=t.SharedArrayReceiverStrategy=t.SharedArraySenderStrategy=t.CancellationToken=t.CancellationTokenSource=t.Emitter=t.Event=t.Disposable=t.LRUCache=t.Touch=t.LinkedMap=t.ParameterStructures=t.NotificationType9=t.NotificationType8=t.NotificationType7=t.NotificationType6=t.NotificationType5=t.NotificationType4=t.NotificationType3=t.NotificationType2=t.NotificationType1=t.NotificationType0=t.NotificationType=t.ErrorCodes=t.ResponseError=t.RequestType9=t.RequestType8=t.RequestType7=t.RequestType6=t.RequestType5=t.RequestType4=t.RequestType3=t.RequestType2=t.RequestType1=t.RequestType0=t.RequestType=t.Message=t.RAL=void 0,t.MessageStrategy=t.CancellationStrategy=t.CancellationSenderStrategy=t.CancellationReceiverStrategy=t.ConnectionError=t.ConnectionErrors=t.LogTraceNotification=t.SetTraceNotification=t.TraceFormat=t.TraceValues=t.Trace=void 0;const e=Fk();Object.defineProperty(t,"Message",{enumerable:!0,get:function(){return e.Message}}),Object.defineProperty(t,"RequestType",{enumerable:!0,get:function(){return e.RequestType}}),Object.defineProperty(t,"RequestType0",{enumerable:!0,get:function(){return e.RequestType0}}),Object.defineProperty(t,"RequestType1",{enumerable:!0,get:function(){return e.RequestType1}}),Object.defineProperty(t,"RequestType2",{enumerable:!0,get:function(){return e.RequestType2}}),Object.defineProperty(t,"RequestType3",{enumerable:!0,get:function(){return e.RequestType3}}),Object.defineProperty(t,"RequestType4",{enumerable:!0,get:function(){return e.RequestType4}}),Object.defineProperty(t,"RequestType5",{enumerable:!0,get:function(){return e.RequestType5}}),Object.defineProperty(t,"RequestType6",{enumerable:!0,get:function(){return e.RequestType6}}),Object.defineProperty(t,"RequestType7",{enumerable:!0,get:function(){return e.RequestType7}}),Object.defineProperty(t,"RequestType8",{enumerable:!0,get:function(){return e.RequestType8}}),Object.defineProperty(t,"RequestType9",{enumerable:!0,get:function(){return e.RequestType9}}),Object.defineProperty(t,"ResponseError",{enumerable:!0,get:function(){return e.ResponseError}}),Object.defineProperty(t,"ErrorCodes",{enumerable:!0,get:function(){return e.ErrorCodes}}),Object.defineProperty(t,"NotificationType",{enumerable:!0,get:function(){return e.NotificationType}}),Object.defineProperty(t,"NotificationType0",{enumerable:!0,get:function(){return e.NotificationType0}}),Object.defineProperty(t,"NotificationType1",{enumerable:!0,get:function(){return e.NotificationType1}}),Object.defineProperty(t,"NotificationType2",{enumerable:!0,get:function(){return e.NotificationType2}}),Object.defineProperty(t,"NotificationType3",{enumerable:!0,get:function(){return e.NotificationType3}}),Object.defineProperty(t,"NotificationType4",{enumerable:!0,get:function(){return e.NotificationType4}}),Object.defineProperty(t,"NotificationType5",{enumerable:!0,get:function(){return e.NotificationType5}}),Object.defineProperty(t,"NotificationType6",{enumerable:!0,get:function(){return e.NotificationType6}}),Object.defineProperty(t,"NotificationType7",{enumerable:!0,get:function(){return e.NotificationType7}}),Object.defineProperty(t,"NotificationType8",{enumerable:!0,get:function(){return e.NotificationType8}}),Object.defineProperty(t,"NotificationType9",{enumerable:!0,get:function(){return e.NotificationType9}}),Object.defineProperty(t,"ParameterStructures",{enumerable:!0,get:function(){return e.ParameterStructures}});const n=Mk();Object.defineProperty(t,"LinkedMap",{enumerable:!0,get:function(){return n.LinkedMap}}),Object.defineProperty(t,"LRUCache",{enumerable:!0,get:function(){return n.LRUCache}}),Object.defineProperty(t,"Touch",{enumerable:!0,get:function(){return n.Touch}});const r=N9();Object.defineProperty(t,"Disposable",{enumerable:!0,get:function(){return r.Disposable}});const i=na();Object.defineProperty(t,"Event",{enumerable:!0,get:function(){return i.Event}}),Object.defineProperty(t,"Emitter",{enumerable:!0,get:function(){return i.Emitter}});const s=Vf();Object.defineProperty(t,"CancellationTokenSource",{enumerable:!0,get:function(){return s.CancellationTokenSource}}),Object.defineProperty(t,"CancellationToken",{enumerable:!0,get:function(){return s.CancellationToken}});const o=O9();Object.defineProperty(t,"SharedArraySenderStrategy",{enumerable:!0,get:function(){return o.SharedArraySenderStrategy}}),Object.defineProperty(t,"SharedArrayReceiverStrategy",{enumerable:!0,get:function(){return o.SharedArrayReceiverStrategy}});const a=F9();Object.defineProperty(t,"MessageReader",{enumerable:!0,get:function(){return a.MessageReader}}),Object.defineProperty(t,"AbstractMessageReader",{enumerable:!0,get:function(){return a.AbstractMessageReader}}),Object.defineProperty(t,"ReadableStreamMessageReader",{enumerable:!0,get:function(){return a.ReadableStreamMessageReader}});const c=L9();Object.defineProperty(t,"MessageWriter",{enumerable:!0,get:function(){return c.MessageWriter}}),Object.defineProperty(t,"AbstractMessageWriter",{enumerable:!0,get:function(){return c.AbstractMessageWriter}}),Object.defineProperty(t,"WriteableStreamMessageWriter",{enumerable:!0,get:function(){return c.WriteableStreamMessageWriter}});const u=M9();Object.defineProperty(t,"AbstractMessageBuffer",{enumerable:!0,get:function(){return u.AbstractMessageBuffer}});const l=z9();Object.defineProperty(t,"ConnectionStrategy",{enumerable:!0,get:function(){return l.ConnectionStrategy}}),Object.defineProperty(t,"ConnectionOptions",{enumerable:!0,get:function(){return l.ConnectionOptions}}),Object.defineProperty(t,"NullLogger",{enumerable:!0,get:function(){return l.NullLogger}}),Object.defineProperty(t,"createMessageConnection",{enumerable:!0,get:function(){return l.createMessageConnection}}),Object.defineProperty(t,"ProgressToken",{enumerable:!0,get:function(){return l.ProgressToken}}),Object.defineProperty(t,"ProgressType",{enumerable:!0,get:function(){return l.ProgressType}}),Object.defineProperty(t,"Trace",{enumerable:!0,get:function(){return l.Trace}}),Object.defineProperty(t,"TraceValues",{enumerable:!0,get:function(){return l.TraceValues}}),Object.defineProperty(t,"TraceFormat",{enumerable:!0,get:function(){return l.TraceFormat}}),Object.defineProperty(t,"SetTraceNotification",{enumerable:!0,get:function(){return l.SetTraceNotification}}),Object.defineProperty(t,"LogTraceNotification",{enumerable:!0,get:function(){return l.LogTraceNotification}}),Object.defineProperty(t,"ConnectionErrors",{enumerable:!0,get:function(){return l.ConnectionErrors}}),Object.defineProperty(t,"ConnectionError",{enumerable:!0,get:function(){return l.ConnectionError}}),Object.defineProperty(t,"CancellationReceiverStrategy",{enumerable:!0,get:function(){return l.CancellationReceiverStrategy}}),Object.defineProperty(t,"CancellationSenderStrategy",{enumerable:!0,get:function(){return l.CancellationSenderStrategy}}),Object.defineProperty(t,"CancellationStrategy",{enumerable:!0,get:function(){return l.CancellationStrategy}}),Object.defineProperty(t,"MessageStrategy",{enumerable:!0,get:function(){return l.MessageStrategy}});const d=Bs();t.RAL=d.default}(sv)),sv}var Kk;function B9(){if(Kk)return oh;Kk=1,Object.defineProperty(oh,"__esModule",{value:!0});const t=P9,e=av();class n extends e.AbstractMessageBuffer{constructor(c="utf-8"){super(c)}emptyBuffer(){return n.emptyBuffer}fromString(c,u){return Buffer.from(c,u)}toString(c,u){return c instanceof Buffer?c.toString(u):new t.TextDecoder(u).decode(c)}asNative(c,u){return u===void 0?c instanceof Buffer?c:Buffer.from(c):c instanceof Buffer?c.slice(0,u):Buffer.from(c,0,u)}allocNative(c){return Buffer.allocUnsafe(c)}}n.emptyBuffer=Buffer.allocUnsafe(0);class r{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}onData(c){return this.stream.on("data",c),e.Disposable.create(()=>this.stream.off("data",c))}}class i{constructor(c){this.stream=c}onClose(c){return this.stream.on("close",c),e.Disposable.create(()=>this.stream.off("close",c))}onError(c){return this.stream.on("error",c),e.Disposable.create(()=>this.stream.off("error",c))}onEnd(c){return this.stream.on("end",c),e.Disposable.create(()=>this.stream.off("end",c))}write(c,u){return new Promise((l,d)=>{const f=h=>{h==null?l():d(h)};typeof c=="string"?this.stream.write(c,u,f):this.stream.write(c,f)})}end(){this.stream.end()}}const s=Object.freeze({messageBuffer:Object.freeze({create:a=>new n(a)}),applicationJson:Object.freeze({encoder:Object.freeze({name:"application/json",encode:(a,c)=>{try{return Promise.resolve(Buffer.from(JSON.stringify(a,void 0,0),c.charset))}catch(u){return Promise.reject(u)}}}),decoder:Object.freeze({name:"application/json",decode:(a,c)=>{try{return a instanceof Buffer?Promise.resolve(JSON.parse(a.toString(c.charset))):Promise.resolve(JSON.parse(new t.TextDecoder(c.charset).decode(a)))}catch(u){return Promise.reject(u)}}})}),stream:Object.freeze({asReadableStream:a=>new r(a),asWritableStream:a=>new i(a)}),console,timer:Object.freeze({setTimeout(a,c,...u){const l=setTimeout(a,c,...u);return{dispose:()=>clearTimeout(l)}},setImmediate(a,...c){const u=setImmediate(a,...c);return{dispose:()=>clearImmediate(u)}},setInterval(a,c,...u){const l=setInterval(a,c,...u);return{dispose:()=>clearInterval(l)}}})});function o(){return s}return function(a){function c(){e.RAL.install(s)}a.install=c}(o||(o={})),oh.default=o,oh}const su=li($O),q9=li(FO),Yk=li(LO),j9=li(MO);var Xk;function Ks(){return Xk||(Xk=1,function(t){var e=Hs&&Hs.__createBinding||(Object.create?function(C,D,R,L){L===void 0&&(L=R);var W=Object.getOwnPropertyDescriptor(D,R);(!W||("get"in W?!D.__esModule:W.writable||W.configurable))&&(W={enumerable:!0,get:function(){return D[R]}}),Object.defineProperty(C,L,W)}:function(C,D,R,L){L===void 0&&(L=R),C[L]=D[R]}),n=Hs&&Hs.__exportStar||function(C,D){for(var R in C)R!=="default"&&!Object.prototype.hasOwnProperty.call(D,R)&&e(D,C,R)};Object.defineProperty(t,"__esModule",{value:!0}),t.createMessageConnection=t.createServerSocketTransport=t.createClientSocketTransport=t.createServerPipeTransport=t.createClientPipeTransport=t.generateRandomPipeName=t.StreamMessageWriter=t.StreamMessageReader=t.SocketMessageWriter=t.SocketMessageReader=t.PortMessageWriter=t.PortMessageReader=t.IPCMessageWriter=t.IPCMessageReader=void 0;const r=B9();r.default.install();const i=su,s=q9,o=Yk,a=j9,c=av();n(av(),t);class u extends c.AbstractMessageReader{constructor(D){super(),this.process=D;let R=this.process;R.on("error",L=>this.fireError(L)),R.on("close",()=>this.fireClose())}listen(D){return this.process.on("message",D),c.Disposable.create(()=>this.process.off("message",D))}}t.IPCMessageReader=u;class l extends c.AbstractMessageWriter{constructor(D){super(),this.process=D,this.errorCount=0;const R=this.process;R.on("error",L=>this.fireError(L)),R.on("close",()=>this.fireClose)}write(D){try{return typeof this.process.send=="function"&&this.process.send(D,void 0,void 0,R=>{R?(this.errorCount++,this.handleError(R,D)):this.errorCount=0}),Promise.resolve()}catch(R){return this.handleError(R,D),Promise.reject(R)}}handleError(D,R){this.errorCount++,this.fireError(D,R,this.errorCount)}end(){}}t.IPCMessageWriter=l;class d extends c.AbstractMessageReader{constructor(D){super(),this.onData=new c.Emitter,D.on("close",()=>this.fireClose),D.on("error",R=>this.fireError(R)),D.on("message",R=>{this.onData.fire(R)})}listen(D){return this.onData.event(D)}}t.PortMessageReader=d;class f extends c.AbstractMessageWriter{constructor(D){super(),this.port=D,this.errorCount=0,D.on("close",()=>this.fireClose()),D.on("error",R=>this.fireError(R))}write(D){try{return this.port.postMessage(D),Promise.resolve()}catch(R){return this.handleError(R,D),Promise.reject(R)}}handleError(D,R){this.errorCount++,this.fireError(D,R,this.errorCount)}end(){}}t.PortMessageWriter=f;class h extends c.ReadableStreamMessageReader{constructor(D,R="utf-8"){super((0,r.default)().stream.asReadableStream(D),R)}}t.SocketMessageReader=h;class p extends c.WriteableStreamMessageWriter{constructor(D,R){super((0,r.default)().stream.asWritableStream(D),R),this.socket=D}dispose(){super.dispose(),this.socket.destroy()}}t.SocketMessageWriter=p;class g extends c.ReadableStreamMessageReader{constructor(D,R){super((0,r.default)().stream.asReadableStream(D),R)}}t.StreamMessageReader=g;class y extends c.WriteableStreamMessageWriter{constructor(D,R){super((0,r.default)().stream.asWritableStream(D),R)}}t.StreamMessageWriter=y;const m=process.env.XDG_RUNTIME_DIR,w=new Map([["linux",107],["darwin",103]]);function E(){const C=(0,o.randomBytes)(21).toString("hex");if(process.platform==="win32")return`\\\\.\\pipe\\vscode-jsonrpc-${C}-sock`;let D;m?D=i.join(m,`vscode-ipc-${C}.sock`):D=i.join(s.tmpdir(),`vscode-${C}.sock`);const R=w.get(process.platform);return R!==void 0&&D.length>R&&(0,r.default)().console.warn(`WARNING: IPC handle "${D}" is longer than ${R} characters.`),D}t.generateRandomPipeName=E;function k(C,D="utf-8"){let R;const L=new Promise((W,V)=>{R=W});return new Promise((W,V)=>{let Z=(0,a.createServer)(Fe=>{Z.close(),R([new h(Fe,D),new p(Fe,D)])});Z.on("error",V),Z.listen(C,()=>{Z.removeListener("error",V),W({onConnected:()=>L})})})}t.createClientPipeTransport=k;function A(C,D="utf-8"){const R=(0,a.createConnection)(C);return[new h(R,D),new p(R,D)]}t.createServerPipeTransport=A;function I(C,D="utf-8"){let R;const L=new Promise((W,V)=>{R=W});return new Promise((W,V)=>{const Z=(0,a.createServer)(Fe=>{Z.close(),R([new h(Fe,D),new p(Fe,D)])});Z.on("error",V),Z.listen(C,"127.0.0.1",()=>{Z.removeListener("error",V),W({onConnected:()=>L})})})}t.createClientSocketTransport=I;function x(C,D="utf-8"){const R=(0,a.createConnection)(C,"127.0.0.1");return[new h(R,D),new p(R,D)]}t.createServerSocketTransport=x;function _(C){const D=C;return D.read!==void 0&&D.addListener!==void 0}function P(C){const D=C;return D.write!==void 0&&D.addListener!==void 0}function O(C,D,R,L){R||(R=c.NullLogger);const W=_(C)?new g(C):C,V=P(D)?new y(D):D;return c.ConnectionStrategy.is(L)&&(L={connectionStrategy:L}),(0,c.createMessageConnection)(W,V,R,L)}t.createMessageConnection=O}(Hs)),Hs}var cv,Jk;function Zk(){return Jk||(Jk=1,cv=Ks()),cv}var Ys={};function Qk(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var ah={exports:{}},e$;function uv(){return e$||(e$=1,function(t,e){(function(n){{var r=n(Qk,e);r!==void 0&&(t.exports=r)}})(function(n,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TextDocument=r.EOL=r.WorkspaceFolder=r.InlineCompletionContext=r.SelectedCompletionInfo=r.InlineCompletionTriggerKind=r.InlineCompletionList=r.InlineCompletionItem=r.StringValue=r.InlayHint=r.InlayHintLabelPart=r.InlayHintKind=r.InlineValueContext=r.InlineValueEvaluatableExpression=r.InlineValueVariableLookup=r.InlineValueText=r.SemanticTokens=r.SemanticTokenModifiers=r.SemanticTokenTypes=r.SelectionRange=r.DocumentLink=r.FormattingOptions=r.CodeLens=r.CodeAction=r.CodeActionContext=r.CodeActionTriggerKind=r.CodeActionKind=r.DocumentSymbol=r.WorkspaceSymbol=r.SymbolInformation=r.SymbolTag=r.SymbolKind=r.DocumentHighlight=r.DocumentHighlightKind=r.SignatureInformation=r.ParameterInformation=r.Hover=r.MarkedString=r.CompletionList=r.CompletionItem=r.CompletionItemLabelDetails=r.InsertTextMode=r.InsertReplaceEdit=r.CompletionItemTag=r.InsertTextFormat=r.CompletionItemKind=r.MarkupContent=r.MarkupKind=r.TextDocumentItem=r.OptionalVersionedTextDocumentIdentifier=r.VersionedTextDocumentIdentifier=r.TextDocumentIdentifier=r.WorkspaceChange=r.WorkspaceEdit=r.DeleteFile=r.RenameFile=r.CreateFile=r.TextDocumentEdit=r.AnnotatedTextEdit=r.ChangeAnnotationIdentifier=r.ChangeAnnotation=r.TextEdit=r.Command=r.Diagnostic=r.CodeDescription=r.DiagnosticTag=r.DiagnosticSeverity=r.DiagnosticRelatedInformation=r.FoldingRange=r.FoldingRangeKind=r.ColorPresentation=r.ColorInformation=r.Color=r.LocationLink=r.Location=r.Range=r.Position=r.uinteger=r.integer=r.URI=r.DocumentUri=void 0;var i;(function(T){function N(v){return typeof v=="string"}T.is=N})(i||(r.DocumentUri=i={}));var s;(function(T){function N(v){return typeof v=="string"}T.is=N})(s||(r.URI=s={}));var o;(function(T){T.MIN_VALUE=-2147483648,T.MAX_VALUE=2147483647;function N(v){return typeof v=="number"&&T.MIN_VALUE<=v&&v<=T.MAX_VALUE}T.is=N})(o||(r.integer=o={}));var a;(function(T){T.MIN_VALUE=0,T.MAX_VALUE=2147483647;function N(v){return typeof v=="number"&&T.MIN_VALUE<=v&&v<=T.MAX_VALUE}T.is=N})(a||(r.uinteger=a={}));var c;(function(T){function N($,b){return $===Number.MAX_VALUE&&($=a.MAX_VALUE),b===Number.MAX_VALUE&&(b=a.MAX_VALUE),{line:$,character:b}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&z.uinteger(b.line)&&z.uinteger(b.character)}T.is=v})(c||(r.Position=c={}));var u;(function(T){function N($,b,F,S){if(z.uinteger($)&&z.uinteger(b)&&z.uinteger(F)&&z.uinteger(S))return{start:c.create($,b),end:c.create(F,S)};if(c.is($)&&c.is(b))return{start:$,end:b};throw new Error("Range#create called with invalid arguments[".concat($,", ").concat(b,", ").concat(F,", ").concat(S,"]"))}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&c.is(b.start)&&c.is(b.end)}T.is=v})(u||(r.Range=u={}));var l;(function(T){function N($,b){return{uri:$,range:b}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&u.is(b.range)&&(z.string(b.uri)||z.undefined(b.uri))}T.is=v})(l||(r.Location=l={}));var d;(function(T){function N($,b,F,S){return{targetUri:$,targetRange:b,targetSelectionRange:F,originSelectionRange:S}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&u.is(b.targetRange)&&z.string(b.targetUri)&&u.is(b.targetSelectionRange)&&(u.is(b.originSelectionRange)||z.undefined(b.originSelectionRange))}T.is=v})(d||(r.LocationLink=d={}));var f;(function(T){function N($,b,F,S){return{red:$,green:b,blue:F,alpha:S}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&z.numberRange(b.red,0,1)&&z.numberRange(b.green,0,1)&&z.numberRange(b.blue,0,1)&&z.numberRange(b.alpha,0,1)}T.is=v})(f||(r.Color=f={}));var h;(function(T){function N($,b){return{range:$,color:b}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&u.is(b.range)&&f.is(b.color)}T.is=v})(h||(r.ColorInformation=h={}));var p;(function(T){function N($,b,F){return{label:$,textEdit:b,additionalTextEdits:F}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&z.string(b.label)&&(z.undefined(b.textEdit)||x.is(b))&&(z.undefined(b.additionalTextEdits)||z.typedArray(b.additionalTextEdits,x.is))}T.is=v})(p||(r.ColorPresentation=p={}));var g;(function(T){T.Comment="comment",T.Imports="imports",T.Region="region"})(g||(r.FoldingRangeKind=g={}));var y;(function(T){function N($,b,F,S,j,te){var ie={startLine:$,endLine:b};return z.defined(F)&&(ie.startCharacter=F),z.defined(S)&&(ie.endCharacter=S),z.defined(j)&&(ie.kind=j),z.defined(te)&&(ie.collapsedText=te),ie}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&z.uinteger(b.startLine)&&z.uinteger(b.startLine)&&(z.undefined(b.startCharacter)||z.uinteger(b.startCharacter))&&(z.undefined(b.endCharacter)||z.uinteger(b.endCharacter))&&(z.undefined(b.kind)||z.string(b.kind))}T.is=v})(y||(r.FoldingRange=y={}));var m;(function(T){function N($,b){return{location:$,message:b}}T.create=N;function v($){var b=$;return z.defined(b)&&l.is(b.location)&&z.string(b.message)}T.is=v})(m||(r.DiagnosticRelatedInformation=m={}));var w;(function(T){T.Error=1,T.Warning=2,T.Information=3,T.Hint=4})(w||(r.DiagnosticSeverity=w={}));var E;(function(T){T.Unnecessary=1,T.Deprecated=2})(E||(r.DiagnosticTag=E={}));var k;(function(T){function N(v){var $=v;return z.objectLiteral($)&&z.string($.href)}T.is=N})(k||(r.CodeDescription=k={}));var A;(function(T){function N($,b,F,S,j,te){var ie={range:$,message:b};return z.defined(F)&&(ie.severity=F),z.defined(S)&&(ie.code=S),z.defined(j)&&(ie.source=j),z.defined(te)&&(ie.relatedInformation=te),ie}T.create=N;function v($){var b,F=$;return z.defined(F)&&u.is(F.range)&&z.string(F.message)&&(z.number(F.severity)||z.undefined(F.severity))&&(z.integer(F.code)||z.string(F.code)||z.undefined(F.code))&&(z.undefined(F.codeDescription)||z.string((b=F.codeDescription)===null||b===void 0?void 0:b.href))&&(z.string(F.source)||z.undefined(F.source))&&(z.undefined(F.relatedInformation)||z.typedArray(F.relatedInformation,m.is))}T.is=v})(A||(r.Diagnostic=A={}));var I;(function(T){function N($,b){for(var F=[],S=2;S<arguments.length;S++)F[S-2]=arguments[S];var j={title:$,command:b};return z.defined(F)&&F.length>0&&(j.arguments=F),j}T.create=N;function v($){var b=$;return z.defined(b)&&z.string(b.title)&&z.string(b.command)}T.is=v})(I||(r.Command=I={}));var x;(function(T){function N(F,S){return{range:F,newText:S}}T.replace=N;function v(F,S){return{range:{start:F,end:F},newText:S}}T.insert=v;function $(F){return{range:F,newText:""}}T.del=$;function b(F){var S=F;return z.objectLiteral(S)&&z.string(S.newText)&&u.is(S.range)}T.is=b})(x||(r.TextEdit=x={}));var _;(function(T){function N($,b,F){var S={label:$};return b!==void 0&&(S.needsConfirmation=b),F!==void 0&&(S.description=F),S}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&z.string(b.label)&&(z.boolean(b.needsConfirmation)||b.needsConfirmation===void 0)&&(z.string(b.description)||b.description===void 0)}T.is=v})(_||(r.ChangeAnnotation=_={}));var P;(function(T){function N(v){var $=v;return z.string($)}T.is=N})(P||(r.ChangeAnnotationIdentifier=P={}));var O;(function(T){function N(F,S,j){return{range:F,newText:S,annotationId:j}}T.replace=N;function v(F,S,j){return{range:{start:F,end:F},newText:S,annotationId:j}}T.insert=v;function $(F,S){return{range:F,newText:"",annotationId:S}}T.del=$;function b(F){var S=F;return x.is(S)&&(_.is(S.annotationId)||P.is(S.annotationId))}T.is=b})(O||(r.AnnotatedTextEdit=O={}));var C;(function(T){function N($,b){return{textDocument:$,edits:b}}T.create=N;function v($){var b=$;return z.defined(b)&&Te.is(b.textDocument)&&Array.isArray(b.edits)}T.is=v})(C||(r.TextDocumentEdit=C={}));var D;(function(T){function N($,b,F){var S={kind:"create",uri:$};return b!==void 0&&(b.overwrite!==void 0||b.ignoreIfExists!==void 0)&&(S.options=b),F!==void 0&&(S.annotationId=F),S}T.create=N;function v($){var b=$;return b&&b.kind==="create"&&z.string(b.uri)&&(b.options===void 0||(b.options.overwrite===void 0||z.boolean(b.options.overwrite))&&(b.options.ignoreIfExists===void 0||z.boolean(b.options.ignoreIfExists)))&&(b.annotationId===void 0||P.is(b.annotationId))}T.is=v})(D||(r.CreateFile=D={}));var R;(function(T){function N($,b,F,S){var j={kind:"rename",oldUri:$,newUri:b};return F!==void 0&&(F.overwrite!==void 0||F.ignoreIfExists!==void 0)&&(j.options=F),S!==void 0&&(j.annotationId=S),j}T.create=N;function v($){var b=$;return b&&b.kind==="rename"&&z.string(b.oldUri)&&z.string(b.newUri)&&(b.options===void 0||(b.options.overwrite===void 0||z.boolean(b.options.overwrite))&&(b.options.ignoreIfExists===void 0||z.boolean(b.options.ignoreIfExists)))&&(b.annotationId===void 0||P.is(b.annotationId))}T.is=v})(R||(r.RenameFile=R={}));var L;(function(T){function N($,b,F){var S={kind:"delete",uri:$};return b!==void 0&&(b.recursive!==void 0||b.ignoreIfNotExists!==void 0)&&(S.options=b),F!==void 0&&(S.annotationId=F),S}T.create=N;function v($){var b=$;return b&&b.kind==="delete"&&z.string(b.uri)&&(b.options===void 0||(b.options.recursive===void 0||z.boolean(b.options.recursive))&&(b.options.ignoreIfNotExists===void 0||z.boolean(b.options.ignoreIfNotExists)))&&(b.annotationId===void 0||P.is(b.annotationId))}T.is=v})(L||(r.DeleteFile=L={}));var W;(function(T){function N(v){var $=v;return $&&($.changes!==void 0||$.documentChanges!==void 0)&&($.documentChanges===void 0||$.documentChanges.every(function(b){return z.string(b.kind)?D.is(b)||R.is(b)||L.is(b):C.is(b)}))}T.is=N})(W||(r.WorkspaceEdit=W={}));var V=function(){function T(N,v){this.edits=N,this.changeAnnotations=v}return T.prototype.insert=function(N,v,$){var b,F;if($===void 0?b=x.insert(N,v):P.is($)?(F=$,b=O.insert(N,v,$)):(this.assertChangeAnnotations(this.changeAnnotations),F=this.changeAnnotations.manage($),b=O.insert(N,v,F)),this.edits.push(b),F!==void 0)return F},T.prototype.replace=function(N,v,$){var b,F;if($===void 0?b=x.replace(N,v):P.is($)?(F=$,b=O.replace(N,v,$)):(this.assertChangeAnnotations(this.changeAnnotations),F=this.changeAnnotations.manage($),b=O.replace(N,v,F)),this.edits.push(b),F!==void 0)return F},T.prototype.delete=function(N,v){var $,b;if(v===void 0?$=x.del(N):P.is(v)?(b=v,$=O.del(N,v)):(this.assertChangeAnnotations(this.changeAnnotations),b=this.changeAnnotations.manage(v),$=O.del(N,b)),this.edits.push($),b!==void 0)return b},T.prototype.add=function(N){this.edits.push(N)},T.prototype.all=function(){return this.edits},T.prototype.clear=function(){this.edits.splice(0,this.edits.length)},T.prototype.assertChangeAnnotations=function(N){if(N===void 0)throw new Error("Text edit change is not configured to manage change annotations.")},T}(),Z=function(){function T(N){this._annotations=N===void 0?Object.create(null):N,this._counter=0,this._size=0}return T.prototype.all=function(){return this._annotations},Object.defineProperty(T.prototype,"size",{get:function(){return this._size},enumerable:!1,configurable:!0}),T.prototype.manage=function(N,v){var $;if(P.is(N)?$=N:($=this.nextId(),v=N),this._annotations[$]!==void 0)throw new Error("Id ".concat($," is already in use."));if(v===void 0)throw new Error("No annotation provided for id ".concat($));return this._annotations[$]=v,this._size++,$},T.prototype.nextId=function(){return this._counter++,this._counter.toString()},T}(),Fe=function(){function T(N){var v=this;this._textEditChanges=Object.create(null),N!==void 0?(this._workspaceEdit=N,N.documentChanges?(this._changeAnnotations=new Z(N.changeAnnotations),N.changeAnnotations=this._changeAnnotations.all(),N.documentChanges.forEach(function($){if(C.is($)){var b=new V($.edits,v._changeAnnotations);v._textEditChanges[$.textDocument.uri]=b}})):N.changes&&Object.keys(N.changes).forEach(function($){var b=new V(N.changes[$]);v._textEditChanges[$]=b})):this._workspaceEdit={}}return Object.defineProperty(T.prototype,"edit",{get:function(){return this.initDocumentChanges(),this._changeAnnotations!==void 0&&(this._changeAnnotations.size===0?this._workspaceEdit.changeAnnotations=void 0:this._workspaceEdit.changeAnnotations=this._changeAnnotations.all()),this._workspaceEdit},enumerable:!1,configurable:!0}),T.prototype.getTextEditChange=function(N){if(Te.is(N)){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var v={uri:N.uri,version:N.version},$=this._textEditChanges[v.uri];if(!$){var b=[],F={textDocument:v,edits:b};this._workspaceEdit.documentChanges.push(F),$=new V(b,this._changeAnnotations),this._textEditChanges[v.uri]=$}return $}else{if(this.initChanges(),this._workspaceEdit.changes===void 0)throw new Error("Workspace edit is not configured for normal text edit changes.");var $=this._textEditChanges[N];if(!$){var b=[];this._workspaceEdit.changes[N]=b,$=new V(b),this._textEditChanges[N]=$}return $}},T.prototype.initDocumentChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._changeAnnotations=new Z,this._workspaceEdit.documentChanges=[],this._workspaceEdit.changeAnnotations=this._changeAnnotations.all())},T.prototype.initChanges=function(){this._workspaceEdit.documentChanges===void 0&&this._workspaceEdit.changes===void 0&&(this._workspaceEdit.changes=Object.create(null))},T.prototype.createFile=function(N,v,$){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var b;_.is(v)||P.is(v)?b=v:$=v;var F,S;if(b===void 0?F=D.create(N,$):(S=P.is(b)?b:this._changeAnnotations.manage(b),F=D.create(N,$,S)),this._workspaceEdit.documentChanges.push(F),S!==void 0)return S},T.prototype.renameFile=function(N,v,$,b){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var F;_.is($)||P.is($)?F=$:b=$;var S,j;if(F===void 0?S=R.create(N,v,b):(j=P.is(F)?F:this._changeAnnotations.manage(F),S=R.create(N,v,b,j)),this._workspaceEdit.documentChanges.push(S),j!==void 0)return j},T.prototype.deleteFile=function(N,v,$){if(this.initDocumentChanges(),this._workspaceEdit.documentChanges===void 0)throw new Error("Workspace edit is not configured for document changes.");var b;_.is(v)||P.is(v)?b=v:$=v;var F,S;if(b===void 0?F=L.create(N,$):(S=P.is(b)?b:this._changeAnnotations.manage(b),F=L.create(N,$,S)),this._workspaceEdit.documentChanges.push(F),S!==void 0)return S},T}();r.WorkspaceChange=Fe;var se;(function(T){function N($){return{uri:$}}T.create=N;function v($){var b=$;return z.defined(b)&&z.string(b.uri)}T.is=v})(se||(r.TextDocumentIdentifier=se={}));var K;(function(T){function N($,b){return{uri:$,version:b}}T.create=N;function v($){var b=$;return z.defined(b)&&z.string(b.uri)&&z.integer(b.version)}T.is=v})(K||(r.VersionedTextDocumentIdentifier=K={}));var Te;(function(T){function N($,b){return{uri:$,version:b}}T.create=N;function v($){var b=$;return z.defined(b)&&z.string(b.uri)&&(b.version===null||z.integer(b.version))}T.is=v})(Te||(r.OptionalVersionedTextDocumentIdentifier=Te={}));var at;(function(T){function N($,b,F,S){return{uri:$,languageId:b,version:F,text:S}}T.create=N;function v($){var b=$;return z.defined(b)&&z.string(b.uri)&&z.string(b.languageId)&&z.integer(b.version)&&z.string(b.text)}T.is=v})(at||(r.TextDocumentItem=at={}));var H;(function(T){T.PlainText="plaintext",T.Markdown="markdown";function N(v){var $=v;return $===T.PlainText||$===T.Markdown}T.is=N})(H||(r.MarkupKind=H={}));var Y;(function(T){function N(v){var $=v;return z.objectLiteral(v)&&H.is($.kind)&&z.string($.value)}T.is=N})(Y||(r.MarkupContent=Y={}));var Q;(function(T){T.Text=1,T.Method=2,T.Function=3,T.Constructor=4,T.Field=5,T.Variable=6,T.Class=7,T.Interface=8,T.Module=9,T.Property=10,T.Unit=11,T.Value=12,T.Enum=13,T.Keyword=14,T.Snippet=15,T.Color=16,T.File=17,T.Reference=18,T.Folder=19,T.EnumMember=20,T.Constant=21,T.Struct=22,T.Event=23,T.Operator=24,T.TypeParameter=25})(Q||(r.CompletionItemKind=Q={}));var ne;(function(T){T.PlainText=1,T.Snippet=2})(ne||(r.InsertTextFormat=ne={}));var fe;(function(T){T.Deprecated=1})(fe||(r.CompletionItemTag=fe={}));var Ee;(function(T){function N($,b,F){return{newText:$,insert:b,replace:F}}T.create=N;function v($){var b=$;return b&&z.string(b.newText)&&u.is(b.insert)&&u.is(b.replace)}T.is=v})(Ee||(r.InsertReplaceEdit=Ee={}));var me;(function(T){T.asIs=1,T.adjustIndentation=2})(me||(r.InsertTextMode=me={}));var ae;(function(T){function N(v){var $=v;return $&&(z.string($.detail)||$.detail===void 0)&&(z.string($.description)||$.description===void 0)}T.is=N})(ae||(r.CompletionItemLabelDetails=ae={}));var M;(function(T){function N(v){return{label:v}}T.create=N})(M||(r.CompletionItem=M={}));var U;(function(T){function N(v,$){return{items:v||[],isIncomplete:!!$}}T.create=N})(U||(r.CompletionList=U={}));var oe;(function(T){function N($){return $.replace(/[\\`*_{}[\]()#+\-.!]/g,"\\$&")}T.fromPlainText=N;function v($){var b=$;return z.string(b)||z.objectLiteral(b)&&z.string(b.language)&&z.string(b.value)}T.is=v})(oe||(r.MarkedString=oe={}));var G;(function(T){function N(v){var $=v;return!!$&&z.objectLiteral($)&&(Y.is($.contents)||oe.is($.contents)||z.typedArray($.contents,oe.is))&&(v.range===void 0||u.is(v.range))}T.is=N})(G||(r.Hover=G={}));var Le;(function(T){function N(v,$){return $?{label:v,documentation:$}:{label:v}}T.create=N})(Le||(r.ParameterInformation=Le={}));var yt;(function(T){function N(v,$){for(var b=[],F=2;F<arguments.length;F++)b[F-2]=arguments[F];var S={label:v};return z.defined($)&&(S.documentation=$),z.defined(b)?S.parameters=b:S.parameters=[],S}T.create=N})(yt||(r.SignatureInformation=yt={}));var gn;(function(T){T.Text=1,T.Read=2,T.Write=3})(gn||(r.DocumentHighlightKind=gn={}));var tr;(function(T){function N(v,$){var b={range:v};return z.number($)&&(b.kind=$),b}T.create=N})(tr||(r.DocumentHighlight=tr={}));var nr;(function(T){T.File=1,T.Module=2,T.Namespace=3,T.Package=4,T.Class=5,T.Method=6,T.Property=7,T.Field=8,T.Constructor=9,T.Enum=10,T.Interface=11,T.Function=12,T.Variable=13,T.Constant=14,T.String=15,T.Number=16,T.Boolean=17,T.Array=18,T.Object=19,T.Key=20,T.Null=21,T.EnumMember=22,T.Struct=23,T.Event=24,T.Operator=25,T.TypeParameter=26})(nr||(r.SymbolKind=nr={}));var rr;(function(T){T.Deprecated=1})(rr||(r.SymbolTag=rr={}));var Bt;(function(T){function N(v,$,b,F,S){var j={name:v,kind:$,location:{uri:F,range:b}};return S&&(j.containerName=S),j}T.create=N})(Bt||(r.SymbolInformation=Bt={}));var _n;(function(T){function N(v,$,b,F){return F!==void 0?{name:v,kind:$,location:{uri:b,range:F}}:{name:v,kind:$,location:{uri:b}}}T.create=N})(_n||(r.WorkspaceSymbol=_n={}));var Xr;(function(T){function N($,b,F,S,j,te){var ie={name:$,detail:b,kind:F,range:S,selectionRange:j};return te!==void 0&&(ie.children=te),ie}T.create=N;function v($){var b=$;return b&&z.string(b.name)&&z.number(b.kind)&&u.is(b.range)&&u.is(b.selectionRange)&&(b.detail===void 0||z.string(b.detail))&&(b.deprecated===void 0||z.boolean(b.deprecated))&&(b.children===void 0||Array.isArray(b.children))&&(b.tags===void 0||Array.isArray(b.tags))}T.is=v})(Xr||(r.DocumentSymbol=Xr={}));var zn;(function(T){T.Empty="",T.QuickFix="quickfix",T.Refactor="refactor",T.RefactorExtract="refactor.extract",T.RefactorInline="refactor.inline",T.RefactorRewrite="refactor.rewrite",T.Source="source",T.SourceOrganizeImports="source.organizeImports",T.SourceFixAll="source.fixAll"})(zn||(r.CodeActionKind=zn={}));var mn;(function(T){T.Invoked=1,T.Automatic=2})(mn||(r.CodeActionTriggerKind=mn={}));var Bn;(function(T){function N($,b,F){var S={diagnostics:$};return b!=null&&(S.only=b),F!=null&&(S.triggerKind=F),S}T.create=N;function v($){var b=$;return z.defined(b)&&z.typedArray(b.diagnostics,A.is)&&(b.only===void 0||z.typedArray(b.only,z.string))&&(b.triggerKind===void 0||b.triggerKind===mn.Invoked||b.triggerKind===mn.Automatic)}T.is=v})(Bn||(r.CodeActionContext=Bn={}));var tn;(function(T){function N($,b,F){var S={title:$},j=!0;return typeof b=="string"?(j=!1,S.kind=b):I.is(b)?S.command=b:S.edit=b,j&&F!==void 0&&(S.kind=F),S}T.create=N;function v($){var b=$;return b&&z.string(b.title)&&(b.diagnostics===void 0||z.typedArray(b.diagnostics,A.is))&&(b.kind===void 0||z.string(b.kind))&&(b.edit!==void 0||b.command!==void 0)&&(b.command===void 0||I.is(b.command))&&(b.isPreferred===void 0||z.boolean(b.isPreferred))&&(b.edit===void 0||W.is(b.edit))}T.is=v})(tn||(r.CodeAction=tn={}));var X;(function(T){function N($,b){var F={range:$};return z.defined(b)&&(F.data=b),F}T.create=N;function v($){var b=$;return z.defined(b)&&u.is(b.range)&&(z.undefined(b.command)||I.is(b.command))}T.is=v})(X||(r.CodeLens=X={}));var J;(function(T){function N($,b){return{tabSize:$,insertSpaces:b}}T.create=N;function v($){var b=$;return z.defined(b)&&z.uinteger(b.tabSize)&&z.boolean(b.insertSpaces)}T.is=v})(J||(r.FormattingOptions=J={}));var ue;(function(T){function N($,b,F){return{range:$,target:b,data:F}}T.create=N;function v($){var b=$;return z.defined(b)&&u.is(b.range)&&(z.undefined(b.target)||z.string(b.target))}T.is=v})(ue||(r.DocumentLink=ue={}));var qt;(function(T){function N($,b){return{range:$,parent:b}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&u.is(b.range)&&(b.parent===void 0||T.is(b.parent))}T.is=v})(qt||(r.SelectionRange=qt={}));var Lt;(function(T){T.namespace="namespace",T.type="type",T.class="class",T.enum="enum",T.interface="interface",T.struct="struct",T.typeParameter="typeParameter",T.parameter="parameter",T.variable="variable",T.property="property",T.enumMember="enumMember",T.event="event",T.function="function",T.method="method",T.macro="macro",T.keyword="keyword",T.modifier="modifier",T.comment="comment",T.string="string",T.number="number",T.regexp="regexp",T.operator="operator",T.decorator="decorator"})(Lt||(r.SemanticTokenTypes=Lt={}));var Sr;(function(T){T.declaration="declaration",T.definition="definition",T.readonly="readonly",T.static="static",T.deprecated="deprecated",T.abstract="abstract",T.async="async",T.modification="modification",T.documentation="documentation",T.defaultLibrary="defaultLibrary"})(Sr||(r.SemanticTokenModifiers=Sr={}));var _i;(function(T){function N(v){var $=v;return z.objectLiteral($)&&($.resultId===void 0||typeof $.resultId=="string")&&Array.isArray($.data)&&($.data.length===0||typeof $.data[0]=="number")}T.is=N})(_i||(r.SemanticTokens=_i={}));var fs;(function(T){function N($,b){return{range:$,text:b}}T.create=N;function v($){var b=$;return b!=null&&u.is(b.range)&&z.string(b.text)}T.is=v})(fs||(r.InlineValueText=fs={}));var hs;(function(T){function N($,b,F){return{range:$,variableName:b,caseSensitiveLookup:F}}T.create=N;function v($){var b=$;return b!=null&&u.is(b.range)&&z.boolean(b.caseSensitiveLookup)&&(z.string(b.variableName)||b.variableName===void 0)}T.is=v})(hs||(r.InlineValueVariableLookup=hs={}));var ps;(function(T){function N($,b){return{range:$,expression:b}}T.create=N;function v($){var b=$;return b!=null&&u.is(b.range)&&(z.string(b.expression)||b.expression===void 0)}T.is=v})(ps||(r.InlineValueEvaluatableExpression=ps={}));var gs;(function(T){function N($,b){return{frameId:$,stoppedLocation:b}}T.create=N;function v($){var b=$;return z.defined(b)&&u.is($.stoppedLocation)}T.is=v})(gs||(r.InlineValueContext=gs={}));var Ai;(function(T){T.Type=1,T.Parameter=2;function N(v){return v===1||v===2}T.is=N})(Ai||(r.InlayHintKind=Ai={}));var xi;(function(T){function N($){return{value:$}}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&(b.tooltip===void 0||z.string(b.tooltip)||Y.is(b.tooltip))&&(b.location===void 0||l.is(b.location))&&(b.command===void 0||I.is(b.command))}T.is=v})(xi||(r.InlayHintLabelPart=xi={}));var yn;(function(T){function N($,b,F){var S={position:$,label:b};return F!==void 0&&(S.kind=F),S}T.create=N;function v($){var b=$;return z.objectLiteral(b)&&c.is(b.position)&&(z.string(b.label)||z.typedArray(b.label,xi.is))&&(b.kind===void 0||Ai.is(b.kind))&&b.textEdits===void 0||z.typedArray(b.textEdits,x.is)&&(b.tooltip===void 0||z.string(b.tooltip)||Y.is(b.tooltip))&&(b.paddingLeft===void 0||z.boolean(b.paddingLeft))&&(b.paddingRight===void 0||z.boolean(b.paddingRight))}T.is=v})(yn||(r.InlayHint=yn={}));var ms;(function(T){function N(v){return{kind:"snippet",value:v}}T.createSnippet=N})(ms||(r.StringValue=ms={}));var ys;(function(T){function N(v,$,b,F){return{insertText:v,filterText:$,range:b,command:F}}T.create=N})(ys||(r.InlineCompletionItem=ys={}));var kr;(function(T){function N(v){return{items:v}}T.create=N})(kr||(r.InlineCompletionList=kr={}));var vs;(function(T){T.Invoked=0,T.Automatic=1})(vs||(r.InlineCompletionTriggerKind=vs={}));var Jr;(function(T){function N(v,$){return{range:v,text:$}}T.create=N})(Jr||(r.SelectedCompletionInfo=Jr={}));var ws;(function(T){function N(v,$){return{triggerKind:v,selectedCompletionInfo:$}}T.create=N})(ws||(r.InlineCompletionContext=ws={}));var qn;(function(T){function N(v){var $=v;return z.objectLiteral($)&&s.is($.uri)&&z.string($.name)}T.is=N})(qn||(r.WorkspaceFolder=qn={})),r.EOL=[`
156
+ `,`\r
157
+ `,"\r"];var ir;(function(T){function N(F,S,j,te){return new Eo(F,S,j,te)}T.create=N;function v(F){var S=F;return!!(z.defined(S)&&z.string(S.uri)&&(z.undefined(S.languageId)||z.string(S.languageId))&&z.uinteger(S.lineCount)&&z.func(S.getText)&&z.func(S.positionAt)&&z.func(S.offsetAt))}T.is=v;function $(F,S){for(var j=F.getText(),te=b(S,function($e,Je){var Ue=$e.range.start.line-Je.range.start.line;return Ue===0?$e.range.start.character-Je.range.start.character:Ue}),ie=j.length,xe=te.length-1;xe>=0;xe--){var _e=te[xe],je=F.offsetAt(_e.range.start),he=F.offsetAt(_e.range.end);if(he<=ie)j=j.substring(0,je)+_e.newText+j.substring(he,j.length);else throw new Error("Overlapping edit");ie=je}return j}T.applyEdits=$;function b(F,S){if(F.length<=1)return F;var j=F.length/2|0,te=F.slice(0,j),ie=F.slice(j);b(te,S),b(ie,S);for(var xe=0,_e=0,je=0;xe<te.length&&_e<ie.length;){var he=S(te[xe],ie[_e]);he<=0?F[je++]=te[xe++]:F[je++]=ie[_e++]}for(;xe<te.length;)F[je++]=te[xe++];for(;_e<ie.length;)F[je++]=ie[_e++];return F}})(ir||(r.TextDocument=ir={}));var Eo=function(){function T(N,v,$,b){this._uri=N,this._languageId=v,this._version=$,this._content=b,this._lineOffsets=void 0}return Object.defineProperty(T.prototype,"uri",{get:function(){return this._uri},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"languageId",{get:function(){return this._languageId},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"version",{get:function(){return this._version},enumerable:!1,configurable:!0}),T.prototype.getText=function(N){if(N){var v=this.offsetAt(N.start),$=this.offsetAt(N.end);return this._content.substring(v,$)}return this._content},T.prototype.update=function(N,v){this._content=N.text,this._version=v,this._lineOffsets=void 0},T.prototype.getLineOffsets=function(){if(this._lineOffsets===void 0){for(var N=[],v=this._content,$=!0,b=0;b<v.length;b++){$&&(N.push(b),$=!1);var F=v.charAt(b);$=F==="\r"||F===`
158
+ `,F==="\r"&&b+1<v.length&&v.charAt(b+1)===`
159
+ `&&b++}$&&v.length>0&&N.push(v.length),this._lineOffsets=N}return this._lineOffsets},T.prototype.positionAt=function(N){N=Math.max(Math.min(N,this._content.length),0);var v=this.getLineOffsets(),$=0,b=v.length;if(b===0)return c.create(0,N);for(;$<b;){var F=Math.floor(($+b)/2);v[F]>N?b=F:$=F+1}var S=$-1;return c.create(S,N-v[S])},T.prototype.offsetAt=function(N){var v=this.getLineOffsets();if(N.line>=v.length)return this._content.length;if(N.line<0)return 0;var $=v[N.line],b=N.line+1<v.length?v[N.line+1]:this._content.length;return Math.max(Math.min($+N.character,b),$)},Object.defineProperty(T.prototype,"lineCount",{get:function(){return this.getLineOffsets().length},enumerable:!1,configurable:!0}),T}(),z;(function(T){var N=Object.prototype.toString;function v(he){return typeof he<"u"}T.defined=v;function $(he){return typeof he>"u"}T.undefined=$;function b(he){return he===!0||he===!1}T.boolean=b;function F(he){return N.call(he)==="[object String]"}T.string=F;function S(he){return N.call(he)==="[object Number]"}T.number=S;function j(he,$e,Je){return N.call(he)==="[object Number]"&&$e<=he&&he<=Je}T.numberRange=j;function te(he){return N.call(he)==="[object Number]"&&-2147483648<=he&&he<=2147483647}T.integer=te;function ie(he){return N.call(he)==="[object Number]"&&0<=he&&he<=2147483647}T.uinteger=ie;function xe(he){return N.call(he)==="[object Function]"}T.func=xe;function _e(he){return he!==null&&typeof he=="object"}T.objectLiteral=_e;function je(he,$e){return Array.isArray(he)&&he.every($e)}T.typedArray=je})(z||(z={}))})}(ah,ah.exports)),ah.exports}var ln={},t$;function pt(){if(t$)return ln;t$=1,Object.defineProperty(ln,"__esModule",{value:!0}),ln.ProtocolNotificationType=ln.ProtocolNotificationType0=ln.ProtocolRequestType=ln.ProtocolRequestType0=ln.RegistrationType=ln.MessageDirection=void 0;const t=Ks();var e;(function(a){a.clientToServer="clientToServer",a.serverToClient="serverToClient",a.both="both"})(e||(ln.MessageDirection=e={}));class n{constructor(c){this.method=c}}ln.RegistrationType=n;class r extends t.RequestType0{constructor(c){super(c)}}ln.ProtocolRequestType0=r;class i extends t.RequestType{constructor(c){super(c,t.ParameterStructures.byName)}}ln.ProtocolRequestType=i;class s extends t.NotificationType0{constructor(c){super(c)}}ln.ProtocolNotificationType0=s;class o extends t.NotificationType{constructor(c){super(c,t.ParameterStructures.byName)}}return ln.ProtocolNotificationType=o,ln}var lv={},Rt={},n$;function dv(){if(n$)return Rt;n$=1,Object.defineProperty(Rt,"__esModule",{value:!0}),Rt.objectLiteral=Rt.typedArray=Rt.stringArray=Rt.array=Rt.func=Rt.error=Rt.number=Rt.string=Rt.boolean=void 0;function t(u){return u===!0||u===!1}Rt.boolean=t;function e(u){return typeof u=="string"||u instanceof String}Rt.string=e;function n(u){return typeof u=="number"||u instanceof Number}Rt.number=n;function r(u){return u instanceof Error}Rt.error=r;function i(u){return typeof u=="function"}Rt.func=i;function s(u){return Array.isArray(u)}Rt.array=s;function o(u){return s(u)&&u.every(l=>e(l))}Rt.stringArray=o;function a(u,l){return Array.isArray(u)&&u.every(l)}Rt.typedArray=a;function c(u){return u!==null&&typeof u=="object"}return Rt.objectLiteral=c,Rt}var ou={},r$;function U9(){if(r$)return ou;r$=1,Object.defineProperty(ou,"__esModule",{value:!0}),ou.ImplementationRequest=void 0;const t=pt();var e;return function(n){n.method="textDocument/implementation",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(ou.ImplementationRequest=e={})),ou}var au={},i$;function G9(){if(i$)return au;i$=1,Object.defineProperty(au,"__esModule",{value:!0}),au.TypeDefinitionRequest=void 0;const t=pt();var e;return function(n){n.method="textDocument/typeDefinition",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(au.TypeDefinitionRequest=e={})),au}var Xs={},s$;function W9(){if(s$)return Xs;s$=1,Object.defineProperty(Xs,"__esModule",{value:!0}),Xs.DidChangeWorkspaceFoldersNotification=Xs.WorkspaceFoldersRequest=void 0;const t=pt();var e;(function(r){r.method="workspace/workspaceFolders",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)})(e||(Xs.WorkspaceFoldersRequest=e={}));var n;return function(r){r.method="workspace/didChangeWorkspaceFolders",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolNotificationType(r.method)}(n||(Xs.DidChangeWorkspaceFoldersNotification=n={})),Xs}var cu={},o$;function H9(){if(o$)return cu;o$=1,Object.defineProperty(cu,"__esModule",{value:!0}),cu.ConfigurationRequest=void 0;const t=pt();var e;return function(n){n.method="workspace/configuration",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(cu.ConfigurationRequest=e={})),cu}var Js={},a$;function V9(){if(a$)return Js;a$=1,Object.defineProperty(Js,"__esModule",{value:!0}),Js.ColorPresentationRequest=Js.DocumentColorRequest=void 0;const t=pt();var e;(function(r){r.method="textDocument/documentColor",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Js.DocumentColorRequest=e={}));var n;return function(r){r.method="textDocument/colorPresentation",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)}(n||(Js.ColorPresentationRequest=n={})),Js}var Zs={},c$;function K9(){if(c$)return Zs;c$=1,Object.defineProperty(Zs,"__esModule",{value:!0}),Zs.FoldingRangeRefreshRequest=Zs.FoldingRangeRequest=void 0;const t=pt();var e;(function(r){r.method="textDocument/foldingRange",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Zs.FoldingRangeRequest=e={}));var n;return function(r){r.method="workspace/foldingRange/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Zs.FoldingRangeRefreshRequest=n={})),Zs}var uu={},u$;function Y9(){if(u$)return uu;u$=1,Object.defineProperty(uu,"__esModule",{value:!0}),uu.DeclarationRequest=void 0;const t=pt();var e;return function(n){n.method="textDocument/declaration",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(uu.DeclarationRequest=e={})),uu}var lu={},l$;function X9(){if(l$)return lu;l$=1,Object.defineProperty(lu,"__esModule",{value:!0}),lu.SelectionRangeRequest=void 0;const t=pt();var e;return function(n){n.method="textDocument/selectionRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(lu.SelectionRangeRequest=e={})),lu}var Di={},d$;function J9(){if(d$)return Di;d$=1,Object.defineProperty(Di,"__esModule",{value:!0}),Di.WorkDoneProgressCancelNotification=Di.WorkDoneProgressCreateRequest=Di.WorkDoneProgress=void 0;const t=Ks(),e=pt();var n;(function(s){s.type=new t.ProgressType;function o(a){return a===s.type}s.is=o})(n||(Di.WorkDoneProgress=n={}));var r;(function(s){s.method="window/workDoneProgress/create",s.messageDirection=e.MessageDirection.serverToClient,s.type=new e.ProtocolRequestType(s.method)})(r||(Di.WorkDoneProgressCreateRequest=r={}));var i;return function(s){s.method="window/workDoneProgress/cancel",s.messageDirection=e.MessageDirection.clientToServer,s.type=new e.ProtocolNotificationType(s.method)}(i||(Di.WorkDoneProgressCancelNotification=i={})),Di}var Ti={},f$;function Z9(){if(f$)return Ti;f$=1,Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.CallHierarchyOutgoingCallsRequest=Ti.CallHierarchyIncomingCallsRequest=Ti.CallHierarchyPrepareRequest=void 0;const t=pt();var e;(function(i){i.method="textDocument/prepareCallHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Ti.CallHierarchyPrepareRequest=e={}));var n;(function(i){i.method="callHierarchy/incomingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Ti.CallHierarchyIncomingCallsRequest=n={}));var r;return function(i){i.method="callHierarchy/outgoingCalls",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Ti.CallHierarchyOutgoingCallsRequest=r={})),Ti}var dn={},h$;function Q9(){if(h$)return dn;h$=1,Object.defineProperty(dn,"__esModule",{value:!0}),dn.SemanticTokensRefreshRequest=dn.SemanticTokensRangeRequest=dn.SemanticTokensDeltaRequest=dn.SemanticTokensRequest=dn.SemanticTokensRegistrationType=dn.TokenFormat=void 0;const t=pt();var e;(function(a){a.Relative="relative"})(e||(dn.TokenFormat=e={}));var n;(function(a){a.method="textDocument/semanticTokens",a.type=new t.RegistrationType(a.method)})(n||(dn.SemanticTokensRegistrationType=n={}));var r;(function(a){a.method="textDocument/semanticTokens/full",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(r||(dn.SemanticTokensRequest=r={}));var i;(function(a){a.method="textDocument/semanticTokens/full/delta",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(i||(dn.SemanticTokensDeltaRequest=i={}));var s;(function(a){a.method="textDocument/semanticTokens/range",a.messageDirection=t.MessageDirection.clientToServer,a.type=new t.ProtocolRequestType(a.method),a.registrationMethod=n.method})(s||(dn.SemanticTokensRangeRequest=s={}));var o;return function(a){a.method="workspace/semanticTokens/refresh",a.messageDirection=t.MessageDirection.serverToClient,a.type=new t.ProtocolRequestType0(a.method)}(o||(dn.SemanticTokensRefreshRequest=o={})),dn}var du={},p$;function e7(){if(p$)return du;p$=1,Object.defineProperty(du,"__esModule",{value:!0}),du.ShowDocumentRequest=void 0;const t=pt();var e;return function(n){n.method="window/showDocument",n.messageDirection=t.MessageDirection.serverToClient,n.type=new t.ProtocolRequestType(n.method)}(e||(du.ShowDocumentRequest=e={})),du}var fu={},g$;function t7(){if(g$)return fu;g$=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.LinkedEditingRangeRequest=void 0;const t=pt();var e;return function(n){n.method="textDocument/linkedEditingRange",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(fu.LinkedEditingRangeRequest=e={})),fu}var Ht={},m$;function n7(){if(m$)return Ht;m$=1,Object.defineProperty(Ht,"__esModule",{value:!0}),Ht.WillDeleteFilesRequest=Ht.DidDeleteFilesNotification=Ht.DidRenameFilesNotification=Ht.WillRenameFilesRequest=Ht.DidCreateFilesNotification=Ht.WillCreateFilesRequest=Ht.FileOperationPatternKind=void 0;const t=pt();var e;(function(c){c.file="file",c.folder="folder"})(e||(Ht.FileOperationPatternKind=e={}));var n;(function(c){c.method="workspace/willCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(n||(Ht.WillCreateFilesRequest=n={}));var r;(function(c){c.method="workspace/didCreateFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(r||(Ht.DidCreateFilesNotification=r={}));var i;(function(c){c.method="workspace/willRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)})(i||(Ht.WillRenameFilesRequest=i={}));var s;(function(c){c.method="workspace/didRenameFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(s||(Ht.DidRenameFilesNotification=s={}));var o;(function(c){c.method="workspace/didDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolNotificationType(c.method)})(o||(Ht.DidDeleteFilesNotification=o={}));var a;return function(c){c.method="workspace/willDeleteFiles",c.messageDirection=t.MessageDirection.clientToServer,c.type=new t.ProtocolRequestType(c.method)}(a||(Ht.WillDeleteFilesRequest=a={})),Ht}var Ri={},y$;function r7(){if(y$)return Ri;y$=1,Object.defineProperty(Ri,"__esModule",{value:!0}),Ri.MonikerRequest=Ri.MonikerKind=Ri.UniquenessLevel=void 0;const t=pt();var e;(function(i){i.document="document",i.project="project",i.group="group",i.scheme="scheme",i.global="global"})(e||(Ri.UniquenessLevel=e={}));var n;(function(i){i.$import="import",i.$export="export",i.local="local"})(n||(Ri.MonikerKind=n={}));var r;return function(i){i.method="textDocument/moniker",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Ri.MonikerRequest=r={})),Ri}var Si={},v$;function i7(){if(v$)return Si;v$=1,Object.defineProperty(Si,"__esModule",{value:!0}),Si.TypeHierarchySubtypesRequest=Si.TypeHierarchySupertypesRequest=Si.TypeHierarchyPrepareRequest=void 0;const t=pt();var e;(function(i){i.method="textDocument/prepareTypeHierarchy",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(Si.TypeHierarchyPrepareRequest=e={}));var n;(function(i){i.method="typeHierarchy/supertypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(Si.TypeHierarchySupertypesRequest=n={}));var r;return function(i){i.method="typeHierarchy/subtypes",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)}(r||(Si.TypeHierarchySubtypesRequest=r={})),Si}var Qs={},w$;function s7(){if(w$)return Qs;w$=1,Object.defineProperty(Qs,"__esModule",{value:!0}),Qs.InlineValueRefreshRequest=Qs.InlineValueRequest=void 0;const t=pt();var e;(function(r){r.method="textDocument/inlineValue",r.messageDirection=t.MessageDirection.clientToServer,r.type=new t.ProtocolRequestType(r.method)})(e||(Qs.InlineValueRequest=e={}));var n;return function(r){r.method="workspace/inlineValue/refresh",r.messageDirection=t.MessageDirection.serverToClient,r.type=new t.ProtocolRequestType0(r.method)}(n||(Qs.InlineValueRefreshRequest=n={})),Qs}var ki={},b$;function o7(){if(b$)return ki;b$=1,Object.defineProperty(ki,"__esModule",{value:!0}),ki.InlayHintRefreshRequest=ki.InlayHintResolveRequest=ki.InlayHintRequest=void 0;const t=pt();var e;(function(i){i.method="textDocument/inlayHint",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(e||(ki.InlayHintRequest=e={}));var n;(function(i){i.method="inlayHint/resolve",i.messageDirection=t.MessageDirection.clientToServer,i.type=new t.ProtocolRequestType(i.method)})(n||(ki.InlayHintResolveRequest=n={}));var r;return function(i){i.method="workspace/inlayHint/refresh",i.messageDirection=t.MessageDirection.serverToClient,i.type=new t.ProtocolRequestType0(i.method)}(r||(ki.InlayHintRefreshRequest=r={})),ki}var Fn={},E$;function a7(){if(E$)return Fn;E$=1,Object.defineProperty(Fn,"__esModule",{value:!0}),Fn.DiagnosticRefreshRequest=Fn.WorkspaceDiagnosticRequest=Fn.DocumentDiagnosticRequest=Fn.DocumentDiagnosticReportKind=Fn.DiagnosticServerCancellationData=void 0;const t=Ks(),e=dv(),n=pt();var r;(function(c){function u(l){const d=l;return d&&e.boolean(d.retriggerRequest)}c.is=u})(r||(Fn.DiagnosticServerCancellationData=r={}));var i;(function(c){c.Full="full",c.Unchanged="unchanged"})(i||(Fn.DocumentDiagnosticReportKind=i={}));var s;(function(c){c.method="textDocument/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(s||(Fn.DocumentDiagnosticRequest=s={}));var o;(function(c){c.method="workspace/diagnostic",c.messageDirection=n.MessageDirection.clientToServer,c.type=new n.ProtocolRequestType(c.method),c.partialResult=new t.ProgressType})(o||(Fn.WorkspaceDiagnosticRequest=o={}));var a;return function(c){c.method="workspace/diagnostic/refresh",c.messageDirection=n.MessageDirection.serverToClient,c.type=new n.ProtocolRequestType0(c.method)}(a||(Fn.DiagnosticRefreshRequest=a={})),Fn}var gt={},D$;function c7(){if(D$)return gt;D$=1,Object.defineProperty(gt,"__esModule",{value:!0}),gt.DidCloseNotebookDocumentNotification=gt.DidSaveNotebookDocumentNotification=gt.DidChangeNotebookDocumentNotification=gt.NotebookCellArrayChange=gt.DidOpenNotebookDocumentNotification=gt.NotebookDocumentSyncRegistrationType=gt.NotebookDocument=gt.NotebookCell=gt.ExecutionSummary=gt.NotebookCellKind=void 0;const t=uv(),e=dv(),n=pt();var r;(function(h){h.Markup=1,h.Code=2;function p(g){return g===1||g===2}h.is=p})(r||(gt.NotebookCellKind=r={}));var i;(function(h){function p(m,w){const E={executionOrder:m};return(w===!0||w===!1)&&(E.success=w),E}h.create=p;function g(m){const w=m;return e.objectLiteral(w)&&t.uinteger.is(w.executionOrder)&&(w.success===void 0||e.boolean(w.success))}h.is=g;function y(m,w){return m===w?!0:m==null||w===null||w===void 0?!1:m.executionOrder===w.executionOrder&&m.success===w.success}h.equals=y})(i||(gt.ExecutionSummary=i={}));var s;(function(h){function p(w,E){return{kind:w,document:E}}h.create=p;function g(w){const E=w;return e.objectLiteral(E)&&r.is(E.kind)&&t.DocumentUri.is(E.document)&&(E.metadata===void 0||e.objectLiteral(E.metadata))}h.is=g;function y(w,E){const k=new Set;return w.document!==E.document&&k.add("document"),w.kind!==E.kind&&k.add("kind"),w.executionSummary!==E.executionSummary&&k.add("executionSummary"),(w.metadata!==void 0||E.metadata!==void 0)&&!m(w.metadata,E.metadata)&&k.add("metadata"),(w.executionSummary!==void 0||E.executionSummary!==void 0)&&!i.equals(w.executionSummary,E.executionSummary)&&k.add("executionSummary"),k}h.diff=y;function m(w,E){if(w===E)return!0;if(w==null||E===null||E===void 0||typeof w!=typeof E||typeof w!="object")return!1;const k=Array.isArray(w),A=Array.isArray(E);if(k!==A)return!1;if(k&&A){if(w.length!==E.length)return!1;for(let I=0;I<w.length;I++)if(!m(w[I],E[I]))return!1}if(e.objectLiteral(w)&&e.objectLiteral(E)){const I=Object.keys(w),x=Object.keys(E);if(I.length!==x.length||(I.sort(),x.sort(),!m(I,x)))return!1;for(let _=0;_<I.length;_++){const P=I[_];if(!m(w[P],E[P]))return!1}}return!0}})(s||(gt.NotebookCell=s={}));var o;(function(h){function p(y,m,w,E){return{uri:y,notebookType:m,version:w,cells:E}}h.create=p;function g(y){const m=y;return e.objectLiteral(m)&&e.string(m.uri)&&t.integer.is(m.version)&&e.typedArray(m.cells,s.is)}h.is=g})(o||(gt.NotebookDocument=o={}));var a;(function(h){h.method="notebookDocument/sync",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.RegistrationType(h.method)})(a||(gt.NotebookDocumentSyncRegistrationType=a={}));var c;(function(h){h.method="notebookDocument/didOpen",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method})(c||(gt.DidOpenNotebookDocumentNotification=c={}));var u;(function(h){function p(y){const m=y;return e.objectLiteral(m)&&t.uinteger.is(m.start)&&t.uinteger.is(m.deleteCount)&&(m.cells===void 0||e.typedArray(m.cells,s.is))}h.is=p;function g(y,m,w){const E={start:y,deleteCount:m};return w!==void 0&&(E.cells=w),E}h.create=g})(u||(gt.NotebookCellArrayChange=u={}));var l;(function(h){h.method="notebookDocument/didChange",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method})(l||(gt.DidChangeNotebookDocumentNotification=l={}));var d;(function(h){h.method="notebookDocument/didSave",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method})(d||(gt.DidSaveNotebookDocumentNotification=d={}));var f;return function(h){h.method="notebookDocument/didClose",h.messageDirection=n.MessageDirection.clientToServer,h.type=new n.ProtocolNotificationType(h.method),h.registrationMethod=a.method}(f||(gt.DidCloseNotebookDocumentNotification=f={})),gt}var hu={},T$;function u7(){if(T$)return hu;T$=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.InlineCompletionRequest=void 0;const t=pt();var e;return function(n){n.method="textDocument/inlineCompletion",n.messageDirection=t.MessageDirection.clientToServer,n.type=new t.ProtocolRequestType(n.method)}(e||(hu.InlineCompletionRequest=e={})),hu}var R$;function l7(){return R$||(R$=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.WorkspaceSymbolRequest=t.CodeActionResolveRequest=t.CodeActionRequest=t.DocumentSymbolRequest=t.DocumentHighlightRequest=t.ReferencesRequest=t.DefinitionRequest=t.SignatureHelpRequest=t.SignatureHelpTriggerKind=t.HoverRequest=t.CompletionResolveRequest=t.CompletionRequest=t.CompletionTriggerKind=t.PublishDiagnosticsNotification=t.WatchKind=t.RelativePattern=t.FileChangeType=t.DidChangeWatchedFilesNotification=t.WillSaveTextDocumentWaitUntilRequest=t.WillSaveTextDocumentNotification=t.TextDocumentSaveReason=t.DidSaveTextDocumentNotification=t.DidCloseTextDocumentNotification=t.DidChangeTextDocumentNotification=t.TextDocumentContentChangeEvent=t.DidOpenTextDocumentNotification=t.TextDocumentSyncKind=t.TelemetryEventNotification=t.LogMessageNotification=t.ShowMessageRequest=t.ShowMessageNotification=t.MessageType=t.DidChangeConfigurationNotification=t.ExitNotification=t.ShutdownRequest=t.InitializedNotification=t.InitializeErrorCodes=t.InitializeRequest=t.WorkDoneProgressOptions=t.TextDocumentRegistrationOptions=t.StaticRegistrationOptions=t.PositionEncodingKind=t.FailureHandlingKind=t.ResourceOperationKind=t.UnregistrationRequest=t.RegistrationRequest=t.DocumentSelector=t.NotebookCellTextDocumentFilter=t.NotebookDocumentFilter=t.TextDocumentFilter=void 0,t.MonikerRequest=t.MonikerKind=t.UniquenessLevel=t.WillDeleteFilesRequest=t.DidDeleteFilesNotification=t.WillRenameFilesRequest=t.DidRenameFilesNotification=t.WillCreateFilesRequest=t.DidCreateFilesNotification=t.FileOperationPatternKind=t.LinkedEditingRangeRequest=t.ShowDocumentRequest=t.SemanticTokensRegistrationType=t.SemanticTokensRefreshRequest=t.SemanticTokensRangeRequest=t.SemanticTokensDeltaRequest=t.SemanticTokensRequest=t.TokenFormat=t.CallHierarchyPrepareRequest=t.CallHierarchyOutgoingCallsRequest=t.CallHierarchyIncomingCallsRequest=t.WorkDoneProgressCancelNotification=t.WorkDoneProgressCreateRequest=t.WorkDoneProgress=t.SelectionRangeRequest=t.DeclarationRequest=t.FoldingRangeRefreshRequest=t.FoldingRangeRequest=t.ColorPresentationRequest=t.DocumentColorRequest=t.ConfigurationRequest=t.DidChangeWorkspaceFoldersNotification=t.WorkspaceFoldersRequest=t.TypeDefinitionRequest=t.ImplementationRequest=t.ApplyWorkspaceEditRequest=t.ExecuteCommandRequest=t.PrepareRenameRequest=t.RenameRequest=t.PrepareSupportDefaultBehavior=t.DocumentOnTypeFormattingRequest=t.DocumentRangesFormattingRequest=t.DocumentRangeFormattingRequest=t.DocumentFormattingRequest=t.DocumentLinkResolveRequest=t.DocumentLinkRequest=t.CodeLensRefreshRequest=t.CodeLensResolveRequest=t.CodeLensRequest=t.WorkspaceSymbolResolveRequest=void 0,t.InlineCompletionRequest=t.DidCloseNotebookDocumentNotification=t.DidSaveNotebookDocumentNotification=t.DidChangeNotebookDocumentNotification=t.NotebookCellArrayChange=t.DidOpenNotebookDocumentNotification=t.NotebookDocumentSyncRegistrationType=t.NotebookDocument=t.NotebookCell=t.ExecutionSummary=t.NotebookCellKind=t.DiagnosticRefreshRequest=t.WorkspaceDiagnosticRequest=t.DocumentDiagnosticRequest=t.DocumentDiagnosticReportKind=t.DiagnosticServerCancellationData=t.InlayHintRefreshRequest=t.InlayHintResolveRequest=t.InlayHintRequest=t.InlineValueRefreshRequest=t.InlineValueRequest=t.TypeHierarchySupertypesRequest=t.TypeHierarchySubtypesRequest=t.TypeHierarchyPrepareRequest=void 0;const e=pt(),n=uv(),r=dv(),i=U9();Object.defineProperty(t,"ImplementationRequest",{enumerable:!0,get:function(){return i.ImplementationRequest}});const s=G9();Object.defineProperty(t,"TypeDefinitionRequest",{enumerable:!0,get:function(){return s.TypeDefinitionRequest}});const o=W9();Object.defineProperty(t,"WorkspaceFoldersRequest",{enumerable:!0,get:function(){return o.WorkspaceFoldersRequest}}),Object.defineProperty(t,"DidChangeWorkspaceFoldersNotification",{enumerable:!0,get:function(){return o.DidChangeWorkspaceFoldersNotification}});const a=H9();Object.defineProperty(t,"ConfigurationRequest",{enumerable:!0,get:function(){return a.ConfigurationRequest}});const c=V9();Object.defineProperty(t,"DocumentColorRequest",{enumerable:!0,get:function(){return c.DocumentColorRequest}}),Object.defineProperty(t,"ColorPresentationRequest",{enumerable:!0,get:function(){return c.ColorPresentationRequest}});const u=K9();Object.defineProperty(t,"FoldingRangeRequest",{enumerable:!0,get:function(){return u.FoldingRangeRequest}}),Object.defineProperty(t,"FoldingRangeRefreshRequest",{enumerable:!0,get:function(){return u.FoldingRangeRefreshRequest}});const l=Y9();Object.defineProperty(t,"DeclarationRequest",{enumerable:!0,get:function(){return l.DeclarationRequest}});const d=X9();Object.defineProperty(t,"SelectionRangeRequest",{enumerable:!0,get:function(){return d.SelectionRangeRequest}});const f=J9();Object.defineProperty(t,"WorkDoneProgress",{enumerable:!0,get:function(){return f.WorkDoneProgress}}),Object.defineProperty(t,"WorkDoneProgressCreateRequest",{enumerable:!0,get:function(){return f.WorkDoneProgressCreateRequest}}),Object.defineProperty(t,"WorkDoneProgressCancelNotification",{enumerable:!0,get:function(){return f.WorkDoneProgressCancelNotification}});const h=Z9();Object.defineProperty(t,"CallHierarchyIncomingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyIncomingCallsRequest}}),Object.defineProperty(t,"CallHierarchyOutgoingCallsRequest",{enumerable:!0,get:function(){return h.CallHierarchyOutgoingCallsRequest}}),Object.defineProperty(t,"CallHierarchyPrepareRequest",{enumerable:!0,get:function(){return h.CallHierarchyPrepareRequest}});const p=Q9();Object.defineProperty(t,"TokenFormat",{enumerable:!0,get:function(){return p.TokenFormat}}),Object.defineProperty(t,"SemanticTokensRequest",{enumerable:!0,get:function(){return p.SemanticTokensRequest}}),Object.defineProperty(t,"SemanticTokensDeltaRequest",{enumerable:!0,get:function(){return p.SemanticTokensDeltaRequest}}),Object.defineProperty(t,"SemanticTokensRangeRequest",{enumerable:!0,get:function(){return p.SemanticTokensRangeRequest}}),Object.defineProperty(t,"SemanticTokensRefreshRequest",{enumerable:!0,get:function(){return p.SemanticTokensRefreshRequest}}),Object.defineProperty(t,"SemanticTokensRegistrationType",{enumerable:!0,get:function(){return p.SemanticTokensRegistrationType}});const g=e7();Object.defineProperty(t,"ShowDocumentRequest",{enumerable:!0,get:function(){return g.ShowDocumentRequest}});const y=t7();Object.defineProperty(t,"LinkedEditingRangeRequest",{enumerable:!0,get:function(){return y.LinkedEditingRangeRequest}});const m=n7();Object.defineProperty(t,"FileOperationPatternKind",{enumerable:!0,get:function(){return m.FileOperationPatternKind}}),Object.defineProperty(t,"DidCreateFilesNotification",{enumerable:!0,get:function(){return m.DidCreateFilesNotification}}),Object.defineProperty(t,"WillCreateFilesRequest",{enumerable:!0,get:function(){return m.WillCreateFilesRequest}}),Object.defineProperty(t,"DidRenameFilesNotification",{enumerable:!0,get:function(){return m.DidRenameFilesNotification}}),Object.defineProperty(t,"WillRenameFilesRequest",{enumerable:!0,get:function(){return m.WillRenameFilesRequest}}),Object.defineProperty(t,"DidDeleteFilesNotification",{enumerable:!0,get:function(){return m.DidDeleteFilesNotification}}),Object.defineProperty(t,"WillDeleteFilesRequest",{enumerable:!0,get:function(){return m.WillDeleteFilesRequest}});const w=r7();Object.defineProperty(t,"UniquenessLevel",{enumerable:!0,get:function(){return w.UniquenessLevel}}),Object.defineProperty(t,"MonikerKind",{enumerable:!0,get:function(){return w.MonikerKind}}),Object.defineProperty(t,"MonikerRequest",{enumerable:!0,get:function(){return w.MonikerRequest}});const E=i7();Object.defineProperty(t,"TypeHierarchyPrepareRequest",{enumerable:!0,get:function(){return E.TypeHierarchyPrepareRequest}}),Object.defineProperty(t,"TypeHierarchySubtypesRequest",{enumerable:!0,get:function(){return E.TypeHierarchySubtypesRequest}}),Object.defineProperty(t,"TypeHierarchySupertypesRequest",{enumerable:!0,get:function(){return E.TypeHierarchySupertypesRequest}});const k=s7();Object.defineProperty(t,"InlineValueRequest",{enumerable:!0,get:function(){return k.InlineValueRequest}}),Object.defineProperty(t,"InlineValueRefreshRequest",{enumerable:!0,get:function(){return k.InlineValueRefreshRequest}});const A=o7();Object.defineProperty(t,"InlayHintRequest",{enumerable:!0,get:function(){return A.InlayHintRequest}}),Object.defineProperty(t,"InlayHintResolveRequest",{enumerable:!0,get:function(){return A.InlayHintResolveRequest}}),Object.defineProperty(t,"InlayHintRefreshRequest",{enumerable:!0,get:function(){return A.InlayHintRefreshRequest}});const I=a7();Object.defineProperty(t,"DiagnosticServerCancellationData",{enumerable:!0,get:function(){return I.DiagnosticServerCancellationData}}),Object.defineProperty(t,"DocumentDiagnosticReportKind",{enumerable:!0,get:function(){return I.DocumentDiagnosticReportKind}}),Object.defineProperty(t,"DocumentDiagnosticRequest",{enumerable:!0,get:function(){return I.DocumentDiagnosticRequest}}),Object.defineProperty(t,"WorkspaceDiagnosticRequest",{enumerable:!0,get:function(){return I.WorkspaceDiagnosticRequest}}),Object.defineProperty(t,"DiagnosticRefreshRequest",{enumerable:!0,get:function(){return I.DiagnosticRefreshRequest}});const x=c7();Object.defineProperty(t,"NotebookCellKind",{enumerable:!0,get:function(){return x.NotebookCellKind}}),Object.defineProperty(t,"ExecutionSummary",{enumerable:!0,get:function(){return x.ExecutionSummary}}),Object.defineProperty(t,"NotebookCell",{enumerable:!0,get:function(){return x.NotebookCell}}),Object.defineProperty(t,"NotebookDocument",{enumerable:!0,get:function(){return x.NotebookDocument}}),Object.defineProperty(t,"NotebookDocumentSyncRegistrationType",{enumerable:!0,get:function(){return x.NotebookDocumentSyncRegistrationType}}),Object.defineProperty(t,"DidOpenNotebookDocumentNotification",{enumerable:!0,get:function(){return x.DidOpenNotebookDocumentNotification}}),Object.defineProperty(t,"NotebookCellArrayChange",{enumerable:!0,get:function(){return x.NotebookCellArrayChange}}),Object.defineProperty(t,"DidChangeNotebookDocumentNotification",{enumerable:!0,get:function(){return x.DidChangeNotebookDocumentNotification}}),Object.defineProperty(t,"DidSaveNotebookDocumentNotification",{enumerable:!0,get:function(){return x.DidSaveNotebookDocumentNotification}}),Object.defineProperty(t,"DidCloseNotebookDocumentNotification",{enumerable:!0,get:function(){return x.DidCloseNotebookDocumentNotification}});const _=u7();Object.defineProperty(t,"InlineCompletionRequest",{enumerable:!0,get:function(){return _.InlineCompletionRequest}});var P;(function(v){function $(b){const F=b;return r.string(F)||r.string(F.language)||r.string(F.scheme)||r.string(F.pattern)}v.is=$})(P||(t.TextDocumentFilter=P={}));var O;(function(v){function $(b){const F=b;return r.objectLiteral(F)&&(r.string(F.notebookType)||r.string(F.scheme)||r.string(F.pattern))}v.is=$})(O||(t.NotebookDocumentFilter=O={}));var C;(function(v){function $(b){const F=b;return r.objectLiteral(F)&&(r.string(F.notebook)||O.is(F.notebook))&&(F.language===void 0||r.string(F.language))}v.is=$})(C||(t.NotebookCellTextDocumentFilter=C={}));var D;(function(v){function $(b){if(!Array.isArray(b))return!1;for(let F of b)if(!r.string(F)&&!P.is(F)&&!C.is(F))return!1;return!0}v.is=$})(D||(t.DocumentSelector=D={}));var R;(function(v){v.method="client/registerCapability",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolRequestType(v.method)})(R||(t.RegistrationRequest=R={}));var L;(function(v){v.method="client/unregisterCapability",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolRequestType(v.method)})(L||(t.UnregistrationRequest=L={}));var W;(function(v){v.Create="create",v.Rename="rename",v.Delete="delete"})(W||(t.ResourceOperationKind=W={}));var V;(function(v){v.Abort="abort",v.Transactional="transactional",v.TextOnlyTransactional="textOnlyTransactional",v.Undo="undo"})(V||(t.FailureHandlingKind=V={}));var Z;(function(v){v.UTF8="utf-8",v.UTF16="utf-16",v.UTF32="utf-32"})(Z||(t.PositionEncodingKind=Z={}));var Fe;(function(v){function $(b){const F=b;return F&&r.string(F.id)&&F.id.length>0}v.hasId=$})(Fe||(t.StaticRegistrationOptions=Fe={}));var se;(function(v){function $(b){const F=b;return F&&(F.documentSelector===null||D.is(F.documentSelector))}v.is=$})(se||(t.TextDocumentRegistrationOptions=se={}));var K;(function(v){function $(F){const S=F;return r.objectLiteral(S)&&(S.workDoneProgress===void 0||r.boolean(S.workDoneProgress))}v.is=$;function b(F){const S=F;return S&&r.boolean(S.workDoneProgress)}v.hasWorkDoneProgress=b})(K||(t.WorkDoneProgressOptions=K={}));var Te;(function(v){v.method="initialize",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(Te||(t.InitializeRequest=Te={}));var at;(function(v){v.unknownProtocolVersion=1})(at||(t.InitializeErrorCodes=at={}));var H;(function(v){v.method="initialized",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(H||(t.InitializedNotification=H={}));var Y;(function(v){v.method="shutdown",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType0(v.method)})(Y||(t.ShutdownRequest=Y={}));var Q;(function(v){v.method="exit",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType0(v.method)})(Q||(t.ExitNotification=Q={}));var ne;(function(v){v.method="workspace/didChangeConfiguration",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(ne||(t.DidChangeConfigurationNotification=ne={}));var fe;(function(v){v.Error=1,v.Warning=2,v.Info=3,v.Log=4,v.Debug=5})(fe||(t.MessageType=fe={}));var Ee;(function(v){v.method="window/showMessage",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolNotificationType(v.method)})(Ee||(t.ShowMessageNotification=Ee={}));var me;(function(v){v.method="window/showMessageRequest",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolRequestType(v.method)})(me||(t.ShowMessageRequest=me={}));var ae;(function(v){v.method="window/logMessage",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolNotificationType(v.method)})(ae||(t.LogMessageNotification=ae={}));var M;(function(v){v.method="telemetry/event",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolNotificationType(v.method)})(M||(t.TelemetryEventNotification=M={}));var U;(function(v){v.None=0,v.Full=1,v.Incremental=2})(U||(t.TextDocumentSyncKind=U={}));var oe;(function(v){v.method="textDocument/didOpen",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(oe||(t.DidOpenTextDocumentNotification=oe={}));var G;(function(v){function $(F){let S=F;return S!=null&&typeof S.text=="string"&&S.range!==void 0&&(S.rangeLength===void 0||typeof S.rangeLength=="number")}v.isIncremental=$;function b(F){let S=F;return S!=null&&typeof S.text=="string"&&S.range===void 0&&S.rangeLength===void 0}v.isFull=b})(G||(t.TextDocumentContentChangeEvent=G={}));var Le;(function(v){v.method="textDocument/didChange",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(Le||(t.DidChangeTextDocumentNotification=Le={}));var yt;(function(v){v.method="textDocument/didClose",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(yt||(t.DidCloseTextDocumentNotification=yt={}));var gn;(function(v){v.method="textDocument/didSave",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(gn||(t.DidSaveTextDocumentNotification=gn={}));var tr;(function(v){v.Manual=1,v.AfterDelay=2,v.FocusOut=3})(tr||(t.TextDocumentSaveReason=tr={}));var nr;(function(v){v.method="textDocument/willSave",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(nr||(t.WillSaveTextDocumentNotification=nr={}));var rr;(function(v){v.method="textDocument/willSaveWaitUntil",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(rr||(t.WillSaveTextDocumentWaitUntilRequest=rr={}));var Bt;(function(v){v.method="workspace/didChangeWatchedFiles",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolNotificationType(v.method)})(Bt||(t.DidChangeWatchedFilesNotification=Bt={}));var _n;(function(v){v.Created=1,v.Changed=2,v.Deleted=3})(_n||(t.FileChangeType=_n={}));var Xr;(function(v){function $(b){const F=b;return r.objectLiteral(F)&&(n.URI.is(F.baseUri)||n.WorkspaceFolder.is(F.baseUri))&&r.string(F.pattern)}v.is=$})(Xr||(t.RelativePattern=Xr={}));var zn;(function(v){v.Create=1,v.Change=2,v.Delete=4})(zn||(t.WatchKind=zn={}));var mn;(function(v){v.method="textDocument/publishDiagnostics",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolNotificationType(v.method)})(mn||(t.PublishDiagnosticsNotification=mn={}));var Bn;(function(v){v.Invoked=1,v.TriggerCharacter=2,v.TriggerForIncompleteCompletions=3})(Bn||(t.CompletionTriggerKind=Bn={}));var tn;(function(v){v.method="textDocument/completion",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(tn||(t.CompletionRequest=tn={}));var X;(function(v){v.method="completionItem/resolve",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(X||(t.CompletionResolveRequest=X={}));var J;(function(v){v.method="textDocument/hover",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(J||(t.HoverRequest=J={}));var ue;(function(v){v.Invoked=1,v.TriggerCharacter=2,v.ContentChange=3})(ue||(t.SignatureHelpTriggerKind=ue={}));var qt;(function(v){v.method="textDocument/signatureHelp",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(qt||(t.SignatureHelpRequest=qt={}));var Lt;(function(v){v.method="textDocument/definition",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(Lt||(t.DefinitionRequest=Lt={}));var Sr;(function(v){v.method="textDocument/references",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(Sr||(t.ReferencesRequest=Sr={}));var _i;(function(v){v.method="textDocument/documentHighlight",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(_i||(t.DocumentHighlightRequest=_i={}));var fs;(function(v){v.method="textDocument/documentSymbol",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(fs||(t.DocumentSymbolRequest=fs={}));var hs;(function(v){v.method="textDocument/codeAction",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(hs||(t.CodeActionRequest=hs={}));var ps;(function(v){v.method="codeAction/resolve",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(ps||(t.CodeActionResolveRequest=ps={}));var gs;(function(v){v.method="workspace/symbol",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(gs||(t.WorkspaceSymbolRequest=gs={}));var Ai;(function(v){v.method="workspaceSymbol/resolve",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(Ai||(t.WorkspaceSymbolResolveRequest=Ai={}));var xi;(function(v){v.method="textDocument/codeLens",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(xi||(t.CodeLensRequest=xi={}));var yn;(function(v){v.method="codeLens/resolve",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(yn||(t.CodeLensResolveRequest=yn={}));var ms;(function(v){v.method="workspace/codeLens/refresh",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolRequestType0(v.method)})(ms||(t.CodeLensRefreshRequest=ms={}));var ys;(function(v){v.method="textDocument/documentLink",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(ys||(t.DocumentLinkRequest=ys={}));var kr;(function(v){v.method="documentLink/resolve",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(kr||(t.DocumentLinkResolveRequest=kr={}));var vs;(function(v){v.method="textDocument/formatting",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(vs||(t.DocumentFormattingRequest=vs={}));var Jr;(function(v){v.method="textDocument/rangeFormatting",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(Jr||(t.DocumentRangeFormattingRequest=Jr={}));var ws;(function(v){v.method="textDocument/rangesFormatting",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(ws||(t.DocumentRangesFormattingRequest=ws={}));var qn;(function(v){v.method="textDocument/onTypeFormatting",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(qn||(t.DocumentOnTypeFormattingRequest=qn={}));var ir;(function(v){v.Identifier=1})(ir||(t.PrepareSupportDefaultBehavior=ir={}));var Eo;(function(v){v.method="textDocument/rename",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(Eo||(t.RenameRequest=Eo={}));var z;(function(v){v.method="textDocument/prepareRename",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(z||(t.PrepareRenameRequest=z={}));var T;(function(v){v.method="workspace/executeCommand",v.messageDirection=e.MessageDirection.clientToServer,v.type=new e.ProtocolRequestType(v.method)})(T||(t.ExecuteCommandRequest=T={}));var N;(function(v){v.method="workspace/applyEdit",v.messageDirection=e.MessageDirection.serverToClient,v.type=new e.ProtocolRequestType("workspace/applyEdit")})(N||(t.ApplyWorkspaceEditRequest=N={}))}(lv)),lv}var pu={},S$;function d7(){if(S$)return pu;S$=1,Object.defineProperty(pu,"__esModule",{value:!0}),pu.createProtocolConnection=void 0;const t=Ks();function e(n,r,i,s){return t.ConnectionStrategy.is(s)&&(s={connectionStrategy:s}),(0,t.createMessageConnection)(n,r,i,s)}return pu.createProtocolConnection=e,pu}var k$;function f7(){return k$||(k$=1,function(t){var e=Ys&&Ys.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=Ys&&Ys.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.LSPErrorCodes=t.createProtocolConnection=void 0,n(Ks(),t),n(uv(),t),n(pt(),t),n(l7(),t);var r=d7();Object.defineProperty(t,"createProtocolConnection",{enumerable:!0,get:function(){return r.createProtocolConnection}});var i;(function(s){s.lspReservedErrorRangeStart=-32899,s.RequestFailed=-32803,s.ServerCancelled=-32802,s.ContentModified=-32801,s.RequestCancelled=-32800,s.lspReservedErrorRangeEnd=-32800})(i||(t.LSPErrorCodes=i={}))}(Ys)),Ys}var $$;function St(){return $$||($$=1,function(t){var e=Ws&&Ws.__createBinding||(Object.create?function(s,o,a,c){c===void 0&&(c=a);var u=Object.getOwnPropertyDescriptor(o,a);(!u||("get"in u?!o.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return o[a]}}),Object.defineProperty(s,c,u)}:function(s,o,a,c){c===void 0&&(c=a),s[c]=o[a]}),n=Ws&&Ws.__exportStar||function(s,o){for(var a in s)a!=="default"&&!Object.prototype.hasOwnProperty.call(o,a)&&e(o,s,a)};Object.defineProperty(t,"__esModule",{value:!0}),t.createProtocolConnection=void 0;const r=Zk();n(Zk(),t),n(f7(),t);function i(s,o,a,c){return(0,r.createMessageConnection)(s,o,a,c)}t.createProtocolConnection=i}(Ws)),Ws}var Ln={},C$;function _$(){if(C$)return Ln;C$=1,Object.defineProperty(Ln,"__esModule",{value:!0}),Ln.generateUuid=Ln.parse=Ln.isUUID=Ln.v4=Ln.empty=void 0;class t{constructor(c){this._value=c}asHex(){return this._value}equals(c){return this.asHex()===c.asHex()}}class e extends t{static _oneOf(c){return c[Math.floor(c.length*Math.random())]}static _randomHex(){return e._oneOf(e._chars)}constructor(){super([e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),"-","4",e._randomHex(),e._randomHex(),e._randomHex(),"-",e._oneOf(e._timeHighBits),e._randomHex(),e._randomHex(),e._randomHex(),"-",e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex(),e._randomHex()].join(""))}}e._chars=["0","1","2","3","4","5","6","6","7","8","9","a","b","c","d","e","f"],e._timeHighBits=["8","9","a","b"],Ln.empty=new t("00000000-0000-0000-0000-000000000000");function n(){return new e}Ln.v4=n;const r=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;function i(a){return r.test(a)}Ln.isUUID=i;function s(a){if(!i(a))throw new Error("invalid uuid");return new t(a)}Ln.parse=s;function o(){return n().asHex()}return Ln.generateUuid=o,Ln}var $i={},A$;function h7(){if(A$)return $i;A$=1,Object.defineProperty($i,"__esModule",{value:!0}),$i.attachPartialResult=$i.ProgressFeature=$i.attachWorkDone=void 0;const t=St(),e=_$();class n{constructor(f,h){this._connection=f,this._token=h,n.Instances.set(this._token,this)}begin(f,h,p,g){let y={kind:"begin",title:f,percentage:h,message:p,cancellable:g};this._connection.sendProgress(t.WorkDoneProgress.type,this._token,y)}report(f,h){let p={kind:"report"};typeof f=="number"?(p.percentage=f,h!==void 0&&(p.message=h)):p.message=f,this._connection.sendProgress(t.WorkDoneProgress.type,this._token,p)}done(){n.Instances.delete(this._token),this._connection.sendProgress(t.WorkDoneProgress.type,this._token,{kind:"end"})}}n.Instances=new Map;class r extends n{constructor(f,h){super(f,h),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose(),super.done()}cancel(){this._source.cancel()}}class i{constructor(){}begin(){}report(){}done(){}}class s extends i{constructor(){super(),this._source=new t.CancellationTokenSource}get token(){return this._source.token}done(){this._source.dispose()}cancel(){this._source.cancel()}}function o(d,f){if(f===void 0||f.workDoneToken===void 0)return new i;const h=f.workDoneToken;return delete f.workDoneToken,new n(d,h)}$i.attachWorkDone=o;const a=d=>class extends d{constructor(){super(),this._progressSupported=!1}initialize(f){super.initialize(f),f?.window?.workDoneProgress===!0&&(this._progressSupported=!0,this.connection.onNotification(t.WorkDoneProgressCancelNotification.type,h=>{let p=n.Instances.get(h.token);(p instanceof r||p instanceof s)&&p.cancel()}))}attachWorkDoneProgress(f){return f===void 0?new i:new n(this.connection,f)}createWorkDoneProgress(){if(this._progressSupported){const f=(0,e.generateUuid)();return this.connection.sendRequest(t.WorkDoneProgressCreateRequest.type,{token:f}).then(()=>new r(this.connection,f))}else return Promise.resolve(new s)}};$i.ProgressFeature=a;var c;(function(d){d.type=new t.ProgressType})(c||(c={}));class u{constructor(f,h){this._connection=f,this._token=h}report(f){this._connection.sendProgress(c.type,this._token,f)}}function l(d,f){if(f===void 0||f.partialResultToken===void 0)return;const h=f.partialResultToken;return delete f.partialResultToken,new u(d,h)}return $i.attachPartialResult=l,$i}var gu={},x$;function p7(){if(x$)return gu;x$=1,Object.defineProperty(gu,"__esModule",{value:!0}),gu.ConfigurationFeature=void 0;const t=St(),e=iv(),n=r=>class extends r{getConfiguration(i){return i?e.string(i)?this._getConfiguration({section:i}):this._getConfiguration(i):this._getConfiguration({})}_getConfiguration(i){let s={items:Array.isArray(i)?i:[i]};return this.connection.sendRequest(t.ConfigurationRequest.type,s).then(o=>Array.isArray(o)?Array.isArray(i)?o:o[0]:Array.isArray(i)?[]:null)}};return gu.ConfigurationFeature=n,gu}var mu={},I$;function g7(){if(I$)return mu;I$=1,Object.defineProperty(mu,"__esModule",{value:!0}),mu.WorkspaceFoldersFeature=void 0;const t=St(),e=n=>class extends n{constructor(){super(),this._notificationIsAutoRegistered=!1}initialize(r){super.initialize(r);let i=r.workspace;i&&i.workspaceFolders&&(this._onDidChangeWorkspaceFolders=new t.Emitter,this.connection.onNotification(t.DidChangeWorkspaceFoldersNotification.type,s=>{this._onDidChangeWorkspaceFolders.fire(s.event)}))}fillServerCapabilities(r){super.fillServerCapabilities(r);const i=r.workspace?.workspaceFolders?.changeNotifications;this._notificationIsAutoRegistered=i===!0||typeof i=="string"}getWorkspaceFolders(){return this.connection.sendRequest(t.WorkspaceFoldersRequest.type)}get onDidChangeWorkspaceFolders(){if(!this._onDidChangeWorkspaceFolders)throw new Error("Client doesn't support sending workspace folder change events.");return!this._notificationIsAutoRegistered&&!this._unregistration&&(this._unregistration=this.connection.client.register(t.DidChangeWorkspaceFoldersNotification.type)),this._onDidChangeWorkspaceFolders.event}};return mu.WorkspaceFoldersFeature=e,mu}var yu={},P$;function m7(){if(P$)return yu;P$=1,Object.defineProperty(yu,"__esModule",{value:!0}),yu.CallHierarchyFeature=void 0;const t=St(),e=n=>class extends n{get callHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.CallHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onIncomingCalls:r=>{const i=t.CallHierarchyIncomingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onOutgoingCalls:r=>{const i=t.CallHierarchyOutgoingCallsRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return yu.CallHierarchyFeature=e,yu}var Ci={},N$;function O$(){if(N$)return Ci;N$=1,Object.defineProperty(Ci,"__esModule",{value:!0}),Ci.SemanticTokensBuilder=Ci.SemanticTokensDiff=Ci.SemanticTokensFeature=void 0;const t=St(),e=i=>class extends i{get semanticTokens(){return{refresh:()=>this.connection.sendRequest(t.SemanticTokensRefreshRequest.type),on:s=>{const o=t.SemanticTokensRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onDelta:s=>{const o=t.SemanticTokensDeltaRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))},onRange:s=>{const o=t.SemanticTokensRangeRequest.type;return this.connection.onRequest(o,(a,c)=>s(a,c,this.attachWorkDoneProgress(a),this.attachPartialResultProgress(o,a)))}}}};Ci.SemanticTokensFeature=e;class n{constructor(s,o){this.originalSequence=s,this.modifiedSequence=o}computeDiff(){const s=this.originalSequence.length,o=this.modifiedSequence.length;let a=0;for(;a<o&&a<s&&this.originalSequence[a]===this.modifiedSequence[a];)a++;if(a<o&&a<s){let c=s-1,u=o-1;for(;c>=a&&u>=a&&this.originalSequence[c]===this.modifiedSequence[u];)c--,u--;(c<a||u<a)&&(c++,u++);const l=c-a+1,d=this.modifiedSequence.slice(a,u+1);return d.length===1&&d[0]===this.originalSequence[c]?[{start:a,deleteCount:l-1}]:[{start:a,deleteCount:l,data:d}]}else return a<o?[{start:a,deleteCount:0,data:this.modifiedSequence.slice(a)}]:a<s?[{start:a,deleteCount:s-a}]:[]}}Ci.SemanticTokensDiff=n;class r{constructor(){this._prevData=void 0,this.initialize()}initialize(){this._id=Date.now(),this._prevLine=0,this._prevChar=0,this._data=[],this._dataLen=0}push(s,o,a,c,u){let l=s,d=o;this._dataLen>0&&(l-=this._prevLine,l===0&&(d-=this._prevChar)),this._data[this._dataLen++]=l,this._data[this._dataLen++]=d,this._data[this._dataLen++]=a,this._data[this._dataLen++]=c,this._data[this._dataLen++]=u,this._prevLine=s,this._prevChar=o}get id(){return this._id.toString()}previousResult(s){this.id===s&&(this._prevData=this._data),this.initialize()}build(){return this._prevData=void 0,{resultId:this.id,data:this._data}}canBuildEdits(){return this._prevData!==void 0}buildEdits(){return this._prevData!==void 0?{resultId:this.id,edits:new n(this._prevData,this._data).computeDiff()}:this.build()}}return Ci.SemanticTokensBuilder=r,Ci}var vu={},F$;function y7(){if(F$)return vu;F$=1,Object.defineProperty(vu,"__esModule",{value:!0}),vu.ShowDocumentFeature=void 0;const t=St(),e=n=>class extends n{showDocument(r){return this.connection.sendRequest(t.ShowDocumentRequest.type,r)}};return vu.ShowDocumentFeature=e,vu}var wu={},L$;function v7(){if(L$)return wu;L$=1,Object.defineProperty(wu,"__esModule",{value:!0}),wu.FileOperationsFeature=void 0;const t=St(),e=n=>class extends n{onDidCreateFiles(r){return this.connection.onNotification(t.DidCreateFilesNotification.type,i=>{r(i)})}onDidRenameFiles(r){return this.connection.onNotification(t.DidRenameFilesNotification.type,i=>{r(i)})}onDidDeleteFiles(r){return this.connection.onNotification(t.DidDeleteFilesNotification.type,i=>{r(i)})}onWillCreateFiles(r){return this.connection.onRequest(t.WillCreateFilesRequest.type,(i,s)=>r(i,s))}onWillRenameFiles(r){return this.connection.onRequest(t.WillRenameFilesRequest.type,(i,s)=>r(i,s))}onWillDeleteFiles(r){return this.connection.onRequest(t.WillDeleteFilesRequest.type,(i,s)=>r(i,s))}};return wu.FileOperationsFeature=e,wu}var bu={},M$;function w7(){if(M$)return bu;M$=1,Object.defineProperty(bu,"__esModule",{value:!0}),bu.LinkedEditingRangeFeature=void 0;const t=St(),e=n=>class extends n{onLinkedEditingRange(r){return this.connection.onRequest(t.LinkedEditingRangeRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0))}};return bu.LinkedEditingRangeFeature=e,bu}var Eu={},z$;function b7(){if(z$)return Eu;z$=1,Object.defineProperty(Eu,"__esModule",{value:!0}),Eu.TypeHierarchyFeature=void 0;const t=St(),e=n=>class extends n{get typeHierarchy(){return{onPrepare:r=>this.connection.onRequest(t.TypeHierarchyPrepareRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),void 0)),onSupertypes:r=>{const i=t.TypeHierarchySupertypesRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))},onSubtypes:r=>{const i=t.TypeHierarchySubtypesRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Eu.TypeHierarchyFeature=e,Eu}var Du={},B$;function E7(){if(B$)return Du;B$=1,Object.defineProperty(Du,"__esModule",{value:!0}),Du.InlineValueFeature=void 0;const t=St(),e=n=>class extends n{get inlineValue(){return{refresh:()=>this.connection.sendRequest(t.InlineValueRefreshRequest.type),on:r=>this.connection.onRequest(t.InlineValueRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return Du.InlineValueFeature=e,Du}var Tu={},q$;function D7(){if(q$)return Tu;q$=1,Object.defineProperty(Tu,"__esModule",{value:!0}),Tu.FoldingRangeFeature=void 0;const t=St(),e=n=>class extends n{get foldingRange(){return{refresh:()=>this.connection.sendRequest(t.FoldingRangeRefreshRequest.type),on:r=>{const i=t.FoldingRangeRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return Tu.FoldingRangeFeature=e,Tu}var Ru={},j$;function T7(){if(j$)return Ru;j$=1,Object.defineProperty(Ru,"__esModule",{value:!0}),Ru.InlayHintFeature=void 0;const t=St(),e=n=>class extends n{get inlayHint(){return{refresh:()=>this.connection.sendRequest(t.InlayHintRefreshRequest.type),on:r=>this.connection.onRequest(t.InlayHintRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i))),resolve:r=>this.connection.onRequest(t.InlayHintResolveRequest.type,(i,s)=>r(i,s))}}};return Ru.InlayHintFeature=e,Ru}var Su={},U$;function R7(){if(U$)return Su;U$=1,Object.defineProperty(Su,"__esModule",{value:!0}),Su.DiagnosticFeature=void 0;const t=St(),e=n=>class extends n{get diagnostics(){return{refresh:()=>this.connection.sendRequest(t.DiagnosticRefreshRequest.type),on:r=>this.connection.onRequest(t.DocumentDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.DocumentDiagnosticRequest.partialResult,i))),onWorkspace:r=>this.connection.onRequest(t.WorkspaceDiagnosticRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i),this.attachPartialResultProgress(t.WorkspaceDiagnosticRequest.partialResult,i)))}}};return Su.DiagnosticFeature=e,Su}var eo={},ku={},G$;function W$(){if(G$)return ku;G$=1,Object.defineProperty(ku,"__esModule",{value:!0}),ku.TextDocuments=void 0;const t=St();class e{constructor(r){this._configuration=r,this._syncedDocuments=new Map,this._onDidChangeContent=new t.Emitter,this._onDidOpen=new t.Emitter,this._onDidClose=new t.Emitter,this._onDidSave=new t.Emitter,this._onWillSave=new t.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(r){this._willSaveWaitUntil=r}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(r){return this._syncedDocuments.get(r)}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(r){r.__textDocumentSync=t.TextDocumentSyncKind.Incremental;const i=[];return i.push(r.onDidOpenTextDocument(s=>{const o=s.textDocument,a=this._configuration.create(o.uri,o.languageId,o.version,o.text);this._syncedDocuments.set(o.uri,a);const c=Object.freeze({document:a});this._onDidOpen.fire(c),this._onDidChangeContent.fire(c)})),i.push(r.onDidChangeTextDocument(s=>{const o=s.textDocument,a=s.contentChanges;if(a.length===0)return;const{version:c}=o;if(c==null)throw new Error(`Received document change event for ${o.uri} without valid version identifier`);let u=this._syncedDocuments.get(o.uri);u!==void 0&&(u=this._configuration.update(u,a,c),this._syncedDocuments.set(o.uri,u),this._onDidChangeContent.fire(Object.freeze({document:u})))})),i.push(r.onDidCloseTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&(this._syncedDocuments.delete(s.textDocument.uri),this._onDidClose.fire(Object.freeze({document:o})))})),i.push(r.onWillSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onWillSave.fire(Object.freeze({document:o,reason:s.reason}))})),i.push(r.onWillSaveTextDocumentWaitUntil((s,o)=>{let a=this._syncedDocuments.get(s.textDocument.uri);return a!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:a,reason:s.reason}),o):[]})),i.push(r.onDidSaveTextDocument(s=>{let o=this._syncedDocuments.get(s.textDocument.uri);o!==void 0&&this._onDidSave.fire(Object.freeze({document:o}))})),t.Disposable.create(()=>{i.forEach(s=>s.dispose())})}}return ku.TextDocuments=e,ku}var H$;function V$(){if(H$)return eo;H$=1,Object.defineProperty(eo,"__esModule",{value:!0}),eo.NotebookDocuments=eo.NotebookSyncFeature=void 0;const t=St(),e=W$(),n=s=>class extends s{get synchronization(){return{onDidOpenNotebookDocument:o=>this.connection.onNotification(t.DidOpenNotebookDocumentNotification.type,a=>{o(a)}),onDidChangeNotebookDocument:o=>this.connection.onNotification(t.DidChangeNotebookDocumentNotification.type,a=>{o(a)}),onDidSaveNotebookDocument:o=>this.connection.onNotification(t.DidSaveNotebookDocumentNotification.type,a=>{o(a)}),onDidCloseNotebookDocument:o=>this.connection.onNotification(t.DidCloseNotebookDocumentNotification.type,a=>{o(a)})}}};eo.NotebookSyncFeature=n;class r{onDidOpenTextDocument(o){return this.openHandler=o,t.Disposable.create(()=>{this.openHandler=void 0})}openTextDocument(o){this.openHandler&&this.openHandler(o)}onDidChangeTextDocument(o){return this.changeHandler=o,t.Disposable.create(()=>{this.changeHandler=o})}changeTextDocument(o){this.changeHandler&&this.changeHandler(o)}onDidCloseTextDocument(o){return this.closeHandler=o,t.Disposable.create(()=>{this.closeHandler=void 0})}closeTextDocument(o){this.closeHandler&&this.closeHandler(o)}onWillSaveTextDocument(){return r.NULL_DISPOSE}onWillSaveTextDocumentWaitUntil(){return r.NULL_DISPOSE}onDidSaveTextDocument(){return r.NULL_DISPOSE}}r.NULL_DISPOSE=Object.freeze({dispose:()=>{}});class i{constructor(o){o instanceof e.TextDocuments?this._cellTextDocuments=o:this._cellTextDocuments=new e.TextDocuments(o),this.notebookDocuments=new Map,this.notebookCellMap=new Map,this._onDidOpen=new t.Emitter,this._onDidChange=new t.Emitter,this._onDidSave=new t.Emitter,this._onDidClose=new t.Emitter}get cellTextDocuments(){return this._cellTextDocuments}getCellTextDocument(o){return this._cellTextDocuments.get(o.document)}getNotebookDocument(o){return this.notebookDocuments.get(o)}getNotebookCell(o){const a=this.notebookCellMap.get(o);return a&&a[0]}findNotebookDocumentForCell(o){const a=typeof o=="string"?o:o.document,c=this.notebookCellMap.get(a);return c&&c[1]}get onDidOpen(){return this._onDidOpen.event}get onDidSave(){return this._onDidSave.event}get onDidChange(){return this._onDidChange.event}get onDidClose(){return this._onDidClose.event}listen(o){const a=new r,c=[];return c.push(this.cellTextDocuments.listen(a)),c.push(o.notebooks.synchronization.onDidOpenNotebookDocument(u=>{this.notebookDocuments.set(u.notebookDocument.uri,u.notebookDocument);for(const l of u.cellTextDocuments)a.openTextDocument({textDocument:l});this.updateCellMap(u.notebookDocument),this._onDidOpen.fire(u.notebookDocument)})),c.push(o.notebooks.synchronization.onDidChangeNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l===void 0)return;l.version=u.notebookDocument.version;const d=l.metadata;let f=!1;const h=u.change;h.metadata!==void 0&&(f=!0,l.metadata=h.metadata);const p=[],g=[],y=[],m=[];if(h.cells!==void 0){const I=h.cells;if(I.structure!==void 0){const x=I.structure.array;if(l.cells.splice(x.start,x.deleteCount,...x.cells!==void 0?x.cells:[]),I.structure.didOpen!==void 0)for(const _ of I.structure.didOpen)a.openTextDocument({textDocument:_}),p.push(_.uri);if(I.structure.didClose)for(const _ of I.structure.didClose)a.closeTextDocument({textDocument:_}),g.push(_.uri)}if(I.data!==void 0){const x=new Map(I.data.map(_=>[_.document,_]));for(let _=0;_<=l.cells.length;_++){const P=x.get(l.cells[_].document);if(P!==void 0){const O=l.cells.splice(_,1,P);if(y.push({old:O[0],new:P}),x.delete(P.document),x.size===0)break}}}if(I.textContent!==void 0)for(const x of I.textContent)a.changeTextDocument({textDocument:x.document,contentChanges:x.changes}),m.push(x.document.uri)}this.updateCellMap(l);const w={notebookDocument:l};f&&(w.metadata={old:d,new:l.metadata});const E=[];for(const I of p)E.push(this.getNotebookCell(I));const k=[];for(const I of g)k.push(this.getNotebookCell(I));const A=[];for(const I of m)A.push(this.getNotebookCell(I));(E.length>0||k.length>0||y.length>0||A.length>0)&&(w.cells={added:E,removed:k,changed:{data:y,textContent:A}}),(w.metadata!==void 0||w.cells!==void 0)&&this._onDidChange.fire(w)})),c.push(o.notebooks.synchronization.onDidSaveNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);l!==void 0&&this._onDidSave.fire(l)})),c.push(o.notebooks.synchronization.onDidCloseNotebookDocument(u=>{const l=this.notebookDocuments.get(u.notebookDocument.uri);if(l!==void 0){this._onDidClose.fire(l);for(const d of u.cellTextDocuments)a.closeTextDocument({textDocument:d});this.notebookDocuments.delete(u.notebookDocument.uri);for(const d of l.cells)this.notebookCellMap.delete(d.document)}})),t.Disposable.create(()=>{c.forEach(u=>u.dispose())})}updateCellMap(o){for(const a of o.cells)this.notebookCellMap.set(a.document,[a,o])}}return eo.NotebookDocuments=i,eo}var $u={},K$;function S7(){if(K$)return $u;K$=1,Object.defineProperty($u,"__esModule",{value:!0}),$u.MonikerFeature=void 0;const t=St(),e=n=>class extends n{get moniker(){return{on:r=>{const i=t.MonikerRequest.type;return this.connection.onRequest(i,(s,o)=>r(s,o,this.attachWorkDoneProgress(s),this.attachPartialResultProgress(i,s)))}}}};return $u.MonikerFeature=e,$u}var Y$;function X$(){if(Y$)return qe;Y$=1,Object.defineProperty(qe,"__esModule",{value:!0}),qe.createConnection=qe.combineFeatures=qe.combineNotebooksFeatures=qe.combineLanguagesFeatures=qe.combineWorkspaceFeatures=qe.combineWindowFeatures=qe.combineClientFeatures=qe.combineTracerFeatures=qe.combineTelemetryFeatures=qe.combineConsoleFeatures=qe._NotebooksImpl=qe._LanguagesImpl=qe.BulkUnregistration=qe.BulkRegistration=qe.ErrorMessageTracker=void 0;const t=St(),e=iv(),n=_$(),r=h7(),i=p7(),s=g7(),o=m7(),a=O$(),c=y7(),u=v7(),l=w7(),d=b7(),f=E7(),h=D7(),p=T7(),g=R7(),y=V$(),m=S7();function w(ae){if(ae!==null)return ae}class E{constructor(){this._messages=Object.create(null)}add(M){let U=this._messages[M];U||(U=0),U++,this._messages[M]=U}sendErrors(M){Object.keys(this._messages).forEach(U=>{M.window.showErrorMessage(U)})}}qe.ErrorMessageTracker=E;class k{constructor(){}rawAttach(M){this._rawConnection=M}attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}fillServerCapabilities(M){}initialize(M){}error(M){this.send(t.MessageType.Error,M)}warn(M){this.send(t.MessageType.Warning,M)}info(M){this.send(t.MessageType.Info,M)}log(M){this.send(t.MessageType.Log,M)}debug(M){this.send(t.MessageType.Debug,M)}send(M,U){this._rawConnection&&this._rawConnection.sendNotification(t.LogMessageNotification.type,{type:M,message:U}).catch(()=>{(0,t.RAL)().console.error("Sending log message failed")})}}class A{constructor(){}attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(M){}fillServerCapabilities(M){}showErrorMessage(M,...U){let oe={type:t.MessageType.Error,message:M,actions:U};return this.connection.sendRequest(t.ShowMessageRequest.type,oe).then(w)}showWarningMessage(M,...U){let oe={type:t.MessageType.Warning,message:M,actions:U};return this.connection.sendRequest(t.ShowMessageRequest.type,oe).then(w)}showInformationMessage(M,...U){let oe={type:t.MessageType.Info,message:M,actions:U};return this.connection.sendRequest(t.ShowMessageRequest.type,oe).then(w)}}const I=(0,c.ShowDocumentFeature)((0,r.ProgressFeature)(A));var x;(function(ae){function M(){return new _}ae.create=M})(x||(qe.BulkRegistration=x={}));class _{constructor(){this._registrations=[],this._registered=new Set}add(M,U){const oe=e.string(M)?M:M.method;if(this._registered.has(oe))throw new Error(`${oe} is already added to this registration`);const G=n.generateUuid();this._registrations.push({id:G,method:oe,registerOptions:U||{}}),this._registered.add(oe)}asRegistrationParams(){return{registrations:this._registrations}}}var P;(function(ae){function M(){return new O(void 0,[])}ae.create=M})(P||(qe.BulkUnregistration=P={}));class O{constructor(M,U){this._connection=M,this._unregistrations=new Map,U.forEach(oe=>{this._unregistrations.set(oe.method,oe)})}get isAttached(){return!!this._connection}attach(M){this._connection=M}add(M){this._unregistrations.set(M.method,M)}dispose(){let M=[];for(let oe of this._unregistrations.values())M.push(oe);let U={unregisterations:M};this._connection.sendRequest(t.UnregistrationRequest.type,U).catch(()=>{this._connection.console.info("Bulk unregistration failed.")})}disposeSingle(M){const U=e.string(M)?M:M.method,oe=this._unregistrations.get(U);if(!oe)return!1;let G={unregisterations:[oe]};return this._connection.sendRequest(t.UnregistrationRequest.type,G).then(()=>{this._unregistrations.delete(U)},Le=>{this._connection.console.info(`Un-registering request handler for ${oe.id} failed.`)}),!0}}class C{attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(M){}fillServerCapabilities(M){}register(M,U,oe){return M instanceof _?this.registerMany(M):M instanceof O?this.registerSingle1(M,U,oe):this.registerSingle2(M,U)}registerSingle1(M,U,oe){const G=e.string(U)?U:U.method,Le=n.generateUuid();let yt={registrations:[{id:Le,method:G,registerOptions:oe||{}}]};return M.isAttached||M.attach(this.connection),this.connection.sendRequest(t.RegistrationRequest.type,yt).then(gn=>(M.add({id:Le,method:G}),M),gn=>(this.connection.console.info(`Registering request handler for ${G} failed.`),Promise.reject(gn)))}registerSingle2(M,U){const oe=e.string(M)?M:M.method,G=n.generateUuid();let Le={registrations:[{id:G,method:oe,registerOptions:U||{}}]};return this.connection.sendRequest(t.RegistrationRequest.type,Le).then(yt=>t.Disposable.create(()=>{this.unregisterSingle(G,oe).catch(()=>{this.connection.console.info(`Un-registering capability with id ${G} failed.`)})}),yt=>(this.connection.console.info(`Registering request handler for ${oe} failed.`),Promise.reject(yt)))}unregisterSingle(M,U){let oe={unregisterations:[{id:M,method:U}]};return this.connection.sendRequest(t.UnregistrationRequest.type,oe).catch(()=>{this.connection.console.info(`Un-registering request handler for ${M} failed.`)})}registerMany(M){let U=M.asRegistrationParams();return this.connection.sendRequest(t.RegistrationRequest.type,U).then(()=>new O(this._connection,U.registrations.map(oe=>({id:oe.id,method:oe.method}))),oe=>(this.connection.console.info("Bulk registration failed."),Promise.reject(oe)))}}class D{constructor(){}attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(M){}fillServerCapabilities(M){}applyEdit(M){function U(G){return G&&!!G.edit}let oe=U(M)?M:{edit:M};return this.connection.sendRequest(t.ApplyWorkspaceEditRequest.type,oe)}}const R=(0,u.FileOperationsFeature)((0,s.WorkspaceFoldersFeature)((0,i.ConfigurationFeature)(D)));class L{constructor(){this._trace=t.Trace.Off}attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(M){}fillServerCapabilities(M){}set trace(M){this._trace=M}log(M,U){this._trace!==t.Trace.Off&&this.connection.sendNotification(t.LogTraceNotification.type,{message:M,verbose:this._trace===t.Trace.Verbose?U:void 0}).catch(()=>{})}}class W{constructor(){}attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(M){}fillServerCapabilities(M){}logEvent(M){this.connection.sendNotification(t.TelemetryEventNotification.type,M).catch(()=>{this.connection.console.log("Sending TelemetryEventNotification failed")})}}class V{constructor(){}attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(M){}fillServerCapabilities(M){}attachWorkDoneProgress(M){return(0,r.attachWorkDone)(this.connection,M)}attachPartialResultProgress(M,U){return(0,r.attachPartialResult)(this.connection,U)}}qe._LanguagesImpl=V;const Z=(0,h.FoldingRangeFeature)((0,m.MonikerFeature)((0,g.DiagnosticFeature)((0,p.InlayHintFeature)((0,f.InlineValueFeature)((0,d.TypeHierarchyFeature)((0,l.LinkedEditingRangeFeature)((0,a.SemanticTokensFeature)((0,o.CallHierarchyFeature)(V)))))))));class Fe{constructor(){}attach(M){this._connection=M}get connection(){if(!this._connection)throw new Error("Remote is not attached to a connection yet.");return this._connection}initialize(M){}fillServerCapabilities(M){}attachWorkDoneProgress(M){return(0,r.attachWorkDone)(this.connection,M)}attachPartialResultProgress(M,U){return(0,r.attachPartialResult)(this.connection,U)}}qe._NotebooksImpl=Fe;const se=(0,y.NotebookSyncFeature)(Fe);function K(ae,M){return function(U){return M(ae(U))}}qe.combineConsoleFeatures=K;function Te(ae,M){return function(U){return M(ae(U))}}qe.combineTelemetryFeatures=Te;function at(ae,M){return function(U){return M(ae(U))}}qe.combineTracerFeatures=at;function H(ae,M){return function(U){return M(ae(U))}}qe.combineClientFeatures=H;function Y(ae,M){return function(U){return M(ae(U))}}qe.combineWindowFeatures=Y;function Q(ae,M){return function(U){return M(ae(U))}}qe.combineWorkspaceFeatures=Q;function ne(ae,M){return function(U){return M(ae(U))}}qe.combineLanguagesFeatures=ne;function fe(ae,M){return function(U){return M(ae(U))}}qe.combineNotebooksFeatures=fe;function Ee(ae,M){function U(G,Le,yt){return G&&Le?yt(G,Le):G||Le}return{__brand:"features",console:U(ae.console,M.console,K),tracer:U(ae.tracer,M.tracer,at),telemetry:U(ae.telemetry,M.telemetry,Te),client:U(ae.client,M.client,H),window:U(ae.window,M.window,Y),workspace:U(ae.workspace,M.workspace,Q),languages:U(ae.languages,M.languages,ne),notebooks:U(ae.notebooks,M.notebooks,fe)}}qe.combineFeatures=Ee;function me(ae,M,U){const oe=U&&U.console?new(U.console(k)):new k,G=ae(oe);oe.rawAttach(G);const Le=U&&U.tracer?new(U.tracer(L)):new L,yt=U&&U.telemetry?new(U.telemetry(W)):new W,gn=U&&U.client?new(U.client(C)):new C,tr=U&&U.window?new(U.window(I)):new I,nr=U&&U.workspace?new(U.workspace(R)):new R,rr=U&&U.languages?new(U.languages(Z)):new Z,Bt=U&&U.notebooks?new(U.notebooks(se)):new se,_n=[oe,Le,yt,gn,tr,nr,rr,Bt];function Xr(X){return X instanceof Promise?X:e.thenable(X)?new Promise((J,ue)=>{X.then(qt=>J(qt),qt=>ue(qt))}):Promise.resolve(X)}let zn,mn,Bn,tn={listen:()=>G.listen(),sendRequest:(X,...J)=>G.sendRequest(e.string(X)?X:X.method,...J),onRequest:(X,J)=>G.onRequest(X,J),sendNotification:(X,J)=>{const ue=e.string(X)?X:X.method;return G.sendNotification(ue,J)},onNotification:(X,J)=>G.onNotification(X,J),onProgress:G.onProgress,sendProgress:G.sendProgress,onInitialize:X=>(mn=X,{dispose:()=>{mn=void 0}}),onInitialized:X=>G.onNotification(t.InitializedNotification.type,X),onShutdown:X=>(zn=X,{dispose:()=>{zn=void 0}}),onExit:X=>(Bn=X,{dispose:()=>{Bn=void 0}}),get console(){return oe},get telemetry(){return yt},get tracer(){return Le},get client(){return gn},get window(){return tr},get workspace(){return nr},get languages(){return rr},get notebooks(){return Bt},onDidChangeConfiguration:X=>G.onNotification(t.DidChangeConfigurationNotification.type,X),onDidChangeWatchedFiles:X=>G.onNotification(t.DidChangeWatchedFilesNotification.type,X),__textDocumentSync:void 0,onDidOpenTextDocument:X=>G.onNotification(t.DidOpenTextDocumentNotification.type,X),onDidChangeTextDocument:X=>G.onNotification(t.DidChangeTextDocumentNotification.type,X),onDidCloseTextDocument:X=>G.onNotification(t.DidCloseTextDocumentNotification.type,X),onWillSaveTextDocument:X=>G.onNotification(t.WillSaveTextDocumentNotification.type,X),onWillSaveTextDocumentWaitUntil:X=>G.onRequest(t.WillSaveTextDocumentWaitUntilRequest.type,X),onDidSaveTextDocument:X=>G.onNotification(t.DidSaveTextDocumentNotification.type,X),sendDiagnostics:X=>G.sendNotification(t.PublishDiagnosticsNotification.type,X),onHover:X=>G.onRequest(t.HoverRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),void 0)),onCompletion:X=>G.onRequest(t.CompletionRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onCompletionResolve:X=>G.onRequest(t.CompletionResolveRequest.type,X),onSignatureHelp:X=>G.onRequest(t.SignatureHelpRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),void 0)),onDeclaration:X=>G.onRequest(t.DeclarationRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onDefinition:X=>G.onRequest(t.DefinitionRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onTypeDefinition:X=>G.onRequest(t.TypeDefinitionRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onImplementation:X=>G.onRequest(t.ImplementationRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onReferences:X=>G.onRequest(t.ReferencesRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onDocumentHighlight:X=>G.onRequest(t.DocumentHighlightRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onDocumentSymbol:X=>G.onRequest(t.DocumentSymbolRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onWorkspaceSymbol:X=>G.onRequest(t.WorkspaceSymbolRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onWorkspaceSymbolResolve:X=>G.onRequest(t.WorkspaceSymbolResolveRequest.type,X),onCodeAction:X=>G.onRequest(t.CodeActionRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onCodeActionResolve:X=>G.onRequest(t.CodeActionResolveRequest.type,(J,ue)=>X(J,ue)),onCodeLens:X=>G.onRequest(t.CodeLensRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onCodeLensResolve:X=>G.onRequest(t.CodeLensResolveRequest.type,(J,ue)=>X(J,ue)),onDocumentFormatting:X=>G.onRequest(t.DocumentFormattingRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),void 0)),onDocumentRangeFormatting:X=>G.onRequest(t.DocumentRangeFormattingRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),void 0)),onDocumentOnTypeFormatting:X=>G.onRequest(t.DocumentOnTypeFormattingRequest.type,(J,ue)=>X(J,ue)),onRenameRequest:X=>G.onRequest(t.RenameRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),void 0)),onPrepareRename:X=>G.onRequest(t.PrepareRenameRequest.type,(J,ue)=>X(J,ue)),onDocumentLinks:X=>G.onRequest(t.DocumentLinkRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onDocumentLinkResolve:X=>G.onRequest(t.DocumentLinkResolveRequest.type,(J,ue)=>X(J,ue)),onDocumentColor:X=>G.onRequest(t.DocumentColorRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onColorPresentation:X=>G.onRequest(t.ColorPresentationRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onFoldingRanges:X=>G.onRequest(t.FoldingRangeRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onSelectionRanges:X=>G.onRequest(t.SelectionRangeRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),(0,r.attachPartialResult)(G,J))),onExecuteCommand:X=>G.onRequest(t.ExecuteCommandRequest.type,(J,ue)=>X(J,ue,(0,r.attachWorkDone)(G,J),void 0)),dispose:()=>G.dispose()};for(let X of _n)X.attach(tn);return G.onRequest(t.InitializeRequest.type,X=>{M.initialize(X),e.string(X.trace)&&(Le.trace=t.Trace.fromString(X.trace));for(let J of _n)J.initialize(X.capabilities);if(mn){let J=mn(X,new t.CancellationTokenSource().token,(0,r.attachWorkDone)(G,X),void 0);return Xr(J).then(ue=>{if(ue instanceof t.ResponseError)return ue;let qt=ue;qt||(qt={capabilities:{}});let Lt=qt.capabilities;Lt||(Lt={},qt.capabilities=Lt),Lt.textDocumentSync===void 0||Lt.textDocumentSync===null?Lt.textDocumentSync=e.number(tn.__textDocumentSync)?tn.__textDocumentSync:t.TextDocumentSyncKind.None:!e.number(Lt.textDocumentSync)&&!e.number(Lt.textDocumentSync.change)&&(Lt.textDocumentSync.change=e.number(tn.__textDocumentSync)?tn.__textDocumentSync:t.TextDocumentSyncKind.None);for(let Sr of _n)Sr.fillServerCapabilities(Lt);return qt})}else{let J={capabilities:{textDocumentSync:t.TextDocumentSyncKind.None}};for(let ue of _n)ue.fillServerCapabilities(J.capabilities);return J}}),G.onRequest(t.ShutdownRequest.type,()=>{if(M.shutdownReceived=!0,zn)return zn(new t.CancellationTokenSource().token)}),G.onNotification(t.ExitNotification.type,()=>{try{Bn&&Bn()}finally{M.shutdownReceived?M.exit(0):M.exit(1)}}),G.onNotification(t.SetTraceNotification.type,X=>{Le.trace=t.Trace.fromString(X.value)}),tn}return qe.createConnection=me,qe}var fn={};const k7=li(zO),ch=li(CO),J$=li(kO);var Z$;function $7(){if(Z$)return fn;Z$=1,Object.defineProperty(fn,"__esModule",{value:!0}),fn.resolveModulePath=fn.FileSystem=fn.resolveGlobalYarnPath=fn.resolveGlobalNodePath=fn.resolve=fn.uriToFilePath=void 0;const t=k7,e=su,n=ch,r=J$;function i(d){let f=t.parse(d);if(f.protocol!=="file:"||!f.path)return;let h=f.path.split("/");for(var p=0,g=h.length;p<g;p++)h[p]=decodeURIComponent(h[p]);if(process.platform==="win32"&&h.length>1){let y=h[0],m=h[1];y.length===0&&m.length>1&&m[1]===":"&&h.shift()}return e.normalize(h.join("/"))}fn.uriToFilePath=i;function s(){return process.platform==="win32"}function o(d,f,h,p){const g="NODE_PATH",y=["var p = process;","p.on('message',function(m){","if(m.c==='e'){","p.exit(0);","}","else if(m.c==='rs'){","try{","var r=require.resolve(m.a);","p.send({c:'r',s:true,r:r});","}","catch(err){","p.send({c:'r',s:false});","}","}","});"].join("");return new Promise((m,w)=>{let E=process.env,k=Object.create(null);Object.keys(E).forEach(A=>k[A]=E[A]),f&&n.existsSync(f)&&(k[g]?k[g]=f+e.delimiter+k[g]:k[g]=f,p&&p(`NODE_PATH value is: ${k[g]}`)),k.ELECTRON_RUN_AS_NODE="1";try{let A=(0,r.fork)("",[],{cwd:h,env:k,execArgv:["-e",y]});if(A.pid===void 0){w(new Error(`Starting process to resolve node module ${d} failed`));return}A.on("error",x=>{w(x)}),A.on("message",x=>{x.c==="r"&&(A.send({c:"e"}),x.s?m(x.r):w(new Error(`Failed to resolve module: ${d}`)))});let I={c:"rs",a:d};A.send(I)}catch(A){w(A)}})}fn.resolve=o;function a(d){let f="npm";const h=Object.create(null);Object.keys(process.env).forEach(y=>h[y]=process.env[y]),h.NO_UPDATE_NOTIFIER="true";const p={encoding:"utf8",env:h};s()&&(f="npm.cmd",p.shell=!0);let g=()=>{};try{process.on("SIGPIPE",g);let y=(0,r.spawnSync)(f,["config","get","prefix"],p).stdout;if(!y){d&&d("'npm config get prefix' didn't return a value.");return}let m=y.trim();return d&&d(`'npm config get prefix' value is: ${m}`),m.length>0?s()?e.join(m,"node_modules"):e.join(m,"lib","node_modules"):void 0}catch{return}finally{process.removeListener("SIGPIPE",g)}}fn.resolveGlobalNodePath=a;function c(d){let f="yarn",h={encoding:"utf8"};s()&&(f="yarn.cmd",h.shell=!0);let p=()=>{};try{process.on("SIGPIPE",p);let g=(0,r.spawnSync)(f,["global","dir","--json"],h),y=g.stdout;if(!y){d&&(d("'yarn global dir' didn't return a value."),g.stderr&&d(g.stderr));return}let m=y.trim().split(/\r?\n/);for(let w of m)try{let E=JSON.parse(w);if(E.type==="log")return e.join(E.data,"node_modules")}catch{}return}catch{return}finally{process.removeListener("SIGPIPE",p)}}fn.resolveGlobalYarnPath=c;var u;(function(d){let f;function h(){return f!==void 0||(process.platform==="win32"?f=!1:f=!n.existsSync(__filename.toUpperCase())||!n.existsSync(__filename.toLowerCase())),f}d.isCaseSensitive=h;function p(g,y){return h()?e.normalize(y).indexOf(e.normalize(g))===0:e.normalize(y).toLowerCase().indexOf(e.normalize(g).toLowerCase())===0}d.isParent=p})(u||(fn.FileSystem=u={}));function l(d,f,h,p){return h?(e.isAbsolute(h)||(h=e.join(d,h)),o(f,h,h,p).then(g=>u.isParent(h,g)?g:Promise.reject(new Error(`Failed to load ${f} from node path location.`))).then(void 0,g=>o(f,a(p),d,p))):o(f,a(p),d,p)}return fn.resolveModulePath=l,fn}var fv,Q$;function eC(){return Q$||(Q$=1,fv=St()),fv}var to={},Cu={},tC;function C7(){if(tC)return Cu;tC=1,Object.defineProperty(Cu,"__esModule",{value:!0}),Cu.InlineCompletionFeature=void 0;const t=St(),e=n=>class extends n{get inlineCompletion(){return{on:r=>this.connection.onRequest(t.InlineCompletionRequest.type,(i,s)=>r(i,s,this.attachWorkDoneProgress(i)))}}};return Cu.InlineCompletionFeature=e,Cu}var nC;function _7(){return nC||(nC=1,function(t){var e=to&&to.__createBinding||(Object.create?function(c,u,l,d){d===void 0&&(d=l);var f=Object.getOwnPropertyDescriptor(u,l);(!f||("get"in f?!u.__esModule:f.writable||f.configurable))&&(f={enumerable:!0,get:function(){return u[l]}}),Object.defineProperty(c,d,f)}:function(c,u,l,d){d===void 0&&(d=l),c[d]=u[l]}),n=to&&to.__exportStar||function(c,u){for(var l in c)l!=="default"&&!Object.prototype.hasOwnProperty.call(u,l)&&e(u,c,l)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProposedFeatures=t.NotebookDocuments=t.TextDocuments=t.SemanticTokensBuilder=void 0;const r=O$();Object.defineProperty(t,"SemanticTokensBuilder",{enumerable:!0,get:function(){return r.SemanticTokensBuilder}});const i=C7();n(St(),t);const s=W$();Object.defineProperty(t,"TextDocuments",{enumerable:!0,get:function(){return s.TextDocuments}});const o=V$();Object.defineProperty(t,"NotebookDocuments",{enumerable:!0,get:function(){return o.NotebookDocuments}}),n(X$(),t);var a;(function(c){c.all={__brand:"features",languages:i.InlineCompletionFeature}})(a||(t.ProposedFeatures=a={}))}(to)),to}var rC;function A7(){return rC||(rC=1,function(t){var e=Gs&&Gs.__createBinding||(Object.create?function(m,w,E,k){k===void 0&&(k=E);var A=Object.getOwnPropertyDescriptor(w,E);(!A||("get"in A?!w.__esModule:A.writable||A.configurable))&&(A={enumerable:!0,get:function(){return w[E]}}),Object.defineProperty(m,k,A)}:function(m,w,E,k){k===void 0&&(k=E),m[k]=w[E]}),n=Gs&&Gs.__exportStar||function(m,w){for(var E in m)E!=="default"&&!Object.prototype.hasOwnProperty.call(w,E)&&e(w,m,E)};Object.defineProperty(t,"__esModule",{value:!0}),t.createConnection=t.Files=void 0;const r=I9,i=iv(),s=X$(),o=$7(),a=eC();n(eC(),t),n(_7(),t);var c;(function(m){m.uriToFilePath=o.uriToFilePath,m.resolveGlobalNodePath=o.resolveGlobalNodePath,m.resolveGlobalYarnPath=o.resolveGlobalYarnPath,m.resolve=o.resolve,m.resolveModulePath=o.resolveModulePath})(c||(t.Files=c={}));function u(){}let l=!1,d;function f(){const m="--clientProcessId";function w(E){try{let k=parseInt(E);isNaN(k)||(d=setInterval(()=>{try{process.kill(k,0)}catch{process.exit(l?0:1)}},3e3))}catch{}}for(let E=2;E<process.argv.length;E++){let k=process.argv[E];if(k===m&&E+1<process.argv.length){w(process.argv[E+1]);return}else{let A=k.split("=");A[0]===m&&w(A[1])}}}f();const h={initialize:m=>{const w=m.processId;i.number(w)&&d===void 0&&setInterval(()=>{try{process.kill(w,0)}catch{process.exit(l?0:1)}},3e3)},get shutdownReceived(){return l},set shutdownReceived(m){l=m},exit:m=>{process.exit(m)}};function p(m,w,E,k){let A,I,x,_;return m!==void 0&&m.__brand==="features"&&(A=m,m=w,w=E,E=k),a.ConnectionStrategy.is(m)||a.ConnectionOptions.is(m)?_=m:(I=m,x=w,_=E),g(I,x,_,A)}t.createConnection=p;function g(m,w,E,k){let A=!1;if(!m&&!w&&process.argv.length>2){let P,O,C=process.argv.slice(2);for(let D=0;D<C.length;D++){let R=C[D];if(R==="--node-ipc"){m=new a.IPCMessageReader(process),w=new a.IPCMessageWriter(process);break}else if(R==="--stdio"){A=!0,m=process.stdin,w=process.stdout;break}else if(R==="--socket"){P=parseInt(C[D+1]);break}else if(R==="--pipe"){O=C[D+1];break}else{var I=R.split("=");if(I[0]==="--socket"){P=parseInt(I[1]);break}else if(I[0]==="--pipe"){O=I[1];break}}}if(P){let D=(0,a.createServerSocketTransport)(P);m=D[0],w=D[1]}else if(O){let D=(0,a.createServerPipeTransport)(O);m=D[0],w=D[1]}}var x="Use arguments of createConnection or set command line parameters: '--node-ipc', '--stdio' or '--socket={number}'";if(!m)throw new Error("Connection input stream is not set. "+x);if(!w)throw new Error("Connection output stream is not set. "+x);if(i.func(m.read)&&i.func(m.on)){let P=m;P.on("end",()=>{process.exit(l?0:1)}),P.on("close",()=>{process.exit(l?0:1)})}const _=P=>{const O=(0,a.createProtocolConnection)(m,w,P,E);return A&&y(P),O};return(0,s.createConnection)(_,h,k)}function y(m){function w(k){return k.map(A=>typeof A=="string"?A:(0,r.inspect)(A)).join(" ")}const E=new Map;console.assert=function(A,...I){if(!A)if(I.length===0)m.error("Assertion failed");else{const[x,..._]=I;m.error(`Assertion failed: ${x} ${w(_)}`)}},console.count=function(A="default"){const I=String(A);let x=E.get(I)??0;x+=1,E.set(I,x),m.log(`${I}: ${I}`)},console.countReset=function(A){A===void 0?E.clear():E.delete(String(A))},console.debug=function(...A){m.log(w(A))},console.dir=function(A,I){m.log((0,r.inspect)(A,I))},console.log=function(...A){m.log(w(A))},console.error=function(...A){m.error(w(A))},console.trace=function(...A){const I=new Error().stack.replace(/(.+\n){2}/,"");let x="Trace";A.length!==0&&(x+=`: ${w(A)}`),m.log(`${x}
160
+ ${I}`)},console.warn=function(...A){m.warn(w(A))}}}(Gs)),Gs}var ge=A7();function iC(t,e){const n={stacks:t,tokens:e};return x7(n),n.stacks.flat().forEach(i=>{i.property=void 0}),oC(n.stacks).map(i=>i[i.length-1])}function hv(t){const{next:e,cardinalities:n,visited:r,plus:i}=t,s=[],o=e.feature;if(r.has(o))return[];r.add(o);let a,c=o;for(;c.$container;)if(Li(c.$container)){a=c.$container;break}else if(sm(c.$container))c=c.$container;else break;if(nT(c.cardinality)){const u=aa({next:{feature:c,type:e.type},cardinalities:n,visited:r,plus:i});for(const l of u)i.add(l.feature);s.push(...u)}if(a){const u=a.elements.indexOf(c);u!==void 0&&u<a.elements.length-1&&s.push(...sC({feature:a,type:e.type},u+1,n,r,i)),s.every(l=>jo(l.feature.cardinality,l.feature)||jo(n.get(l.feature))||i.has(l.feature))&&s.push(...hv({next:{feature:a,type:e.type},cardinalities:n,visited:r,plus:i}))}return s}function pv(t){return vt(t)&&(t={feature:t}),aa({next:t,cardinalities:new Map,visited:new Set,plus:new Set})}function aa(t){var e,n,r;const{next:i,cardinalities:s,visited:o,plus:a}=t;if(i===void 0)return[];const{feature:c,type:u}=i;if(Li(c)){if(o.has(c))return[];o.add(c)}if(Li(c))return sC(i,0,s,o,a).map(l=>uh(l,c.cardinality,s));if(lm(c)||dm(c))return c.elements.flatMap(l=>aa({next:{feature:l,type:u,property:i.property},cardinalities:s,visited:o,plus:a})).map(l=>uh(l,c.cardinality,s));if(xr(c)){const l={feature:c.terminal,type:u,property:(e=i.property)!==null&&e!==void 0?e:c.feature};return aa({next:l,cardinalities:s,visited:o,plus:a}).map(d=>uh(d,c.cardinality,s))}else{if(Cs(c))return hv({next:{feature:c,type:_c(c),property:(n=i.property)!==null&&n!==void 0?n:c.feature},cardinalities:s,visited:o,plus:a});if(oi(c)&&Xt(c.rule.ref)){const l=c.rule.ref,d={feature:l.definition,type:l.fragment||l.dataType?void 0:(r=_s(l))!==null&&r!==void 0?r:l.name,property:i.property};return aa({next:d,cardinalities:s,visited:o,plus:a}).map(f=>uh(f,c.cardinality,s))}else return[i]}}function uh(t,e,n){return n.set(t.feature,e),t}function sC(t,e,n,r,i){var s;const o=[];let a;for(;e<t.feature.elements.length&&(a={feature:t.feature.elements[e++],type:t.type},o.push(...aa({next:a,cardinalities:n,visited:r,plus:i})),!!jo((s=a.feature.cardinality)!==null&&s!==void 0?s:n.get(a.feature),a.feature)););return o}function x7(t){for(const e of t.tokens){const n=oC(t.stacks,e);t.stacks=n}}function oC(t,e){const n=[];for(const r of t)n.push(...I7(r,e));return n}function I7(t,e){const n=new Map,r=new Set(t.map(s=>s.feature).filter(P7)),i=[];for(;t.length>0;){const s=t.pop(),o=hv({next:s,cardinalities:n,plus:r,visited:new Set}).filter(a=>e?gv(a.feature,e):!0);for(const a of o)i.push([...t,a]);if(!o.every(a=>jo(a.feature.cardinality,a.feature)||jo(n.get(a.feature))))break}return i}function P7(t){if(t.cardinality==="+")return!0;const e=wn(t,xr);return!!(e&&e.cardinality==="+")}function gv(t,e){if(Ir(t))return t.value===e.image;if(oi(t))return N7(t.rule.ref,e);if(fc(t)){const n=bm(t);if(n)return gv(n,e)}return!1}function N7(t,e){return Xt(t)?pv(t.definition).some(r=>gv(r.feature,e)):si(t)?Ac(t).test(e.image):!1}function O7(t){const e=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.triggerCharacters)!==null&&i!==void 0?i:[]}))),n=Array.from(new Set(t.flatMap(r=>{var i;return(i=r?.allCommitCharacters)!==null&&i!==void 0?i:[]})));return{triggerCharacters:e.length>0?e:void 0,allCommitCharacters:n.length>0?n:void 0}}class aC{constructor(e){this.scopeProvider=e.references.ScopeProvider,this.grammar=e.Grammar,this.completionParser=e.parser.CompletionParser,this.nameProvider=e.references.NameProvider,this.lexer=e.parser.Lexer,this.nodeKindProvider=e.shared.lsp.NodeKindProvider,this.fuzzyMatcher=e.shared.lsp.FuzzyMatcher,this.grammarConfig=e.parser.GrammarConfig,this.astReflection=e.shared.AstReflection,this.documentationProvider=e.documentation.DocumentationProvider}async getCompletion(e,n,r){const i=[],s=this.buildContexts(e,n.position),o=(u,l)=>{const d=this.fillCompletionItem(u,l);d&&i.push(d)},a=u=>Ir(u.feature)?u.feature.value:u.feature,c=[];for(const u of s)if(await Promise.all(Qe(u.features).distinct(a).exclude(c).map(l=>this.completionFor(u,l,o))),c.push(...u.features),!this.continueCompletion(i))break;return ge.CompletionList.create(this.deduplicateItems(i),!0)}deduplicateItems(e){return Qe(e).distinct(n=>`${n.kind}_${n.label}_${n.detail}`).toArray()}findFeaturesAt(e,n){const r=e.getText({start:ge.Position.create(0,0),end:e.positionAt(n)}),i=this.completionParser.parse(r),s=i.tokens;if(i.tokenIndex===0){const c=Jd(this.grammar),u=pv({feature:c.definition,type:_s(c)});return s.length>0?(s.shift(),iC(u.map(l=>[l]),s)):u}const o=[...s].splice(i.tokenIndex);return iC([i.elementStack.map(c=>({feature:c}))],o)}*buildContexts(e,n){var r,i;const s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument,a=o.getText(),c=o.offsetAt(n),u={document:e,textDocument:o,offset:c,position:n},l=this.findDataTypeRuleStart(s,c);if(l){const[w,E]=l,k=(r=Pd(s,w))===null||r===void 0?void 0:r.astNode;yield Object.assign(Object.assign({},u),{node:k,tokenOffset:w,tokenEndOffset:E,features:this.findFeaturesAt(o,w)})}const{nextTokenStart:d,nextTokenEnd:f,previousTokenStart:h,previousTokenEnd:p}=this.backtrackToAnyToken(a,c);let g=d;c<=d&&h!==void 0&&(g=h);const y=(i=Pd(s,g))===null||i===void 0?void 0:i.astNode;let m=!0;if(h!==void 0&&p!==void 0&&p===c&&(yield Object.assign(Object.assign({},u),{node:y,tokenOffset:h,tokenEndOffset:p,features:this.findFeaturesAt(o,h)}),m=this.performNextTokenCompletion(e,a.substring(h,p),h,p),m&&(yield Object.assign(Object.assign({},u),{node:y,tokenOffset:p,tokenEndOffset:p,features:this.findFeaturesAt(o,p)}))),y)m&&(yield Object.assign(Object.assign({},u),{node:y,tokenOffset:d,tokenEndOffset:f,features:this.findFeaturesAt(o,d)}));else{const w=Jd(this.grammar);if(!w)throw new Error("Missing entry parser rule");yield Object.assign(Object.assign({},u),{tokenOffset:d,tokenEndOffset:f,features:pv(w.definition)})}}performNextTokenCompletion(e,n,r,i){return new RegExp("\\P{L}$","u").test(n)}findDataTypeRuleStart(e,n){var r,i;let s=Fi(e,n,this.grammarConfig.nameRegexp),o=!!(!((r=wn(s?.grammarSource,Xt))===null||r===void 0)&&r.dataType);if(o){for(;o;)s=s?.container,o=!!(!((i=wn(s?.grammarSource,Xt))===null||i===void 0)&&i.dataType);if(s)return[s.offset,s.end]}}continueCompletion(e){return e.length===0}backtrackToAnyToken(e,n){const r=this.lexer.tokenize(e).tokens;if(r.length===0)return{nextTokenStart:n,nextTokenEnd:n};let i;for(const s of r){if(s.startOffset>=n)return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};if(s.endOffset>=n)return{nextTokenStart:s.startOffset,nextTokenEnd:s.endOffset+1,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0};i=s}return{nextTokenStart:n,nextTokenEnd:n,previousTokenStart:i?i.startOffset:void 0,previousTokenEnd:i?i.endOffset+1:void 0}}completionFor(e,n,r){if(Ir(n.feature))return this.completionForKeyword(e,n.feature,r);if(fc(n.feature)&&e.node)return this.completionForCrossReference(e,n,r)}completionForCrossReference(e,n,r){const i=wn(n.feature,xr);let s=e.node;if(i&&s){n.type&&(s={$type:n.type,$container:s,$containerProperty:n.property},pm(this.astReflection,s));const o={reference:{$refText:""},container:s,property:i.feature};try{for(const a of this.getReferenceCandidates(o,e))r(e,this.createReferenceCompletionItem(a))}catch(a){console.error(a)}}}getReferenceCandidates(e,n){return this.scopeProvider.getScope(e).getAllElements()}createReferenceCompletionItem(e){const n=this.nodeKindProvider.getCompletionItemKind(e),r=this.getReferenceDocumentation(e);return{nodeDescription:e,kind:n,documentation:r,detail:e.type,sortText:"0"}}getReferenceDocumentation(e){if(!e.node)return;const n=this.documentationProvider.getDocumentation(e.node);if(n)return{kind:"markdown",value:n}}completionForKeyword(e,n,r){this.filterKeyword(e,n)&&r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}getKeywordCompletionItemKind(e){return ge.CompletionItemKind.Keyword}filterKeyword(e,n){return new RegExp("\\p{L}","u").test(n.value)}fillCompletionItem(e,n){var r,i;let s;if(typeof n.label=="string")s=n.label;else if("node"in n){const u=this.nameProvider.getName(n.node);if(!u)return;s=u}else if("nodeDescription"in n)s=n.nodeDescription.name;else return;let o;typeof((r=n.textEdit)===null||r===void 0?void 0:r.newText)=="string"?o=n.textEdit.newText:typeof n.insertText=="string"?o=n.insertText:o=s;const a=(i=n.textEdit)!==null&&i!==void 0?i:this.buildCompletionTextEdit(e,s,o);return a?{additionalTextEdits:n.additionalTextEdits,command:n.command,commitCharacters:n.commitCharacters,data:n.data,detail:n.detail,documentation:n.documentation,filterText:n.filterText,insertText:n.insertText,insertTextFormat:n.insertTextFormat,insertTextMode:n.insertTextMode,kind:n.kind,labelDetails:n.labelDetails,preselect:n.preselect,sortText:n.sortText,tags:n.tags,textEditText:n.textEditText,textEdit:a,label:s}:void 0}buildCompletionTextEdit(e,n,r){const s=e.textDocument.getText().substring(e.tokenOffset,e.offset);if(this.fuzzyMatcher.match(s,n)){const o=e.textDocument.positionAt(e.tokenOffset),a=e.position;return{newText:r,range:{start:o,end:a}}}else return}}class F7{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getDefinition(e,n,r){const i=e.parseResult.value;if(i.$cstNode){const s=i.$cstNode,o=Fi(s,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(o)return this.collectLocationLinks(o,n)}}collectLocationLinks(e,n){var r;const i=this.findLink(e);if(i)return[ge.LocationLink.create(i.targetDocument.textDocument.uri,((r=i.target.astNode.$cstNode)!==null&&r!==void 0?r:i.target).range,i.target.range,i.source.range)]}findLink(e){const n=this.references.findDeclarationNode(e);if(n?.astNode){const r=sn(n.astNode);if(n&&r)return{source:e,target:n,targetDocument:r}}}}class cC{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}getDocumentHighlight(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return;const s=Fi(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);if(!s)return;const o=this.references.findDeclaration(s);if(o){const a=Et.equals(sn(o).uri,e.uri),c={documentUri:e.uri,includeDeclaration:a};return this.references.findReferences(o,c).map(l=>this.createDocumentHighlight(l)).toArray()}}createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range)}}class L7{constructor(e){this.nameProvider=e.references.NameProvider,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}getSymbols(e,n,r){return this.getSymbol(e,e.parseResult.value)}getSymbol(e,n){const r=n.$cstNode,i=this.nameProvider.getNameNode(n);if(i&&r){const s=this.nameProvider.getName(n);return[{kind:this.nodeKindProvider.getSymbolKind(n),name:s||i.text,range:r.range,selectionRange:i.range,children:this.getChildSymbols(e,n)}]}else return this.getChildSymbols(e,n)||[]}getChildSymbols(e,n){const r=[];for(const i of kc(n)){const s=this.getSymbol(e,i);r.push(...s)}if(r.length>0)return r}}class M7{constructor(e){this.workspaceManager=e.workspace.WorkspaceManager,this.documentBuilder=e.workspace.DocumentBuilder,this.workspaceLock=e.workspace.WorkspaceLock,this.serviceRegistry=e.ServiceRegistry;let n=!1;e.lsp.LanguageServer.onInitialize(r=>{var i,s;n=!!(!((s=(i=r.capabilities.workspace)===null||i===void 0?void 0:i.didChangeWatchedFiles)===null||s===void 0)&&s.dynamicRegistration)}),e.lsp.LanguageServer.onInitialized(r=>{n&&this.registerFileWatcher(e)})}registerFileWatcher(e){const n=Qe(e.ServiceRegistry.all).flatMap(r=>r.LanguageMetaData.fileExtensions).map(r=>r.startsWith(".")?r.substring(1):r).distinct().toArray();if(n.length>0){const r=e.lsp.Connection,i={watchers:[{globPattern:n.length===1?`**/*.${n[0]}`:`**/*.{${n.join(",")}}`}]};r?.client.register(ge.DidChangeWatchedFilesNotification.type,i)}}fireDocumentUpdate(e,n){e=e.filter(r=>this.serviceRegistry.hasServices(r)),this.workspaceManager.ready.then(()=>{this.workspaceLock.write(r=>this.documentBuilder.update(e,n,r))}).catch(r=>{console.error("Workspace initialization failed. Could not perform document update.",r)})}didChangeContent(e){this.fireDocumentUpdate([Jt.parse(e.document.uri)],[])}didChangeWatchedFiles(e){const n=Qe(e.changes).filter(i=>i.type!==ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Jt.parse(i.uri)).toArray(),r=Qe(e.changes).filter(i=>i.type===ge.FileChangeType.Deleted).distinct(i=>i.uri).map(i=>Jt.parse(i.uri)).toArray();this.fireDocumentUpdate(n,r)}}class z7{constructor(e){this.commentNames=e.parser.GrammarConfig.multilineCommentRules}getFoldingRanges(e,n,r){const i=[],s=o=>i.push(o);return this.collectFolding(e,s),i}collectFolding(e,n){var r;const i=(r=e.parseResult)===null||r===void 0?void 0:r.value;if(i){if(this.shouldProcessContent(i)){const s=Pr(i).iterator();let o;do if(o=s.next(),!o.done){const a=o.value;this.shouldProcess(a)&&this.collectObjectFolding(e,a,n),this.shouldProcessContent(a)||s.prune()}while(!o.done)}this.collectCommentFolding(e,i,n)}}shouldProcess(e){return!0}shouldProcessContent(e){return!0}collectObjectFolding(e,n,r){const i=n.$cstNode;if(i){const s=this.toFoldingRange(e,i);s&&r(s)}}collectCommentFolding(e,n,r){const i=n.$cstNode;if(i){for(const s of AD(i))if(this.commentNames.includes(s.tokenType.name)){const o=this.toFoldingRange(e,s,ge.FoldingRangeKind.Comment);o&&r(o)}}}toFoldingRange(e,n,r){const i=n.range,s=i.start;let o=i.end;if(!(o.line-s.line<2))return this.includeLastFoldingLine(n,r)||(o=e.textDocument.positionAt(e.textDocument.offsetAt({line:o.line,character:0})-1)),ge.FoldingRange.create(s.line,o.line,s.character,o.character,r)}includeLastFoldingLine(e,n){if(n===ge.FoldingRangeKind.Comment)return!1;const r=e.text,i=r.charAt(r.length-1);return!(i==="}"||i===")"||i==="]")}}class B7{match(e,n){if(e.length===0)return!0;let r=!1,i,s=0;const o=n.length;for(let a=0;a<o;a++){const c=n.charCodeAt(a),u=e.charCodeAt(s);if((c===u||this.toUpperCharCode(c)===this.toUpperCharCode(u))&&(r||(r=i===void 0||this.isWordTransition(i,c)),r&&s++,s===e.length))return!0;i=c}return!1}isWordTransition(e,n){return uC<=e&&e<=lC&&q7<=n&&n<=j7||e===dC&&n!==dC}toUpperCharCode(e){return uC<=e&&e<=lC?e-32:e}}const uC=97,lC=122,q7=65,j7=90,dC=95;class fC{constructor(e){this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}getHoverContent(e,n){var r,i;const s=(i=(r=e.parseResult)===null||r===void 0?void 0:r.value)===null||i===void 0?void 0:i.$cstNode;if(s){const o=e.textDocument.offsetAt(n.position),a=Fi(s,o,this.grammarConfig.nameRegexp);if(a&&a.offset+a.length>o){const c=this.references.findDeclaration(a);if(c)return this.getAstNodeHoverContent(c)}}}}class U7 extends fC{constructor(e){super(e),this.documentationProvider=e.documentation.DocumentationProvider}getAstNodeHoverContent(e){const n=this.documentationProvider.getDocumentation(e);if(n)return{contents:{kind:"markdown",value:n}}}}var lh=St();const G7={[ge.SemanticTokenTypes.class]:0,[ge.SemanticTokenTypes.comment]:1,[ge.SemanticTokenTypes.enum]:2,[ge.SemanticTokenTypes.enumMember]:3,[ge.SemanticTokenTypes.event]:4,[ge.SemanticTokenTypes.function]:5,[ge.SemanticTokenTypes.interface]:6,[ge.SemanticTokenTypes.keyword]:7,[ge.SemanticTokenTypes.macro]:8,[ge.SemanticTokenTypes.method]:9,[ge.SemanticTokenTypes.modifier]:10,[ge.SemanticTokenTypes.namespace]:11,[ge.SemanticTokenTypes.number]:12,[ge.SemanticTokenTypes.operator]:13,[ge.SemanticTokenTypes.parameter]:14,[ge.SemanticTokenTypes.property]:15,[ge.SemanticTokenTypes.regexp]:16,[ge.SemanticTokenTypes.string]:17,[ge.SemanticTokenTypes.struct]:18,[ge.SemanticTokenTypes.type]:19,[ge.SemanticTokenTypes.typeParameter]:20,[ge.SemanticTokenTypes.variable]:21,[ge.SemanticTokenTypes.decorator]:22},W7={[ge.SemanticTokenModifiers.abstract]:1,[ge.SemanticTokenModifiers.async]:2,[ge.SemanticTokenModifiers.declaration]:4,[ge.SemanticTokenModifiers.defaultLibrary]:8,[ge.SemanticTokenModifiers.definition]:16,[ge.SemanticTokenModifiers.deprecated]:32,[ge.SemanticTokenModifiers.documentation]:64,[ge.SemanticTokenModifiers.modification]:128,[ge.SemanticTokenModifiers.readonly]:256,[ge.SemanticTokenModifiers.static]:512};function H7(t){const e=[],n=[];let r=!0,i=!0,s=!0;for(const o of t)o&&(o.legend.tokenTypes.forEach((a,c)=>{const u=e[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token types. They use the same index ${c}.`);e[c]=a}),o.legend.tokenModifiers.forEach((a,c)=>{const u=n[c];if(u&&u!==a)throw new Error(`Cannot merge '${u}' and '${a}' token modifier. They use the same index ${c}.`);n[c]=a}),o.full?typeof o.full=="object"&&!o.full.delta&&(i=!1):r=!1,o.range||(s=!1));return{legend:{tokenTypes:e,tokenModifiers:n},full:r&&{delta:i},range:s}}class V7 extends ge.SemanticTokensBuilder{constructor(){super(...arguments),this._tokens=[]}push(e,n,r,i,s){this._tokens.push({line:e,char:n,length:r,tokenType:i,tokenModifiers:s})}build(){return this.applyTokens(),super.build()}buildEdits(){return this.applyTokens(),super.buildEdits()}flush(){this.previousResult(this.id)}applyTokens(){for(const e of this._tokens.sort(this.compareTokens))super.push(e.line,e.char,e.length,e.tokenType,e.tokenModifiers);this._tokens=[]}compareTokens(e,n){return e.line===n.line?e.char-n.char:e.line-n.line}}class K7{constructor(e){this.tokensBuilders=new Map,e.shared.workspace.TextDocuments.onDidClose(n=>{this.tokensBuilders.delete(n.document.uri)}),e.shared.lsp.LanguageServer.onInitialize(n=>{var r;this.initialize((r=n.capabilities.textDocument)===null||r===void 0?void 0:r.semanticTokens)})}initialize(e){this.clientCapabilities=e}get tokenTypes(){return G7}get tokenModifiers(){return W7}get semanticTokensOptions(){return{legend:{tokenTypes:Object.keys(this.tokenTypes),tokenModifiers:Object.keys(this.tokenModifiers)},full:{delta:!0},range:!0}}async semanticHighlight(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightRange(e,n,r=ct.CancellationToken.None){return this.currentRange=n.range,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.flush(),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.build()}async semanticHighlightDelta(e,n,r=ct.CancellationToken.None){return this.currentRange=void 0,this.currentDocument=e,this.currentTokensBuilder=this.getDocumentTokensBuilder(e),this.currentTokensBuilder.previousResult(n.previousResultId),await this.computeHighlighting(e,this.createAcceptor(),r),this.currentTokensBuilder.buildEdits()}createAcceptor(){return n=>{"line"in n?this.highlightToken({range:{start:{line:n.line,character:n.char},end:{line:n.line,character:n.char+n.length}},type:n.type,modifier:n.modifier}):"range"in n?this.highlightToken(n):"keyword"in n?this.highlightKeyword(n):"property"in n?this.highlightProperty(n):this.highlightNode({node:n.cst,type:n.type,modifier:n.modifier})}}getDocumentTokensBuilder(e){const n=this.tokensBuilders.get(e.uri.toString());if(n)return n;const r=new V7;return this.tokensBuilders.set(e.uri.toString(),r),r}async computeHighlighting(e,n,r){const i=e.parseResult.value,s=ai(i,{range:this.currentRange}).iterator();let o;do if(o=s.next(),!o.done){await zt(r);const a=o.value;this.highlightElement(a,n)==="prune"&&s.prune()}while(!o.done)}highlightToken(e){var n;const{range:r,type:i}=e;let s=e.modifier;if(this.currentRange&&!Qg(r,this.currentRange)||!this.currentDocument||!this.currentTokensBuilder)return;const o=this.tokenTypes[i];let a=0;if(s!==void 0){typeof s=="string"&&(s=[s]);for(const l of s){const d=this.tokenModifiers[l];a|=d}}const c=r.start.line,u=r.end.line;if(c===u){const l=r.start.character,d=r.end.character-l;this.currentTokensBuilder.push(c,l,d,o,a)}else if(!((n=this.clientCapabilities)===null||n===void 0)&&n.multilineTokenSupport){const l=r.start.character,d=this.currentDocument.textDocument.offsetAt(r.start),f=this.currentDocument.textDocument.offsetAt(r.end);this.currentTokensBuilder.push(c,l,f-d,o,a)}else{const l=r.start;let d=this.currentDocument.textDocument.offsetAt({line:c+1,character:0});this.currentTokensBuilder.push(l.line,l.character,d-l.character-1,o,a);for(let f=c+1;f<u;f++){const h=d;d=this.currentDocument.textDocument.offsetAt({line:f+1,character:0}),this.currentTokensBuilder.push(f,0,d-h-1,o,a)}this.currentTokensBuilder.push(u,0,r.end.character,o,a)}}highlightProperty(e){const n=[];if(typeof e.index=="number"){const s=An(e.node.$cstNode,e.property,e.index);s&&n.push(s)}else n.push(...qo(e.node.$cstNode,e.property));const{type:r,modifier:i}=e;for(const s of n)this.highlightNode({node:s,type:r,modifier:i})}highlightKeyword(e){const{node:n,keyword:r,type:i,index:s,modifier:o}=e,a=[];if(typeof s=="number"){const c=Cc(n.$cstNode,r,s);c&&a.push(c)}else a.push(...Dm(n.$cstNode,r));for(const c of a)this.highlightNode({node:c,type:i,modifier:o})}highlightNode(e){const{node:n,type:r,modifier:i}=e,s=n.range;this.highlightToken({range:s,type:r,modifier:i})}}var hC;(function(t){function e(r,i,s){const o=new Map;Object.entries(i).forEach(([u,l])=>o.set(l,u));let a=0,c=0;return n(r.data,5).map(u=>{a+=u[0],u[0]!==0&&(c=0),c+=u[1];const l=u[2];return{offset:s.textDocument.offsetAt({line:a,character:c}),tokenType:o.get(u[3]),tokenModifiers:u[4],text:s.textDocument.getText({start:{line:a,character:c},end:{line:a,character:c+l}})}})}t.decode=e;function n(r,i){const s=[];for(let o=0;o<r.length;o+=i){const a=r.slice(o,o+i);s.push(a)}return s}})(hC||(hC={}));function Y7(t){const e=[],n=[];t.forEach(i=>{i?.triggerCharacters&&e.push(...i.triggerCharacters),i?.retriggerCharacters&&n.push(...i.retriggerCharacters)});const r={triggerCharacters:e.length>0?Array.from(new Set(e)).sort():void 0,retriggerCharacters:n.length>0?Array.from(new Set(n)).sort():void 0};return r.triggerCharacters?r:void 0}class X7{constructor(e){this.onInitializeEmitter=new lh.Emitter,this.onInitializedEmitter=new lh.Emitter,this.services=e}get onInitialize(){return this.onInitializeEmitter.event}get onInitialized(){return this.onInitializedEmitter.event}async initialize(e){return this.eagerLoadServices(),this.fireInitializeOnDefaultServices(e),this.onInitializeEmitter.fire(e),this.onInitializeEmitter.dispose(),this.buildInitializeResult(e)}eagerLoadServices(){Jy(this.services),this.services.ServiceRegistry.all.forEach(e=>Jy(e))}hasService(e){return this.services.ServiceRegistry.all.some(r=>e(r)!==void 0)}buildInitializeResult(e){var n,r,i,s;const o=this.services.lsp.DocumentUpdateHandler,a=(n=this.services.lsp.FileOperationHandler)===null||n===void 0?void 0:n.fileOperationOptions,c=this.services.ServiceRegistry.all,u=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.Formatter}),l=c.map(se=>{var K,Te;return(Te=(K=se.lsp)===null||K===void 0?void 0:K.Formatter)===null||Te===void 0?void 0:Te.formatOnTypeOptions}).find(se=>!!se),d=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.CodeActionProvider}),f=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.SemanticTokenProvider}),h=H7(c.map(se=>{var K,Te;return(Te=(K=se.lsp)===null||K===void 0?void 0:K.SemanticTokenProvider)===null||Te===void 0?void 0:Te.semanticTokensOptions})),p=(i=(r=this.services.lsp)===null||r===void 0?void 0:r.ExecuteCommandHandler)===null||i===void 0?void 0:i.commands,g=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.DocumentLinkProvider}),y=Y7(c.map(se=>{var K,Te;return(Te=(K=se.lsp)===null||K===void 0?void 0:K.SignatureHelp)===null||Te===void 0?void 0:Te.signatureHelpOptions})),m=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.TypeProvider}),w=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.ImplementationProvider}),E=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.CompletionProvider}),k=O7(c.map(se=>{var K,Te;return(Te=(K=se.lsp)===null||K===void 0?void 0:K.CompletionProvider)===null||Te===void 0?void 0:Te.completionOptions})),A=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.ReferencesProvider}),I=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.DocumentSymbolProvider}),x=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.DefinitionProvider}),_=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.DocumentHighlightProvider}),P=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.FoldingRangeProvider}),O=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.HoverProvider}),C=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.RenameProvider}),D=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.CallHierarchyProvider}),R=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.TypeHierarchyProvider}),L=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.CodeLensProvider}),W=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.DeclarationProvider}),V=this.hasService(se=>{var K;return(K=se.lsp)===null||K===void 0?void 0:K.InlayHintProvider}),Z=(s=this.services.lsp)===null||s===void 0?void 0:s.WorkspaceSymbolProvider;return{capabilities:{workspace:{workspaceFolders:{supported:!0},fileOperations:a},executeCommandProvider:p&&{commands:p},textDocumentSync:{change:lh.TextDocumentSyncKind.Incremental,openClose:!0,save:!!o.didSaveDocument,willSave:!!o.willSaveDocument,willSaveWaitUntil:!!o.willSaveDocumentWaitUntil},completionProvider:E?k:void 0,referencesProvider:A,documentSymbolProvider:I,definitionProvider:x,typeDefinitionProvider:m,documentHighlightProvider:_,codeActionProvider:d,documentFormattingProvider:u,documentRangeFormattingProvider:u,documentOnTypeFormattingProvider:l,foldingRangeProvider:P,hoverProvider:O,renameProvider:C?{prepareProvider:!0}:void 0,semanticTokensProvider:f?h:void 0,signatureHelpProvider:y,implementationProvider:w,callHierarchyProvider:D?{}:void 0,typeHierarchyProvider:R?{}:void 0,documentLinkProvider:g?{resolveProvider:!1}:void 0,codeLensProvider:L?{resolveProvider:!1}:void 0,declarationProvider:W,inlayHintProvider:V?{resolveProvider:!1}:void 0,workspaceSymbolProvider:Z?{resolveProvider:!!Z.resolveSymbol}:void 0}}}initialized(e){this.fireInitializedOnDefaultServices(e),this.onInitializedEmitter.fire(e),this.onInitializedEmitter.dispose()}fireInitializeOnDefaultServices(e){this.services.workspace.ConfigurationProvider.initialize(e),this.services.workspace.WorkspaceManager.initialize(e)}fireInitializedOnDefaultServices(e){const n=this.services.lsp.Connection,r=n?Object.assign(Object.assign({},e),{register:i=>n.client.register(lh.DidChangeConfigurationNotification.type,i),fetchConfiguration:i=>n.workspace.getConfiguration(i)}):e;this.services.workspace.ConfigurationProvider.initialized(r).catch(i=>console.error("Error in ConfigurationProvider initialization:",i)),this.services.workspace.WorkspaceManager.initialized(e).catch(i=>console.error("Error in WorkspaceManager initialization:",i))}}class J7{getSymbolKind(e){return ge.SymbolKind.Field}getCompletionItemKind(e){return ge.CompletionItemKind.Reference}}class Z7{constructor(e){this.nameProvider=e.references.NameProvider,this.references=e.references.References,this.grammarConfig=e.parser.GrammarConfig}findReferences(e,n,r){const i=e.parseResult.value.$cstNode;if(!i)return[];const s=Fi(i,e.textDocument.offsetAt(n.position),this.grammarConfig.nameRegexp);return s?this.getReferences(s,n,e):[]}getReferences(e,n,r){const i=[],s=this.references.findDeclaration(e);if(s){const o={includeDeclaration:n.context.includeDeclaration};this.references.findReferences(s,o).forEach(a=>{i.push(ge.Location.create(a.sourceUri.toString(),a.segment.range))})}return i}}class Q7{constructor(e){this.references=e.references.References,this.nameProvider=e.references.NameProvider,this.grammarConfig=e.parser.GrammarConfig}async rename(e,n,r){const i={},s=e.parseResult.value.$cstNode;if(!s)return;const o=e.textDocument.offsetAt(n.position),a=Fi(s,o,this.grammarConfig.nameRegexp);if(!a)return;const c=this.references.findDeclaration(a);if(!c)return;const u={onlyLocal:!1,includeDeclaration:!0};return this.references.findReferences(c,u).forEach(d=>{const f=Sn.replace(d.segment.range,n.newName),h=d.sourceUri.toString();i[h]?i[h].push(f):i[h]=[f]}),{changes:i}}prepareRename(e,n,r){return this.renameNodeRange(e,n.position)}renameNodeRange(e,n){const r=e.parseResult.value.$cstNode,i=e.textDocument.offsetAt(n);if(r&&i){const s=Fi(r,i,this.grammarConfig.nameRegexp);if(!s)return;if(this.references.findDeclaration(s)||this.isNameNode(s))return s.range}}isNameNode(e){return e?.astNode&&HS(e.astNode)&&e===this.nameProvider.getNameNode(e.astNode)}}class pC{constructor(e){this.indexManager=e.workspace.IndexManager,this.nodeKindProvider=e.lsp.NodeKindProvider,this.fuzzyMatcher=e.lsp.FuzzyMatcher}async getSymbols(e,n=ct.CancellationToken.None){const r=[],i=e.query.toLowerCase();for(const s of this.indexManager.allElements())if(await zt(n),this.fuzzyMatcher.match(i,s.name)){const o=this.getWorkspaceSymbol(s);o&&r.push(o)}return r}getWorkspaceSymbol(e){const n=e.nameSegment;if(n)return{kind:this.nodeKindProvider.getSymbolKind(e),name:e.name,location:{range:n.range,uri:e.documentUri.toString()}}}}class eG{constructor(e){this._configuration=e,this._syncedDocuments=new Map,this._onDidChangeContent=new ge.Emitter,this._onDidOpen=new ge.Emitter,this._onDidClose=new ge.Emitter,this._onDidSave=new ge.Emitter,this._onWillSave=new ge.Emitter}get onDidOpen(){return this._onDidOpen.event}get onDidChangeContent(){return this._onDidChangeContent.event}get onWillSave(){return this._onWillSave.event}onWillSaveWaitUntil(e){this._willSaveWaitUntil=e}get onDidSave(){return this._onDidSave.event}get onDidClose(){return this._onDidClose.event}get(e){return this._syncedDocuments.get(Et.normalize(e))}set(e){const n=Et.normalize(e.uri);let r=!0;this._syncedDocuments.has(n)&&(r=!1),this._syncedDocuments.set(n,e);const i=Object.freeze({document:e});return this._onDidOpen.fire(i),this._onDidChangeContent.fire(i),r}delete(e){const n=Et.normalize(typeof e=="object"&&"uri"in e?e.uri:e),r=this._syncedDocuments.get(n);r!==void 0&&(this._syncedDocuments.delete(n),this._onDidClose.fire(Object.freeze({document:r})))}all(){return Array.from(this._syncedDocuments.values())}keys(){return Array.from(this._syncedDocuments.keys())}listen(e){e.__textDocumentSync=ge.TextDocumentSyncKind.Incremental;const n=[];return n.push(e.onDidOpenTextDocument(r=>{const i=r.textDocument,s=Et.normalize(i.uri),o=this._configuration.create(s,i.languageId,i.version,i.text);this._syncedDocuments.set(s,o);const a=Object.freeze({document:o});this._onDidOpen.fire(a),this._onDidChangeContent.fire(a)})),n.push(e.onDidChangeTextDocument(r=>{const i=r.textDocument,s=r.contentChanges;if(s.length===0)return;const{version:o}=i;if(o==null)throw new Error(`Received document change event for ${i.uri} without valid version identifier`);const a=Et.normalize(i.uri);let c=this._syncedDocuments.get(a);c!==void 0&&(c=this._configuration.update(c,s,o),this._syncedDocuments.set(a,c),this._onDidChangeContent.fire(Object.freeze({document:c})))})),n.push(e.onDidCloseTextDocument(r=>{const i=Et.normalize(r.textDocument.uri),s=this._syncedDocuments.get(i);s!==void 0&&(this._syncedDocuments.delete(i),this._onDidClose.fire(Object.freeze({document:s})))})),n.push(e.onWillSaveTextDocument(r=>{const i=this._syncedDocuments.get(Et.normalize(r.textDocument.uri));i!==void 0&&this._onWillSave.fire(Object.freeze({document:i,reason:r.reason}))})),n.push(e.onWillSaveTextDocumentWaitUntil((r,i)=>{const s=this._syncedDocuments.get(Et.normalize(r.textDocument.uri));return s!==void 0&&this._willSaveWaitUntil?this._willSaveWaitUntil(Object.freeze({document:s,reason:r.reason}),i):[]})),n.push(e.onDidSaveTextDocument(r=>{const i=this._syncedDocuments.get(Et.normalize(r.textDocument.uri));i!==void 0&&this._onDidSave.fire(Object.freeze({document:i}))})),ge.Disposable.create(()=>{n.forEach(r=>r.dispose())})}}function tG(t){return Zf.merge(fk(t),nG(t))}function nG(t){return{lsp:{CompletionProvider:e=>new aC(e),DocumentSymbolProvider:e=>new L7(e),HoverProvider:e=>new U7(e),FoldingRangeProvider:e=>new z7(e),ReferencesProvider:e=>new Z7(e),DefinitionProvider:e=>new F7(e),DocumentHighlightProvider:e=>new cC(e),RenameProvider:e=>new Q7(e)},shared:()=>t.shared}}function rG(t){return Zf.merge(hk(t),iG(t))}function iG(t){return{lsp:{Connection:()=>t.connection,LanguageServer:e=>new X7(e),DocumentUpdateHandler:e=>new M7(e),WorkspaceSymbolProvider:e=>new pC(e),NodeKindProvider:()=>new J7,FuzzyMatcher:()=>new B7},workspace:{TextDocuments:()=>new eG(Xf)}}}class sG{constructor(){this.collector=()=>{}}getNodeFormatter(e){return new oG(e,this.collector)}formatDocument(e,n){const r=e.parseResult;return r.lexerErrors.length===0&&r.parserErrors.length===0?this.doDocumentFormat(e,n.options):[]}isFormatRangeErrorFree(e,n){const r=e.parseResult;return r.lexerErrors.length||r.parserErrors.length?Math.min(...r.lexerErrors.map(s=>{var o;return(o=s.line)!==null&&o!==void 0?o:Number.MAX_VALUE}),...r.parserErrors.map(s=>{var o;return(o=s.token.startLine)!==null&&o!==void 0?o:Number.MAX_VALUE}))>n.end.line:!0}formatDocumentRange(e,n){return this.isFormatRangeErrorFree(e,n.range)?this.doDocumentFormat(e,n.options,n.range):[]}formatDocumentOnType(e,n){const r={start:{character:0,line:n.position.line},end:n.position};return this.isFormatRangeErrorFree(e,r)?this.doDocumentFormat(e,n.options,r):[]}get formatOnTypeOptions(){}doDocumentFormat(e,n,r){const i=new Map,s=(a,c,u)=>{var l,d;const f=this.nodeModeToKey(a,c),h=i.get(f),p=(l=u.options.priority)!==null&&l!==void 0?l:0,g=(d=h?.options.priority)!==null&&d!==void 0?d:0;(!h||g<=p)&&i.set(f,u)};this.collector=s,this.iterateAstFormatting(e,r);const o=this.iterateCstFormatting(e,i,n,r);return this.avoidOverlappingEdits(e.textDocument,o)}avoidOverlappingEdits(e,n){const r=[];for(const i of n){let s=r[r.length-1];for(;s;){const o=e.offsetAt(i.range.start),a=e.offsetAt(s.range.end);if(o<a)r.pop(),s=r[r.length-1];else break}r.push(i)}return r.filter(i=>this.isNecessary(i,e))}iterateAstFormatting(e,n){const r=e.parseResult.value;this.format(r);const i=Pr(r).iterator();let s;do if(s=i.next(),!s.done){const o=s.value;this.insideRange(o.$cstNode.range,n)?this.format(o):i.prune()}while(!s.done)}nodeModeToKey(e,n){return`${e.offset}:${e.end}:${n}`}insideRange(e,n){return!n||e.start.line<=n.start.line&&e.end.line>=n.end.line||e.start.line>=n.start.line&&e.end.line<=n.end.line||e.start.line<=n.end.line&&e.end.line>=n.end.line}isNecessary(e,n){return e.newText!==n.getText(e.range).replace(/\r/g,"")}iterateCstFormatting(e,n,r,i){const s={indentation:0,options:r,document:e.textDocument},o=[],c=this.iterateCstTree(e,s).iterator();let u,l;do if(l=c.next(),!l.done){const d=l.value,f=$s(d),h=this.nodeModeToKey(d,"prepend"),p=n.get(h);if(n.delete(h),p){const m=this.createTextEdit(u,d,p,s);for(const w of m)w&&this.insideRange(w.range,i)&&o.push(w)}const g=this.nodeModeToKey(d,"append"),y=n.get(g);if(n.delete(g),y){const m=OD(d);if(m){const w=this.createTextEdit(d,m,y,s);for(const E of w)E&&this.insideRange(E.range,i)&&o.push(E)}}if(!p&&d.hidden){const m=this.createHiddenTextEdits(u,d,void 0,s);for(const w of m)w&&this.insideRange(w.range,i)&&o.push(w)}f&&(u=d)}while(!l.done);return o}createHiddenTextEdits(e,n,r,i){var s;const o=n.range.start.line;if(e&&e.range.end.line===o)return[];const a=[],c={start:{character:0,line:o},end:n.range.start},u=i.document.getText(c),l=this.findFittingMove(c,(s=r?.moves)!==null&&s!==void 0?s:[],i),d=this.getExistingIndentationCharacterCount(u,i),h=this.getIndentationCharacterCount(i,l)-d;if(h===0)return[];let p="";h>0&&(p=(i.options.insertSpaces?" ":" ").repeat(h));const g=n.text.split(`
161
+ `);g[0]=u+g[0];for(let y=0;y<g.length;y++){const m=o+y,w={character:0,line:m};if(h>0)a.push({newText:p,range:{start:w,end:w}});else{const E=g[y];let k=0;for(;k<E.length;k++){const A=E.charAt(k);if(A!==" "&&A!==" ")break}a.push({newText:"",range:{start:w,end:{line:m,character:Math.min(k,Math.abs(h))}}})}}return a}getExistingIndentationCharacterCount(e,n){const r=" ".repeat(n.options.tabSize);return(n.options.insertSpaces?e.replaceAll(" ",r):e.replaceAll(r," ")).length}getIndentationCharacterCount(e,n){let r=e.indentation;return n&&n.tabs&&(r+=n.tabs),(e.options.insertSpaces?e.options.tabSize:1)*r}createTextEdit(e,n,r,i){var s;if(n.hidden)return this.createHiddenTextEdits(e,n,r,i);if(e&&(e.range.end.line>n.range.start.line||e.range.end.line===n.range.start.line&&e.range.end.character>n.range.start.character))return[];const o={start:(s=e?.range.end)!==null&&s!==void 0?s:{character:0,line:0},end:n.range.start},a=this.findFittingMove(o,r.moves,i);if(!a)return[];const c=a.characters,u=a.lines,l=a.tabs,d=i.indentation;i.indentation+=l??0;const f=[];return c!==void 0?e?.hidden||f.push(this.createSpaceTextEdit(o,c,r.options)):u!==void 0?f.push(this.createLineTextEdit(o,u,i,r.options)):l!==void 0&&f.push(this.createTabTextEdit(o,!!e,i)),$s(n)&&(i.indentation=d),f}createSpaceTextEdit(e,n,r){if(e.start.line===e.end.line){const s=e.end.character-e.start.character;n=this.fitIntoOptions(n,s,r)}return{newText:" ".repeat(n),range:e}}createLineTextEdit(e,n,r,i){const s=e.end.line-e.start.line;n=this.fitIntoOptions(n,s,i);const a=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation);return{newText:`${`
162
+ `.repeat(n)}${a}`,range:e}}createTabTextEdit(e,n,r){const s=(r.options.insertSpaces?" ".repeat(r.options.tabSize):" ").repeat(r.indentation),o=n?1:0,a=Math.max(e.end.line-e.start.line,o);return{newText:`${`
163
+ `.repeat(a)}${s}`,range:e}}fitIntoOptions(e,n,r){return r.allowMore?e=Math.max(n,e):r.allowLess&&(e=Math.min(n,e)),e}findFittingMove(e,n,r){if(n.length===0)return;if(n.length===1)return n[0];const i=e.end.line-e.start.line;for(const s of n){if(s.lines!==void 0&&i<=s.lines)return s;if(s.lines===void 0&&i===0)return s}return n[n.length-1]}iterateCstTree(e,n){const i=e.parseResult.value.$cstNode;return i?new Mo(i,s=>this.iterateCst(s,n)):Lo}iterateCst(e,n){if(!ii(e))return Lo;const r=n.indentation;return new xt(()=>({index:0}),i=>i.index<e.content.length?{done:!1,value:e.content[i.index++]}:(n.indentation=r,Yt))}}class oG{constructor(e,n){this.astNode=e,this.collector=n}node(e){return new Rr(e.$cstNode?[e.$cstNode]:[],this.collector)}nodes(...e){const n=[];for(const r of e)r.$cstNode&&n.push(r.$cstNode);return new Rr(n,this.collector)}property(e,n){const r=An(this.astNode.$cstNode,e,n);return new Rr(r?[r]:[],this.collector)}properties(...e){const n=[];for(const r of e){const i=qo(this.astNode.$cstNode,r);n.push(...i)}return new Rr(n,this.collector)}keyword(e,n){const r=Cc(this.astNode.$cstNode,e,n);return new Rr(r?[r]:[],this.collector)}keywords(...e){const n=[];for(const r of e){const i=Dm(this.astNode.$cstNode,r);n.push(...i)}return new Rr(n,this.collector)}cst(e){return new Rr([...e],this.collector)}interior(e,n){const r=e.nodes,i=n.nodes;if(r.length!==1||i.length!==1)return new Rr([],this.collector);let s=r[0],o=i[0];if(s.offset>o.offset){const a=s;s=o,o=a}return new Rr(FD(s,o),this.collector)}}class Rr{constructor(e,n){this.nodes=e,this.collector=n}prepend(e){for(const n of this.nodes)this.collector(n,"prepend",e);return this}append(e){for(const n of this.nodes)this.collector(n,"append",e);return this}surround(e){for(const n of this.nodes)this.collector(n,"prepend",e),this.collector(n,"append",e);return this}slice(e,n){return new Rr(this.nodes.slice(e,n),this.collector)}}var Yi;(function(t){function e(...l){return{options:{},moves:l.flatMap(d=>d.moves).sort(u)}}t.fit=e;function n(l){return i(0,l)}t.noSpace=n;function r(l){return i(1,l)}t.oneSpace=r;function i(l,d){return{options:d??{},moves:[{characters:l}]}}t.spaces=i;function s(l){return o(1,l)}t.newLine=s;function o(l,d){return{options:d??{},moves:[{lines:l}]}}t.newLines=o;function a(l){return{options:l??{},moves:[{tabs:1,lines:1}]}}t.indent=a;function c(l){return{options:l??{},moves:[{tabs:0}]}}t.noIndent=c;function u(l,d){var f,h,p,g,y,m;const w=(f=l.lines)!==null&&f!==void 0?f:0,E=(h=d.lines)!==null&&h!==void 0?h:0,k=(p=l.tabs)!==null&&p!==void 0?p:0,A=(g=d.tabs)!==null&&g!==void 0?g:0,I=(y=l.characters)!==null&&y!==void 0?y:0,x=(m=d.characters)!==null&&m!==void 0?m:0;return w<E?-1:w>E?1:k<A?-1:k>A?1:I<x?-1:I>x?1:0}})(Yi||(Yi={}));class aG{constructor(){this.encoding="utf-8"}readFile(e){return z0.promises.readFile(e.fsPath,this.encoding)}async readDirectory(e){return(await z0.promises.readdir(e.fsPath,{withFileTypes:!0})).map(r=>({dirent:r,isFile:r.isFile(),isDirectory:r.isDirectory(),uri:Et.joinPath(e,r.name)}))}}const cG={fileSystemProvider:()=>new aG},Xe={silent:Number.NEGATIVE_INFINITY,fatal:0,error:0,warn:1,log:2,info:3,success:3,fail:3,ready:3,start:3,box:3,debug:4,trace:5,verbose:Number.POSITIVE_INFINITY},gC={silent:{level:-1},fatal:{level:Xe.fatal},error:{level:Xe.error},warn:{level:Xe.warn},log:{level:Xe.log},info:{level:Xe.info},success:{level:Xe.success},fail:{level:Xe.fail},ready:{level:Xe.info},start:{level:Xe.info},box:{level:Xe.info},debug:{level:Xe.debug},trace:{level:Xe.trace},verbose:{level:Xe.verbose}};function mv(t){return t!==null&&typeof t=="object"}function yv(t,e,n=".",r){if(!mv(e))return yv(t,{},n);const i=Object.assign({},e);for(const s in t){if(s==="__proto__"||s==="constructor")continue;const o=t[s];o!=null&&(Array.isArray(o)&&Array.isArray(i[s])?i[s]=[...o,...i[s]]:mv(o)&&mv(i[s])?i[s]=yv(o,i[s],(n?`${n}.`:"")+s.toString()):i[s]=o)}return i}function uG(t){return(...e)=>e.reduce((n,r)=>yv(n,r,""),{})}const lG=uG();function dG(t){return Object.prototype.toString.call(t)==="[object Object]"}function fG(t){return!(!dG(t)||!t.message&&!t.args||t.stack)}let vv=!1;const mC=[];let hn=class rO{constructor(e={}){const n=e.types||gC;this.options=lG({...e,defaults:{...e.defaults},level:wv(e.level,n),reporters:[...e.reporters||[]]},{types:gC,throttle:1e3,throttleMin:5,formatOptions:{date:!0,colors:!1,compact:!0}});for(const r in n){const i={type:r,...this.options.defaults,...n[r]};this[r]=this._wrapLogFn(i),this[r].raw=this._wrapLogFn(i,!0)}this.options.mockFn&&this.mockTypes(),this._lastLog={}}get level(){return this.options.level}set level(e){this.options.level=wv(e,this.options.types,this.options.level)}prompt(e,n){if(!this.options.prompt)throw new Error("prompt is not supported!");return this.options.prompt(e,n)}create(e){const n=new rO({...this.options,...e});return this._mockFn&&n.mockTypes(this._mockFn),n}withDefaults(e){return this.create({...this.options,defaults:{...this.options.defaults,...e}})}withTag(e){return this.withDefaults({tag:this.options.defaults.tag?this.options.defaults.tag+":"+e:e})}addReporter(e){return this.options.reporters.push(e),this}removeReporter(e){if(e){const n=this.options.reporters.indexOf(e);if(n>=0)return this.options.reporters.splice(n,1)}else this.options.reporters.splice(0);return this}setReporters(e){return this.options.reporters=Array.isArray(e)?e:[e],this}wrapAll(){this.wrapConsole(),this.wrapStd()}restoreAll(){this.restoreConsole(),this.restoreStd()}wrapConsole(){for(const e in this.options.types)console["__"+e]||(console["__"+e]=console[e]),console[e]=this[e].raw}restoreConsole(){for(const e in this.options.types)console["__"+e]&&(console[e]=console["__"+e],delete console["__"+e])}wrapStd(){this._wrapStream(this.options.stdout,"log"),this._wrapStream(this.options.stderr,"log")}_wrapStream(e,n){e&&(e.__write||(e.__write=e.write),e.write=r=>{this[n].raw(String(r).trim())})}restoreStd(){this._restoreStream(this.options.stdout),this._restoreStream(this.options.stderr)}_restoreStream(e){e&&e.__write&&(e.write=e.__write,delete e.__write)}pauseLogs(){vv=!0}resumeLogs(){vv=!1;const e=mC.splice(0);for(const n of e)n[0]._logFn(n[1],n[2])}mockTypes(e){const n=e||this.options.mockFn;if(this._mockFn=n,typeof n=="function")for(const r in this.options.types)this[r]=n(r,this.options.types[r])||this[r],this[r].raw=this[r]}_wrapLogFn(e,n){return(...r)=>{if(vv){mC.push([this,e,r,n]);return}return this._logFn(e,r,n)}}_logFn(e,n,r){if((e.level||0)>this.level)return!1;const i={date:new Date,args:[],...e,level:wv(e.level,this.options.types)};!r&&n.length===1&&fG(n[0])?Object.assign(i,n[0]):i.args=[...n],i.message&&(i.args.unshift(i.message),delete i.message),i.additional&&(Array.isArray(i.additional)||(i.additional=i.additional.split(`
164
+ `)),i.args.push(`
165
+ `+i.additional.join(`
166
+ `)),delete i.additional),i.type=typeof i.type=="string"?i.type.toLowerCase():"log",i.tag=typeof i.tag=="string"?i.tag:"";const s=(a=!1)=>{const c=(this._lastLog.count||0)-this.options.throttleMin;if(this._lastLog.object&&c>0){const u=[...this._lastLog.object.args];c>1&&u.push(`(repeated ${c} times)`),this._log({...this._lastLog.object,args:u}),this._lastLog.count=1}a&&(this._lastLog.object=i,this._log(i))};clearTimeout(this._lastLog.timeout);const o=this._lastLog.time&&i.date?i.date.getTime()-this._lastLog.time.getTime():0;if(this._lastLog.time=i.date,o<this.options.throttle)try{const a=JSON.stringify([i.type,i.tag,i.args]),c=this._lastLog.serialized===a;if(this._lastLog.serialized=a,c&&(this._lastLog.count=(this._lastLog.count||0)+1,this._lastLog.count>this.options.throttleMin)){this._lastLog.timeout=setTimeout(s,this.options.throttle);return}}catch{}s(!0)}_log(e){for(const n of this.options.reporters)n.log(e,{options:this.options})}};function wv(t,e={},n=3){return t===void 0?n:typeof t=="number"?t:e[t]&&e[t].level!==void 0?e[t].level:n}hn.prototype.add=hn.prototype.addReporter,hn.prototype.remove=hn.prototype.removeReporter,hn.prototype.clear=hn.prototype.removeReporter,hn.prototype.withScope=hn.prototype.withTag,hn.prototype.mock=hn.prototype.mockTypes,hn.prototype.pause=hn.prototype.pauseLogs,hn.prototype.resume=hn.prototype.resumeLogs;function hG(t={}){return new hn(t)}function yC(t){const e=process.cwd()+lO;return t.split(`
167
+ `).splice(1).map(n=>n.trim().replace("file://","").replace(e,""))}function pG(t,e){return(e.__write||e.write).call(e,t)}const bv=t=>t?`[${t}]`:"";let vC=class{formatStack(e,n){return" "+yC(e).join(`
168
+ `)}formatArgs(e,n){const r=e.map(i=>i&&typeof i.stack=="string"?i.message+`
169
+ `+this.formatStack(i.stack,n):i);return mO(n,...r)}formatDate(e,n){return n.date?e.toLocaleTimeString():""}filterAndJoin(e){return e.filter(Boolean).join(" ")}formatLogObj(e,n){const r=this.formatArgs(e.args,n);return e.type==="box"?`
170
+ `+[bv(e.tag),e.title&&e.title,...r.split(`
171
+ `)].filter(Boolean).map(i=>" > "+i).join(`
172
+ `)+`
173
+ `:this.filterAndJoin([bv(e.type),bv(e.tag),r])}log(e,n){const r=this.formatLogObj(e,{columns:n.options.stdout.columns||0,...n.options.formatOptions});return pG(r+`
174
+ `,e.level<2?n.options.stderr||process.stderr:n.options.stdout||process.stdout)}};const{env:Xi={},argv:wC=[],platform:gG=""}=typeof process>"u"?{}:process,mG="NO_COLOR"in Xi||wC.includes("--no-color"),yG="FORCE_COLOR"in Xi||wC.includes("--color"),vG=gG==="win32",bC=Xi.TERM==="dumb",wG=fg&&fg.isatty&&fg.isatty(1)&&Xi.TERM&&!bC,bG="CI"in Xi&&("GITHUB_ACTIONS"in Xi||"GITLAB_CI"in Xi||"CIRCLECI"in Xi),EG=!mG&&(yG||vG&&!bC||wG||bG);function EC(t,e,n,r,i=e.slice(0,Math.max(0,t))+r,s=e.slice(Math.max(0,t+n.length)),o=s.indexOf(n)){return i+(o<0?s:EC(o,s,n,r))}function DG(t,e,n,r,i){return t<0?n+e+r:n+EC(t,e,r,i)+r}function TG(t,e,n=t,r=t.length+1){return i=>i||!(i===""||i===void 0)?DG((""+i).indexOf(e,r),i,t,e,n):""}function ke(t,e,n){return TG(`\x1B[${t}m`,`\x1B[${e}m`,n)}const DC={reset:ke(0,0),bold:ke(1,22,"\x1B[22m\x1B[1m"),dim:ke(2,22,"\x1B[22m\x1B[2m"),italic:ke(3,23),underline:ke(4,24),inverse:ke(7,27),hidden:ke(8,28),strikethrough:ke(9,29),black:ke(30,39),red:ke(31,39),green:ke(32,39),yellow:ke(33,39),blue:ke(34,39),magenta:ke(35,39),cyan:ke(36,39),white:ke(37,39),gray:ke(90,39),bgBlack:ke(40,49),bgRed:ke(41,49),bgGreen:ke(42,49),bgYellow:ke(43,49),bgBlue:ke(44,49),bgMagenta:ke(45,49),bgCyan:ke(46,49),bgWhite:ke(47,49),blackBright:ke(90,39),redBright:ke(91,39),greenBright:ke(92,39),yellowBright:ke(93,39),blueBright:ke(94,39),magentaBright:ke(95,39),cyanBright:ke(96,39),whiteBright:ke(97,39),bgBlackBright:ke(100,49),bgRedBright:ke(101,49),bgGreenBright:ke(102,49),bgYellowBright:ke(103,49),bgBlueBright:ke(104,49),bgMagentaBright:ke(105,49),bgCyanBright:ke(106,49),bgWhiteBright:ke(107,49)};function RG(t=EG){return t?DC:Object.fromEntries(Object.keys(DC).map(e=>[e,String]))}const pn=RG();function SG(t,e="reset"){return pn[t]||pn[e]}const kG=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");function _u(t){return t.replace(new RegExp(kG,"g"),"")}const TC={solid:{tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502"},double:{tl:"\u2554",tr:"\u2557",bl:"\u255A",br:"\u255D",h:"\u2550",v:"\u2551"},doubleSingle:{tl:"\u2553",tr:"\u2556",bl:"\u2559",br:"\u255C",h:"\u2500",v:"\u2551"},doubleSingleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2551"},singleThick:{tl:"\u250F",tr:"\u2513",bl:"\u2517",br:"\u251B",h:"\u2501",v:"\u2503"},singleDouble:{tl:"\u2552",tr:"\u2555",bl:"\u2558",br:"\u255B",h:"\u2550",v:"\u2502"},singleDoubleRounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2550",v:"\u2502"},rounded:{tl:"\u256D",tr:"\u256E",bl:"\u2570",br:"\u256F",h:"\u2500",v:"\u2502"}},$G={borderColor:"white",borderStyle:"rounded",valign:"center",padding:2,marginLeft:1,marginTop:1,marginBottom:1};function CG(t,e={}){const n={...e,style:{...$G,...e.style}},r=t.split(`
175
+ `),i=[],s=SG(n.style.borderColor),o={...typeof n.style.borderStyle=="string"?TC[n.style.borderStyle]||TC.solid:n.style.borderStyle};if(s)for(const h in o)o[h]=s(o[h]);const a=n.style.padding%2===0?n.style.padding:n.style.padding+1,c=r.length+a,u=Math.max(...r.map(h=>h.length))+a,l=u+a,d=n.style.marginLeft>0?" ".repeat(n.style.marginLeft):"";if(n.style.marginTop>0&&i.push("".repeat(n.style.marginTop)),n.title){const h=o.h.repeat(Math.floor((u-_u(n.title).length)/2)),p=o.h.repeat(u-_u(n.title).length-_u(h).length+a);i.push(`${d}${o.tl}${h}${n.title}${p}${o.tr}`)}else i.push(`${d}${o.tl}${o.h.repeat(l)}${o.tr}`);const f=n.style.valign==="center"?Math.floor((c-r.length)/2):n.style.valign==="top"?c-r.length-a:c-r.length;for(let h=0;h<c;h++)if(h<f||h>=f+r.length)i.push(`${d}${o.v}${" ".repeat(l)}${o.v}`);else{const p=r[h-f],g=" ".repeat(a),y=" ".repeat(u-_u(p).length);i.push(`${d}${o.v}${g}${p}${y}${o.v}`)}return i.push(`${d}${o.bl}${o.h.repeat(l)}${o.br}`),n.style.marginBottom>0&&i.push("".repeat(n.style.marginBottom)),i.join(`
176
+ `)}const _G=[["APPVEYOR"],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"]];function AG(t){for(const e of _G){const n=e[1]||e[0];if(t[n])return{name:e[0].toLowerCase(),...e[2]}}return t.SHELL&&t.SHELL==="/bin/jsh"?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const dh=typeof process<"u"?process:{},Au=dh.env||{},RC=AG(Au),xG=typeof process<"u"&&process.env&&process.env.NODE_ENV||"";dh.platform,RC.name;const IG=xu(Au.CI)||RC.ci!==!1;xu(dh.stdout&&dh.stdout.isTTY);const PG=xu(Au.DEBUG),SC=xG==="test"||xu(Au.TEST);xu(Au.MINIMAL);function xu(t){return t?t!=="false":!1}function NG({onlyFirst:t=!1}={}){const e=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?\\u0007)","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-ntqry=><~]))"].join("|");return new RegExp(e,t?void 0:"g")}const OG=NG();function FG(t){if(typeof t!="string")throw new TypeError(`Expected a \`string\`, got \`${typeof t}\``);return t.replace(OG,"")}function kC(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var $C={exports:{}};(function(t){var e={};t.exports=e,e.eastAsianWidth=function(r){var i=r.charCodeAt(0),s=r.length==2?r.charCodeAt(1):0,o=i;return 55296<=i&&i<=56319&&56320<=s&&s<=57343&&(i&=1023,s&=1023,o=i<<10|s,o+=65536),o==12288||65281<=o&&o<=65376||65504<=o&&o<=65510?"F":o==8361||65377<=o&&o<=65470||65474<=o&&o<=65479||65482<=o&&o<=65487||65490<=o&&o<=65495||65498<=o&&o<=65500||65512<=o&&o<=65518?"H":4352<=o&&o<=4447||4515<=o&&o<=4519||4602<=o&&o<=4607||9001<=o&&o<=9002||11904<=o&&o<=11929||11931<=o&&o<=12019||12032<=o&&o<=12245||12272<=o&&o<=12283||12289<=o&&o<=12350||12353<=o&&o<=12438||12441<=o&&o<=12543||12549<=o&&o<=12589||12593<=o&&o<=12686||12688<=o&&o<=12730||12736<=o&&o<=12771||12784<=o&&o<=12830||12832<=o&&o<=12871||12880<=o&&o<=13054||13056<=o&&o<=19903||19968<=o&&o<=42124||42128<=o&&o<=42182||43360<=o&&o<=43388||44032<=o&&o<=55203||55216<=o&&o<=55238||55243<=o&&o<=55291||63744<=o&&o<=64255||65040<=o&&o<=65049||65072<=o&&o<=65106||65108<=o&&o<=65126||65128<=o&&o<=65131||110592<=o&&o<=110593||127488<=o&&o<=127490||127504<=o&&o<=127546||127552<=o&&o<=127560||127568<=o&&o<=127569||131072<=o&&o<=194367||177984<=o&&o<=196605||196608<=o&&o<=262141?"W":32<=o&&o<=126||162<=o&&o<=163||165<=o&&o<=166||o==172||o==175||10214<=o&&o<=10221||10629<=o&&o<=10630?"Na":o==161||o==164||167<=o&&o<=168||o==170||173<=o&&o<=174||176<=o&&o<=180||182<=o&&o<=186||188<=o&&o<=191||o==198||o==208||215<=o&&o<=216||222<=o&&o<=225||o==230||232<=o&&o<=234||236<=o&&o<=237||o==240||242<=o&&o<=243||247<=o&&o<=250||o==252||o==254||o==257||o==273||o==275||o==283||294<=o&&o<=295||o==299||305<=o&&o<=307||o==312||319<=o&&o<=322||o==324||328<=o&&o<=331||o==333||338<=o&&o<=339||358<=o&&o<=359||o==363||o==462||o==464||o==466||o==468||o==470||o==472||o==474||o==476||o==593||o==609||o==708||o==711||713<=o&&o<=715||o==717||o==720||728<=o&&o<=731||o==733||o==735||768<=o&&o<=879||913<=o&&o<=929||931<=o&&o<=937||945<=o&&o<=961||963<=o&&o<=969||o==1025||1040<=o&&o<=1103||o==1105||o==8208||8211<=o&&o<=8214||8216<=o&&o<=8217||8220<=o&&o<=8221||8224<=o&&o<=8226||8228<=o&&o<=8231||o==8240||8242<=o&&o<=8243||o==8245||o==8251||o==8254||o==8308||o==8319||8321<=o&&o<=8324||o==8364||o==8451||o==8453||o==8457||o==8467||o==8470||8481<=o&&o<=8482||o==8486||o==8491||8531<=o&&o<=8532||8539<=o&&o<=8542||8544<=o&&o<=8555||8560<=o&&o<=8569||o==8585||8592<=o&&o<=8601||8632<=o&&o<=8633||o==8658||o==8660||o==8679||o==8704||8706<=o&&o<=8707||8711<=o&&o<=8712||o==8715||o==8719||o==8721||o==8725||o==8730||8733<=o&&o<=8736||o==8739||o==8741||8743<=o&&o<=8748||o==8750||8756<=o&&o<=8759||8764<=o&&o<=8765||o==8776||o==8780||o==8786||8800<=o&&o<=8801||8804<=o&&o<=8807||8810<=o&&o<=8811||8814<=o&&o<=8815||8834<=o&&o<=8835||8838<=o&&o<=8839||o==8853||o==8857||o==8869||o==8895||o==8978||9312<=o&&o<=9449||9451<=o&&o<=9547||9552<=o&&o<=9587||9600<=o&&o<=9615||9618<=o&&o<=9621||9632<=o&&o<=9633||9635<=o&&o<=9641||9650<=o&&o<=9651||9654<=o&&o<=9655||9660<=o&&o<=9661||9664<=o&&o<=9665||9670<=o&&o<=9672||o==9675||9678<=o&&o<=9681||9698<=o&&o<=9701||o==9711||9733<=o&&o<=9734||o==9737||9742<=o&&o<=9743||9748<=o&&o<=9749||o==9756||o==9758||o==9792||o==9794||9824<=o&&o<=9825||9827<=o&&o<=9829||9831<=o&&o<=9834||9836<=o&&o<=9837||o==9839||9886<=o&&o<=9887||9918<=o&&o<=9919||9924<=o&&o<=9933||9935<=o&&o<=9953||o==9955||9960<=o&&o<=9983||o==10045||o==10071||10102<=o&&o<=10111||11093<=o&&o<=11097||12872<=o&&o<=12879||57344<=o&&o<=63743||65024<=o&&o<=65039||o==65533||127232<=o&&o<=127242||127248<=o&&o<=127277||127280<=o&&o<=127337||127344<=o&&o<=127386||917760<=o&&o<=917999||983040<=o&&o<=1048573||1048576<=o&&o<=1114109?"A":"N"},e.characterLength=function(r){var i=this.eastAsianWidth(r);return i=="F"||i=="W"||i=="A"?2:1};function n(r){return r.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}e.length=function(r){for(var i=n(r),s=0,o=0;o<i.length;o++)s=s+this.characterLength(i[o]);return s},e.slice=function(r,i,s){textLen=e.length(r),i=i||0,s=s||1,i<0&&(i=textLen+i),s<0&&(s=textLen+s);for(var o="",a=0,c=n(r),u=0;u<c.length;u++){var l=c[u],d=e.length(l);if(a>=i-(d==2?1:0))if(a+d<=s)o+=l;else break;a+=d}return o}})($C);var LG=$C.exports;const MG=kC(LG),zG=()=>/[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g;function BG(t,e){if(typeof t!="string"||t.length===0||(e={ambiguousIsNarrow:!0,countAnsiEscapeCodes:!1,...e},e.countAnsiEscapeCodes||(t=FG(t)),t.length===0))return 0;const n=e.ambiguousIsNarrow?1:2;let r=0;for(const{segment:i}of new Intl.Segmenter().segment(t)){const s=i.codePointAt(0);if(!(s<=31||s>=127&&s<=159||s>=768&&s<=879)){if(zG().test(i)){r+=2;continue}switch(MG.eastAsianWidth(i)){case"F":case"W":{r+=2;break}case"A":{r+=n;break}default:r+=1}}}return r}function CC(){return Ne.platform!=="win32"?Ne.env.TERM!=="linux":!!Ne.env.CI||!!Ne.env.WT_SESSION||!!Ne.env.TERMINUS_SUBLIME||Ne.env.ConEmuTask==="{cmd::Cmder}"||Ne.env.TERM_PROGRAM==="Terminus-Sublime"||Ne.env.TERM_PROGRAM==="vscode"||Ne.env.TERM==="xterm-256color"||Ne.env.TERM==="alacritty"||Ne.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const qG={info:"cyan",fail:"red",success:"green",ready:"green",start:"magenta"},jG={0:"red",1:"yellow"},UG=CC(),Ur=(t,e)=>UG?t:e,_C={error:Ur("\u2716","\xD7"),fatal:Ur("\u2716","\xD7"),ready:Ur("\u2714","\u221A"),warn:Ur("\u26A0","\u203C"),info:Ur("\u2139","i"),success:Ur("\u2714","\u221A"),debug:Ur("\u2699","D"),trace:Ur("\u2192","\u2192"),fail:Ur("\u2716","\xD7"),start:Ur("\u25D0","o"),log:""};function AC(t){return Intl.Segmenter?BG(t):_u(t).length}class GG extends vC{formatStack(e){return`
177
+ `+yC(e).map(n=>" "+n.replace(/^at +/,r=>pn.gray(r)).replace(/\((.+)\)/,(r,i)=>`(${pn.cyan(i)})`)).join(`
178
+ `)}formatType(e,n,r){const i=qG[e.type]||jG[e.level]||"gray";if(n)return HG(i)(pn.black(` ${e.type.toUpperCase()} `));const s=typeof _C[e.type]=="string"?_C[e.type]:e.icon||e.type;return s?WG(i)(s):""}formatLogObj(e,n){const[r,...i]=this.formatArgs(e.args,n).split(`
179
+ `);if(e.type==="box")return CG(fh(r+(i.length>0?`
180
+ `+i.join(`
181
+ `):"")),{title:e.title?fh(e.title):void 0,style:e.style});const s=this.formatDate(e.date,n),o=s&&pn.gray(s),a=e.badge??e.level<2,c=this.formatType(e,a,n),u=e.tag?pn.gray(e.tag):"";let l;const d=this.filterAndJoin([c,fh(r)]),f=this.filterAndJoin(n.columns?[u,o]:[u]),h=(n.columns||0)-AC(d)-AC(f)-2;if(l=h>0&&(n.columns||0)>=80?d+" ".repeat(h)+f:(f?`${pn.gray(`[${f}]`)} `:"")+d,l+=fh(i.length>0?`
182
+ `+i.join(`
183
+ `):""),e.type==="trace"){const p=new Error("Trace: "+e.message);l+=this.formatStack(p.stack||"")}return a?`
184
+ `+l+`
185
+ `:l}}function fh(t){return t.replace(/`([^`]+)`/gm,(e,n)=>pn.cyan(n)).replace(/\s+_([^_]+)_\s+/gm,(e,n)=>` ${pn.underline(n)} `)}function WG(t="white"){return pn[t]||pn.white}function HG(t="bgWhite"){return pn[`bg${t[0].toUpperCase()}${t.slice(1)}`]||pn.bgWhite}function xC(t={}){let e=VG();return process.env.CONSOLA_LEVEL&&(e=Number.parseInt(process.env.CONSOLA_LEVEL)??e),hG({level:e,defaults:{level:e},stdout:process.stdout,stderr:process.stderr,prompt:(...n)=>import("../chunks/prompt.mjs").then(r=>r.prompt(...n)),reporters:t.reporters||[t.fancy??!(IG||SC)?new GG:new vC],...t})}function VG(){return PG?Xe.debug:SC?Xe.warn:Xe.info}xC();function KG(){return Xe.debug}const IC=KG(),et=xC({level:IC,defaults:{level:IC},formatOptions:{colors:!0,compact:!1,date:!1}});function YG(t,e=1,n={}){const{indent:r=" ",includeEmptyLines:i=!1}=n;if(typeof t!="string")throw new TypeError(`Expected \`input\` to be a \`string\`, got \`${typeof t}\``);if(typeof e!="number")throw new TypeError(`Expected \`count\` to be a \`number\`, got \`${typeof e}\``);if(e<0)throw new RangeError(`Expected \`count\` to be at least 0, got \`${e}\``);if(typeof r!="string")throw new TypeError(`Expected \`options.indent\` to be a \`string\`, got \`${typeof r}\``);if(e===0)return t;const s=i?/^/gm:/^(?!\s*$)/gm;return t.replace(s,r.repeat(e))}function XG(t){for(var e=t.length,n=0,r=0;r<e;){var i=t.charCodeAt(r++);if(i&4294967168)if(!(i&4294965248))n+=2;else{if(i>=55296&&i<=56319&&r<e){var s=t.charCodeAt(r);(s&64512)===56320&&(++r,i=((i&1023)<<10)+(s&1023)+65536)}i&4294901760?n+=4:n+=3}else{n++;continue}}return n}function JG(t,e,n){for(var r=t.length,i=n,s=0;s<r;){var o=t.charCodeAt(s++);if(o&4294967168)if(!(o&4294965248))e[i++]=o>>6&31|192;else{if(o>=55296&&o<=56319&&s<r){var a=t.charCodeAt(s);(a&64512)===56320&&(++s,o=((o&1023)<<10)+(a&1023)+65536)}o&4294901760?(e[i++]=o>>18&7|240,e[i++]=o>>12&63|128,e[i++]=o>>6&63|128):(e[i++]=o>>12&15|224,e[i++]=o>>6&63|128)}else{e[i++]=o;continue}e[i++]=o&63|128}}var ZG=new TextEncoder,QG=50;function eW(t,e,n){ZG.encodeInto(t,e.subarray(n))}function tW(t,e,n){t.length>QG?eW(t,e,n):JG(t,e,n)}var nW=4096;function PC(t,e,n){for(var r=e,i=r+n,s=[],o="";r<i;){var a=t[r++];if(!(a&128))s.push(a);else if((a&224)===192){var c=t[r++]&63;s.push((a&31)<<6|c)}else if((a&240)===224){var c=t[r++]&63,u=t[r++]&63;s.push((a&31)<<12|c<<6|u)}else if((a&248)===240){var c=t[r++]&63,u=t[r++]&63,l=t[r++]&63,d=(a&7)<<18|c<<12|u<<6|l;d>65535&&(d-=65536,s.push(d>>>10&1023|55296),d=56320|d&1023),s.push(d)}else s.push(a);s.length>=nW&&(o+=String.fromCharCode.apply(String,s),s.length=0)}return s.length>0&&(o+=String.fromCharCode.apply(String,s)),o}var rW=new TextDecoder,iW=200;function sW(t,e,n){var r=t.subarray(e,e+n);return rW.decode(r)}function oW(t,e,n){return n>iW?sW(t,e,n):PC(t,e,n)}var hh=function(){function t(e,n){this.type=e,this.data=n}return t}(),aW=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(r[s]=i[s])},t(e,n)};return function(e,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");t(e,n);function r(){this.constructor=e}e.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}(),Gr=function(t){aW(e,t);function e(n){var r=t.call(this,n)||this,i=Object.create(e.prototype);return Object.setPrototypeOf(r,i),Object.defineProperty(r,"name",{configurable:!0,enumerable:!1,value:e.name}),r}return e}(Error),Iu=4294967295;function cW(t,e,n){var r=n/4294967296,i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function NC(t,e,n){var r=Math.floor(n/4294967296),i=n;t.setUint32(e,r),t.setUint32(e+4,i)}function OC(t,e){var n=t.getInt32(e),r=t.getUint32(e+4);return n*4294967296+r}function uW(t,e){var n=t.getUint32(e),r=t.getUint32(e+4);return n*4294967296+r}var lW=-1,dW=4294967296-1,fW=17179869184-1;function hW(t){var e=t.sec,n=t.nsec;if(e>=0&&n>=0&&e<=fW)if(n===0&&e<=dW){var r=new Uint8Array(4),i=new DataView(r.buffer);return i.setUint32(0,e),r}else{var s=e/4294967296,o=e&4294967295,r=new Uint8Array(8),i=new DataView(r.buffer);return i.setUint32(0,n<<2|s&3),i.setUint32(4,o),r}else{var r=new Uint8Array(12),i=new DataView(r.buffer);return i.setUint32(0,n),NC(i,4,e),r}}function pW(t){var e=t.getTime(),n=Math.floor(e/1e3),r=(e-n*1e3)*1e6,i=Math.floor(r/1e9);return{sec:n+i,nsec:r-i*1e9}}function gW(t){if(t instanceof Date){var e=pW(t);return hW(e)}else return null}function mW(t){var e=new DataView(t.buffer,t.byteOffset,t.byteLength);switch(t.byteLength){case 4:{var n=e.getUint32(0),r=0;return{sec:n,nsec:r}}case 8:{var i=e.getUint32(0),s=e.getUint32(4),n=(i&3)*4294967296+s,r=i>>>2;return{sec:n,nsec:r}}case 12:{var n=OC(e,4),r=e.getUint32(0);return{sec:n,nsec:r}}default:throw new Gr("Unrecognized data size for timestamp (expected 4, 8, or 12): ".concat(t.length))}}function yW(t){var e=mW(t);return new Date(e.sec*1e3+e.nsec/1e6)}var vW={type:lW,encode:gW,decode:yW},FC=function(){function t(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(vW)}return t.prototype.register=function(e){var n=e.type,r=e.encode,i=e.decode;if(n>=0)this.encoders[n]=r,this.decoders[n]=i;else{var s=1+n;this.builtInEncoders[s]=r,this.builtInDecoders[s]=i}},t.prototype.tryToEncode=function(e,n){for(var r=0;r<this.builtInEncoders.length;r++){var i=this.builtInEncoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=-1-r;return new hh(o,s)}}}for(var r=0;r<this.encoders.length;r++){var i=this.encoders[r];if(i!=null){var s=i(e,n);if(s!=null){var o=r;return new hh(o,s)}}}return e instanceof hh?e:null},t.prototype.decode=function(e,n,r){var i=n<0?this.builtInDecoders[-1-n]:this.decoders[n];return i?i(e,n,r):new hh(n,e)},t.defaultCodec=new t,t}();function ph(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}function wW(t){if(t instanceof ArrayBuffer)return new DataView(t);var e=ph(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}var bW=100,EW=2048,DW=function(){function t(e){var n,r,i,s,o,a,c,u;this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:FC.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxDepth=(i=e?.maxDepth)!==null&&i!==void 0?i:bW,this.initialBufferSize=(s=e?.initialBufferSize)!==null&&s!==void 0?s:EW,this.sortKeys=(o=e?.sortKeys)!==null&&o!==void 0?o:!1,this.forceFloat32=(a=e?.forceFloat32)!==null&&a!==void 0?a:!1,this.ignoreUndefined=(c=e?.ignoreUndefined)!==null&&c!==void 0?c:!1,this.forceIntegerToFloat=(u=e?.forceIntegerToFloat)!==null&&u!==void 0?u:!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}return t.prototype.reinitializeState=function(){this.pos=0},t.prototype.encodeSharedRef=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)},t.prototype.encode=function(e){return this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)},t.prototype.doEncode=function(e,n){if(n>this.maxDepth)throw new Error("Too deep objects in depth ".concat(n));e==null?this.encodeNil():typeof e=="boolean"?this.encodeBoolean(e):typeof e=="number"?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):typeof e=="string"?this.encodeString(e):this.useBigInt64&&typeof e=="bigint"?this.encodeBigInt64(e):this.encodeObject(e,n)},t.prototype.ensureBufferSizeToWrite=function(e){var n=this.pos+e;this.view.byteLength<n&&this.resizeBuffer(n*2)},t.prototype.resizeBuffer=function(e){var n=new ArrayBuffer(e),r=new Uint8Array(n),i=new DataView(n);r.set(this.bytes),this.view=i,this.bytes=r},t.prototype.encodeNil=function(){this.writeU8(192)},t.prototype.encodeBoolean=function(e){e===!1?this.writeU8(194):this.writeU8(195)},t.prototype.encodeNumber=function(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<4294967296?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-2147483648?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)},t.prototype.encodeNumberAsFloat=function(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))},t.prototype.encodeBigInt64=function(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))},t.prototype.writeStringHeader=function(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<4294967296)this.writeU8(219),this.writeU32(e);else throw new Error("Too long string: ".concat(e," bytes in UTF-8"))},t.prototype.encodeString=function(e){var n=5,r=XG(e);this.ensureBufferSizeToWrite(n+r),this.writeStringHeader(r),tW(e,this.bytes,this.pos),this.pos+=r},t.prototype.encodeObject=function(e,n){var r=this.extensionCodec.tryToEncode(e,this.context);if(r!=null)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,n);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if(typeof e=="object")this.encodeMap(e,n);else throw new Error("Unrecognized object: ".concat(Object.prototype.toString.apply(e)))},t.prototype.encodeBinary=function(e){var n=e.byteLength;if(n<256)this.writeU8(196),this.writeU8(n);else if(n<65536)this.writeU8(197),this.writeU16(n);else if(n<4294967296)this.writeU8(198),this.writeU32(n);else throw new Error("Too large binary: ".concat(n));var r=ph(e);this.writeU8a(r)},t.prototype.encodeArray=function(e,n){var r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<4294967296)this.writeU8(221),this.writeU32(r);else throw new Error("Too large array: ".concat(r));for(var i=0,s=e;i<s.length;i++){var o=s[i];this.doEncode(o,n+1)}},t.prototype.countWithoutUndefined=function(e,n){for(var r=0,i=0,s=n;i<s.length;i++){var o=s[i];e[o]!==void 0&&r++}return r},t.prototype.encodeMap=function(e,n){var r=Object.keys(e);this.sortKeys&&r.sort();var i=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(i<16)this.writeU8(128+i);else if(i<65536)this.writeU8(222),this.writeU16(i);else if(i<4294967296)this.writeU8(223),this.writeU32(i);else throw new Error("Too large map object: ".concat(i));for(var s=0,o=r;s<o.length;s++){var a=o[s],c=e[a];this.ignoreUndefined&&c===void 0||(this.encodeString(a),this.doEncode(c,n+1))}},t.prototype.encodeExtension=function(e){var n=e.data.length;if(n===1)this.writeU8(212);else if(n===2)this.writeU8(213);else if(n===4)this.writeU8(214);else if(n===8)this.writeU8(215);else if(n===16)this.writeU8(216);else if(n<256)this.writeU8(199),this.writeU8(n);else if(n<65536)this.writeU8(200),this.writeU16(n);else if(n<4294967296)this.writeU8(201),this.writeU32(n);else throw new Error("Too large extension object: ".concat(n));this.writeI8(e.type),this.writeU8a(e.data)},t.prototype.writeU8=function(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++},t.prototype.writeU8a=function(e){var n=e.length;this.ensureBufferSizeToWrite(n),this.bytes.set(e,this.pos),this.pos+=n},t.prototype.writeI8=function(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++},t.prototype.writeU16=function(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2},t.prototype.writeI16=function(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2},t.prototype.writeU32=function(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4},t.prototype.writeI32=function(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4},t.prototype.writeF32=function(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4},t.prototype.writeF64=function(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8},t.prototype.writeU64=function(e){this.ensureBufferSizeToWrite(8),cW(this.view,this.pos,e),this.pos+=8},t.prototype.writeI64=function(e){this.ensureBufferSizeToWrite(8),NC(this.view,this.pos,e),this.pos+=8},t.prototype.writeBigUint64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8},t.prototype.writeBigInt64=function(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8},t}();function TW(t,e){var n=new DW(e);return n.encodeSharedRef(t)}function Ev(t){return"".concat(t<0?"-":"","0x").concat(Math.abs(t).toString(16).padStart(2,"0"))}var RW=16,SW=16,kW=function(){function t(e,n){e===void 0&&(e=RW),n===void 0&&(n=SW),this.maxKeyLength=e,this.maxLengthPerKey=n,this.hit=0,this.miss=0,this.caches=[];for(var r=0;r<this.maxKeyLength;r++)this.caches.push([])}return t.prototype.canBeCached=function(e){return e>0&&e<=this.maxKeyLength},t.prototype.find=function(e,n,r){var i=this.caches[r-1];e:for(var s=0,o=i;s<o.length;s++){for(var a=o[s],c=a.bytes,u=0;u<r;u++)if(c[u]!==e[n+u])continue e;return a.str}return null},t.prototype.store=function(e,n){var r=this.caches[e.length-1],i={bytes:e,str:n};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=i:r.push(i)},t.prototype.decode=function(e,n,r){var i=this.find(e,n,r);if(i!=null)return this.hit++,i;this.miss++;var s=PC(e,n,r),o=Uint8Array.prototype.slice.call(e,n,n+r);return this.store(o,s),s},t}(),$W=function(t,e,n,r){function i(s){return s instanceof n?s:new n(function(o){o(s)})}return new(n||(n=Promise))(function(s,o){function a(l){try{u(r.next(l))}catch(d){o(d)}}function c(l){try{u(r.throw(l))}catch(d){o(d)}}function u(l){l.done?s(l.value):i(l.value).then(a,c)}u((r=r.apply(t,e||[])).next())})},Dv=function(t,e){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},r,i,s,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(u){return function(l){return c([u,l])}}function c(u){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,u[0]&&(n=0)),n;)try{if(r=1,i&&(s=u[0]&2?i.return:u[0]?i.throw||((s=i.return)&&s.call(i),0):i.next)&&!(s=s.call(i,u[1])).done)return s;switch(i=0,s&&(u=[u[0]&2,s.value]),u[0]){case 0:case 1:s=u;break;case 4:return n.label++,{value:u[1],done:!1};case 5:n.label++,i=u[1],u=[0];continue;case 7:u=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(u[0]===6||u[0]===2)){n=0;continue}if(u[0]===3&&(!s||u[1]>s[0]&&u[1]<s[3])){n.label=u[1];break}if(u[0]===6&&n.label<s[1]){n.label=s[1],s=u;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(u);break}s[2]&&n.ops.pop(),n.trys.pop();continue}u=e.call(t,n)}catch(l){u=[6,l],i=0}finally{r=s=0}if(u[0]&5)throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}},LC=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],n;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(s){n[s]=t[s]&&function(o){return new Promise(function(a,c){o=t[s](o),i(a,c,o.done,o.value)})}}function i(s,o,a,c){Promise.resolve(c).then(function(u){s({value:u,done:a})},o)}},ca=function(t){return this instanceof ca?(this.v=t,this):new ca(t)},CW=function(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r=n.apply(t,e||[]),i,s=[];return i={},o("next"),o("throw"),o("return"),i[Symbol.asyncIterator]=function(){return this},i;function o(f){r[f]&&(i[f]=function(h){return new Promise(function(p,g){s.push([f,h,p,g])>1||a(f,h)})})}function a(f,h){try{c(r[f](h))}catch(p){d(s[0][3],p)}}function c(f){f.value instanceof ca?Promise.resolve(f.value.v).then(u,l):d(s[0][2],f)}function u(f){a("next",f)}function l(f){a("throw",f)}function d(f,h){f(h),s.shift(),s.length&&a(s[0][0],s[0][1])}},MC="array",gh="map_key",_W="map_value",AW=function(t){return typeof t=="string"||typeof t=="number"},Pu=-1,Tv=new DataView(new ArrayBuffer(0)),xW=new Uint8Array(Tv.buffer);try{Tv.getInt8(0)}catch(t){if(!(t instanceof RangeError))throw new Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}var Rv=RangeError,zC=new Rv("Insufficient data"),IW=new kW,PW=function(){function t(e){var n,r,i,s,o,a,c;this.totalPos=0,this.pos=0,this.view=Tv,this.bytes=xW,this.headByte=Pu,this.stack=[],this.extensionCodec=(n=e?.extensionCodec)!==null&&n!==void 0?n:FC.defaultCodec,this.context=e?.context,this.useBigInt64=(r=e?.useBigInt64)!==null&&r!==void 0?r:!1,this.maxStrLength=(i=e?.maxStrLength)!==null&&i!==void 0?i:Iu,this.maxBinLength=(s=e?.maxBinLength)!==null&&s!==void 0?s:Iu,this.maxArrayLength=(o=e?.maxArrayLength)!==null&&o!==void 0?o:Iu,this.maxMapLength=(a=e?.maxMapLength)!==null&&a!==void 0?a:Iu,this.maxExtLength=(c=e?.maxExtLength)!==null&&c!==void 0?c:Iu,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:IW}return t.prototype.reinitializeState=function(){this.totalPos=0,this.headByte=Pu,this.stack.length=0},t.prototype.setBuffer=function(e){this.bytes=ph(e),this.view=wW(this.bytes),this.pos=0},t.prototype.appendBuffer=function(e){if(this.headByte===Pu&&!this.hasRemaining(1))this.setBuffer(e);else{var n=this.bytes.subarray(this.pos),r=ph(e),i=new Uint8Array(n.length+r.length);i.set(n),i.set(r,n.length),this.setBuffer(i)}},t.prototype.hasRemaining=function(e){return this.view.byteLength-this.pos>=e},t.prototype.createExtraByteError=function(e){var n=this,r=n.view,i=n.pos;return new RangeError("Extra ".concat(r.byteLength-i," of ").concat(r.byteLength," byte(s) found at buffer[").concat(e,"]"))},t.prototype.decode=function(e){this.reinitializeState(),this.setBuffer(e);var n=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return n},t.prototype.decodeMulti=function(e){return Dv(this,function(n){switch(n.label){case 0:this.reinitializeState(),this.setBuffer(e),n.label=1;case 1:return this.hasRemaining(1)?[4,this.doDecodeSync()]:[3,3];case 2:return n.sent(),[3,1];case 3:return[2]}})},t.prototype.decodeAsync=function(e){var n,r,i,s,o,a,c;return $W(this,void 0,void 0,function(){var u,l,d,f,h,p,g,y;return Dv(this,function(m){switch(m.label){case 0:u=!1,m.label=1;case 1:m.trys.push([1,6,7,12]),n=!0,r=LC(e),m.label=2;case 2:return[4,r.next()];case 3:if(i=m.sent(),s=i.done,!!s)return[3,5];c=i.value,n=!1;try{if(d=c,u)throw this.createExtraByteError(this.totalPos);this.appendBuffer(d);try{l=this.doDecodeSync(),u=!0}catch(w){if(!(w instanceof Rv))throw w}this.totalPos+=this.pos}finally{n=!0}m.label=4;case 4:return[3,2];case 5:return[3,12];case 6:return f=m.sent(),o={error:f},[3,12];case 7:return m.trys.push([7,,10,11]),!n&&!s&&(a=r.return)?[4,a.call(r)]:[3,9];case 8:m.sent(),m.label=9;case 9:return[3,11];case 10:if(o)throw o.error;return[7];case 11:return[7];case 12:if(u){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return[2,l]}throw h=this,p=h.headByte,g=h.pos,y=h.totalPos,new RangeError("Insufficient data in parsing ".concat(Ev(p)," at ").concat(y," (").concat(g," in the current buffer)"))}})})},t.prototype.decodeArrayStream=function(e){return this.decodeMultiAsync(e,!0)},t.prototype.decodeStream=function(e){return this.decodeMultiAsync(e,!1)},t.prototype.decodeMultiAsync=function(e,n){return CW(this,arguments,function(){var i,s,o,a,c,u,l,d,f,h,p,g;return Dv(this,function(y){switch(y.label){case 0:i=n,s=-1,y.label=1;case 1:y.trys.push([1,15,16,21]),o=!0,a=LC(e),y.label=2;case 2:return[4,ca(a.next())];case 3:if(c=y.sent(),f=c.done,!!f)return[3,14];g=c.value,o=!1,y.label=4;case 4:if(y.trys.push([4,,12,13]),u=g,n&&s===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(u),i&&(s=this.readArraySize(),i=!1,this.complete()),y.label=5;case 5:y.trys.push([5,10,,11]),y.label=6;case 6:return[4,ca(this.doDecodeSync())];case 7:return[4,y.sent()];case 8:return y.sent(),--s===0?[3,9]:[3,6];case 9:return[3,11];case 10:if(l=y.sent(),!(l instanceof Rv))throw l;return[3,11];case 11:return this.totalPos+=this.pos,[3,13];case 12:return o=!0,[7];case 13:return[3,2];case 14:return[3,21];case 15:return d=y.sent(),h={error:d},[3,21];case 16:return y.trys.push([16,,19,20]),!o&&!f&&(p=a.return)?[4,ca(p.call(a))]:[3,18];case 17:y.sent(),y.label=18;case 18:return[3,20];case 19:if(h)throw h.error;return[7];case 20:return[7];case 21:return[2]}})})},t.prototype.doDecodeSync=function(){e:for(;;){var e=this.readHeadByte(),n=void 0;if(e>=224)n=e-256;else if(e<192)if(e<128)n=e;else if(e<144){var r=e-128;if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e<160){var r=e-144;if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else{var i=e-160;n=this.decodeUtf8String(i,0)}else if(e===192)n=null;else if(e===194)n=!1;else if(e===195)n=!0;else if(e===202)n=this.readF32();else if(e===203)n=this.readF64();else if(e===204)n=this.readU8();else if(e===205)n=this.readU16();else if(e===206)n=this.readU32();else if(e===207)this.useBigInt64?n=this.readU64AsBigInt():n=this.readU64();else if(e===208)n=this.readI8();else if(e===209)n=this.readI16();else if(e===210)n=this.readI32();else if(e===211)this.useBigInt64?n=this.readI64AsBigInt():n=this.readI64();else if(e===217){var i=this.lookU8();n=this.decodeUtf8String(i,1)}else if(e===218){var i=this.lookU16();n=this.decodeUtf8String(i,2)}else if(e===219){var i=this.lookU32();n=this.decodeUtf8String(i,4)}else if(e===220){var r=this.readU16();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===221){var r=this.readU32();if(r!==0){this.pushArrayState(r),this.complete();continue e}else n=[]}else if(e===222){var r=this.readU16();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===223){var r=this.readU32();if(r!==0){this.pushMapState(r),this.complete();continue e}else n={}}else if(e===196){var r=this.lookU8();n=this.decodeBinary(r,1)}else if(e===197){var r=this.lookU16();n=this.decodeBinary(r,2)}else if(e===198){var r=this.lookU32();n=this.decodeBinary(r,4)}else if(e===212)n=this.decodeExtension(1,0);else if(e===213)n=this.decodeExtension(2,0);else if(e===214)n=this.decodeExtension(4,0);else if(e===215)n=this.decodeExtension(8,0);else if(e===216)n=this.decodeExtension(16,0);else if(e===199){var r=this.lookU8();n=this.decodeExtension(r,1)}else if(e===200){var r=this.lookU16();n=this.decodeExtension(r,2)}else if(e===201){var r=this.lookU32();n=this.decodeExtension(r,4)}else throw new Gr("Unrecognized type byte: ".concat(Ev(e)));this.complete();for(var s=this.stack;s.length>0;){var o=s[s.length-1];if(o.type===MC)if(o.array[o.position]=n,o.position++,o.position===o.size)s.pop(),n=o.array;else continue e;else if(o.type===gh){if(!AW(n))throw new Gr("The type of key must be string or number but "+typeof n);if(n==="__proto__")throw new Gr("The key __proto__ is not allowed");o.key=n,o.type=_W;continue e}else if(o.map[o.key]=n,o.readCount++,o.readCount===o.size)s.pop(),n=o.map;else{o.key=null,o.type=gh;continue e}}return n}},t.prototype.readHeadByte=function(){return this.headByte===Pu&&(this.headByte=this.readU8()),this.headByte},t.prototype.complete=function(){this.headByte=Pu},t.prototype.readArraySize=function(){var e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:{if(e<160)return e-144;throw new Gr("Unrecognized array type byte: ".concat(Ev(e)))}}},t.prototype.pushMapState=function(e){if(e>this.maxMapLength)throw new Gr("Max length exceeded: map length (".concat(e,") > maxMapLengthLength (").concat(this.maxMapLength,")"));this.stack.push({type:gh,size:e,key:null,readCount:0,map:{}})},t.prototype.pushArrayState=function(e){if(e>this.maxArrayLength)throw new Gr("Max length exceeded: array length (".concat(e,") > maxArrayLength (").concat(this.maxArrayLength,")"));this.stack.push({type:MC,size:e,array:new Array(e),position:0})},t.prototype.decodeUtf8String=function(e,n){var r;if(e>this.maxStrLength)throw new Gr("Max length exceeded: UTF-8 byte length (".concat(e,") > maxStrLength (").concat(this.maxStrLength,")"));if(this.bytes.byteLength<this.pos+n+e)throw zC;var i=this.pos+n,s;return this.stateIsMapKey()&&(!((r=this.keyDecoder)===null||r===void 0)&&r.canBeCached(e))?s=this.keyDecoder.decode(this.bytes,i,e):s=oW(this.bytes,i,e),this.pos+=n+e,s},t.prototype.stateIsMapKey=function(){if(this.stack.length>0){var e=this.stack[this.stack.length-1];return e.type===gh}return!1},t.prototype.decodeBinary=function(e,n){if(e>this.maxBinLength)throw new Gr("Max length exceeded: bin length (".concat(e,") > maxBinLength (").concat(this.maxBinLength,")"));if(!this.hasRemaining(e+n))throw zC;var r=this.pos+n,i=this.bytes.subarray(r,r+e);return this.pos+=n+e,i},t.prototype.decodeExtension=function(e,n){if(e>this.maxExtLength)throw new Gr("Max length exceeded: ext length (".concat(e,") > maxExtLength (").concat(this.maxExtLength,")"));var r=this.view.getInt8(this.pos+n),i=this.decodeBinary(e,n+1);return this.extensionCodec.decode(i,r,this.context)},t.prototype.lookU8=function(){return this.view.getUint8(this.pos)},t.prototype.lookU16=function(){return this.view.getUint16(this.pos)},t.prototype.lookU32=function(){return this.view.getUint32(this.pos)},t.prototype.readU8=function(){var e=this.view.getUint8(this.pos);return this.pos++,e},t.prototype.readI8=function(){var e=this.view.getInt8(this.pos);return this.pos++,e},t.prototype.readU16=function(){var e=this.view.getUint16(this.pos);return this.pos+=2,e},t.prototype.readI16=function(){var e=this.view.getInt16(this.pos);return this.pos+=2,e},t.prototype.readU32=function(){var e=this.view.getUint32(this.pos);return this.pos+=4,e},t.prototype.readI32=function(){var e=this.view.getInt32(this.pos);return this.pos+=4,e},t.prototype.readU64=function(){var e=uW(this.view,this.pos);return this.pos+=8,e},t.prototype.readI64=function(){var e=OC(this.view,this.pos);return this.pos+=8,e},t.prototype.readU64AsBigInt=function(){var e=this.view.getBigUint64(this.pos);return this.pos+=8,e},t.prototype.readI64AsBigInt=function(){var e=this.view.getBigInt64(this.pos);return this.pos+=8,e},t.prototype.readF32=function(){var e=this.view.getFloat32(this.pos);return this.pos+=4,e},t.prototype.readF64=function(){var e=this.view.getFloat64(this.pos);return this.pos+=8,e},t}();function NW(t,e){var n=new PW(e);return n.decode(t)}const OW=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]",FW=(t,e=0,n=t.byteLength-e)=>{if(!OW(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return mg.from(t,e,n)},BC=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?mg.from(t,e):mg.from(t)},LW=/^[A-Za-z0-9+/]*={0,2}$/,MW=t=>{if(t.length*3%4!==0)throw new TypeError("Incorrect padding on base64 string.");if(!LW.exec(t))throw new TypeError("Invalid base64 string.");const e=BC(t,"base64");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},zW=t=>{const e=BC(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},BW=t=>{let e;if(typeof t=="string"?e=zW(t):e=t,typeof e!="object"||typeof e.byteOffset!="number"||typeof e.byteLength!="number")throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");return FW(e.buffer,e.byteOffset,e.byteLength).toString("base64")},qW=`likec4lib { icons {
186
+ aws:activate
187
+ aws:alexa-for-business
188
+ aws:amplify
189
+ aws:apache-mxnet-on-aws
190
+ aws:api-gateway
191
+ aws:app-config
192
+ aws:app-flow
193
+ aws:app-mesh
194
+ aws:app-runner
195
+ aws:app-stream
196
+ aws:app-sync
197
+ aws:application-auto-scaling
198
+ aws:application-composer
199
+ aws:application-cost-profiler
200
+ aws:application-discovery-service
201
+ aws:application-migration-service
202
+ aws:artifact
203
+ aws:athena
204
+ aws:audit-manager
205
+ aws:augmented-ai-a2i
206
+ aws:aurora
207
+ aws:auto-scaling
208
+ aws:backint-agent
209
+ aws:backup
210
+ aws:batch
211
+ aws:billing-conductor
212
+ aws:bottlerocket
213
+ aws:braket
214
+ aws:budgets
215
+ aws:certificate-manager
216
+ aws:chatbot
217
+ aws:chime
218
+ aws:chime-sdk
219
+ aws:chime-voice-connector
220
+ aws:clean-rooms
221
+ aws:client-vpn
222
+ aws:cloud-control-api
223
+ aws:cloud-development-kit
224
+ aws:cloud-directory
225
+ aws:cloud-formation
226
+ aws:cloud-front
227
+ aws:cloud-hsm
228
+ aws:cloud-map
229
+ aws:cloud-search
230
+ aws:cloud-shell
231
+ aws:cloud-trail
232
+ aws:cloud-wan
233
+ aws:cloud-watch
234
+ aws:cloud9
235
+ aws:code-artifact
236
+ aws:code-build
237
+ aws:code-catalyst
238
+ aws:code-commit
239
+ aws:code-deploy
240
+ aws:code-guru
241
+ aws:code-pipeline
242
+ aws:code-star
243
+ aws:code-whisperer
244
+ aws:cognito
245
+ aws:command-line-interface
246
+ aws:comprehend
247
+ aws:comprehend-medical
248
+ aws:compute-optimizer
249
+ aws:config
250
+ aws:connect
251
+ aws:console-mobile-application
252
+ aws:control-tower
253
+ aws:corretto
254
+ aws:cost-and-usage-report
255
+ aws:cost-explorer
256
+ aws:data-exchange
257
+ aws:data-pipeline
258
+ aws:data-sync
259
+ aws:data-zone
260
+ aws:database-migration-service
261
+ aws:deep-composer
262
+ aws:deep-learning-amis
263
+ aws:deep-learning-containers
264
+ aws:deep-lens
265
+ aws:deep-racer
266
+ aws:detective
267
+ aws:dev-ops-guru
268
+ aws:device-farm
269
+ aws:direct-connect
270
+ aws:directory-service
271
+ aws:distro-for-open-telemetry
272
+ aws:document-db
273
+ aws:dynamo-db
274
+ aws:ec2
275
+ aws:ec2-auto-scaling
276
+ aws:ec2-image-builder
277
+ aws:ecs-anywhere
278
+ aws:efs
279
+ aws:eks-anywhere
280
+ aws:eks-cloud
281
+ aws:eks-distro
282
+ aws:elasti-cache
283
+ aws:elastic-beanstalk
284
+ aws:elastic-block-store
285
+ aws:elastic-container-registry
286
+ aws:elastic-container-service
287
+ aws:elastic-disaster-recovery
288
+ aws:elastic-fabric-adapter
289
+ aws:elastic-inference
290
+ aws:elastic-kubernetes-service
291
+ aws:elastic-load-balancing
292
+ aws:elastic-transcoder
293
+ aws:elemental-appliances-software
294
+ aws:elemental-conductor
295
+ aws:elemental-delta
296
+ aws:elemental-link
297
+ aws:elemental-live
298
+ aws:elemental-media-connect
299
+ aws:elemental-media-convert
300
+ aws:elemental-media-live
301
+ aws:elemental-media-package
302
+ aws:elemental-media-store
303
+ aws:elemental-media-tailor
304
+ aws:elemental-server
305
+ aws:emr
306
+ aws:event-bridge
307
+ aws:express-workflows
308
+ aws:fargate
309
+ aws:fault-injection-simulator
310
+ aws:file-cache
311
+ aws:fin-space
312
+ aws:firewall-manager
313
+ aws:forecast
314
+ aws:fraud-detector
315
+ aws:free-rtos
316
+ aws:fsx
317
+ aws:fsx-for-lustre
318
+ aws:fsx-for-net-app-ontap
319
+ aws:fsx-for-open-zfs
320
+ aws:fsx-for-wfs
321
+ aws:game-kit
322
+ aws:game-lift
323
+ aws:game-sparks
324
+ aws:genomics-cli
325
+ aws:global-accelerator
326
+ aws:glue
327
+ aws:glue-data-brew
328
+ aws:glue-elastic-views
329
+ aws:ground-station
330
+ aws:guard-duty
331
+ aws:health-lake
332
+ aws:honeycode
333
+ aws:iam-identity-center
334
+ aws:identity-and-access-management
335
+ aws:inspector
336
+ aws:interactive-video-service
337
+ aws:io-t-1-click
338
+ aws:io-t-analytics
339
+ aws:io-t-button
340
+ aws:io-t-core
341
+ aws:io-t-device-defender
342
+ aws:io-t-device-management
343
+ aws:io-t-edu-kit
344
+ aws:io-t-events
345
+ aws:io-t-express-link
346
+ aws:io-t-fleet-wise
347
+ aws:io-t-greengrass
348
+ aws:io-t-robo-runner
349
+ aws:io-t-site-wise
350
+ aws:io-t-things-graph
351
+ aws:io-t-twin-maker
352
+ aws:iq
353
+ aws:kendra
354
+ aws:key-management-service
355
+ aws:keyspaces
356
+ aws:kinesis
357
+ aws:kinesis-data-analytics
358
+ aws:kinesis-data-streams
359
+ aws:kinesis-firehose
360
+ aws:kinesis-video-streams
361
+ aws:lake-formation
362
+ aws:lambda
363
+ aws:launch-wizard
364
+ aws:lex
365
+ aws:license-manager
366
+ aws:lightsail
367
+ aws:local-zones
368
+ aws:location-service
369
+ aws:lookout-for-equipment
370
+ aws:lookout-for-metrics
371
+ aws:lookout-for-vision
372
+ aws:lumberyard
373
+ aws:macie
374
+ aws:mainframe-modernization
375
+ aws:managed-blockchain
376
+ aws:managed-grafana
377
+ aws:managed-service-for-prometheus
378
+ aws:managed-services
379
+ aws:managed-streaming-for-apache-kafka
380
+ aws:managed-workflows-for-apache-airflow
381
+ aws:management-console
382
+ aws:marketplace-dark
383
+ aws:marketplace-light
384
+ aws:memory-db-for-redis
385
+ aws:migration-evaluator
386
+ aws:migration-hub
387
+ aws:monitron
388
+ aws:mq
389
+ aws:neptune
390
+ aws:network-firewall
391
+ aws:neuron
392
+ aws:nice-dcv
393
+ aws:nice-engin-frame
394
+ aws:nimble-studio
395
+ aws:nitro-enclaves
396
+ aws:omics
397
+ aws:open-3d-engine
398
+ aws:open-search-service
399
+ aws:ops-works
400
+ aws:organizations
401
+ aws:outposts-family
402
+ aws:outposts-rack
403
+ aws:outposts-servers
404
+ aws:panorama
405
+ aws:parallel-cluster
406
+ aws:personal-health-dashboard
407
+ aws:personalize
408
+ aws:pinpoint
409
+ aws:pinpoint-apis
410
+ aws:polly
411
+ aws:private-5g
412
+ aws:private-certificate-authority
413
+ aws:private-link
414
+ aws:professional-services
415
+ aws:proton
416
+ aws:quantum-ledger-database
417
+ aws:quick-sight
418
+ aws:rds
419
+ aws:rds-on-vmware
420
+ aws:re-post
421
+ aws:red-hat-open-shift-service-on-aws
422
+ aws:redshift
423
+ aws:rekognition
424
+ aws:reserved-instance-reporting
425
+ aws:resilience-hub
426
+ aws:resource-access-manager
427
+ aws:resource-explorer
428
+ aws:robo-maker
429
+ aws:route-53
430
+ aws:s3-on-outposts
431
+ aws:sage-maker
432
+ aws:sage-maker-ground-truth
433
+ aws:sage-maker-studio-lab
434
+ aws:savings-plans
435
+ aws:secrets-manager
436
+ aws:security-hub
437
+ aws:security-lake
438
+ aws:server-migration-service
439
+ aws:serverless-application-repository
440
+ aws:service-catalog
441
+ aws:service-management-connector
442
+ aws:shield
443
+ aws:signer
444
+ aws:sim-space-weaver
445
+ aws:simple-email-service
446
+ aws:simple-notification-service
447
+ aws:simple-queue-service
448
+ aws:simple-storage-service
449
+ aws:simple-storage-service-glacier
450
+ aws:site-to-site-vpn
451
+ aws:snowball
452
+ aws:snowball-edge
453
+ aws:snowcone
454
+ aws:snowmobile
455
+ aws:step-functions
456
+ aws:storage-gateway
457
+ aws:sumerian
458
+ aws:supply-chain
459
+ aws:support
460
+ aws:systems-manager
461
+ aws:tensor-flow-on-aws
462
+ aws:textract
463
+ aws:thinkbox-deadline
464
+ aws:thinkbox-frost
465
+ aws:thinkbox-krakatoa
466
+ aws:thinkbox-sequoia
467
+ aws:thinkbox-stoke
468
+ aws:thinkbox-xmesh
469
+ aws:timestream
470
+ aws:tools-and-sdks
471
+ aws:torch-serve
472
+ aws:training-certification
473
+ aws:transcribe
474
+ aws:transfer-family
475
+ aws:transit-gateway
476
+ aws:translate
477
+ aws:trusted-advisor
478
+ aws:verified-access
479
+ aws:verified-permissions
480
+ aws:virtual-private-cloud
481
+ aws:vmware-cloud-on-aws
482
+ aws:vpc-lattice
483
+ aws:waf
484
+ aws:wavelength
485
+ aws:well-architected-tool
486
+ aws:wickr
487
+ aws:work-docs
488
+ aws:work-docs-sdk
489
+ aws:work-link
490
+ aws:work-mail
491
+ aws:work-spaces-family
492
+ aws:x-ray
493
+ azure:abs-member
494
+ azure:active-directory-connect-health
495
+ azure:activity-log
496
+ azure:administrative-units
497
+ azure:advisor
498
+ azure:ai-studio
499
+ azure:aks-automatic
500
+ azure:aks-istio
501
+ azure:alerts
502
+ azure:all-resources
503
+ azure:analysis-services
504
+ azure:anomaly-detector
505
+ azure:api-center
506
+ azure:api-connections
507
+ azure:api-management-services
508
+ azure:api-proxy
509
+ azure:app-compliance-automation
510
+ azure:app-configuration
511
+ azure:app-registrations
512
+ azure:app-service-certificates
513
+ azure:app-service-domains
514
+ azure:app-service-environments
515
+ azure:app-service-plans
516
+ azure:app-services
517
+ azure:app-space
518
+ azure:app-space-component
519
+ azure:applens
520
+ azure:application-gateway-containers
521
+ azure:application-gateways
522
+ azure:application-group
523
+ azure:application-insights
524
+ azure:application-security-groups
525
+ azure:aquila
526
+ azure:arc-data-services
527
+ azure:arc-kubernetes
528
+ azure:arc-machines
529
+ azure:arc-sql-managed-instance
530
+ azure:arc-sql-server
531
+ azure:atm-multistack
532
+ azure:auto-scale
533
+ azure:automanaged-vm
534
+ azure:automation-accounts
535
+ azure:availability-sets
536
+ azure:avs-vm
537
+ azure:azure-a
538
+ azure:azure-ad-b2c
539
+ azure:azure-api-for-fhir
540
+ azure:azure-applied-ai-services
541
+ azure:azure-arc
542
+ azure:azure-attestation
543
+ azure:azure-backup-center
544
+ azure:azure-blockchain-service
545
+ azure:azure-center-for-sap
546
+ azure:azure-chaos-studio
547
+ azure:azure-cloud-shell
548
+ azure:azure-communication-services
549
+ azure:azure-communications-gateway
550
+ azure:azure-compute-galleries
551
+ azure:azure-cosmos-db
552
+ azure:azure-data-catalog
553
+ azure:azure-data-explorer-clusters
554
+ azure:azure-database-maria-db-server
555
+ azure:azure-database-migration-services
556
+ azure:azure-database-my-sql-server
557
+ azure:azure-database-postgre-sql-server
558
+ azure:azure-database-postgre-sql-server-group
559
+ azure:azure-databox-gateway
560
+ azure:azure-databricks
561
+ azure:azure-deployment-environments
562
+ azure:azure-dev-ops
563
+ azure:azure-dev-tunnels
564
+ azure:azure-edge-hardware-center
565
+ azure:azure-experimentation-studio
566
+ azure:azure-fileshares
567
+ azure:azure-firewall-manager
568
+ azure:azure-firewall-policy
569
+ azure:azure-hcp-cache
570
+ azure:azure-hpc-workbenches
571
+ azure:azure-hybrid-center
572
+ azure:azure-information-protection
573
+ azure:azure-io-t-operations
574
+ azure:azure-lighthouse
575
+ azure:azure-load-testing
576
+ azure:azure-managed-grafana
577
+ azure:azure-maps-accounts
578
+ azure:azure-media-service
579
+ azure:azure-migrate
580
+ azure:azure-monitor-dashboard
581
+ azure:azure-monitor-pipeline
582
+ azure:azure-monitors-for-sap-solutions
583
+ azure:azure-net-app-files
584
+ azure:azure-network-function-manager
585
+ azure:azure-network-function-manager-functions
586
+ azure:azure-object-understanding
587
+ azure:azure-open-ai
588
+ azure:azure-operator-5g-core
589
+ azure:azure-operator-insights
590
+ azure:azure-operator-nexus
591
+ azure:azure-operator-service-manager
592
+ azure:azure-orbital
593
+ azure:azure-programmable-connectivity
594
+ azure:azure-purview-accounts
595
+ azure:azure-quotas
596
+ azure:azure-red-hat-open-shift
597
+ azure:azure-sentinel
598
+ azure:azure-service-bus
599
+ azure:azure-sphere
600
+ azure:azure-spring-apps
601
+ azure:azure-sql
602
+ azure:azure-sql-edge
603
+ azure:azure-sql-server-stretch-databases
604
+ azure:azure-sql-vm
605
+ azure:azure-stack
606
+ azure:azure-stack-edge
607
+ azure:azure-stack-hci-sizer
608
+ azure:azure-storage-mover
609
+ azure:azure-support-center-blue
610
+ azure:azure-sustainability
611
+ azure:azure-synapse-analytics
612
+ azure:azure-token-service
613
+ azure:azure-video-indexer
614
+ azure:azure-virtual-desktop
615
+ azure:azure-vmware-solution
616
+ azure:azure-workbooks
617
+ azure:azurite
618
+ azure:backlog
619
+ azure:backup-vault
620
+ azure:bare-metal-infrastructure
621
+ azure:bastions
622
+ azure:batch-accounts
623
+ azure:batch-ai
624
+ azure:biz-talk
625
+ azure:blob-block
626
+ azure:blob-page
627
+ azure:blockchain-applications
628
+ azure:blueprints
629
+ azure:bonsai
630
+ azure:bot-services
631
+ azure:branch
632
+ azure:browser
633
+ azure:bug
634
+ azure:builds
635
+ azure:business-process-tracking
636
+ azure:cache
637
+ azure:cache-redis
638
+ azure:capacity
639
+ azure:capacity-reservation-groups
640
+ azure:cdn-profiles
641
+ azure:central-service-instance-for-sap
642
+ azure:ceres
643
+ azure:change-analysis
644
+ azure:client-apps
645
+ azure:cloud-services-classic
646
+ azure:cloud-services-extended-support
647
+ azure:cloud-test
648
+ azure:code
649
+ azure:code-optimization
650
+ azure:cognitive-search
651
+ azure:cognitive-services
652
+ azure:cognitive-services-decisions
653
+ azure:collaborative-service
654
+ azure:commit
655
+ azure:community-images
656
+ azure:compliance
657
+ azure:compliance-center
658
+ azure:compute-fleet
659
+ azure:computer-vision
660
+ azure:conditional-access
661
+ azure:confidential-ledgers
662
+ azure:connected-cache
663
+ azure:connected-vehicle-platform
664
+ azure:connections
665
+ azure:consortium
666
+ azure:container-apps-environments
667
+ azure:container-instances
668
+ azure:container-registries
669
+ azure:container-services-deprecated
670
+ azure:content-moderators
671
+ azure:content-safety
672
+ azure:controls
673
+ azure:controls-horizontal
674
+ azure:cost-alerts
675
+ azure:cost-analysis
676
+ azure:cost-budgets
677
+ azure:cost-export
678
+ azure:cost-management
679
+ azure:cost-management-and-billing
680
+ azure:counter
681
+ azure:cubes
682
+ azure:custom-ip-prefix
683
+ azure:custom-vision
684
+ azure:customer-lockbox-for-microsoft-azure
685
+ azure:dashboard
686
+ azure:dashboard-hub
687
+ azure:data-box
688
+ azure:data-collection-rules
689
+ azure:data-factories
690
+ azure:data-lake-analytics
691
+ azure:data-lake-storage-gen1
692
+ azure:data-lake-store-gen1
693
+ azure:data-share-invitations
694
+ azure:data-shares
695
+ azure:database-instance-for-sap
696
+ azure:ddo-s-protection-plans
697
+ azure:dedicated-hsm
698
+ azure:defender-cm-local-manager
699
+ azure:defender-dcs-controller
700
+ azure:defender-distributer-control-system
701
+ azure:defender-engineering-station
702
+ azure:defender-external-management
703
+ azure:defender-freezer-monitor
704
+ azure:defender-historian
705
+ azure:defender-hmi
706
+ azure:defender-industrial-packaging-system
707
+ azure:defender-industrial-printer
708
+ azure:defender-industrial-robot
709
+ azure:defender-industrial-scale-system
710
+ azure:defender-marquee
711
+ azure:defender-meter
712
+ azure:defender-plc
713
+ azure:defender-pneumatic-device
714
+ azure:defender-programable-board
715
+ azure:defender-relay
716
+ azure:defender-robot-controller
717
+ azure:defender-rtu
718
+ azure:defender-sensor
719
+ azure:defender-slot
720
+ azure:defender-web-guiding-system
721
+ azure:detonation
722
+ azure:dev-console
723
+ azure:dev-ops-starter
724
+ azure:dev-test-labs
725
+ azure:device-compliance
726
+ azure:device-configuration
727
+ azure:device-enrollment
728
+ azure:device-provisioning-services
729
+ azure:device-security-apple
730
+ azure:device-security-google
731
+ azure:device-security-windows
732
+ azure:device-update-io-t-hub
733
+ azure:devices
734
+ azure:diagnostics-settings
735
+ azure:digital-twins
736
+ azure:disk-encryption-sets
737
+ azure:disk-pool
738
+ azure:disks
739
+ azure:disks-classic
740
+ azure:disks-snapshots
741
+ azure:dns-multistack
742
+ azure:dns-private-resolver
743
+ azure:dns-security-policy
744
+ azure:dns-zones
745
+ azure:download
746
+ azure:e-books
747
+ azure:edge-management
748
+ azure:education
749
+ azure:elastic-job-agents
750
+ azure:elastic-san
751
+ azure:endpoint-analytics
752
+ azure:enterprise-applications
753
+ azure:entra-connect
754
+ azure:entra-connect-health
755
+ azure:entra-connect-sync
756
+ azure:entra-domain-services
757
+ azure:entra-global-secure-access
758
+ azure:entra-id-protection
759
+ azure:entra-identity-custom-roles
760
+ azure:entra-identity-licenses
761
+ azure:entra-identity-risky-signins
762
+ azure:entra-identity-risky-users
763
+ azure:entra-identity-roles-and-administrators
764
+ azure:entra-internet-access
765
+ azure:entra-managed-identities
766
+ azure:entra-private-access
767
+ azure:entra-privleged-identity-management
768
+ azure:entra-verified-id
769
+ azure:error
770
+ azure:event-grid-domains
771
+ azure:event-grid-subscriptions
772
+ azure:event-grid-topics
773
+ azure:event-hub-clusters
774
+ azure:event-hubs
775
+ azure:exchange-access
776
+ azure:exchange-on-premises-access
777
+ azure:express-route-circuits
778
+ azure:express-route-direct
779
+ azure:express-route-traffic-collector
780
+ azure:extended-security-updates
781
+ azure:extensions
782
+ azure:external-identities
783
+ azure:face-apis
784
+ azure:feature-previews
785
+ azure:fhir-service
786
+ azure:fiji
787
+ azure:file
788
+ azure:files
789
+ azure:firewalls
790
+ azure:folder-blank
791
+ azure:folder-website
792
+ azure:form-recognizers
793
+ azure:free-services
794
+ azure:front-door-and-cdn-profiles
795
+ azure:ftp
796
+ azure:function-apps
797
+ azure:gear
798
+ azure:genomics
799
+ azure:genomics-accounts
800
+ azure:globe-error
801
+ azure:globe-success
802
+ azure:globe-warning
803
+ azure:groups
804
+ azure:guide
805
+ azure:hd-insight-clusters
806
+ azure:hdi-aks-cluster
807
+ azure:heart
808
+ azure:help-and-support
809
+ azure:host-groups
810
+ azure:host-pools
811
+ azure:hosts
812
+ azure:ic-m-troubleshooting
813
+ azure:identity-governance
814
+ azure:identity-multi-factor-authentication
815
+ azure:identity-secure-score
816
+ azure:image
817
+ azure:image-definitions
818
+ azure:image-templates
819
+ azure:image-versions
820
+ azure:images
821
+ azure:immersive-readers
822
+ azure:import-export-jobs
823
+ azure:industrial-io-t
824
+ azure:information
825
+ azure:infrastructure-backup
826
+ azure:input-output
827
+ azure:instance-pools
828
+ azure:integration-accounts
829
+ azure:integration-environments
830
+ azure:integration-service-environments
831
+ azure:internet-analyzer-profiles
832
+ azure:intune
833
+ azure:intune-app-protection
834
+ azure:intune-for-education
835
+ azure:intune-trends
836
+ azure:io-t-central-applications
837
+ azure:io-t-edge
838
+ azure:io-t-hub
839
+ azure:ip-address-manager
840
+ azure:ip-groups
841
+ azure:journey-hub
842
+ azure:key-vaults
843
+ azure:keys
844
+ azure:kubernetes-fleet-manager
845
+ azure:kubernetes-services
846
+ azure:lab-accounts
847
+ azure:lab-services
848
+ azure:language
849
+ azure:language-understanding
850
+ azure:launch-portal
851
+ azure:learn
852
+ azure:load-balancer-hub
853
+ azure:load-balancers
854
+ azure:load-test
855
+ azure:load-testing
856
+ azure:local-network-gateways
857
+ azure:location
858
+ azure:log-analytics-query-pack
859
+ azure:log-analytics-workspaces
860
+ azure:log-streaming
861
+ azure:logic-apps
862
+ azure:logic-apps-custom-connector
863
+ azure:machine-learning
864
+ azure:machine-learning-studio-classic-web-services
865
+ azure:machine-learning-studio-web-service-plans
866
+ azure:machine-learning-studio-workspaces
867
+ azure:machines-azure-arc
868
+ azure:maintenance-configuration
869
+ azure:managed-applications-center
870
+ azure:managed-database
871
+ azure:managed-desktop
872
+ azure:managed-dev-ops-pools
873
+ azure:managed-file-shares
874
+ azure:managed-identities
875
+ azure:managed-instance-apache-cassandra
876
+ azure:managed-service-fabric
877
+ azure:management-groups
878
+ azure:management-portal
879
+ azure:marketplace
880
+ azure:marketplace-management
881
+ azure:med-tech-service
882
+ azure:media
883
+ azure:media-file
884
+ azure:mesh-applications
885
+ azure:metrics
886
+ azure:metrics-advisor
887
+ azure:microsoft-defender-easm
888
+ azure:microsoft-defender-for-cloud
889
+ azure:microsoft-defender-for-io-t
890
+ azure:microsoft-dev-box
891
+ azure:mindaro
892
+ azure:mission-landing-zone
893
+ azure:mobile
894
+ azure:mobile-engagement
895
+ azure:mobile-networks
896
+ azure:modular-data-center
897
+ azure:module
898
+ azure:monitor
899
+ azure:monitor-health-models
900
+ azure:multi-tenancy
901
+ azure:multifactor-authentication
902
+ azure:my-customers
903
+ azure:nat
904
+ azure:network-interfaces
905
+ azure:network-managers
906
+ azure:network-security-groups
907
+ azure:network-security-perimeters
908
+ azure:network-watcher
909
+ azure:notification-hub-namespaces
910
+ azure:notification-hubs
911
+ azure:offers
912
+ azure:on-premises-data-gateways
913
+ azure:open-supply-chain-platform
914
+ azure:operation-log-classic
915
+ azure:oracle-database
916
+ azure:os-images-classic
917
+ azure:osconfig
918
+ azure:outbound-connection
919
+ azure:partner-namespace
920
+ azure:partner-registration
921
+ azure:partner-topic
922
+ azure:peering-service
923
+ azure:peerings
924
+ azure:personalizers
925
+ azure:plans
926
+ azure:policy
927
+ azure:power
928
+ azure:power-bi-embedded
929
+ azure:power-platform
930
+ azure:power-up
931
+ azure:powershell
932
+ azure:preview-features
933
+ azure:private-endpoints
934
+ azure:private-link
935
+ azure:private-link-service
936
+ azure:private-link-services
937
+ azure:process-explorer
938
+ azure:production-ready-database
939
+ azure:proximity-placement-groups
940
+ azure:public-ip-addresses
941
+ azure:public-ip-addresses-classic
942
+ azure:public-ip-prefixes
943
+ azure:qn-a-makers
944
+ azure:quickstart-center
945
+ azure:recent
946
+ azure:recovery-services-vaults
947
+ azure:region-management
948
+ azure:relays
949
+ azure:remote-rendering
950
+ azure:reservations
951
+ azure:reserved-capacity
952
+ azure:reserved-ip-addresses-classic
953
+ azure:resource-explorer
954
+ azure:resource-graph-explorer
955
+ azure:resource-group-list
956
+ azure:resource-groups
957
+ azure:resource-guard
958
+ azure:resource-linked
959
+ azure:resource-management-private-link
960
+ azure:resource-mover
961
+ azure:resources-provider
962
+ azure:restore-points
963
+ azure:restore-points-collections
964
+ azure:route-filters
965
+ azure:route-tables
966
+ azure:rtos
967
+ azure:savings-plans
968
+ azure:scheduler
969
+ azure:scheduler-job-collections
970
+ azure:scvmm-management-servers
971
+ azure:search
972
+ azure:search-grid
973
+ azure:security
974
+ azure:security-baselines
975
+ azure:send-grid-accounts
976
+ azure:server-farm
977
+ azure:serverless-search
978
+ azure:service-catalog-mad
979
+ azure:service-endpoint-policies
980
+ azure:service-fabric-clusters
981
+ azure:service-health
982
+ azure:service-providers
983
+ azure:shared-image-galleries
984
+ azure:signal-r
985
+ azure:software-as-a-service
986
+ azure:software-updates
987
+ azure:solutions
988
+ azure:sonic-dash
989
+ azure:spatial-anchor-accounts
990
+ azure:speech-services
991
+ azure:spot-vm
992
+ azure:spot-vmss
993
+ azure:sql-data-warehouses
994
+ azure:sql-database
995
+ azure:sql-elastic-pools
996
+ azure:sql-managed-instance
997
+ azure:sql-server
998
+ azure:sql-server-registries
999
+ azure:ssd
1000
+ azure:ssh-keys
1001
+ azure:ssis-lift-and-shift-ir
1002
+ azure:stack-hci-premium
1003
+ azure:static-apps
1004
+ azure:stor-simple-data-managers
1005
+ azure:stor-simple-device-managers
1006
+ azure:storage-accounts
1007
+ azure:storage-accounts-classic
1008
+ azure:storage-actions
1009
+ azure:storage-azure-files
1010
+ azure:storage-container
1011
+ azure:storage-explorer
1012
+ azure:storage-functions
1013
+ azure:storage-queue
1014
+ azure:storage-sync-services
1015
+ azure:stream-analytics-jobs
1016
+ azure:subnet
1017
+ azure:subscriptions
1018
+ azure:system-topic
1019
+ azure:table
1020
+ azure:tag
1021
+ azure:tags
1022
+ azure:targets-management
1023
+ azure:template-specs
1024
+ azure:templates
1025
+ azure:tenant-properties
1026
+ azure:tenant-status
1027
+ azure:test-base
1028
+ azure:tfs-vc-repository
1029
+ azure:time-series-data-sets
1030
+ azure:time-series-insights-access-policies
1031
+ azure:time-series-insights-environments
1032
+ azure:time-series-insights-event-sources
1033
+ azure:toolbox
1034
+ azure:traffic-manager-profiles
1035
+ azure:translator-text
1036
+ azure:troubleshoot
1037
+ azure:universal-print
1038
+ azure:update-management-center
1039
+ azure:updates
1040
+ azure:user-privacy
1041
+ azure:user-settings
1042
+ azure:user-subscriptions
1043
+ azure:users
1044
+ azure:verifiable-credentials
1045
+ azure:verification-as-a-service
1046
+ azure:versions
1047
+ azure:video-analyzers
1048
+ azure:virtual-clusters
1049
+ azure:virtual-enclaves
1050
+ azure:virtual-instance-for-sap
1051
+ azure:virtual-machine
1052
+ azure:virtual-machines-classic
1053
+ azure:virtual-network-gateways
1054
+ azure:virtual-networks
1055
+ azure:virtual-networks-classic
1056
+ azure:virtual-router
1057
+ azure:virtual-visits-builder
1058
+ azure:virtual-wan-hub
1059
+ azure:virtual-wans
1060
+ azure:vm-app-definitions
1061
+ azure:vm-app-versions
1062
+ azure:vm-image-version
1063
+ azure:vm-images-classic
1064
+ azure:vm-scale-sets
1065
+ azure:wac
1066
+ azure:wac-installer
1067
+ azure:web-app-database
1068
+ azure:web-application-firewall-policies-waf
1069
+ azure:web-jobs
1070
+ azure:web-slots
1071
+ azure:web-test
1072
+ azure:website-power
1073
+ azure:website-staging
1074
+ azure:windows-notification-services
1075
+ azure:windows10-core-services
1076
+ azure:workbooks
1077
+ azure:worker-container-app
1078
+ azure:workflow
1079
+ azure:workspace-gateway
1080
+ azure:workspaces
1081
+ gcp:access-context-manager
1082
+ gcp:administration
1083
+ gcp:advanced-agent-modeling
1084
+ gcp:advanced-solutions-lab
1085
+ gcp:agent-assist
1086
+ gcp:ai-hub
1087
+ gcp:ai-platform
1088
+ gcp:ai-platform-unified
1089
+ gcp:analytics-hub
1090
+ gcp:anthos
1091
+ gcp:anthos-config-management
1092
+ gcp:anthos-service-mesh
1093
+ gcp:api
1094
+ gcp:api-analytics
1095
+ gcp:api-monetization
1096
+ gcp:apigee-api-platform
1097
+ gcp:apigee-sense
1098
+ gcp:app-engine
1099
+ gcp:artifact-registry
1100
+ gcp:asset-inventory
1101
+ gcp:assured-workloads
1102
+ gcp:auto-ml
1103
+ gcp:auto-ml-natural-language
1104
+ gcp:auto-ml-tables
1105
+ gcp:auto-ml-translation
1106
+ gcp:auto-ml-video-intelligence
1107
+ gcp:auto-ml-vision
1108
+ gcp:bare-metal-solutions
1109
+ gcp:batch
1110
+ gcp:beyondcorp
1111
+ gcp:big-query
1112
+ gcp:bigtable
1113
+ gcp:billing
1114
+ gcp:binary-authorization
1115
+ gcp:catalog
1116
+ gcp:certificate-authority-service
1117
+ gcp:certificate-manager
1118
+ gcp:cloud-api-gateway
1119
+ gcp:cloud-apis
1120
+ gcp:cloud-armor
1121
+ gcp:cloud-asset-inventory
1122
+ gcp:cloud-audit-logs
1123
+ gcp:cloud-build
1124
+ gcp:cloud-cdn
1125
+ gcp:cloud-code
1126
+ gcp:cloud-composer
1127
+ gcp:cloud-data-fusion
1128
+ gcp:cloud-deploy
1129
+ gcp:cloud-deployment-manager
1130
+ gcp:cloud-dns
1131
+ gcp:cloud-domains
1132
+ gcp:cloud-ekm
1133
+ gcp:cloud-endpoints
1134
+ gcp:cloud-external-ip-addresses
1135
+ gcp:cloud-firewall-rules
1136
+ gcp:cloud-for-marketing
1137
+ gcp:cloud-functions
1138
+ gcp:cloud-generic
1139
+ gcp:cloud-gpu
1140
+ gcp:cloud-healthcare-api
1141
+ gcp:cloud-healthcare-marketplace
1142
+ gcp:cloud-hsm
1143
+ gcp:cloud-ids
1144
+ gcp:cloud-inference-api
1145
+ gcp:cloud-interconnect
1146
+ gcp:cloud-jobs-api
1147
+ gcp:cloud-load-balancing
1148
+ gcp:cloud-logging
1149
+ gcp:cloud-media-edge
1150
+ gcp:cloud-monitoring
1151
+ gcp:cloud-nat
1152
+ gcp:cloud-natural-language-api
1153
+ gcp:cloud-network
1154
+ gcp:cloud-ops
1155
+ gcp:cloud-optimization-ai
1156
+ gcp:cloud-optimization-ai-fleet-routing-api
1157
+ gcp:cloud-router
1158
+ gcp:cloud-routes
1159
+ gcp:cloud-run
1160
+ gcp:cloud-run-for-anthos
1161
+ gcp:cloud-scheduler
1162
+ gcp:cloud-security-scanner
1163
+ gcp:cloud-shell
1164
+ gcp:cloud-spanner
1165
+ gcp:cloud-sql
1166
+ gcp:cloud-storage
1167
+ gcp:cloud-tasks
1168
+ gcp:cloud-test-lab
1169
+ gcp:cloud-tpu
1170
+ gcp:cloud-translation-api
1171
+ gcp:cloud-vision-api
1172
+ gcp:cloud-vpn
1173
+ gcp:compute-engine
1174
+ gcp:configuration-management
1175
+ gcp:connectivity-test
1176
+ gcp:connectors
1177
+ gcp:contact-center-ai
1178
+ gcp:container-optimized-os
1179
+ gcp:container-registry
1180
+ gcp:data-catalog
1181
+ gcp:data-labeling
1182
+ gcp:data-layers
1183
+ gcp:data-loss-prevention-api
1184
+ gcp:data-qn-a
1185
+ gcp:data-studio
1186
+ gcp:data-transfer
1187
+ gcp:database-migration-service
1188
+ gcp:dataflow
1189
+ gcp:datalab
1190
+ gcp:dataplex
1191
+ gcp:datapol
1192
+ gcp:dataprep
1193
+ gcp:dataproc
1194
+ gcp:dataproc-metastore
1195
+ gcp:datashare
1196
+ gcp:datastore
1197
+ gcp:datastream
1198
+ gcp:debugger
1199
+ gcp:developer-portal
1200
+ gcp:dialogflow
1201
+ gcp:dialogflow-cx
1202
+ gcp:dialogflow-insights
1203
+ gcp:document-ai
1204
+ gcp:early-access-center
1205
+ gcp:error-reporting
1206
+ gcp:eventarc
1207
+ gcp:filestore
1208
+ gcp:financial-services-marketplace
1209
+ gcp:firestore
1210
+ gcp:fleet-engine
1211
+ gcp:free-trial
1212
+ gcp:game-servers
1213
+ gcp:gce-systems-management
1214
+ gcp:genomics
1215
+ gcp:gke-on-prem
1216
+ gcp:google-cloud-marketplace
1217
+ gcp:google-kubernetes-engine
1218
+ gcp:google-maps-platform
1219
+ gcp:healthcare-nlp-api
1220
+ gcp:home
1221
+ gcp:identity-and-access-management
1222
+ gcp:identity-aware-proxy
1223
+ gcp:identity-platform
1224
+ gcp:iot-core
1225
+ gcp:iot-edge
1226
+ gcp:key-access-justifications
1227
+ gcp:key-management-service
1228
+ gcp:kuberun
1229
+ gcp:launcher
1230
+ gcp:local-ssd
1231
+ gcp:looker
1232
+ gcp:managed-service-for-microsoft-active-directory
1233
+ gcp:media-translation-api
1234
+ gcp:memorystore
1235
+ gcp:migrate-for-anthos
1236
+ gcp:migrate-for-compute-engine
1237
+ gcp:my-cloud
1238
+ gcp:network-connectivity-center
1239
+ gcp:network-intelligence-center
1240
+ gcp:network-security
1241
+ gcp:network-tiers
1242
+ gcp:network-topology
1243
+ gcp:onboarding
1244
+ gcp:os-configuration-management
1245
+ gcp:os-inventory-management
1246
+ gcp:os-patch-management
1247
+ gcp:partner-interconnect
1248
+ gcp:partner-portal
1249
+ gcp:performance-dashboard
1250
+ gcp:permissions
1251
+ gcp:persistent-disk
1252
+ gcp:phishing-protection
1253
+ gcp:policy-analyzer
1254
+ gcp:premium-network-tier
1255
+ gcp:private-connectivity
1256
+ gcp:private-service-connect
1257
+ gcp:producer-portal
1258
+ gcp:profiler
1259
+ gcp:project
1260
+ gcp:pub-sub
1261
+ gcp:quantum-engine
1262
+ gcp:quotas
1263
+ gcp:real-world-insights
1264
+ gcp:recommendations-ai
1265
+ gcp:release-notes
1266
+ gcp:retail-api
1267
+ gcp:risk-manager
1268
+ gcp:runtime-config
1269
+ gcp:secret-manager
1270
+ gcp:security
1271
+ gcp:security-command-center
1272
+ gcp:security-health-advisor
1273
+ gcp:security-key-enforcement
1274
+ gcp:service-discovery
1275
+ gcp:speech-to-text
1276
+ gcp:stackdriver
1277
+ gcp:standard-network-tier
1278
+ gcp:stream-suite
1279
+ gcp:support
1280
+ gcp:tensorflow-enterprise
1281
+ gcp:text-to-speech
1282
+ gcp:tools-for-powershell
1283
+ gcp:trace
1284
+ gcp:traffic-director
1285
+ gcp:transfer
1286
+ gcp:transfer-appliance
1287
+ gcp:user-preferences
1288
+ gcp:vertex-ai
1289
+ gcp:video-intelligence-api
1290
+ gcp:virtual-private-cloud
1291
+ gcp:visual-inspection
1292
+ gcp:vmware-engine
1293
+ gcp:web-risk
1294
+ gcp:web-security-scanner
1295
+ gcp:workflows
1296
+ gcp:workload-identity-pool
1297
+ tech:aarch64
1298
+ tech:adobe-illustrator
1299
+ tech:adobe-photoshop
1300
+ tech:adobe-premiere-pro
1301
+ tech:adobe-xd
1302
+ tech:adonis-js
1303
+ tech:after-effects
1304
+ tech:airflow
1305
+ tech:akka
1306
+ tech:algolia
1307
+ tech:alpine-js
1308
+ tech:amazon-web-services
1309
+ tech:anaconda
1310
+ tech:android
1311
+ tech:android-studio
1312
+ tech:angular
1313
+ tech:angular-js
1314
+ tech:ansible
1315
+ tech:ant-design
1316
+ tech:apache
1317
+ tech:apl
1318
+ tech:appcelerator
1319
+ tech:apple
1320
+ tech:apple-safari
1321
+ tech:appwrite
1322
+ tech:arch-linux
1323
+ tech:arduino
1324
+ tech:argo-cd
1325
+ tech:astro
1326
+ tech:atom
1327
+ tech:autodesk-maya
1328
+ tech:autodesk-shot-grid
1329
+ tech:awk
1330
+ tech:azios
1331
+ tech:azure
1332
+ tech:azure-devops
1333
+ tech:azure-sql-database
1334
+ tech:babel
1335
+ tech:backbone-js
1336
+ tech:ballerina
1337
+ tech:bamboo
1338
+ tech:bash
1339
+ tech:behance
1340
+ tech:bitbucket
1341
+ tech:blender
1342
+ tech:bootstrap
1343
+ tech:bower
1344
+ tech:browserstack
1345
+ tech:bulma
1346
+ tech:bun
1347
+ tech:c
1348
+ tech:cairo-graphics
1349
+ tech:cake-php
1350
+ tech:canva
1351
+ tech:capacitor
1352
+ tech:cassandra
1353
+ tech:cent-os
1354
+ tech:chrome
1355
+ tech:circle-ci
1356
+ tech:clarity
1357
+ tech:clion
1358
+ tech:clojure
1359
+ tech:clojure-script
1360
+ tech:cloudflare
1361
+ tech:cloudflare-workers
1362
+ tech:cmake
1363
+ tech:code-igniter
1364
+ tech:code-pen
1365
+ tech:codeac
1366
+ tech:codecov
1367
+ tech:coffee-script
1368
+ tech:composer
1369
+ tech:confluence
1370
+ tech:consul
1371
+ tech:contao
1372
+ tech:corejs
1373
+ tech:cosmosdb
1374
+ tech:couchdb
1375
+ tech:cplusplus
1376
+ tech:crystal
1377
+ tech:csharp
1378
+ tech:css3
1379
+ tech:cucumber
1380
+ tech:cypress
1381
+ tech:d3js
1382
+ tech:dart
1383
+ tech:data-grip
1384
+ tech:data-spell
1385
+ tech:dbeaver
1386
+ tech:debian
1387
+ tech:deno
1388
+ tech:devicon
1389
+ tech:digital-ocean
1390
+ tech:discord-js
1391
+ tech:django
1392
+ tech:django-rest
1393
+ tech:docker
1394
+ tech:doctrine
1395
+ tech:dropwizard
1396
+ tech:drupal
1397
+ tech:eclipse-ceylon
1398
+ tech:eclipse-ide
1399
+ tech:eclipse-vert-x
1400
+ tech:elasticbeats
1401
+ tech:elasticsearch
1402
+ tech:electron
1403
+ tech:eleventy-11ty
1404
+ tech:elixir
1405
+ tech:elm
1406
+ tech:embedded-c
1407
+ tech:ember-js
1408
+ tech:envoy
1409
+ tech:erlang
1410
+ tech:eslint
1411
+ tech:express
1412
+ tech:facebook
1413
+ tech:fast-api
1414
+ tech:fastify
1415
+ tech:fauna
1416
+ tech:feathers
1417
+ tech:fedora
1418
+ tech:figma
1419
+ tech:file-zilla
1420
+ tech:firebase
1421
+ tech:firefox
1422
+ tech:flask
1423
+ tech:flutter
1424
+ tech:fortran
1425
+ tech:foundation
1426
+ tech:fsharp
1427
+ tech:gatling
1428
+ tech:gatsby
1429
+ tech:gazebo
1430
+ tech:gcc
1431
+ tech:gentoo
1432
+ tech:ghost
1433
+ tech:gimp
1434
+ tech:git
1435
+ tech:gitbook
1436
+ tech:github
1437
+ tech:github-actions
1438
+ tech:github-codespaces
1439
+ tech:gitlab
1440
+ tech:gitpod
1441
+ tech:gitter
1442
+ tech:gnu-emacs
1443
+ tech:go
1444
+ tech:go-land
1445
+ tech:godot-engine
1446
+ tech:google
1447
+ tech:google-cloud
1448
+ tech:gradle
1449
+ tech:grafana
1450
+ tech:grails
1451
+ tech:graphql
1452
+ tech:groovy
1453
+ tech:grunt-js
1454
+ tech:gulp-js
1455
+ tech:hadoop
1456
+ tech:handlebars
1457
+ tech:hardhat
1458
+ tech:harvester
1459
+ tech:hashicorp-vault
1460
+ tech:haskell
1461
+ tech:haxe
1462
+ tech:helm
1463
+ tech:heroku
1464
+ tech:hibernate
1465
+ tech:homebrew
1466
+ tech:html5
1467
+ tech:hugo
1468
+ tech:ibm-spss-statistics
1469
+ tech:ie10
1470
+ tech:ifttt
1471
+ tech:influxdb
1472
+ tech:inkscape
1473
+ tech:insomnia
1474
+ tech:intellij-idea
1475
+ tech:ionic
1476
+ tech:jaeger
1477
+ tech:jamstack
1478
+ tech:jasmine
1479
+ tech:java
1480
+ tech:javascript
1481
+ tech:jeet
1482
+ tech:jekyll
1483
+ tech:jenkins
1484
+ tech:jest
1485
+ tech:jetbrains
1486
+ tech:jira
1487
+ tech:jira-align
1488
+ tech:jquery
1489
+ tech:json
1490
+ tech:jule
1491
+ tech:julia
1492
+ tech:junit
1493
+ tech:jupyter
1494
+ tech:k3os
1495
+ tech:k3s
1496
+ tech:kafka
1497
+ tech:kaggle
1498
+ tech:karate
1499
+ tech:karma
1500
+ tech:keras
1501
+ tech:kibana
1502
+ tech:knex-js
1503
+ tech:knockout
1504
+ tech:kotlin
1505
+ tech:krakenjs
1506
+ tech:ktor
1507
+ tech:kubernetes
1508
+ tech:labview
1509
+ tech:laravel
1510
+ tech:latex
1511
+ tech:less-js
1512
+ tech:linkedin
1513
+ tech:linux
1514
+ tech:liquibase
1515
+ tech:livewire
1516
+ tech:llvm
1517
+ tech:logstash
1518
+ tech:lua
1519
+ tech:lumen
1520
+ tech:magento
1521
+ tech:markdown
1522
+ tech:material-ui
1523
+ tech:materialize
1524
+ tech:matlab
1525
+ tech:matplotlib
1526
+ tech:maven
1527
+ tech:meteor-js
1528
+ tech:microsoft-sql-server
1529
+ tech:minitab
1530
+ tech:mob-x
1531
+ tech:mocha
1532
+ tech:modx
1533
+ tech:moleculer
1534
+ tech:mongodb
1535
+ tech:mongoose-js
1536
+ tech:moodle
1537
+ tech:ms-dos
1538
+ tech:mysql
1539
+ tech:nano
1540
+ tech:nerog
1541
+ tech:nestjs
1542
+ tech:net
1543
+ tech:net-core
1544
+ tech:network-x
1545
+ tech:new4j
1546
+ tech:nextjs
1547
+ tech:nginx
1548
+ tech:nhibernate
1549
+ tech:nim
1550
+ tech:nimble
1551
+ tech:nix
1552
+ tech:nodejs
1553
+ tech:nodemon
1554
+ tech:nodewebkit
1555
+ tech:npm
1556
+ tech:nuget
1557
+ tech:num-py
1558
+ tech:nuxt-js
1559
+ tech:objective-c
1560
+ tech:ocaml
1561
+ tech:oh-my-zsh
1562
+ tech:okta
1563
+ tech:open-al
1564
+ tech:open-api
1565
+ tech:open-cl
1566
+ tech:open-cv
1567
+ tech:open-gl
1568
+ tech:open-stack
1569
+ tech:open-suse
1570
+ tech:open-telemetry
1571
+ tech:opera
1572
+ tech:oracle
1573
+ tech:p5js
1574
+ tech:packer
1575
+ tech:pandas
1576
+ tech:perl
1577
+ tech:pf-sense
1578
+ tech:phalcon
1579
+ tech:phoenix-framework
1580
+ tech:photon-engine
1581
+ tech:php
1582
+ tech:php-storm
1583
+ tech:playwrite
1584
+ tech:ploty
1585
+ tech:podman
1586
+ tech:polygon
1587
+ tech:portainer
1588
+ tech:postcss
1589
+ tech:postgresql
1590
+ tech:postman
1591
+ tech:powershell
1592
+ tech:processing
1593
+ tech:prometheus
1594
+ tech:protractor
1595
+ tech:purescript
1596
+ tech:putty
1597
+ tech:pycharm
1598
+ tech:pyscript
1599
+ tech:pytest
1600
+ tech:python
1601
+ tech:python-poetry
1602
+ tech:pytorch
1603
+ tech:qodana
1604
+ tech:qt
1605
+ tech:quarkus
1606
+ tech:quasar
1607
+ tech:qwik
1608
+ tech:r
1609
+ tech:rabbitmq
1610
+ tech:rancher
1611
+ tech:raspberrypi
1612
+ tech:reach
1613
+ tech:react
1614
+ tech:react-bootstrap
1615
+ tech:realm
1616
+ tech:red-cube-s-epic-compiler-thingy-programming-re-ct
1617
+ tech:redhat
1618
+ tech:redis
1619
+ tech:redux
1620
+ tech:ren-py
1621
+ tech:rider
1622
+ tech:robot-operating-system-ros
1623
+ tech:rocksdb
1624
+ tech:rollup-js
1625
+ tech:rspec
1626
+ tech:rstudio
1627
+ tech:ruby
1628
+ tech:ruby-mine
1629
+ tech:ruby-on-rails
1630
+ tech:rust
1631
+ tech:salesforce
1632
+ tech:sanity
1633
+ tech:sass
1634
+ tech:scala
1635
+ tech:scalingo
1636
+ tech:sdl
1637
+ tech:selenium
1638
+ tech:sema-software
1639
+ tech:sequelize
1640
+ tech:shopware
1641
+ tech:sketch
1642
+ tech:slack
1643
+ tech:socket-io
1644
+ tech:solid-js
1645
+ tech:solidity
1646
+ tech:sonarqube
1647
+ tech:sourcetree
1648
+ tech:spark
1649
+ tech:splunk
1650
+ tech:spring
1651
+ tech:sql-developer
1652
+ tech:sqlalchemy
1653
+ tech:sqlite
1654
+ tech:ssh
1655
+ tech:stackoverflow
1656
+ tech:stata
1657
+ tech:storybook
1658
+ tech:streamlit
1659
+ tech:stylus
1660
+ tech:subversion
1661
+ tech:svelte
1662
+ tech:swagger
1663
+ tech:swift
1664
+ tech:symfony
1665
+ tech:tailwind-css
1666
+ tech:tauri
1667
+ tech:tensorflow
1668
+ tech:terraform
1669
+ tech:tex
1670
+ tech:the-algorithms
1671
+ tech:three-js
1672
+ tech:titanium-sdk
1673
+ tech:tomcat
1674
+ tech:tortoise-git
1675
+ tech:tower
1676
+ tech:traefik-mesh
1677
+ tech:traefik-proxy
1678
+ tech:travis-ci
1679
+ tech:trello
1680
+ tech:twitter
1681
+ tech:typescript
1682
+ tech:typo3
1683
+ tech:ubuntu
1684
+ tech:uml
1685
+ tech:unity
1686
+ tech:unix
1687
+ tech:unreal-engine
1688
+ tech:uwsgi
1689
+ tech:v8
1690
+ tech:vagrant
1691
+ tech:vala
1692
+ tech:vercel
1693
+ tech:veutify
1694
+ tech:vim
1695
+ tech:visualstudio
1696
+ tech:vite
1697
+ tech:vitejs
1698
+ tech:vscode
1699
+ tech:vsphere
1700
+ tech:vue
1701
+ tech:vue-storefront
1702
+ tech:vyper
1703
+ tech:webassembly
1704
+ tech:webflow
1705
+ tech:weblate
1706
+ tech:webpack
1707
+ tech:webstorm
1708
+ tech:windows8
1709
+ tech:windows11
1710
+ tech:woo-commerce
1711
+ tech:wordpress
1712
+ tech:xamarin
1713
+ tech:xcode
1714
+ tech:xml
1715
+ tech:yaml
1716
+ tech:yarn
1717
+ tech:yii-framework
1718
+ tech:yuno-host
1719
+ tech:zend-framework
1720
+ tech:zig
1721
+ }}`,qC="likec4builtin",jW=`${qC}:///likec4/lib/icons.c4`;var no=Ks();const UW=new no.NotificationType("likec4/onDidChangeModel"),GW=new no.RequestType0("likec4/fetchModel"),WW=new no.RequestType("likec4/fetchComputedModel"),HW=new no.RequestType("likec4/computeView"),VW=new no.RequestType("likec4/build"),KW=new no.RequestType("likec4/locate"),YW=new no.RequestType("likec4/change-view");var Sv,jC;function XW(){return jC||(jC=1,Sv=t=>{const e=t.match(/^[ \t]*(?=\S)/gm);return e?e.reduce((n,r)=>Math.min(n,r.length),1/0):0}),Sv}var JW=XW();function kv(t){const e=JW(t);if(e===0)return t;const n=new RegExp(`^[ \\t]{${e}}`,"gm");return t.replace(n,"")}var $v,UC;function ZW(){if(UC)return $v;UC=1;function t(e){for(var n=5381,r=e.length;r;)n=n*33^e.charCodeAt(--r);return n>>>0}return $v=t,$v}var QW=ZW(),eH=Object.getOwnPropertyNames,tH=Object.getOwnPropertySymbols,nH=Object.prototype.hasOwnProperty;function GC(t,e){return function(r,i,s){return t(r,i,s)&&e(r,i,s)}}function mh(t){return function(n,r,i){if(!n||!r||typeof n!="object"||typeof r!="object")return t(n,r,i);var s=i.cache,o=s.get(n),a=s.get(r);if(o&&a)return o===r&&a===n;s.set(n,r),s.set(r,n);var c=t(n,r,i);return s.delete(n),s.delete(r),c}}function WC(t){return eH(t).concat(tH(t))}var HC=Object.hasOwn||function(t,e){return nH.call(t,e)};function ua(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var VC="_owner",KC=Object.getOwnPropertyDescriptor,YC=Object.keys;function rH(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function iH(t,e){return ua(t.getTime(),e.getTime())}function XC(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],h=d[1],p=a.value,g=p[0],y=p[1];!u&&!r[l]&&(u=n.equals(f,g,s,l,t,e,n)&&n.equals(h,y,f,g,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function sH(t,e,n){var r=YC(t),i=r.length;if(YC(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===VC&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!HC(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Nu(t,e,n){var r=WC(t),i=r.length;if(WC(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===VC&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!HC(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=KC(t,s),a=KC(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function oH(t,e){return ua(t.valueOf(),e.valueOf())}function aH(t,e){return t.source===e.source&&t.flags===e.flags}function JC(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function cH(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var uH="[object Arguments]",lH="[object Boolean]",dH="[object Date]",fH="[object Map]",hH="[object Number]",pH="[object Object]",gH="[object RegExp]",mH="[object Set]",yH="[object String]",vH=Array.isArray,ZC=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,QC=Object.assign,wH=Object.prototype.toString.call.bind(Object.prototype.toString);function bH(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(l,d,f){if(l===d)return!0;if(l==null||d==null||typeof l!="object"||typeof d!="object")return l!==l&&d!==d;var h=l.constructor;if(h!==d.constructor)return!1;if(h===Object)return i(l,d,f);if(vH(l))return e(l,d,f);if(ZC!=null&&ZC(l))return c(l,d,f);if(h===Date)return n(l,d,f);if(h===RegExp)return o(l,d,f);if(h===Map)return r(l,d,f);if(h===Set)return a(l,d,f);var p=wH(l);return p===dH?n(l,d,f):p===gH?o(l,d,f):p===fH?r(l,d,f):p===mH?a(l,d,f):p===pH?typeof l.then!="function"&&typeof d.then!="function"&&i(l,d,f):p===uH?i(l,d,f):p===lH||p===hH||p===yH?s(l,d,f):!1}}function EH(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Nu:rH,areDatesEqual:iH,areMapsEqual:r?GC(XC,Nu):XC,areObjectsEqual:r?Nu:sH,arePrimitiveWrappersEqual:oH,areRegExpsEqual:aH,areSetsEqual:r?GC(JC,Nu):JC,areTypedArraysEqual:r?Nu:cH};if(n&&(i=QC({},i,n(i))),e){var s=mh(i.areArraysEqual),o=mh(i.areMapsEqual),a=mh(i.areObjectsEqual),c=mh(i.areSetsEqual);i=QC({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function DH(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function TH(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(c,u){var l=r(),d=l.cache,f=d===void 0?e?new WeakMap:void 0:d,h=l.meta;return n(c,u,{cache:f,equals:i,meta:h,strict:s})};if(e)return function(c,u){return n(c,u,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(c,u){return n(c,u,o)}}var e_=Ji();Ji({strict:!0}),Ji({circular:!0}),Ji({circular:!0,strict:!0}),Ji({createInternalComparator:function(){return ua}}),Ji({strict:!0,createInternalComparator:function(){return ua}}),Ji({circular:!0,createInternalComparator:function(){return ua}}),Ji({circular:!0,createInternalComparator:function(){return ua},strict:!0});function Ji(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=EH(t),c=bH(a),u=r?r(c):DH(c);return TH({circular:n,comparator:c,createState:i,equals:u,strict:o})}var Cv,t_;function _v(){if(t_)return Cv;t_=1;var t="\0",e="\0",n="";class r{_isDirected=!0;_isMultigraph=!1;_isCompound=!1;_label;_defaultNodeLabelFn=()=>{};_defaultEdgeLabelFn=()=>{};_nodes={};_in={};_preds={};_out={};_sucs={};_edgeObjs={};_edgeLabels={};_nodeCount=0;_edgeCount=0;_parent;_children;constructor(l){l&&(this._isDirected=Object.hasOwn(l,"directed")?l.directed:!0,this._isMultigraph=Object.hasOwn(l,"multigraph")?l.multigraph:!1,this._isCompound=Object.hasOwn(l,"compound")?l.compound:!1),this._isCompound&&(this._parent={},this._children={},this._children[e]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(l){return this._label=l,this}graph(){return this._label}setDefaultNodeLabel(l){return this._defaultNodeLabelFn=l,typeof l!="function"&&(this._defaultNodeLabelFn=()=>l),this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){var l=this;return this.nodes().filter(d=>Object.keys(l._in[d]).length===0)}sinks(){var l=this;return this.nodes().filter(d=>Object.keys(l._out[d]).length===0)}setNodes(l,d){var f=arguments,h=this;return l.forEach(function(p){f.length>1?h.setNode(p,d):h.setNode(p)}),this}setNode(l,d){return Object.hasOwn(this._nodes,l)?(arguments.length>1&&(this._nodes[l]=d),this):(this._nodes[l]=arguments.length>1?d:this._defaultNodeLabelFn(l),this._isCompound&&(this._parent[l]=e,this._children[l]={},this._children[e][l]=!0),this._in[l]={},this._preds[l]={},this._out[l]={},this._sucs[l]={},++this._nodeCount,this)}node(l){return this._nodes[l]}hasNode(l){return Object.hasOwn(this._nodes,l)}removeNode(l){var d=this;if(Object.hasOwn(this._nodes,l)){var f=h=>d.removeEdge(d._edgeObjs[h]);delete this._nodes[l],this._isCompound&&(this._removeFromParentsChildList(l),delete this._parent[l],this.children(l).forEach(function(h){d.setParent(h)}),delete this._children[l]),Object.keys(this._in[l]).forEach(f),delete this._in[l],delete this._preds[l],Object.keys(this._out[l]).forEach(f),delete this._out[l],delete this._sucs[l],--this._nodeCount}return this}setParent(l,d){if(!this._isCompound)throw new Error("Cannot set parent in a non-compound graph");if(d===void 0)d=e;else{d+="";for(var f=d;f!==void 0;f=this.parent(f))if(f===l)throw new Error("Setting "+d+" as parent of "+l+" would create a cycle");this.setNode(d)}return this.setNode(l),this._removeFromParentsChildList(l),this._parent[l]=d,this._children[d][l]=!0,this}_removeFromParentsChildList(l){delete this._children[this._parent[l]][l]}parent(l){if(this._isCompound){var d=this._parent[l];if(d!==e)return d}}children(l=e){if(this._isCompound){var d=this._children[l];if(d)return Object.keys(d)}else{if(l===e)return this.nodes();if(this.hasNode(l))return[]}}predecessors(l){var d=this._preds[l];if(d)return Object.keys(d)}successors(l){var d=this._sucs[l];if(d)return Object.keys(d)}neighbors(l){var d=this.predecessors(l);if(d){const h=new Set(d);for(var f of this.successors(l))h.add(f);return Array.from(h.values())}}isLeaf(l){var d;return this.isDirected()?d=this.successors(l):d=this.neighbors(l),d.length===0}filterNodes(l){var d=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});d.setGraph(this.graph());var f=this;Object.entries(this._nodes).forEach(function([g,y]){l(g)&&d.setNode(g,y)}),Object.values(this._edgeObjs).forEach(function(g){d.hasNode(g.v)&&d.hasNode(g.w)&&d.setEdge(g,f.edge(g))});var h={};function p(g){var y=f.parent(g);return y===void 0||d.hasNode(y)?(h[g]=y,y):y in h?h[y]:p(y)}return this._isCompound&&d.nodes().forEach(g=>d.setParent(g,p(g))),d}setDefaultEdgeLabel(l){return this._defaultEdgeLabelFn=l,typeof l!="function"&&(this._defaultEdgeLabelFn=()=>l),this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(l,d){var f=this,h=arguments;return l.reduce(function(p,g){return h.length>1?f.setEdge(p,g,d):f.setEdge(p,g),g}),this}setEdge(){var l,d,f,h,p=!1,g=arguments[0];typeof g=="object"&&g!==null&&"v"in g?(l=g.v,d=g.w,f=g.name,arguments.length===2&&(h=arguments[1],p=!0)):(l=g,d=arguments[1],f=arguments[3],arguments.length>2&&(h=arguments[2],p=!0)),l=""+l,d=""+d,f!==void 0&&(f=""+f);var y=o(this._isDirected,l,d,f);if(Object.hasOwn(this._edgeLabels,y))return p&&(this._edgeLabels[y]=h),this;if(f!==void 0&&!this._isMultigraph)throw new Error("Cannot set a named edge when isMultigraph = false");this.setNode(l),this.setNode(d),this._edgeLabels[y]=p?h:this._defaultEdgeLabelFn(l,d,f);var m=a(this._isDirected,l,d,f);return l=m.v,d=m.w,Object.freeze(m),this._edgeObjs[y]=m,i(this._preds[d],l),i(this._sucs[l],d),this._in[d][y]=m,this._out[l][y]=m,this._edgeCount++,this}edge(l,d,f){var h=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,l,d,f);return this._edgeLabels[h]}edgeAsObj(){const l=this.edge(...arguments);return typeof l!="object"?{label:l}:l}hasEdge(l,d,f){var h=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,l,d,f);return Object.hasOwn(this._edgeLabels,h)}removeEdge(l,d,f){var h=arguments.length===1?c(this._isDirected,arguments[0]):o(this._isDirected,l,d,f),p=this._edgeObjs[h];return p&&(l=p.v,d=p.w,delete this._edgeLabels[h],delete this._edgeObjs[h],s(this._preds[d],l),s(this._sucs[l],d),delete this._in[d][h],delete this._out[l][h],this._edgeCount--),this}inEdges(l,d){var f=this._in[l];if(f){var h=Object.values(f);return d?h.filter(p=>p.v===d):h}}outEdges(l,d){var f=this._out[l];if(f){var h=Object.values(f);return d?h.filter(p=>p.w===d):h}}nodeEdges(l,d){var f=this.inEdges(l,d);if(f)return f.concat(this.outEdges(l,d))}}function i(u,l){u[l]?u[l]++:u[l]=1}function s(u,l){--u[l]||delete u[l]}function o(u,l,d,f){var h=""+l,p=""+d;if(!u&&h>p){var g=h;h=p,p=g}return h+n+p+n+(f===void 0?t:f)}function a(u,l,d,f){var h=""+l,p=""+d;if(!u&&h>p){var g=h;h=p,p=g}var y={v:h,w:p};return f&&(y.name=f),y}function c(u,l){return o(u,l.v,l.w,l.name)}return Cv=r,Cv}var Av,n_;function RH(){return n_||(n_=1,Av="2.2.4"),Av}var xv,r_;function SH(){return r_||(r_=1,xv={Graph:_v(),version:RH()}),xv}var Iv,i_;function kH(){if(i_)return Iv;i_=1;var t=_v();Iv={write:e,read:i};function e(s){var o={options:{directed:s.isDirected(),multigraph:s.isMultigraph(),compound:s.isCompound()},nodes:n(s),edges:r(s)};return s.graph()!==void 0&&(o.value=structuredClone(s.graph())),o}function n(s){return s.nodes().map(function(o){var a=s.node(o),c=s.parent(o),u={v:o};return a!==void 0&&(u.value=a),c!==void 0&&(u.parent=c),u})}function r(s){return s.edges().map(function(o){var a=s.edge(o),c={v:o.v,w:o.w};return o.name!==void 0&&(c.name=o.name),a!==void 0&&(c.value=a),c})}function i(s){var o=new t(s.options).setGraph(s.value);return s.nodes.forEach(function(a){o.setNode(a.v,a.value),a.parent&&o.setParent(a.v,a.parent)}),s.edges.forEach(function(a){o.setEdge({v:a.v,w:a.w,name:a.name},a.value)}),o}return Iv}var Pv,s_;function $H(){if(s_)return Pv;s_=1,Pv=t;function t(e){var n={},r=[],i;function s(o){Object.hasOwn(n,o)||(n[o]=!0,i.push(o),e.successors(o).forEach(s),e.predecessors(o).forEach(s))}return e.nodes().forEach(function(o){i=[],s(o),i.length&&r.push(i)}),r}return Pv}var Nv,o_;function a_(){if(o_)return Nv;o_=1;class t{_arr=[];_keyIndices={};size(){return this._arr.length}keys(){return this._arr.map(function(n){return n.key})}has(n){return Object.hasOwn(this._keyIndices,n)}priority(n){var r=this._keyIndices[n];if(r!==void 0)return this._arr[r].priority}min(){if(this.size()===0)throw new Error("Queue underflow");return this._arr[0].key}add(n,r){var i=this._keyIndices;if(n=String(n),!Object.hasOwn(i,n)){var s=this._arr,o=s.length;return i[n]=o,s.push({key:n,priority:r}),this._decrease(o),!0}return!1}removeMin(){this._swap(0,this._arr.length-1);var n=this._arr.pop();return delete this._keyIndices[n.key],this._heapify(0),n.key}decrease(n,r){var i=this._keyIndices[n];if(r>this._arr[i].priority)throw new Error("New priority is greater than current priority. Key: "+n+" Old: "+this._arr[i].priority+" New: "+r);this._arr[i].priority=r,this._decrease(i)}_heapify(n){var r=this._arr,i=2*n,s=i+1,o=n;i<r.length&&(o=r[i].priority<r[o].priority?i:o,s<r.length&&(o=r[s].priority<r[o].priority?s:o),o!==n&&(this._swap(n,o),this._heapify(o)))}_decrease(n){for(var r=this._arr,i=r[n].priority,s;n!==0&&(s=n>>1,!(r[s].priority<i));)this._swap(n,s),n=s}_swap(n,r){var i=this._arr,s=this._keyIndices,o=i[n],a=i[r];i[n]=a,i[r]=o,s[a.key]=n,s[o.key]=r}}return Nv=t,Nv}var Ov,c_;function u_(){if(c_)return Ov;c_=1;var t=a_();Ov=n;var e=()=>1;function n(i,s,o,a){return r(i,String(s),o||e,a||function(c){return i.outEdges(c)})}function r(i,s,o,a){var c={},u=new t,l,d,f=function(h){var p=h.v!==l?h.v:h.w,g=c[p],y=o(h),m=d.distance+y;if(y<0)throw new Error("dijkstra does not allow negative edge weights. Bad edge: "+h+" Weight: "+y);m<g.distance&&(g.distance=m,g.predecessor=l,u.decrease(p,m))};for(i.nodes().forEach(function(h){var p=h===s?0:Number.POSITIVE_INFINITY;c[h]={distance:p},u.add(h,p)});u.size()>0&&(l=u.removeMin(),d=c[l],d.distance!==Number.POSITIVE_INFINITY);)a(l).forEach(f);return c}return Ov}var Fv,l_;function CH(){if(l_)return Fv;l_=1;var t=u_();Fv=e;function e(n,r,i){return n.nodes().reduce(function(s,o){return s[o]=t(n,o,r,i),s},{})}return Fv}var Lv,d_;function f_(){if(d_)return Lv;d_=1,Lv=t;function t(e){var n=0,r=[],i={},s=[];function o(a){var c=i[a]={onStack:!0,lowlink:n,index:n++};if(r.push(a),e.successors(a).forEach(function(d){Object.hasOwn(i,d)?i[d].onStack&&(c.lowlink=Math.min(c.lowlink,i[d].index)):(o(d),c.lowlink=Math.min(c.lowlink,i[d].lowlink))}),c.lowlink===c.index){var u=[],l;do l=r.pop(),i[l].onStack=!1,u.push(l);while(a!==l);s.push(u)}}return e.nodes().forEach(function(a){Object.hasOwn(i,a)||o(a)}),s}return Lv}var Mv,h_;function _H(){if(h_)return Mv;h_=1;var t=f_();Mv=e;function e(n){return t(n).filter(function(r){return r.length>1||r.length===1&&n.hasEdge(r[0],r[0])})}return Mv}var zv,p_;function AH(){if(p_)return zv;p_=1,zv=e;var t=()=>1;function e(r,i,s){return n(r,i||t,s||function(o){return r.outEdges(o)})}function n(r,i,s){var o={},a=r.nodes();return a.forEach(function(c){o[c]={},o[c][c]={distance:0},a.forEach(function(u){c!==u&&(o[c][u]={distance:Number.POSITIVE_INFINITY})}),s(c).forEach(function(u){var l=u.v===c?u.w:u.v,d=i(u);o[c][l]={distance:d,predecessor:c}})}),a.forEach(function(c){var u=o[c];a.forEach(function(l){var d=o[l];a.forEach(function(f){var h=d[c],p=u[f],g=d[f],y=h.distance+p.distance;y<g.distance&&(g.distance=y,g.predecessor=p.predecessor)})})}),o}return zv}var Bv,g_;function m_(){if(g_)return Bv;g_=1;function t(n){var r={},i={},s=[];function o(a){if(Object.hasOwn(i,a))throw new e;Object.hasOwn(r,a)||(i[a]=!0,r[a]=!0,n.predecessors(a).forEach(o),delete i[a],s.push(a))}if(n.sinks().forEach(o),Object.keys(r).length!==n.nodeCount())throw new e;return s}class e extends Error{constructor(){super(...arguments)}}return Bv=t,t.CycleException=e,Bv}var qv,y_;function xH(){if(y_)return qv;y_=1;var t=m_();qv=e;function e(n){try{t(n)}catch(r){if(r instanceof t.CycleException)return!1;throw r}return!0}return qv}var jv,v_;function w_(){if(v_)return jv;v_=1,jv=t;function t(i,s,o){Array.isArray(s)||(s=[s]);var a=i.isDirected()?d=>i.successors(d):d=>i.neighbors(d),c=o==="post"?e:n,u=[],l={};return s.forEach(d=>{if(!i.hasNode(d))throw new Error("Graph does not have node: "+d);c(d,a,l,u)}),u}function e(i,s,o,a){for(var c=[[i,!1]];c.length>0;){var u=c.pop();u[1]?a.push(u[0]):Object.hasOwn(o,u[0])||(o[u[0]]=!0,c.push([u[0],!0]),r(s(u[0]),l=>c.push([l,!1])))}}function n(i,s,o,a){for(var c=[i];c.length>0;){var u=c.pop();Object.hasOwn(o,u)||(o[u]=!0,a.push(u),r(s(u),l=>c.push(l)))}}function r(i,s){for(var o=i.length;o--;)s(i[o],o,i);return i}return jv}var Uv,b_;function IH(){if(b_)return Uv;b_=1;var t=w_();Uv=e;function e(n,r){return t(n,r,"post")}return Uv}var Gv,E_;function PH(){if(E_)return Gv;E_=1;var t=w_();Gv=e;function e(n,r){return t(n,r,"pre")}return Gv}var Wv,D_;function NH(){if(D_)return Wv;D_=1;var t=_v(),e=a_();Wv=n;function n(r,i){var s=new t,o={},a=new e,c;function u(d){var f=d.v===c?d.w:d.v,h=a.priority(f);if(h!==void 0){var p=i(d);p<h&&(o[f]=c,a.decrease(f,p))}}if(r.nodeCount()===0)return s;r.nodes().forEach(function(d){a.add(d,Number.POSITIVE_INFINITY),s.setNode(d)}),a.decrease(r.nodes()[0],0);for(var l=!1;a.size()>0;){if(c=a.removeMin(),Object.hasOwn(o,c))s.setEdge(c,o[c]);else{if(l)throw new Error("Input graph is not connected: "+r);l=!0}r.nodeEdges(c).forEach(u)}return s}return Wv}var Hv,T_;function OH(){return T_||(T_=1,Hv={components:$H(),dijkstra:u_(),dijkstraAll:CH(),findCycles:_H(),floydWarshall:AH(),isAcyclic:xH(),postorder:IH(),preorder:PH(),prim:NH(),tarjan:f_(),topsort:m_()}),Hv}var Vv,R_;function vr(){if(R_)return Vv;R_=1;var t=SH();return Vv={Graph:t.Graph,json:kH(),alg:OH(),version:t.version},Vv}var Kv,S_;function FH(){if(S_)return Kv;S_=1;class t{constructor(){let i={};i._next=i._prev=i,this._sentinel=i}dequeue(){let i=this._sentinel,s=i._prev;if(s!==i)return e(s),s}enqueue(i){let s=this._sentinel;i._prev&&i._next&&e(i),i._next=s._next,s._next._prev=i,s._next=i,i._prev=s}toString(){let i=[],s=this._sentinel,o=s._prev;for(;o!==s;)i.push(JSON.stringify(o,n)),o=o._prev;return"["+i.join(", ")+"]"}}function e(r){r._prev._next=r._next,r._next._prev=r._prev,delete r._next,delete r._prev}function n(r,i){if(r!=="_next"&&r!=="_prev")return i}return Kv=t,Kv}var Yv,k_;function LH(){if(k_)return Yv;k_=1;let t=vr().Graph,e=FH();Yv=r;let n=()=>1;function r(u,l){if(u.nodeCount()<=1)return[];let d=o(u,l||n);return i(d.graph,d.buckets,d.zeroIdx).flatMap(h=>u.outEdges(h.v,h.w))}function i(u,l,d){let f=[],h=l[l.length-1],p=l[0],g;for(;u.nodeCount();){for(;g=p.dequeue();)s(u,l,d,g);for(;g=h.dequeue();)s(u,l,d,g);if(u.nodeCount()){for(let y=l.length-2;y>0;--y)if(g=l[y].dequeue(),g){f=f.concat(s(u,l,d,g,!0));break}}}return f}function s(u,l,d,f,h){let p=h?[]:void 0;return u.inEdges(f.v).forEach(g=>{let y=u.edge(g),m=u.node(g.v);h&&p.push({v:g.v,w:g.w}),m.out-=y,a(l,d,m)}),u.outEdges(f.v).forEach(g=>{let y=u.edge(g),m=g.w,w=u.node(m);w.in-=y,a(l,d,w)}),u.removeNode(f.v),p}function o(u,l){let d=new t,f=0,h=0;u.nodes().forEach(y=>{d.setNode(y,{v:y,in:0,out:0})}),u.edges().forEach(y=>{let m=d.edge(y.v,y.w)||0,w=l(y),E=m+w;d.setEdge(y.v,y.w,E),h=Math.max(h,d.node(y.v).out+=w),f=Math.max(f,d.node(y.w).in+=w)});let p=c(h+f+3).map(()=>new e),g=f+1;return d.nodes().forEach(y=>{a(p,g,d.node(y))}),{graph:d,buckets:p,zeroIdx:g}}function a(u,l,d){d.out?d.in?u[d.out-d.in+l].enqueue(d):u[u.length-1].enqueue(d):u[0].enqueue(d)}function c(u){const l=[];for(let d=0;d<u;d++)l.push(d);return l}return Yv}var Xv,$_;function At(){if($_)return Xv;$_=1;let t=vr().Graph;Xv={addBorderNode:l,addDummyNode:e,applyWithChunking:h,asNonCompoundGraph:r,buildLayerMatrix:a,intersectRect:o,mapValues:I,maxRank:p,normalizeRanks:c,notime:m,partition:g,pick:A,predecessorWeights:s,range:k,removeEmptyRanks:u,simplify:n,successorWeights:i,time:y,uniqueId:E,zipObject:x};function e(_,P,O,C){let D;do D=E(C);while(_.hasNode(D));return O.dummy=P,_.setNode(D,O),D}function n(_){let P=new t().setGraph(_.graph());return _.nodes().forEach(O=>P.setNode(O,_.node(O))),_.edges().forEach(O=>{let C=P.edge(O.v,O.w)||{weight:0,minlen:1},D=_.edge(O);P.setEdge(O.v,O.w,{weight:C.weight+D.weight,minlen:Math.max(C.minlen,D.minlen)})}),P}function r(_){let P=new t({multigraph:_.isMultigraph()}).setGraph(_.graph());return _.nodes().forEach(O=>{_.children(O).length||P.setNode(O,_.node(O))}),_.edges().forEach(O=>{P.setEdge(O,_.edge(O))}),P}function i(_){let P=_.nodes().map(O=>{let C={};return _.outEdges(O).forEach(D=>{C[D.w]=(C[D.w]||0)+_.edge(D).weight}),C});return x(_.nodes(),P)}function s(_){let P=_.nodes().map(O=>{let C={};return _.inEdges(O).forEach(D=>{C[D.v]=(C[D.v]||0)+_.edge(D).weight}),C});return x(_.nodes(),P)}function o(_,P){let O=_.x,C=_.y,D=P.x-O,R=P.y-C,L=_.width/2,W=_.height/2;if(!D&&!R)throw new Error("Not possible to find intersection inside of the rectangle");let V,Z;return Math.abs(R)*L>Math.abs(D)*W?(R<0&&(W=-W),V=W*D/R,Z=W):(D<0&&(L=-L),V=L,Z=L*R/D),{x:O+V,y:C+Z}}function a(_){let P=k(p(_)+1).map(()=>[]);return _.nodes().forEach(O=>{let C=_.node(O),D=C.rank;D!==void 0&&(P[D][C.order]=O)}),P}function c(_){let P=_.nodes().map(C=>{let D=_.node(C).rank;return D===void 0?Number.MAX_VALUE:D}),O=h(Math.min,P);_.nodes().forEach(C=>{let D=_.node(C);Object.hasOwn(D,"rank")&&(D.rank-=O)})}function u(_){let P=_.nodes().map(L=>_.node(L).rank),O=h(Math.min,P),C=[];_.nodes().forEach(L=>{let W=_.node(L).rank-O;C[W]||(C[W]=[]),C[W].push(L)});let D=0,R=_.graph().nodeRankFactor;Array.from(C).forEach((L,W)=>{L===void 0&&W%R!==0?--D:L!==void 0&&D&&L.forEach(V=>_.node(V).rank+=D)})}function l(_,P,O,C){let D={width:0,height:0};return arguments.length>=4&&(D.rank=O,D.order=C),e(_,"border",D,P)}function d(_,P=f){const O=[];for(let C=0;C<_.length;C+=P){const D=_.slice(C,C+P);O.push(D)}return O}const f=65535;function h(_,P){if(P.length>f){const O=d(P);return _.apply(null,O.map(C=>_.apply(null,C)))}else return _.apply(null,P)}function p(_){const O=_.nodes().map(C=>{let D=_.node(C).rank;return D===void 0?Number.MIN_VALUE:D});return h(Math.max,O)}function g(_,P){let O={lhs:[],rhs:[]};return _.forEach(C=>{P(C)?O.lhs.push(C):O.rhs.push(C)}),O}function y(_,P){let O=Date.now();try{return P()}finally{console.log(_+" time: "+(Date.now()-O)+"ms")}}function m(_,P){return P()}let w=0;function E(_){var P=++w;return toString(_)+P}function k(_,P,O=1){P==null&&(P=_,_=0);let C=R=>R<P;O<0&&(C=R=>P<R);const D=[];for(let R=_;C(R);R+=O)D.push(R);return D}function A(_,P){const O={};for(const C of P)_[C]!==void 0&&(O[C]=_[C]);return O}function I(_,P){let O=P;return typeof P=="string"&&(O=C=>C[P]),Object.entries(_).reduce((C,[D,R])=>(C[D]=O(R,D),C),{})}function x(_,P){return _.reduce((O,C,D)=>(O[C]=P[D],O),{})}return Xv}var Jv,C_;function MH(){if(C_)return Jv;C_=1;let t=LH(),e=At().uniqueId;Jv={run:n,undo:i};function n(s){(s.graph().acyclicer==="greedy"?t(s,a(s)):r(s)).forEach(c=>{let u=s.edge(c);s.removeEdge(c),u.forwardName=c.name,u.reversed=!0,s.setEdge(c.w,c.v,u,e("rev"))});function a(c){return u=>c.edge(u).weight}}function r(s){let o=[],a={},c={};function u(l){Object.hasOwn(c,l)||(c[l]=!0,a[l]=!0,s.outEdges(l).forEach(d=>{Object.hasOwn(a,d.w)?o.push(d):u(d.w)}),delete a[l])}return s.nodes().forEach(u),o}function i(s){s.edges().forEach(o=>{let a=s.edge(o);if(a.reversed){s.removeEdge(o);let c=a.forwardName;delete a.reversed,delete a.forwardName,s.setEdge(o.w,o.v,a,c)}})}return Jv}var Zv,__;function zH(){if(__)return Zv;__=1;let t=At();Zv={run:e,undo:r};function e(i){i.graph().dummyChains=[],i.edges().forEach(s=>n(i,s))}function n(i,s){let o=s.v,a=i.node(o).rank,c=s.w,u=i.node(c).rank,l=s.name,d=i.edge(s),f=d.labelRank;if(u===a+1)return;i.removeEdge(s);let h,p,g;for(g=0,++a;a<u;++g,++a)d.points=[],p={width:0,height:0,edgeLabel:d,edgeObj:s,rank:a},h=t.addDummyNode(i,"edge",p,"_d"),a===f&&(p.width=d.width,p.height=d.height,p.dummy="edge-label",p.labelpos=d.labelpos),i.setEdge(o,h,{weight:d.weight},l),g===0&&i.graph().dummyChains.push(h),o=h;i.setEdge(o,c,{weight:d.weight},l)}function r(i){i.graph().dummyChains.forEach(s=>{let o=i.node(s),a=o.edgeLabel,c;for(i.setEdge(o.edgeObj,a);o.dummy;)c=i.successors(s)[0],i.removeNode(s),a.points.push({x:o.x,y:o.y}),o.dummy==="edge-label"&&(a.x=o.x,a.y=o.y,a.width=o.width,a.height=o.height),s=c,o=i.node(s)})}return Zv}var Qv,A_;function yh(){if(A_)return Qv;A_=1;const{applyWithChunking:t}=At();Qv={longestPath:e,slack:n};function e(r){var i={};function s(o){var a=r.node(o);if(Object.hasOwn(i,o))return a.rank;i[o]=!0;let c=r.outEdges(o).map(l=>l==null?Number.POSITIVE_INFINITY:s(l.w)-r.edge(l).minlen);var u=t(Math.min,c);return u===Number.POSITIVE_INFINITY&&(u=0),a.rank=u}r.sources().forEach(s)}function n(r,i){return r.node(i.w).rank-r.node(i.v).rank-r.edge(i).minlen}return Qv}var ew,x_;function I_(){if(x_)return ew;x_=1;var t=vr().Graph,e=yh().slack;ew=n;function n(o){var a=new t({directed:!1}),c=o.nodes()[0],u=o.nodeCount();a.setNode(c,{});for(var l,d;r(a,o)<u;)l=i(a,o),d=a.hasNode(l.v)?e(o,l):-e(o,l),s(a,o,d);return a}function r(o,a){function c(u){a.nodeEdges(u).forEach(l=>{var d=l.v,f=u===d?l.w:d;!o.hasNode(f)&&!e(a,l)&&(o.setNode(f,{}),o.setEdge(u,f,{}),c(f))})}return o.nodes().forEach(c),o.nodeCount()}function i(o,a){return a.edges().reduce((u,l)=>{let d=Number.POSITIVE_INFINITY;return o.hasNode(l.v)!==o.hasNode(l.w)&&(d=e(a,l)),d<u[0]?[d,l]:u},[Number.POSITIVE_INFINITY,null])[1]}function s(o,a,c){o.nodes().forEach(u=>a.node(u).rank+=c)}return ew}var tw,P_;function BH(){if(P_)return tw;P_=1;var t=I_(),e=yh().slack,n=yh().longestPath,r=vr().alg.preorder,i=vr().alg.postorder,s=At().simplify;tw=o,o.initLowLimValues=l,o.initCutValues=a,o.calcCutValue=u,o.leaveEdge=f,o.enterEdge=h,o.exchangeEdges=p;function o(w){w=s(w),n(w);var E=t(w);l(E),a(E,w);for(var k,A;k=f(E);)A=h(E,w,k),p(E,w,k,A)}function a(w,E){var k=i(w,w.nodes());k=k.slice(0,k.length-1),k.forEach(A=>c(w,E,A))}function c(w,E,k){var A=w.node(k),I=A.parent;w.edge(k,I).cutvalue=u(w,E,k)}function u(w,E,k){var A=w.node(k),I=A.parent,x=!0,_=E.edge(k,I),P=0;return _||(x=!1,_=E.edge(I,k)),P=_.weight,E.nodeEdges(k).forEach(O=>{var C=O.v===k,D=C?O.w:O.v;if(D!==I){var R=C===x,L=E.edge(O).weight;if(P+=R?L:-L,y(w,k,D)){var W=w.edge(k,D).cutvalue;P+=R?-W:W}}}),P}function l(w,E){arguments.length<2&&(E=w.nodes()[0]),d(w,{},1,E)}function d(w,E,k,A,I){var x=k,_=w.node(A);return E[A]=!0,w.neighbors(A).forEach(P=>{Object.hasOwn(E,P)||(k=d(w,E,k,P,A))}),_.low=x,_.lim=k++,I?_.parent=I:delete _.parent,k}function f(w){return w.edges().find(E=>w.edge(E).cutvalue<0)}function h(w,E,k){var A=k.v,I=k.w;E.hasEdge(A,I)||(A=k.w,I=k.v);var x=w.node(A),_=w.node(I),P=x,O=!1;x.lim>_.lim&&(P=_,O=!0);var C=E.edges().filter(D=>O===m(w,w.node(D.v),P)&&O!==m(w,w.node(D.w),P));return C.reduce((D,R)=>e(E,R)<e(E,D)?R:D)}function p(w,E,k,A){var I=k.v,x=k.w;w.removeEdge(I,x),w.setEdge(A.v,A.w,{}),l(w),a(w,E),g(w,E)}function g(w,E){var k=w.nodes().find(I=>!E.node(I).parent),A=r(w,k);A=A.slice(1),A.forEach(I=>{var x=w.node(I).parent,_=E.edge(I,x),P=!1;_||(_=E.edge(x,I),P=!0),E.node(I).rank=E.node(x).rank+(P?_.minlen:-_.minlen)})}function y(w,E,k){return w.hasEdge(E,k)}function m(w,E,k){return k.low<=E.lim&&E.lim<=k.lim}return tw}var nw,N_;function qH(){if(N_)return nw;N_=1;var t=yh(),e=t.longestPath,n=I_(),r=BH();nw=i;function i(c){switch(c.graph().ranker){case"network-simplex":a(c);break;case"tight-tree":o(c);break;case"longest-path":s(c);break;default:a(c)}}var s=e;function o(c){e(c),n(c)}function a(c){r(c)}return nw}var rw,O_;function jH(){if(O_)return rw;O_=1,rw=t;function t(r){let i=n(r);r.graph().dummyChains.forEach(s=>{let o=r.node(s),a=o.edgeObj,c=e(r,i,a.v,a.w),u=c.path,l=c.lca,d=0,f=u[d],h=!0;for(;s!==a.w;){if(o=r.node(s),h){for(;(f=u[d])!==l&&r.node(f).maxRank<o.rank;)d++;f===l&&(h=!1)}if(!h){for(;d<u.length-1&&r.node(f=u[d+1]).minRank<=o.rank;)d++;f=u[d]}r.setParent(s,f),s=r.successors(s)[0]}})}function e(r,i,s,o){let a=[],c=[],u=Math.min(i[s].low,i[o].low),l=Math.max(i[s].lim,i[o].lim),d,f;d=s;do d=r.parent(d),a.push(d);while(d&&(i[d].low>u||l>i[d].lim));for(f=d,d=o;(d=r.parent(d))!==f;)c.push(d);return{path:a.concat(c.reverse()),lca:f}}function n(r){let i={},s=0;function o(a){let c=s;r.children(a).forEach(o),i[a]={low:c,lim:s++}}return r.children().forEach(o),i}return rw}var iw,F_;function UH(){if(F_)return iw;F_=1;let t=At();iw={run:e,cleanup:s};function e(o){let a=t.addDummyNode(o,"root",{},"_root"),c=r(o),u=Object.values(c),l=t.applyWithChunking(Math.max,u)-1,d=2*l+1;o.graph().nestingRoot=a,o.edges().forEach(h=>o.edge(h).minlen*=d);let f=i(o)+1;o.children().forEach(h=>n(o,a,d,f,l,c,h)),o.graph().nodeRankFactor=d}function n(o,a,c,u,l,d,f){let h=o.children(f);if(!h.length){f!==a&&o.setEdge(a,f,{weight:0,minlen:c});return}let p=t.addBorderNode(o,"_bt"),g=t.addBorderNode(o,"_bb"),y=o.node(f);o.setParent(p,f),y.borderTop=p,o.setParent(g,f),y.borderBottom=g,h.forEach(m=>{n(o,a,c,u,l,d,m);let w=o.node(m),E=w.borderTop?w.borderTop:m,k=w.borderBottom?w.borderBottom:m,A=w.borderTop?u:2*u,I=E!==k?1:l-d[f]+1;o.setEdge(p,E,{weight:A,minlen:I,nestingEdge:!0}),o.setEdge(k,g,{weight:A,minlen:I,nestingEdge:!0})}),o.parent(f)||o.setEdge(a,p,{weight:0,minlen:l+d[f]})}function r(o){var a={};function c(u,l){var d=o.children(u);d&&d.length&&d.forEach(f=>c(f,l+1)),a[u]=l}return o.children().forEach(u=>c(u,1)),a}function i(o){return o.edges().reduce((a,c)=>a+o.edge(c).weight,0)}function s(o){var a=o.graph();o.removeNode(a.nestingRoot),delete a.nestingRoot,o.edges().forEach(c=>{var u=o.edge(c);u.nestingEdge&&o.removeEdge(c)})}return iw}var sw,L_;function GH(){if(L_)return sw;L_=1;let t=At();sw=e;function e(r){function i(s){let o=r.children(s),a=r.node(s);if(o.length&&o.forEach(i),Object.hasOwn(a,"minRank")){a.borderLeft=[],a.borderRight=[];for(let c=a.minRank,u=a.maxRank+1;c<u;++c)n(r,"borderLeft","_bl",s,a,c),n(r,"borderRight","_br",s,a,c)}}r.children().forEach(i)}function n(r,i,s,o,a,c){let u={width:0,height:0,rank:c,borderType:i},l=a[i][c-1],d=t.addDummyNode(r,"border",u,s);a[i][c]=d,r.setParent(d,o),l&&r.setEdge(l,d,{weight:1})}return sw}var ow,M_;function WH(){if(M_)return ow;M_=1,ow={adjust:t,undo:e};function t(c){let u=c.graph().rankdir.toLowerCase();(u==="lr"||u==="rl")&&n(c)}function e(c){let u=c.graph().rankdir.toLowerCase();(u==="bt"||u==="rl")&&i(c),(u==="lr"||u==="rl")&&(o(c),n(c))}function n(c){c.nodes().forEach(u=>r(c.node(u))),c.edges().forEach(u=>r(c.edge(u)))}function r(c){let u=c.width;c.width=c.height,c.height=u}function i(c){c.nodes().forEach(u=>s(c.node(u))),c.edges().forEach(u=>{let l=c.edge(u);l.points.forEach(s),Object.hasOwn(l,"y")&&s(l)})}function s(c){c.y=-c.y}function o(c){c.nodes().forEach(u=>a(c.node(u))),c.edges().forEach(u=>{let l=c.edge(u);l.points.forEach(a),Object.hasOwn(l,"x")&&a(l)})}function a(c){let u=c.x;c.x=c.y,c.y=u}return ow}var aw,z_;function HH(){if(z_)return aw;z_=1;let t=At();aw=e;function e(n){let r={},i=n.nodes().filter(l=>!n.children(l).length),s=i.map(l=>n.node(l).rank),o=t.applyWithChunking(Math.max,s),a=t.range(o+1).map(()=>[]);function c(l){if(r[l])return;r[l]=!0;let d=n.node(l);a[d.rank].push(l),n.successors(l).forEach(c)}return i.sort((l,d)=>n.node(l).rank-n.node(d).rank).forEach(c),a}return aw}var cw,B_;function VH(){if(B_)return cw;B_=1;let t=At().zipObject;cw=e;function e(r,i){let s=0;for(let o=1;o<i.length;++o)s+=n(r,i[o-1],i[o]);return s}function n(r,i,s){let o=t(s,s.map((f,h)=>h)),a=i.flatMap(f=>r.outEdges(f).map(h=>({pos:o[h.w],weight:r.edge(h).weight})).sort((h,p)=>h.pos-p.pos)),c=1;for(;c<s.length;)c<<=1;let u=2*c-1;c-=1;let l=new Array(u).fill(0),d=0;return a.forEach(f=>{let h=f.pos+c;l[h]+=f.weight;let p=0;for(;h>0;)h%2&&(p+=l[h+1]),h=h-1>>1,l[h]+=f.weight;d+=f.weight*p}),d}return cw}var uw,q_;function KH(){if(q_)return uw;q_=1,uw=t;function t(e,n=[]){return n.map(r=>{let i=e.inEdges(r);if(i.length){let s=i.reduce((o,a)=>{let c=e.edge(a),u=e.node(a.v);return{sum:o.sum+c.weight*u.order,weight:o.weight+c.weight}},{sum:0,weight:0});return{v:r,barycenter:s.sum/s.weight,weight:s.weight}}else return{v:r}})}return uw}var lw,j_;function YH(){if(j_)return lw;j_=1;let t=At();lw=e;function e(i,s){let o={};i.forEach((c,u)=>{let l=o[c.v]={indegree:0,in:[],out:[],vs:[c.v],i:u};c.barycenter!==void 0&&(l.barycenter=c.barycenter,l.weight=c.weight)}),s.edges().forEach(c=>{let u=o[c.v],l=o[c.w];u!==void 0&&l!==void 0&&(l.indegree++,u.out.push(o[c.w]))});let a=Object.values(o).filter(c=>!c.indegree);return n(a)}function n(i){let s=[];function o(c){return u=>{u.merged||(u.barycenter===void 0||c.barycenter===void 0||u.barycenter>=c.barycenter)&&r(c,u)}}function a(c){return u=>{u.in.push(c),--u.indegree===0&&i.push(u)}}for(;i.length;){let c=i.pop();s.push(c),c.in.reverse().forEach(o(c)),c.out.forEach(a(c))}return s.filter(c=>!c.merged).map(c=>t.pick(c,["vs","i","barycenter","weight"]))}function r(i,s){let o=0,a=0;i.weight&&(o+=i.barycenter*i.weight,a+=i.weight),s.weight&&(o+=s.barycenter*s.weight,a+=s.weight),i.vs=s.vs.concat(i.vs),i.barycenter=o/a,i.weight=a,i.i=Math.min(s.i,i.i),s.merged=!0}return lw}var dw,U_;function XH(){if(U_)return dw;U_=1;let t=At();dw=e;function e(i,s){let o=t.partition(i,p=>Object.hasOwn(p,"barycenter")),a=o.lhs,c=o.rhs.sort((p,g)=>g.i-p.i),u=[],l=0,d=0,f=0;a.sort(r(!!s)),f=n(u,c,f),a.forEach(p=>{f+=p.vs.length,u.push(p.vs),l+=p.barycenter*p.weight,d+=p.weight,f=n(u,c,f)});let h={vs:u.flat(!0)};return d&&(h.barycenter=l/d,h.weight=d),h}function n(i,s,o){let a;for(;s.length&&(a=s[s.length-1]).i<=o;)s.pop(),i.push(a.vs),o++;return o}function r(i){return(s,o)=>s.barycenter<o.barycenter?-1:s.barycenter>o.barycenter?1:i?o.i-s.i:s.i-o.i}return dw}var fw,G_;function JH(){if(G_)return fw;G_=1;let t=KH(),e=YH(),n=XH();fw=r;function r(o,a,c,u){let l=o.children(a),d=o.node(a),f=d?d.borderLeft:void 0,h=d?d.borderRight:void 0,p={};f&&(l=l.filter(w=>w!==f&&w!==h));let g=t(o,l);g.forEach(w=>{if(o.children(w.v).length){let E=r(o,w.v,c,u);p[w.v]=E,Object.hasOwn(E,"barycenter")&&s(w,E)}});let y=e(g,c);i(y,p);let m=n(y,u);if(f&&(m.vs=[f,m.vs,h].flat(!0),o.predecessors(f).length)){let w=o.node(o.predecessors(f)[0]),E=o.node(o.predecessors(h)[0]);Object.hasOwn(m,"barycenter")||(m.barycenter=0,m.weight=0),m.barycenter=(m.barycenter*m.weight+w.order+E.order)/(m.weight+2),m.weight+=2}return m}function i(o,a){o.forEach(c=>{c.vs=c.vs.flatMap(u=>a[u]?a[u].vs:u)})}function s(o,a){o.barycenter!==void 0?(o.barycenter=(o.barycenter*o.weight+a.barycenter*a.weight)/(o.weight+a.weight),o.weight+=a.weight):(o.barycenter=a.barycenter,o.weight=a.weight)}return fw}var hw,W_;function ZH(){if(W_)return hw;W_=1;let t=vr().Graph,e=At();hw=n;function n(i,s,o){let a=r(i),c=new t({compound:!0}).setGraph({root:a}).setDefaultNodeLabel(u=>i.node(u));return i.nodes().forEach(u=>{let l=i.node(u),d=i.parent(u);(l.rank===s||l.minRank<=s&&s<=l.maxRank)&&(c.setNode(u),c.setParent(u,d||a),i[o](u).forEach(f=>{let h=f.v===u?f.w:f.v,p=c.edge(h,u),g=p!==void 0?p.weight:0;c.setEdge(h,u,{weight:i.edge(f).weight+g})}),Object.hasOwn(l,"minRank")&&c.setNode(u,{borderLeft:l.borderLeft[s],borderRight:l.borderRight[s]}))}),c}function r(i){for(var s;i.hasNode(s=e.uniqueId("_root")););return s}return hw}var pw,H_;function QH(){if(H_)return pw;H_=1,pw=t;function t(e,n,r){let i={},s;r.forEach(o=>{let a=e.parent(o),c,u;for(;a;){if(c=e.parent(a),c?(u=i[c],i[c]=a):(u=s,s=a),u&&u!==a){n.setEdge(u,a);return}a=c}})}return pw}var gw,V_;function eV(){if(V_)return gw;V_=1;let t=HH(),e=VH(),n=JH(),r=ZH(),i=QH(),s=vr().Graph,o=At();gw=a;function a(d,f){if(f&&typeof f.customOrder=="function"){f.customOrder(d,a);return}let h=o.maxRank(d),p=c(d,o.range(1,h+1),"inEdges"),g=c(d,o.range(h-1,-1,-1),"outEdges"),y=t(d);if(l(d,y),f&&f.disableOptimalOrderHeuristic)return;let m=Number.POSITIVE_INFINITY,w;for(let E=0,k=0;k<4;++E,++k){u(E%2?p:g,E%4>=2),y=o.buildLayerMatrix(d);let A=e(d,y);A<m&&(k=0,w=Object.assign({},y),m=A)}l(d,w)}function c(d,f,h){return f.map(function(p){return r(d,p,h)})}function u(d,f){let h=new s;d.forEach(function(p){let g=p.graph().root,y=n(p,g,h,f);y.vs.forEach((m,w)=>p.node(m).order=w),i(p,h,y.vs)})}function l(d,f){Object.values(f).forEach(h=>h.forEach((p,g)=>d.node(p).order=g))}return gw}var mw,K_;function tV(){if(K_)return mw;K_=1;let t=vr().Graph,e=At();mw={positionX:h,findType1Conflicts:n,findType2Conflicts:r,addConflict:s,hasConflict:o,verticalAlignment:a,horizontalCompaction:c,alignCoordinates:d,findSmallestWidthAlignment:l,balance:f};function n(y,m){let w={};function E(k,A){let I=0,x=0,_=k.length,P=A[A.length-1];return A.forEach((O,C)=>{let D=i(y,O),R=D?y.node(D).order:_;(D||O===P)&&(A.slice(x,C+1).forEach(L=>{y.predecessors(L).forEach(W=>{let V=y.node(W),Z=V.order;(Z<I||R<Z)&&!(V.dummy&&y.node(L).dummy)&&s(w,W,L)})}),x=C+1,I=R)}),A}return m.length&&m.reduce(E),w}function r(y,m){let w={};function E(A,I,x,_,P){let O;e.range(I,x).forEach(C=>{O=A[C],y.node(O).dummy&&y.predecessors(O).forEach(D=>{let R=y.node(D);R.dummy&&(R.order<_||R.order>P)&&s(w,D,O)})})}function k(A,I){let x=-1,_,P=0;return I.forEach((O,C)=>{if(y.node(O).dummy==="border"){let D=y.predecessors(O);D.length&&(_=y.node(D[0]).order,E(I,P,C,x,_),P=C,x=_)}E(I,P,I.length,_,A.length)}),I}return m.length&&m.reduce(k),w}function i(y,m){if(y.node(m).dummy)return y.predecessors(m).find(w=>y.node(w).dummy)}function s(y,m,w){if(m>w){let k=m;m=w,w=k}let E=y[m];E||(y[m]=E={}),E[w]=!0}function o(y,m,w){if(m>w){let E=m;m=w,w=E}return!!y[m]&&Object.hasOwn(y[m],w)}function a(y,m,w,E){let k={},A={},I={};return m.forEach(x=>{x.forEach((_,P)=>{k[_]=_,A[_]=_,I[_]=P})}),m.forEach(x=>{let _=-1;x.forEach(P=>{let O=E(P);if(O.length){O=O.sort((D,R)=>I[D]-I[R]);let C=(O.length-1)/2;for(let D=Math.floor(C),R=Math.ceil(C);D<=R;++D){let L=O[D];A[P]===P&&_<I[L]&&!o(w,P,L)&&(A[L]=P,A[P]=k[P]=k[L],_=I[L])}}})}),{root:k,align:A}}function c(y,m,w,E,k){let A={},I=u(y,m,w,k),x=k?"borderLeft":"borderRight";function _(C,D){let R=I.nodes(),L=R.pop(),W={};for(;L;)W[L]?C(L):(W[L]=!0,R.push(L),R=R.concat(D(L))),L=R.pop()}function P(C){A[C]=I.inEdges(C).reduce((D,R)=>Math.max(D,A[R.v]+I.edge(R)),0)}function O(C){let D=I.outEdges(C).reduce((L,W)=>Math.min(L,A[W.w]-I.edge(W)),Number.POSITIVE_INFINITY),R=y.node(C);D!==Number.POSITIVE_INFINITY&&R.borderType!==x&&(A[C]=Math.max(A[C],D))}return _(P,I.predecessors.bind(I)),_(O,I.successors.bind(I)),Object.keys(E).forEach(C=>A[C]=A[w[C]]),A}function u(y,m,w,E){let k=new t,A=y.graph(),I=p(A.nodesep,A.edgesep,E);return m.forEach(x=>{let _;x.forEach(P=>{let O=w[P];if(k.setNode(O),_){var C=w[_],D=k.edge(C,O);k.setEdge(C,O,Math.max(I(y,P,_),D||0))}_=P})}),k}function l(y,m){return Object.values(m).reduce((w,E)=>{let k=Number.NEGATIVE_INFINITY,A=Number.POSITIVE_INFINITY;Object.entries(E).forEach(([x,_])=>{let P=g(y,x)/2;k=Math.max(_+P,k),A=Math.min(_-P,A)});const I=k-A;return I<w[0]&&(w=[I,E]),w},[Number.POSITIVE_INFINITY,null])[1]}function d(y,m){let w=Object.values(m),E=e.applyWithChunking(Math.min,w),k=e.applyWithChunking(Math.max,w);["u","d"].forEach(A=>{["l","r"].forEach(I=>{let x=A+I,_=y[x];if(_===m)return;let P=Object.values(_),O=E-e.applyWithChunking(Math.min,P);I!=="l"&&(O=k-e.applyWithChunking(Math.max,P)),O&&(y[x]=e.mapValues(_,C=>C+O))})})}function f(y,m){return e.mapValues(y.ul,(w,E)=>{if(m)return y[m.toLowerCase()][E];{let k=Object.values(y).map(A=>A[E]).sort((A,I)=>A-I);return(k[1]+k[2])/2}})}function h(y){let m=e.buildLayerMatrix(y),w=Object.assign(n(y,m),r(y,m)),E={},k;["u","d"].forEach(I=>{k=I==="u"?m:Object.values(m).reverse(),["l","r"].forEach(x=>{x==="r"&&(k=k.map(C=>Object.values(C).reverse()));let _=(I==="u"?y.predecessors:y.successors).bind(y),P=a(y,k,w,_),O=c(y,k,P.root,P.align,x==="r");x==="r"&&(O=e.mapValues(O,C=>-C)),E[I+x]=O})});let A=l(y,E);return d(E,A),f(E,y.graph().align)}function p(y,m,w){return(E,k,A)=>{let I=E.node(k),x=E.node(A),_=0,P;if(_+=I.width/2,Object.hasOwn(I,"labelpos"))switch(I.labelpos.toLowerCase()){case"l":P=-I.width/2;break;case"r":P=I.width/2;break}if(P&&(_+=w?P:-P),P=0,_+=(I.dummy?m:y)/2,_+=(x.dummy?m:y)/2,_+=x.width/2,Object.hasOwn(x,"labelpos"))switch(x.labelpos.toLowerCase()){case"l":P=x.width/2;break;case"r":P=-x.width/2;break}return P&&(_+=w?P:-P),P=0,_}}function g(y,m){return y.node(m).width}return mw}var yw,Y_;function nV(){if(Y_)return yw;Y_=1;let t=At(),e=tV().positionX;yw=n;function n(i){i=t.asNonCompoundGraph(i),r(i),Object.entries(e(i)).forEach(([s,o])=>i.node(s).x=o)}function r(i){let s=t.buildLayerMatrix(i),o=i.graph().ranksep,a=0;s.forEach(c=>{const u=c.reduce((l,d)=>{const f=i.node(d).height;return l>f?l:f},0);c.forEach(l=>i.node(l).y=a+u/2),a+=u+o})}return yw}var vw,X_;function rV(){if(X_)return vw;X_=1;let t=MH(),e=zH(),n=qH(),r=At().normalizeRanks,i=jH(),s=At().removeEmptyRanks,o=UH(),a=GH(),c=WH(),u=eV(),l=nV(),d=At(),f=vr().Graph;vw=h;function h(H,Y){let Q=Y&&Y.debugTiming?d.time:d.notime;Q("layout",()=>{let ne=Q(" buildLayoutGraph",()=>_(H));Q(" runLayout",()=>p(ne,Q,Y)),Q(" updateInputGraph",()=>g(H,ne))})}function p(H,Y,Q){Y(" makeSpaceForEdgeLabels",()=>P(H)),Y(" removeSelfEdges",()=>Fe(H)),Y(" acyclic",()=>t.run(H)),Y(" nestingGraph.run",()=>o.run(H)),Y(" rank",()=>n(d.asNonCompoundGraph(H))),Y(" injectEdgeLabelProxies",()=>O(H)),Y(" removeEmptyRanks",()=>s(H)),Y(" nestingGraph.cleanup",()=>o.cleanup(H)),Y(" normalizeRanks",()=>r(H)),Y(" assignRankMinMax",()=>C(H)),Y(" removeEdgeLabelProxies",()=>D(H)),Y(" normalize.run",()=>e.run(H)),Y(" parentDummyChains",()=>i(H)),Y(" addBorderSegments",()=>a(H)),Y(" order",()=>u(H,Q)),Y(" insertSelfEdges",()=>se(H)),Y(" adjustCoordinateSystem",()=>c.adjust(H)),Y(" position",()=>l(H)),Y(" positionSelfEdges",()=>K(H)),Y(" removeBorderNodes",()=>Z(H)),Y(" normalize.undo",()=>e.undo(H)),Y(" fixupEdgeLabelCoords",()=>W(H)),Y(" undoCoordinateSystem",()=>c.undo(H)),Y(" translateGraph",()=>R(H)),Y(" assignNodeIntersects",()=>L(H)),Y(" reversePoints",()=>V(H)),Y(" acyclic.undo",()=>t.undo(H))}function g(H,Y){H.nodes().forEach(Q=>{let ne=H.node(Q),fe=Y.node(Q);ne&&(ne.x=fe.x,ne.y=fe.y,ne.rank=fe.rank,Y.children(Q).length&&(ne.width=fe.width,ne.height=fe.height))}),H.edges().forEach(Q=>{let ne=H.edge(Q),fe=Y.edge(Q);ne.points=fe.points,Object.hasOwn(fe,"x")&&(ne.x=fe.x,ne.y=fe.y)}),H.graph().width=Y.graph().width,H.graph().height=Y.graph().height}let y=["nodesep","edgesep","ranksep","marginx","marginy"],m={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},w=["acyclicer","ranker","rankdir","align"],E=["width","height"],k={width:0,height:0},A=["minlen","weight","width","height","labeloffset"],I={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},x=["labelpos"];function _(H){let Y=new f({multigraph:!0,compound:!0}),Q=at(H.graph());return Y.setGraph(Object.assign({},m,Te(Q,y),d.pick(Q,w))),H.nodes().forEach(ne=>{let fe=at(H.node(ne));const Ee=Te(fe,E);Object.keys(k).forEach(me=>{Ee[me]===void 0&&(Ee[me]=k[me])}),Y.setNode(ne,Ee),Y.setParent(ne,H.parent(ne))}),H.edges().forEach(ne=>{let fe=at(H.edge(ne));Y.setEdge(ne,Object.assign({},I,Te(fe,A),d.pick(fe,x)))}),Y}function P(H){let Y=H.graph();Y.ranksep/=2,H.edges().forEach(Q=>{let ne=H.edge(Q);ne.minlen*=2,ne.labelpos.toLowerCase()!=="c"&&(Y.rankdir==="TB"||Y.rankdir==="BT"?ne.width+=ne.labeloffset:ne.height+=ne.labeloffset)})}function O(H){H.edges().forEach(Y=>{let Q=H.edge(Y);if(Q.width&&Q.height){let ne=H.node(Y.v),Ee={rank:(H.node(Y.w).rank-ne.rank)/2+ne.rank,e:Y};d.addDummyNode(H,"edge-proxy",Ee,"_ep")}})}function C(H){let Y=0;H.nodes().forEach(Q=>{let ne=H.node(Q);ne.borderTop&&(ne.minRank=H.node(ne.borderTop).rank,ne.maxRank=H.node(ne.borderBottom).rank,Y=Math.max(Y,ne.maxRank))}),H.graph().maxRank=Y}function D(H){H.nodes().forEach(Y=>{let Q=H.node(Y);Q.dummy==="edge-proxy"&&(H.edge(Q.e).labelRank=Q.rank,H.removeNode(Y))})}function R(H){let Y=Number.POSITIVE_INFINITY,Q=0,ne=Number.POSITIVE_INFINITY,fe=0,Ee=H.graph(),me=Ee.marginx||0,ae=Ee.marginy||0;function M(U){let oe=U.x,G=U.y,Le=U.width,yt=U.height;Y=Math.min(Y,oe-Le/2),Q=Math.max(Q,oe+Le/2),ne=Math.min(ne,G-yt/2),fe=Math.max(fe,G+yt/2)}H.nodes().forEach(U=>M(H.node(U))),H.edges().forEach(U=>{let oe=H.edge(U);Object.hasOwn(oe,"x")&&M(oe)}),Y-=me,ne-=ae,H.nodes().forEach(U=>{let oe=H.node(U);oe.x-=Y,oe.y-=ne}),H.edges().forEach(U=>{let oe=H.edge(U);oe.points.forEach(G=>{G.x-=Y,G.y-=ne}),Object.hasOwn(oe,"x")&&(oe.x-=Y),Object.hasOwn(oe,"y")&&(oe.y-=ne)}),Ee.width=Q-Y+me,Ee.height=fe-ne+ae}function L(H){H.edges().forEach(Y=>{let Q=H.edge(Y),ne=H.node(Y.v),fe=H.node(Y.w),Ee,me;Q.points?(Ee=Q.points[0],me=Q.points[Q.points.length-1]):(Q.points=[],Ee=fe,me=ne),Q.points.unshift(d.intersectRect(ne,Ee)),Q.points.push(d.intersectRect(fe,me))})}function W(H){H.edges().forEach(Y=>{let Q=H.edge(Y);if(Object.hasOwn(Q,"x"))switch((Q.labelpos==="l"||Q.labelpos==="r")&&(Q.width-=Q.labeloffset),Q.labelpos){case"l":Q.x-=Q.width/2+Q.labeloffset;break;case"r":Q.x+=Q.width/2+Q.labeloffset;break}})}function V(H){H.edges().forEach(Y=>{let Q=H.edge(Y);Q.reversed&&Q.points.reverse()})}function Z(H){H.nodes().forEach(Y=>{if(H.children(Y).length){let Q=H.node(Y),ne=H.node(Q.borderTop),fe=H.node(Q.borderBottom),Ee=H.node(Q.borderLeft[Q.borderLeft.length-1]),me=H.node(Q.borderRight[Q.borderRight.length-1]);Q.width=Math.abs(me.x-Ee.x),Q.height=Math.abs(fe.y-ne.y),Q.x=Ee.x+Q.width/2,Q.y=ne.y+Q.height/2}}),H.nodes().forEach(Y=>{H.node(Y).dummy==="border"&&H.removeNode(Y)})}function Fe(H){H.edges().forEach(Y=>{if(Y.v===Y.w){var Q=H.node(Y.v);Q.selfEdges||(Q.selfEdges=[]),Q.selfEdges.push({e:Y,label:H.edge(Y)}),H.removeEdge(Y)}})}function se(H){var Y=d.buildLayerMatrix(H);Y.forEach(Q=>{var ne=0;Q.forEach((fe,Ee)=>{var me=H.node(fe);me.order=Ee+ne,(me.selfEdges||[]).forEach(ae=>{d.addDummyNode(H,"selfedge",{width:ae.label.width,height:ae.label.height,rank:me.rank,order:Ee+ ++ne,e:ae.e,label:ae.label},"_se")}),delete me.selfEdges})})}function K(H){H.nodes().forEach(Y=>{var Q=H.node(Y);if(Q.dummy==="selfedge"){var ne=H.node(Q.e.v),fe=ne.x+ne.width/2,Ee=ne.y,me=Q.x-fe,ae=ne.height/2;H.setEdge(Q.e,Q.label),H.removeNode(Y),Q.label.points=[{x:fe+2*me/3,y:Ee-ae},{x:fe+5*me/6,y:Ee-ae},{x:fe+me,y:Ee},{x:fe+5*me/6,y:Ee+ae},{x:fe+2*me/3,y:Ee+ae}],Q.label.x=Q.x,Q.label.y=Q.y}})}function Te(H,Y){return d.mapValues(d.pick(H,Y),Number)}function at(H){var Y={};return H&&Object.entries(H).forEach(([Q,ne])=>{typeof Q=="string"&&(Q=Q.toLowerCase()),Y[Q]=ne}),Y}return vw}var ww,J_;function iV(){if(J_)return ww;J_=1;let t=At(),e=vr().Graph;ww={debugOrdering:n};function n(r){let i=t.buildLayerMatrix(r),s=new e({compound:!0,multigraph:!0}).setGraph({});return r.nodes().forEach(o=>{s.setNode(o,{label:o}),s.setParent(o,"layer"+r.node(o).rank)}),r.edges().forEach(o=>s.setEdge(o.v,o.w,{},o.name)),i.forEach((o,a)=>{let c="layer"+a;s.setNode(c,{rank:"same"}),o.reduce((u,l)=>(s.setEdge(u,l,{style:"invis"}),l))}),s}return ww}var bw,Z_;function sV(){return Z_||(Z_=1,bw="1.1.4"),bw}var Ew,Q_;function oV(){return Q_||(Q_=1,Ew={graphlib:vr(),layout:rV(),debug:iV(),util:{time:At().time,notime:At().notime},version:sV()}),Ew}var vh=oV(),wh={exports:{}},eA;function aV(){return eA||(eA=1,function(t,e){var n=Yk;e=t.exports=r;function r(d,f){return f=o(d,f),c(d,f)}e.sha1=function(d){return r(d)},e.keys=function(d){return r(d,{excludeValues:!0,algorithm:"sha1",encoding:"hex"})},e.MD5=function(d){return r(d,{algorithm:"md5",encoding:"hex"})},e.keysMD5=function(d){return r(d,{algorithm:"md5",encoding:"hex",excludeValues:!0})};var i=n.getHashes?n.getHashes().slice():["sha1","md5"];i.push("passthrough");var s=["buffer","hex","binary","base64"];function o(d,f){f=f||{};var h={};if(h.algorithm=f.algorithm||"sha1",h.encoding=f.encoding||"hex",h.excludeValues=!!f.excludeValues,h.algorithm=h.algorithm.toLowerCase(),h.encoding=h.encoding.toLowerCase(),h.ignoreUnknown=f.ignoreUnknown===!0,h.respectType=f.respectType!==!1,h.respectFunctionNames=f.respectFunctionNames!==!1,h.respectFunctionProperties=f.respectFunctionProperties!==!1,h.unorderedArrays=f.unorderedArrays===!0,h.unorderedSets=f.unorderedSets!==!1,h.unorderedObjects=f.unorderedObjects!==!1,h.replacer=f.replacer||void 0,h.excludeKeys=f.excludeKeys||void 0,typeof d>"u")throw new Error("Object argument required.");for(var p=0;p<i.length;++p)i[p].toLowerCase()===h.algorithm.toLowerCase()&&(h.algorithm=i[p]);if(i.indexOf(h.algorithm)===-1)throw new Error('Algorithm "'+h.algorithm+'" not supported. supported values: '+i.join(", "));if(s.indexOf(h.encoding)===-1&&h.algorithm!=="passthrough")throw new Error('Encoding "'+h.encoding+'" not supported. supported values: '+s.join(", "));return h}function a(d){if(typeof d!="function")return!1;var f=/^function\s+\w*\s*\(\s*\)\s*{\s+\[native code\]\s+}$/i;return f.exec(Function.prototype.toString.call(d))!=null}function c(d,f){var h;f.algorithm!=="passthrough"?h=n.createHash(f.algorithm):h=new l,typeof h.write>"u"&&(h.write=h.update,h.end=h.update);var p=u(f,h);if(p.dispatch(d),h.update||h.end(""),h.digest)return h.digest(f.encoding==="buffer"?void 0:f.encoding);var g=h.read();return f.encoding==="buffer"?g:g.toString(f.encoding)}e.writeToStream=function(d,f,h){return typeof h>"u"&&(h=f,f={}),f=o(d,f),u(f,h).dispatch(d)};function u(d,f,h){h=h||[];var p=function(g){return f.update?f.update(g,"utf8"):f.write(g,"utf8")};return{dispatch:function(g){d.replacer&&(g=d.replacer(g));var y=typeof g;return g===null&&(y="null"),this["_"+y](g)},_object:function(g){var y=/\[object (.*)\]/i,m=Object.prototype.toString.call(g),w=y.exec(m);w?w=w[1]:w="unknown:["+m+"]",w=w.toLowerCase();var E=null;if((E=h.indexOf(g))>=0)return this.dispatch("[CIRCULAR:"+E+"]");if(h.push(g),typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(g))return p("buffer:"),p(g);if(w!=="object"&&w!=="function"&&w!=="asyncfunction")if(this["_"+w])this["_"+w](g);else{if(d.ignoreUnknown)return p("["+w+"]");throw new Error('Unknown object type "'+w+'"')}else{var k=Object.keys(g);d.unorderedObjects&&(k=k.sort()),d.respectType!==!1&&!a(g)&&k.splice(0,0,"prototype","__proto__","constructor"),d.excludeKeys&&(k=k.filter(function(I){return!d.excludeKeys(I)})),p("object:"+k.length+":");var A=this;return k.forEach(function(I){A.dispatch(I),p(":"),d.excludeValues||A.dispatch(g[I]),p(",")})}},_array:function(g,y){y=typeof y<"u"?y:d.unorderedArrays!==!1;var m=this;if(p("array:"+g.length+":"),!y||g.length<=1)return g.forEach(function(k){return m.dispatch(k)});var w=[],E=g.map(function(k){var A=new l,I=h.slice(),x=u(d,A,I);return x.dispatch(k),w=w.concat(I.slice(h.length)),A.read().toString()});return h=h.concat(w),E.sort(),this._array(E,!1)},_date:function(g){return p("date:"+g.toJSON())},_symbol:function(g){return p("symbol:"+g.toString())},_error:function(g){return p("error:"+g.toString())},_boolean:function(g){return p("bool:"+g.toString())},_string:function(g){p("string:"+g.length+":"),p(g.toString())},_function:function(g){p("fn:"),a(g)?this.dispatch("[native]"):this.dispatch(g.toString()),d.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(g.name)),d.respectFunctionProperties&&this._object(g)},_number:function(g){return p("number:"+g.toString())},_xml:function(g){return p("xml:"+g.toString())},_null:function(){return p("Null")},_undefined:function(){return p("Undefined")},_regexp:function(g){return p("regex:"+g.toString())},_uint8array:function(g){return p("uint8array:"),this.dispatch(Array.prototype.slice.call(g))},_uint8clampedarray:function(g){return p("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(g))},_int8array:function(g){return p("int8array:"),this.dispatch(Array.prototype.slice.call(g))},_uint16array:function(g){return p("uint16array:"),this.dispatch(Array.prototype.slice.call(g))},_int16array:function(g){return p("int16array:"),this.dispatch(Array.prototype.slice.call(g))},_uint32array:function(g){return p("uint32array:"),this.dispatch(Array.prototype.slice.call(g))},_int32array:function(g){return p("int32array:"),this.dispatch(Array.prototype.slice.call(g))},_float32array:function(g){return p("float32array:"),this.dispatch(Array.prototype.slice.call(g))},_float64array:function(g){return p("float64array:"),this.dispatch(Array.prototype.slice.call(g))},_arraybuffer:function(g){return p("arraybuffer:"),this.dispatch(new Uint8Array(g))},_url:function(g){return p("url:"+g.toString())},_map:function(g){p("map:");var y=Array.from(g);return this._array(y,d.unorderedSets!==!1)},_set:function(g){p("set:");var y=Array.from(g);return this._array(y,d.unorderedSets!==!1)},_file:function(g){return p("file:"),this.dispatch([g.name,g.size,g.type,g.lastModfied])},_blob:function(){if(d.ignoreUnknown)return p("[blob]");throw Error(`Hashing Blob objects is currently not supported
1722
+ (see https://github.com/puleos/object-hash/issues/26)
1723
+ Use "options.replacer" or "options.ignoreUnknown"
1724
+ `)},_domwindow:function(){return p("domwindow")},_bigint:function(g){return p("bigint:"+g.toString())},_process:function(){return p("process")},_timer:function(){return p("timer")},_pipe:function(){return p("pipe")},_tcp:function(){return p("tcp")},_udp:function(){return p("udp")},_tty:function(){return p("tty")},_statwatcher:function(){return p("statwatcher")},_securecontext:function(){return p("securecontext")},_connection:function(){return p("connection")},_zlib:function(){return p("zlib")},_context:function(){return p("context")},_nodescript:function(){return p("nodescript")},_httpparser:function(){return p("httpparser")},_dataview:function(){return p("dataview")},_signal:function(){return p("signal")},_fsevent:function(){return p("fsevent")},_tlswrap:function(){return p("tlswrap")}}}function l(){return{buf:"",write:function(d){this.buf+=d},end:function(d){this.buf+=d},read:function(){return this.buf}}}}(wh,wh.exports)),wh.exports}var cV=aV();function tA(t){const e={id:t.id,__:t.__??"element",autoLayout:t.autoLayout,nodes:Ke(t.nodes,ut(kk(["id","title","description","technology","shape","icon","children"])),vi(({id:n,icon:r,...i})=>[n,{...i,icon:ce(r)?"Y":"N"}])),edges:Ke(t.edges,ut(kk(["source","target","label","description","technology","dir","head","tail","line"])),vi(({source:n,target:r,...i})=>[`${n}:${r}`,i]))};return t.hash=cV(e,{ignoreUnknown:!0,respectType:!1}),t}function $n(t){if(ye.isElementWhere(t)){const e=$n(t.where.expr),n=Ro(t.where.condition);return r=>e(r)&&n(r)}if(ye.isWildcard(t))return()=>!0;if(ye.isElementKindExpr(t))return t.isEqual?e=>e.kind===t.elementKind:e=>e.kind!==t.elementKind;if(ye.isElementTagExpr(t))return t.isEqual?({tags:e})=>!!e&&e.includes(t.elementTag):({tags:e})=>Dt(e)||!e.includes(t.elementTag);if(ye.isExpandedElementExpr(t))return e=>e.id===t.expanded||kt(e.id)===t.expanded;if(ye.isElementRef(t)){const{element:e,isDescedants:n}=t;return n?r=>r.id.startsWith(e+"."):r=>r.id===e}if(ye.isCustomElement(t))return $n(t.custom.expr);Ie(t)}function Dw(t){return e=>Dg(e)?e.groupRules.flatMap(Dw(t)):hE(e)?"include"in e?e.include.filter(t):[]:[]}function nA(t,e){const n=t.flatMap(Dw(ye.isCustomElement));if(n.length===0)return e;const r=[...e];for(const{custom:{expr:i,...s}}of n){const{border:o,opacity:a,...c}=Sk(s,Dt),u=!Vi(c),l=$n(i);r.forEach((d,f)=>{if(pd.isNodesGroup(d)||!l(d))return;u&&(d={...d,isCustomized:!0,...c});let h;o!==void 0&&(h={border:o}),a!==void 0&&(h={...h,opacity:a}),h&&(d={...d,isCustomized:!0,style:{...d.style,...h}}),r[f]=d})}return r}function rA(t){switch(!0){case ye.isRelationWhere(t):return rA(t.where.expr);case ye.isRelation(t):{const e=$n(t.source),n=$n(t.target);return r=>e(r.source)&&n(r.target)||!!t.isBidirectional&&e(r.target)&&n(r.source)}case ye.isInOut(t):{const e=$n(t.inout);return n=>e(n.source)||e(n.target)}case ye.isIncoming(t):{const e=$n(t.incoming);return n=>e(n.target)}case ye.isOutgoing(t):{const e=$n(t.outgoing);return n=>e(n.source)}default:Ie(t)}}function uV(t,e,n){const r=t.flatMap(Dw(ye.isCustomRelationExpr)),i=Array.from(n);if(r.length===0||i.length===0)return i;for(const{customRelation:{relation:s,title:o,...a}}of r){const c=Sk(a,Dt),u=rA(s);i.forEach((l,d)=>{const f=e.find(p=>p.id===l.source),h=e.find(p=>p.id===l.target);!f||!h||u({source:f,target:h})&&(i[d]={...l,label:o??l.label,isCustomized:!0,...c})})}return i}function iA(t,e){const n=t.filter(e2);if(n.length===0)return e;for(const r of n){const i=[];for(const s of r.targets){if(ye.isWildcard(s)){i.push(()=>!0);break}i.push($n(s))}Ke(e,nt(t9(pd.isNodesGroup)),nt(nv(i)),Ck(s=>{s.shape=r.style.shape??s.shape,s.color=r.style.color??s.color,Ft(r.style.icon)&&(s.icon=r.style.icon),Ft(r.notation)&&(s.notation=r.notation);let o;Ft(r.style.border)&&(o={border:r.style.border}),Ft(r.style.opacity)&&(o={...o,opacity:r.style.opacity}),o&&(s.style={...s.style,...o})}))}return e}function lV(t,e){let n;for(;t.parent&&(n=e.get(t.parent));){const r=n.depth??1;if(n.depth=Math.max(r,(t.depth??0)+1),n.depth===r)break;t=n}}function sA(t,e){const n=new Map,r=new Map;return e?.forEach(({id:i,parent:s,viewRule:o,explicits:a})=>{s&&Ze(n.get(s),`Parent group node ${s} not found`).children.push(i),n.set(i,{id:i,parent:s,kind:To.Group,title:o.title??"",color:o.color??"muted",shape:"rectangle",children:[],inEdges:[],outEdges:[],level:0,depth:0,description:null,technology:null,tags:null,links:null,style:{border:o.border??"dashed",opacity:o.opacity??0}});for(const c of a)r.set(c.id,i)}),Array.from(t).sort(za).reduce((i,{id:s,color:o,shape:a,style:c,kind:u,title:l,...d})=>{let f=kt(s),h=0,p;for(;f&&(p=i.get(f),!p);)f=kt(f);!p&&r.has(s)&&(f=r.get(s),p=i.get(f)),p&&(p.children.length==0&&(p.depth=1,lV(p,i)),p.children.push(s),h=p.level+1);const g={id:s,parent:f,kind:u,title:l,color:o??Na,shape:a??yg,children:[],inEdges:[],outEdges:[],level:h,...d,style:{...c}};return i.set(s,g),i},n)}function oA(t){return Ke(t,sh(yr("notation")),Wi(ev(sh(yr("shape")),Wi(ev(sh(yr("color")),Wi(ev(ut(yr("kind")),Br())),Us(),ut(([e,n])=>({kinds:n,color:e})))),Us(),Ki(([e,n])=>n.map(({color:r,kinds:i})=>({shape:e,color:r,kinds:i}))))),Us(),Ki(([e,n])=>n.map(({shape:r,color:i,kinds:s})=>({title:e,shape:r,color:i,kinds:s}))),BU(yr("shape"),yr("title"),[e=>e.kinds.length,"desc"]))}const aA=vh.graphlib.Graph,cA=vh.graphlib.alg.postorder,dV=vh.graphlib.alg.findCycles,fV=vh.graphlib.alg.isAcyclic;function uA(t){t.forEach(e=>{e.children.length>0&&(e.children=t.flatMap(n=>n.parent===e.id?n.id:[]))})}function hV({nodes:t,edges:e}){if(t.length<2)return t;if(e.length===0)return Ke(t,ia(za),xU(uA));const n=new aA({compound:!1,directed:!0,multigraph:!1}),r=a=>Ze(t.find(c=>c.id===a),"Edge not found"),i=a=>Ze(e.find(c=>c.id===a),"Edge not found");for(const a of[...e].sort(Ga))n.setEdge(a.source,a.target);for(const a of t)n.setNode(a.id,a.id),a.children.length>0&&a.inEdges.forEach(c=>{const u=i(c);u.target!==a.id&&r(u.source).children.length===0&&n.setEdge(u.source,a.id)}),a.parent&&n.setEdge(a.parent,a.id);let s=n.sources();s.length===0&&(s=Ke(t,nt(a=>a.inEdges.length===0||a.parent===null),ia(za),ut(a=>a.id)));const o=cA(n,s).reverse().map(r);if(o.length<t.length){const a=xk(t,o).sort(za);o.push(...a)}return we(o.length===t.length,"Not all nodes were processed by graphlib"),uA(o),o}function pV(t){const e=Ke(t,Ki(n=>n.tags??[]),Br(),ia(yd));return gd(e,1)?e:null}const wr=()=>!0,Tw=t=>t,Rw=t=>t===wr?Tw:nt(t),gV=t=>t===wr?Tw:e=>t(e)?e:null;function mV(t,e=wr){const n=[...this.resolvedElements],r=Rw(e)(t.isDescedants===!0?this.graph.childrenOrElement(t.element):[this.graph.element(t.element)]);if(r.length!==0&&(this.addElement(...r),r.length>1&&this.addEdges(this.graph.edgesWithin(r)),n.length>0&&r.length>0))for(const i of r)this.addEdges(this.graph.anyEdgesBetween(i,n))}function yV(t,e=wr){const n=[...this.resolvedElements].filter(Ik([$n(t),e]));this.excludeElement(...n)}function vV(t,e=wr){const n=this.root;if(!n){const u=this.graph.rootElements.filter(e);if(u.length<=0)return;const l=[...this.resolvedElements];if(this.addElement(...u),this.addEdges(this.graph.edgesWithin(u)),l.length>0)for(const d of u)this.addEdges(this.graph.anyEdgesBetween(d,l));return}const r=[...this.resolvedElements],i=gV(e)(this.graph.element(n));i&&this.addElement(i);const s=Rw(e),o=s(this.graph.children(n)),a=o.length>0;a?(this.addElement(...o),this.addEdges(this.graph.edgesWithin(o))):i&&o.push(i);const c=[...r,...s([...this.graph.siblings(n),...this.graph.ancestors(n).flatMap(u=>this.graph.siblings(u.id))])];for(const u of o)this.addEdges(this.graph.anyEdgesBetween(u,c)).forEach(l=>{this.addImplicit(l.source,l.target)});if(!a&&i&&this.graph.anyEdgesBetween(i,this.graph.siblings(n)).length===0){const u=kt(n),l=u&&this.graph.element(u);l&&e(l)&&this.addElement(l)}}function wV(t,e=wr){if(e!==wr){const r=[...this.resolvedElements].filter(e);this.excludeElement(...r);return}const n=this.root;n?(this.excludeElement(this.graph.element(n),...this.graph.children(n)),this.excludeRelation(...this.graph.connectedRelations(n))):this.reset()}function bV(t,e=wr){const n=Rw(e),r=[...this.resolvedElements],i=this.graph.element(t.expanded);if(e(i)){this.addElement(i);const o=this.graph.anyEdgesBetween(i,r);this.addEdges(o)}const s=[];for(const o of n(this.graph.children(t.expanded))){this.addImplicit(o);const a=this.graph.anyEdgesBetween(o,r);a.length>0&&(this.addEdges(a),s.push(o))}s.length>1&&this.addEdges(this.graph.edgesWithin(s))}function EV(t,e=wr){const n=[...this.resolvedElements].filter(Ik([$n(t),e]));this.excludeElement(...n)}const lA=t=>t.isEqual?ye.isElementKindExpr(t)?e=>e.kind===t.elementKind:({tags:e})=>!!e&&e.includes(t.elementTag):ye.isElementKindExpr(t)?e=>e.kind!==t.elementKind:({tags:e})=>Dt(e)||e.length===0||!e.includes(t.elementTag);function DV(t,e=wr){const n=this.graph.elements.filter(lA(t)).filter(e);if(n.length>0){const r=[...this.resolvedElements];this.addElement(...n),this.addEdges(this.graph.edgesWithin(n));for(const i of n)this.addEdges(this.graph.anyEdgesBetween(i,r))}}function TV(t,e=wr){const n=[...this.resolvedElements].filter(lA(t)).filter(e);n.length>0&&this.excludeElement(...n)}function Ou(t){return ye.isElementRef(t)?this.graph.ascendingSiblings(t.element):this.root?this.graph.ascendingSiblings(this.root):this.graph.rootElements}function bh(t){return ye.isWildcard(t)?this.root?[...this.graph.children(this.root),this.graph.element(this.root)]:this.graph.rootElements:ye.isElementKindExpr(t)?this.graph.elements.filter(e=>t.isEqual?e.kind===t.elementKind:e.kind!==t.elementKind):ye.isElementTagExpr(t)?this.graph.elements.filter(e=>{const n=e.tags;return t.isEqual?!!n&&n.includes(t.elementTag):Dt(n)||n.length===0||!n.includes(t.elementTag)}):ye.isExpandedElementExpr(t)?[this.graph.element(t.expanded)]:ye.isElementRef(t)?this.root===t.element&&t.isDescedants!==!0?[...this.graph.children(this.root),this.graph.element(this.root)]:t.isDescedants?this.graph.childrenOrElement(t.element):[this.graph.element(t.element)]:Ie(t)}function dA(t){if(ye.isWildcard(t)){if(!this.root)return[];const r=this.graph.ascendingSiblings(this.root),i=[...this.graph.children(this.root),this.graph.element(this.root)];return this.graph.edgesBetween(r,i)}const e=bh.call(this,t);if(e.length===0)return[];let n=[...this.resolvedElements];if(ye.isElementRef(t)||ye.isExpandedElementExpr(t)){const r=t.element??t.expanded,i=t.isDescedants??!1;n=n.filter(s=>!Cr(r,s.id)||i&&kt(s.id)===r)}return n.length===0&&(n=Ou.call(this,t)),this.graph.edgesBetween(n,e)}const Fu=(t,e)=>e?Ke(t,ut(n=>({...n,relations:n.relations.filter(e)})),nt(n=>n.relations.length>0)):t,Sw=(t,e)=>Ke(t,Ki(n=>n.relations),e?nt(e):Tw,Br());function RV(t,e){const n=Fu(dA.call(this,t.incoming),e);n.length!==0&&this.addEdges(n).forEach(r=>{this.addImplicit(r.target)})}function SV(t,e){let n=Sw(dA.call(this,t.incoming),e);this.excludeRelation(...n)}function fA(t){if(ye.isWildcard(t)){if(!this.root)return[];const r=this.graph.ascendingSiblings(this.root),i=[...this.graph.children(this.root),this.graph.element(this.root)];return this.graph.edgesBetween(i,r)}const e=bh.call(this,t);if(e.length===0)return[];let n=[...this.resolvedElements];if(ye.isElementRef(t)||ye.isExpandedElementExpr(t)){const r=t.element??t.expanded,i=t.isDescedants??!1;n=n.filter(s=>!Cr(r,s.id)||i&&kt(s.id)===r)}return n.length===0&&(n=Ou.call(this,t)),this.graph.edgesBetween(e,n)}function kV(t,e){const n=Fu(fA.call(this,t.outgoing),e);n.length!==0&&this.addEdges(n).forEach(r=>{this.addImplicit(r.source)})}function $V(t,e){const n=Sw(fA.call(this,t.outgoing),e);this.excludeRelation(...n)}var Eh;(t=>{t.Empty={implicits:[],edges:[]}})(Eh||(Eh={}));function hA({inout:t},e){if(ye.isWildcard(t)){if(!this.root)return Eh.Empty;const i=this.graph.ascendingSiblings(this.root);return{edges:Fu(this.graph.anyEdgesBetween(this.graph.element(this.root),i),e),implicits:[]}}const n=bh.call(this,t);if(n.length===0)return Eh.Empty;let r=[...this.resolvedElements];if(ye.isElementRef(t)||ye.isExpandedElementExpr(t)){const i=t.element??t.expanded,s=t.isDescedants??!1;r=r.filter(o=>!Cr(i,o.id)||s&&kt(o.id)===i)}return r.length===0&&(r=Ou.call(this,t)),n.reduce((i,s)=>{const o=Fu(this.graph.anyEdgesBetween(s,r),e);return o.length>0&&(i.implicits.push(s),i.edges.push(...o)),i},{implicits:[],edges:[]})}function CV(t,e){const{implicits:n,edges:r}=hA.call(this,t,e);this.addEdges(r),this.addImplicit(...n)}function _V(t,e){const{edges:n}=hA.call(this,t,e);this.excludeRelation(...n.flatMap(r=>r.relations))}function Dh(t){return ye.isElementRef(t)&&this.root===t.element&&t.isDescedants!==!0?[...this.graph.children(t.element),this.graph.element(t.element)]:ye.isExpandedElementExpr(t)&&this.root===t.expanded?[...this.graph.children(t.expanded),this.graph.element(t.expanded)]:bh.call(this,t)}function AV(t,e){let n,r;ye.isWildcard(t.source)&&!ye.isWildcard(t.target)?(n=Ou.call(this,t.target),r=Dh.call(this,t.target)):!ye.isWildcard(t.source)&&ye.isWildcard(t.target)?(n=Dh.call(this,t.source),r=Ou.call(this,t.source)):(n=Dh.call(this,t.source),r=Dh.call(this,t.target));const i=this.graph.edgesBetween(n,r);t.isBidirectional===!0&&i.push(...this.graph.edgesBetween(r,n)),this.addEdges(Fu(i,e)).forEach(s=>{this.activeGroup.addImplicit(s.source,s.target)})}function xV(t,e){const n=$n(t.source),r=$n(t.target),i=a=>{let c=n(a.source)&&r(a.target);return!c&&t.isBidirectional&&(c=n(a.target)&&r(a.source)),c},s=this.edges.filter(i),o=Sw(s,e);this.excludeRelation(...o)}function IV(t,e){return Ga({source:t.source.id,target:t.target.id},{source:e.source.id,target:e.target.id})}let kw=class N0{constructor(e,n,r=null){this.id=e,this.viewRule=n,this.parent=r}static kind=To.Group;static root(){return new N0("@root",{title:null,groupRules:[]})}static is(e){return e.kind===N0.kind}explicits=new Set;implicits=new Set;addElement(...e){for(const n of e)this.explicits.add(n),this.implicits.add(n)}addImplicit(...e){for(const n of e)this.implicits.add(n)}excludeElement(...e){for(const n of e)this.explicits.delete(n),this.implicits.delete(n)}isEmpty(){return this.explicits.size===0&&this.implicits.size===0}},PV=class iO{constructor(e,n){this.view=e,this.graph=n}explicits=new Set;implicits=new Set;ctxEdges=[];__rootGroup=kw.root();groups=[];activeGroupStack=[];get activeGroup(){return this.activeGroupStack[0]??this.__rootGroup}static elementView(e,n){return new iO(e,n).compute()}compute(){this.reset();const{docUri:e,rules:n,...r}=this.view,i=n.filter(nv([hE,Dg]));this.root&&i.length==0&&this.addElement(this.graph.element(this.root)),this.processPredicates(i),this.removeRedundantImplicitEdges(),this.groups.length>0&&this.cleanGroupElements();const s=[...this.includedElements],o=sA(s,this.groups),a=g=>{const y=[];let m=g.parent;for(;m;){const w=o.get(m);if(!w)break;y.push(w),m=w.parent}return y},c=new Map,u=this.computeEdges();for(const g of u){c.set(g.id,g);const y=o.get(g.source),m=o.get(g.target);we(y,`Source node ${g.source} not found`),we(m,`Target node ${g.target} not found`);const w=a(y),E=a(m),k=sa(WL(nh(w),nh(E)));g.parent=k?.id??null,y.outEdges.push(g.id),m.inEdges.push(g.id);for(const A of w){if(A===k)break;A.outEdges.push(g.id)}for(const A of E){if(A===k)break;A.inEdges.push(g.id)}}let l=s.map(g=>Ze(o.get(g.id),`Node ${g.id} not found in nodesMap`));this.groups.length>0&&(l=w9(this.groups.map(g=>Ze(o.get(g.id),`Node ${g.id} not found in nodesMap`)),l));const d=nA(n,iA(n,hV({nodes:l,edges:u}))),f=new Set([...d.flatMap(g=>g.children.length===0?g.outEdges.flatMap(y=>c.get(y)??[]):[]),...u]),h=this.view.rules.findLast(gE),p=oA(d);return tA({...r,autoLayout:{direction:h?.direction??"TB",...h?.nodeSep&&{nodeSep:h.nodeSep},...h?.rankSep&&{rankSep:h.rankSep}},nodes:ut(d,Rk(["notation"])),edges:uV(n,d,f),...p.length>0&&{notation:{elements:p}}})}get root(){return Tg(this.view)?this.view.viewOf:null}computeEdges(){return this.ctxEdges.map(e=>{we(qr(e.relations,1),"Edge must have at least one relation");const n=ia(e.relations,Ga),r=e.source.id,i=e.target.id,s={id:`${r}:${i}`,parent:Ss(r,i),source:r,target:i,label:null,relations:n.map(c=>c.id)};let o;if(o=kn(n)??Ke(n,nt(c=>c.source===r&&c.target===i),kn()),!o){const c=Ke(n,Tk((u,l)=>(ce(l.title)&&!u.title.includes(l.title)&&u.title.push(l.title),ce(l.description)&&!u.description.includes(l.description)&&u.description.push(l.description),ce(l.technology)&&!u.technology.includes(l.technology)&&u.technology.push(l.technology),ce(l.kind)&&!u.kind.includes(l.kind)&&u.kind.push(l.kind),ce(l.color)&&!u.color.includes(l.color)&&u.color.push(l.color),ce(l.line)&&!u.line.includes(l.line)&&u.line.push(l.line),ce(l.head)&&!u.head.includes(l.head)&&u.head.push(l.head),ce(l.tail)&&!u.tail.includes(l.tail)&&u.tail.push(l.tail),ce(l.navigateTo)&&!u.navigateTo.includes(l.navigateTo)&&u.navigateTo.push(l.navigateTo),u),{title:[],description:[],technology:[],kind:[],head:[],tail:[],color:[],line:[],navigateTo:[]}));o={title:kn(c.title)??"[...]",description:kn(c.description),technology:kn(c.technology),kind:kn(c.kind),head:kn(c.head),tail:kn(c.tail),color:kn(c.color),line:kn(c.line),navigateTo:kn(c.navigateTo)}}const a=pV(n);return Object.assign(s,this.getEdgeLabel(o),ce(o.description)&&{description:o.description},ce(o.technology)&&{technology:o.technology},ce(o.kind)&&{kind:o.kind},o.color&&{color:o.color},o.line&&{line:o.line},o.head&&{head:o.head},o.tail&&{tail:o.tail},o.navigateTo&&{navigateTo:o.navigateTo},a&&{tags:a})})}get includedElements(){return new Set([...this.explicits,...this.ctxEdges.flatMap(e=>[e.source,e.target])])}get resolvedElements(){return new Set([...this.explicits,...this.implicits,...this.ctxEdges.flatMap(e=>[e.source,e.target])])}get edges(){return this.ctxEdges}addEdges(e){const n=[];for(const r of e){if(!qr(r.relations,1))continue;const i=this.ctxEdges.find(s=>s.source.id===r.source.id&&s.target.id===r.target.id);if(i){i.relations=Br([...i.relations,...r.relations]),n.push(i);continue}n.push(r),this.ctxEdges.push(r)}return n}addElement(...e){for(const n of e)this.explicits.has(n)?this.activeGroup!==this.__rootGroup&&(this.groups.forEach(r=>{r.implicits.delete(n)}),this.activeGroup.addImplicit(n)):this.activeGroup.addElement(n),this.explicits.add(n),this.implicits.add(n)}addImplicit(...e){for(const n of e)this.implicits.add(n),this.activeGroup!==this.__rootGroup&&this.groups.forEach(r=>{r.implicits.delete(n)});this.activeGroup.addImplicit(...e)}excludeElement(...e){for(const n of e)this.ctxEdges=this.ctxEdges.filter(r=>r.source.id!==n.id&&r.target.id!==n.id),this.explicits.delete(n),this.implicits.delete(n);this.__rootGroup.excludeElement(...e),this.groups.forEach(n=>{n.excludeElement(...e)})}excludeRelation(...e){if(e.length===0)return;const n=new Set,r=Ke(this.ctxEdges,ut(s=>{const o=s.relations.filter(a=>!e.includes(a));return o.length===0?(n.add(s.source),n.add(s.target),null):o.length!==s.relations.length?{...s,relations:o}:s}),nt(e9));if(n.size===0)return;this.ctxEdges=r;const i=this.includedElements;if(i.size===0){this.implicits.clear(),this.__rootGroup.implicits.clear(),this.groups.forEach(s=>s.implicits.clear());return}for(const s of n)i.has(s)||(this.implicits.delete(s),this.__rootGroup.implicits.delete(s),this.groups.forEach(o=>o.implicits.delete(s)))}reset(){this.explicits.clear(),this.implicits.clear(),this.ctxEdges=[],this.__rootGroup=kw.root(),this.groups=[],this.activeGroupStack=[]}removeRedundantImplicitEdges(){const e=new Set,n=s=>s.reduce((o,a)=>(e.has(a)||(o.push(a),e.add(a)),o),[]),r=s=>{const{source:o,target:a}=s;return c=>{const u=o.id===c.source.id,l=a.id===c.target.id;if(u&&l)return!0;const d=Cr(o.id,c.source.id),f=Cr(a.id,c.target.id);return d&&f||u&&f||l&&d}},i=[...this.ctxEdges].sort(IV).reverse();this.ctxEdges=i.reduce((s,o)=>{const a=n(o.relations);return a.length===0||s.length>0&&s.some(r(o))||s.push({source:o.source,target:o.target,relations:a}),s},[])}cleanGroupElements(){const e=new Set(xk([...this.includedElements],[...this.__rootGroup.explicits]));for(const n of this.groups){const r=[...n.explicits];n.explicits.clear();for(const i of r)e.delete(i)&&n.explicits.add(i)}for(const n of this.groups){for(const r of n.implicits)e.delete(r)&&n.explicits.add(r);n.implicits.clear()}}processPredicates(e){for(const n of e){if(Dg(n)){const s=oa(this.activeGroupStack),o=`@gr${this.groups.length+1}`,a=new kw(o,n,s?.id??null);this.groups.push(a),this.activeGroupStack.unshift(a),this.processPredicates(n.groupRules),this.activeGroupStack.shift();continue}const r="include"in n,i=n.include??n.exclude;for(const s of i){if(ye.isElementPredicateExpr(s)){this.processElementPredicate(s,r);continue}if(ye.isRelationPredicateExpr(s)){this.processRelationPredicate(s,r);continue}Ie(s)}}return this}processElementPredicate(e,n,r){if(ye.isCustomElement(e))return n&&this.processElementPredicate(e.custom.expr,n),this;if(ye.isElementWhere(e)){const i=Ro(e.where.condition);return this.processElementPredicate(e.where.expr,n,i),this}if(ye.isExpandedElementExpr(e))return n?bV.call(this,e,r):EV.call(this,e,r),this;if(ye.isElementKindExpr(e)||ye.isElementTagExpr(e))return n?DV.call(this,e,r):TV.call(this,e,r),this;if(ye.isElementRef(e))return n?mV.call(this,e,r):yV.call(this,e,r),this;if(ye.isWildcard(e))return n?vV.call(this,e,r):wV.call(this,e,r),this;Ie(e)}processRelationPredicate(e,n,r){if(ye.isCustomRelationExpr(e))return n&&this.processRelationPredicate(e.customRelation.relation,n),this;if(ye.isRelationWhere(e)){const i=Ro(e.where.condition);return this.processRelationPredicate(e.where.expr,n,i),this}if(ye.isIncoming(e))return n?RV.call(this,e,r):SV.call(this,e,r),this;if(ye.isOutgoing(e))return n?kV.call(this,e,r):$V.call(this,e,r),this;if(ye.isInOut(e))return n?CV.call(this,e,r):_V.call(this,e,r),this;if(ye.isRelation(e))return n?AV.call(this,e,r):xV.call(this,e,r),this;Ie(e)}getEdgeLabel(e){const n=[];return ce(e.title)&&n.push(e.title),ce(e.technology)&&n.push(`[${e.technology}]`),n.length>0?{label:n.join(`
1725
+ `)}:{}}};function NV(t,e){return PV.elementView(t,e)}function pA(t,e){try{return{isSuccess:!0,view:NV(t,e)}}catch(n){return{isSuccess:!1,error:n instanceof Error?n:new Error(`Unknown error: ${n}`),view:void 0}}}let OV=class sO{constructor(e,n){this.view=e,this.graph=n}explicits=new Set;steps=[];static compute(e,n){return new sO(e,n).compute()}addStep({source:e,target:n,title:r,isBackward:i,navigateTo:s,...o},a,c){const u=c?yE(c,a):yE(a),l=this.graph.element(e),d=this.graph.element(n);this.explicits.add(l),this.explicits.add(d);const{title:f,relations:h,tags:p,navigateTo:g}=this.findRelations(l,d),y=ce(s)&&s!==this.view.id?s:g;this.steps.push({id:u,...o,source:l,target:d,title:r??f,relations:h??[],isBackward:i??!1,...y?{navigateTo:y}:{},...p?{tags:p}:{}})}compute(){const{docUri:e,rules:n,steps:r,...i}=this.view;let s=1;for(const f of r){if(r2(f)){if(f.__parallel.length===0)continue;f.__parallel.length===1?this.addStep(f.__parallel[0],s):f.__parallel.forEach((h,p)=>this.addStep(h,p+1,s))}else this.addStep(f,s);s++}for(const f of n)if(n2(f))for(const h of f.include){const p=$n(h);this.graph.elements.filter(p).forEach(g=>this.explicits.add(g))}const o=[...this.explicits],a=sA(o),c=this.steps.map(({source:f,target:h,relations:p,title:g,isBackward:y,...m})=>{const w=Ze(a.get(f.id),`Source node ${f.id} not found`),E=Ze(a.get(h.id),`Target node ${h.id} not found`),k={parent:Ss(f.id,h.id),source:f.id,target:h.id,label:g,relations:p,color:Ds,line:dE,head:So,...m};for(y&&(k.dir="back");k.parent&&!a.has(k.parent);)k.parent=kt(k.parent);w.outEdges.push(k.id),E.inEdges.push(k.id);for(const A of Qr(k.source)){if(A===k.parent)break;a.get(A)?.outEdges.push(k.id)}for(const A of Qr(k.target)){if(A===k.parent)break;a.get(A)?.inEdges.push(k.id)}return k}),u=nA(n,iA(n,o.map(f=>Ze(a.get(f.id))))),l=n.findLast(gE),d=oA(u);return tA({...i,autoLayout:{direction:l?.direction??"LR",...l?.nodeSep&&{nodeSep:l.nodeSep},...l?.rankSep&&{rankSep:l.rankSep}},nodes:ut(u,Rk(["notation"])),edges:c,...d.length>0&&{notation:{elements:d}}})}findRelations(e,n){const r=Br(this.graph.edgesBetween(e,n).flatMap(l=>l.relations));if(r.length===0)return{title:null,tags:null,relations:null,navigateTo:null};const i=Ke(r,Ki(l=>l.tags),nt(ce),Br()),s=qr(i,1)?i:null,o=qr(r,1)?ut(r,l=>l.id):null,a=kn(r)||r.find(l=>l.source===e.id&&l.target===n.id),c=ce(a?.title)?a.title:Ke(r,ut(l=>l.title),nt(ce),Br(),kn()),u=a?.navigateTo&&a.navigateTo!==this.view.id?a.navigateTo:Ke(r,ut(l=>l.navigateTo),nt(ce),nt(l=>l!==this.view.id),Br(),kn());return{title:c??null,tags:s,relations:o,navigateTo:u??null}}};function gA(t,e){try{return{isSuccess:!0,view:OV.compute(t,e)}}catch(n){return{isSuccess:!1,error:n instanceof Error?n:new Error(`Unknown error: ${n}`),view:void 0}}}const $w=Set,Cw=Map;function _w(t,e){return t.size===0||e.size===0?new Set:new Set([...t].filter(n=>e.has(n)))}class mA{#e=new Map;#t=new Map;#n=new Map;#r=new Set;#s=new Map;#i=new Cw;#o=new Cw;#a=new Cw;#c=new Map;constructor({elements:e,relations:n}){for(const r of Object.values(e))this.addElement(r);for(const r of Object.values(n))this.addRelation(r)}get rootElements(){return[...this.#r]}get elements(){return[...this.#e.values()]}element(e){const n=this.#e.get(e);return we(n,`Element ${e} not found`),n}connectedRelations(e){return[...this._incomingTo(e),...this._outgoingFrom(e),...this._internalOf(e)]}children(e){return this._childrenOf(e).slice()}childrenOrElement(e){const n=this.children(e);return n.length>0?n:[this.element(e)]}siblings(e){const n=Hi(e)?e:e.id,r=kt(n);return(r?this._childrenOf(r):this.rootElements).filter(i=>i.id!==n)}ancestors(e){let n=Hi(e)?e:e.id;const r=[];let i;for(;i=this.#t.get(n);)r.push(i),n=i.id;return r}ascendingSiblings(e){const n=Hi(e)?e:e.id;let r=this.#c.get(n);return r||(r=[...this.siblings(n),...this.ancestors(n).flatMap(i=>this.siblings(i.id))],this.#c.set(n,r)),r.slice()}anyEdgesBetween(e,n){if(n.length===0)return[];const r=Hi(e)?this.element(e):e,i=this._incomingTo(r.id),s=this._outgoingFrom(r.id);if(i.size===0&&s.size===0)return[];const o=[];for(const a of n){const c=Hi(a)?this.element(a):a;if(!Ma(r,c)){if(s.size>0){const u=_w(this._incomingTo(c.id),s);u.size>0&&o.push({source:r,target:c,relations:[...u]})}if(i.size>0){const u=_w(this._outgoingFrom(c.id),i);u.size>0&&o.push({source:c,target:r,relations:[...u]})}}}return o}edgesWithin(e){return e.length<2?[]:e.reduce((n,r,i,s)=>(i===s.length-1||n.push(...this.anyEdgesBetween(r,s.slice(i+1))),n),[])}edgesBetween(e,n){const r=$k(e)?e:[e],i=$k(n)?n:[n];if(r.length===0||i.length===0)return[];const s=[];for(const o of r){const a=Hi(o)?this.element(o):o,c=this._outgoingFrom(a.id);if(c.size!==0)for(const u of i){const l=Hi(u)?this.element(u):u;if(Ma(a,l))continue;const d=this._incomingTo(l.id),f=_w(c,d);f.size>0&&s.push({source:a,target:l,relations:[...f]})}}return s}addElement(e){if(this.#e.has(e.id))throw new Error(`Element ${e.id} already exists`);this.#e.set(e.id,e);const n=kt(e.id);n?(this.#t.set(e.id,this.element(n)),this._childrenOf(n).push(e)):this.#r.add(e)}addRelation(e){if(this.#s.has(e.id))throw new Error(`Relation ${e.id} already exists`);this.#s.set(e.id,e),this._incomingTo(e.target).add(e),this._outgoingFrom(e.source).add(e);const n=Ss(e.source,e.target);if(n)for(const r of[n,...Qr(n)])this._internalOf(r).add(e);for(const r of Qr(e.source)){if(r===n)break;this._outgoingFrom(r).add(e)}for(const r of Qr(e.target)){if(r===n)break;this._incomingTo(r).add(e)}}_childrenOf(e){let n=this.#n.get(e);return n||(n=[],this.#n.set(e,n)),n}_incomingTo(e){let n=this.#i.get(e);return n||(n=new $w,this.#i.set(e,n)),n}_outgoingFrom(e){let n=this.#o.get(e);return n||(n=new $w,this.#o.set(e,n)),n}_internalOf(e){let n=this.#a.get(e);return n||(n=new $w,this.#a.set(e,n)),n}}const FV=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,LV=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,MV=/^([/\\]\s*){2,}[^/\\]/;function yA(t){return["./","../"].some(e=>t.startsWith(e))}function Aw(t,e={}){return typeof e=="boolean"&&(e={acceptRelative:e}),e.strict?FV.test(t):LV.test(t)||(e.acceptRelative?MV.test(t):!1)}function zV(t="",e){return t.endsWith("/")}function BV(t="",e){return(zV(t)?t.slice(0,-1):t)||"/"}function qV(t="",e){return t.endsWith("/")?t:t+"/"}function Th(t=""){return t.startsWith("/")}function vA(t=""){return(Th(t)?t.slice(1):t)||"/"}function jV(t=""){return Th(t)?t:"/"+t}function UV(t,e){if(GV(e))return t;const n=BV(e);if(!t.startsWith(n))return t;const r=t.slice(n.length);return r[0]==="/"?r:"/"+r}function GV(t){return!t||t==="/"}function Rh(t=""){const[e="",n="",r=""]=(t.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:e,search:n,hash:r}}const Sh="DynamicViewRule";function xw(t){return ee.isInstance(t,Sh)}const kh="ElementExpression";function Iw(t){return ee.isInstance(t,kh)}const $h="ElementPredicate";function WV(t){return ee.isInstance(t,$h)}const Ch="ElementPredicateOrWhere";function HV(t){return ee.isInstance(t,Ch)}const ro="ElementProperty";function VV(t){return ee.isInstance(t,ro)}const io="LikeC4View";function Pw(t){return ee.isInstance(t,io)}const _h="MetadataProperty";function wA(t){return ee.isInstance(t,_h)}const bA="Predicate",Ah="RelationExpression";function Nw(t){return ee.isInstance(t,Ah)}const xh="RelationPredicate";function KV(t){return ee.isInstance(t,xh)}const Ih="RelationPredicateOrWhere";function YV(t){return ee.isInstance(t,Ih)}const la="RelationProperty";function XV(t){return ee.isInstance(t,la)}const Ph="RelationshipStyleProperty";function JV(t){return ee.isInstance(t,Ph)}const da="StringProperty";function ZV(t){return ee.isInstance(t,da)}const Lu="StyleProperty";function Ow(t){return ee.isInstance(t,Lu)}const Nh="ViewProperty";function QV(t){return ee.isInstance(t,Nh)}const Oh="ViewRule";function eK(t){return ee.isInstance(t,Oh)}const Fh="ViewRulePredicate";function Lh(t){return ee.isInstance(t,Fh)}const Mh="ViewRuleStyleOrGlobalRef";function EA(t){return ee.isInstance(t,Mh)}const Mu="WhereElement";function DA(t){return ee.isInstance(t,Mu)}const zu="WhereElementExpression";function tK(t){return ee.isInstance(t,zu)}const TA="WhereExpression",zh="WhereKindEqual";function nK(t){return ee.isInstance(t,zh)}const Bu="WhereRelation";function RA(t){return ee.isInstance(t,Bu)}const qu="WhereRelationExpression";function rK(t){return ee.isInstance(t,qu)}const Bh="WhereTagEqual";function iK(t){return ee.isInstance(t,Bh)}const ju="ArrowProperty";function Uu(t){return ee.isInstance(t,ju)}const Gu="BorderProperty";function qh(t){return ee.isInstance(t,Gu)}const Wu="ColorProperty";function so(t){return ee.isInstance(t,Wu)}const oo="CustomColor",jh="CustomElementProperties";function sK(t){return ee.isInstance(t,jh)}const Uh="CustomRelationProperties";function oK(t){return ee.isInstance(t,Uh)}const Hu="DirectedRelationExpression";function Fw(t){return ee.isInstance(t,Hu)}const fa="DynamicView";function aK(t){return ee.isInstance(t,fa)}const Gh="DynamicViewBody";function SA(t){return ee.isInstance(t,Gh)}const Vu="DynamicViewIncludePredicate";function cK(t){return ee.isInstance(t,Vu)}const Wh="DynamicViewParallelSteps";function Lw(t){return ee.isInstance(t,Wh)}const Hh="DynamicViewPredicateIterator";function kA(t){return ee.isInstance(t,Hh)}const Mw="DynamicViewRef",Vh="DynamicViewStep";function zw(t){return ee.isInstance(t,Vh)}const Wr="Element";function Hr(t){return ee.isInstance(t,Wr)}const Kh="ElementBody";function ha(t){return ee.isInstance(t,Kh)}const Ku="ElementDescedantsExpression";function Bw(t){return ee.isInstance(t,Ku)}const Yh="ElementExpressionsIterator";function uK(t){return ee.isInstance(t,Yh)}const Zi="ElementKind";function lK(t){return ee.isInstance(t,Zi)}const Yu="ElementKindExpression";function Xh(t){return ee.isInstance(t,Yu)}const Xu="ElementPredicateWhere";function qw(t){return ee.isInstance(t,Xu)}const Ju="ElementPredicateWith";function Jh(t){return ee.isInstance(t,Ju)}const Zu="ElementRef";function Qu(t){return ee.isInstance(t,Zu)}const el="ElementStringProperty";function jw(t){return ee.isInstance(t,el)}const tl="ElementStyleProperty";function nl(t){return ee.isInstance(t,tl)}const rl="ElementTagExpression";function Zh(t){return ee.isInstance(t,rl)}const pa="ElementView";function Qh(t){return ee.isInstance(t,pa)}const ep="ElementViewBody";function Uw(t){return ee.isInstance(t,ep)}const Gw="ElementViewRef",il="ExcludePredicate";function tp(t){return ee.isInstance(t,il)}const sl="ExpandElementExpression";function $A(t){return ee.isInstance(t,sl)}const ga="ExtendElement";function ma(t){return ee.isInstance(t,ga)}const np="ExtendElementBody";function Ww(t){return ee.isInstance(t,np)}const rp="FqnElementRef";function CA(t){return ee.isInstance(t,rp)}const ip="Globals";function dK(t){return ee.isInstance(t,ip)}const sp="GlobalStyle";function Hw(t){return ee.isInstance(t,sp)}const op="GlobalStyleGroup";function Vw(t){return ee.isInstance(t,op)}const ol="GlobalStyleId",al="IconProperty";function Qi(t){return ee.isInstance(t,al)}const cl="IncludePredicate";function Kw(t){return ee.isInstance(t,cl)}const ul="IncomingRelationExpression";function _A(t){return ee.isInstance(t,ul)}const ll="InOutRelationExpression";function Yw(t){return ee.isInstance(t,ll)}const ao="LibIcon";function fK(t){return ee.isInstance(t,ao)}const Xw="LikeC4Grammar",ap="LikeC4Lib";function AA(t){return ee.isInstance(t,ap)}const dl="LineProperty";function fl(t){return ee.isInstance(t,dl)}const hl="LinkProperty";function cp(t){return ee.isInstance(t,hl)}const pl="MetadataAttribute";function hK(t){return ee.isInstance(t,pl)}const gl="MetadataBody";function pK(t){return ee.isInstance(t,gl)}const ya="Model";function Jw(t){return ee.isInstance(t,ya)}const va="ModelViews";function up(t){return ee.isInstance(t,va)}const lp="NavigateToProperty";function Zw(t){return ee.isInstance(t,lp)}const ml="NotationProperty";function wa(t){return ee.isInstance(t,ml)}const yl="NotesProperty";function xA(t){return ee.isInstance(t,yl)}const vl="OpacityProperty";function dp(t){return ee.isInstance(t,vl)}const wl="OutgoingRelationExpression";function Qw(t){return ee.isInstance(t,wl)}const fp="Predicates";function IA(t){return ee.isInstance(t,fp)}const hp="Relation";function es(t){return ee.isInstance(t,hp)}const pp="RelationBody";function PA(t){return ee.isInstance(t,pp)}const bl="RelationNavigateToProperty";function gp(t){return ee.isInstance(t,bl)}const El="RelationPredicateWhere";function NA(t){return ee.isInstance(t,El)}const Dl="RelationPredicateWith";function eb(t){return ee.isInstance(t,Dl)}const ts="RelationshipKind";function gK(t){return ee.isInstance(t,ts)}const Tl="RelationStringProperty";function mp(t){return ee.isInstance(t,Tl)}const Rl="RelationStyleProperty";function tb(t){return ee.isInstance(t,Rl)}const Sl="ShapeProperty";function yp(t){return ee.isInstance(t,Sl)}const vp="SpecificationColor";function wp(t){return ee.isInstance(t,vp)}const ba="SpecificationElementKind";function Ea(t){return ee.isInstance(t,ba)}const kl="SpecificationElementStringProperty";function OA(t){return ee.isInstance(t,kl)}const Da="SpecificationRelationshipKind";function Ta(t){return ee.isInstance(t,Da)}const $l="SpecificationRelationshipStringProperty";function FA(t){return ee.isInstance(t,$l)}const Ra="SpecificationRule";function nb(t){return ee.isInstance(t,Ra)}const Sa="SpecificationTag";function bp(t){return ee.isInstance(t,Sa)}const ns="Tag";function LA(t){return ee.isInstance(t,ns)}const Ep="Tags";function rb(t){return ee.isInstance(t,Ep)}const ib="ViewRef",Cl="ViewRuleAutoLayout";function Dp(t){return ee.isInstance(t,Cl)}const _l="ViewRuleGlobalStyle";function mK(t){return ee.isInstance(t,_l)}const Al="ViewRuleGroup";function MA(t){return ee.isInstance(t,Al)}const xl="ViewRuleStyle";function Il(t){return ee.isInstance(t,xl)}const Pl="ViewStringProperty";function yK(t){return ee.isInstance(t,Pl)}const Nl="WhereBinaryExpression";function vK(t){return ee.isInstance(t,Nl)}const Ol="WhereElementKind";function wK(t){return ee.isInstance(t,Ol)}const Fl="WhereElementNegation";function zA(t){return ee.isInstance(t,Fl)}const Ll="WhereElementTag";function bK(t){return ee.isInstance(t,Ll)}const Ml="WhereRelationKind";function BA(t){return ee.isInstance(t,Ml)}const zl="WhereRelationNegation";function qA(t){return ee.isInstance(t,zl)}const Bl="WhereRelationTag";function EK(t){return ee.isInstance(t,Bl)}const ql="WildcardExpression";function ka(t){return ee.isInstance(t,ql)}class jA extends CD{getAllTypes(){return[ju,Gu,Wu,oo,jh,Uh,Hu,fa,Gh,Vu,Wh,Hh,Mw,Sh,Vh,Wr,Kh,Ku,kh,Yh,Zi,Yu,$h,Ch,Xu,Ju,ro,Zu,el,tl,rl,pa,ep,Gw,il,sl,ga,np,rp,sp,op,ol,ip,al,ll,cl,ul,ao,Xw,ap,io,dl,hl,pl,gl,_h,ya,va,lp,ml,yl,vl,wl,bA,fp,hp,pp,Ah,bl,xh,Ih,El,Dl,la,Tl,Rl,ts,Ph,Sl,vp,ba,kl,Da,$l,Ra,Sa,da,Lu,ns,Ep,Nh,ib,Oh,Cl,_l,Al,Fh,xl,Mh,Pl,Nl,Mu,zu,Ol,Fl,Ll,TA,zh,Bu,qu,Ml,zl,Bl,Bh,ql]}computeIsSubtype(e,n){switch(e){case ju:case dl:return this.isSubtype(Ph,n);case Gu:case vl:case Sl:return this.isSubtype(Lu,n);case Wu:return this.isSubtype(Ph,n)||this.isSubtype(Lu,n);case Hu:case ul:case ll:case wl:return this.isSubtype(Ah,n);case fa:case pa:return this.isSubtype(io,n);case Vu:return this.isSubtype(Sh,n);case Ku:case Yu:case Zu:case rl:case sl:case ql:return this.isSubtype(kh,n);case kh:case Xu:return this.isSubtype(Ch,n);case $h:case xh:return this.isSubtype(bA,n);case Ch:case Ju:return this.isSubtype($h,n);case el:return this.isSubtype(ro,n)||this.isSubtype(da,n);case tl:return this.isSubtype(ro,n);case il:case cl:return this.isSubtype(Fh,n);case al:return this.isSubtype(ro,n)||this.isSubtype(Lu,n);case hl:return this.isSubtype(ro,n)||this.isSubtype(la,n)||this.isSubtype(Nh,n);case pl:case ml:case yl:case kl:case $l:return this.isSubtype(da,n);case gl:return this.isSubtype(_h,n);case _h:return this.isSubtype(ro,n)||this.isSubtype(la,n);case Ah:case El:return this.isSubtype(Ih,n);case bl:case Rl:return this.isSubtype(la,n);case Ih:case Dl:return this.isSubtype(xh,n);case Tl:return this.isSubtype(la,n)||this.isSubtype(da,n);case Cl:case Mh:return this.isSubtype(Sh,n)||this.isSubtype(Oh,n);case _l:case xl:return this.isSubtype(Mh,n);case Al:case Fh:return this.isSubtype(Oh,n);case Pl:return this.isSubtype(da,n)||this.isSubtype(Nh,n);case Nl:return this.isSubtype(zu,n)||this.isSubtype(qu,n);case Mu:case Fl:return this.isSubtype(zu,n);case zu:case qu:return this.isSubtype(TA,n);case Ol:return this.isSubtype(Mu,n)||this.isSubtype(zh,n);case Ll:return this.isSubtype(Mu,n)||this.isSubtype(Bh,n);case Bu:case zl:return this.isSubtype(qu,n);case Ml:return this.isSubtype(zh,n)||this.isSubtype(Bu,n);case Bl:return this.isSubtype(Bu,n)||this.isSubtype(Bh,n);default:return!1}}getReferenceType(e){const n=`${e.container.$type}:${e.property}`;switch(n){case"ColorProperty:customColor":return oo;case"DynamicViewRef:view":return fa;case"DynamicViewStep:kind":case"OutgoingRelationExpression:kind":case"Relation:kind":case"WhereRelationKind:value":return ts;case"Element:kind":case"ElementKindExpression:kind":case"WhereElementKind:value":return Zi;case"ElementRef:el":case"FqnElementRef:el":return Wr;case"ElementTagExpression:tag":case"Tags:values":case"WhereElementTag:value":case"WhereRelationTag:value":return ns;case"ElementViewRef:view":return pa;case"IconProperty:libicon":return ao;case"ViewRef:view":return io;case"ViewRuleGlobalStyle:style":return ol;default:throw new Error(`${n} is not a valid reference id.`)}}getTypeMetaData(e){switch(e){case ju:return{name:ju,properties:[{name:"key"},{name:"value"}]};case Gu:return{name:Gu,properties:[{name:"key"},{name:"value"}]};case Wu:return{name:Wu,properties:[{name:"customColor"},{name:"key"},{name:"themeColor"}]};case oo:return{name:oo,properties:[{name:"name"}]};case jh:return{name:jh,properties:[{name:"props",defaultValue:[]}]};case Uh:return{name:Uh,properties:[{name:"props",defaultValue:[]}]};case Hu:return{name:Hu,properties:[{name:"source"},{name:"target"}]};case fa:return{name:fa,properties:[{name:"body"},{name:"name"}]};case Gh:return{name:Gh,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"steps",defaultValue:[]},{name:"tags"}]};case Vu:return{name:Vu,properties:[{name:"predicates"}]};case Wh:return{name:Wh,properties:[{name:"steps",defaultValue:[]}]};case Hh:return{name:Hh,properties:[{name:"prev"},{name:"value"}]};case Mw:return{name:Mw,properties:[{name:"view"}]};case Vh:return{name:Vh,properties:[{name:"custom"},{name:"isBackward",defaultValue:!1},{name:"kind"},{name:"source"},{name:"target"},{name:"title"}]};case Wr:return{name:Wr,properties:[{name:"body"},{name:"kind"},{name:"name"},{name:"props",defaultValue:[]}]};case Kh:return{name:Kh,properties:[{name:"elements",defaultValue:[]},{name:"props",defaultValue:[]},{name:"tags"}]};case Ku:return{name:Ku,properties:[{name:"parent"}]};case Yh:return{name:Yh,properties:[{name:"prev"},{name:"value"}]};case Zi:return{name:Zi,properties:[{name:"name"}]};case Yu:return{name:Yu,properties:[{name:"isEqual",defaultValue:!1},{name:"kind"}]};case Xu:return{name:Xu,properties:[{name:"subject"},{name:"where"}]};case Ju:return{name:Ju,properties:[{name:"custom"},{name:"subject"}]};case Zu:return{name:Zu,properties:[{name:"el"},{name:"parent"}]};case el:return{name:el,properties:[{name:"key"},{name:"value"}]};case tl:return{name:tl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case rl:return{name:rl,properties:[{name:"isEqual",defaultValue:!1},{name:"tag"}]};case pa:return{name:pa,properties:[{name:"body"},{name:"extends"},{name:"name"},{name:"viewOf"}]};case ep:return{name:ep,properties:[{name:"props",defaultValue:[]},{name:"rules",defaultValue:[]},{name:"tags"}]};case Gw:return{name:Gw,properties:[{name:"view"}]};case il:return{name:il,properties:[{name:"predicates"}]};case sl:return{name:sl,properties:[{name:"expand"}]};case ga:return{name:ga,properties:[{name:"body"},{name:"element"}]};case np:return{name:np,properties:[{name:"elements",defaultValue:[]}]};case rp:return{name:rp,properties:[{name:"el"},{name:"parent"}]};case ip:return{name:ip,properties:[{name:"name"},{name:"styles",defaultValue:[]}]};case sp:return{name:sp,properties:[{name:"id"},{name:"props",defaultValue:[]},{name:"target"}]};case op:return{name:op,properties:[{name:"id"},{name:"styles",defaultValue:[]}]};case ol:return{name:ol,properties:[{name:"name"}]};case al:return{name:al,properties:[{name:"key"},{name:"libicon"},{name:"value"}]};case cl:return{name:cl,properties:[{name:"predicates"}]};case ul:return{name:ul,properties:[{name:"to"}]};case ll:return{name:ll,properties:[{name:"inout"}]};case ao:return{name:ao,properties:[{name:"name"}]};case Xw:return{name:Xw,properties:[{name:"globals",defaultValue:[]},{name:"likec4lib",defaultValue:[]},{name:"models",defaultValue:[]},{name:"specifications",defaultValue:[]},{name:"views",defaultValue:[]}]};case ap:return{name:ap,properties:[{name:"icons",defaultValue:[]}]};case dl:return{name:dl,properties:[{name:"key"},{name:"value"}]};case hl:return{name:hl,properties:[{name:"key"},{name:"title"},{name:"value"}]};case pl:return{name:pl,properties:[{name:"key"},{name:"value"}]};case gl:return{name:gl,properties:[{name:"props",defaultValue:[]}]};case ya:return{name:ya,properties:[{name:"elements",defaultValue:[]},{name:"name"}]};case va:return{name:va,properties:[{name:"name"},{name:"styles",defaultValue:[]},{name:"views",defaultValue:[]}]};case lp:return{name:lp,properties:[{name:"key"},{name:"value"}]};case ml:return{name:ml,properties:[{name:"key"},{name:"value"}]};case yl:return{name:yl,properties:[{name:"key"},{name:"value"}]};case vl:return{name:vl,properties:[{name:"key"},{name:"value"}]};case wl:return{name:wl,properties:[{name:"from"},{name:"isBidirectional",defaultValue:!1},{name:"kind"}]};case fp:return{name:fp,properties:[{name:"prev"},{name:"value"}]};case hp:return{name:hp,properties:[{name:"body"},{name:"kind"},{name:"source"},{name:"tags"},{name:"target"},{name:"technology"},{name:"title"}]};case pp:return{name:pp,properties:[{name:"props",defaultValue:[]},{name:"tags"}]};case bl:return{name:bl,properties:[{name:"key"},{name:"value"}]};case El:return{name:El,properties:[{name:"subject"},{name:"where"}]};case Dl:return{name:Dl,properties:[{name:"custom"},{name:"subject"}]};case ts:return{name:ts,properties:[{name:"name"}]};case Tl:return{name:Tl,properties:[{name:"key"},{name:"value"}]};case Rl:return{name:Rl,properties:[{name:"key"},{name:"props",defaultValue:[]}]};case Sl:return{name:Sl,properties:[{name:"key"},{name:"value"}]};case vp:return{name:vp,properties:[{name:"color"},{name:"name"}]};case ba:return{name:ba,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case kl:return{name:kl,properties:[{name:"key"},{name:"value"}]};case Da:return{name:Da,properties:[{name:"kind"},{name:"props",defaultValue:[]}]};case $l:return{name:$l,properties:[{name:"key"},{name:"value"}]};case Ra:return{name:Ra,properties:[{name:"colors",defaultValue:[]},{name:"elements",defaultValue:[]},{name:"name"},{name:"relationships",defaultValue:[]},{name:"tags",defaultValue:[]}]};case Sa:return{name:Sa,properties:[{name:"tag"}]};case ns:return{name:ns,properties:[{name:"name"}]};case Ep:return{name:Ep,properties:[{name:"prev"},{name:"values",defaultValue:[]}]};case ib:return{name:ib,properties:[{name:"view"}]};case Cl:return{name:Cl,properties:[{name:"direction"},{name:"nodeSep"},{name:"rankSep"}]};case _l:return{name:_l,properties:[{name:"style"}]};case Al:return{name:Al,properties:[{name:"groupRules",defaultValue:[]},{name:"props",defaultValue:[]},{name:"title"}]};case xl:return{name:xl,properties:[{name:"props",defaultValue:[]},{name:"target"}]};case Pl:return{name:Pl,properties:[{name:"key"},{name:"value"}]};case Nl:return{name:Nl,properties:[{name:"left"},{name:"operator"},{name:"right"}]};case Ol:return{name:Ol,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Fl:return{name:Fl,properties:[{name:"value"}]};case Ll:return{name:Ll,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case Ml:return{name:Ml,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case zl:return{name:zl,properties:[{name:"value"}]};case Bl:return{name:Bl,properties:[{name:"not",defaultValue:!1},{name:"operator"},{name:"value"}]};case ql:return{name:ql,properties:[{name:"isWildcard",defaultValue:!1}]};default:return{name:e,properties:[]}}}}const ee=new jA;let UA;const DK=()=>UA??(UA=RU(`{"$type":"Grammar","isDeclared":true,"name":"LikeC4","rules":[{"$type":"ParserRule","name":"LikeC4Grammar","entry":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"specifications","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@7"},"arguments":[]}},{"$type":"Assignment","feature":"models","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@14"},"arguments":[]}},{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@32"},"arguments":[]}},{"$type":"Assignment","feature":"globals","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@91"},"arguments":[]}},{"$type":"Assignment","feature":"likec4lib","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@1"},"arguments":[]}}],"cardinality":"*"},"definesHiddenTokens":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4Lib","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"likec4lib"},{"$type":"Keyword","value":"{"},{"$type":"Keyword","value":"icons"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"icons","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@2"},"arguments":[]},"cardinality":"+"},{"$type":"Keyword","value":"}"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LibIcon","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tag","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipKind","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColor","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRule","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"specification"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@8"},"arguments":[]}},{"$type":"Assignment","feature":"tags","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@10"},"arguments":[]}},{"$type":"Assignment","feature":"relationships","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@12"},"arguments":[]}},{"$type":"Assignment","feature":"colors","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@11"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"element"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@3"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@9"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationTag","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"tag"},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@4"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationColor","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"color"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@6"},"arguments":[]}},{"$type":"Assignment","feature":"color","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@111"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipKind","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"relationship"},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@5"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@13"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"SpecificationRelationshipStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"notation"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Model","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"model"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@19"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Element","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false}}]}]},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@16"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@17"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":false},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@103"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElement","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"extend"},{"$type":"Assignment","feature":"element","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@21"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@20"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ExtendElementBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"elements","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@24"},"arguments":[{"$type":"NamedArgument","value":{"$type":"BooleanLiteral","true":true},"calledByName":false}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@15"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"FqnElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"FqnElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementRef","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementRef"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@130"},"arguments":[]},{"$type":"Assignment","feature":"el","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@15"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},"deprecatedSyntax":false}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Tags","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"+"},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Tags"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"values","operator":"+=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"*"}],"cardinality":"*"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Relation","parameters":[{"$type":"Parameter","name":"isExplicit"}],"definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Group","guardCondition":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@24/parameters@0"}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]},{"$type":"Group","guardCondition":{"$type":"Negation","value":{"$type":"ParameterReference","parameter":{"$ref":"#/rules@24/parameters@0"}}},"elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},"cardinality":"?"}]}]},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Keyword","value":"->"}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Assignment","feature":"technology","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@25"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"wildcard":false},{"$type":"ParserRule","name":"RelationBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@26"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@28"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@29"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"technology"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataProperty","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"metadata"},{"$type":"RuleCall","rule":{"$ref":"#/rules@30"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@31"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"MetadataAttribute","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ModelViews","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"views"}},{"$type":"Keyword","value":"{"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"views","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@33"},"arguments":[]}},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LikeC4ViewRule","returnType":{"$ref":"#/types@0"},"definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@34"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@35"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},"cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"extends"},{"$type":"Assignment","feature":"extends","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@37"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Keyword","value":"of"},{"$type":"Assignment","feature":"viewOf","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}}]}],"cardinality":"?"},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@39"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicView","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"dynamic"},{"$type":"Keyword","value":"view"},{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}},{"$type":"Assignment","feature":"body","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@40"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/types@0"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@34"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRef","definition":{"$type":"Assignment","feature":"view","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@35"},"deprecatedSyntax":false}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},"cardinality":"*"},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@44"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewBody","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"tags","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@23"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@41"},"arguments":[]},"cardinality":"*"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@47"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]}]}},{"$type":"Assignment","feature":"rules","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@46"},"arguments":[]}}],"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@42"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@95"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewStringProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"title"},{"$type":"Keyword","value":"description"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewLayoutDirection","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"TopBottom"},{"$type":"Keyword","value":"LeftRight"},{"$type":"Keyword","value":"BottomTop"},{"$type":"Keyword","value":"RightLeft"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"group"},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]}]},"cardinality":"*"},{"$type":"Assignment","feature":"groupRules","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@49"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@45"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewRule","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@79"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@83"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@84"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewParallelSteps","definition":{"$type":"Group","elements":[{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"parallel"},{"$type":"Keyword","value":"par"}]},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"steps","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@48"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewStep","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"source","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBackward","operator":"?=","terminal":{"$type":"Keyword","value":"<-"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},"cardinality":"?"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRulePredicate","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"IncludePredicate"}},{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExcludePredicate"}},{"$type":"Keyword","value":"exclude"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@50"},"arguments":[]}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicates","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"Predicates"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@51"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Predicate","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@64"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@53"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicates","inferredType":{"$type":"InferredType","name":"ElementPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@54"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@87"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@56"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementOr","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@57"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementAnd","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@58"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementPrimary","inferredType":{"$type":"InferredType","name":"WhereElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@59"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@60"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElementNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@55"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereElement","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereElementKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@62"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@63"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementSelectorExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WildcardExpression"}},{"$type":"Assignment","feature":"isWildcard","operator":"?=","terminal":{"$type":"Keyword","value":"*"}}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementTagExpression"}},{"$type":"Keyword","value":"element.tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]},{"$type":"Assignment","feature":"tag","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementKindExpression"}},{"$type":"Keyword","value":"element.kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@119"},"arguments":[]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@3"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementDescedantsExpression","inferredType":{"$type":"InferredType","name":"ElementExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@22"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ExpandElementExpression"},"feature":"expand","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@127"},"arguments":[]}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementDescedantsExpression"},"feature":"parent","operator":"="},{"$type":"RuleCall","rule":{"$ref":"#/rules@128"},"arguments":[]}]}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicate","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@65"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicates","inferredType":{"$type":"InferredType","name":"RelationPredicate"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@66"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWith"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"with"},{"$type":"Assignment","feature":"custom","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@88"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationPredicateOrWhere","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@73"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"RelationPredicateWhere"},"feature":"subject","operator":"="},{"$type":"Keyword","value":"where"},{"$type":"Assignment","feature":"where","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationExpression","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@68"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationOr","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"or"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@69"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationAnd","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereBinaryExpression"},"feature":"left","operator":"="},{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"and"}},{"$type":"Assignment","feature":"right","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@70"},"arguments":[]}}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationPrimary","inferredType":{"$type":"InferredType","name":"WhereRelationExpression"},"definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Keyword","value":"("},{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]},{"$type":"Keyword","value":")"}]},{"$type":"RuleCall","rule":{"$ref":"#/rules@71"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@72"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelationNegation","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"not"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@67"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"WhereRelation","definition":{"$type":"Alternatives","elements":[{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationTag"}},{"$type":"Keyword","value":"tag"},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@4"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@114"},"arguments":[]},"deprecatedSyntax":false},"cardinality":"?"}]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"WhereRelationKind"}},{"$type":"Keyword","value":"kind"},{"$type":"RuleCall","rule":{"$ref":"#/rules@118"},"arguments":[]},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationExpression","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@74"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@76"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"InOutRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@75"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"InOutRelationExpression"},"feature":"inout","operator":"="},{"$type":"Keyword","value":"->"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IncomingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"->"},{"$type":"Assignment","feature":"to","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DirectedRelationExpressions","inferredType":{"$type":"InferredType","name":"RelationExpression"},"definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@77"},"arguments":[]},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DirectedRelationExpression"},"feature":"source","operator":"="},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OutgoingRelationExpression","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"from","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isBidirectional","operator":"?=","terminal":{"$type":"Keyword","value":"<->"}},{"$type":"Keyword","value":"->"},{"$type":"Group","elements":[{"$type":"Keyword","value":"-["},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"deprecatedSyntax":false}},{"$type":"Keyword","value":"]->"}]},{"$type":"Assignment","feature":"kind","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@5"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@115"},"arguments":[]},"deprecatedSyntax":false}}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementExpressionsIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"ElementExpressionsIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@61"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewIncludePredicate","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"include"},{"$type":"Assignment","feature":"predicates","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@80"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DynamicViewPredicateIterator","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Action","inferredType":{"$type":"InferredType","name":"DynamicViewPredicateIterator"},"feature":"prev","operator":"="},{"$type":"Keyword","value":","},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@52"},"arguments":[]},"cardinality":"?"}],"cardinality":"*"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleGlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"global"},{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"style","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@92"},"deprecatedSyntax":false}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleStyleOrGlobalRef","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@82"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ViewRuleAutoLayout","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"autoLayout"},{"$type":"Assignment","feature":"direction","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@43"},"arguments":[]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"rankSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]}},{"$type":"Assignment","feature":"nodeSep","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]},"cardinality":"?"}],"cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotationProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notation"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NotesProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"notes"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomElementProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@89"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@18"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomRelationProperties","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@90"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@27"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@86"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@106"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"NavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@36"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationNavigateToProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"navigateTo"}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@38"},"arguments":[]}}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Globals","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"Keyword","value":"global"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@93"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@94"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleId","definition":{"$type":"Assignment","feature":"name","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]}},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyle","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"style"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]}},{"$type":"Assignment","feature":"target","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@78"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@85"},"arguments":[]}]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"GlobalStyleGroup","definition":{"$type":"Group","elements":[{"$type":"Keyword","value":"styleGroup"},{"$type":"Assignment","feature":"id","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@92"},"arguments":[]}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"styles","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@81"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LinkProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"link"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}},{"$type":"Assignment","feature":"title","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@135"},"arguments":[]},"cardinality":"?"},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ColorProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"color"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"themeColor","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]}},{"$type":"Assignment","feature":"customColor","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@6"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@116"},"arguments":[]},"deprecatedSyntax":false}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"OpacityProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"opacity"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@134"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"icon"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"libicon","operator":"=","terminal":{"$type":"CrossReference","type":{"$ref":"#/rules@2"},"terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@112"},"arguments":[]},"deprecatedSyntax":false}},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@113"},"arguments":[]}}]},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ShapeProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"shape"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderStyleValue","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},{"$type":"Keyword","value":"none"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"BorderProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"border"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@100"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"StyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@99"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@101"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@97"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@98"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementStyleProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"style"}},{"$type":"Keyword","value":"{"},{"$type":"Assignment","feature":"props","operator":"+=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@102"},"arguments":[]},"cardinality":"*"},{"$type":"Keyword","value":"}"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Keyword","value":"line"}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowProperty","definition":{"$type":"Group","elements":[{"$type":"Assignment","feature":"key","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"head"},{"$type":"Keyword","value":"tail"}]}},{"$type":"Keyword","value":":","cardinality":"?"},{"$type":"Assignment","feature":"value","operator":"=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]}},{"$type":"Keyword","value":";","cardinality":"?"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"RelationshipStyleProperty","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@96"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@104"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@105"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"LineOptions","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"solid"},{"$type":"Keyword","value":"dashed"},{"$type":"Keyword","value":"dotted"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ArrowType","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"none"},{"$type":"Keyword","value":"normal"},{"$type":"Keyword","value":"onormal"},{"$type":"Keyword","value":"dot"},{"$type":"Keyword","value":"odot"},{"$type":"Keyword","value":"diamond"},{"$type":"Keyword","value":"odiamond"},{"$type":"Keyword","value":"crow"},{"$type":"Keyword","value":"open"},{"$type":"Keyword","value":"vee"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ThemeColor","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"primary"},{"$type":"Keyword","value":"secondary"},{"$type":"Keyword","value":"muted"},{"$type":"Keyword","value":"slate"},{"$type":"Keyword","value":"blue"},{"$type":"Keyword","value":"indigo"},{"$type":"Keyword","value":"sky"},{"$type":"Keyword","value":"red"},{"$type":"Keyword","value":"gray"},{"$type":"Keyword","value":"green"},{"$type":"Keyword","value":"amber"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"ElementShape","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"Keyword","value":"rectangle"},{"$type":"Keyword","value":"person"},{"$type":"Keyword","value":"browser"},{"$type":"Keyword","value":"mobile"},{"$type":"Keyword","value":"cylinder"},{"$type":"Keyword","value":"storage"},{"$type":"Keyword","value":"queue"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorValue","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@138"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@137"},"arguments":[]}]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IconId","dataType":"string","definition":{"$type":"RuleCall","rule":{"$ref":"#/rules@124"},"arguments":[]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Uri","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@125"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@126"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"TagId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@129"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"DotId","dataType":"string","definition":{"$type":"Group","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@131"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@117"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"CustomColorId","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"Id","dataType":"string","definition":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@136"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@110"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@109"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@108"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@107"},"arguments":[]},{"$type":"Keyword","value":"element"},{"$type":"Keyword","value":"model"},{"$type":"Keyword","value":"group"}]},"definesHiddenTokens":false,"entry":false,"fragment":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"EqOperator","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Alternatives","elements":[{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]}]}},{"$type":"Group","elements":[{"$type":"Assignment","feature":"operator","operator":"=","terminal":{"$type":"Keyword","value":"is"}},{"$type":"Assignment","feature":"not","operator":"?=","terminal":{"$type":"Keyword","value":"not"},"cardinality":"?"}]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"ParserRule","name":"IsEqual","fragment":true,"definition":{"$type":"Alternatives","elements":[{"$type":"Assignment","feature":"isEqual","operator":"?=","terminal":{"$type":"RuleCall","rule":{"$ref":"#/rules@133"},"arguments":[]}},{"$type":"RuleCall","rule":{"$ref":"#/rules@132"},"arguments":[]}]},"definesHiddenTokens":false,"entry":false,"hiddenTokens":[],"parameters":[],"wildcard":false},{"$type":"TerminalRule","hidden":true,"name":"BLOCK_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\*[\\\\s\\\\S]*?\\\\*\\\\//"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"LINE_COMMENT","definition":{"$type":"RegexToken","regex":"/\\\\/\\\\/[^\\\\n\\\\r]*/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"WS","definition":{"$type":"RegexToken","regex":"/[\\\\t ]+/"},"fragment":false},{"$type":"TerminalRule","hidden":true,"name":"NL","definition":{"$type":"RegexToken","regex":"/[\\\\r\\\\n]+/"},"fragment":false},{"$type":"TerminalRule","name":"LIB_ICON","definition":{"$type":"RegexToken","regex":"/(aws|azure|gcp|tech):[-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_WITH_SCHEMA","definition":{"$type":"RegexToken","regex":"/\\\\w+:\\\\/\\\\/\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"URI_RELATIVE","definition":{"$type":"RegexToken","regex":"/\\\\.{0,2}\\\\/[^\\\\/]\\\\S+/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotUnderscore","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\._/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"DotWildcard","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\.\\\\*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hash","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"#"}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"StickyDot","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\./"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Dot","definition":{"$type":"CharacterRange","left":{"$type":"Keyword","value":"."}},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"NotEqual","definition":{"$type":"RegexToken","regex":"/\\\\!\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Eq","definition":{"$type":"RegexToken","regex":"/\\\\={1,2}/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Percent","definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+%/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"String","definition":{"$type":"RegexToken","regex":"/\\"[^\\"]*\\"|'[^']*'/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"IdTerminal","definition":{"$type":"RegexToken","regex":"/[_]*[a-zA-Z][-\\\\w]*/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Number","type":{"$type":"ReturnType","name":"number"},"definition":{"$type":"RegexToken","regex":"/\\\\b\\\\d+\\\\b/"},"fragment":false,"hidden":false},{"$type":"TerminalRule","name":"Hex","definition":{"$type":"RegexToken","regex":"/\\\\b[a-zA-Z0-9]+\\\\b/"},"fragment":false,"hidden":false}],"types":[{"$type":"Type","name":"LikeC4View","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@34"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@35"}}]}},{"$type":"Type","name":"StringProperty","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@18"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@42"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@27"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@31"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@9"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@13"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@85"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@86"}}]}},{"$type":"Type","name":"WhereTagEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@60/definition/elements@0/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@72/definition/elements@0/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereKindEqual","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@60/definition/elements@1/elements@0/inferredType"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@72/definition/elements@1/elements@0/inferredType"}}]}},{"$type":"Type","name":"WhereExpression","type":{"$type":"UnionType","types":[{"$type":"SimpleType","typeRef":{"$ref":"#/rules@55"}},{"$type":"SimpleType","typeRef":{"$ref":"#/rules@67"}}]}}],"definesHiddenTokens":false,"hiddenTokens":[],"imports":[],"interfaces":[],"usedGrammars":[]}`)),GA={languageId:"likec4",fileExtensions:[".c4",".likec4",".like-c4"],caseInsensitive:!1},TK={skipValidations:!0,recoveryEnabled:!0,nodeLocationTracking:"full"},RK={AstReflection:()=>new jA},SK={Grammar:()=>DK(),LanguageMetaData:()=>GA,parser:{ParserConfig:()=>TK}},Oe=et.withTag("lsp");function Vt(t){Oe.error(t)}function mt(t){if(t instanceof Error){Oe.warn(t.stack??t.message);return}Oe.warn(t)}function kK(t){Oe.level=Xe[t]}function $K(t){const e={log:({level:n,...r},i)=>{if(n!==Xe.error&&n!==Xe.fatal)return;const s=r.tag||"",o=r.args.map(c=>tv(c)?c.stack??c.message:typeof c=="string"?c:""+c);s&&o.unshift(`[${s}]`);const a=o.join(" ");t.telemetry.logEvent({eventName:"error",error:a})}};et.addReporter(e),Oe.setReporters(et.options.reporters)}function CK(t){const e={log:({level:n,...r},i)=>{const s=r.tag||"",o=r.args.map(c=>tv(c)?c.stack??c.message:typeof c=="string"?c:""+c);s&&o.unshift(`[${s}]`);const a=o.join(" ");switch(!0){case n>=Xe.debug:{t.console.debug(a);break}case n>=Xe.log:{t.console.info(a);break}case n>=Xe.warn:{t.console.warn(a);break}case n>=Xe.fatal:{t.console.error(a);break}default:t.console.log(a)}}};et.setReporters([e]),Oe.setReporters(et.options.reporters)}function Cn(t){return t.el.ref}function Tp(t){const e=[t.el.$refText];let n=t.parent;for(;n;)e.push(n.el.$refText),n=n.parent;return e.length===1?e[0]:e.reverse().join(".")}const jl=Symbol.for("idattr"),sb={writeId(t,e){return t[jl]=e,t},readId(t){return t[jl]}},WA={writeId(t,e){return Dt(e)?t[jl]=void 0:t[jl]=e,t},readId(t){return t[jl]}};function _K(t){return Object.assign(t,{c4Specification:{tags:new Set,elements:{},relationships:{},colors:{}},c4Elements:[],c4Relations:[],c4Globals:{styles:{}},c4Views:[]})}function Rp(t){return t.textDocument.languageId===GA.languageId}function HA(t){return Rp(t)&&t.state>=Ve.IndexedContent&&!!t.c4fqnIndex}function Ul(t){return Rp(t)&&t.state==Ve.Validated&&!!t.c4Specification&&!!t.c4Elements&&!!t.c4Relations&&!!t.c4Views&&!!t.c4fqnIndex}function AK(t){return e=>t.some(n=>n(e))}const xK=AK([dK,Hw,Vw,kA,Jh,eb,Iw,Nw,Lw,zw,QV,Ow,rb,eK,xw,Uw,SA,Pw,XV,PA,es,VV,ha,Hr,Ww,ma,Ea,Ta,bp,wp,nb,up,Jw]),IK=t=>{let e=t;for(;e;){if(xK(e))return e;e=e.$container}};function PK(t){const e=t.diagnostics?.filter(r=>r.severity===Xc.Error)??[],n=new WeakSet(e.flatMap(r=>IK(r.node)??[]));return{isValid:r=>!n.has(r),invalidNodes:n}}function*NK(t,e){const n=t.parseResult.value.models.flatMap(s=>s.elements),r=[];let i;for(;i=n.shift();)if(e(i)){if(es(i)){r.push(i);continue}if(ma(i)){i.body&&i.body.elements.length>0&&n.push(...i.body.elements);continue}i.body&&i.body.elements.length>0&&n.push(...i.body.elements),yield i}for(const s of r)yield s}function OK(t){const e=Cn(t.target);if(!e)throw new Error("RelationRefError: Invalid reference to target");if(Ft(t.source)){const n=Cn(t.source);if(!n)throw new Error("RelationRefError: Invalid reference to source");return{source:n,target:e}}if(!ha(t.$container))throw new Error("RelationRefError: Invalid container for sourceless relation");return{source:t.$container.$container,target:e}}function VA({value:t}){const e=parseFloat(t);return isNaN(e)?100:Pk(e,{min:0,max:100})}function Sp(t,e){const n={};if(!t||t.length===0)return n;for(const r of t)if(e(r))switch(!0){case qh(r):{ce(r.value)&&(n.border=r.value);break}case so(r):{const i=Gl(r);ce(i)&&(n.color=i);break}case yp(r):{ce(r.value)&&(n.shape=r.value);break}case Qi(r):{const i=r.libicon?.ref?.name??r.value;ce(i)&&(n.icon=i);break}case dp(r):{n.opacity=VA(r);break}default:Ie(r.$type)}return n}function FK(t){const e={};if(!t||t.length===0)return e;for(const n of t){if(so(n)){const r=Gl(n);ce(r)&&(e.color=r);continue}if(fl(n)){e.line=n.value;continue}if(Uu(n)){switch(n.key){case"head":{e.head=n.value;break}case"tail":{e.tail=n.value;break}default:Ie(n)}continue}Ie(n)}return e}function KA(t){const{color:e,line:n,head:r,tail:i}=FK(t?.filter(JV));return{...e&&e!==Ds?{color:e}:{},...n&&n!==dE?{line:n}:{},...r&&r!==So?{head:r}:{},...i?{tail:i}:{}}}function Gl(t){return t?.themeColor??t?.customColor?.$refText}function YA(t){const e=t.rankSep,n=t.nodeSep;let r;switch(t.direction){case"TopBottom":{r="TB";break}case"BottomTop":{r="BT";break}case"LeftRight":{r="LR";break}case"RightLeft":{r="RL";break}default:Ie(t.direction)}return{direction:r,...n&&{nodeSep:n},...e&&{rankSep:e}}}function LK(t){switch(t){case"TB":return"TopBottom";case"BT":return"BottomTop";case"LR":return"LeftRight";case"RL":return"RightLeft";default:Ie(t)}}function XA(t){if(Iw(t))return t;if(qw(t))return t.subject;if(Jh(t))return XA(t.subject);Ie(t)}class MK{constructor(e){this.services=e}async provideCodeLens(e,n,r){return e.state!==Ve.Validated&&(Oe.debug(`Waiting for document ${e.uri.path} to be validated`),await this.services.shared.workspace.DocumentBuilder.waitUntil(Ve.Validated,e.uri,r),Oe.debug(`Document ${e.uri.path} is validated`)),Ul(e)?e.parseResult.value.views.flatMap(i=>i.views).flatMap(i=>{const s=sb.readId(i),o=i.$cstNode?.range;return!o||!s?[]:{range:{start:o.start,end:{line:o.start.line,character:o.start.character+4}},command:{command:"likec4.open-preview",arguments:[s],title:"open preview"}}}):void 0}}class zK extends aC{completionOptions={triggerCharacters:["."]};completionForKeyword(e,n,r){if(this.filterKeyword(e,n)){if(["title","description","technology"].includes(n.value))return r(e,{label:n.value,kind:Ot.Property,insertTextFormat:pr.Snippet,insertText:`${n.value} '\${0}'`});if(["views","specification","model","with"].includes(n.value))return r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ot.Module,insertTextFormat:pr.Snippet,insertText:`${n.value} {
1726
+ $0
1727
+ }`});if(n.value==="group")return r(e,{label:n.value,detail:"Insert group block",kind:Ot.Class,insertTextFormat:pr.Snippet,insertText:["group '${1:Title}' {"," $0","}"].join(`
1728
+ `)});if(n.value==="dynamic")return r(e,{label:n.value,detail:"Insert dynamic view",kind:Ot.Class,insertTextFormat:pr.Snippet,insertText:["dynamic view ${1:view_${TM_FILENAME_BASE}_${CURRENT_SECOND}} {"," title '${2:Untitled}'"," "," $0","}"].join(`
1729
+ `)});if(n.value==="style"&&e.node)return Sc(e.node,Hw)?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ot.Module,insertTextFormat:pr.Snippet,insertText:`${n.value} \${1:name} \${2:*} {
1730
+ \${3|color,shape,border,opacity,icon|} $0
1731
+ }`}):Sc(e.node,nv([up,Vw]))?r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ot.Module,insertTextFormat:pr.Snippet,insertText:`${n.value} \${1:*} {
1732
+ \${2|color,shape,border,opacity,icon|} $0
1733
+ }`}):r(e,{label:n.value,detail:`Insert ${n.value} block`,kind:Ot.Module,insertTextFormat:pr.Snippet,insertText:`${n.value} {
1734
+ \${1|color,shape,border,opacity,icon|} $0
1735
+ }`});if(n.value==="extend")return r(e,{label:n.value,detail:"Extend another view",kind:Ot.Class,insertTextFormat:pr.Snippet,insertText:`extend \${1:element} {
1736
+ $0
1737
+ }`});if(n.value==="autoLayout")return r(e,{label:n.value,kind:Ot.Class,insertTextFormat:pr.Snippet,insertText:"autoLayout ${1|TopBottom,BottomTop,LeftRight,RightLeft|}$0"});r(e,{label:n.value,kind:this.getKeywordCompletionItemKind(n),detail:"Keyword",sortText:"1"})}}}class BK extends cC{createDocumentHighlight(e){return ge.DocumentHighlight.create(e.segment.range,ge.DocumentHighlightKind.Read)}}class qK{constructor(e){this.services=e}getDocumentLinks(e,n){return Ul(e)?Pr(e.parseResult.value).filter(cp).map(r=>{try{const i=An(r.$cstNode,"value")?.range,s=this.resolveLink(e,r.value);if(i&&Aw(s))return{range:i,target:s}}catch(i){mt(i)}return null}).nonNullable().toArray():[]}resolveLink(e,n){if(Aw(n)||Th(n))return n;const r=yA(n)?new URL(e.uri.toString(!0)):this.services.shared.workspace.WorkspaceManager.workspaceURL;return new URL(n,r).toString()}relativeLink(e,n){if(Th(n))return vA(n);if(yA(n)){const r=new URL(e.uri.toString(!0)),i=new URL(n,r).toString();return vA(UV(i,this.services.shared.workspace.WorkspaceManager.workspaceURL.toString()))}return null}}class jK{constructor(e){this.services=e,this.nodeKindProvider=e.shared.lsp.NodeKindProvider}nodeKindProvider;getSymbols({parseResult:{value:{specifications:e,models:n,views:r,likec4lib:i}}}){return[...i.map(s=>()=>this.getLikec4LibSymbol(s)),...e.map(s=>()=>this.getSpecSymbol(s)),...n.map(s=>()=>this.getModelSymbol(s)),...r.map(s=>()=>this.getModelViewsSymbol(s))].flatMap(s=>{try{return s()??[]}catch(o){return Vt(o),[]}})}getLikec4LibSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.icons.map(i=>this.getLibIconSymbol(i)).filter(ce);return r.length===0?[]:[{kind:gr.Namespace,name:"icons",range:n.range,selectionRange:Cc(n,"icons")?.range??n.range,children:r}]}getSpecSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=An(n,"name");if(!r)return[];const i=Ke([...e.elements,...e.tags,...e.relationships],ut(s=>{try{if(Ea(s)||Ta(s))return this.getKindSymbol(s);if(bp(s))return this.getTagSymbol(s)}catch(o){return Vt(o),null}Ie(s)}),nt(ce));return i.length===0?[]:[{kind:gr.Namespace,name:e.name,range:n.range,selectionRange:r.range,children:i}]}getModelSymbol(e){const n=e.$cstNode;if(!n)return[];const r=An(n,"name");return r?[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.elements.flatMap(i=>this.getElementsSymbol(i))}]:[]}getElementsSymbol(e){try{if(ma(e))return this.getExtendElementSymbol(e);if(Hr(e))return this.getElementSymbol(e)}catch(n){Vt(n)}return[]}getExtendElementSymbol(e){const n=e.$cstNode,r=e.element.$cstNode,i=e.body;return!n||!r?[]:[{kind:this.symbolKind(e),name:Tp(e.element),range:n.range,selectionRange:r.range,children:i.elements.flatMap(s=>this.getElementsSymbol(s))}]}getElementSymbol(e){const n=e.$cstNode,r=An(n,"name");if(!r||!n)return[];const i=e.name,s=e.kind.$refText;return[{kind:this.symbolKind(e),name:i,range:n.range,selectionRange:r.range,detail:s,children:e.body?.elements.flatMap(o=>this.getElementsSymbol(o))??[]}]}getModelViewsSymbol(e){const n=e.$cstNode,r=An(n,"name");return!r||!n?[]:[{kind:this.symbolKind(e),name:e.name,range:n.range,selectionRange:r.range,children:e.views.flatMap(i=>this.getViewSymbol(i))}]}getKindSymbol(e){return!e.$cstNode||!e.kind.$cstNode||Vi(e.kind.name)?null:{kind:this.symbolKind(e),name:e.kind.name,range:e.$cstNode.range,selectionRange:e.kind.$cstNode.range}}getTagSymbol(e){return!e.$cstNode||!e.tag.$cstNode||Vi(e.tag.name)?null:{kind:this.symbolKind(e),name:"#"+e.tag.name,range:e.$cstNode.range,selectionRange:e.tag.$cstNode.range}}getLibIconSymbol(e){return!e.$cstNode||Vi(e.name)?null:{kind:this.symbolKind(e),name:e.name,range:e.$cstNode.range,selectionRange:e.$cstNode.range}}getViewSymbol(e){const n=e?.$cstNode;if(!n)return[];const r=e.name?An(n,"name"):null;return r?[{kind:this.symbolKind(e),name:r.text,range:n.range,selectionRange:r.range,children:[]}]:[]}symbolKind(e){return this.nodeKindProvider.getSymbolKind(e)}}class UK extends fC{locator;constructor(e){super(e),this.locator=e.likec4.ModelLocator}getAstNodeHoverContent(e){if(LA(e))return{contents:{kind:"markdown",value:kv(`
1738
+ tag: \`${e.name}\`
1739
+ `)}};if(Hr(e)){const n=this.locator.getParsedElement(e);return n?{contents:{kind:"markdown",value:[n.id,`### ${n.title}`,"`"+n.kind+"` "].join(`
1740
+ `)}}:void 0}}}class GK extends K7{highlightElement(e,n){if(gK(e))return n({node:e,property:"name",type:We.function});if(fK(e))return n({node:e,property:"name",type:We.type,modifier:[ht.definition]}),"prune";if(Qw(e)&&"kind"in e){n({node:e,property:"kind",type:We.function});return}if(es(e)&&"kind"in e&&n({node:e,property:"kind",type:We.function}),Zw(e)||gp(e))return n({node:e,property:"key",type:We.property}),n({node:e,property:"value",type:We.variable,modifier:[ht.definition,ht.readonly]}),"prune";if((Bw(e)||ka(e))&&e.$cstNode){n({cst:e.$cstNode,type:We.variable,modifier:[ht.definition,ht.readonly]});return}if(BA(e)&&ce(e.value)){n({node:e,property:"value",type:We.function});return}if((DA(e)||RA(e))&&ce(e.value)){n({node:e,property:"value",type:We.type,modifier:[ht.definition,ht.readonly]});return}if(Xh(e)&&ce(e.kind)&&n({node:e,property:"kind",type:We.type,modifier:[ht.definition]}),Zh(e)&&ce(e.tag)&&n({node:e,property:"tag",type:We.type,modifier:[ht.definition]}),Qu(e)||CA(e))return n({node:e,property:"el",type:e.parent?We.property:We.variable,modifier:[ht.definition,ht.readonly]}),e.parent?void 0:"prune";if(wp(e)){n({node:e,keyword:"color",type:We.keyword}),n({node:e,property:"name",type:We.type,modifier:[ht.declaration,ht.readonly]});return}if((Ea(e)||Ta(e))&&n({node:e,property:"kind",type:We.type,modifier:[ht.declaration,ht.readonly]}),rb(e))return n({node:e,property:"values",type:We.interface});if(LA(e))return n({node:e,property:"name",type:We.type,modifier:[ht.definition]});if((tb(e)||nl(e)&&ha(e.$container))&&n({node:e,property:"key",type:We.property}),dp(e))return n({node:e,property:"key",type:We.property}),n({node:e,property:"value",type:We.number}),"prune";if(cp(e)||Qi(e)||ZV(e))return n({node:e,property:"key",type:We.property}),"value"in e&&e.value&&n({node:e,property:"value",type:We.string}),Qi(e)&&e.libicon&&n({node:e,property:"libicon",type:We.enum,modifier:[ht.defaultLibrary]}),"prune";if(so(e)||yp(e)||Uu(e)||fl(e)||qh(e))return n({node:e,property:"key",type:We.property}),"value"in e&&n({node:e,property:"value",type:We.enum}),"prune";if(Hr(e))return this.highlightAstElement(e,n);if(Pw(e))return this.highlightView(e,n)}highlightAstElement(e,n){n({node:e,property:"name",type:We.variable,modifier:[ht.declaration,ht.readonly]}),n({node:e,property:"kind",type:We.keyword,modifier:[]})}highlightView(e,n){e.name&&n({node:e,property:"name",type:We.variable,modifier:[ht.declaration,ht.readonly,"local"]})}}const{findNodeForProperty:WK}=Qd,{toDocumentSegment:JA}=JL;function HK(t,e,n){const r=WK(e.$cstNode,"name");return{documentUri:n.uri,name:e.name,...e.$cstNode&&{selectionSegment:JA(e.$cstNode)},...r&&{nameSegment:JA(r)},path:t.getAstNodePath(e),type:Wr}}function VK(t,e){const n=t.c4fqnIndex=new zr,r=t.parseResult.value.models.flatMap(a=>a.elements);if(r.length===0)return;const i=e.workspace.AstNodeLocator,s=r.map(a=>[a,null]);let o;for(;o=s.shift();)try{const[a,c]=o;if(es(a))continue;if(ma(a)){if(Ft(a.body)&&!Vi(a.body.elements)){const u=Tp(a.element);for(const l of a.body.elements)s.push([l,u])}continue}if(Hr(a)){const u=HO(a.name,c);if(n.add(u,{...HK(i,a,t),fqn:u}),WA.writeId(a,u),Ft(a.body)&&!Vi(a.body.elements))for(const l of a.body.elements)s.push([l,u]);continue}Ie(a)}catch(a){Vt(a)}}class KK{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments,e.shared.workspace.DocumentBuilder.onBuildPhase(Ve.IndexedContent,async(n,r)=>{for(const i of n)if(Rp(i)){delete i.c4fqnIndex,delete i.c4Elements,delete i.c4Specification,delete i.c4Relations,delete i.c4Views;try{VK(i,e)}catch(s){mt(s)}}return await Promise.resolve()}),Oe.debug("[FqnIndex] Created")}langiumDocuments;get documents(){return this.langiumDocuments.all.filter(HA)}entries(e){return this.documents.flatMap(n=>n.c4fqnIndex.keys().filter(e).flatMap(r=>n.c4fqnIndex.get(r)))}getFqn(e){return WA.readId(e)??null}byFqn(e){return this.documents.flatMap(n=>n.c4fqnIndex.get(e))}directChildrenOf(e){return Qe([e]).flatMap(n=>{const r=this.entries(i=>kt(i)===n).map(i=>[i.name,i]).toArray();return r.length===0?[]:new zr(r).entriesGroupedByKey().flatMap(([i,s])=>s.length===1?s:[]).iterator()})}uniqueDescedants(e){return new xt(()=>{const n=`${e}.`,r=new Set,i=[],s=new zr;if(this.entries(o=>o.startsWith(n)).forEach(o=>{const a=ko(o.fqn),c={...o,name:a};kt(o.fqn)===e?(r.add(a),s.add(a,c)):i.push(c)}),s.size+i.length===0)return null;for(const o of i)r.has(o.name)||s.add(o.name,o);return s.entriesGroupedByKey().flatMap(([o,a])=>a.length===1?a:[]).iterator()},n=>n?n.next():Yt)}}function YK(t){const e=new Map;for(const n of t)if(s2(n)&&n.viewOf&&Dt(n.extends)){const r=e.get(n.viewOf)??[];r.push(n.id),e.set(n.viewOf,r)}for(const{id:n,nodes:r}of t)for(const i of r){if(i.navigateTo)continue;const s=Ak(e.get(i.id)??[],o=>o!==n);s&&(i.navigateTo=s)}return t}function XK(t){const e=new aA({directed:!0,multigraph:!1,compound:!1});for(const n of th(t))e.setNode(n.id,n.id),mE(n)&&e.setEdge(n.id,n.extends);if(e.edgeCount()===0)return t;for(;!fV(e);){const n=oa(dV(e));if(!n)break;const r=sa(n);if(!r)break;e.removeNode(r)}return cA(e,e.sources()).reduce((n,r)=>{const i=t[r];if(!i)return n;if(mE(i)){const s=n[i.extends];return s?Object.assign(n,{[i.id]:{...s,...i,rules:[...s.rules,...i.rules]}}):(et.debug(`View "${i.id}" extends from "${i.extends}" which does not exist`),n)}return Object.assign(n,{[i.id]:i})},{})}function JK(t,e){if(Oa(t))return ZK(t,e);if(i2(t))return QK(t,e);Ie(t)}function ZK(t,e){const n=t.rules.flatMap(r=>{if(pE(r)){const i=e[r.styleId];return i===void 0?(et.warn(`Global style not found: ${r.styleId}`),[]):i.styles}else return r});return{...t,rules:n}}function QK(t,e){const n=t.rules.flatMap(r=>{if(pE(r)){const i=e[r.styleId];return i===void 0?(et.warn(`Global style not found: ${r.styleId}`),[]):i.styles}else return r});return{...t,rules:n}}function eY(t,e="/"){const n=Ke(t,ut(c=>c.docUri),nt(ce),Br());if(n.length===0)return"";if(n.length===1){const c=Rh(n[0]).pathname.split(e);return c.length<=1?e:(c.pop(),c.join(e)+e)}we(qr(n,2),"Expected at least 2 unique URIs");const[r,...i]=n,s=Rh(r).pathname.split(e);let o=s.length;for(const c of i){if(c===r)continue;const u=Rh(c).pathname.split(e);for(let l=0;l<o;l++)u[l]!==s[l]&&(o=l);if(o===0)return""}const a=s.slice(0,o).join(e);return a.endsWith(e)?a:a+e}function tY(t){const e="/",n=eY(t,e);return t.map(r=>{if(!r.docUri)return{view:r,parts:[]};let i=Rh(r.docUri).pathname;return n.length>0?(we(i.startsWith(n),`Expect path "${i}" to start with common prefix: "${n}"`),i=i.slice(n.length)):i=i.includes(e)?i.slice(i.lastIndexOf(e)+1):i,{view:r,parts:i.split(e)}}).sort((r,i)=>{if(r.parts.length!==i.parts.length)return r.parts.length-i.parts.length;for(let s=0;s<r.parts.length;s++){const o=yd(r.parts[s],i.parts[s]);if(o!==0)return o}return yd(r.view.title??r.view.id,i.view.title??i.view.id)}).map(({parts:r,view:i})=>({...i,relativePath:r.join(e)}))}function nY(t,e){const n={tags:new Set,elements:{},relationships:{},colors:{}};Ck(ut(e,yr("c4Specification")),p=>{p.tags.forEach(g=>n.tags.add(g)),Object.assign(n.elements,p.elements),Object.assign(n.relationships,p.relationships),Object.assign(n.colors,p.colors)});function r(p,g){return ut(g,y=>{try{const m=t.lsp.DocumentLinkProvider.relativeLink(p,y.url);if(m&&m!==y.url)return{...y,relative:m}}catch(m){mt(m)}return y})}const i=Wi(n.colors,p=>GL(p.color));function s(p){return({tags:g,links:y,style:{color:m,shape:w,icon:E,opacity:k,border:A},id:I,kind:x,title:_,description:P,technology:O,metadata:C})=>{try{const D=n.elements[x];if(!D)return Oe.warn(`No kind '${x}' found for ${I}`),null;const R=y?r(p,y):null;return m??=D.style.color,w??=D.style.shape,E??=D.style.icon,k??=D.style.opacity,A??=D.style.border,O??=D.technology,{...m&&{color:m},...w&&{shape:w},...E&&{icon:E},...C&&!Vi(C)&&{metadata:C},...D.notation&&{notation:D.notation},style:{...A&&{border:A},...rh(k)&&{opacity:k}},links:R,tags:g??null,technology:O??null,description:P??null,title:_,kind:x,id:I}}catch(D){mt(D)}return null}}const o=Ke(e,Ki(p=>ut(p.c4Elements,s(p))),nt(ce),x2,Tk((p,g)=>{const y=kt(g.id);return y&&Dt(p[y])?(mt(`No parent found for ${g.id}`),p):(p[g.id]=g,p)},{}));function a(p){return({astPath:g,source:y,target:m,kind:w,links:E,id:k,...A})=>{if(Dt(o[y])||Dt(o[m]))return Oe.warn(`Invalid relation ${k}, source: ${y}(${!!o[y]}), target: ${m}(${!!o[m]})`),null;const I=E?r(p,E):null;return jr(w)&&w in n.relationships?{...n.relationships[w],...A,...I&&{links:I},source:y,target:m,kind:w,id:k}:{...I&&{links:I},...A,source:y,target:m,id:k}}}const c=Ke(e,Ki(p=>ut(p.c4Relations,a(p))),nt(ce),ia(Ga),nh(),ih(yr("id"))),u={styles:{}};Object.assign(u.styles,...e.map(p=>p.c4Globals.styles));const l={styles:Ke(Us(u.styles),ut(([p,g])=>({id:p,styles:g})),ih(yr("id")))};function d(p){const g=p.uri.toString();return y=>{let{id:m,title:w,description:E,tags:k,links:A,astPath:I,...x}=y;y.__==="element"&&Dt(w)&&"viewOf"in y&&(w=o[y.viewOf]?.title??null),Dt(w)&&m==="index"&&(w="Landscape view");const _=A?r(p,A):null;return{...x,tags:k,links:_,docUri:g,description:E,title:w,id:m,customColorDefinitions:i}}}const f=e.flatMap(p=>ut(p.c4Views,d(p)));f.some(p=>p.id==="index")||f.unshift({__:"element",id:"index",title:"Landscape view",description:null,tags:null,links:null,customColorDefinitions:i,rules:[{include:[{wildcard:!0}]}]});const h=Ke(f,tY,ih(yr("id")),XK);return{specification:{tags:Array.from(n.tags),elements:n.elements,relationships:n.relationships},elements:o,relations:c,globals:l,views:h}}const ob="ParsedLikeC4Model",ab="ComputedLikeC4Model";class rY{constructor(e){this.services=e,this.langiumDocuments=e.shared.workspace.LangiumDocuments;const n=e.likec4.ModelParser;e.shared.workspace.DocumentBuilder.onUpdate((r,i)=>{i.length>0&&this.notifyListeners(i)}),e.shared.workspace.DocumentBuilder.onBuildPhase(Ve.Validated,async(r,i)=>{let s=[];try{Oe.debug(`[ModelBuilder] onValidated (${r.length} docs)`);for(const o of n.parse(r))s.push(o.uri)}catch(o){mt(o)}return s.length>0&&this.notifyListeners(s),await Promise.resolve()}),Oe.debug("[ModelBuilder] Created")}langiumDocuments;listeners=[];unsafeSyncBuildModel(){return this.services.WorkspaceCache.get(ob,()=>{const e=this.documents();return e.length===0?(Oe.debug("[ModelBuilder] No documents to build model from"),null):(Oe.debug(`[ModelBuilder] onValidated (${e.length} docs)`),nY(this.services,e))})}async buildModel(e){const n=this.services.WorkspaceCache;return n.has(ob)?n.get(ob):await this.services.shared.workspace.WorkspaceLock.read(async()=>(e&&await zt(e),this.unsafeSyncBuildModel()))}previousViews={};unsafeSyncBuildComputedModel(e){const n=this.services.WorkspaceCache,r=this.services.WorkspaceCache;return n.get(ab,()=>{const i=new mA(e),s=[];for(const a of th(e.views)){const c=Oa(a)?pA(a,i):gA(a,i);if(!c.isSuccess){mt(c.error);continue}s.push(c.view)}YK(s);const o=vi(s,a=>{const c=this.previousViews[a.id],u=c&&e_(a,c)?c:a;return r.set(ZA(a.id),u),[a.id,u]});return this.previousViews={...o},{specification:e.specification,elements:e.elements,relations:e.relations,globals:e.globals,views:o}})}async buildComputedModel(e){const n=this.services.WorkspaceCache;return n.has(ab)?n.get(ab):await this.services.shared.workspace.WorkspaceLock.read(async()=>{e&&await zt(e);const r=this.unsafeSyncBuildModel();return r?this.unsafeSyncBuildComputedModel(r):null})}async computeView(e,n){const r=this.services.WorkspaceCache,i=ZA(e);return r.has(i)?r.get(i):await this.services.shared.workspace.WorkspaceLock.read(async()=>(n&&await zt(n),r.get(i,()=>{const s=this.unsafeSyncBuildModel(),o=s?.views[e];if(!o)return Oe.warn(`[ModelBuilder] Cannot find view ${e}`),null;const a=new mA(s),c=JK(o,s.globals.styles),u=Oa(c)?pA(c,a):gA(c,a);if(!u.isSuccess)return Vt(u.error),null;let l=u.view;const d=Ke(s.views,th(),nt(Tg),nt(h=>h.id!==e),sh(h=>h.viewOf));for(const h of l.nodes)if(!h.navigateTo){const p=d[h.id];p&&(h.navigateTo=p[0].id)}const f=this.previousViews[e];return l=f&&e_(l,f)?f:l,this.previousViews[e]=l,l})))}onModelParsed(e){return this.listeners.push(e),js.create(()=>{const n=this.listeners.indexOf(e);n>=0&&this.listeners.splice(n,1)})}documents(){return this.langiumDocuments.all.filter(Ul).toArray()}notifyListeners(e){for(const n of this.listeners)try{n(e)}catch(r){Vt(r)}}}function ZA(t){return`computed-view-${t}`}const{findNodeForKeyword:iY,findNodeForProperty:kp}=Qd,{getDocument:sY}=Wd;class oY{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,this.langiumDocuments=e.shared.workspace.LangiumDocuments}fqnIndex;langiumDocuments;documents(){return this.langiumDocuments.all.filter(Ul)}getParsedElement(e){const n=this.fqnIndex.getFqn(e);if(!n)return null;const r=sY(e);return Ul(r)?r.c4Elements.find(i=>i.id===n)??null:null}locateElement(e,n){const r=this.fqnIndex.byFqn(e).head(),i=r?.nameSegment??r?.selectionSegment;return!r||!i?null:{uri:r.documentUri.toString(),range:i.range}}locateRelation(e){for(const n of this.documents()){const r=n.c4Relations.find(o=>o.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(!es(i))continue;let s=i.title?kp(i.$cstNode,"title"):void 0;if(s??=i.kind?kp(i.$cstNode,"kind"):void 0,s??=kp(i.$cstNode,"target"),s??=i.$cstNode,!!s)return{uri:n.uri.toString(),range:s.range}}return null}locateViewAst(e){for(const n of this.documents()){const r=n.c4Views.find(s=>s.id===e);if(!r)continue;const i=this.services.workspace.AstNodeLocator.getAstNode(n.parseResult.value,r.astPath);if(Pw(i))return{doc:n,view:r,viewAst:i}}return null}locateView(e){const n=this.locateViewAst(e);if(!n)return null;const r=n.viewAst;let i=r.name?kp(r.$cstNode,"name"):void 0;return i??=iY(r.$cstNode,"view"),i??=r.$cstNode,i?{uri:n.doc.uri.toString(),range:i.range}:null}}function cb(...t){var e=t.length>1?t.join(":::"):t[0];return QW(e).toString(36)}function aY({nodes:t,edges:e,...n}){return{...n,nodes:Wi(t,({x:r,y:i,width:s,height:o,isCompound:a,...c})=>({...c,b:[r,i,s,o],c:a})),edges:Wi(e,({points:r,controlPoints:i,labelBBox:s,dotpos:o,...a})=>({...!!i&&{cp:i},...!!s&&{l:s},...!!o&&{dp:o},...a,p:r}))}}function cY({nodes:t,edges:e,autoLayout:n,...r}){return{...r,autoLayout:t2(n)?{direction:n}:n,nodes:Wi(t,({b:i,c:s,...o})=>({x:i[0],y:i[1],width:i[2],height:i[3],isCompound:s,...o})),edges:Wi(e,({p:i,cp:s,l:o,dp:a,...c})=>({...!!s&&{controlPoints:s},...!!o&&{labelBBox:o},...!!a&&{dotpos:a},...c,points:i}))}}const QA=500;function uY(t){const e=TW(aY(t)),n=BW(e),r=[];let i=0;for(;i<n.length;)r.push(" * "+n.slice(i,Math.min(i+QA,n.length))),i+=QA;return r.unshift("/**"," * @likec4-generated(v1)"),r.push(" */"),r.join(`
1741
+ `)}function ex(t){return t.includes("@likec4-generated")}function lY(t){if(!ex(t))throw new Error(`Not a likec4-generated comment: ${t}`);const e=t.trim().split(`
1742
+ `).filter(r=>!r.includes("**")&&!r.includes("@likec4-")&&!r.includes("*/")).map(r=>r.replaceAll("*","").trim()).join(""),n=MW(e);return cY(NW(n))}const tx=({operator:t,not:e},n)=>t.startsWith("!=")?{neq:n}:t.startsWith("=")?{eq:n}:e?{neq:n}:{eq:n};function Wl(t){switch(!0){case iK(t):{const e=t.value?.ref?.name;return we(e,"Expected tag name"),{tag:tx(t,e)}}case nK(t):{const e=t.value?.ref?.name;return we(e,"Expected kind name"),{kind:tx(t,e)}}case(zA(t)||qA(t)):return{not:Wl(t.value)};case vK(t):{const e=Wl(t.left),n=Wl(t.right),r=t.operator.toLowerCase();switch(r){case"and":{const i=[bg(e)?e.and:e,bg(n)?n.and:n].flat();return we(Rs(i),"Expected non-empty array"),{and:i}}case"or":{const i=[Eg(e)?e.or:e,Eg(n)?n.or:n].flat();return we(Rs(i),"Expected non-empty array"),{or:i}}default:Ie(r)}}default:Ie(t)}}const{getDocument:ub}=Wd;function rs(t){return jr(t)?Zt(t).split(`
1743
+ `).join(" "):void 0}function Zt(t){return jr(t)?kv(t).trim():void 0}class dY{constructor(e){this.services=e,this.fqnIndex=e.likec4.FqnIndex,Oe.debug("[ModelParser] Created")}fqnIndex;parse(e){const n=Array.isArray(e)?e:[e],r=[];for(const i of n){if(!HA(i)){Oe.warn(`Not a FqnIndexedDocument: ${i.uri.toString(!0)}`);continue}try{r.push(this.parseLikeC4Document(i))}catch(s){Vt(new Error(`Error parsing document ${i.uri.toString()}`,{cause:s}))}}return r}parseLikeC4Document(e){const n=_K(e),{isValid:r}=PK(n);return this.parseSpecification(n,r),this.parseModel(n,r),this.parseGlobal(n,r),this.parseViews(n,r),n}parseSpecification(e,n){const{parseResult:r,c4Specification:i}=e,s=r.value.specifications.filter(n),o=s.flatMap(l=>l.elements.filter(n));for(const{kind:l,props:d}of o)try{const f=l.name;if(!ce(f))continue;if(f in i.elements){Oe.warn(`Element kind "${f}" is already defined`);continue}const h=d.find(nl),p=vi(d.filter(OA).filter(g=>jr(g.value))??[],g=>[g.key,Zt(g.value)]);i.elements[f]={...p,style:{...Sp(h?.props,n)}}}catch(f){mt(f)}const a=s.flatMap(l=>l.relationships.filter(n));for(const{kind:l,props:d}of a)try{const f=l.name;if(!ce(f))continue;if(f in i.relationships){Oe.warn(`Relationship kind "${f}" is already defined`);continue}const h=vi(d.filter(FA).filter(p=>jr(p.value))??[],p=>[p.key,Zt(p.value)]);i.relationships[f]={...h,...KA(d)}}catch(f){mt(f)}const c=s.flatMap(l=>l.tags.filter(n));for(const l of c){const d=l.tag.name;ce(d)&&i.tags.add(d)}const u=s.flatMap(l=>l.colors.filter(n));for(const{name:l,color:d}of u)try{const f=l.name;if(f in i.colors){Oe.warn(`Custom color "${f}" is already defined`);continue}i.colors[f]={color:d}}catch(f){mt(f)}}parseModel(e,n){for(const r of NK(e,n)){if(Hr(r)){try{e.c4Elements.push(this.parseElement(r,n))}catch(i){mt(i)}continue}if(es(r)){try{e.c4Relations.push(this.parseRelation(r))}catch(i){mt(i)}continue}Ie(r)}}parseElement(e,n){const r=this.resolveFqn(e),i=e.kind.$refText,s=this.convertTags(e.body),o=e.body?.props.find(nl)?.props,a=Sp(o,n),c=this.getMetadata(e.body?.props.find(wA)),u=this.getAstNodePath(e);let[l,d,f]=e.props??[];const h=vi(e.body?.props.filter(jw)??[],y=>[y.key,y.value||void 0]);l=rs(l??h.title),d=Zt(h.description??d),f=rs(h.technology??f);const p=this.convertLinks(e.body),g=e.body?.props.find(Qi);if(g){const y=g.libicon?.ref?.name??g.value;ce(y)&&(a.icon=y)}return{id:r,kind:i,astPath:u,title:l??e.name,...c&&{metadata:c},...s&&{tags:s},...p&&Rs(p)&&{links:p},...ce(f)&&{technology:f},...ce(d)&&{description:d},style:a}}parseRelation(e){const n=OK(e),r=this.resolveFqn(n.target),i=this.resolveFqn(n.source),s=this.convertTags(e)??this.convertTags(e.body),o=this.convertLinks(e.body),a=e.kind?.ref?.name,c=this.getMetadata(e.body?.props.find(wA)),u=this.getAstNodePath(e),l=vi(e.body?.props.filter(mp).filter(y=>jr(y.value))??[],y=>[y.key,y.value]),d=Ke(e.body?.props??[],nt(gp),ut(y=>y.value.view.ref?.name),nt(ce),oa()),f=Zt(e.title??l.title)??"",h=Zt(l.description),p=Zt(e.technology)??rs(l.technology),g=e.body?.props.find(tb);return{id:cb(u,i,r),astPath:u,source:i,target:r,title:f,...c&&{metadata:c},...ce(p)&&{technology:p},...ce(h)&&{description:h},...a&&{kind:a},...s&&{tags:s},...Rs(o)&&{links:o},...KA(g?.props),...d&&{navigateTo:d}}}parseGlobal(e,n){const{parseResult:r,c4Globals:i}=e,s=r.value.globals.filter(n).flatMap(o=>o.styles.filter(n));for(const o of s)try{const a=o.id.name;if(!ce(a))continue;if(a in i.styles){Oe.warn(`Global style named "${a}" is already defined`);continue}const c=this.parseGlobalStyleOrGroup(o,n);c.length>0&&(i.styles[a]=c)}catch(a){mt(a)}}parseGlobalStyleOrGroup(e,n){if(Hw(e))return[this.parseGlobalStyle(e,n)];if(Vw(e))return e.styles.map(r=>this.parseViewRuleStyle(r,n));Ie(e)}parseGlobalStyle(e,n){const r=e.props.filter(Ow),i=e.target,s=e.props.find(wa);return this.parseRuleStyle(r,i,n,s)}parseViews(e,n){const r=e.parseResult.value.views.filter(i=>n(i));for(const i of r){const s=i.styles.flatMap(o=>this.parseViewRuleStyleOrGlobalRef(o,n));for(const o of i.views)try{if(!n(o))continue;e.c4Views.push(Qh(o)?this.parseElementView(o,s,n):this.parseDynamicElementView(o,s,n))}catch(a){mt(a)}}}parseViewRulePredicate(e,n){const r=[];let i=e.predicates;for(;i;){try{ce(i.value)&&n(i.value)&&r.unshift(this.parsePredicate(i.value,n))}catch(s){mt(s)}i=i.prev}return Kw(e)?{include:r}:{exclude:r}}parsePredicate(e,n){if(WV(e))return this.parseElementPredicate(e,n);if(KV(e))return this.parseRelationPredicate(e,n);Ie(e)}parseElementExpressionsIterator(e){const n=[];let r=e;for(;r;){try{n.unshift(this.parseElementExpr(r.value))}catch(i){mt(i)}r=r.prev}return n}parseElementPredicate(e,n){if(Jh(e))return this.parseElementPredicateWith(e,n);if(qw(e))return this.parseElementPredicateWhere(e);if(Iw(e))return this.parseElementExpr(e);Ie(e)}parseElementExpr(e){if(ka(e))return{wildcard:!0};if(Xh(e))return we(e.kind,"ElementKindExpr kind is not resolved: "+e.$cstNode?.text),{elementKind:e.kind.$refText,isEqual:e.isEqual};if(Zh(e)){we(e.tag,"ElementTagExpr tag is not resolved: "+e.$cstNode?.text);let n=e.tag.$refText;return n.startsWith("#")&&(n=n.slice(1)),{elementTag:n,isEqual:e.isEqual}}if($A(e)){const n=Cn(e.expand);return we(n,"Element not found "+e.expand.$cstNode?.text),{expanded:this.resolveFqn(n)}}if(Bw(e)){const n=Cn(e.parent);return we(n,"Element not found "+e.parent.$cstNode?.text),{element:this.resolveFqn(n),isDescedants:!0}}if(Qu(e)){const n=Cn(e);return we(n,"Element not found "+e.$cstNode?.text),{element:this.resolveFqn(n)}}Ie(e)}parseElementPredicateWith(e,n){const r=this.parseElementPredicate(e.subject,n);return(e.custom?.props??[]).reduce((i,s)=>{if(Zw(s)){const o=s.value.view.$refText;return ce(o)&&(i.custom.navigateTo=o),i}if(jw(s)){if(Ft(s.value)){let o=s.key==="description"?Zt(s.value):rs(s.value);i.custom[s.key]=o||""}return i}if(Qi(s)){const o=s.libicon?.ref?.name??s.value;return Ft(o)&&(i.custom[s.key]=o),i}if(so(s)){const o=Gl(s);return Ft(o)&&(i.custom[s.key]=o),i}if(yp(s)||qh(s))return Ft(s.value)&&(i.custom[s.key]=s.value),i;if(dp(s))return Ft(s.value)&&(i.custom[s.key]=VA(s)),i;if(wa(s))return ce(s.value)&&(i.custom[s.key]=Zt(s.value)),i;Ie(s)},{custom:{expr:r}})}parseElementPredicateWhere(e){return{where:{expr:this.parseElementExpr(e.subject),condition:e.where?Wl(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicate(e,n){if(eb(e)){let r=NA(e.subject)?this.parseRelationPredicateWhere(e.subject):this.parseRelationExpr(e.subject);return this.parseRelationPredicateWith(e,r)}if(NA(e))return this.parseRelationPredicateWhere(e);if(Nw(e))return this.parseRelationExpr(e);Ie(e)}parseRelationPredicateWhere(e){return{where:{expr:this.parseRelationExpr(e.subject),condition:e.where?Wl(e.where):{kind:{neq:"--always-true--"}}}}}parseRelationPredicateWith(e,n){return(e.custom?.props??[]).reduce((r,i)=>{if(mp(i)||wa(i)||xA(i))return Ft(i.value)&&(r.customRelation[i.key]=Zt(i.value)??""),r;if(Uu(i))return ce(i.value)&&(r.customRelation[i.key]=i.value),r;if(so(i)){const s=Gl(i);return ce(s)&&(r.customRelation[i.key]=s),r}if(fl(i))return ce(i.value)&&(r.customRelation[i.key]=i.value),r;if(gp(i)){const s=i.value.view.ref?.name;return ce(s)&&(r.customRelation.navigateTo=s),r}Ie(i)},{customRelation:{relation:n}})}parseRelationExpr(e){if(Fw(e))return{source:this.parseElementExpr(e.source.from),target:this.parseElementExpr(e.target),isBidirectional:e.source.isBidirectional};if(Yw(e))return{inout:this.parseElementExpr(e.inout.to)};if(Qw(e))return{outgoing:this.parseElementExpr(e.from)};if(_A(e))return{incoming:this.parseElementExpr(e.to)};Ie(e)}parseViewRule(e,n){if(Lh(e))return this.parseViewRulePredicate(e,n);if(EA(e))return this.parseViewRuleStyleOrGlobalRef(e,n);if(Dp(e))return YA(e);if(MA(e))return this.parseViewRuleGroup(e,n);Ie(e)}parseViewRuleStyleOrGlobalRef(e,n){if(Il(e))return this.parseViewRuleStyle(e,n);if(mK(e))return this.parseViewRuleGlobalStyle(e,n);Ie(e)}parseViewRuleStyle(e,n){const r=e.props.filter(Ow),i=e.target,s=e.props.find(wa);return this.parseRuleStyle(r,i,n,s)}parseViewRuleGroup(e,n){const r=[];for(const i of e.groupRules)try{if(!n(i))continue;if(Lh(i)){r.push(this.parseViewRulePredicate(i,n));continue}if(MA(i)){r.push(this.parseViewRuleGroup(i,n));continue}Ie(i)}catch(s){mt(s)}return{title:rs(e.title)??null,groupRules:r,...Sp(e.props,n)}}parseRuleStyle(e,n,r,i){const s=Sp(e,r),o=Zt(i?.value);return{targets:this.parseElementExpressionsIterator(n),...o&&{notation:o},style:{...s}}}parseViewRuleGlobalStyle(e,n){return{styleId:e.style.$refText}}parseViewManualLaout(e){const n=Id(e.$cstNode,["BLOCK_COMMENT"]);if(!(!n||!ex(n.text)))try{return lY(n.text)}catch(r){const i=ub(e);Oe.warn(r),Oe.warn(`Ignoring manual layout of "${e.name??"unnamed"}" at ${i.uri.fsPath}:${1+(n.range.start.line||0)}`);return}}parseDynamicParallelSteps(e){return{__parallel:e.steps.map(n=>this.parseDynamicStep(n))}}parseDynamicStep(e){const n=Cn(e.source);if(!n)throw new Error("Invalid reference to source");const r=Cn(e.target);if(!r)throw new Error("Invalid reference to target");let i=this.resolveFqn(n),s=this.resolveFqn(r);const o=Zt(e.title)??null;let a={source:i,target:s,title:o};if(e.isBackward&&(a={source:s,target:i,title:o,isBackward:!0}),Array.isArray(e.custom?.props))for(const c of e.custom.props)try{if(mp(c)||wa(c)||xA(c)){Ft(c.value)&&(a[c.key]=Zt(c.value)??"");continue}if(Uu(c)){Ft(c.value)&&(a[c.key]=c.value);continue}if(so(c)){const u=Gl(c);Ft(u)&&(a[c.key]=u);continue}if(fl(c)){Ft(c.value)&&(a[c.key]=c.value);continue}if(gp(c)){const u=c.value.view.ref?.name;ce(u)&&(a.navigateTo=u);continue}Ie(c)}catch(u){mt(u)}return a}parseElementView(e,n,r){const i=e.body;we(i,"ElementView body is not defined");const s=this.getAstNodePath(e);let o=null;if("viewOf"in e){const p=Cn(e.viewOf),g=p&&this.resolveFqn(p);g?o=g:Oe.warn("viewOf is not resolved: "+e.$cstNode?.text)}let a=e.name;a||(a="view_"+cb(ub(e).uri.toString(),s,o??""));const c=rs(i.props.find(p=>p.key==="title")?.value)??null,u=Zt(i.props.find(p=>p.key==="description")?.value)??null,l=this.convertTags(i),d=this.convertLinks(i),f=this.parseViewManualLaout(e),h={__:"element",id:a,astPath:s,title:c,description:u,tags:l,links:Rs(d)?d:null,rules:[...n,...i.rules.flatMap(p=>{try{return r(p)?this.parseViewRule(p,r):[]}catch(g){return mt(g),[]}})],...o&&{viewOf:o},...f&&{manualLayout:f}};if(sb.writeId(e,h.id),"extends"in e){const p=e.extends.view.ref;return we(p?.name,"view extends is not resolved: "+e.$cstNode?.text),Object.assign(h,{extends:p.name})}return h}parseDynamicElementView(e,n,r){const i=e.body;we(i,"DynamicElementView body is not defined");const s=i.props.filter(r),o=this.getAstNodePath(e);let a=e.name;a||(a="dynamic_"+cb(ub(e).uri.toString(),o));const c=rs(s.find(h=>h.key==="title")?.value)??null,u=Zt(s.find(h=>h.key==="description")?.value)??null,l=this.convertTags(i),d=this.convertLinks(i);sb.writeId(e,a);const f=this.parseViewManualLaout(e);return{__:"dynamic",id:a,astPath:o,title:c,description:u,tags:l,links:Rs(d)?d:null,rules:[...n,...i.rules.flatMap(h=>{try{return r(h)?this.parseDynamicViewRule(h,r):[]}catch(p){return mt(p),[]}},[])],steps:i.steps.reduce((h,p)=>{try{r(p)&&(Lw(p)?h.push(this.parseDynamicParallelSteps(p)):h.push(this.parseDynamicStep(p)))}catch(g){mt(g)}return h},[]),...f&&{manualLayout:f}}}parseDynamicViewRule(e,n){if(cK(e))return this.parseDynamicViewIncludePredicate(e,n);if(EA(e))return this.parseViewRuleStyleOrGlobalRef(e,n);if(Dp(e))return YA(e);Ie(e)}parseDynamicViewIncludePredicate(e,n){const r=[];let i=e.predicates;for(;i;){try{if(n(i.value)){const s=this.parseElementPredicate(i.value,n);r.unshift(s)}}catch(s){mt(s)}i=i.prev}return{include:r}}resolveFqn(e){if(ma(e))return Tp(e.element);const n=this.fqnIndex.getFqn(e);return we(n,`Not indexed element: ${this.getAstNodePath(e)}`),n}getAstNodePath(e){return this.services.workspace.AstNodeLocator.getAstNodePath(e)}getMetadata(e){return e?.props!=null?vi(e.props,n=>[n.key,Zt(n.value)]):void 0}convertTags(e){let n=e?.tags;if(!n)return null;const r=[];for(;n;){try{const i=n.values.map(s=>s.ref?.name).filter(ce);i.length>0&&r.unshift(...i)}catch{}n=n.prev}return Rs(r)?r:null}convertLinks(e){if(!(!e?.props||e.props.length===0))return Ke(e.props,nt(cp),Ki(n=>{const r=n.value;if(ce(r)){const i=ce(n.title)?rs(n.title):void 0;return i?{url:r,title:i}:{url:r}}return[]}))}}const{findNodeForKeyword:fY,findNodeForProperty:Iae}=Qd,hY=(t,e,n=0)=>{const r=n>0?" ".repeat(n):"";return[r+`style ${t} {`,...Us(e).map(([i,s])=>r+` ${i} ${i==="opacity"?s.toString()+"%":s}`),r+"}"]},pY=(t,e)=>n=>{if(!Il(n))return!1;const r=n.target.value;if(!r||ce(n.target.prev)||!Qu(r))return!1;const i=r.el.ref;return(i?e.getFqn(i):null)===t};function gY(t,{view:e,viewAst:n,targets:r,style:i}){we(n.body,`View ${e.id} has no body`);const s=n.$cstNode;we(s,"viewCstNode");const o=sa(n.body.rules)?.$cstNode?.range.end??n.body.$cstNode?.range.end;we(o,"insertPos is not defined");const a=s.range.start.character+2,c=t.likec4.FqnIndex,u=nt(n.body.rules,Il),l=e.__==="element"?e.viewOf:null,d=[],f=[];r.forEach(y=>{const m=p9(u,pY(y,c)),w=l&&Cr(l,y)?y.substring(l.length+1):y;m?d.push({fqn:w,rule:m}):f.push({fqn:w})});const h={start:o,end:o},p=y=>{y.start.line<=h.start.line&&(y.start.line==h.start.line?h.start.character=Math.min(y.start.character,h.start.character):h.start=y.start),y.end.line>=h.end.line&&(y.end.line==h.end.line?h.end.character=Math.max(y.end.character,h.end.character):h.end=y.end)},g=[];if(f.length>0){const y=f.flatMap(({fqn:m})=>hY(m,i,a));g.push(Sn.insert(o,`
1744
+ `+y.join(`
1745
+ `))),h.start={line:o.line+1,character:a},h.end={line:o.line+y.length,character:sa(y)?.length??0}}if(d.length>0)for(const{rule:y}of d){const m=y.$cstNode;we(m,"RuleCstNode not found");for(const[w,E]of Us(i)){const k=w==="opacity"?E.toString()+"%":E,A=y.props.find(P=>P.key===w);if(A&&A.$cstNode){const{range:{start:P,end:O}}=A.$cstNode;p({start:P,end:O}),g.push(Sn.replace({start:P,end:O},w+" "+k));continue}const I=fY(m,"{")?.range.end;we(I,"Opening brace not found");const x=" ".repeat(2+m.range.start.character),_=x+w+" "+k;g.push(Sn.insert(I,`
1746
+ `+_)),p({start:{line:I.line+1,character:x.length},end:{line:I.line+1,character:_.length}})}}return{modifiedRange:h,edits:g}}const{findNodeForProperty:Pae,findNodeForKeyword:mY}=Qd;function yY(t,{view:e,viewAst:n,layout:r}){we(n.body,`View ${e.id} has no body`);const i=n.$cstNode;we(i,"viewCstNode");const s=LK(r.direction),o=n.body.rules.findLast(Dp);let a=`autoLayout ${s}`;if(rh(r.rankSep)&&(a+=` ${r.rankSep}`,rh(r.nodeSep)&&(a+=` ${r.nodeSep}`)),o&&o.$cstNode)return Sn.replace(o.$cstNode.range,a);const c=mY(n.body.$cstNode,"}")?.range.start;we(c,"Closing brace not found");const u=` ${a}
1747
+ `;return Sn.insert(c,u)}function vY(t,{viewAst:e,layout:n}){we(e.$cstNode,"invalid view.$cstNode");const r=Id(e.$cstNode,["BLOCK_COMMENT"]);let i=uY(n);return e.$cstNode.range.start.character>0&&(i=YG(i,e.$cstNode.range.start.character)),r?Sn.replace(r.range,i.trimStart()):Sn.insert({line:e.$cstNode.range.start.line,character:0},i+`
1748
+ `)}class wY{constructor(e){this.services=e,this.locator=e.likec4.ModelLocator}locator;async applyChange(e){const n=this.services.shared.lsp.Connection;we(n,"LSP Connection not available");let r=null;try{await this.services.shared.workspace.WorkspaceLock.write(async()=>{const{doc:i,edits:s,modifiedRange:o}=this.convertToTextEdit(e),a={uri:i.textDocument.uri,version:i.textDocument.version};if(!s.length)return;const c=await n.workspace.applyEdit({label:`LikeC4 - change view ${e.viewId}`,edit:{changes:{[a.uri]:s}}});if(!c.applied){n.window.showErrorMessage(`Failed to apply changes ${c.failureReason}`);return}r={uri:a.uri,range:o}})}catch(i){et.error(`Failed to apply change ${e.change.op} ${e.viewId}`,i)}return r}convertToTextEdit({viewId:e,change:n}){const r=this.locator.locateViewAst(e);if(!r)throw new Error(`LikeC4ModelChanges: view not found: ${e}`);switch(n.op){case"change-element-style":return{doc:r.doc,...gY(this.services,{...r,targets:n.targets,style:n.style})};case"change-autolayout":{const s=yY(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:s.range,edits:[s]}}case"save-manual-layout":const i=vY(this.services,{...r,layout:n.layout});return{doc:r.doc,modifiedRange:i.range,edits:[i]};default:Ie(n)}}}class bY extends KS{async computeExports(e,n){const r=[];try{const{specifications:i,models:s,views:o,globals:a,likec4lib:c}=e.parseResult.value;this.exportLibrary(c,r,e),this.exportSpecification(i,r,e),this.exportModel(s,r,e),this.exportViews(o,r,e),this.exportGlobals(a,r,e)}catch(i){Vt(i)}return r}exportViews(e,n,r){if(!(Dt(e)||e.length===0))for(const i of e.flatMap(s=>s.views))try{ce(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Vt(s)}}exportGlobals(e,n,r){if(!(Dt(e)||e.length===0))for(const i of e.flatMap(s=>s.styles))try{const s=i.id;ce(s.name)&&n.push(this.descriptions.createDescription(s,s.name,r))}catch(s){Vt(s)}}exportModel(e,n,r){if(!(Dt(e)||e.length===0))for(const i of e.flatMap(s=>s.elements))try{Hr(i)&&ce(i.name)&&n.push(this.descriptions.createDescription(i,i.name,r))}catch(s){Vt(s)}}exportLibrary(e,n,r){if(!Dt(e))try{for(const i of e.flatMap(s=>s.icons))n.push(this.descriptions.createDescription(i,i.name,r))}catch(i){Vt(i)}}exportSpecification(e,n,r){if(!(Dt(e)||e.length===0))for(const i of e.flatMap(s=>[...s.elements,...s.relationships,...s.tags,...s.colors]))try{switch(!0){case Ea(i):{ce(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r));continue}case bp(i):{ce(i.tag.name)&&n.push(this.descriptions.createDescription(i.tag,"#"+i.tag.name,r));continue}case Ta(i):{ce(i.kind.name)&&n.push(this.descriptions.createDescription(i.kind,i.kind.name,r),this.descriptions.createDescription(i.kind,"."+i.kind.name,r));continue}case wp(i):{ce(i.name.name)&&n.push(this.descriptions.createDescription(i.name,i.name.name,r));continue}default:Ie(i)}}catch(s){Vt(s)}}computeLocalScopes(e,n){return new Promise(r=>{const i=e.parseResult.value,s=new zr;for(const o of i.models)try{const a=this.processContainer(o,s,e);s.addAll(i,a.values())}catch(a){Vt(a)}r(s)})}processContainer(e,n,r){const i=new zr,s=new zr;for(const o of e.elements){if(es(o))continue;let a;if(Hr(o)?(ce(o.name)&&i.add(o.name,this.descriptions.createDescription(o,o.name,r)),a=o.body):ma(o)&&(a=o.body),a&&a.elements.length>0)try{const c=this.processContainer(a,n,r);for(const[u,l]of c)s.add(u,l)}catch(c){Vt(c)}}if(s.size>0)for(const[o,a]of s.entriesGroupedByKey())!i.has(o)&&a.length===1&&i.add(o,a[0]);return n.addAll(e,i.values()),i}}const{getDocument:EY}=Wd;class DY extends QS{fqnIndex;constructor(e){super(e),this.fqnIndex=e.likec4.FqnIndex}directChildrenOf(e){return this.fqnIndex.directChildrenOf(e)}uniqueDescedants(e){return new xt(()=>{const n=e(),r=n&&this.fqnIndex.getFqn(n);return r?this.fqnIndex.uniqueDescedants(r).iterator():null},n=>n?n.next():Yt)}scopeElementRef(e){return this.uniqueDescedants(()=>e.el.ref)}scopeExtendElement({element:e}){return Qe([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>Cn(e)))}scopeElementView({viewOf:e,extends:n}){return e?Qe([e.el.$nodeDescription]).nonNullable().concat(this.uniqueDescedants(()=>Cn(e))):n?Qe([n]).flatMap(r=>{const i=r.view.ref;return i?this.scopeElementView(i):Lo}):Lo}getScope(e){try{const n=this.reflection.getReferenceType(e);if(n!==Wr)return this.getGlobalScope(n);try{const r=e.container;if(CA(r)&&e.property==="el"){const i=r.parent;return i?new eu(this.directChildrenOf(Tp(i))):this.getGlobalScope(n)}if(Qu(r)&&e.property==="el"){const i=r.parent;if(i)return new eu(this.scopeElementRef(i));if(e.reference.$refText==="this"||e.reference.$refText==="it"){const s=wn(r,Hr);return s?new YS([this.descriptions.createDescription(s,e.reference.$refText)]):XS}}return this.computeScope(e)}catch(r){return Oe.warn(r),this.getGlobalScope(n)}}catch(n){return Oe.warn(n),XS}}computeScope(e){const n=this.reflection.getReferenceType(e);we(n===Wr,"Invalid reference type");const r=[],i=EY(e.container).precomputedScopes;if(i){const s=a=>this.reflection.isSubtype(a.type,n);let o=e.container;for(;o;){const a=i.get(o).filter(s);a.length>0&&r.push(Qe(a)),Ww(o)&&r.push(this.scopeExtendElement(o.$container)),Uw(o)&&r.push(this.scopeElementView(o.$container)),o=o.$container}}return r.reduceRight((s,o)=>this.createScope(o,s),this.getGlobalScope(n))}getGlobalScope(e){return new eu(this.indexManager.allElements(e))}}class TY{constructor(e){this.services=e}disposables=[];init(){const e=this.services.likec4.ModelBuilder,n=this.services.likec4.ModelLocator,r=this.services.likec4.ModelChanges,i=this.services.shared.lsp.Connection;if(!i){Oe.info("[ServerRpc] no connection, not initializing");return}Oe.info("[ServerRpc] init");const s=this.services.shared.workspace.LangiumDocuments,o=this.services.shared.workspace.DocumentBuilder,a=E9(()=>{i.sendNotification(UW,"").catch(u=>(Oe.error(`[ServerRpc] error sending onDidChangeModel: ${u}`),Promise.resolve()))},{timing:"both",waitMs:300,maxWaitMs:600});let c=!0;this.disposables.push(js.create(()=>{a.cancel()}),e.onModelParsed(()=>a.call()),i.onRequest(WW,async({cleanCaches:u},l)=>(u&&this.services.WorkspaceCache.clear(),{model:await e.buildComputedModel(l)})),i.onRequest(GW,async u=>({model:await e.buildModel(u)})),i.onRequest(HW,async({viewId:u},l)=>({view:await e.computeView(u,l)})),i.onRequest(VW,async({docs:u},l)=>{const d=u.map(p=>Jt.parse(p)),f=p=>d.every(g=>!Et.equals(g,p)),h=s.all.filter(p=>Rp(p)&&f(p.uri)&&p.uri.scheme!==qC).map(p=>p.uri).toArray();Oe.debug(`[ServerRpc] received request to build:
1749
+ changed (total ${d.length}):${u.map(p=>`
1750
+ - `+p).join("")}
1751
+ deleted (total ${h.length}):${h.map(p=>`
1752
+ - `+p.toString()).join(`
1753
+ `)}`),!c&&d.length+h.length>0&&(await Promise.allSettled([...d,...h].map(async p=>{const g=p.toString();Oe.debug(`clear diagnostics for ${g}`);try{await i.sendDiagnostics({uri:g,diagnostics:[]})}catch(y){Oe.warn(`error clearing diagnostics for ${g}: ${y}`)}})),await zt(l)),c=!1,await o.update(d,h,l)}),i.onRequest(KW,u=>{if("element"in u)return n.locateElement(u.element,u.property??"name");if("relation"in u)return n.locateRelation(u.relation);if("view"in u)return n.locateView(u.view);Ie(u)}),i.onRequest(YW,async(u,l)=>await r.applyChange(u)))}dispose(){let e;for(;e=this.disposables.pop();)try{e.dispose()}catch(n){Vt(n)}}}class RY{constructor(e){this.services=e}getSymbolKind(e){const n=vt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(Wr,ga):return gr.Constructor;case r(ya,va,Ra):return gr.Namespace;case r(io):return gr.Class;case r(ns,ao,oo,Sa):return gr.EnumMember;case r(ts,Da):return gr.Event;case r(Zi,ba):return gr.TypeParameter}return gr.Field}getCompletionItemKind(e){const n=vt(e)?e.$type:e.type,r=(...i)=>i.some(s=>this.services.AstReflection.isSubtype(n,s));switch(!0){case r(oo):return Ot.Color;case r(Wr,ga):return Ot.Constructor;case r(ya,va,Ra):return Ot.Module;case r(io):return Ot.Class;case r(ns,ao,oo,Sa):return Ot.EnumMember;case r(ts,Da):return Ot.Event;case r(Zi,ba):return Ot.TypeParameter;default:return Ot.Reference}}}class SY extends tk{documentFactory;constructor(e){super(e),this.documentFactory=e.workspace.LangiumDocumentFactory}async loadAdditionalDocuments(e,n){n(this.documentFactory.fromString(qW,Jt.parse(jW))),await super.loadAdditionalDocuments(e,n)}workspace(){return this.folders&&gd(this.folders,1)?this.folders[0]:null}get workspaceUri(){const e=this.workspace();return we(e,"Workspace not initialized"),Jt.parse(e.uri)}get workspaceURL(){const e=this.workspace();return we(e,"Workspace not initialized"),new URL(e.uri)}}class kY extends pC{}const $Y=t=>(e,n)=>{const r=XA(e.value);switch(!0){case Xh(r):case Zh(r):case ka(r):{n("warning","Predicate is ignored, as not supported in dynamic views",{node:e});return}}},CY=t=>{const e=t.likec4.FqnIndex;return(n,r)=>{try{const i=Cn(n.source),s=i&&e.getFqn(i);s||r("error","Source not found (not parsed/indexed yet)",{node:n,property:"source"});const o=Cn(n.target),a=o&&e.getFqn(o);a||r("error","Target not found (not parsed/indexed yet)",{node:n,property:"target"}),s&&a&&(Cr(s,a)||Cr(a,s))&&r("error","Invalid parent-child relationship",{node:n})}catch(i){Vt(i)}}},$p=["this","it","self","super","likec4lib","global"];function Cp(t){return async(e,n,r)=>{r&&await zt(r);try{await t(e,n,r)}catch(i){mt(i)}}}const{getDocument:_Y}=Wd,AY=t=>{const e=t.likec4.FqnIndex,n=t.workspace.AstNodeLocator;return Cp((r,i)=>{const s=e.getFqn(r);if(!s){i("error","Not indexed element",{node:r,property:"name"});return}$p.includes(r.name)&&i("error",`Reserved word: ${r.name}`,{node:r,property:"name"});const o=_Y(r).uri,a=n.getAstNodePath(r),c=e.byFqn(s).filter(u=>u.documentUri!==o||u.path!==a).head();if(c){const u=c.documentUri!==o;i("error",`Duplicate element name ${r.name!==s?r.name+" ("+s+")":r.name}`,{node:r,property:"name",...u&&{relatedInformation:[{location:{range:c.nameSegment?.range??c.selectionSegment?.range,uri:c.documentUri.toString()},message:"conflicting element"}]}})}})},xY=t=>(e,n)=>{const r=parseFloat(e.value);(isNaN(r)||r<0||r>100)&&n("warning","Value ignored, must be between 0% and 100%",{node:e,property:"value"})},IY=t=>(e,n)=>{const r=e.$container;r.props.some(i=>Qi(i)&&i!==e)&&n("error","Icon must be defined once",{node:e}),nl(r)&&ha(r.$container)&&r.$container.props.some(i=>Qi(i))&&n("warning","Redundant as icon defined on element",{node:e})},PY=t=>(e,n)=>{Sc(e,zw)||n("error","Notes can be defined only inside dynamic view",{node:e})},NY=t=>{const e=t.likec4.FqnIndex;return Cp((n,r)=>{const i=Cn(n.target),s=i&&e.getFqn(i);s||r("error","Target not resolved",{node:n,property:"target"});let o;if(Ft(n.source)){if(o=Cn(n.source),!o)return r("error","Source not resolved",{node:n,property:"source"})}else{if(!ha(n.$container))return r("error","Sourceless relation must be nested",{node:n});o=n.$container.$container}const a=e.getFqn(o);a||r("error","Source not resolved",{node:n}),a&&s&&Ma(a,s)&&r("error","Invalid parent-child relationship",{node:n})})},OY=t=>Cp((e,n)=>{e.$container.tags?.values&&e.tags?.values&&n("error","Relation cannot have tags in both header and body",{node:e.tags})}),FY=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one specification per document",{node:e,property:"name"})},LY=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one model per document",{node:e,property:"name"})},MY=t=>(e,n)=>{e.$containerIndex&&e.$containerIndex>0&&n("warning","Prefer one global block per document",{node:e,property:"name"})},zY=t=>{const e=t.shared.workspace.IndexManager;return Cp((n,r)=>{$p.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"});const i=e.allElements(Zi).filter(s=>s.name===n.name&&s.node!==n).head();if(i){const s=i.documentUri!==sn(n).uri;r("error",`Duplicate element kind '${n.name}'`,{node:n,property:"name",...s&&{relatedInformation:[{location:{range:i.nameSegment.range,uri:i.documentUri.toString()},message:"conflicting definition"}]}})}})},BY=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{const i="#"+n.name,s=e.allElements(ns).filter(o=>o.name===i&&o.node!==n).head();if(s){const o=s.documentUri!==sn(n).uri;r("error",`Duplicate tag '${n.name}'`,{node:n,property:"name",...o&&{relatedInformation:[{location:{range:s.nameSegment.range,uri:s.documentUri.toString()},message:"conflicting definition"}]}})}}},qY=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{$p.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(ts).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate RelationshipKind '${n.name}'`,{node:n,property:"name"})}},jY=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{e.allElements(ol).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate GlobalStyleId name '${n.name}'`,{node:n,property:"name"})}},UY=t=>{const e=t.shared.workspace.IndexManager;return(n,r)=>{n.name&&($p.includes(n.name)&&r("error",`Reserved word: ${n.name}`,{node:n,property:"name"}),e.allElements(io).filter(i=>i.name===n.name).limit(2).count()>1&&r("error",`Duplicate view '${n.name}'`,{node:n,property:"name"}))}},GY=t=>(e,n)=>{const r=wn(e,Lh);tp(r)&&n("error",'Invalid usage inside "exclude"',{node:e});const i=qw(e.subject)?e.subject.subject:e.subject;switch(!0){case Qu(i):case Bw(i):case $A(i):case ka(i):return;case Xh(i):case Zh(i):n("error","Invalid target (expect reference to specific element)",{node:e,property:"subject"});return;default:Ie(i)}},WY=t=>(e,n)=>{Sc(e,Nw)&&n("warning","Redundant usage, expand predicate resolves parent element only when used in relations",{node:e})},HY=t=>(e,n)=>{if(ka(e.to)&&!Yw(e.$container)){const r=wn(e,Qh);Dt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}},VY=t=>(e,n)=>{if(ka(e.from)&&!Fw(e.$container)){const r=wn(e,Qh);Dt(r?.viewOf)&&n("warning","Predicate is ignored as it concerns all relationships",{node:e})}},KY=t=>(e,n)=>{const r=wn(e,Lh);tp(r)&&n("error",'Invalid usage inside "exclude"',{node:e})};function YY(t){Oe.info("registerValidationChecks"),t.validation.ValidationRegistry.register({NotesProperty:PY(),OpacityProperty:xY(),IconProperty:IY(),SpecificationRule:FY(),Model:LY(),Globals:MY(),GlobalStyleId:jY(t),DynamicViewStep:CY(t),LikeC4View:UY(t),Element:AY(t),ElementKind:zY(t),Relation:NY(t),RelationBody:OY(),Tag:BY(t),DynamicViewPredicateIterator:$Y(),ElementPredicateWith:GY(),RelationPredicateWith:KY(),ExpandElementExpression:WY(),RelationshipKind:qY(t),IncomingRelationExpression:HY(),OutgoingRelationExpression:VY()});const e=t.shared.lsp.Connection;e&&t.shared.workspace.DocumentBuilder.onUpdate((n,r)=>{for(const i of r)Oe.debug(`clear diagnostics for deleted ${i.path}`),e.sendDiagnostics({uri:i.toString(),diagnostics:[]})})}function XY(t,e){return[t,e]=nx(t,e)>0?[e,t]:[t,e],JY(t.range,e.range.start)}function nx(t,e){const n=t.range.start.line-e.range.start.line;return n!==0?n:t.range.start.character-e.range.start.character}function JY(t,e){return!(e.line<t.start.line||e.line>t.end.line||e.line==t.start.line&&e.character<t.start.character||e.line==t.end.line&&e.character>t.end.character)}function rx(t){return t.range.start.line!=t.range.end.line}const le={newLine:Yi.newLine({allowMore:!0}),oneSpace:Yi.oneSpace(),noSpace:Yi.noSpace(),indent:Yi.indent({allowMore:!0}),noIndent:Yi.noIndent()};class ZY extends sG{format(e){this.removeIndentFromTopLevelStatements(e),this.indentContentInBraces(e),this.formatSpecificationRule(e),this.formatElementDeclaration(e),this.formatRelation(e),this.formatView(e),this.formatViewRuleStyle(e),this.formatIncludeExcludeExpressions(e),this.formatWhereExpression(e),this.formatWithPredicate(e),this.formatLeafProperty(e),this.formatMetadataProperty(e),this.formatAutolayoutProperty(e),this.formatLinkProperty(e),this.formatNavigateToProperty(e),this.formatTags(e)}formatTags(e){this.on(e,rb,(n,r)=>{r.cst(qo(n.$cstNode,"values").slice(1)).prepend(le.oneSpace),r.keywords(",").prepend(le.noSpace).append(le.oneSpace)})}formatRelation(e){this.on(e,es,(n,r)=>{const i=n?.source?.$cstNode?[n?.source?.$cstNode]:[];r.cst(i).append(le.oneSpace),r.keywords("]->").prepend(le.noSpace),r.keywords("-[").append(le.noSpace),r.properties("target","title","technology","tags").prepend(le.oneSpace)}),this.on(e,zw,(n,r)=>{r.keywords("->","<-").surround(le.oneSpace);const i=r.property("kind");i.nodes[0]?.text.startsWith(".")&&i.surround(le.oneSpace),r.keywords("]->").prepend(le.noSpace).append(le.oneSpace),r.keywords("-[").prepend(le.oneSpace).append(le.noSpace),r.properties("title").prepend(le.oneSpace)}),this.on(e,Fw)?.property("target").prepend(le.oneSpace),this.on(e,Qw,(n,r)=>{r.property("from").append(le.oneSpace),r.keywords("]->").prepend(le.noSpace),r.keywords("-[").append(le.noSpace)}),this.on(e,_A)?.keywords("->").append(le.oneSpace),this.on(e,Yw)?.keyword("->").prepend(le.oneSpace)}removeIndentFromTopLevelStatements(e){(Jw(e)||nb(e)||up(e)||AA(e))&&this.getNodeFormatter(e).keywords("specification","model","views","likec4lib").prepend(le.noIndent)}indentContentInBraces(e){if(AA(e)||nb(e)||Ea(e)||Ta(e)||Jw(e)||ha(e)||Ww(e)||PA(e)||tb(e)||pK(e)||up(e)||Uw(e)||SA(e)||Il(e)||sK(e)||oK(e)||nl(e)||Lw(e)){const n=this.getNodeFormatter(e),r=n.keywords("{"),i=n.keywords("}"),s=n.interior(r,i);let o=null;for(const a of s.nodes)(!o||!XY(o,a))&&n.cst([a]).prepend(le.indent),o=a;r.prepend(le.noIndent).prepend(le.oneSpace),i.prepend(le.noIndent).prepend(Yi.newLine({allowMore:!0}))}}appendKeywordsWithSpace(e){this.on(e,lK)?.keywords("element").append(le.oneSpace)}formatView(e){this.on(e,Qh,(n,r)=>{(n.extends||n.viewOf||n.name)&&r.keywords("view").append(le.oneSpace),r.keywords("of","extends").surround(le.oneSpace)}),this.on(e,aK)?.keywords("dynamic","view").append(le.oneSpace)}formatLeafProperty(e){if(jw(e)||mp(e)||yK(e)||wa(e)||OA(e)||FA(e)||so(e)||fl(e)||Uu(e)||Qi(e)||yp(e)||qh(e)||dp(e)){const n=this.getNodeFormatter(e),r=n.keyword(":"),i=n.keywords("title","description","technology","notation","color","line","head","tail","icon","shape","border","opacity");r.nodes.length===0?i.append(le.oneSpace):r.prepend(le.noSpace).append(le.oneSpace),n.keyword(";").prepend(le.noSpace).append(le.newLine)}}formatLinkProperty(e){this.on(e,cp,(n,r)=>{r.keyword("link").append(le.oneSpace),r.property("value").append(le.oneSpace),r.keyword(":").prepend(le.noSpace).append(le.oneSpace),r.keyword(";").prepend(le.noSpace).append(le.newLine)})}formatNavigateToProperty(e){this.on(e,Zw)?.property("key").append(le.oneSpace)}formatAutolayoutProperty(e){this.on(e,Dp,(n,r)=>{r.keyword("autoLayout").append(le.oneSpace),r.property("rankSep").prepend(le.oneSpace),r.property("nodeSep").prepend(le.oneSpace)})}formatMetadataProperty(e){this.on(e,hK,(n,r)=>{r.property("key").append(le.oneSpace),r.keyword(":").prepend(le.noSpace).append(le.oneSpace),r.keyword(";").prepend(le.noSpace).append(le.newLine)})}formatElementDeclaration(e){this.on(e,Hr,(n,r)=>{const i=An(n.$cstNode,"kind"),s=An(n.$cstNode,"name");s&&i&&(nx(s,i)>0?r.cst([i]).append(le.oneSpace):(r.cst([s]).append(le.oneSpace),r.cst([i]).prepend(le.oneSpace))),r.properties("props").prepend(le.oneSpace)})}formatSpecificationRule(e){if((Ea(e)||Ta(e)||bp(e))&&this.getNodeFormatter(e).keywords("element","relationship","tag").append(le.oneSpace),wp(e)){const n=this.getNodeFormatter(e);n.keyword("color").append(le.oneSpace),n.property("name").append(le.oneSpace)}}formatWithPredicate(e){const n=this.getNodeFormatter(e);(Jh(e)||eb(e))&&n.keyword("with").prepend(le.oneSpace)}formatViewRuleStyle(e){this.on(e,Il)?.keyword("style").append(le.oneSpace),this.on(e,uK)?.keyword(",").prepend(le.noSpace).append(le.oneSpace)}formatWhereExpression(e){if((YV(e)||HV(e))&&this.getNodeFormatter(e).keyword("where").append(le.oneSpace),(rK(e)||tK(e))&&this.getNodeFormatter(e).property("operator").surround(le.oneSpace),(zA(e)||qA(e))&&this.getNodeFormatter(e).keyword("not").append(le.oneSpace),DA(e)||bK(e)||wK(e)||RA(e)||EK(e)||BA(e)){const n=this.getNodeFormatter(e);n.property("operator").surround(le.oneSpace),n.property("not").surround(le.oneSpace)}}formatIncludeExcludeExpressions(e){if(xw(e)||Kw(e)||tp(e)){const n=this.getNodeFormatter(e);(!e.$cstNode||!rx(e.$cstNode))&&n.keywords("include","exclude").append(le.oneSpace)}if(kA(e)||IA(e)||IA(e)){const n=this.getNodeFormatter(e),r=this.findPredicateExpressionRoot(e),i=r?.$cstNode&&rx(r?.$cstNode);i&&n.property("value").prepend(le.indent),n.keyword(",").prepend(le.noSpace).append(i?le.newLine:le.oneSpace)}}findPredicateExpressionRoot(e){let n=e.$container;for(;;){if(!n||xw(n)||Kw(n)||tp(n))return n;n=n.$container}}on(e,n,r){const i=n(e)?this.getNodeFormatter(e):void 0;return r&&i&&r(e,i),i}}const QY={lsp:{NodeKindProvider:t=>new RY(t),WorkspaceSymbolProvider:t=>new kY(t)},workspace:{WorkspaceManager:t=>new SY(t)}};function Qt(t){return e=>new t(e)}const eX={WorkspaceCache:t=>new ZS(t.shared),Rpc:Qt(TY),likec4:{ModelChanges:Qt(wY),FqnIndex:Qt(KK),ModelParser:Qt(dY),ModelBuilder:Qt(rY),ModelLocator:Qt(oY)},lsp:{CompletionProvider:Qt(zK),DocumentHighlightProvider:Qt(BK),DocumentSymbolProvider:Qt(jK),SemanticTokenProvider:Qt(GK),HoverProvider:Qt(UK),CodeLensProvider:Qt(MK),DocumentLinkProvider:Qt(qK),Formatter:Qt(ZY)},references:{ScopeComputation:Qt(bY),ScopeProvider:Qt(DY)}};function tX(t,e,n,r){const i=nX(t),s=[tG({shared:i}),SK,eX,e,n,r].reduce(ix,{}),o=Qf(s);return i.ServiceRegistry.register(o),YY(o),t.connection?o.Rpc.init():i.workspace.ConfigurationProvider.initialized({}),{shared:i,likec4:o}}function nX(t={}){const e={...vk,...t};return t.connection&&(CK(t.connection),$K(t.connection)),Qf(rG(e),RK,QY)}function ix(t,e){if(e){for(const[n,r]of Object.entries(e))if(r!==void 0){const i=t[n];i!==null&&r!==null&&typeof i=="object"&&typeof r=="object"?t[n]=ix(i,r):t[n]=r}}return t}function sx(t){return typeof t=="object"&&t!==null&&typeof t.id=="string"}function lb(t){return typeof t=="object"&&t!==null&&t.$$type==="Node"&&typeof t.id=="string"}function ox(t){return lb(t)||sx(t)}function Hl(t){return typeof t=="string"||ox(t)}function rX(t){return Array.isArray(t)&&t.every(Hl)}function iX(t){return["n","ne","e","se","s","sw","w","nw","c"].includes(t)}function ax(t){if(ox(t))return t;const[e,n,r]=t.split(":");return iX(r)?{id:e,port:n,compass:r}:{id:e,port:n}}function sX(t){if(t.length<2&&(Hl(t[0])&&Hl(t[1]))===!1)throw Error("EdgeTargets must have at least 2 elements.");return t.map(e=>ax(e))}const _p=Object.seal({Graph:null,Digraph:null,Subgraph:null,Node:null,Edge:null});function oX(t){return Object.assign(Object.seal(Object.assign({},_p)),t)}function aX(...t){const[e,...n]=t;return(...r)=>n.reduce((i,s)=>s(i),e(...r))}function Jn(t,...e){return aX(t,...e)}const cX=t=>(...e)=>n=>t(n,...e),uX=t=>({[Symbol.iterator]:t}),br=cX((t,e)=>Array.from(uX(function*(){for(const n of t)yield e(n)})));class cx{options;getLocation(){return this.options?.locationFunction?.()??null}constructor(e){this.options=e}createElement(e,n,r=[]){return{location:this.getLocation(),...n,type:e,children:r}}}const Ge=cx.prototype.createElement.bind(new cx),lX=/\r?\n/;function Er(t){return e=>e.join(t)}function dX(t){return e=>t+e+t}function is(t,e){return n=>t+n+e}function Ap(t){return e=>t+e}const ux=t=>t.replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/"/g,'\\"'),xp=t=>t.split(lX),Vl=(t,e,n)=>Jn(xp,br(Ap(t==="space"?" ".repeat(e):`
1754
+ `)),Er(n)),co=t=>{switch(t){case"crlf":return`\r
1755
+ `;case"lf":return`
1756
+ `}},fX={match(t){return t.type==="AttributeList"},print(t,e){if(e.children.length===0)return`${e.kind.toLocaleLowerCase()} [];`;const n=co(t.endOfLine);return Jn(br(t.print),Er(n),Vl(t.indentStyle,t.indentSize,n),is(`${e.kind.toLocaleLowerCase()} [${n}`,`${n}];`))(e.children)}},hX={match(t){return t.type==="Attribute"},print(t,e){return`${t.print(e.key)} = ${t.print(e.value)};`}},pX={match(t){return t.type==="Comment"},print(t,e){const n=co(t.endOfLine);switch(e.kind){case"Block":return Jn(xp,br(Ap(" * ")),Er(n),is(`/**${n}`,`${n} */`))(e.value);case"Macro":return Jn(xp,br(Ap("# ")),Er(n))(e.value);case"Slash":default:return Jn(xp,br(Ap("// ")),Er(n))(e.value)}}},gX={match(t){return t.type==="Dot"},print(t,e){return e.children.map(t.print).join(co(t.endOfLine))}},mX={match(t){return t.type==="Edge"},print(t,e){const n=Jn(br(t.print),Er(t.directed?" -> ":" -- "))(e.targets);if(e.children.length===0)return`${n};`;const r=co(t.endOfLine),i=Jn(br(t.print),Er(r),Vl(t.indentStyle,t.indentSize,r),is(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},yX={match(t){return t.type==="Graph"},print(t,e){t.directed=e.directed;const n=[];if(e.strict&&n.push("strict"),n.push(e.directed?"digraph":"graph"),e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=co(t.endOfLine),i=Jn(br(t.print),Er(r),Vl(t.indentStyle,t.indentSize,r),is(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},vX=Jn(ux,dX('"')),wX=is("<",">"),bX={match(t){return t.type==="Literal"},print(t,e){switch(e.quoted){case"html":return wX(e.value);case!0:return vX(e.value);case!1:default:return ux(e.value)}}},EX={match(t){return t.type==="Node"},print(t,e){const n=t.print(e.id);if(e.children.length===0)return`${n};`;const r=co(t.endOfLine),i=Jn(br(t.print),Er(r),Vl(t.indentStyle,t.indentSize,r),is(`[${r}`,`${r}];`))(e.children);return`${n} ${i}`}},DX={match(t){return t.type==="NodeRefGroup"},print(t,e){return Jn(br(t.print),Er(" "),is("{","}"))(e.children)}},TX={match(t){return t.type==="NodeRef"},print(t,e){const n=[t.print(e.id)];return e.port&&n.push(t.print(e.port)),e.compass&&n.push(t.print(e.compass)),n.join(":")}},RX={match(t){return t.type==="Subgraph"},print(t,e){const n=["subgraph"];if(e.id&&n.push(t.print(e.id)),e.children.length===0)return`${n.join(" ")} {}`;const r=co(t.endOfLine),i=Jn(br(t.print),Er(r),Vl(t.indentStyle,t.indentSize,r),is(`{${r}`,`${r}}`))(e.children);return`${n.join(" ")} ${i}`}},SX=[fX,hX,pX,gX,mX,yX,bX,EX,DX,TX,RX];class kX{options;#e=[...SX];constructor(e={}){this.options=e}print(e){const n=[...this.#e],{indentSize:r=2,indentStyle:i="space",endOfLine:s="lf"}=this.options,o={directed:!0,indentSize:r,indentStyle:i,endOfLine:s,print(a){for(const c of n)if(c.match(a))return c.print(o,a);throw Error()}};return o.print(e)}}function $X(t,e){const n=new kX(e).print(t);if(!n)throw new Error;return n}function Ip(t,e){if(typeof e=="string"){const n=e.trim();return/^<.+>$/ms.test(n)?Ge("Attribute",{key:Ge("Literal",{value:t,quoted:!1},[]),value:Ge("Literal",{value:n.slice(1,n.length-1),quoted:"html"},[])},[]):Ge("Attribute",{key:Ge("Literal",{value:t,quoted:!1},[]),value:Ge("Literal",{value:e,quoted:!0},[])},[])}return Ge("Attribute",{key:Ge("Literal",{value:t,quoted:!1},[]),value:Ge("Literal",{value:String(e),quoted:!1},[])},[])}function uo(t,e){return Ge("Comment",{kind:e,value:t},[])}function lx(t,e){return Array.from(function*(){for(const[n,r]of e.values)yield Ip(n,r);for(const n of Object.values(e.attributes))n.size>0&&(n.comment&&(yield uo(n.comment,t.commentKind)),yield t.convert(n));for(const n of e.nodes)n.comment&&(yield uo(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.subgraphs)n.comment&&(yield uo(n.comment,t.commentKind)),yield t.convert(n);for(const n of e.edges)n.comment&&(yield uo(n.comment,t.commentKind)),yield t.convert(n)}())}const CX={match(t){return t.$$type==="AttributeList"},convert(t,e){return Ge("AttributeList",{kind:e.$$kind},e.values.map(([n,r])=>Ip(n,r)))}},_X={match(t){return t.$$type==="Edge"},convert(t,e){return Ge("Edge",{targets:e.targets.map(n=>lb(n)?Ge("NodeRef",{id:Ge("Literal",{value:n.id,quoted:!0},[])},[]):sx(n)?Ge("NodeRef",{id:Ge("Literal",{value:n.id,quoted:!0},[]),port:n.port?Ge("Literal",{value:n.port,quoted:!0},[]):void 0,compass:n.compass?Ge("Literal",{value:n.compass,quoted:!0},[]):void 0},[]):Ge("NodeRefGroup",{},n.map(r=>lb(r)?Ge("NodeRef",{id:Ge("Literal",{value:r.id,quoted:!0},[])},[]):Ge("NodeRef",{id:Ge("Literal",{value:r.id,quoted:!0},[]),port:r.port?Ge("Literal",{value:r.port,quoted:!0},[]):void 0,compass:r.compass?Ge("Literal",{value:r.compass,quoted:!0},[]):void 0},[]))))},[...e.attributes.comment?[uo(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Ip(n,r))])}},AX={match(t){return t.$$type==="Graph"},convert(t,e){return Ge("Dot",{},[...e.comment?[uo(e.comment,t.commentKind)]:[],Ge("Graph",{directed:e.directed,strict:e.strict,id:e.id?Ge("Literal",{value:e.id,quoted:!0},[]):void 0},lx(t,e))])}},xX={match(t){return t.$$type==="Node"},convert(t,e){return Ge("Node",{id:Ge("Literal",{value:e.id,quoted:!0},[])},[...e.attributes.comment?[uo(e.attributes.comment,t.commentKind)]:[],...e.attributes.values.map(([n,r])=>Ip(n,r))])}},IX={match(t){return t.$$type==="Subgraph"},convert(t,e){return Ge("Subgraph",{id:e.id?Ge("Literal",{value:e.id,quoted:!0},[]):void 0},lx(t,e))}},PX=[CX,_X,xX,AX,IX];class NX{options;#e=[...PX];constructor(e={}){this.options=e}convert(e){const n=[...this.#e],{commentKind:r="Slash"}=this.options,i={commentKind:r,convert(s){for(const o of n)if(o.match(s))return o.convert(i,s);throw Error()}};return i.convert(e)}}function OX(t,e){return new NX(e).convert(t)}const q=new Proxy(Object.freeze({}),{get:(t,e)=>e});class db{}class fb extends db{#e=new Map;constructor(e){super(),e!==void 0&&this.apply(e)}get values(){return Array.from(this.#e.entries())}get size(){return this.#e.size}get(e){return this.#e.get(e)}set(e,n){n!=null&&this.#e.set(e,n)}delete(e){this.#e.delete(e)}apply(e){const n=Array.isArray(e)?e:Object.entries(e);for(const[r,i]of n)this.set(r,i)}clear(){this.#e.clear()}}class hb extends fb{$$kind;get $$type(){return"AttributeList"}comment;constructor(e,n){super(n),this.$$kind=e}}class dx extends fb{#e=_p;id;comment;attributes=Object.freeze({graph:new hb("Graph"),edge:new hb("Edge"),node:new hb("Node")});get nodes(){return Array.from(this.#t.nodes.values())}get edges(){return Array.from(this.#t.edges.values())}get subgraphs(){return Array.from(this.#t.subgraphs.values())}#t={nodes:new Map,edges:new Set,subgraphs:new Set};with(e){this.#e=oX(e)}addNode(e){this.#t.nodes.set(e.id,e)}addEdge(e){this.#t.edges.add(e)}addSubgraph(e){this.#t.subgraphs.add(e)}existNode(e){return this.#t.nodes.has(e)}existEdge(e){return this.#t.edges.has(e)}existSubgraph(e){return this.#t.subgraphs.has(e)}createSubgraph(...e){const n=new this.#e.Subgraph(...e);return n.with(this.#e),this.addSubgraph(n),n}removeNode(e){this.#t.nodes.delete(typeof e=="string"?e:e.id)}removeEdge(e){this.#t.edges.delete(e)}removeSubgraph(e){this.#t.subgraphs.delete(e)}createNode(e,n){const r=new this.#e.Node(e,n);return this.addNode(r),r}getSubgraph(e){return Array.from(this.#t.subgraphs.values()).find(n=>n.id===e)}getNode(e){return this.#t.nodes.get(e)}createEdge(e,n){const r=e.map(s=>rX(s)?sX(s):ax(s)),i=new this.#e.Edge(r,n);return this.addEdge(i),i}subgraph(...e){const n=e.find(o=>typeof o=="string"),r=e.find(o=>typeof o=="object"&&o!==null),i=e.find(o=>typeof o=="function"),s=n?this.getSubgraph(n)??this.createSubgraph(n):this.createSubgraph();return r!==void 0&&s.apply(r),i!==void 0&&i(s),s}node(e,...n){if(typeof e=="string"){const r=e,i=n.find(a=>typeof a=="object"&&a!==null),s=n.find(a=>typeof a=="function"),o=this.getNode(r)??this.createNode(r);return i!==void 0&&o.attributes.apply(i),s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.node.apply(e)}edge(e,...n){if(Array.isArray(e)){const r=e,i=n.find(a=>typeof a=="object"),s=n.find(a=>typeof a=="function"),o=this.createEdge(r,i);return s!==void 0&&s(o),o}typeof e=="object"&&e!==null&&this.attributes.edge.apply(e)}graph(e){this.attributes.graph.apply(e)}}class fx extends dx{get $$type(){return"Graph"}id;strict;constructor(...e){super(),this.id=e.find(r=>typeof r=="string"),this.strict=e.find(r=>typeof r=="boolean")??!1;const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}}class FX extends fx{get directed(){return!0}}class LX extends fx{get directed(){return!1}}class MX extends dx{get $$type(){return"Subgraph"}id;constructor(...e){super(),this.id=e.find(r=>typeof r=="string");const n=e.find(r=>typeof r=="object"&&r!==null);n!==void 0&&this.apply(n)}isSubgraphCluster(){return typeof this.id=="string"?this.id.startsWith("cluster"):!1}}class hx extends fb{comment}let zX=class extends db{id;get $$type(){return"Node"}comment;attributes;constructor(e,n){super(),this.id=e,this.attributes=new hx(n)}port(e){return typeof e=="string"?{id:this.id,port:e}:{id:this.id,...e}}};class BX extends db{targets;get $$type(){return"Edge"}comment;attributes;constructor(e,n){if(super(),this.targets=e,e.length<2&&(Hl(e[0])&&Hl(e[1]))===!1)throw Error("The element of Edge target is missing or not satisfied as Edge target.");this.attributes=new hx(n)}}Object.assign(_p,{Graph:LX,Digraph:FX,Subgraph:MX,Node:zX,Edge:BX});function px(t,e){return(...n)=>{const r=t?this.Digraph:this.Graph,i=n.find(c=>typeof c=="string"),s=n.find(c=>typeof c=="object"),o=n.find(c=>typeof c=="function"),a=new r(i,e,s);return a.with(this),typeof o=="function"&&o(a),a}}function gx(t,e=_p){return Object.freeze({digraph:px.call(e,!0,t),graph:px.call(e,!1,t)})}const mx=gx(!1),qX=mx.digraph;mx.graph;const jX=gx(!0);function yx(t,e){const n=OX(t,e?.convert);return $X(n,e?.print)}var pb,vx;function UX(){if(vx)return pb;vx=1;function t(r){let i=r.length-1,s=r[i];for(;s===" "||s===" ";)s=r[--i];return r.substring(0,i+1)}function e(r){return r.split(`
1757
+ `).map(o=>t(o)).join(`
1758
+ `)}pb=function(r,i){if(i=i||{},r==null)return r;var s=i.width||50,o=typeof i.indent=="string"?i.indent:" ",a=i.newline||`
1759
+ `+o,c=typeof i.escape=="function"?i.escape:n,u=".{1,"+s+"}";i.cut!==!0&&(u+="([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)");var l=new RegExp(u,"g"),d=r.match(l)||[],f=o+d.map(function(h){return h.slice(-1)===`
1760
+ `&&(h=h.slice(0,h.length-1)),c(h)}).join(a);return i.trim===!0&&(f=e(f)),f};function n(r){return r}return pb}var GX=UX();const Pp={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:t=>t>=255?255:t<0?0:t,g:t=>t>=255?255:t<0?0:t,b:t=>t>=255?255:t<0?0:t,h:t=>t%360,s:t=>t>=100?100:t<0?0:t,l:t=>t>=100?100:t<0?0:t,a:t=>t>=1?1:t<0?0:t},toLinear:t=>{const e=t/255;return t>.03928?Math.pow((e+.055)/1.055,2.4):e/12.92},hue2rgb:(t,e,n)=>(n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t),hsl2rgb:({h:t,s:e,l:n},r)=>{if(!e)return n*2.55;t/=360,e/=100,n/=100;const i=n<.5?n*(1+e):n+e-n*e,s=2*n-i;switch(r){case"r":return Pp.hue2rgb(s,i,t+1/3)*255;case"g":return Pp.hue2rgb(s,i,t)*255;case"b":return Pp.hue2rgb(s,i,t-1/3)*255}},rgb2hsl:({r:t,g:e,b:n},r)=>{t/=255,e/=255,n/=255;const i=Math.max(t,e,n),s=Math.min(t,e,n),o=(i+s)/2;if(r==="l")return o*100;if(i===s)return 0;const a=i-s,c=o>.5?a/(2-i-s):a/(i+s);if(r==="s")return c*100;switch(i){case t:return((e-n)/a+(e<n?6:0))*60;case e:return((n-t)/a+2)*60;case n:return((t-e)/a+4)*60;default:return-1}}},WX={clamp:(t,e,n)=>e>n?Math.min(e,Math.max(n,t)):Math.min(n,Math.max(e,t)),round:t=>Math.round(t*1e10)/1e10},HX={dec2hex:t=>{const e=Math.round(t).toString(16);return e.length>1?e:`0${e}`}},Ce={channel:Pp,lang:WX,unit:HX},ss={};for(let t=0;t<=255;t++)ss[t]=Ce.unit.dec2hex(t);const en={ALL:0,RGB:1,HSL:2};class VX{constructor(){this.type=en.ALL}get(){return this.type}set(e){if(this.type&&this.type!==e)throw new Error("Cannot change both RGB and HSL channels at the same time");this.type=e}reset(){this.type=en.ALL}is(e){return this.type===e}}class KX{constructor(e,n){this.color=n,this.changed=!1,this.data=e,this.type=new VX}set(e,n){return this.color=n,this.changed=!1,this.data=e,this.type.type=en.ALL,this}_ensureHSL(){const e=this.data,{h:n,s:r,l:i}=e;n===void 0&&(e.h=Ce.channel.rgb2hsl(e,"h")),r===void 0&&(e.s=Ce.channel.rgb2hsl(e,"s")),i===void 0&&(e.l=Ce.channel.rgb2hsl(e,"l"))}_ensureRGB(){const e=this.data,{r:n,g:r,b:i}=e;n===void 0&&(e.r=Ce.channel.hsl2rgb(e,"r")),r===void 0&&(e.g=Ce.channel.hsl2rgb(e,"g")),i===void 0&&(e.b=Ce.channel.hsl2rgb(e,"b"))}get r(){const e=this.data,n=e.r;return!this.type.is(en.HSL)&&n!==void 0?n:(this._ensureHSL(),Ce.channel.hsl2rgb(e,"r"))}get g(){const e=this.data,n=e.g;return!this.type.is(en.HSL)&&n!==void 0?n:(this._ensureHSL(),Ce.channel.hsl2rgb(e,"g"))}get b(){const e=this.data,n=e.b;return!this.type.is(en.HSL)&&n!==void 0?n:(this._ensureHSL(),Ce.channel.hsl2rgb(e,"b"))}get h(){const e=this.data,n=e.h;return!this.type.is(en.RGB)&&n!==void 0?n:(this._ensureRGB(),Ce.channel.rgb2hsl(e,"h"))}get s(){const e=this.data,n=e.s;return!this.type.is(en.RGB)&&n!==void 0?n:(this._ensureRGB(),Ce.channel.rgb2hsl(e,"s"))}get l(){const e=this.data,n=e.l;return!this.type.is(en.RGB)&&n!==void 0?n:(this._ensureRGB(),Ce.channel.rgb2hsl(e,"l"))}get a(){return this.data.a}set r(e){this.type.set(en.RGB),this.changed=!0,this.data.r=e}set g(e){this.type.set(en.RGB),this.changed=!0,this.data.g=e}set b(e){this.type.set(en.RGB),this.changed=!0,this.data.b=e}set h(e){this.type.set(en.HSL),this.changed=!0,this.data.h=e}set s(e){this.type.set(en.HSL),this.changed=!0,this.data.s=e}set l(e){this.type.set(en.HSL),this.changed=!0,this.data.l=e}set a(e){this.changed=!0,this.data.a=e}}const gb=new KX({r:0,g:0,b:0,a:0},"transparent"),$a={re:/^#((?:[a-f0-9]{2}){2,4}|[a-f0-9]{3})$/i,parse:t=>{if(t.charCodeAt(0)!==35)return;const e=t.match($a.re);if(!e)return;const n=e[1],r=parseInt(n,16),i=n.length,s=i%4===0,o=i>4,a=o?1:17,c=o?8:4,u=s?0:-1,l=o?255:15;return gb.set({r:(r>>c*(u+3)&l)*a,g:(r>>c*(u+2)&l)*a,b:(r>>c*(u+1)&l)*a,a:s?(r&l)*a/255:1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`#${ss[Math.round(e)]}${ss[Math.round(n)]}${ss[Math.round(r)]}${ss[Math.round(i*255)]}`:`#${ss[Math.round(e)]}${ss[Math.round(n)]}${ss[Math.round(r)]}`}},lo={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:t=>{const e=t.match(lo.hueRe);if(e){const[,n,r]=e;switch(r){case"grad":return Ce.channel.clamp.h(parseFloat(n)*.9);case"rad":return Ce.channel.clamp.h(parseFloat(n)*180/Math.PI);case"turn":return Ce.channel.clamp.h(parseFloat(n)*360)}}return Ce.channel.clamp.h(parseFloat(t))},parse:t=>{const e=t.charCodeAt(0);if(e!==104&&e!==72)return;const n=t.match(lo.re);if(!n)return;const[,r,i,s,o,a]=n;return gb.set({h:lo._hue2deg(r),s:Ce.channel.clamp.s(parseFloat(i)),l:Ce.channel.clamp.l(parseFloat(s)),a:o?Ce.channel.clamp.a(a?parseFloat(o)/100:parseFloat(o)):1},t)},stringify:t=>{const{h:e,s:n,l:r,a:i}=t;return i<1?`hsla(${Ce.lang.round(e)}, ${Ce.lang.round(n)}%, ${Ce.lang.round(r)}%, ${i})`:`hsl(${Ce.lang.round(e)}, ${Ce.lang.round(n)}%, ${Ce.lang.round(r)}%)`}},Kl={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:t=>{t=t.toLowerCase();const e=Kl.colors[t];if(e)return $a.parse(e)},stringify:t=>{const e=$a.stringify(t);for(const n in Kl.colors)if(Kl.colors[n]===e)return n}},Yl={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:t=>{const e=t.charCodeAt(0);if(e!==114&&e!==82)return;const n=t.match(Yl.re);if(!n)return;const[,r,i,s,o,a,c,u,l]=n;return gb.set({r:Ce.channel.clamp.r(i?parseFloat(r)*2.55:parseFloat(r)),g:Ce.channel.clamp.g(o?parseFloat(s)*2.55:parseFloat(s)),b:Ce.channel.clamp.b(c?parseFloat(a)*2.55:parseFloat(a)),a:u?Ce.channel.clamp.a(l?parseFloat(u)/100:parseFloat(u)):1},t)},stringify:t=>{const{r:e,g:n,b:r,a:i}=t;return i<1?`rgba(${Ce.lang.round(e)}, ${Ce.lang.round(n)}, ${Ce.lang.round(r)}, ${Ce.lang.round(i)})`:`rgb(${Ce.lang.round(e)}, ${Ce.lang.round(n)}, ${Ce.lang.round(r)})`}},os={format:{keyword:Kl,hex:$a,rgb:Yl,rgba:Yl,hsl:lo,hsla:lo},parse:t=>{if(typeof t!="string")return t;const e=$a.parse(t)||Yl.parse(t)||lo.parse(t)||Kl.parse(t);if(e)return e;throw new Error(`Unsupported color format: "${t}"`)},stringify:t=>!t.changed&&t.color?t.color:t.type.is(en.HSL)||t.data.r===void 0?lo.stringify(t):t.a<1||!Number.isInteger(t.r)||!Number.isInteger(t.g)||!Number.isInteger(t.b)?Yl.stringify(t):$a.stringify(t)},YX=(t,e)=>{const n=os.parse(t);for(const r in e)n[r]=Ce.channel.clamp[r](e[r]);return os.stringify(n)},wx=t=>os.format.hex.stringify(os.parse(t)),XX=(t,e,n)=>{const r=os.parse(t),i=r[e],s=Ce.channel.clamp[e](i+n);return i!==s&&(r[e]=s),os.stringify(r)},JX=(t,e)=>XX(t,"a",-e),ZX=(t,e)=>{const n=os.parse(t),r={};for(const i in e)e[i]&&(r[i]=n[i]+e[i]);return YX(t,r)},QX=(t,e)=>{const n=os.parse(t),r={},i=(s,o,a)=>o>0?(a-s)*o/100:s*o/100;for(const s in e)r[s]=i(n[s],e[s],Ce.channel.max[s]);return ZX(t,r)};class eJ{value;next;constructor(e){this.value=e}}class tJ{#e;#t;#n;constructor(){this.clear()}enqueue(e){const n=new eJ(e);this.#e?(this.#t.next=n,this.#t=n):(this.#e=n,this.#t=n),this.#n++}dequeue(){const e=this.#e;if(e)return this.#e=this.#e.next,this.#n--,e.value}peek(){if(this.#e)return this.#e.value}clear(){this.#e=void 0,this.#t=void 0,this.#n=0}get size(){return this.#n}*[Symbol.iterator](){let e=this.#e;for(;e;)yield e.value,e=e.next}}function Np(t){bx(t);const e=new tJ;let n=0;const r=()=>{n<t&&e.size>0&&(e.dequeue()(),n++)},i=()=>{n--,r()},s=async(c,u,l)=>{const d=(async()=>c(...l))();u(d);try{await d}catch{}i()},o=(c,u,l)=>{new Promise(d=>{e.enqueue(d)}).then(s.bind(void 0,c,u,l)),(async()=>(await Promise.resolve(),n<t&&r()))()},a=(c,...u)=>new Promise(l=>{o(c,l,u)});return Object.defineProperties(a,{activeCount:{get:()=>n},pendingCount:{get:()=>e.size},clearQueue:{value(){e.clear()}},concurrency:{get:()=>t,set(c){bx(c),t=c,queueMicrotask(()=>{for(;n<t&&e.size>0;)r()})}}}),a}function bx(t){if(!((Number.isInteger(t)||t===Number.POSITIVE_INFINITY)&&t>0))throw new TypeError("Expected `concurrency` to be a number from 1 and up")}var nJ=Object.getOwnPropertyNames,rJ=Object.getOwnPropertySymbols,iJ=Object.prototype.hasOwnProperty;function Ex(t,e){return function(n,r,i){return t(n,r,i)&&e(n,r,i)}}function Op(t){return function(e,n,r){if(!e||!n||typeof e!="object"||typeof n!="object")return t(e,n,r);var i=r.cache,s=i.get(e),o=i.get(n);if(s&&o)return s===n&&o===e;i.set(e,n),i.set(n,e);var a=t(e,n,r);return i.delete(e),i.delete(n),a}}function Dx(t){return nJ(t).concat(rJ(t))}var Tx=Object.hasOwn||function(t,e){return iJ.call(t,e)};function Ca(t,e){return t||e?t===e:t===e||t!==t&&e!==e}var Rx="_owner",Sx=Object.getOwnPropertyDescriptor,kx=Object.keys;function sJ(t,e,n){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(!n.equals(t[r],e[r],r,r,t,e,n))return!1;return!0}function oJ(t,e){return Ca(t.getTime(),e.getTime())}function $x(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.entries(),s=0,o,a;(o=i.next())&&!o.done;){for(var c=e.entries(),u=!1,l=0;(a=c.next())&&!a.done;){var d=o.value,f=d[0],h=d[1],p=a.value,g=p[0],y=p[1];!u&&!r[l]&&(u=n.equals(f,g,s,l,t,e,n)&&n.equals(h,y,f,g,t,e,n))&&(r[l]=!0),l++}if(!u)return!1;s++}return!0}function aJ(t,e,n){var r=kx(t),i=r.length;if(kx(e).length!==i)return!1;for(var s;i-- >0;)if(s=r[i],s===Rx&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Tx(e,s)||!n.equals(t[s],e[s],s,s,t,e,n))return!1;return!0}function Xl(t,e,n){var r=Dx(t),i=r.length;if(Dx(e).length!==i)return!1;for(var s,o,a;i-- >0;)if(s=r[i],s===Rx&&(t.$$typeof||e.$$typeof)&&t.$$typeof!==e.$$typeof||!Tx(e,s)||!n.equals(t[s],e[s],s,s,t,e,n)||(o=Sx(t,s),a=Sx(e,s),(o||a)&&(!o||!a||o.configurable!==a.configurable||o.enumerable!==a.enumerable||o.writable!==a.writable)))return!1;return!0}function cJ(t,e){return Ca(t.valueOf(),e.valueOf())}function uJ(t,e){return t.source===e.source&&t.flags===e.flags}function Cx(t,e,n){if(t.size!==e.size)return!1;for(var r={},i=t.values(),s,o;(s=i.next())&&!s.done;){for(var a=e.values(),c=!1,u=0;(o=a.next())&&!o.done;)!c&&!r[u]&&(c=n.equals(s.value,o.value,s.value,o.value,t,e,n))&&(r[u]=!0),u++;if(!c)return!1}return!0}function lJ(t,e){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(t[n]!==e[n])return!1;return!0}var dJ="[object Arguments]",fJ="[object Boolean]",hJ="[object Date]",pJ="[object Map]",gJ="[object Number]",mJ="[object Object]",yJ="[object RegExp]",vJ="[object Set]",wJ="[object String]",bJ=Array.isArray,_x=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,Ax=Object.assign,EJ=Object.prototype.toString.call.bind(Object.prototype.toString);function DJ(t){var e=t.areArraysEqual,n=t.areDatesEqual,r=t.areMapsEqual,i=t.areObjectsEqual,s=t.arePrimitiveWrappersEqual,o=t.areRegExpsEqual,a=t.areSetsEqual,c=t.areTypedArraysEqual;return function(u,l,d){if(u===l)return!0;if(u==null||l==null||typeof u!="object"||typeof l!="object")return u!==u&&l!==l;var f=u.constructor;if(f!==l.constructor)return!1;if(f===Object)return i(u,l,d);if(bJ(u))return e(u,l,d);if(_x!=null&&_x(u))return c(u,l,d);if(f===Date)return n(u,l,d);if(f===RegExp)return o(u,l,d);if(f===Map)return r(u,l,d);if(f===Set)return a(u,l,d);var h=EJ(u);return h===hJ?n(u,l,d):h===yJ?o(u,l,d):h===pJ?r(u,l,d):h===vJ?a(u,l,d):h===mJ?typeof u.then!="function"&&typeof l.then!="function"&&i(u,l,d):h===dJ?i(u,l,d):h===fJ||h===gJ||h===wJ?s(u,l,d):!1}}function TJ(t){var e=t.circular,n=t.createCustomConfig,r=t.strict,i={areArraysEqual:r?Xl:sJ,areDatesEqual:oJ,areMapsEqual:r?Ex($x,Xl):$x,areObjectsEqual:r?Xl:aJ,arePrimitiveWrappersEqual:cJ,areRegExpsEqual:uJ,areSetsEqual:r?Ex(Cx,Xl):Cx,areTypedArraysEqual:r?Xl:lJ};if(n&&(i=Ax({},i,n(i))),e){var s=Op(i.areArraysEqual),o=Op(i.areMapsEqual),a=Op(i.areObjectsEqual),c=Op(i.areSetsEqual);i=Ax({},i,{areArraysEqual:s,areMapsEqual:o,areObjectsEqual:a,areSetsEqual:c})}return i}function RJ(t){return function(e,n,r,i,s,o,a){return t(e,n,a)}}function SJ(t){var e=t.circular,n=t.comparator,r=t.createState,i=t.equals,s=t.strict;if(r)return function(a,c){var u=r(),l=u.cache,d=l===void 0?e?new WeakMap:void 0:l,f=u.meta;return n(a,c,{cache:d,equals:i,meta:f,strict:s})};if(e)return function(a,c){return n(a,c,{cache:new WeakMap,equals:i,meta:void 0,strict:s})};var o={cache:void 0,equals:i,meta:void 0,strict:s};return function(a,c){return n(a,c,o)}}var kJ=as();as({strict:!0}),as({circular:!0}),as({circular:!0,strict:!0}),as({createInternalComparator:function(){return Ca}}),as({strict:!0,createInternalComparator:function(){return Ca}}),as({circular:!0,createInternalComparator:function(){return Ca}}),as({circular:!0,createInternalComparator:function(){return Ca},strict:!0});function as(t){t===void 0&&(t={});var e=t.circular,n=e===void 0?!1:e,r=t.createInternalComparator,i=t.createState,s=t.strict,o=s===void 0?!1:s,a=TJ(t),c=DJ(a),u=r?r(c):RJ(c);return SJ({circular:n,comparator:c,createState:i,equals:u,strict:o})}function xx(t,e){const n=t.nodes.map(i=>{const s=e.nodes[i.id];if(!s)return i;const{x:o,y:a,width:c,height:u}=s;return{...i,width:c,height:u,position:[o,a]}}),r=t.edges.map(i=>{const s=e.edges[i.id];return s?{...i,...s}:i});return{...t,bounds:{x:e.x,y:e.y,width:e.width,height:e.height},nodes:n,edges:r}}const Ix=(t,e)=>t.width>e.width+10||t.height>e.height+10;function $J(t,e){if(t.hash===e.hash)return{diagram:xx(t,e)};if(kJ(t.autoLayout,e.autoLayout)&&t.nodes.every(r=>{const i=e.nodes[r.id];return!!i&&(r.children.length>0&&i.isCompound||r.children.length===0&&!i.isCompound)&&(i.isCompound||Ix(r,i)===!1)})&&t.edges.every(r=>{const i=e.edges[r.id];return!!i&&(!r.labelBBox&&!i.labelBBox||!!r.labelBBox&&!!i.labelBBox&&r.labelBBox.width<=i.labelBBox.width&&r.labelBBox.height<=i.labelBBox.height)}))return{diagram:xx(t,e)};const n=t.nodes.reduce((r,i)=>{const s=e.nodes[i.id];if(i.children.length>0||!s)return r;const o={id:i.id,center:{x:Math.round(s.x+s.width/2),y:Math.round(s.y+s.height/2)}};return s.isCompound||Ix(i,s)||(o.fixedsize={width:s.width,height:s.height}),r.push(o),r},[]);return{relayout:{x:e.x,y:e.y,height:e.height,nodes:n,edges:Us(e.edges).flatMap(([r,i])=>i.dotpos?{id:r,dotpos:i.dotpos}:[])}}}function Mn(t){return t.children.length>0}function Zn(t){switch(t){case"open":return"vee";default:return t}}function Vr(t){return Array.isArray(t)?[Vr(t[0]),Vr(t[1])]:(we(isFinite(t),`Invalid not finite point value ${t}`),Math.round(t))}const Px=t=>(we(isFinite(t),`Invalid not finite inch value ${t}`),Math.floor(t*72)),dt=t=>Math.ceil(t/72*1e3)/1e3,Qn=t=>Math.ceil(t);Qn(40).toString();function Nx(t,e){return wx(QX(t,{l:-35-5*e,s:-15-5*e}))}function CJ(t){return wx(JX(t,.3))}function _J(t){return t.trim().replaceAll("&","&amp;").replaceAll("<","&lt;").replaceAll(">","&gt;")}function mb(t,e){return GX(t,{width:e,indent:"",escape:_J}).split(`
1761
+ `)}function cs({text:t,maxchars:e,fontsize:n,bold:r,color:i}){let s=mb(t,e).map(a=>Vi(a)?" ":a).join("<BR/>");r&&(s=`<B>${s}</B>`);const o=i?` COLOR="${i}"`:"";return`<FONT POINT-SIZE="${Qn(n)}"${o}>${s}</FONT>`}function AJ(t,e){const n=ce(t.icon),r=[cs({text:t.title,fontsize:19,maxchars:35})];if(ce(t.technology)&&r.push(cs({text:t.technology,fontsize:12,maxchars:n?35:45,color:e.loContrast})),ce(t.description)&&r.push(cs({text:t.description,fontsize:14,maxchars:n?35:45,color:e.loContrast})),r.length===1&&!n)return`<${r[0]}>`;const i=n?(s,o,a)=>{let c=`<TD ALIGN="TEXT" BALIGN="LEFT">${s}</TD>`;if(o===0){const u=a.length>1?` ROWSPAN="${a.length}"`:"";let l=76;(t.shape==="queue"||t.shape==="mobile")&&(l+=20),c=`<TD${u} WIDTH="${l}" FIXEDSIZE="TRUE"> </TD>${c}`,c=`${c}<TD${u} WIDTH="16" FIXEDSIZE="TRUE"> </TD>`}return`<TR>${c}</TR>`}:s=>`<TR><TD>${s}</TD></TR>`;return`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="6">${r.map(i).join("")}</TABLE>>`}function xJ(t,e){const n=cs({text:t.title.toUpperCase(),maxchars:50,fontsize:11,bold:!0,color:e});return n.includes("<BR/>")?`<<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0"><TR><TD ALIGN="TEXT" BALIGN="LEFT">${n}</TD></TR></TABLE>>`:`<${n}>`}const _a=35;function IJ({label:t,description:e,technology:n}){const r=[];if(ce(t)&&r.push(cs({text:t,maxchars:_a,fontsize:14,bold:t==="[...]"})),ce(e)&&r.push(cs({text:e,maxchars:_a,fontsize:14})),ce(n)&&r.push(cs({text:n,fontsize:12,maxchars:_a})),r.length===0)return null;const i=r.map(s=>`<TR><TD ALIGN="TEXT" BALIGN="LEFT">${s}</TD></TR>`).join("");return`<<TABLE BORDER="0" CELLPADDING="3" CELLSPACING="0" ${yb}>${i}</TABLE>>`}const yb=`BGCOLOR="${Gn.relationships[Ds].labelBgColor}A0"`;function PJ(t,e){const n=`<TABLE BORDER="0" CELLPADDING="6" ${yb}><TR><TD FIXEDSIZE="TRUE" WIDTH="20" HEIGHT="20"><FONT POINT-SIZE="${Qn(14)}"><B>${t}</B></FONT></TD></TR></TABLE>`;return ce(e)?`<${['<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">',"<TR>",`<TD>${n}</TD>`,`<TD ${yb} CELLPADDING="2">`,cs({text:e,maxchars:_a,fontsize:14}),"</TD>","</TR>","</TABLE>"].join("")}>`:`<${n}>`}const Ox="dashed",vb=Gn.font;class Fx{constructor(e){this.view=e,this.compoundIds=new Set(e.nodes.filter(Mn).map(r=>r.id)),this.edgesWithCompounds=new Set(this.compoundIds.size>0?e.edges.filter(r=>this.compoundIds.has(r.source)||this.compoundIds.has(r.target)).map(r=>r.id):[]);const n=this.graphvizModel=this.createGraph();this.applyNodeAttributes(n.attributes.node),this.applyEdgeAttributes(n.attributes.edge),this.buildGraphvizModel(n)}ids=new Set;subgraphs=new Map;nodes=new Map;edges=new Map;compoundIds;edgesWithCompounds;graphvizModel;get hasEdgesWithCompounds(){return this.edgesWithCompounds.size>0}buildGraphvizModel(e){const n=(i,s)=>{const o=this.nodeId(i),a=this.elementToSubgraph(i,s.subgraph(o));this.subgraphs.set(i.id,a);for(const c of this.view.nodes.filter(u=>Mn(u)&&u.parent===i.id))n(c,a)},r=[];for(const i of this.view.nodes)Mn(i)?Dt(i.parent)&&n(i,e):r.push(i);for(const i of r){const s=i.parent?this.getSubgraph(i.parent):e;we(s,"parent graph should be defined");const o=this.nodeId(i),a=this.elementToNode(i,s.node(o));this.nodes.set(i.id,a)}for(const i of this.view.edges){const s=this.addEdge(i,e);s&&this.edges.set(i.id,s)}}print(){return yx(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}createGraph(){const e=this.view.autoLayout,n=qX({[q.bgcolor]:"transparent",[q.layout]:"dot",[q.compound]:!0,[q.rankdir]:e.direction,[q.TBbalance]:"min",[q.splines]:"spline",[q.outputorder]:"nodesfirst",[q.nodesep]:dt(e.nodeSep??110),[q.ranksep]:dt(e.rankSep??120),[q.pack]:Qn(e.rankSep??120),[q.packmode]:"array_3",[q.pad]:dt(15),[q.forcelabels]:!0,[q.fontname]:vb});return n.attributes.graph.apply({[q.fontsize]:Qn(15),[q.labeljust]:e.direction==="RL"?"r":"l",[q.labelloc]:e.direction==="BT"?"b":"t",[q.margin]:50.1}),n}applyNodeAttributes(e){e.apply({[q.fontname]:vb,[q.nojustify]:!0,[q.shape]:"rect",[q.width]:dt(320),[q.height]:dt(180),[q.style]:"filled",[q.penwidth]:0})}applyEdgeAttributes(e){e.apply({[q.nojustify]:!0,[q.arrowsize]:.75,[q.fontname]:vb,[q.fontsize]:Qn(14),[q.penwidth]:Qn(2),[q.color]:Gn.relationships[Ds].lineColor,[q.fontcolor]:Gn.relationships[Ds].labelColor})}checkNodeId(e,n=!1){return n?e="cluster_"+e:e.toLowerCase().startsWith("cluster")&&(e="nd_"+e),this.ids.has(e)?null:(this.ids.add(e),e)}nodeId(e){const n=Mn(e);let r=ko(e.id).toLowerCase(),i=this.checkNodeId(r,n);if(i!==null)return i;let s=e.id,o;for(;o=kt(s);){if(r=ko(o).toLowerCase()+"_"+r,i=this.checkNodeId(r,n),i!==null)return i;s=o}r=ko(e.id).toLowerCase();let a=1;do i=this.checkNodeId(r+"_"+a++,n);while(i===null);return i}elementToSubgraph(e,n){we(Mn(e),"node should be compound"),we(rh(e.depth),"node.depth should be defined");const r=this.getElementColorValues(e.color),i=CJ(r.loContrast);return n.apply({[q.likec4_id]:e.id,[q.likec4_level]:e.level,[q.likec4_depth]:e.depth,[q.fillcolor]:Nx(r.fill,e.depth),[q.color]:Nx(r.stroke,e.depth),[q.style]:"filled",[q.margin]:Qn(e.children.length>1?40:32),[q.label]:xJ(e,i)}),n}elementToNode(e,n){we(!Mn(e),"node should not be compound");const r=ce(e.icon),i=this.getElementColorValues(e.color);switch(n.attributes.apply({[q.likec4_id]:e.id,[q.likec4_level]:e.level,[q.fillcolor]:i.fill,[q.fontcolor]:i.hiContrast,[q.color]:i.stroke,[q.margin]:`${dt(r?10:26)},${dt(26)}`}),e.shape){case"cylinder":case"storage":{n.attributes.apply({[q.margin]:`${dt(r?10:26)},${dt(0)}`,[q.penwidth]:Qn(2),[q.shape]:"cylinder"});break}case"browser":{n.attributes.apply({[q.margin]:`${dt(r?10:30)},${dt(32)}`});break}case"mobile":{n.attributes.apply({[q.margin]:`${dt(r?10:30)},${dt(26)}`});break}case"queue":{n.attributes.apply({[q.width]:dt(320),[q.height]:dt(165),[q.margin]:`${dt(r?10:30)},${dt(26)}`});break}}return n.attributes.set(q.label,AJ(e,i)),n}leafElements(e){if(e===null)return this.view.nodes.filter(r=>!Mn(r));const n=e+".";return this.view.nodes.filter(r=>!Mn(r)&&r.id.startsWith(n))}viewElement(e){return Ze(this.view.nodes.find(n=>n.id===e),`Node ${e} not found`)}getGraphNode(e){return this.nodes.get(e)??null}getSubgraph(e){return this.subgraphs.get(e)??null}edgeEndpoint(e,n){let r=this.viewElement(e),i=this.getGraphNode(e),s;return i||(we(Mn(r),"endpoint node should be compound"),s=this.getSubgraph(e)?.id,we(s,`subgraph ${e} not found`),r=Ze(n(this.leafElements(e)),`leaf element in ${e} not found`),i=Ze(this.getGraphNode(r.id),`source graphviz node ${r.id} not found`)),[r,i,s]}hasInternalEdges(e){return e===null?this.view.edges.length>0:this.view.edges.some($E(e))}findInternalEdges(e){return e===null?this.view.edges.slice():this.view.edges.filter($E(e))}withoutCompoundEdges(e){return this.edgesWithCompounds.size===0?e:{...e,inEdges:e.inEdges.filter(n=>!this.edgesWithCompounds.has(n)),outEdges:e.outEdges.filter(n=>!this.edgesWithCompounds.has(n))}}assignGroups(){const e=Ke(this.view.nodes,nt(Mn),ut(r=>r.id),ia($o),nh(),ut(r=>{const i=this.findInternalEdges(r).filter(s=>s.source!==s.target&&!this.compoundIds.has(s.source)&&!this.compoundIds.has(s.target));return{id:r,edges:i}}),nt(({edges:r})=>r.length>1&&r.length<8),PU(4)),n=new Set;for(const r of e){const i=r.edges.filter(s=>!n.has(s.source)&&!n.has(s.target));for(const s of i)try{const o=Ze(this.getGraphNode(s.source),`Graphviz Node not found for ${s.source}`),a=Ze(this.getGraphNode(s.target),`Graphviz Node not found for ${s.target}`);n.add(s.source),n.add(s.target),o.attributes.set(q.group,r.id),a.attributes.set(q.group,r.id)}catch(o){et.error(o)}}}applyManualLayout({height:e,...n}){const r=n.x<0?-n.x:0,i=n.y<0?-n.y:0,s=r>0||i>0;for(const{id:o,...a}of n.nodes){const c=this.getGraphNode(o);if(!c)continue;const u=dt(a.center.x)+r,l=dt(e-a.center.y);a.fixedsize?c.attributes.apply({[q.pos]:`${u},${l}!`,[q.pin]:!0,[q.width]:dt(a.fixedsize.width),[q.height]:dt(a.fixedsize.height),[q.fixedsize]:!0}):c.attributes.set(q.pos,`${u},${l}`)}for(const[o,a]of this.edges.entries()){a.attributes.delete(q.weight),a.attributes.delete(q.minlen),a.attributes.delete(q.constraint);const c=n.edges.find(u=>u.id===o)?.dotpos;c&&!s&&a.attributes.set(q.pos,c)}return this.graphvizModel.apply({[q.layout]:"fdp",[q.overlap]:"vpsc",[q.sep]:"+50,50",[q.esep]:"+10,10",[q.start]:"random2",[q.splines]:"compound"}),this.graphvizModel.delete(q.compound),this.graphvizModel.delete(q.rankdir),this.graphvizModel.delete(q.nodesep),this.graphvizModel.delete(q.ranksep),this.graphvizModel.delete(q.pack),this.graphvizModel.delete(q.pad),this.graphvizModel.delete(q.packmode),this.graphvizModel.attributes.graph.delete(q.margin),this}getRelationshipColorValues(e){return fE(e)?Gn.relationships[e]:this.view.customColorDefinitions[e]?.relationships??Gn.relationships[Na]}getElementColorValues(e){return fE(e)?Gn.elements[e]:this.view.customColorDefinitions[e]?.elements??Gn.elements[Na]}}class F0 extends Fx{static toDot(e){return new F0(e).print()}createGraph(){const e=super.createGraph();return e.set(q.TBbalance,"max"),e}addEdge(e,n){const{nodes:r}=this.view,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,E=>sa(E)),[u,l,d]=this.edgeEndpoint(s,oa),f=n.edge([a,l],{[q.likec4_id]:e.id,[q.style]:e.line??Ox});if(d&&f.attributes.set(q.lhead,d),c&&f.attributes.set(q.ltail,c),e.color&&e.color!==Ds){const E=this.getRelationshipColorValues(e.color);f.attributes.apply({[q.color]:E.lineColor,[q.fontcolor]:E.labelColor})}const h=jr(d)||jr(c),p=wE(e.id),g=PJ(p,e.label?.trim());if(f.attributes.set(q.label,g),!h){const E=new Set([...o.outEdges,...u.inEdges,...r9(u.outEdges,o.inEdges)].filter(k=>!this.edgesWithCompounds.has(k)));f.attributes.set(q.weight,E.size)}const y=r.findIndex(E=>E.id===i);r.findIndex(E=>E.id===s)<y&&e.dir!=="back"&&f.attributes.apply({[q.constraint]:!1});let[m,w]=[e.head??So,e.tail??"none"];return e.dir==="back"?(f.attributes.apply({[q.arrowtail]:Zn(m),[q.minlen]:0,[q.dir]:"back"}),w!=="none"&&f.attributes.apply({[q.arrowhead]:Zn(w),[q.dir]:"both"}),f):m==="none"&&w==="none"||m!=="none"&&w!=="none"?(f.attributes.apply({[q.arrowhead]:Zn(m),[q.arrowtail]:Zn(w),[q.dir]:"both"}),f):m==="none"?(f.attributes.delete(q.arrowhead),f.attributes.apply({[q.arrowtail]:Zn(w),[q.minlen]:0,[q.dir]:"back"}),f):(m!==So&&f.attributes.set(q.arrowhead,Zn(m)),f)}}class L0 extends Fx{static toDot(e){return new L0(e).print()}buildGraphvizModel(e){super.buildGraphvizModel(e),this.assignGroups();const n=new Set,r=this.view.nodes.reduce((i,s)=>(Mn(s)&&(n.add(s.id),i.push(s)),i),[]);for(const i of r){const s=Ke(i.children,nt(u=>!this.compoundIds.has(u)),ut(u=>this.viewElement(u)),nt(u=>u.inEdges.length===0&&u.outEdges.length===0));if(s.length<=2)continue;let o=2;switch(!0){case s.length>11:o=4;break;case s.length>4:o=3;break}const a=Ze(this.getSubgraph(i.id),`Subgraph not found for ${i.id}`);let c=null;S9(s,o).forEach(u=>{const l=u.length>1?a.createSubgraph({[q.rank]:"same"}):null;u.forEach((d,f)=>{const h=this.getGraphNode(d.id);h&&(l?.node(h.id),f===0&&(c&&a.edge([c,h],{[q.style]:"invis"}),c=h))})})}}addEdge(e,n){const r=this.view.edges,[i,s]=e.dir==="back"?[e.target,e.source]:[e.source,e.target],[o,a,c]=this.edgeEndpoint(i,E=>sa(E)),[u,l,d]=this.edgeEndpoint(s,oa),f=e.parent,h=(f===null?n:Ze(this.getSubgraph(f),`Parent not found for edge ${e.id}`)).edge([a,l],{[q.likec4_id]:e.id,[q.style]:e.line??Ox});d&&h.attributes.set(q.lhead,d),c&&h.attributes.set(q.ltail,c);const p=jr(d)||jr(c);if(!p){const E=new Set([...o.inEdges,...o.outEdges,...u.inEdges,...u.outEdges].filter(k=>!this.edgesWithCompounds.has(k)));h.attributes.set(q.weight,E.size)}const g=IJ(e);if(g&&(p?h.attributes.set(q.xlabel,g):h.attributes.set(q.label,g)),e.color){const E=this.getRelationshipColorValues(e.color);h.attributes.apply({[q.color]:E.lineColor,[q.fontcolor]:E.labelColor})}let[y,m]=[e.head??So,e.tail??"none"];if(e.dir==="back")return h.attributes.apply({[q.arrowtail]:Zn(y),[q.dir]:"back"}),m!=="none"&&h.attributes.apply({[q.arrowhead]:Zn(m),[q.dir]:"both",[q.minlen]:0}),h;if(y==="none"&&m==="none")return h.attributes.apply({[q.arrowtail]:"none",[q.arrowhead]:"none",[q.dir]:"none",[q.minlen]:0,[q.constraint]:!1}),h;if(y!=="none"&&m!=="none")return h.attributes.apply({[q.arrowhead]:Zn(y),[q.arrowtail]:Zn(m),[q.dir]:"both",[q.minlen]:0}),h;if(y!==So&&h.attributes.set(q.arrowhead,Zn(y)),m!=="none"&&h.attributes.set(q.arrowtail,Zn(m)),r.length===1)return h;let w;return f===null&&o.parent==null&&u.parent==null?w=r.filter(E=>{if(E.id===e.id||E.parent!==null||E.source===e.source&&E.target===e.target||E.source===e.target&&E.target===e.source)return!1;const k=this.viewElement(E.source),A=this.viewElement(E.target);return Mn(k)||Mn(A)?!1:k.parent==null&&A.parent==null}):w=this.findInternalEdges(f).filter(E=>!(E.id===e.id||E.source===e.source&&E.target===e.target||E.source===e.target&&E.target===e.source)),w.length===0&&(f===null||this.leafElements(f).length<=3)&&h.attributes.set(q.minlen,0),h}}function Fp(t){const[e,n,r,i]=t?t.split(",").map(a=>Vr(+a)):[0,0,0,0],s=Math.round(r-e),o=Math.round(n-i);return{x:Math.round(e),y:Math.round(i),width:s,height:o}}function NJ(t){try{const[e,n]=t.split(",");return{x:Vr(parseFloat(e)),y:Vr(parseFloat(n))}}catch(e){throw et.error(`failed on parsing pos: ${t}`,e),e}}function Lx({pos:t,width:e,height:n}){const{x:r,y:i}=NJ(t),s=Px(+e),o=Px(+n);return{x:r-Math.round(s/2),y:i-Math.round(o/2),width:s,height:o}}function Mx(t,[e,n]=[0,0]){if(!t||t.length===0)return null;let r=1/0,i=1/0,s=-1/0,o=-1/0,a=13;try{for(const u of t){if(u.op==="F"){a=Vr(u.size);continue}if(u.op==="T"){let l=Vr(u.pt[0])-e,d=Vr(u.width);switch(u.align){case"r":l-=d;break;case"c":l-=Math.round(d/2);break}r=Math.min(r,l),s=Math.max(s,l+d);let f=Vr(u.pt[1])-n;i=Math.min(i,Math.round(f-a)),o=Math.max(o,f)}}}catch(u){return et.error(`Failed on parsing label draw ops: ${u}
1762
+ ${JSON.stringify(t,null,2)}`),null}if(r===1/0)return null;const c=2;return{x:r-c,y:i-c,width:s-r+2*c,height:o-i+2*c}}function zx({_draw_:t,likec4_id:e="???"},n="<unknown view>"){try{const r=t.filter(s=>s.op.toLowerCase()==="b");we(qr(r,1),`view ${n} edge ${e} should have at least one bezier draw op`),r.length>1&&et.warn(`view ${n} edge ${e} has more than one bezier draw op, using the first one only`);const i=r[0].points.map(s=>Vr(s));return we(qr(i,2),`view ${n} edge ${e} should have at least two points`),i}catch(r){throw et.error(`failed on parsing view ${n} edge ${e} _draw_:
1763
+ ${JSON.stringify(t,null,2)}`),r}}function OJ(t,{id:e,source:n,target:r,dir:i,label:s,description:o,...a},c){const u=Mx(t._ldraw_??t._tldraw_??t._hldraw_),l=t.dir==="back"||i==="back";return s=s?mb(s,_a).join(`
1764
+ `):null,o=o?mb(o,_a).join(`
1765
+ `):void 0,{id:e,source:n,target:r,label:s,...ce(o)&&{description:o},...ce(t.pos)&&{dotpos:t.pos},points:zx(t,c),labelBBox:u,...l?{dir:"back"}:{},...a}}function Bx(t,e){const n=JSON.parse(t),r=Fp(n.bb),{nodes:i,edges:s,manualLayout:o,...a}=e,c={...a,bounds:r,nodes:[],edges:[]},u=n.objects??[];for(const d of i){const f=u.find(w=>w.likec4_id===d.id);we(f,`View ${a.id} element ${d.id} not found in graphviz output`);const{x:h,y:p,width:g,height:y}="bb"in f?Fp(f.bb):Lx(f),m=[h,p];c.nodes.push({...d,position:m,width:g,height:y,labelBBox:Ze(Mx(f._ldraw_,m),`View ${a.id} Node ${d.id} label bbox not found`)})}const l=n.edges??[];for(const d of s){const f=l.find(h=>h.likec4_id===d.id);if(!f){et.warn(`View ${a.id} edge ${d.id} not found in graphviz output, skipping`);continue}c.edges.push(OJ(f,d,a.id))}return c}const Lp=t=>String(t+1).padStart(2,"0");function FJ(t){const e=JSON.parse(t),n=Fp(e.bb),r={nodes:[],edges:[],bounds:n},i=new Map,s=e.objects??[];for(const o of s){if(!o.likec4_type)continue;const a=Lp(o._gvid),c=o.likec4_path??"",u=i.get(o._gvid),{x:l,y:d,width:f,height:h}="bb"in o?Fp(o.bb):Lx(o),p={x:l,y:d};if(o.likec4_type==="view")we(o.likec4_id,`View ${o} has no likec4_id`),r.nodes.push({id:a,type:"view",parentId:u?.id??null,height:h,width:f,position:p,label:o.label??"",viewId:o.likec4_id});else{const g={id:a,type:o.likec4_type,parentId:u?.id??null,height:h,width:f,position:p,path:c,label:o.label??""},y=[..."subgraphs"in o?o.subgraphs:[],..."nodes"in o?o.nodes:[]];for(const m of y)i.set(m,g);r.nodes.push(g)}}for(const o of e.edges??[])try{const a=Lp(o.tail),c=Lp(o.head);r.edges.push({id:`link${Lp(o._gvid)}`,source:a,target:c,points:zx(o)})}catch(a){et.warn(a)}return r}const qx=Gn.font,Mp="/";class M0{static toDot(e){return new M0(e).print()}subgraphs=new Map;graphvizModel;constructor(e){const n=this.graphvizModel=jX.graph({[q.layout]:"osage",[q.pack]:Qn(100),[q.packmode]:"array_ltc",[q.pad]:dt(15),[q.fontname]:qx,[q.splines]:"polyline",[q.esep]:"+20"});n.attributes.graph.apply({[q.fontsize]:Qn(20),[q.labeljust]:"l",[q.labelloc]:"t"}),n.attributes.node.apply({[q.fontname]:qx,[q.shape]:"rect",[q.width]:dt(400),[q.height]:dt(300),[q.fixedsize]:!0,[q.fontsize]:10}),n.attributes.edge.apply({[q.penwidth]:Qn(2)});const r=new Set(e.map(c=>c.relativePath??""));let i=0,s=[...e];const o=r.size>1;o&&s.sort((c,u)=>{const l=c.relativePath?.split(Mp)??[""],d=u.relativePath?.split(Mp)??[""];l.push(c.title??"Untitled"),d.push(u.title??"Untitled");const f=l.length,h=d.length;switch(i=Math.max(i,f,h),!0){case f>h:return-1;case f<h:return 1;default:{for(let p=0;p<f;p++){const g=l[p].localeCompare(d[p]);if(g!==0)return g}return 0}}});const a=new Map;s.forEach((c,u)=>{this.addView(o?c:{...c,relativePath:""},u+i);const l=c.nodes.reduce((d,f)=>(f.navigateTo&&d.add(f.navigateTo),d),new Set);l.size>0&&a.set(c.id,l)});for(const[c,u]of a)for(const l of u)n.edge([c,l])}getParentForPath(e){if(e==="")return this.graphvizModel;const n=e.toLowerCase();let r=this.subgraphs.get(n);if(!r){const i=n.endsWith(".c4")||n.endsWith(".likec4"),s=e.includes(Mp)?e.slice(0,e.lastIndexOf(Mp)):"";r=this.getParentForPath(s).subgraph("cluster"+String(this.subgraphs.size+1),{[q.likec4_type]:i?"file":"folder",[q.likec4_path]:e,[q.sortv]:this.subgraphs.size,[q.label]:ce(s)?e.slice(s.length+1):e}),this.subgraphs.set(n,r)}return r}addView(e,n=0){return this.getParentForPath(e.relativePath??"").node(e.id,{[q.likec4_type]:"view",[q.likec4_id]:e.id,[q.sortv]:n,[q.label]:e.title||"Untitled"})}print(){return yx(this.graphvizModel,{print:{indentStyle:"space",indentSize:2}})}}const jx=t=>Rg(t)?new F0(t):new L0(t);class LJ{constructor(e){this.graphviz=e}get port(){return this.graphviz}changePort(e){this.graphviz=e}async layout(e){let n=await this.dot(e);const r=await this.graphviz.layoutJson(n);let i=Bx(r,e);if(e.manualLayout){const s=$J(i,e.manualLayout);if(s.diagram)i=s.diagram;else{if(s.relayout.nodes.length>0){const o=jx(e);if(o.hasEdgesWithCompounds)et.warn(`Manual layout for view ${e.id} is ignored, as edges with compounds are not supported`);else{o.applyManualLayout(s.relayout);const a=await this.graphviz.layoutJson(o.print());i=Bx(a,e)}}i.hasLayoutDrift=!0}}return n=n.split(`
1766
+ `).filter(s=>!(s.includes("margin")&&s.includes("50.1"))).join(`
1767
+ `),{dot:n,diagram:i}}async svg(e){let n=await this.dot(e);return n=n.split(`
1768
+ `).filter(r=>!(r.includes("margin")&&r.includes("50.1"))).join(`
1769
+ `),{svg:await this.graphviz.svg(n),dot:n}}async dot(e){let n=jx(e).print();if(Rg(e))return n;try{return await this.graphviz.unflatten(n)}catch(r){return et.warn(`Error during unflatten: ${e.id}`,r),n}}async layoutOverviewGraph(e){if(e.length===0)return Promise.resolve({nodes:[],edges:[],bounds:{x:0,y:0,width:10,height:10}});const n=M0.toDot(e),r=await this.graphviz.layoutJson(n);return FJ(r)}}const MJ=Np(1);let zJ=class cg{static _graphviz=null;graphviz(){return Promise.resolve().then(()=>cg._graphviz??=dg.load())}async attempt(e,n){return await MJ(async()=>{const r=et.withTag("graphviz-wasm");try{return await n()}catch(i){r.error(`FAILED GraphvizWasmAdapter: ${e}`,i),dg.unload(),cg._graphviz=null}r.warn("Retrying..."),await $D(50,300);try{return await n()}finally{dg.unload(),cg._graphviz=null}})}async unflatten(e){return await this.attempt(`unflatten
1770
+ ${e}`,async()=>(await this.graphviz()).unflatten(e,1,!1,3).replaceAll(/\t\[/g," [").replaceAll(/\t/g," "))}async acyclic(e){return await this.attempt(`acyclic
1771
+ ${e}`,async()=>{const n=(await this.graphviz()).acyclic(e,!0);return n.acyclic&&n.outFile||e})}async layoutJson(e){return await this.attempt(`dot
1772
+ ${e}`,async()=>(await this.graphviz()).layout(e,"json",void 0,{yInvert:!0}))}async svg(e){return await this.attempt(`svg
1773
+ ${e}`,async()=>(await this.graphviz()).layout(e,"svg"))}};function er(t){if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)}const wb=(t,e)=>{const n=Ux(t);if(typeof n!="string")throw new TypeError(`${e} must be a string or a file URL: ${n}.`);return n},Ux=t=>t instanceof URL?lg(t):t,Gx=(t,e=[],n={})=>{const r=wb(t,"First argument"),[i,s]=er(e)?[[],e]:[e,n];if(!Array.isArray(i))throw new TypeError(`Second argument must be either an array of arguments or an options object: ${i}`);if(i.some(c=>typeof c=="object"&&c!==null))throw new TypeError(`Second argument must be an array of strings: ${i}`);const o=i.map(String),a=o.find(c=>c.includes("\0"));if(a!==void 0)throw new TypeError(`Arguments cannot contain null bytes ("\\0"): ${a}`);if(!er(s))throw new TypeError(`Last argument must be an options object: ${s}`);return[r,o,s]},{toString:Wx}=Object.prototype,BJ=t=>Wx.call(t)==="[object ArrayBuffer]",Dr=t=>Wx.call(t)==="[object Uint8Array]",Jl=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),qJ=new TextEncoder,Hx=t=>qJ.encode(t),jJ=new TextDecoder,Vx=t=>jJ.decode(t),UJ=(t,e)=>GJ(t,e).join(""),GJ=(t,e)=>{if(e==="utf8"&&t.every(s=>typeof s=="string"))return t;const n=new H0(e),r=t.map(s=>typeof s=="string"?Hx(s):s).map(s=>n.write(s)),i=n.end();return i===""?r:[...r,i]},bb=t=>t.length===1&&Dr(t[0])?t[0]:Kx(WJ(t)),WJ=t=>t.map(e=>typeof e=="string"?Hx(e):e),Kx=t=>{const e=new Uint8Array(HJ(t));let n=0;for(const r of t)e.set(r,n),n+=r.length;return e},HJ=t=>{let e=0;for(const n of t)e+=n.length;return e},VJ=t=>Array.isArray(t)&&Array.isArray(t.raw),KJ=(t,e)=>{let n=[];for(const[s,o]of t.entries())n=YJ({templates:t,expressions:e,tokens:n,index:s,template:o});if(n.length===0)throw new TypeError("Template script must not be empty");const[r,...i]=n;return[r,i,{}]},YJ=({templates:t,expressions:e,tokens:n,index:r,template:i})=>{if(i===void 0)throw new TypeError(`Invalid backslash sequence: ${t.raw[r]}`);const{nextTokens:s,leadingWhitespaces:o,trailingWhitespaces:a}=XJ(i,t.raw[r]),c=Xx(n,s,o);if(r===e.length)return c;const u=e[r],l=Array.isArray(u)?u.map(d=>Jx(d)):[Jx(u)];return Xx(c,l,a)},XJ=(t,e)=>{if(e.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};const n=[];let r=0;const i=Yx.has(e[0]);for(let o=0,a=0;o<t.length;o+=1,a+=1){const c=e[a];if(Yx.has(c))r!==o&&n.push(t.slice(r,o)),r=o+1;else if(c==="\\"){const u=e[a+1];u==="u"&&e[a+2]==="{"?a=e.indexOf("}",a+3):a+=JJ[u]??1}}const s=r===t.length;return s||n.push(t.slice(r)),{nextTokens:n,leadingWhitespaces:i,trailingWhitespaces:s}},Yx=new Set([" "," ","\r",`
1774
+ `]),JJ={x:3,u:5},Xx=(t,e,n)=>n||t.length===0||e.length===0?[...t,...e]:[...t.slice(0,-1),`${t.at(-1)}${e[0]}`,...e.slice(1)],Jx=t=>{const e=typeof t;if(e==="string")return t;if(e==="number")return String(t);if(er(t)&&("stdout"in t||"isMaxBuffer"in t))return ZJ(t);throw t instanceof W0||Object.prototype.toString.call(t)==="[object Promise]"?new TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}."):new TypeError(`Unexpected "${e}" in template expression`)},ZJ=({stdout:t})=>{if(typeof t=="string")return t;if(Dr(t))return Vx(t);throw t===void 0?new TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`):new TypeError(`Unexpected "${typeof t}" stdout in template expression`)},fo=t=>Eb.includes(t),Eb=[Ne.stdin,Ne.stdout,Ne.stderr],Kr=["stdin","stdout","stderr"],Zx=t=>Kr[t]??`stdio[${t}]`,QJ=t=>{const e={...t};for(const n of nI)e[n]=Qx(t,n);return e},Qx=(t,e)=>{const n=Array.from({length:eZ(t)+1}),r=tZ(t[e],n,e);return oZ(r,e)},eZ=({stdio:t})=>Array.isArray(t)?Math.max(t.length,Kr.length):Kr.length,tZ=(t,e,n)=>er(t)?nZ(t,e,n):e.fill(t),nZ=(t,e,n)=>{for(const r of Object.keys(t).sort(rZ))for(const i of iZ(r,n,e))e[i]=t[r];return e},rZ=(t,e)=>eI(t)<eI(e)?1:-1,eI=t=>t==="stdout"||t==="stderr"?0:t==="all"?2:1,iZ=(t,e,n)=>{if(t==="ipc")return[n.length-1];const r=tI(t);if(r===void 0||r===0)throw new TypeError(`"${e}.${t}" is invalid.
1775
+ It must be "${e}.stdout", "${e}.stderr", "${e}.all", "${e}.ipc", or "${e}.fd3", "${e}.fd4" (and so on).`);if(r>=n.length)throw new TypeError(`"${e}.${t}" is invalid: that file descriptor does not exist.
1776
+ Please set the "stdio" option to ensure that file descriptor exists.`);return r==="all"?[1,2]:[r]},tI=t=>{if(t==="all")return t;if(Kr.includes(t))return Kr.indexOf(t);const e=sZ.exec(t);if(e!==null)return Number(e[1])},sZ=/^fd(\d+)$/,oZ=(t,e)=>t.map(n=>n===void 0?cZ[e]:n),aZ=yO("execa").enabled?"full":"none",cZ={lines:!1,buffer:!0,maxBuffer:1e3*1e3*100,verbose:aZ,stripFinalNewline:!0},nI=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],Zl=(t,e)=>e==="ipc"?t.at(-1):t[e],Db=({verbose:t},e)=>Rb(t,e)!=="none",Tb=({verbose:t},e)=>!["none","short"].includes(Rb(t,e)),uZ=({verbose:t},e)=>{const n=Rb(t,e);return Sb(n)?n:void 0},Rb=(t,e)=>e===void 0?lZ(t):Zl(t,e),lZ=t=>t.find(e=>Sb(e))??kb.findLast(e=>t.includes(e)),Sb=t=>typeof t=="function",kb=["none","short","full"],dZ=(t,e)=>{const n=[t,...e],r=n.join(" "),i=n.map(s=>yZ(rI(s))).join(" ");return{command:r,escapedCommand:i}},$b=t=>vO(t).split(`
1777
+ `).map(e=>rI(e)).join(`
1778
+ `),rI=t=>t.replaceAll(pZ,e=>fZ(e)),fZ=t=>{const e=gZ[t];if(e!==void 0)return e;const n=t.codePointAt(0),r=n.toString(16);return n<=mZ?`\\u${r.padStart(4,"0")}`:`\\U${r}`},hZ=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},pZ=hZ(),gZ={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"},mZ=65535,yZ=t=>vZ.test(t)?t:EO==="win32"?`"${t.replaceAll('"','""')}"`:`'${t.replaceAll("'","'\\''")}'`,vZ=/^[\w./-]+$/;function wZ(){return Ne.platform!=="win32"?Ne.env.TERM!=="linux":!!Ne.env.WT_SESSION||!!Ne.env.TERMINUS_SUBLIME||Ne.env.ConEmuTask==="{cmd::Cmder}"||Ne.env.TERM_PROGRAM==="Terminus-Sublime"||Ne.env.TERM_PROGRAM==="vscode"||Ne.env.TERM==="xterm-256color"||Ne.env.TERM==="alacritty"||Ne.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}const iI={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"\u2588",squareDarkShade:"\u2593",squareMediumShade:"\u2592",squareLightShade:"\u2591",squareTop:"\u2580",squareBottom:"\u2584",squareLeft:"\u258C",squareRight:"\u2590",squareCenter:"\u25A0",bullet:"\u25CF",dot:"\u2024",ellipsis:"\u2026",pointerSmall:"\u203A",triangleUp:"\u25B2",triangleUpSmall:"\u25B4",triangleDown:"\u25BC",triangleDownSmall:"\u25BE",triangleLeftSmall:"\u25C2",triangleRightSmall:"\u25B8",home:"\u2302",heart:"\u2665",musicNote:"\u266A",musicNoteBeamed:"\u266B",arrowUp:"\u2191",arrowDown:"\u2193",arrowLeft:"\u2190",arrowRight:"\u2192",arrowLeftRight:"\u2194",arrowUpDown:"\u2195",almostEqual:"\u2248",notEqual:"\u2260",lessOrEqual:"\u2264",greaterOrEqual:"\u2265",identical:"\u2261",infinity:"\u221E",subscriptZero:"\u2080",subscriptOne:"\u2081",subscriptTwo:"\u2082",subscriptThree:"\u2083",subscriptFour:"\u2084",subscriptFive:"\u2085",subscriptSix:"\u2086",subscriptSeven:"\u2087",subscriptEight:"\u2088",subscriptNine:"\u2089",oneHalf:"\xBD",oneThird:"\u2153",oneQuarter:"\xBC",oneFifth:"\u2155",oneSixth:"\u2159",oneEighth:"\u215B",twoThirds:"\u2154",twoFifths:"\u2156",threeQuarters:"\xBE",threeFifths:"\u2157",threeEighths:"\u215C",fourFifths:"\u2158",fiveSixths:"\u215A",fiveEighths:"\u215D",sevenEighths:"\u215E",line:"\u2500",lineBold:"\u2501",lineDouble:"\u2550",lineDashed0:"\u2504",lineDashed1:"\u2505",lineDashed2:"\u2508",lineDashed3:"\u2509",lineDashed4:"\u254C",lineDashed5:"\u254D",lineDashed6:"\u2574",lineDashed7:"\u2576",lineDashed8:"\u2578",lineDashed9:"\u257A",lineDashed10:"\u257C",lineDashed11:"\u257E",lineDashed12:"\u2212",lineDashed13:"\u2013",lineDashed14:"\u2010",lineDashed15:"\u2043",lineVertical:"\u2502",lineVerticalBold:"\u2503",lineVerticalDouble:"\u2551",lineVerticalDashed0:"\u2506",lineVerticalDashed1:"\u2507",lineVerticalDashed2:"\u250A",lineVerticalDashed3:"\u250B",lineVerticalDashed4:"\u254E",lineVerticalDashed5:"\u254F",lineVerticalDashed6:"\u2575",lineVerticalDashed7:"\u2577",lineVerticalDashed8:"\u2579",lineVerticalDashed9:"\u257B",lineVerticalDashed10:"\u257D",lineVerticalDashed11:"\u257F",lineDownLeft:"\u2510",lineDownLeftArc:"\u256E",lineDownBoldLeftBold:"\u2513",lineDownBoldLeft:"\u2512",lineDownLeftBold:"\u2511",lineDownDoubleLeftDouble:"\u2557",lineDownDoubleLeft:"\u2556",lineDownLeftDouble:"\u2555",lineDownRight:"\u250C",lineDownRightArc:"\u256D",lineDownBoldRightBold:"\u250F",lineDownBoldRight:"\u250E",lineDownRightBold:"\u250D",lineDownDoubleRightDouble:"\u2554",lineDownDoubleRight:"\u2553",lineDownRightDouble:"\u2552",lineUpLeft:"\u2518",lineUpLeftArc:"\u256F",lineUpBoldLeftBold:"\u251B",lineUpBoldLeft:"\u251A",lineUpLeftBold:"\u2519",lineUpDoubleLeftDouble:"\u255D",lineUpDoubleLeft:"\u255C",lineUpLeftDouble:"\u255B",lineUpRight:"\u2514",lineUpRightArc:"\u2570",lineUpBoldRightBold:"\u2517",lineUpBoldRight:"\u2516",lineUpRightBold:"\u2515",lineUpDoubleRightDouble:"\u255A",lineUpDoubleRight:"\u2559",lineUpRightDouble:"\u2558",lineUpDownLeft:"\u2524",lineUpBoldDownBoldLeftBold:"\u252B",lineUpBoldDownBoldLeft:"\u2528",lineUpDownLeftBold:"\u2525",lineUpBoldDownLeftBold:"\u2529",lineUpDownBoldLeftBold:"\u252A",lineUpDownBoldLeft:"\u2527",lineUpBoldDownLeft:"\u2526",lineUpDoubleDownDoubleLeftDouble:"\u2563",lineUpDoubleDownDoubleLeft:"\u2562",lineUpDownLeftDouble:"\u2561",lineUpDownRight:"\u251C",lineUpBoldDownBoldRightBold:"\u2523",lineUpBoldDownBoldRight:"\u2520",lineUpDownRightBold:"\u251D",lineUpBoldDownRightBold:"\u2521",lineUpDownBoldRightBold:"\u2522",lineUpDownBoldRight:"\u251F",lineUpBoldDownRight:"\u251E",lineUpDoubleDownDoubleRightDouble:"\u2560",lineUpDoubleDownDoubleRight:"\u255F",lineUpDownRightDouble:"\u255E",lineDownLeftRight:"\u252C",lineDownBoldLeftBoldRightBold:"\u2533",lineDownLeftBoldRightBold:"\u252F",lineDownBoldLeftRight:"\u2530",lineDownBoldLeftBoldRight:"\u2531",lineDownBoldLeftRightBold:"\u2532",lineDownLeftRightBold:"\u252E",lineDownLeftBoldRight:"\u252D",lineDownDoubleLeftDoubleRightDouble:"\u2566",lineDownDoubleLeftRight:"\u2565",lineDownLeftDoubleRightDouble:"\u2564",lineUpLeftRight:"\u2534",lineUpBoldLeftBoldRightBold:"\u253B",lineUpLeftBoldRightBold:"\u2537",lineUpBoldLeftRight:"\u2538",lineUpBoldLeftBoldRight:"\u2539",lineUpBoldLeftRightBold:"\u253A",lineUpLeftRightBold:"\u2536",lineUpLeftBoldRight:"\u2535",lineUpDoubleLeftDoubleRightDouble:"\u2569",lineUpDoubleLeftRight:"\u2568",lineUpLeftDoubleRightDouble:"\u2567",lineUpDownLeftRight:"\u253C",lineUpBoldDownBoldLeftBoldRightBold:"\u254B",lineUpDownBoldLeftBoldRightBold:"\u2548",lineUpBoldDownLeftBoldRightBold:"\u2547",lineUpBoldDownBoldLeftRightBold:"\u254A",lineUpBoldDownBoldLeftBoldRight:"\u2549",lineUpBoldDownLeftRight:"\u2540",lineUpDownBoldLeftRight:"\u2541",lineUpDownLeftBoldRight:"\u253D",lineUpDownLeftRightBold:"\u253E",lineUpBoldDownBoldLeftRight:"\u2542",lineUpDownLeftBoldRightBold:"\u253F",lineUpBoldDownLeftBoldRight:"\u2543",lineUpBoldDownLeftRightBold:"\u2544",lineUpDownBoldLeftBoldRight:"\u2545",lineUpDownBoldLeftRightBold:"\u2546",lineUpDoubleDownDoubleLeftDoubleRightDouble:"\u256C",lineUpDoubleDownDoubleLeftRight:"\u256B",lineUpDownLeftDoubleRightDouble:"\u256A",lineCross:"\u2573",lineBackslash:"\u2572",lineSlash:"\u2571"},bZ={tick:"\u2714",info:"\u2139",warning:"\u26A0",cross:"\u2718",squareSmall:"\u25FB",squareSmallFilled:"\u25FC",circle:"\u25EF",circleFilled:"\u25C9",circleDotted:"\u25CC",circleDouble:"\u25CE",circleCircle:"\u24DE",circleCross:"\u24E7",circlePipe:"\u24BE",radioOn:"\u25C9",radioOff:"\u25EF",checkboxOn:"\u2612",checkboxOff:"\u2610",checkboxCircleOn:"\u24E7",checkboxCircleOff:"\u24BE",pointer:"\u276F",triangleUpOutline:"\u25B3",triangleLeft:"\u25C0",triangleRight:"\u25B6",lozenge:"\u25C6",lozengeOutline:"\u25C7",hamburger:"\u2630",smiley:"\u32E1",mustache:"\u0DF4",star:"\u2605",play:"\u25B6",nodejs:"\u2B22",oneSeventh:"\u2150",oneNinth:"\u2151",oneTenth:"\u2152"},EZ={tick:"\u221A",info:"i",warning:"\u203C",cross:"\xD7",squareSmall:"\u25A1",squareSmallFilled:"\u25A0",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(\u25CB)",circleCross:"(\xD7)",circlePipe:"(\u2502)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[\xD7]",checkboxOff:"[ ]",checkboxCircleOn:"(\xD7)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"\u2206",triangleLeft:"\u25C4",triangleRight:"\u25BA",lozenge:"\u2666",lozengeOutline:"\u25CA",hamburger:"\u2261",smiley:"\u263A",mustache:"\u250C\u2500\u2510",star:"\u2736",play:"\u25BA",nodejs:"\u2666",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},DZ={...iI,...bZ},TZ={...iI,...EZ},RZ=wZ(),Cb=RZ?DZ:TZ,SZ=G0.WriteStream.prototype.hasColors(),zp=(t,e)=>{if(!SZ)return i=>i;const n=`\x1B[${t}m`,r=`\x1B[${e}m`;return i=>{const s=i+"";let o=s.indexOf(r);if(o===-1)return n+s+r;let a=n,c=0;for(;o!==-1;)a+=s.slice(c,o)+n,c=o+r.length,o=s.indexOf(r,c);return a+=s.slice(c)+r,a}},kZ=zp(1,22),_b=zp(90,39),$Z=zp(91,39),CZ=zp(93,39),_Z=({type:t,message:e,timestamp:n,piped:r,commandId:i,result:{failed:s=!1}={},options:{reject:o=!0}})=>{const a=AZ(n),c=xZ[t]({failed:s,reject:o,piped:r}),u=IZ[t]({reject:o});return`${_b(`[${a}]`)} ${_b(`[${i}]`)} ${u(c)} ${u(e)}`},AZ=t=>`${Bp(t.getHours(),2)}:${Bp(t.getMinutes(),2)}:${Bp(t.getSeconds(),2)}.${Bp(t.getMilliseconds(),3)}`,Bp=(t,e)=>String(t).padStart(e,"0"),sI=({failed:t,reject:e})=>t?e?Cb.cross:Cb.warning:Cb.tick,xZ={command:({piped:t})=>t?"|":"$",output:()=>" ",ipc:()=>"*",error:sI,duration:sI},oI=t=>t,IZ={command:()=>kZ,output:()=>oI,ipc:()=>oI,error:({reject:t})=>t?$Z:CZ,duration:()=>_b},PZ=(t,e,n)=>{const r=uZ(e,n);return t.map(({verboseLine:i,verboseObject:s})=>NZ(i,s,r)).filter(i=>i!==void 0).map(i=>OZ(i)).join("")},NZ=(t,e,n)=>{if(n===void 0)return t;const r=n(t,e);if(typeof r=="string")return r},OZ=t=>t.endsWith(`
1779
+ `)?t:`${t}
1780
+ `,Ql=({type:t,verboseMessage:e,fdNumber:n,verboseInfo:r,result:i})=>{const s=FZ({type:t,result:i,verboseInfo:r}),o=LZ(e,s),a=PZ(o,r,n);B0(zZ,a)},FZ=({type:t,result:e,verboseInfo:{escapedCommand:n,commandId:r,rawOptions:{piped:i=!1,...s}}})=>({type:t,escapedCommand:n,commandId:`${r}`,timestamp:new Date,piped:i,result:e,options:s}),LZ=(t,e)=>t.split(`
1781
+ `).map(n=>MZ({...e,message:n})),MZ=t=>({verboseLine:_Z(t),verboseObject:t}),zZ=2,aI=t=>{const e=typeof t=="string"?t:U0(t);return $b(e).replaceAll(" "," ".repeat(BZ))},BZ=2,qZ=(t,e)=>{Db(e)&&Ql({type:"command",verboseMessage:t,verboseInfo:e})},jZ=(t,e,n)=>{WZ(t);const r=UZ(t);return{verbose:t,escapedCommand:e,commandId:r,rawOptions:n}},UZ=t=>Db({verbose:t})?GZ++:void 0;let GZ=0n;const WZ=t=>{for(const e of t){if(e===!1)throw new TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(e===!0)throw new TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!kb.includes(e)&&!Sb(e)){const n=kb.map(r=>`'${r}'`).join(", ");throw new TypeError(`The "verbose" option must not be ${e}. Allowed values are: ${n} or a function.`)}}},cI=()=>ld.bigint(),uI=t=>Number(ld.bigint()-t)/1e6,lI=(t,e,n)=>{const r=cI(),{command:i,escapedCommand:s}=dZ(t,e),o=Qx(n,"verbose"),a=jZ(o,s,{...n});return qZ(s,a),{command:i,escapedCommand:s,startTime:r,verboseInfo:a}};var ho={exports:{}},Ab,dI;function HZ(){if(dI)return Ab;dI=1,Ab=r,r.sync=i;var t=ch;function e(s,o){var a=o.pathExt!==void 0?o.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var c=0;c<a.length;c++){var u=a[c].toLowerCase();if(u&&s.substr(-u.length).toLowerCase()===u)return!0}return!1}function n(s,o,a){return!s.isSymbolicLink()&&!s.isFile()?!1:e(o,a)}function r(s,o,a){t.stat(s,function(c,u){a(c,c?!1:n(u,s,o))})}function i(s,o){return n(t.statSync(s),s,o)}return Ab}var xb,fI;function VZ(){if(fI)return xb;fI=1,xb=e,e.sync=n;var t=ch;function e(s,o,a){t.stat(s,function(c,u){a(c,c?!1:r(u,o))})}function n(s,o){return r(t.statSync(s),o)}function r(s,o){return s.isFile()&&i(s,o)}function i(s,o){var a=s.mode,c=s.uid,u=s.gid,l=o.uid!==void 0?o.uid:process.getuid&&process.getuid(),d=o.gid!==void 0?o.gid:process.getgid&&process.getgid(),f=parseInt("100",8),h=parseInt("010",8),p=parseInt("001",8),g=f|h,y=a&p||a&h&&u===d||a&f&&c===l||a&g&&l===0;return y}return xb}var Ib,hI;function KZ(){if(hI)return Ib;hI=1;var t;process.platform==="win32"||U3.TESTING_WINDOWS?t=HZ():t=VZ(),Ib=e,e.sync=n;function e(r,i,s){if(typeof i=="function"&&(s=i,i={}),!s){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(o,a){e(r,i||{},function(c,u){c?a(c):o(u)})})}t(r,i||{},function(o,a){o&&(o.code==="EACCES"||i&&i.ignoreErrors)&&(o=null,a=!1),s(o,a)})}function n(r,i){try{return t.sync(r,i||{})}catch(s){if(i&&i.ignoreErrors||s.code==="EACCES")return!1;throw s}}return Ib}var Pb,pI;function YZ(){if(pI)return Pb;pI=1;const t=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",e=su,n=t?";":":",r=KZ(),i=c=>Object.assign(new Error(`not found: ${c}`),{code:"ENOENT"}),s=(c,u)=>{const l=u.colon||n,d=c.match(/\//)||t&&c.match(/\\/)?[""]:[...t?[process.cwd()]:[],...(u.path||process.env.PATH||"").split(l)],f=t?u.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",h=t?f.split(l):[""];return t&&c.indexOf(".")!==-1&&h[0]!==""&&h.unshift(""),{pathEnv:d,pathExt:h,pathExtExe:f}},o=(c,u,l)=>{typeof u=="function"&&(l=u,u={}),u||(u={});const{pathEnv:d,pathExt:f,pathExtExe:h}=s(c,u),p=[],g=m=>new Promise((w,E)=>{if(m===d.length)return u.all&&p.length?w(p):E(i(c));const k=d[m],A=/^".*"$/.test(k)?k.slice(1,-1):k,I=e.join(A,c),x=!A&&/^\.[\\\/]/.test(c)?c.slice(0,2)+I:I;w(y(x,m,0))}),y=(m,w,E)=>new Promise((k,A)=>{if(E===f.length)return k(g(w+1));const I=f[E];r(m+I,{pathExt:h},(x,_)=>{if(!x&&_)if(u.all)p.push(m+I);else return k(m+I);return k(y(m,w,E+1))})});return l?g(0).then(m=>l(null,m),l):g(0)},a=(c,u)=>{u=u||{};const{pathEnv:l,pathExt:d,pathExtExe:f}=s(c,u),h=[];for(let p=0;p<l.length;p++){const g=l[p],y=/^".*"$/.test(g)?g.slice(1,-1):g,m=e.join(y,c),w=!y&&/^\.[\\\/]/.test(c)?c.slice(0,2)+m:m;for(let E=0;E<d.length;E++){const k=w+d[E];try{if(r.sync(k,{pathExt:f}))if(u.all)h.push(k);else return k}catch{}}}if(u.all&&h.length)return h;if(u.nothrow)return null;throw i(c)};return Pb=o,o.sync=a,Pb}var qp={exports:{}},gI;function XZ(){if(gI)return qp.exports;gI=1;const t=(e={})=>{const n=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(n).reverse().find(i=>i.toUpperCase()==="PATH")||"Path"};return qp.exports=t,qp.exports.default=t,qp.exports}var Nb,mI;function JZ(){if(mI)return Nb;mI=1;const t=su,e=YZ(),n=XZ();function r(s,o){const a=s.options.env||process.env,c=process.cwd(),u=s.options.cwd!=null,l=u&&process.chdir!==void 0&&!process.chdir.disabled;if(l)try{process.chdir(s.options.cwd)}catch{}let d;try{d=e.sync(s.command,{path:a[n({env:a})],pathExt:o?t.delimiter:void 0})}catch{}finally{l&&process.chdir(c)}return d&&(d=t.resolve(u?s.options.cwd:"",d)),d}function i(s){return r(s)||r(s,!0)}return Nb=i,Nb}var jp={},yI;function ZZ(){if(yI)return jp;yI=1;const t=/([()\][%!^"`<>&|;, *?])/g;function e(r){return r=r.replace(t,"^$1"),r}function n(r,i){return r=`${r}`,r=r.replace(/(\\*)"/g,'$1$1\\"'),r=r.replace(/(\\*)$/,"$1$1"),r=`"${r}"`,r=r.replace(t,"^$1"),i&&(r=r.replace(t,"^$1")),r}return jp.command=e,jp.argument=n,jp}var Ob,vI;function QZ(){return vI||(vI=1,Ob=/^#!(.*)/),Ob}var Fb,wI;function eQ(){if(wI)return Fb;wI=1;const t=QZ();return Fb=(e="")=>{const n=e.match(t);if(!n)return null;const[r,i]=n[0].replace(/#! ?/,"").split(" "),s=r.split("/").pop();return s==="env"?i:i?`${s} ${i}`:s},Fb}var Lb,bI;function tQ(){if(bI)return Lb;bI=1;const t=ch,e=eQ();function n(r){const s=Buffer.alloc(150);let o;try{o=t.openSync(r,"r"),t.readSync(o,s,0,150,0),t.closeSync(o)}catch{}return e(s.toString())}return Lb=n,Lb}var Mb,EI;function nQ(){if(EI)return Mb;EI=1;const t=su,e=JZ(),n=ZZ(),r=tQ(),i=process.platform==="win32",s=/\.(?:com|exe)$/i,o=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function a(l){l.file=e(l);const d=l.file&&r(l.file);return d?(l.args.unshift(l.file),l.command=d,e(l)):l.file}function c(l){if(!i)return l;const d=a(l),f=!s.test(d);if(l.options.forceShell||f){const h=o.test(d);l.command=t.normalize(l.command),l.command=n.command(l.command),l.args=l.args.map(g=>n.argument(g,h));const p=[l.command].concat(l.args).join(" ");l.args=["/d","/s","/c",`"${p}"`],l.command=process.env.comspec||"cmd.exe",l.options.windowsVerbatimArguments=!0}return l}function u(l,d,f){d&&!Array.isArray(d)&&(f=d,d=null),d=d?d.slice(0):[],f=Object.assign({},f);const h={command:l,args:d,options:f,file:void 0,original:{command:l,args:d}};return f.shell?h:c(h)}return Mb=u,Mb}var zb,DI;function rQ(){if(DI)return zb;DI=1;const t=process.platform==="win32";function e(s,o){return Object.assign(new Error(`${o} ${s.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${o} ${s.command}`,path:s.command,spawnargs:s.args})}function n(s,o){if(!t)return;const a=s.emit;s.emit=function(c,u){if(c==="exit"){const l=r(u,o);if(l)return a.call(s,"error",l)}return a.apply(s,arguments)}}function r(s,o){return t&&s===1&&!o.file?e(o.original,"spawn"):null}function i(s,o){return t&&s===1&&!o.file?e(o.original,"spawnSync"):null}return zb={hookChildProcess:n,verifyENOENT:r,verifyENOENTSync:i,notFoundError:e},zb}var TI;function iQ(){if(TI)return ho.exports;TI=1;const t=J$,e=nQ(),n=rQ();function r(s,o,a){const c=e(s,o,a),u=t.spawn(c.command,c.args,c.options);return n.hookChildProcess(u,c),u}function i(s,o,a){const c=e(s,o,a),u=t.spawnSync(c.command,c.args,c.options);return u.error=u.error||n.verifyENOENTSync(u.status,c),u}return ho.exports=r,ho.exports.spawn=r,ho.exports.sync=i,ho.exports._parse=e,ho.exports._enoent=n,ho.exports}var sQ=iQ();function RI(t={}){const{env:e=process.env,platform:n=process.platform}=t;return n!=="win32"?"PATH":Object.keys(e).reverse().find(r=>r.toUpperCase()==="PATH")||"Path"}const oQ=({cwd:t=Ne.cwd(),path:e=Ne.env[RI()],preferLocal:n=!0,execPath:r=Ne.execPath,addExecPath:i=!0}={})=>{const s=t instanceof URL?lg(t):t,o=Zr.resolve(s),a=[];return n&&aQ(a,o),i&&cQ(a,r,o),[...a,e].join(Zr.delimiter)},aQ=(t,e)=>{let n;for(;n!==e;)t.push(Zr.join(e,"node_modules/.bin")),n=e,e=Zr.resolve(e,"..")},cQ=(t,e,n)=>{const r=e instanceof URL?lg(e):e;t.push(Zr.resolve(n,r,".."))},uQ=({env:t=Ne.env,...e}={})=>{t={...t};const n=RI({env:t});return e.path=t[n],t[n]=oQ(e),t},lQ=(t,e,n)=>{const r=n?jb:qb,i=t instanceof ed?{}:{cause:t};return new r(e,i)};class ed extends Error{}const SI=(t,e)=>{Object.defineProperty(t.prototype,"name",{value:e,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,kI,{value:!0,writable:!1,enumerable:!1,configurable:!1})},dQ=t=>Bb(t)&&kI in t,kI=Symbol("isExecaError"),Bb=t=>Object.prototype.toString.call(t)==="[object Error]";class qb extends Error{}SI(qb,qb.name);class jb extends Error{}SI(jb,jb.name);const fQ=()=>{const t=CI-$I+1;return Array.from({length:t},hQ)},hQ=(t,e)=>({name:`SIGRT${e+1}`,number:$I+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),$I=34,CI=64,pQ=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}],_I=()=>{const t=fQ();return[...pQ,...t].map(gQ)},gQ=({name:t,number:e,description:n,action:r,forced:i=!1,standard:s})=>{const{signals:{[t]:o}}=bs,a=o!==void 0;return{name:t,number:a?o:e,description:n,supported:a,action:r,forced:i,standard:s}},mQ=()=>{const t=_I();return Object.fromEntries(t.map(yQ))},yQ=({name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o})=>[t,{name:t,number:e,description:n,supported:r,action:i,forced:s,standard:o}],vQ=mQ(),wQ=()=>{const t=_I(),e=CI+1,n=Array.from({length:e},(r,i)=>bQ(i,t));return Object.assign({},...n)},bQ=(t,e)=>{const n=EQ(t,e);if(n===void 0)return{};const{name:r,description:i,supported:s,action:o,forced:a,standard:c}=n;return{[t]:{name:r,number:t,description:i,supported:s,action:o,forced:a,standard:c}}},EQ=(t,e)=>{const n=e.find(({name:r})=>bs.signals[r]===t);return n!==void 0?n:e.find(r=>r.number===t)};wQ();const DQ=t=>{const e="option `killSignal`";if(t===0)throw new TypeError(`Invalid ${e}: 0 cannot be used.`);return AI(t,e)},TQ=t=>t===0?t:AI(t,"`subprocess.kill()`'s argument"),AI=(t,e)=>{if(Number.isInteger(t))return RQ(t,e);if(typeof t=="string")return kQ(t,e);throw new TypeError(`Invalid ${e} ${String(t)}: it must be a string or an integer.
1782
+ ${Ub()}`)},RQ=(t,e)=>{if(xI.has(t))return xI.get(t);throw new TypeError(`Invalid ${e} ${t}: this signal integer does not exist.
1783
+ ${Ub()}`)},SQ=()=>new Map(Object.entries(bs.signals).reverse().map(([t,e])=>[e,t])),xI=SQ(),kQ=(t,e)=>{if(t in bs.signals)return t;throw t.toUpperCase()in bs.signals?new TypeError(`Invalid ${e} '${t}': please rename it to '${t.toUpperCase()}'.`):new TypeError(`Invalid ${e} '${t}': this signal name does not exist.
1784
+ ${Ub()}`)},Ub=()=>`Available signal names: ${$Q()}.
1785
+ Available signal numbers: ${CQ()}.`,$Q=()=>Object.keys(bs.signals).sort().map(t=>`'${t}'`).join(", "),CQ=()=>[...new Set(Object.values(bs.signals).sort((t,e)=>t-e))].join(", "),II=t=>vQ[t].description,_Q=t=>{if(t===!1)return t;if(t===!0)return AQ;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t},AQ=1e3*5,xQ=({kill:t,options:{forceKillAfterDelay:e,killSignal:n},onInternalError:r,context:i,controller:s},o,a)=>{const{signal:c,error:u}=IQ(o,a,n);PQ(u,r);const l=t(c);return NQ({kill:t,signal:c,forceKillAfterDelay:e,killSignal:n,killResult:l,context:i,controller:s}),l},IQ=(t,e,n)=>{const[r=n,i]=Bb(t)?[void 0,t]:[t,e];if(typeof r!="string"&&!Number.isInteger(r))throw new TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(r)}`);if(i!==void 0&&!Bb(i))throw new TypeError(`The second argument is optional. If specified, it must be an error instance: ${i}`);return{signal:TQ(r),error:i}},PQ=(t,e)=>{t!==void 0&&e.reject(t)},NQ=async({kill:t,signal:e,forceKillAfterDelay:n,killSignal:r,killResult:i,context:s,controller:o})=>{e===r&&i&&PI({kill:t,forceKillAfterDelay:n,context:s,controllerSignal:o.signal})},PI=async({kill:t,forceKillAfterDelay:e,context:n,controllerSignal:r})=>{if(e!==!1)try{await V0(e,void 0,{signal:r}),t("SIGKILL")&&(n.isForcefullyTerminated??=!0)}catch{}},NI=async(t,e)=>{t.aborted||await vn(t,"abort",{signal:e})},OQ=({cancelSignal:t})=>{if(t!==void 0&&Object.prototype.toString.call(t)!=="[object AbortSignal]")throw new Error(`The \`cancelSignal\` option must be an AbortSignal: ${String(t)}`)},FQ=({subprocess:t,cancelSignal:e,gracefulCancel:n,context:r,controller:i})=>e===void 0||n?[]:[LQ(t,e,r,i)],LQ=async(t,e,n,{signal:r})=>{throw await NI(e,r),n.terminationReason??="cancel",t.kill(),e.reason},Gb=({methodName:t,isSubprocess:e,ipc:n,isConnected:r})=>{MQ(t,e,n),OI(t,e,r)},MQ=(t,e,n)=>{if(!n)throw new Error(`${Tr(t,e)} can only be used if the \`ipc\` option is \`true\`.`)},OI=(t,e,n)=>{if(!n)throw new Error(`${Tr(t,e)} cannot be used: the ${us(e)} has already exited or disconnected.`)},zQ=t=>{throw new Error(`${Tr("getOneMessage",t)} could not complete: the ${us(t)} exited or disconnected.`)},BQ=t=>{throw new Error(`${Tr("sendMessage",t)} failed: the ${us(t)} is sending a message too, instead of listening to incoming messages.
1786
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
1787
+
1788
+ const [receivedMessage] = await Promise.all([
1789
+ ${Tr("getOneMessage",t)},
1790
+ ${Tr("sendMessage",t,"message, {strict: true}")},
1791
+ ]);`)},FI=(t,e)=>new Error(`${Tr("sendMessage",e)} failed when sending an acknowledgment response to the ${us(e)}.`,{cause:t}),qQ=t=>{throw new Error(`${Tr("sendMessage",t)} failed: the ${us(t)} is not listening to incoming messages.`)},jQ=t=>{throw new Error(`${Tr("sendMessage",t)} failed: the ${us(t)} exited without listening to incoming messages.`)},UQ=()=>new Error(`\`cancelSignal\` aborted: the ${us(!0)} disconnected.`),GQ=()=>{throw new Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},WQ=({error:t,methodName:e,isSubprocess:n})=>{if(t.code==="EPIPE")throw new Error(`${Tr(e,n)} cannot be used: the ${us(n)} is disconnecting.`,{cause:t})},HQ=({error:t,methodName:e,isSubprocess:n,message:r})=>{if(VQ(t))throw new Error(`${Tr(e,n)}'s argument type is invalid: the message cannot be serialized: ${String(r)}.`,{cause:t})},VQ=({code:t,message:e})=>KQ.has(t)||YQ.some(n=>e.includes(n)),KQ=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),YQ=["could not be cloned","circular structure","call stack size exceeded"],Tr=(t,e,n="")=>t==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${XQ(e)}${t}(${n})`,XQ=t=>t?"":"subprocess.",us=t=>t?"parent process":"subprocess",Wb=t=>{t.connected&&t.disconnect()},td=()=>{const t={},e=new Promise((n,r)=>{Object.assign(t,{resolve:n,reject:r})});return Object.assign(e,t)},LI=(t,e="stdin")=>{const{options:r,fileDescriptors:i}=po.get(t),s=MI(i,e,!0),o=t.stdio[s];if(o===null)throw new TypeError(zI(s,e,r,!0));return o},Hb=(t,e="stdout")=>{const{options:r,fileDescriptors:i}=po.get(t),s=MI(i,e,!1),o=s==="all"?t.all:t.stdio[s];if(o==null)throw new TypeError(zI(s,e,r,!1));return o},po=new WeakMap,MI=(t,e,n)=>{const r=JQ(e,n);return ZQ(r,e,n,t),r},JQ=(t,e)=>{const n=tI(t);if(n!==void 0)return n;const{validOptions:r,defaultValue:i}=e?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw new TypeError(`"${nd(e)}" must not be "${t}".
1792
+ It must be ${r} or "fd3", "fd4" (and so on).
1793
+ It is optional and defaults to "${i}".`)},ZQ=(t,e,n,r)=>{const i=r[BI(t)];if(i===void 0)throw new TypeError(`"${nd(n)}" must not be ${e}. That file descriptor does not exist.
1794
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(i.direction==="input"&&!n)throw new TypeError(`"${nd(n)}" must not be ${e}. It must be a readable stream, not writable.`);if(i.direction!=="input"&&n)throw new TypeError(`"${nd(n)}" must not be ${e}. It must be a writable stream, not readable.`)},zI=(t,e,n,r)=>{if(t==="all"&&!n.all)return`The "all" option must be true to use "from: 'all'".`;const{optionName:i,optionValue:s}=QQ(t,n);return`The "${i}: ${Vb(s)}" option is incompatible with using "${nd(r)}: ${Vb(e)}".
1795
+ Please set this option with "pipe" instead.`},QQ=(t,{stdin:e,stdout:n,stderr:r,stdio:i})=>{const s=BI(t);return s===0&&e!==void 0?{optionName:"stdin",optionValue:e}:s===1&&n!==void 0?{optionName:"stdout",optionValue:n}:s===2&&r!==void 0?{optionName:"stderr",optionValue:r}:{optionName:`stdio[${s}]`,optionValue:i[s]}},BI=t=>t==="all"?1:t,nd=t=>t?"to":"from",Vb=t=>typeof t=="string"?`'${t}'`:typeof t=="number"?`${t}`:"Stream",Up=(t,e,n)=>{const r=t.getMaxListeners();r===0||r===Number.POSITIVE_INFINITY||(t.setMaxListeners(r+e),Y0(n,()=>{t.setMaxListeners(t.getMaxListeners()-e)}))},qI=(t,e)=>{e&&Kb(t)},Kb=t=>{t.refCounted()},jI=(t,e)=>{e&&Yb(t)},Yb=t=>{t.unrefCounted()},eee=(t,e)=>{e&&(Yb(t),Yb(t))},tee=(t,e)=>{e&&(Kb(t),Kb(t))},nee=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r},i)=>{if(uee(i)||Eee(i))return;Gp.has(t)||Gp.set(t,[]);const s=Gp.get(t);if(s.push(i),!(s.length>1))for(;s.length>0;){await pee(t,r,i),await K0.yield();const o=await cee({wrappedMessage:s[0],anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r});s.shift(),r.emit("message",o),r.emit("message:done")}},ree=async({anyProcess:t,channel:e,isSubprocess:n,ipcEmitter:r,boundOnMessage:i})=>{YI();const s=Gp.get(t);for(;s?.length>0;)await vn(r,"message:done");t.removeListener("message",i),tee(e,n),r.connected=!1,r.emit("disconnect")},Gp=new WeakMap,Wp=(t,e,n)=>{if(Hp.has(t))return Hp.get(t);const r=new AO;return r.connected=!0,Hp.set(t,r),iee({ipcEmitter:r,anyProcess:t,channel:e,isSubprocess:n}),r},Hp=new WeakMap,iee=({ipcEmitter:t,anyProcess:e,channel:n,isSubprocess:r})=>{const i=nee.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t});e.on("message",i),e.once("disconnect",ree.bind(void 0,{anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:t,boundOnMessage:i})),eee(n,r)},UI=t=>{const e=Hp.get(t);return e===void 0?t.channel!==null:e.connected},see=({anyProcess:t,channel:e,isSubprocess:n,message:r,strict:i})=>{if(!i)return r;const s=Wp(t,e,n),o=Xb(t,s);return{id:oee++,type:Kp,message:r,hasListeners:o}};let oee=0n;const aee=(t,e)=>{if(!(e?.type!==Kp||e.hasListeners))for(const{id:n}of t)n!==void 0&&Vp[n].resolve({isDeadlock:!0,hasListeners:!1})},cee=async({wrappedMessage:t,anyProcess:e,channel:n,isSubprocess:r,ipcEmitter:i})=>{if(t?.type!==Kp||!e.connected)return t;const{id:s,message:o}=t,a={id:s,type:GI,message:Xb(e,i)};try{await WI({anyProcess:e,channel:n,isSubprocess:r,ipc:!0},a)}catch(c){i.emit("strict:error",c)}return o},uee=t=>{if(t?.type!==GI)return!1;const{id:e,message:n}=t;return Vp[e]?.resolve({isDeadlock:!1,hasListeners:n}),!0},lee=async(t,e,n)=>{if(t?.type!==Kp)return;const r=td();Vp[t.id]=r;const i=new AbortController;try{const{isDeadlock:s,hasListeners:o}=await Promise.race([r,dee(e,n,i)]);s&&BQ(n),o||qQ(n)}finally{i.abort(),delete Vp[t.id]}},Vp={},dee=async(t,e,{signal:n})=>{Up(t,1,n),await vn(t,"disconnect",{signal:n}),jQ(e)},Kp="execa:ipc:request",GI="execa:ipc:response",fee=(t,e,n)=>{rd.has(t)||rd.set(t,new Set);const r=rd.get(t),i=td(),s=n?e.id:void 0,o={onMessageSent:i,id:s};return r.add(o),{outgoingMessages:r,outgoingMessage:o}},hee=({outgoingMessages:t,outgoingMessage:e})=>{t.delete(e),e.onMessageSent.resolve()},pee=async(t,e,n)=>{for(;!Xb(t,e)&&rd.get(t)?.size>0;){const r=[...rd.get(t)];aee(r,n),await Promise.all(r.map(({onMessageSent:i})=>i))}},rd=new WeakMap,Xb=(t,e)=>e.listenerCount("message")>gee(t),gee=t=>po.has(t)&&!Zl(po.get(t).options.buffer,"ipc")?1:0,WI=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},i,{strict:s=!1}={})=>{const o="sendMessage";return Gb({methodName:o,isSubprocess:n,ipc:r,isConnected:t.connected}),mee({anyProcess:t,channel:e,methodName:o,isSubprocess:n,message:i,strict:s})},mee=async({anyProcess:t,channel:e,methodName:n,isSubprocess:r,message:i,strict:s})=>{const o=see({anyProcess:t,channel:e,isSubprocess:r,message:i,strict:s}),a=fee(t,o,s);try{await HI({anyProcess:t,methodName:n,isSubprocess:r,wrappedMessage:o,message:i})}catch(c){throw Wb(t),c}finally{hee(a)}},HI=async({anyProcess:t,methodName:e,isSubprocess:n,wrappedMessage:r,message:i})=>{const s=yee(t);try{await Promise.all([lee(r,t,n),s(r)])}catch(o){throw WQ({error:o,methodName:e,isSubprocess:n}),HQ({error:o,methodName:e,isSubprocess:n,message:i}),o}},yee=t=>{if(Jb.has(t))return Jb.get(t);const e=wO(t.send.bind(t));return Jb.set(t,e),e},Jb=new WeakMap,vee=(t,e)=>{const n="cancelSignal";return OI(n,!1,t.connected),HI({anyProcess:t,methodName:n,isSubprocess:!1,wrappedMessage:{type:KI,message:e},message:e})},wee=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>(await bee({anyProcess:t,channel:e,isSubprocess:n,ipc:r}),Zb.signal),bee=async({anyProcess:t,channel:e,isSubprocess:n,ipc:r})=>{if(!VI){if(VI=!0,!r){GQ();return}if(e===null){YI();return}Wp(t,e,n),await K0.yield()}};let VI=!1;const Eee=t=>t?.type!==KI?!1:(Zb.abort(t.message),!0),KI="execa:ipc:cancel",YI=()=>{Zb.abort(UQ())},Zb=new AbortController,Dee=({gracefulCancel:t,cancelSignal:e,ipc:n,serialization:r})=>{if(t){if(e===void 0)throw new Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!n)throw new Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(r==="json")throw new Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")}},Tee=({subprocess:t,cancelSignal:e,gracefulCancel:n,forceKillAfterDelay:r,context:i,controller:s})=>n?[Ree({subprocess:t,cancelSignal:e,forceKillAfterDelay:r,context:i,controller:s})]:[],Ree=async({subprocess:t,cancelSignal:e,forceKillAfterDelay:n,context:r,controller:{signal:i}})=>{await NI(e,i);const s=See(e);throw await vee(t,s),PI({kill:t.kill,forceKillAfterDelay:n,context:r,controllerSignal:i}),r.terminationReason??="gracefulCancel",e.reason},See=({reason:t})=>{if(!(t instanceof DOMException))return t;const e=new Error(t.message);return Object.defineProperty(e,"stack",{value:t.stack,enumerable:!1,configurable:!0,writable:!0}),e},kee=({timeout:t})=>{if(t!==void 0&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},$ee=(t,e,n,r)=>e===0||e===void 0?[]:[Cee(t,e,n,r)],Cee=async(t,e,n,{signal:r})=>{throw await V0(e,void 0,{signal:r}),n.terminationReason??="timeout",t.kill(),new ed},_ee=({options:t})=>{if(t.node===!1)throw new TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...t,node:!0}}},Aee=(t,e,{node:n=!1,nodePath:r=DO,nodeOptions:i=TO.filter(c=>!c.startsWith("--inspect")),cwd:s,execPath:o,...a})=>{if(o!==void 0)throw new TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');const c=wb(r,'The "nodePath" option'),u=Zr.resolve(s,c),l={...a,nodePath:u,node:n,cwd:s};if(!n)return[t,e,l];if(Zr.basename(t,".exe")==="node")throw new TypeError('When the "node" option is true, the first argument does not need to be "node".');return[u,[...i,t,...e],{ipc:!0,...l,shell:!1}]},xee=({ipcInput:t,ipc:e,serialization:n})=>{if(t!==void 0){if(!e)throw new Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");Nee[n](t)}},Iee=t=>{try{IO(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with a structured clone.",{cause:e})}},Pee=t=>{try{JSON.stringify(t)}catch(e){throw new Error("The `ipcInput` option is not serializable with JSON.",{cause:e})}},Nee={advanced:Iee,json:Pee},Oee=async(t,e)=>{e!==void 0&&await t.sendMessage(e)},Fee=({encoding:t})=>{if(Qb.has(t))return;const e=Mee(t);if(e!==void 0)throw new TypeError(`Invalid option \`encoding: ${Yp(t)}\`.
1796
+ Please rename it to ${Yp(e)}.`);const n=[...Qb].map(r=>Yp(r)).join(", ");throw new TypeError(`Invalid option \`encoding: ${Yp(t)}\`.
1797
+ Please rename it to one of: ${n}.`)},Lee=new Set(["utf8","utf16le"]),go=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),Qb=new Set([...Lee,...go]),Mee=t=>{if(t===null)return"buffer";if(typeof t!="string")return;const e=t.toLowerCase();if(e in XI)return XI[e];if(Qb.has(e))return e},XI={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Yp=t=>typeof t=="string"?`"${t}"`:String(t),zee=(t=JI())=>{const e=wb(t,'The "cwd" option');return Zr.resolve(e)},JI=()=>{try{return Ne.cwd()}catch(t){throw t.message=`The current directory does not exist.
1798
+ ${t.message}`,t}},Bee=(t,e)=>{if(e===JI())return t;let n;try{n=aO(e)}catch(r){return`The "cwd" option is invalid: ${e}.
1799
+ ${r.message}
1800
+ ${t}`}return n.isDirectory()?t:`The "cwd" option is not a directory: ${e}.
1801
+ ${t}`},ZI=(t,e,n)=>{n.cwd=zee(n.cwd);const[r,i,s]=Aee(t,e,n),{command:o,args:a,options:c}=sQ._parse(r,i,s),u=QJ(c),l=qee(u);return kee(l),Fee(l),xee(l),OQ(l),Dee(l),l.shell=Ux(l.shell),l.env=jee(l),l.killSignal=DQ(l.killSignal),l.forceKillAfterDelay=_Q(l.forceKillAfterDelay),l.lines=l.lines.map((d,f)=>d&&!go.has(l.encoding)&&l.buffer[f]),Ne.platform==="win32"&&Zr.basename(o,".exe")==="cmd"&&a.unshift("/q"),{file:o,commandArguments:a,options:l}},qee=({extendEnv:t=!0,preferLocal:e=!1,cwd:n,localDir:r=n,encoding:i="utf8",reject:s=!0,cleanup:o=!0,all:a=!1,windowsHide:c=!0,killSignal:u="SIGTERM",forceKillAfterDelay:l=!0,gracefulCancel:d=!1,ipcInput:f,ipc:h=f!==void 0||d,serialization:p="advanced",...g})=>({...g,extendEnv:t,preferLocal:e,cwd:n,localDirectory:r,encoding:i,reject:s,cleanup:o,all:a,windowsHide:c,killSignal:u,forceKillAfterDelay:l,gracefulCancel:d,ipcInput:f,ipc:h,serialization:p}),jee=({env:t,extendEnv:e,preferLocal:n,node:r,localDirectory:i,nodePath:s})=>{const o=e?{...Ne.env,...t}:t;return n||r?uQ({env:o,cwd:i,execPath:s,preferLocal:n,addExecPath:r}):o};function e0(t){if(typeof t=="string")return Uee(t);if(!(ArrayBuffer.isView(t)&&t.BYTES_PER_ELEMENT===1))throw new Error("Input must be a string or a Uint8Array");return Gee(t)}const Uee=t=>t.at(-1)===QI?t.slice(0,t.at(-2)===eP?-2:-1):t,Gee=t=>t.at(-1)===Wee?t.subarray(0,t.at(-2)===Hee?-2:-1):t,QI=`
1802
+ `,Wee=QI.codePointAt(0),eP="\r",Hee=eP.codePointAt(0);function mo(t,{checkOpen:e=!0}={}){return t!==null&&typeof t=="object"&&(t.writable||t.readable||!e||t.writable===void 0&&t.readable===void 0)&&typeof t.pipe=="function"}function tP(t,{checkOpen:e=!0}={}){return mo(t,{checkOpen:e})&&(t.writable||!e)&&typeof t.write=="function"&&typeof t.end=="function"&&typeof t.writable=="boolean"&&typeof t.writableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function Xp(t,{checkOpen:e=!0}={}){return mo(t,{checkOpen:e})&&(t.readable||!e)&&typeof t.read=="function"&&typeof t.readable=="boolean"&&typeof t.readableObjectMode=="boolean"&&typeof t.destroy=="function"&&typeof t.destroyed=="boolean"}function nP(t,e){return tP(t,e)&&Xp(t,e)}const Vee=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);let Kee=class{#e;#t;#n=!1;#r=void 0;constructor(e,n){this.#e=e,this.#t=n}next(){const e=()=>this.#s();return this.#r=this.#r?this.#r.then(e,e):e(),this.#r}return(e){const n=()=>this.#i(e);return this.#r?this.#r.then(n,n):n()}async#s(){if(this.#n)return{done:!0,value:void 0};let e;try{e=await this.#e.read()}catch(n){throw this.#r=void 0,this.#n=!0,this.#e.releaseLock(),n}return e.done&&(this.#r=void 0,this.#n=!0,this.#e.releaseLock()),e}async#i(e){if(this.#n)return{done:!0,value:e};if(this.#n=!0,!this.#t){const n=this.#e.cancel(e);return this.#e.releaseLock(),await n,{done:!0,value:e}}return this.#e.releaseLock(),{done:!0,value:e}}};const t0=Symbol();function rP(){return this[t0].next()}Object.defineProperty(rP,"name",{value:"next"});function iP(t){return this[t0].return(t)}Object.defineProperty(iP,"name",{value:"return"});const Yee=Object.create(Vee,{next:{enumerable:!0,configurable:!0,writable:!0,value:rP},return:{enumerable:!0,configurable:!0,writable:!0,value:iP}});function Xee({preventCancel:t=!1}={}){const e=this.getReader(),n=new Kee(e,t),r=Object.create(Yee);return r[t0]=n,r}const Jee=t=>{if(Xp(t,{checkOpen:!1})&&n0.on!==void 0)return Qee(t);if(typeof t?.[Symbol.asyncIterator]=="function")return t;if(Zee.call(t)==="[object ReadableStream]")return Xee.call(t);throw new TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:Zee}=Object.prototype,Qee=async function*(t){const e=new AbortController,n={};ete(t,e,n);try{for await(const[r]of n0.on(t,"data",{signal:e.signal}))yield r}catch(r){if(n.error!==void 0)throw n.error;if(!e.signal.aborted)throw r}finally{t.destroy()}},ete=async(t,e,n)=>{try{await n0.finished(t,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(r){n.error=r}finally{e.abort()}},n0={},r0=async(t,{init:e,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,finalize:a},{maxBuffer:c=Number.POSITIVE_INFINITY}={})=>{const u=Jee(t),l=e();l.length=0;try{for await(const d of u){const f=nte(d),h=n[f](d,l);sP({convertedChunk:h,state:l,getSize:r,truncateChunk:i,addChunk:s,maxBuffer:c})}return tte({state:l,convertChunk:n,getSize:r,truncateChunk:i,addChunk:s,getFinalChunk:o,maxBuffer:c}),a(l)}catch(d){const f=typeof d=="object"&&d!==null?d:new Error(d);throw f.bufferedData=a(l),f}},tte=({state:t,getSize:e,truncateChunk:n,addChunk:r,getFinalChunk:i,maxBuffer:s})=>{const o=i(t);o!==void 0&&sP({convertedChunk:o,state:t,getSize:e,truncateChunk:n,addChunk:r,maxBuffer:s})},sP=({convertedChunk:t,state:e,getSize:n,truncateChunk:r,addChunk:i,maxBuffer:s})=>{const o=n(t),a=e.length+o;if(a<=s){oP(t,e,i,a);return}const c=r(t,s-e.length);throw c!==void 0&&oP(c,e,i,s),new Jp},oP=(t,e,n,r)=>{e.contents=n(t,e,r),e.length=r},nte=t=>{const e=typeof t;if(e==="string")return"string";if(e!=="object"||t===null)return"others";if(globalThis.Buffer?.isBuffer(t))return"buffer";const n=aP.call(t);return n==="[object ArrayBuffer]"?"arrayBuffer":n==="[object DataView]"?"dataView":Number.isInteger(t.byteLength)&&Number.isInteger(t.byteOffset)&&aP.call(t.buffer)==="[object ArrayBuffer]"?"typedArray":"others"},{toString:aP}=Object.prototype;class Jp extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}const yo=t=>t,i0=()=>{},cP=({contents:t})=>t,uP=t=>{throw new Error(`Streams in object mode are not supported: ${String(t)}`)},lP=t=>t.length;async function rte(t,e){return r0(t,ate,e)}const ite=()=>({contents:[]}),ste=()=>1,ote=(t,{contents:e})=>(e.push(t),e),ate={init:ite,convertChunk:{string:yo,buffer:yo,arrayBuffer:yo,dataView:yo,typedArray:yo,others:yo},getSize:ste,truncateChunk:i0,addChunk:ote,getFinalChunk:i0,finalize:cP};async function cte(t,e){return r0(t,yte,e)}const ute=()=>({contents:new ArrayBuffer(0)}),lte=t=>dte.encode(t),dte=new TextEncoder,dP=t=>new Uint8Array(t),fP=t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),fte=(t,e)=>t.slice(0,e),hte=(t,{contents:e,length:n},r)=>{const i=gP()?gte(e,r):pte(e,r);return new Uint8Array(i).set(t,n),i},pte=(t,e)=>{if(e<=t.byteLength)return t;const n=new ArrayBuffer(hP(e));return new Uint8Array(n).set(new Uint8Array(t),0),n},gte=(t,e)=>{if(e<=t.maxByteLength)return t.resize(e),t;const n=new ArrayBuffer(e,{maxByteLength:hP(e)});return new Uint8Array(n).set(new Uint8Array(t),0),n},hP=t=>pP**Math.ceil(Math.log(t)/Math.log(pP)),pP=2,mte=({contents:t,length:e})=>gP()?t:t.slice(0,e),gP=()=>"resize"in ArrayBuffer.prototype,yte={init:ute,convertChunk:{string:lte,buffer:dP,arrayBuffer:dP,dataView:fP,typedArray:fP,others:uP},getSize:lP,truncateChunk:fte,addChunk:hte,getFinalChunk:i0,finalize:mte};async function vte(t,e){return r0(t,Tte,e)}const wte=()=>({contents:"",textDecoder:new TextDecoder}),Zp=(t,{textDecoder:e})=>e.decode(t,{stream:!0}),bte=(t,{contents:e})=>e+t,Ete=(t,e)=>t.slice(0,e),Dte=({textDecoder:t})=>{const e=t.decode();return e===""?void 0:e},Tte={init:wte,convertChunk:{string:yo,buffer:Zp,arrayBuffer:Zp,dataView:Zp,typedArray:Zp,others:uP},getSize:lP,truncateChunk:Ete,addChunk:bte,getFinalChunk:Dte,finalize:cP},Rte=({error:t,stream:e,readableObjectMode:n,lines:r,encoding:i,fdNumber:s})=>{if(!(t instanceof Jp))throw t;if(s==="all")return t;const o=Ste(n,r,i);throw t.maxBufferInfo={fdNumber:s,unit:o},e.destroy(),t},Ste=(t,e,n)=>t?"objects":e?"lines":n==="buffer"?"bytes":"characters",kte=(t,e,n)=>{if(e.length!==n)return;const r=new Jp;throw r.maxBufferInfo={fdNumber:"ipc"},r},$te=(t,e)=>{const{streamName:n,threshold:r,unit:i}=Cte(t,e);return`Command's ${n} was larger than ${r} ${i}`},Cte=(t,e)=>{if(t?.maxBufferInfo===void 0)return{streamName:"output",threshold:e[1],unit:"bytes"};const{maxBufferInfo:{fdNumber:n,unit:r}}=t;delete t.maxBufferInfo;const i=Zl(e,n);return n==="ipc"?{streamName:"IPC output",threshold:i,unit:"messages"}:{streamName:Zx(n),threshold:i,unit:r}},_te=(t,e,n)=>t?.code==="ENOBUFS"&&e!==null&&e.some(r=>r!==null&&r.length>s0(n)),Ate=(t,e,n)=>{if(!e)return t;const r=s0(n);return t.length>r?t.slice(0,r):t},s0=([,t])=>t,xte=({stdio:t,all:e,ipcOutput:n,originalError:r,signal:i,signalDescription:s,exitCode:o,escapedCommand:a,timedOut:c,isCanceled:u,isGracefullyCanceled:l,isMaxBuffer:d,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:p,maxBuffer:g,timeout:y,cwd:m})=>{const w=r?.code,E=Ite({originalError:r,timedOut:c,timeout:y,isMaxBuffer:d,maxBuffer:g,errorCode:w,signal:i,signalDescription:s,exitCode:o,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:f,forceKillAfterDelay:h,killSignal:p}),k=Nte(r,m),A=k===void 0?"":`
1803
+ ${k}`,I=`${E}: ${a}${A}`,x=e===void 0?[t[2],t[1]]:[e],_=[I,...x,...t.slice(3),n.map(P=>Ote(P)).join(`
1804
+ `)].map(P=>$b(e0(Fte(P)))).filter(Boolean).join(`
1805
+
1806
+ `);return{originalMessage:k,shortMessage:I,message:_}},Ite=({originalError:t,timedOut:e,timeout:n,isMaxBuffer:r,maxBuffer:i,errorCode:s,signal:o,signalDescription:a,exitCode:c,isCanceled:u,isGracefullyCanceled:l,isForcefullyTerminated:d,forceKillAfterDelay:f,killSignal:h})=>{const p=Pte(d,f);return e?`Command timed out after ${n} milliseconds${p}`:l?o===void 0?`Command was gracefully canceled with exit code ${c}`:d?`Command was gracefully canceled${p}`:`Command was gracefully canceled with ${o} (${a})`:u?`Command was canceled${p}`:r?`${$te(t,i)}${p}`:s!==void 0?`Command failed with ${s}${p}`:d?`Command was killed with ${h} (${II(h)})${p}`:o!==void 0?`Command was killed with ${o} (${a})`:c!==void 0?`Command failed with exit code ${c}`:"Command failed"},Pte=(t,e)=>t?` and was forcefully terminated after ${e} milliseconds`:"",Nte=(t,e)=>{if(t instanceof ed)return;const n=dQ(t)?t.originalMessage:String(t?.message??t),r=$b(Bee(n,e));return r===""?void 0:r},Ote=t=>typeof t=="string"?t:U0(t),Fte=t=>Array.isArray(t)?t.map(e=>e0(mP(e))).filter(Boolean).join(`
1807
+ `):mP(t),mP=t=>typeof t=="string"?t:Dr(t)?Vx(t):"",yP=({command:t,escapedCommand:e,stdio:n,all:r,ipcOutput:i,options:{cwd:s},startTime:o})=>vP({command:t,escapedCommand:e,cwd:s,durationMs:uI(o),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:n[1],stderr:n[2],all:r,stdio:n,ipcOutput:i,pipedFrom:[]}),o0=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:o})=>a0({error:t,command:e,escapedCommand:n,startTime:s,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:r.length}),ipcOutput:[],options:i,isSync:o}),a0=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,stdio:d,all:f,ipcOutput:h,options:{timeoutDuration:p,timeout:g=p,forceKillAfterDelay:y,killSignal:m,cwd:w,maxBuffer:E},isSync:k})=>{const{exitCode:A,signal:I,signalDescription:x}=Mte(u,l),{originalMessage:_,shortMessage:P,message:O}=xte({stdio:d,all:f,ipcOutput:h,originalError:t,signal:I,signalDescription:x,exitCode:A,escapedCommand:n,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,forceKillAfterDelay:y,killSignal:m,maxBuffer:E,timeout:g,cwd:w}),C=lQ(t,O,k);return Object.assign(C,Lte({error:C,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:A,signal:I,signalDescription:x,stdio:d,all:f,ipcOutput:h,cwd:w,originalMessage:_,shortMessage:P})),C},Lte=({error:t,command:e,escapedCommand:n,startTime:r,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,stdio:f,all:h,ipcOutput:p,cwd:g,originalMessage:y,shortMessage:m})=>vP({shortMessage:m,originalMessage:y,command:e,escapedCommand:n,cwd:g,durationMs:uI(r),failed:!0,timedOut:i,isCanceled:s,isGracefullyCanceled:o,isTerminated:l!==void 0,isMaxBuffer:a,isForcefullyTerminated:c,exitCode:u,signal:l,signalDescription:d,code:t.cause?.code,stdout:f[1],stderr:f[2],all:h,stdio:f,ipcOutput:p,pipedFrom:[]}),vP=t=>Object.fromEntries(Object.entries(t).filter(([,e])=>e!==void 0)),Mte=(t,e)=>{const n=t===null?void 0:t,r=e===null?void 0:e,i=r===void 0?void 0:II(e);return{exitCode:n,signal:r,signalDescription:i}},wP=t=>Number.isFinite(t)?t:0;function zte(t){return{days:Math.trunc(t/864e5),hours:Math.trunc(t/36e5%24),minutes:Math.trunc(t/6e4%60),seconds:Math.trunc(t/1e3%60),milliseconds:Math.trunc(t%1e3),microseconds:Math.trunc(wP(t*1e3)%1e3),nanoseconds:Math.trunc(wP(t*1e6)%1e3)}}function Bte(t){return{days:t/86400000n,hours:t/3600000n%24n,minutes:t/60000n%60n,seconds:t/1000n%60n,milliseconds:t%1000n,microseconds:0n,nanoseconds:0n}}function qte(t){switch(typeof t){case"number":{if(Number.isFinite(t))return zte(t);break}case"bigint":return Bte(t)}throw new TypeError("Expected a finite number or bigint")}const jte=t=>t===0||t===0n,Ute=(t,e)=>e===1||e===1n?t:`${t}s`,Gte=1e-7,Wte=24n*60n*60n*1000n;function bP(t,e){const n=typeof t=="bigint";if(!n&&!Number.isFinite(t))throw new TypeError("Expected a finite number or bigint");e={...e};const r=t<0?"-":"";t=t<0?-t:t,e.colonNotation&&(e.compact=!1,e.formatSubMilliseconds=!1,e.separateMilliseconds=!1,e.verbose=!1),e.compact&&(e.unitCount=1,e.secondsDecimalDigits=0,e.millisecondsDecimalDigits=0);let i=[];const s=(l,d)=>{const f=Math.floor(l*10**d+Gte);return(Math.round(f)/10**d).toFixed(d)},o=(l,d,f,h)=>{if(!((i.length===0||!e.colonNotation)&&jte(l)&&!(e.colonNotation&&f==="m"))){if(h??=String(l),e.colonNotation){const p=h.includes(".")?h.split(".")[0].length:h.length,g=i.length>0?2:1;h="0".repeat(Math.max(0,g-p))+h}else h+=e.verbose?" "+Ute(d,l):f;i.push(h)}},a=qte(t),c=BigInt(a.days);if(o(c/365n,"year","y"),o(c%365n,"day","d"),o(Number(a.hours),"hour","h"),o(Number(a.minutes),"minute","m"),e.separateMilliseconds||e.formatSubMilliseconds||!e.colonNotation&&t<1e3){const l=Number(a.seconds),d=Number(a.milliseconds),f=Number(a.microseconds),h=Number(a.nanoseconds);if(o(l,"second","s"),e.formatSubMilliseconds)o(d,"millisecond","ms"),o(f,"microsecond","\xB5s"),o(h,"nanosecond","ns");else{const p=d+f/1e3+h/1e6,g=typeof e.millisecondsDecimalDigits=="number"?e.millisecondsDecimalDigits:0,y=p>=1?Math.round(p):Math.ceil(p),m=g?p.toFixed(g):y;o(Number.parseFloat(m),"millisecond","ms",m)}}else{const l=(n?Number(t%Wte):t)/1e3%60,d=typeof e.secondsDecimalDigits=="number"?e.secondsDecimalDigits:1,f=s(l,d),h=e.keepDecimalsOnWholeSeconds?f:f.replace(/\.0+$/,"");o(Number.parseFloat(h),"second","s",h)}if(i.length===0)return r+"0"+(e.verbose?" milliseconds":"ms");const u=e.colonNotation?":":" ";return typeof e.unitCount=="number"&&(i=i.slice(0,Math.max(e.unitCount,1))),r+i.join(u)}const Hte=(t,e)=>{t.failed&&Ql({type:"error",verboseMessage:t.shortMessage,verboseInfo:e,result:t})},Vte=(t,e)=>{Db(e)&&(Hte(t,e),Kte(t,e))},Kte=(t,e)=>{const n=`(done in ${bP(t.durationMs)})`;Ql({type:"duration",verboseMessage:n,verboseInfo:e,result:t})},c0=(t,e,{reject:n})=>{if(Vte(t,e),t.failed&&n)throw t;return t},Yte=(t,e)=>Aa(t)?"asyncGenerator":SP(t)?"generator":l0(t)?"fileUrl":tne(t)?"filePath":ine(t)?"webStream":mo(t,{checkOpen:!1})?"native":Dr(t)?"uint8Array":sne(t)?"asyncIterable":one(t)?"iterable":f0(t)?EP({transform:t},e):Qte(t)?Xte(t,e):"native",Xte=(t,e)=>nP(t.transform,{checkOpen:!1})?Jte(t,e):f0(t.transform)?EP(t,e):Zte(t,e),Jte=(t,e)=>(DP(t,e,"Duplex stream"),"duplex"),EP=(t,e)=>(DP(t,e,"web TransformStream"),"webTransform"),DP=({final:t,binary:e,objectMode:n},r,i)=>{TP(t,`${r}.final`,i),TP(e,`${r}.binary`,i),u0(n,`${r}.objectMode`)},TP=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${e}\` option can only be defined when using a generator, not a ${n}.`)},Zte=({transform:t,final:e,binary:n,objectMode:r},i)=>{if(t!==void 0&&!RP(t))throw new TypeError(`The \`${i}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(nP(e,{checkOpen:!1}))throw new TypeError(`The \`${i}.final\` option must not be a Duplex stream.`);if(f0(e))throw new TypeError(`The \`${i}.final\` option must not be a web TransformStream.`);if(e!==void 0&&!RP(e))throw new TypeError(`The \`${i}.final\` option must be a generator.`);return u0(n,`${i}.binary`),u0(r,`${i}.objectMode`),Aa(t)||Aa(e)?"asyncGenerator":"generator"},u0=(t,e)=>{if(t!==void 0&&typeof t!="boolean")throw new TypeError(`The \`${e}\` option must use a boolean.`)},RP=t=>Aa(t)||SP(t),Aa=t=>Object.prototype.toString.call(t)==="[object AsyncGeneratorFunction]",SP=t=>Object.prototype.toString.call(t)==="[object GeneratorFunction]",Qte=t=>er(t)&&(t.transform!==void 0||t.final!==void 0),l0=t=>Object.prototype.toString.call(t)==="[object URL]",ene=t=>l0(t)&&t.protocol!=="file:",tne=t=>er(t)&&Object.keys(t).length===1&&kP(t.file),kP=t=>typeof t=="string",nne=(t,e)=>t==="native"&&typeof e=="string"&&!rne.has(e),rne=new Set(["ipc","ignore","inherit","overlapped","pipe"]),$P=t=>Object.prototype.toString.call(t)==="[object ReadableStream]",d0=t=>Object.prototype.toString.call(t)==="[object WritableStream]",ine=t=>$P(t)||d0(t),f0=t=>$P(t?.readable)&&d0(t?.writable),sne=t=>CP(t)&&typeof t[Symbol.asyncIterator]=="function",one=t=>CP(t)&&typeof t[Symbol.iterator]=="function",CP=t=>typeof t=="object"&&t!==null,vo=new Set(["generator","asyncGenerator","duplex","webTransform"]),_P=new Set(["fileUrl","filePath","fileNumber"]),AP=new Set(["fileUrl","filePath"]),ane=new Set([...AP,"webStream","nodeStream"]),cne=new Set(["webTransform","duplex"]),Qp={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"},xP=(t,e,n,r)=>r==="output"?une(t,e,n):lne(t,e,n),une=(t,e,n)=>{const r=e!==0&&n[e-1].value.readableObjectMode;return{writableObjectMode:r,readableObjectMode:t??r}},lne=(t,e,n)=>{const r=e===0?t===!0:n[e-1].value.readableObjectMode,i=e!==n.length-1&&(t??r);return{writableObjectMode:r,readableObjectMode:i}},dne=(t,e)=>{const n=t.findLast(({type:r})=>vo.has(r));return n===void 0?!1:e==="input"?n.value.writableObjectMode:n.value.readableObjectMode},fne=(t,e,n,r)=>[...t.filter(({type:i})=>!vo.has(i)),...hne(t,e,n,r)],hne=(t,e,n,{encoding:r})=>{const i=t.filter(({type:o})=>vo.has(o)),s=Array.from({length:i.length});for(const[o,a]of Object.entries(i))s[o]=pne({stdioItem:a,index:Number(o),newTransforms:s,optionName:e,direction:n,encoding:r});return vne(s,n)},pne=({stdioItem:t,stdioItem:{type:e},index:n,newTransforms:r,optionName:i,direction:s,encoding:o})=>e==="duplex"?gne({stdioItem:t,optionName:i}):e==="webTransform"?mne({stdioItem:t,index:n,newTransforms:r,direction:s}):yne({stdioItem:t,index:n,newTransforms:r,direction:s,encoding:o}),gne=({stdioItem:t,stdioItem:{value:{transform:e,transform:{writableObjectMode:n,readableObjectMode:r},objectMode:i=r}},optionName:s})=>{if(i&&!r)throw new TypeError(`The \`${s}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!i&&r)throw new TypeError(`The \`${s}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...t,value:{transform:e,writableObjectMode:n,readableObjectMode:r}}},mne=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i})=>{const{transform:s,objectMode:o}=er(e)?e:{transform:e},{writableObjectMode:a,readableObjectMode:c}=xP(o,n,r,i);return{...t,value:{transform:s,writableObjectMode:a,readableObjectMode:c}}},yne=({stdioItem:t,stdioItem:{value:e},index:n,newTransforms:r,direction:i,encoding:s})=>{const{transform:o,final:a,binary:c=!1,preserveNewlines:u=!1,objectMode:l}=er(e)?e:{transform:e},d=c||go.has(s),{writableObjectMode:f,readableObjectMode:h}=xP(l,n,r,i);return{...t,value:{transform:o,final:a,binary:d,preserveNewlines:u,writableObjectMode:f,readableObjectMode:h}}},vne=(t,e)=>e==="input"?t.reverse():t,wne=(t,e,n)=>{const r=t.map(i=>bne(i,e));if(r.includes("input")&&r.includes("output"))throw new TypeError(`The \`${n}\` option must not be an array of both readable and writable values.`);return r.find(Boolean)??Tne},bne=({type:t,value:e},n)=>Ene[n]??IP[t](e),Ene=["input","output","output"],xa=()=>{},h0=()=>"input",IP={generator:xa,asyncGenerator:xa,fileUrl:xa,filePath:xa,iterable:h0,asyncIterable:h0,uint8Array:h0,webStream:t=>d0(t)?"output":"input",nodeStream(t){return Xp(t,{checkOpen:!1})?tP(t,{checkOpen:!1})?void 0:"input":"output"},webTransform:xa,duplex:xa,native(t){const e=Dne(t);if(e!==void 0)return e;if(mo(t,{checkOpen:!1}))return IP.nodeStream(t)}},Dne=t=>{if([0,Ne.stdin].includes(t))return"input";if([1,2,Ne.stdout,Ne.stderr].includes(t))return"output"},Tne="output",Rne=(t,e)=>e&&!t.includes("ipc")?[...t,"ipc"]:t,Sne=({stdio:t,ipc:e,buffer:n,...r},i,s)=>{const o=kne(t,r).map((a,c)=>PP(a,c));return s?Cne(o,n,i):Rne(o,e)},kne=(t,e)=>{if(t===void 0)return Kr.map(r=>e[r]);if($ne(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${Kr.map(r=>`\`${r}\``).join(", ")}`);if(typeof t=="string")return[t,t,t];if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);const n=Math.max(t.length,Kr.length);return Array.from({length:n},(r,i)=>t[i])},$ne=t=>Kr.some(e=>t[e]!==void 0),PP=(t,e)=>Array.isArray(t)?t.map(n=>PP(n,e)):t??(e>=Kr.length?"ignore":"pipe"),Cne=(t,e,n)=>t.map((r,i)=>!e[i]&&i!==0&&!Tb(n,i)&&_ne(r)?"ignore":r),_ne=t=>t==="pipe"||Array.isArray(t)&&t.every(e=>e==="pipe"),Ane=({stdioItem:t,stdioItem:{type:e},isStdioArray:n,fdNumber:r,direction:i,isSync:s})=>!n||e!=="native"?t:s?xne({stdioItem:t,fdNumber:r,direction:i}):Nne({stdioItem:t,fdNumber:r}),xne=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r,direction:i})=>{const s=Ine({value:e,optionName:n,fdNumber:r,direction:i});if(s!==void 0)return s;if(mo(e,{checkOpen:!1}))throw new TypeError(`The \`${n}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return t},Ine=({value:t,optionName:e,fdNumber:n,direction:r})=>{const i=Pne(t,n);if(i!==void 0){if(r==="output")return{type:"fileNumber",value:i,optionName:e};if(G0.isatty(i))throw new TypeError(`The \`${e}: ${Vb(t)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Jl(ug(i)),optionName:e}}},Pne=(t,e)=>{if(t==="inherit")return e;if(typeof t=="number")return t;const n=Eb.indexOf(t);if(n!==-1)return n},Nne=({stdioItem:t,stdioItem:{value:e,optionName:n},fdNumber:r})=>e==="inherit"?{type:"nodeStream",value:NP(r,e,n),optionName:n}:typeof e=="number"?{type:"nodeStream",value:NP(e,e,n),optionName:n}:mo(e,{checkOpen:!1})?{type:"nodeStream",value:e,optionName:n}:t,NP=(t,e,n)=>{const r=Eb[t];if(r===void 0)throw new TypeError(`The \`${n}: ${e}\` option is invalid: no such standard stream.`);return r},One=({input:t,inputFile:e},n)=>n===0?[...Fne(t),...Mne(e)]:[],Fne=t=>t===void 0?[]:[{type:Lne(t),value:t,optionName:"input"}],Lne=t=>{if(Xp(t,{checkOpen:!1}))return"nodeStream";if(typeof t=="string")return"string";if(Dr(t))return"uint8Array";throw new Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},Mne=t=>t===void 0?[]:[{...zne(t),optionName:"inputFile"}],zne=t=>{if(l0(t))return{type:"fileUrl",value:t};if(kP(t))return{type:"filePath",value:{file:t}};throw new Error("The `inputFile` option must be a file path string or a file URL.")},Bne=t=>t.filter((e,n)=>t.every((r,i)=>e.value!==r.value||n>=i||e.type==="generator"||e.type==="asyncGenerator")),qne=({stdioItem:{type:t,value:e,optionName:n},direction:r,fileDescriptors:i,isSync:s})=>{const o=jne(i,t);if(o.length!==0){if(s){Une({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});return}if(ane.has(t))return OP({otherStdioItems:o,type:t,value:e,optionName:n,direction:r});cne.has(t)&&Wne({otherStdioItems:o,type:t,value:e,optionName:n})}},jne=(t,e)=>t.flatMap(({direction:n,stdioItems:r})=>r.filter(i=>i.type===e).map(i=>({...i,direction:n}))),Une=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{AP.has(e)&&OP({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})},OP=({otherStdioItems:t,type:e,value:n,optionName:r,direction:i})=>{const s=t.filter(a=>Gne(a,n));if(s.length===0)return;const o=s.find(a=>a.direction!==i);return FP(o,r,e),i==="output"?s[0].stream:void 0},Gne=({type:t,value:e},n)=>t==="filePath"?e.file===n.file:t==="fileUrl"?e.href===n.href:e===n,Wne=({otherStdioItems:t,type:e,value:n,optionName:r})=>{const i=t.find(({value:{transform:s}})=>s===n.transform);FP(i,r,e)},FP=(t,e,n)=>{if(t!==void 0)throw new TypeError(`The \`${t.optionName}\` and \`${e}\` options must not target ${Qp[n]} that is the same.`)},LP=(t,e,n,r)=>{const s=Sne(e,n,r).map((a,c)=>Hne({stdioOption:a,fdNumber:c,options:e,isSync:r})),o=ere({initialFileDescriptors:s,addProperties:t,options:e,isSync:r});return e.stdio=o.map(({stdioItems:a})=>rre(a)),o},Hne=({stdioOption:t,fdNumber:e,options:n,isSync:r})=>{const i=Zx(e),{stdioItems:s,isStdioArray:o}=Vne({stdioOption:t,fdNumber:e,options:n,optionName:i}),a=wne(s,e,i),c=s.map(d=>Ane({stdioItem:d,isStdioArray:o,fdNumber:e,direction:a,isSync:r})),u=fne(c,i,a,n),l=dne(u,a);return Qne(u,l),{direction:a,objectMode:l,stdioItems:u}},Vne=({stdioOption:t,fdNumber:e,options:n,optionName:r})=>{const s=[...(Array.isArray(t)?t:[t]).map(c=>Kne(c,r)),...One(n,e)],o=Bne(s),a=o.length>1;return Yne(o,a,r),Jne(o),{stdioItems:o,isStdioArray:a}},Kne=(t,e)=>({type:Yte(t,e),value:t,optionName:e}),Yne=(t,e,n)=>{if(t.length===0)throw new TypeError(`The \`${n}\` option must not be an empty array.`);if(e){for(const{value:r,optionName:i}of t)if(Xne.has(r))throw new Error(`The \`${i}\` option must not include \`${r}\`.`)}},Xne=new Set(["ignore","ipc"]),Jne=t=>{for(const e of t)Zne(e)},Zne=({type:t,value:e,optionName:n})=>{if(ene(e))throw new TypeError(`The \`${n}: URL\` option must use the \`file:\` scheme.
1808
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(nne(t,e))throw new TypeError(`The \`${n}: { file: '...' }\` option must be used instead of \`${n}: '...'\`.`)},Qne=(t,e)=>{if(!e)return;const n=t.find(({type:r})=>_P.has(r));if(n!==void 0)throw new TypeError(`The \`${n.optionName}\` option cannot use both files and transforms in objectMode.`)},ere=({initialFileDescriptors:t,addProperties:e,options:n,isSync:r})=>{const i=[];try{for(const s of t)i.push(tre({fileDescriptor:s,fileDescriptors:i,addProperties:e,options:n,isSync:r}));return i}catch(s){throw MP(i),s}},tre=({fileDescriptor:{direction:t,objectMode:e,stdioItems:n},fileDescriptors:r,addProperties:i,options:s,isSync:o})=>{const a=n.map(c=>nre({stdioItem:c,addProperties:i,direction:t,options:s,fileDescriptors:r,isSync:o}));return{direction:t,objectMode:e,stdioItems:a}},nre=({stdioItem:t,addProperties:e,direction:n,options:r,fileDescriptors:i,isSync:s})=>{const o=qne({stdioItem:t,direction:n,fileDescriptors:i,isSync:s});return o!==void 0?{...t,stream:o}:{...t,...e[n][t.type](t,r)}},MP=t=>{for(const{stdioItems:e}of t)for(const{stream:n}of e)n!==void 0&&!fo(n)&&n.destroy()},rre=t=>{if(t.length>1)return t.some(({value:r})=>r==="overlapped")?"overlapped":"pipe";const[{type:e,value:n}]=t;return e==="native"?n:"pipe"},ire=(t,e)=>LP(ore,t,e,!0),Yr=({type:t,optionName:e})=>{zP(e,Qp[t])},sre=({optionName:t,value:e})=>((e==="ipc"||e==="overlapped")&&zP(t,`"${e}"`),{}),zP=(t,e)=>{throw new TypeError(`The \`${t}\` option cannot be ${e} with synchronous methods.`)},BP={generator(){},asyncGenerator:Yr,webStream:Yr,nodeStream:Yr,webTransform:Yr,duplex:Yr,asyncIterable:Yr,native:sre},ore={input:{...BP,fileUrl:({value:t})=>({contents:[Jl(ug(t))]}),filePath:({value:{file:t}})=>({contents:[Jl(ug(t))]}),fileNumber:Yr,iterable:({value:t})=>({contents:[...t]}),string:({value:t})=>({contents:[t]}),uint8Array:({value:t})=>({contents:[t]})},output:{...BP,fileUrl:({value:t})=>({path:t}),filePath:({value:{file:t}})=>({path:t}),fileNumber:({value:t})=>({path:t}),iterable:Yr,string:Yr,uint8Array:Yr}},Ia=(t,{stripFinalNewline:e},n)=>qP(e,n)&&t!==void 0&&!Array.isArray(t)?e0(t):t,qP=(t,e)=>e==="all"?t[1]||t[2]:t[e],jP=(t,e,n,r)=>t||n?void 0:WP(e,r),UP=(t,e,n)=>n?t.flatMap(r=>GP(r,e)):GP(t,e),GP=(t,e)=>{const{transform:n,final:r}=WP(e,{});return[...n(t),...r()]},WP=(t,e)=>(e.previousChunks="",{transform:are.bind(void 0,e,t),final:ure.bind(void 0,e)}),are=function*(t,e,n){if(typeof n!="string"){yield n;return}let{previousChunks:r}=t,i=-1;for(let s=0;s<n.length;s+=1)if(n[s]===`
1809
+ `){const o=cre(n,s,e,t);let a=n.slice(i+1,s+1-o);r.length>0&&(a=p0(r,a),r=""),yield a,i=s}i!==n.length-1&&(r=p0(r,n.slice(i+1))),t.previousChunks=r},cre=(t,e,n,r)=>n?0:(r.isWindowsNewline=e!==0&&t[e-1]==="\r",r.isWindowsNewline?2:1),ure=function*({previousChunks:t}){t.length>0&&(yield t)},lre=({binary:t,preserveNewlines:e,readableObjectMode:n,state:r})=>t||e||n?void 0:{transform:dre.bind(void 0,r)},dre=function*({isWindowsNewline:t=!1},e){const{unixNewline:n,windowsNewline:r,LF:i,concatBytes:s}=typeof e=="string"?fre:pre;if(e.at(-1)===i){yield e;return}yield s(e,t?r:n)},p0=(t,e)=>`${t}${e}`,fre={windowsNewline:`\r
1810
+ `,unixNewline:`
1811
+ `,LF:`
1812
+ `,concatBytes:p0},hre=(t,e)=>{const n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},pre={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:hre},gre=(t,e)=>t?void 0:mre.bind(void 0,e),mre=function*(t,e){if(typeof e!="string"&&!Dr(e)&&!gg.isBuffer(e))throw new TypeError(`The \`${t}\` option's transform must use "objectMode: true" to receive as input: ${typeof e}.`);yield e},yre=(t,e)=>t?vre.bind(void 0,e):wre.bind(void 0,e),vre=function*(t,e){HP(t,e),yield e},wre=function*(t,e){if(HP(t,e),typeof e!="string"&&!Dr(e))throw new TypeError(`The \`${t}\` option's function must yield a string or an Uint8Array, not ${typeof e}.`);yield e},HP=(t,e)=>{if(e==null)throw new TypeError(`The \`${t}\` option's function must not call \`yield ${e}\`.
1813
+ Instead, \`yield\` should either be called with a value, or not be called at all. For example:
1814
+ if (condition) { yield value; }`)},VP=(t,e,n)=>{if(n)return;if(t)return{transform:bre.bind(void 0,new TextEncoder)};const r=new H0(e);return{transform:Ere.bind(void 0,r),final:Dre.bind(void 0,r)}},bre=function*(t,e){gg.isBuffer(e)?yield Jl(e):typeof e=="string"?yield t.encode(e):yield e},Ere=function*(t,e){yield Dr(e)?t.write(e):e},Dre=function*(t){const e=t.end();e!==""&&(yield e)},KP=Do(async(t,e,n,r)=>{e.currentIterable=t(...n);try{for await(const i of e.currentIterable)r.push(i)}finally{delete e.currentIterable}}),g0=async function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=kre}=e[n];for await(const i of r(t))yield*g0(i,e,n+1)},Tre=async function*(t){for(const[e,{final:n}]of Object.entries(t))yield*Rre(n,Number(e),t)},Rre=async function*(t,e,n){if(t!==void 0)for await(const r of t())yield*g0(r,n,e+1)},Sre=Do(async({currentIterable:t},e)=>{if(t!==void 0){await(e?t.throw(e):t.return());return}if(e)throw e}),kre=function*(t){yield t},YP=(t,e,n,r)=>{try{for(const i of t(...e))n.push(i);r()}catch(i){r(i)}},$re=(t,e)=>[...e.flatMap(n=>[...id(n,t,0)]),...m0(t)],id=function*(t,e,n){if(n===e.length){yield t;return}const{transform:r=_re}=e[n];for(const i of r(t))yield*id(i,e,n+1)},m0=function*(t){for(const[e,{final:n}]of Object.entries(t))yield*Cre(n,Number(e),t)},Cre=function*(t,e,n){if(t!==void 0)for(const r of t())yield*id(r,n,e+1)},_re=function*(t){yield t},XP=({value:t,value:{transform:e,final:n,writableObjectMode:r,readableObjectMode:i},optionName:s},{encoding:o})=>{const a={},c=ZP(t,o,s),u=Aa(e),l=Aa(n),d=u?KP.bind(void 0,g0,a):YP.bind(void 0,id),f=u||l?KP.bind(void 0,Tre,a):YP.bind(void 0,m0),h=u||l?Sre.bind(void 0,a):void 0;return{stream:new PO({writableObjectMode:r,writableHighWaterMark:fd(r),readableObjectMode:i,readableHighWaterMark:fd(i),transform(g,y,m){d([g,c,0],this,m)},flush(g){f([c],this,g)},destroy:h})}},JP=(t,e,n,r)=>{const i=e.filter(({type:o})=>o==="generator"),s=r?i.reverse():i;for(const{value:o,optionName:a}of s){const c=ZP(o,n,a);t=$re(c,t)}return t},ZP=({transform:t,final:e,binary:n,writableObjectMode:r,readableObjectMode:i,preserveNewlines:s},o,a)=>{const c={};return[{transform:gre(r,a)},VP(n,o,r),jP(n,s,r,c),{transform:t,final:e},{transform:yre(i,a)},lre({binary:n,preserveNewlines:s,readableObjectMode:i,state:c})].filter(Boolean)},Are=(t,e)=>{for(const n of xre(t))Ire(t,n,e)},xre=t=>new Set(Object.entries(t).filter(([,{direction:e}])=>e==="input").map(([e])=>Number(e))),Ire=(t,e,n)=>{const{stdioItems:r}=t[e],i=r.filter(({contents:a})=>a!==void 0);if(i.length===0)return;if(e!==0){const[{type:a,optionName:c}]=i;throw new TypeError(`Only the \`stdin\` option, not \`${c}\`, can be ${Qp[a]} with synchronous methods.`)}const o=i.map(({contents:a})=>a).map(a=>Pre(a,r));n.input=bb(o)},Pre=(t,e)=>{const n=JP(t,e,"utf8",!0);return Nre(n),bb(n)},Nre=t=>{const e=t.find(n=>typeof n!="string"&&!Dr(n));if(e!==void 0)throw new TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${e}.`)},QP=({stdioItems:t,encoding:e,verboseInfo:n,fdNumber:r})=>r!=="all"&&Tb(n,r)&&!go.has(e)&&Ore(r)&&(t.some(({type:i,value:s})=>i==="native"&&Fre.has(s))||t.every(({type:i})=>vo.has(i))),Ore=t=>t===1||t===2,Fre=new Set(["pipe","overlapped"]),Lre=async(t,e,n,r)=>{for await(const i of t)zre(e)||eN(i,n,r)},Mre=(t,e,n)=>{for(const r of t)eN(r,e,n)},zre=t=>t._readableState.pipes.length>0,eN=(t,e,n)=>{const r=aI(t);Ql({type:"output",verboseMessage:r,fdNumber:e,verboseInfo:n})},Bre=({fileDescriptors:t,syncResult:{output:e},options:n,isMaxBuffer:r,verboseInfo:i})=>{if(e===null)return{output:Array.from({length:3})};const s={},o=new Set([]);return{output:e.map((c,u)=>qre({result:c,fileDescriptors:t,fdNumber:u,state:s,outputFiles:o,isMaxBuffer:r,verboseInfo:i},n)),...s}},qre=({result:t,fileDescriptors:e,fdNumber:n,state:r,outputFiles:i,isMaxBuffer:s,verboseInfo:o},{buffer:a,encoding:c,lines:u,stripFinalNewline:l,maxBuffer:d})=>{if(t===null)return;const f=Ate(t,s,d),h=Jl(f),{stdioItems:p,objectMode:g}=e[n],y=jre([h],p,c,r),{serializedResult:m,finalResult:w=m}=Ure({chunks:y,objectMode:g,encoding:c,lines:u,stripFinalNewline:l,fdNumber:n});Gre({serializedResult:m,fdNumber:n,state:r,verboseInfo:o,encoding:c,stdioItems:p,objectMode:g});const E=a[n]?w:void 0;try{return r.error===void 0&&Wre(m,p,i),E}catch(k){return r.error=k,E}},jre=(t,e,n,r)=>{try{return JP(t,e,n,!1)}catch(i){return r.error=i,t}},Ure=({chunks:t,objectMode:e,encoding:n,lines:r,stripFinalNewline:i,fdNumber:s})=>{if(e)return{serializedResult:t};if(n==="buffer")return{serializedResult:bb(t)};const o=UJ(t,n);return r[s]?{serializedResult:o,finalResult:UP(o,!i[s],e)}:{serializedResult:o}},Gre=({serializedResult:t,fdNumber:e,state:n,verboseInfo:r,encoding:i,stdioItems:s,objectMode:o})=>{if(!QP({stdioItems:s,encoding:i,verboseInfo:r,fdNumber:e}))return;const a=UP(t,!1,o);try{Mre(a,e,r)}catch(c){n.error??=c}},Wre=(t,e,n)=>{for(const{path:r}of e.filter(({type:i})=>_P.has(i))){const i=typeof r=="string"?r:r.toString();n.has(i)?cO(r,t):(n.add(i),B0(r,t))}},Hre=([,t,e],n)=>{if(n.all)return t===void 0?e:e===void 0?t:Array.isArray(t)?Array.isArray(e)?[...t,...e]:[...t,Ia(e,n,"all")]:Array.isArray(e)?[Ia(t,n,"all"),...e]:Dr(t)&&Dr(e)?Kx([t,e]):`${t}${e}`},Vre=async(t,e)=>{const[n,r]=await Kre(t);return e.isForcefullyTerminated??=!1,[n,r]},Kre=async t=>{const[e,n]=await Promise.allSettled([vn(t,"spawn"),vn(t,"exit")]);return e.status==="rejected"?[]:n.status==="rejected"?tN(t):n.value},tN=async t=>{try{return await vn(t,"exit")}catch{return tN(t)}},Yre=async t=>{const[e,n]=await t;if(!Xre(e,n)&&nN(e,n))throw new ed;return[e,n]},Xre=(t,e)=>t===void 0&&e===void 0,nN=(t,e)=>t!==0||e!==null,Jre=({error:t,status:e,signal:n,output:r},{maxBuffer:i})=>{const s=Zre(t,e,n),o=s?.code==="ETIMEDOUT",a=_te(s,r,i);return{resultError:s,exitCode:e,signal:n,timedOut:o,isMaxBuffer:a}},Zre=(t,e,n)=>t!==void 0?t:nN(e,n)?new ed:void 0,Qre=(t,e,n)=>{const{file:r,commandArguments:i,command:s,escapedCommand:o,startTime:a,verboseInfo:c,options:u,fileDescriptors:l}=eie(t,e,n),d=rie({file:r,commandArguments:i,options:u,command:s,escapedCommand:o,verboseInfo:c,fileDescriptors:l,startTime:a});return c0(d,c,u)},eie=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=lI(t,e,n),a=tie(n),{file:c,commandArguments:u,options:l}=ZI(t,e,a);nie(l);const d=ire(l,o);return{file:c,commandArguments:u,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},tie=t=>t.node&&!t.ipc?{...t,ipc:!1}:t,nie=({ipc:t,ipcInput:e,detached:n,cancelSignal:r})=>{e&&eg("ipcInput"),t&&eg("ipc: true"),n&&eg("detached: true"),r&&eg("cancelSignal")},eg=t=>{throw new TypeError(`The "${t}" option cannot be used with synchronous methods.`)},rie=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,verboseInfo:s,fileDescriptors:o,startTime:a})=>{const c=iie({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:o,startTime:a});if(c.failed)return c;const{resultError:u,exitCode:l,signal:d,timedOut:f,isMaxBuffer:h}=Jre(c,n),{output:p,error:g=u}=Bre({fileDescriptors:o,syncResult:c,options:n,isMaxBuffer:h,verboseInfo:s}),y=p.map((w,E)=>Ia(w,n,E)),m=Ia(Hre(p,n),n,"all");return oie({error:g,exitCode:l,signal:d,timedOut:f,isMaxBuffer:h,stdio:y,all:m,options:n,command:r,escapedCommand:i,startTime:a})},iie=({file:t,commandArguments:e,options:n,command:r,escapedCommand:i,fileDescriptors:s,startTime:o})=>{try{Are(s,n);const a=sie(n);return RO(t,e,a)}catch(a){return o0({error:a,command:r,escapedCommand:i,fileDescriptors:s,options:n,startTime:o,isSync:!0})}},sie=({encoding:t,maxBuffer:e,...n})=>({...n,encoding:"buffer",maxBuffer:s0(e)}),oie=({error:t,exitCode:e,signal:n,timedOut:r,isMaxBuffer:i,stdio:s,all:o,options:a,command:c,escapedCommand:u,startTime:l})=>t===void 0?yP({command:c,escapedCommand:u,stdio:s,all:o,ipcOutput:[],options:a,startTime:l}):a0({error:t,command:c,escapedCommand:u,timedOut:r,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:i,isForcefullyTerminated:!1,exitCode:e,signal:n,stdio:s,all:o,ipcOutput:[],options:a,startTime:l,isSync:!0}),aie=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0,filter:s}={})=>(Gb({methodName:"getOneMessage",isSubprocess:n,ipc:r,isConnected:UI(t)}),cie({anyProcess:t,channel:e,isSubprocess:n,filter:s,reference:i})),cie=async({anyProcess:t,channel:e,isSubprocess:n,filter:r,reference:i})=>{qI(e,i);const s=Wp(t,e,n),o=new AbortController;try{return await Promise.race([uie(s,r,o),lie(s,n,o),die(s,n,o)])}catch(a){throw Wb(t),a}finally{o.abort(),jI(e,i)}},uie=async(t,e,{signal:n})=>{if(e===void 0){const[r]=await vn(t,"message",{signal:n});return r}for await(const[r]of dd(t,"message",{signal:n}))if(e(r))return r},lie=async(t,e,{signal:n})=>{await vn(t,"disconnect",{signal:n}),zQ(e)},die=async(t,e,{signal:n})=>{const[r]=await vn(t,"strict:error",{signal:n});throw FI(r,e)},fie=({anyProcess:t,channel:e,isSubprocess:n,ipc:r},{reference:i=!0}={})=>rN({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:!n,reference:i}),rN=({anyProcess:t,channel:e,isSubprocess:n,ipc:r,shouldAwait:i,reference:s})=>{Gb({methodName:"getEachMessage",isSubprocess:n,ipc:r,isConnected:UI(t)}),qI(e,s);const o=Wp(t,e,n),a=new AbortController,c={};return hie(t,o,a),pie({ipcEmitter:o,isSubprocess:n,controller:a,state:c}),gie({anyProcess:t,channel:e,ipcEmitter:o,isSubprocess:n,shouldAwait:i,controller:a,state:c,reference:s})},hie=async(t,e,n)=>{try{await vn(e,"disconnect",{signal:n.signal}),n.abort()}catch{}},pie=async({ipcEmitter:t,isSubprocess:e,controller:n,state:r})=>{try{const[i]=await vn(t,"strict:error",{signal:n.signal});r.error=FI(i,e),n.abort()}catch{}},gie=async function*({anyProcess:t,channel:e,ipcEmitter:n,isSubprocess:r,shouldAwait:i,controller:s,state:o,reference:a}){try{for await(const[c]of dd(n,"message",{signal:s.signal}))iN(o),yield c}catch{iN(o)}finally{s.abort(),jI(e,a),r||Wb(t),i&&await t}},iN=({error:t})=>{if(t)throw t},mie=(t,{ipc:e})=>{Object.assign(t,sN(t,!1,e))},yie=()=>{const t=Ne,e=!0,n=Ne.channel!==void 0;return{...sN(t,e,n),getCancelSignal:wee.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}},sN=(t,e,n)=>({sendMessage:WI.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getOneMessage:aie.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n}),getEachMessage:fie.bind(void 0,{anyProcess:t,channel:t.channel,isSubprocess:e,ipc:n})}),vie=({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,verboseInfo:o})=>{MP(r);const a=new W0;wie(a,r),Object.assign(a,{readable:bie,writable:Eie,duplex:Die});const c=o0({error:t,command:e,escapedCommand:n,fileDescriptors:r,options:i,startTime:s,isSync:!1}),u=Tie(c,o,i);return{subprocess:a,promise:u}},wie=(t,e)=>{const n=sd(),r=sd(),i=sd(),s=Array.from({length:e.length-3},sd),o=sd(),a=[n,r,i,...s];Object.assign(t,{stdin:n,stdout:r,stderr:i,all:o,stdio:a})},sd=()=>{const t=new X0;return t.end(),t},bie=()=>new Es({read(){}}),Eie=()=>new hg({write(){}}),Die=()=>new pg({read(){},write(){}}),Tie=async(t,e,n)=>c0(t,e,n),Rie=(t,e)=>LP(Sie,t,e,!1),od=({type:t,optionName:e})=>{throw new TypeError(`The \`${e}\` option cannot be ${Qp[t]}.`)},oN={fileNumber:od,generator:XP,asyncGenerator:XP,nodeStream:({value:t})=>({stream:t}),webTransform({value:{transform:t,writableObjectMode:e,readableObjectMode:n}}){const r=e||n;return{stream:pg.fromWeb(t,{objectMode:r})}},duplex:({value:{transform:t}})=>({stream:t}),native(){}},Sie={input:{...oN,fileUrl:({value:t})=>({stream:q0(t)}),filePath:({value:{file:t}})=>({stream:q0(t)}),webStream:({value:t})=>({stream:Es.fromWeb(t)}),iterable:({value:t})=>({stream:Es.from(t)}),asyncIterable:({value:t})=>({stream:Es.from(t)}),string:({value:t})=>({stream:Es.from(t)}),uint8Array:({value:t})=>({stream:Es.from(gg.from(t))})},output:{...oN,fileUrl:({value:t})=>({stream:j0(t)}),filePath:({value:{file:t}})=>({stream:j0(t)}),webStream:({value:t})=>({stream:hg.fromWeb(t)}),iterable:od,asyncIterable:od,string:od,uint8Array:od}};function y0(t){if(!Array.isArray(t))throw new TypeError(`Expected an array, got \`${typeof t}\`.`);for(const i of t)v0(i);const e=t.some(({readableObjectMode:i})=>i),n=kie(t,e),r=new $ie({objectMode:e,writableHighWaterMark:n,readableHighWaterMark:n});for(const i of t)r.add(i);return r}const kie=(t,e)=>{if(t.length===0)return fd(e);const n=t.filter(({readableObjectMode:r})=>r===e).map(({readableHighWaterMark:r})=>r);return Math.max(...n)};class $ie extends X0{#e=new Set([]);#t=new Set([]);#n=new Set([]);#r;#s=Symbol("unpipe");#i=new WeakMap;add(e){if(v0(e),this.#e.has(e))return;this.#e.add(e),this.#r??=Cie(this,this.#e,this.#s);const n=xie({passThroughStream:this,stream:e,streams:this.#e,ended:this.#t,aborted:this.#n,onFinished:this.#r,unpipeEvent:this.#s});this.#i.set(e,n),e.pipe(this,{end:!1})}async remove(e){if(v0(e),!this.#e.has(e))return!1;const n=this.#i.get(e);return n===void 0?!1:(this.#i.delete(e),e.unpipe(this),await n,!0)}}const Cie=async(t,e,n)=>{tg(t,lN);const r=new AbortController;try{await Promise.race([_ie(t,r),Aie(t,e,n,r)])}finally{r.abort(),tg(t,-lN)}},_ie=async(t,{signal:e})=>{try{await Ii(t,{signal:e,cleanup:!0})}catch(n){throw aN(t,n),n}},Aie=async(t,e,n,{signal:r})=>{for await(const[i]of dd(t,"unpipe",{signal:r}))e.has(i)&&i.emit(n)},v0=t=>{if(typeof t?.pipe!="function")throw new TypeError(`Expected a readable stream, got: \`${typeof t}\`.`)},xie=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,onFinished:s,unpipeEvent:o})=>{tg(t,dN);const a=new AbortController;try{await Promise.race([Iie(s,e,a),Pie({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:a}),Nie({stream:e,streams:n,ended:r,aborted:i,unpipeEvent:o,controller:a})])}finally{a.abort(),tg(t,-dN)}n.size>0&&n.size===r.size+i.size&&(r.size===0&&i.size>0?w0(t):Oie(t))},Iie=async(t,e,{signal:n})=>{try{await t,n.aborted||w0(e)}catch(r){n.aborted||aN(e,r)}},Pie=async({passThroughStream:t,stream:e,streams:n,ended:r,aborted:i,controller:{signal:s}})=>{try{await Ii(e,{signal:s,cleanup:!0,readable:!0,writable:!1}),n.has(e)&&r.add(e)}catch(o){if(s.aborted||!n.has(e))return;cN(o)?i.add(e):uN(t,o)}},Nie=async({stream:t,streams:e,ended:n,aborted:r,unpipeEvent:i,controller:{signal:s}})=>{if(await vn(t,i,{signal:s}),!t.readable)return vn(s,"abort",{signal:s});e.delete(t),n.delete(t),r.delete(t)},Oie=t=>{t.writable&&t.end()},aN=(t,e)=>{cN(e)?w0(t):uN(t,e)},cN=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",w0=t=>{(t.readable||t.writable)&&t.destroy()},uN=(t,e)=>{t.destroyed||(t.once("error",Fie),t.destroy(e))},Fie=()=>{},tg=(t,e)=>{const n=t.getMaxListeners();n!==0&&n!==Number.POSITIVE_INFINITY&&t.setMaxListeners(n+e)},lN=2,dN=1,ng=(t,e)=>{t.pipe(e),Lie(t,e),Mie(t,e)},Lie=async(t,e)=>{if(!(fo(t)||fo(e))){try{await Ii(t,{cleanup:!0,readable:!0,writable:!1})}catch{}fN(e)}},fN=t=>{t.writable&&t.end()},Mie=async(t,e)=>{if(!(fo(t)||fo(e))){try{await Ii(e,{cleanup:!0,readable:!1,writable:!0})}catch{}hN(t)}},hN=t=>{t.readable&&t.destroy()},zie=(t,e,n)=>{const r=new Map;for(const[i,{stdioItems:s,direction:o}]of Object.entries(e)){for(const{stream:a}of s.filter(({type:c})=>vo.has(c)))Bie(t,a,o,i);for(const{stream:a}of s.filter(({type:c})=>!vo.has(c)))jie({subprocess:t,stream:a,direction:o,fdNumber:i,pipeGroups:r,controller:n})}for(const[i,s]of r.entries()){const o=s.length===1?s[0]:y0(s);ng(o,i)}},Bie=(t,e,n,r)=>{n==="output"?ng(t.stdio[r],e):ng(e,t.stdio[r]);const i=qie[r];i!==void 0&&(t[i]=e),t.stdio[r]=e},qie=["stdin","stdout","stderr"],jie=({subprocess:t,stream:e,direction:n,fdNumber:r,pipeGroups:i,controller:s})=>{if(e===void 0)return;Uie(e,s);const[o,a]=n==="output"?[e,t.stdio[r]]:[t.stdio[r],e],c=i.get(o)??[];i.set(o,[...c,a])},Uie=(t,{signal:e})=>{fo(t)&&Up(t,Gie,e)},Gie=2,Pa=[];Pa.push("SIGHUP","SIGINT","SIGTERM"),process.platform!=="win32"&&Pa.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),process.platform==="linux"&&Pa.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");const rg=t=>!!t&&typeof t=="object"&&typeof t.removeListener=="function"&&typeof t.emit=="function"&&typeof t.reallyExit=="function"&&typeof t.listeners=="function"&&typeof t.kill=="function"&&typeof t.pid=="number"&&typeof t.on=="function",b0=Symbol.for("signal-exit emitter"),E0=globalThis,Wie=Object.defineProperty.bind(Object);class Hie{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(E0[b0])return E0[b0];Wie(E0,b0,{value:this,writable:!1,enumerable:!1,configurable:!1})}on(e,n){this.listeners[e].push(n)}removeListener(e,n){const r=this.listeners[e],i=r.indexOf(n);i!==-1&&(i===0&&r.length===1?r.length=0:r.splice(i,1))}emit(e,n,r){if(this.emitted[e])return!1;this.emitted[e]=!0;let i=!1;for(const s of this.listeners[e])i=s(n,r)===!0||i;return e==="exit"&&(i=this.emit("afterExit",n,r)||i),i}}class pN{}const Vie=t=>({onExit(e,n){return t.onExit(e,n)},load(){return t.load()},unload(){return t.unload()}});class Kie extends pN{onExit(){return()=>{}}load(){}unload(){}}class Yie extends pN{#e=D0.platform==="win32"?"SIGINT":"SIGHUP";#t=new Hie;#n;#r;#s;#i={};#o=!1;constructor(e){super(),this.#n=e,this.#i={};for(const n of Pa)this.#i[n]=()=>{const r=this.#n.listeners(n);let{count:i}=this.#t;const s=e;if(typeof s.__signal_exit_emitter__=="object"&&typeof s.__signal_exit_emitter__.count=="number"&&(i+=s.__signal_exit_emitter__.count),r.length===i){this.unload();const o=this.#t.emit("exit",null,n),a=n==="SIGHUP"?this.#e:n;o||e.kill(e.pid,a)}};this.#s=e.reallyExit,this.#r=e.emit}onExit(e,n){if(!rg(this.#n))return()=>{};this.#o===!1&&this.load();const r=n?.alwaysLast?"afterExit":"exit";return this.#t.on(r,e),()=>{this.#t.removeListener(r,e),this.#t.listeners.exit.length===0&&this.#t.listeners.afterExit.length===0&&this.unload()}}load(){if(!this.#o){this.#o=!0,this.#t.count+=1;for(const e of Pa)try{const n=this.#i[e];n&&this.#n.on(e,n)}catch{}this.#n.emit=(e,...n)=>this.#c(e,...n),this.#n.reallyExit=e=>this.#a(e)}}unload(){this.#o&&(this.#o=!1,Pa.forEach(e=>{const n=this.#i[e];if(!n)throw new Error("Listener not defined for signal: "+e);try{this.#n.removeListener(e,n)}catch{}}),this.#n.emit=this.#r,this.#n.reallyExit=this.#s,this.#t.count-=1)}#a(e){return rg(this.#n)?(this.#n.exitCode=e||0,this.#t.emit("exit",this.#n.exitCode,null),this.#s.call(this.#n,this.#n.exitCode)):0}#c(e,...n){const r=this.#r;if(e==="exit"&&rg(this.#n)){typeof n[0]=="number"&&(this.#n.exitCode=n[0]);const i=r.call(this.#n,e,...n);return this.#t.emit("exit",this.#n.exitCode,null),i}else return r.call(this.#n,e,...n)}}const D0=globalThis.process,{onExit:Xie,load:Fae,unload:Lae}=Vie(rg(D0)?new Yie(D0):new Kie),Jie=(t,{cleanup:e,detached:n},{signal:r})=>{if(!e||n)return;const i=Xie(()=>{t.kill()});Y0(r,()=>{i()})},Zie=({source:t,sourcePromise:e,boundOptions:n,createNested:r},...i)=>{const s=cI(),{destination:o,destinationStream:a,destinationError:c,from:u,unpipeSignal:l}=Qie(n,r,i),{sourceStream:d,sourceError:f}=tse(t,u),{options:h,fileDescriptors:p}=po.get(t);return{sourcePromise:e,sourceStream:d,sourceOptions:h,sourceError:f,destination:o,destinationStream:a,destinationError:c,unpipeSignal:l,fileDescriptors:p,startTime:s}},Qie=(t,e,n)=>{try{const{destination:r,pipeOptions:{from:i,to:s,unpipeSignal:o}={}}=ese(t,e,...n),a=LI(r,s);return{destination:r,destinationStream:a,from:i,unpipeSignal:o}}catch(r){return{destinationError:r}}},ese=(t,e,n,...r)=>{if(Array.isArray(n))return{destination:e(gN,t)(n,...r),pipeOptions:t};if(typeof n=="string"||n instanceof URL){if(Object.keys(t).length>0)throw new TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');const[i,s,o]=Gx(n,...r);return{destination:e(gN)(i,s,o),pipeOptions:o}}if(po.has(n)){if(Object.keys(t).length>0)throw new TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:n,pipeOptions:r[0]}}throw new TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${n}`)},gN=({options:t})=>({options:{...t,stdin:"pipe",piped:!0}}),tse=(t,e)=>{try{return{sourceStream:Hb(t,e)}}catch(n){return{sourceError:n}}},nse=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r,fileDescriptors:i,sourceOptions:s,startTime:o})=>{const a=rse({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r});if(a!==void 0)throw mN({error:a,fileDescriptors:i,sourceOptions:s,startTime:o})},rse=({sourceStream:t,sourceError:e,destinationStream:n,destinationError:r})=>{if(e!==void 0&&r!==void 0)return r;if(r!==void 0)return hN(t),r;if(e!==void 0)return fN(n),e},mN=({error:t,fileDescriptors:e,sourceOptions:n,startTime:r})=>o0({error:t,command:yN,escapedCommand:yN,fileDescriptors:e,options:n,startTime:r,isSync:!1}),yN="source.pipe(destination)",ise=async t=>{const[{status:e,reason:n,value:r=n},{status:i,reason:s,value:o=s}]=await t;if(o.pipedFrom.includes(r)||o.pipedFrom.push(r),i==="rejected")throw o;if(e==="rejected")throw r;return o},sse=(t,e,n)=>{const r=ig.has(e)?ase(t,e):ose(t,e);return Up(t,use,n.signal),Up(e,lse,n.signal),cse(e),r},ose=(t,e)=>{const n=y0([t]);return ng(n,e),ig.set(e,n),n},ase=(t,e)=>{const n=ig.get(e);return n.add(t),n},cse=async t=>{try{await Ii(t,{cleanup:!0,readable:!1,writable:!0})}catch{}ig.delete(t)},ig=new WeakMap,use=2,lse=1,dse=(t,e)=>t===void 0?[]:[fse(t,e)],fse=async(t,{sourceStream:e,mergedStream:n,fileDescriptors:r,sourceOptions:i,startTime:s})=>{await bO(t,e),await n.remove(e);const o=new Error("Pipe canceled by `unpipeSignal` option.");throw mN({error:o,fileDescriptors:r,sourceOptions:i,startTime:s})},T0=(t,...e)=>{if(er(e[0]))return T0.bind(void 0,{...t,boundOptions:{...t.boundOptions,...e[0]}});const{destination:n,...r}=Zie(t,...e),i=hse({...r,destination:n});return i.pipe=T0.bind(void 0,{...t,source:n,sourcePromise:i,boundOptions:{}}),i},hse=async({sourcePromise:t,sourceStream:e,sourceOptions:n,sourceError:r,destination:i,destinationStream:s,destinationError:o,unpipeSignal:a,fileDescriptors:c,startTime:u})=>{const l=pse(t,i);nse({sourceStream:e,sourceError:r,destinationStream:s,destinationError:o,fileDescriptors:c,sourceOptions:n,startTime:u});const d=new AbortController;try{const f=sse(e,s,d);return await Promise.race([ise(l),...dse(a,{sourceStream:e,mergedStream:f,sourceOptions:n,fileDescriptors:c,startTime:u})])}finally{d.abort()}},pse=(t,e)=>Promise.allSettled([t,e]),vN=({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:r,encoding:i,preserveNewlines:s})=>{const o=new AbortController;return gse(e,o),bN({stream:t,controller:o,binary:n,shouldEncode:!t.readableObjectMode&&r,encoding:i,shouldSplit:!t.readableObjectMode,preserveNewlines:s})},gse=async(t,e)=>{try{await t}catch{}finally{e.abort()}},wN=({stream:t,onStreamEnd:e,lines:n,encoding:r,stripFinalNewline:i,allMixed:s})=>{const o=new AbortController;mse(e,o,t);const a=t.readableObjectMode&&!s;return bN({stream:t,controller:o,binary:r==="buffer",shouldEncode:!a,encoding:r,shouldSplit:!a&&n,preserveNewlines:!i})},mse=async(t,e,n)=>{try{await t}catch{n.destroy()}finally{e.abort()}},bN=({stream:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})=>{const a=dd(t,"data",{signal:e.signal,highWaterMark:DN,highWatermark:DN});return yse({onStdoutChunk:a,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o})},EN=fd(!0),DN=EN,yse=async function*({onStdoutChunk:t,controller:e,binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o}){const a=vse({binary:n,shouldEncode:r,encoding:i,shouldSplit:s,preserveNewlines:o});try{for await(const[c]of t)yield*id(c,a,0)}catch(c){if(!e.signal.aborted)throw c}finally{yield*m0(a)}},vse=({binary:t,shouldEncode:e,encoding:n,shouldSplit:r,preserveNewlines:i})=>[VP(t,n,!e),jP(t,i,!r,{})].filter(Boolean),wse=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,buffer:i,maxBuffer:s,lines:o,allMixed:a,stripFinalNewline:c,verboseInfo:u,streamInfo:l})=>{const d=bse({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:a,verboseInfo:u,streamInfo:l});if(!i){await Promise.all([Ese(t),d]);return}const f=qP(c,n),h=wN({stream:t,onStreamEnd:e,lines:o,encoding:r,stripFinalNewline:f,allMixed:a}),[p]=await Promise.all([Dse({stream:t,iterable:h,fdNumber:n,encoding:r,maxBuffer:s,lines:o}),d]);return p},bse=async({stream:t,onStreamEnd:e,fdNumber:n,encoding:r,allMixed:i,verboseInfo:s,streamInfo:{fileDescriptors:o}})=>{if(!QP({stdioItems:o[n]?.stdioItems,encoding:r,verboseInfo:s,fdNumber:n}))return;const a=wN({stream:t,onStreamEnd:e,lines:!0,encoding:r,stripFinalNewline:!0,allMixed:i});await Lre(a,t,n,s)},Ese=async t=>{await _O(),t.readableFlowing===null&&t.resume()},Dse=async({stream:t,stream:{readableObjectMode:e},iterable:n,fdNumber:r,encoding:i,maxBuffer:s,lines:o})=>{try{return e||o?await rte(n,{maxBuffer:s}):i==="buffer"?new Uint8Array(await cte(n,{maxBuffer:s})):await vte(n,{maxBuffer:s})}catch(a){return RN(Rte({error:a,stream:t,readableObjectMode:e,lines:o,encoding:i,fdNumber:r}))}},TN=async t=>{try{return await t}catch(e){return RN(e)}},RN=({bufferedData:t})=>BJ(t)?new Uint8Array(t):t,R0=async(t,e,n,{isSameDirection:r,stopOnExit:i=!1}={})=>{const s=Tse(t,n),o=new AbortController;try{await Promise.race([...i?[n.exitPromise]:[],Ii(t,{cleanup:!0,signal:o.signal})])}catch(a){s.stdinCleanedUp||kse(a,e,n,r)}finally{o.abort()}},Tse=(t,{originalStreams:[e],subprocess:n})=>{const r={stdinCleanedUp:!1};return t===e&&Rse(t,n,r),r},Rse=(t,e,n)=>{const{_destroy:r}=t;t._destroy=(...i)=>{Sse(e,n),r.call(t,...i)}},Sse=({exitCode:t,signalCode:e},n)=>{(t!==null||e!==null)&&(n.stdinCleanedUp=!0)},kse=(t,e,n,r)=>{if(!$se(t,e,n,r))throw t},$se=(t,e,n,r=!0)=>n.propagating?kN(t)||S0(t):(n.propagating=!0,SN(n,e)===r?kN(t):S0(t)),SN=({fileDescriptors:t},e)=>e!=="all"&&t[e].direction==="input",S0=t=>t?.code==="ERR_STREAM_PREMATURE_CLOSE",kN=t=>t?.code==="EPIPE",Cse=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>t.stdio.map((c,u)=>$N({stream:c,fdNumber:u,encoding:e,buffer:n[u],maxBuffer:r[u],lines:i[u],allMixed:!1,stripFinalNewline:s,verboseInfo:o,streamInfo:a})),$N=async({stream:t,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u})=>{if(!t)return;const l=R0(t,e,u);if(SN(u,e)){await l;return}const[d]=await Promise.all([wse({stream:t,onStreamEnd:l,fdNumber:e,encoding:n,buffer:r,maxBuffer:i,lines:s,allMixed:o,stripFinalNewline:a,verboseInfo:c,streamInfo:u}),l]);return d},_se=({stdout:t,stderr:e},{all:n})=>n&&(t||e)?y0([t,e].filter(Boolean)):void 0,Ase=({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:s,verboseInfo:o,streamInfo:a})=>$N({...xse(t,n),fdNumber:"all",encoding:e,maxBuffer:r[1]+r[2],lines:i[1]||i[2],allMixed:Ise(t),stripFinalNewline:s,verboseInfo:o,streamInfo:a}),xse=({stdout:t,stderr:e,all:n},[,r,i])=>{const s=r||i;return s?r?i?{stream:n,buffer:s}:{stream:t,buffer:s}:{stream:e,buffer:s}:{stream:n,buffer:s}},Ise=({all:t,stdout:e,stderr:n})=>t&&e&&n&&e.readableObjectMode!==n.readableObjectMode,Pse=t=>Tb(t,"ipc"),Nse=(t,e)=>{const n=aI(t);Ql({type:"ipc",verboseMessage:n,fdNumber:"ipc",verboseInfo:e})},Ose=async({subprocess:t,buffer:e,maxBuffer:n,ipc:r,ipcOutput:i,verboseInfo:s})=>{if(!r)return i;const o=Pse(s),a=Zl(e,"ipc"),c=Zl(n,"ipc");for await(const u of rN({anyProcess:t,channel:t.channel,isSubprocess:!1,ipc:r,shouldAwait:!1,reference:!0}))a&&(kte(t,i,c),i.push(u)),o&&Nse(u,s);return i},Fse=async(t,e)=>(await Promise.allSettled([t]),e),Lse=async({subprocess:t,options:{encoding:e,buffer:n,maxBuffer:r,lines:i,timeoutDuration:s,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,stripFinalNewline:u,ipc:l,ipcInput:d},context:f,verboseInfo:h,fileDescriptors:p,originalStreams:g,onInternalError:y,controller:m})=>{const w=Vre(t,f),E={originalStreams:g,fileDescriptors:p,subprocess:t,exitPromise:w,propagating:!1},k=Cse({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:h,streamInfo:E}),A=Ase({subprocess:t,encoding:e,buffer:n,maxBuffer:r,lines:i,stripFinalNewline:u,verboseInfo:h,streamInfo:E}),I=[],x=Ose({subprocess:t,buffer:n,maxBuffer:r,ipc:l,ipcOutput:I,verboseInfo:h}),_=Mse(g,t,E),P=zse(p,E);try{return await Promise.race([Promise.all([{},Yre(w),Promise.all(k),A,x,Oee(t,d),..._,...P]),y,Bse(t,m),...$ee(t,s,f,m),...FQ({subprocess:t,cancelSignal:o,gracefulCancel:a,context:f,controller:m}),...Tee({subprocess:t,cancelSignal:o,gracefulCancel:a,forceKillAfterDelay:c,context:f,controller:m})])}catch(O){return f.terminationReason??="other",Promise.all([{error:O},w,Promise.all(k.map(C=>TN(C))),TN(A),Fse(x,I),Promise.allSettled(_),Promise.allSettled(P)])}},Mse=(t,e,n)=>t.map((r,i)=>r===e.stdio[i]?void 0:R0(r,i,n)),zse=(t,e)=>t.flatMap(({stdioItems:n},r)=>n.filter(({value:i,stream:s=i})=>mo(s,{checkOpen:!1})&&!fo(s)).map(({type:i,value:s,stream:o=s})=>R0(o,r,e,{isSameDirection:vo.has(i),stopOnExit:i==="native"}))),Bse=async(t,{signal:e})=>{const[n]=await vn(t,"error",{signal:e});throw n},qse=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),k0=(t,e,n)=>{const r=t[n];r.has(e)||r.set(e,[]);const i=r.get(e),s=td();return i.push(s),{resolve:s.resolve.bind(s),promises:i}},sg=async({resolve:t,promises:e},n)=>{t();const[r]=await Promise.race([Promise.allSettled([!0,n]),Promise.all([!1,...e])]);return!r},CN=async t=>{if(t!==void 0)try{await _N(t)}catch{}},jse=async t=>{if(t!==void 0)try{await AN(t)}catch{}},_N=async t=>{await Ii(t,{cleanup:!0,readable:!1,writable:!0})},AN=async t=>{await Ii(t,{cleanup:!0,readable:!0,writable:!1})},xN=async(t,e)=>{if(await t,e)throw e},IN=(t,e,n)=>{n&&!S0(n)?t.destroy(n):e&&t.destroy()},Use=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,binary:i=!0,preserveNewlines:s=!0}={})=>{const o=i||go.has(n),{subprocessStdout:a,waitReadableDestroy:c}=PN(t,r,e),{readableEncoding:u,readableObjectMode:l,readableHighWaterMark:d}=NN(a,o),{read:f,onStdoutDataDone:h}=ON({subprocessStdout:a,subprocess:t,binary:o,encoding:n,preserveNewlines:s}),p=new Es({read:f,destroy:Do(LN.bind(void 0,{subprocessStdout:a,subprocess:t,waitReadableDestroy:c})),highWaterMark:d,objectMode:l,encoding:u});return FN({subprocessStdout:a,onStdoutDataDone:h,readable:p,subprocess:t}),p},PN=(t,e,n)=>{const r=Hb(t,e),i=k0(n,r,"readableDestroy");return{subprocessStdout:r,waitReadableDestroy:i}},NN=({readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n},r)=>r?{readableEncoding:t,readableObjectMode:e,readableHighWaterMark:n}:{readableEncoding:t,readableObjectMode:!0,readableHighWaterMark:EN},ON=({subprocessStdout:t,subprocess:e,binary:n,encoding:r,preserveNewlines:i})=>{const s=td(),o=vN({subprocessStdout:t,subprocess:e,binary:n,shouldEncode:!n,encoding:r,preserveNewlines:i});return{read(){Gse(this,o,s)},onStdoutDataDone:s}},Gse=async(t,e,n)=>{try{const{value:r,done:i}=await e.next();i?n.resolve():t.push(r)}catch{}},FN=async({subprocessStdout:t,onStdoutDataDone:e,readable:n,subprocess:r,subprocessStdin:i})=>{try{await AN(t),await r,await CN(i),await e,n.readable&&n.push(null)}catch(s){await CN(i),MN(n,s)}},LN=async({subprocessStdout:t,subprocess:e,waitReadableDestroy:n},r)=>{await sg(n,e)&&(MN(t,r),await xN(e,r))},MN=(t,e)=>{IN(t,t.readable,e)},Wse=({subprocess:t,concurrentStreams:e},{to:n}={})=>{const{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}=zN(t,n,e),o=new hg({...BN(r,t,i),destroy:Do(jN.bind(void 0,{subprocessStdin:r,subprocess:t,waitWritableFinal:i,waitWritableDestroy:s})),highWaterMark:r.writableHighWaterMark,objectMode:r.writableObjectMode});return qN(r,o),o},zN=(t,e,n)=>{const r=LI(t,e),i=k0(n,r,"writableFinal"),s=k0(n,r,"writableDestroy");return{subprocessStdin:r,waitWritableFinal:i,waitWritableDestroy:s}},BN=(t,e,n)=>({write:Hse.bind(void 0,t),final:Do(Vse.bind(void 0,t,e,n))}),Hse=(t,e,n,r)=>{t.write(e,n)?r():t.once("drain",r)},Vse=async(t,e,n)=>{await sg(n,e)&&(t.writable&&t.end(),await e)},qN=async(t,e,n)=>{try{await _N(t),e.writable&&e.end()}catch(r){await jse(n),UN(e,r)}},jN=async({subprocessStdin:t,subprocess:e,waitWritableFinal:n,waitWritableDestroy:r},i)=>{await sg(n,e),await sg(r,e)&&(UN(t,i),await xN(e,i))},UN=(t,e)=>{IN(t,t.writable,e)},Kse=({subprocess:t,concurrentStreams:e,encoding:n},{from:r,to:i,binary:s=!0,preserveNewlines:o=!0}={})=>{const a=s||go.has(n),{subprocessStdout:c,waitReadableDestroy:u}=PN(t,r,e),{subprocessStdin:l,waitWritableFinal:d,waitWritableDestroy:f}=zN(t,i,e),{readableEncoding:h,readableObjectMode:p,readableHighWaterMark:g}=NN(c,a),{read:y,onStdoutDataDone:m}=ON({subprocessStdout:c,subprocess:t,binary:a,encoding:n,preserveNewlines:o}),w=new pg({read:y,...BN(l,t,d),destroy:Do(Yse.bind(void 0,{subprocessStdout:c,subprocessStdin:l,subprocess:t,waitReadableDestroy:u,waitWritableFinal:d,waitWritableDestroy:f})),readableHighWaterMark:g,writableHighWaterMark:l.writableHighWaterMark,readableObjectMode:p,writableObjectMode:l.writableObjectMode,encoding:h});return FN({subprocessStdout:c,onStdoutDataDone:m,readable:w,subprocess:t,subprocessStdin:l}),qN(l,w,c),w},Yse=async({subprocessStdout:t,subprocessStdin:e,subprocess:n,waitReadableDestroy:r,waitWritableFinal:i,waitWritableDestroy:s},o)=>{await Promise.all([LN({subprocessStdout:t,subprocess:n,waitReadableDestroy:r},o),jN({subprocessStdin:e,subprocess:n,waitWritableFinal:i,waitWritableDestroy:s},o)])},GN=(t,e,{from:n,binary:r=!1,preserveNewlines:i=!1}={})=>{const s=r||go.has(e),o=Hb(t,n),a=vN({subprocessStdout:o,subprocess:t,binary:s,shouldEncode:!0,encoding:e,preserveNewlines:i});return Xse(a,o,t)},Xse=async function*(t,e,n){try{yield*t}finally{e.readable&&e.destroy(),await n}},Jse=(t,{encoding:e})=>{const n=qse();t.readable=Use.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.writable=Wse.bind(void 0,{subprocess:t,concurrentStreams:n}),t.duplex=Kse.bind(void 0,{subprocess:t,concurrentStreams:n,encoding:e}),t.iterable=GN.bind(void 0,t,e),t[Symbol.asyncIterator]=GN.bind(void 0,t,e,{})},Zse=(t,e)=>{for(const[n,r]of eoe){const i=r.value.bind(e);Reflect.defineProperty(t,n,{...r,value:i})}},Qse=(async()=>{})().constructor.prototype,eoe=["then","catch","finally"].map(t=>[t,Reflect.getOwnPropertyDescriptor(Qse,t)]),toe=(t,e,n,r)=>{const{file:i,commandArguments:s,command:o,escapedCommand:a,startTime:c,verboseInfo:u,options:l,fileDescriptors:d}=noe(t,e,n),{subprocess:f,promise:h}=ioe({file:i,commandArguments:s,options:l,startTime:c,verboseInfo:u,command:o,escapedCommand:a,fileDescriptors:d});return f.pipe=T0.bind(void 0,{source:f,sourcePromise:h,boundOptions:{},createNested:r}),Zse(f,h),po.set(f,{options:l,fileDescriptors:d}),f},noe=(t,e,n)=>{const{command:r,escapedCommand:i,startTime:s,verboseInfo:o}=lI(t,e,n),{file:a,commandArguments:c,options:u}=ZI(t,e,n),l=roe(u),d=Rie(l,o);return{file:a,commandArguments:c,command:r,escapedCommand:i,startTime:s,verboseInfo:o,options:l,fileDescriptors:d}},roe=({timeout:t,signal:e,...n})=>{if(e!==void 0)throw new TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...n,timeoutDuration:t}},ioe=({file:t,commandArguments:e,options:n,startTime:r,verboseInfo:i,command:s,escapedCommand:o,fileDescriptors:a})=>{let c;try{c=SO(t,e,n)}catch(p){return vie({error:p,command:s,escapedCommand:o,fileDescriptors:a,options:n,startTime:r,verboseInfo:i})}const u=new AbortController;xO(Number.POSITIVE_INFINITY,u.signal);const l=[...c.stdio];zie(c,a,u),Jie(c,n,u);const d={},f=td();c.kill=xQ.bind(void 0,{kill:c.kill.bind(c),options:n,onInternalError:f,context:d,controller:u}),c.all=_se(c,n),Jse(c,n),mie(c,n);const h=soe({subprocess:c,options:n,startTime:r,verboseInfo:i,fileDescriptors:a,originalStreams:l,command:s,escapedCommand:o,context:d,onInternalError:f,controller:u});return{subprocess:c,promise:h}},soe=async({subprocess:t,options:e,startTime:n,verboseInfo:r,fileDescriptors:i,originalStreams:s,command:o,escapedCommand:a,context:c,onInternalError:u,controller:l})=>{const[d,[f,h],p,g,y]=await Lse({subprocess:t,options:e,context:c,verboseInfo:r,fileDescriptors:i,originalStreams:s,onInternalError:u,controller:l});l.abort(),u.resolve();const m=p.map((k,A)=>Ia(k,e,A)),w=Ia(g,e,"all"),E=ooe({errorInfo:d,exitCode:f,signal:h,stdio:m,all:w,ipcOutput:y,context:c,options:e,command:o,escapedCommand:a,startTime:n});return c0(E,r,e)},ooe=({errorInfo:t,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,context:o,options:a,command:c,escapedCommand:u,startTime:l})=>"error"in t?a0({error:t.error,command:c,escapedCommand:u,timedOut:o.terminationReason==="timeout",isCanceled:o.terminationReason==="cancel"||o.terminationReason==="gracefulCancel",isGracefullyCanceled:o.terminationReason==="gracefulCancel",isMaxBuffer:t.error instanceof Jp,isForcefullyTerminated:o.isForcefullyTerminated,exitCode:e,signal:n,stdio:r,all:i,ipcOutput:s,options:a,startTime:l,isSync:!1}):yP({command:c,escapedCommand:u,stdio:r,all:i,ipcOutput:s,options:a,startTime:l}),$0=(t,e)=>{const n=Object.fromEntries(Object.entries(e).map(([r,i])=>[r,aoe(r,t[r],i)]));return{...t,...n}},aoe=(t,e,n)=>coe.has(t)&&er(e)&&er(n)?{...e,...n}:n,coe=new Set(["env",...nI]),wo=(t,e,n,r)=>{const i=(o,a,c)=>wo(o,a,n,c),s=(...o)=>uoe({mapArguments:t,deepOptions:n,boundOptions:e,setBoundExeca:r,createNested:i},...o);return r!==void 0&&r(s,i,e),s},uoe=({mapArguments:t,deepOptions:e={},boundOptions:n={},setBoundExeca:r,createNested:i},s,...o)=>{if(er(s))return i(t,$0(n,s),r);const{file:a,commandArguments:c,options:u,isSync:l}=loe({mapArguments:t,firstArgument:s,nextArguments:o,deepOptions:e,boundOptions:n});return l?Qre(a,c,u):toe(a,c,u,i)},loe=({mapArguments:t,firstArgument:e,nextArguments:n,deepOptions:r,boundOptions:i})=>{const s=VJ(e)?KJ(e,n):[e,...n],[o,a,c]=Gx(...s),u=$0($0(r,i),c),{file:l=o,commandArguments:d=a,options:f=u,isSync:h=!1}=t({file:o,commandArguments:a,options:u});return{file:l,commandArguments:d,options:f,isSync:h}},doe=({file:t,commandArguments:e})=>WN(t,e),foe=({file:t,commandArguments:e})=>({...WN(t,e),isSync:!0}),WN=(t,e)=>{if(e.length>0)throw new TypeError(`The command and its arguments must be passed as a single string: ${t} ${e}.`);const[n,...r]=hoe(t);return{file:n,commandArguments:r}},hoe=t=>{if(typeof t!="string")throw new TypeError(`The command must be a string: ${String(t)}.`);const e=t.trim();if(e==="")return[];const n=[];for(const r of e.split(poe)){const i=n.at(-1);i&&i.endsWith("\\")?n[n.length-1]=`${i.slice(0,-1)} ${r}`:n.push(r)}return n},poe=/ +/g,goe=(t,e,n)=>{t.sync=e(yoe,n),t.s=t.sync},moe=({options:t})=>HN(t),yoe=({options:t})=>({...HN(t),isSync:!0}),HN=t=>({options:{...voe(t),...t}}),voe=({input:t,inputFile:e,stdio:n})=>t===void 0&&e===void 0&&n===void 0?{stdin:"inherit"}:{},woe={preferLocal:!0},C0=wo(()=>({}));wo(()=>({isSync:!0})),wo(doe),wo(foe),wo(_ee),wo(moe,{},woe,goe),yie();const _0=Np(2);class boe{constructor(e="dot"){this.path=e}async unflatten(e){return await _0(async()=>{const n=await C0("unflatten",["-l 1","-c 3"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});return n instanceof Error&&(n.stdout?et.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
1815
+
1816
+ but returned
1817
+ ${n.stdout}`):et.error(`[BinaryGraphvizLayouter.layout] '${n.command}' failed: ${n.stderr}
1818
+
1819
+ nothing returned, ignoring...`)),n.stdout&&(e=n.stdout.replaceAll(/\t\[/g," [").replaceAll(/\t/g," ")),e})}async layoutJson(e){return await _0(async()=>{const n=await C0(this.path,["-Tjson","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw et.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: "${n.stderr}"`),n;et.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed "${n.stderr}"`)}return n.stdout})}async acyclic(e){return Promise.reject(new Error("Method not implemented."))}async svg(e){return await _0(async()=>{const n=await C0(this.path,["-Tsvg","-y"],{reject:!1,timeout:1e4,input:e,stdin:"pipe",encoding:"utf8"});if(n instanceof Error){if(!n.stdout)throw et.error(`[BinaryGraphvizLayouter.layout] '${n.command}' nothing returned and failed: ${n.stderr}`),n;et.warn(`[BinaryGraphvizLayouter.layout] '${n.command}' returned result but also failed ${n.stderr}`)}return n.stdout})}}const Eoe="likec4",Doe="1.15.0",Toe="MIT",Roe="https://likec4.dev",Soe="Denis Davydkov <denis@davydkov.com>",koe={url:"https://github.com/sponsors/davydkov"},$oe={type:"git",url:"https://github.com/likec4/likec4.git",directory:"packages/likec4"},Coe={node:">=20"},_oe="https://github.com/likec4/likec4/issues",Aoe="module",xoe="./bin/likec4.mjs",Ioe={".":"./src/index.ts","./react":{types:"./app/react/components/index.ts",default:"./react/index.mjs"},"./react/style.css":"./react/style.css","./icons/all":{types:"./icons/all.d.ts",default:"./icons/all.js"},"./icons/*":{types:"./icons/icon.d.ts",default:"./icons/*"}},Poe={registry:"https://registry.npmjs.org",access:"public",exports:{".":{types:"./dist/index.d.ts",default:"./dist/index.mjs"},"./react":{types:"./react/index.d.ts",default:"./react/index.mjs"},"./react/style.css":"./react/style.css","./icons/all":{types:"./icons/all.d.ts",default:"./icons/all.js"},"./icons/*":{types:"./icons/icon.d.ts",default:"./icons/*"}}},Noe={"turbo-build":"turbo run build --log-prefix=none --log-order=grouped",package:"yarn pack","typecheck:app":"tsc --noEmit -p ./app/tsconfig.json","typecheck:cli":"tsc --noEmit -p ./tsconfig.cli.json",typecheck:"run-p --print-label 'typecheck:*'","build-cli":"unbuild","build-app":"run-p --print-label 'bundle:*'","bundle:app":"tsx scripts/bundle-app.ts","bundle:react":"tsx scripts/bundle-react.ts","bundle:react-dts":"tsx scripts/dts-react.ts","bundle:webcomponent":"tsx scripts/bundle-webcomponent.ts",generate:"tsx scripts/generate.ts",prepack:"turbo run build --log-prefix=none --log-order=grouped",lint:"run -T eslint src/ --fix",clean:"rm -r -f dist app/dist dev/.export dev/dist node_modules/.vite",dev:"tsx watch src/cli/index.ts serve dev","dev:docs:bigbank":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/bigbank","dev:docs:dynamic-view":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/dynamic-view","dev:docs:index-page":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/index-page","dev:docs:theme":"tsx watch src/cli/index.ts serve ../../apps/docs/src/components/likec4-theme","dev:template":"tsx watch src/cli/index.ts serve ../create-likec4/template","dev:example-cloud":"tsx watch src/cli/index.ts serve ../../examples/cloud-system","dev:failed":"tsx watch src/cli/index.ts serve ../../examples/failed","dev:example-dev":"tsx watch src/cli/index.ts serve ../../examples/diagrams-dev/likec4",cli:"tsx src/cli/index.ts","cli:serve":"tsx watch src/cli/index.ts serve dev","cli:build":"tsx src/cli/index.ts build -o dev/dist dev","cli:preview":"tsx src/cli/index.ts preview -o dev/dist dev","cli:export":"tsx src/cli/index.ts export png -o dev/export dev","cli:export:json":"tsx src/cli/index.ts export json -o dev/export/likec4.json dev",test:"vitest run --no-isolate","vitest:ui":"vitest --no-isolate --ui","test:watch":"vitest"},Ooe={"@hpcc-js/wasm-graphviz":"1.6.1","@vitejs/plugin-react-swc":"3.7.1",playwright:"1.47.2",react:"^18.3.1","react-dom":"^18.3.1","type-fest":"4.26.1",vite:"5.4.10"},Foe={"@fontsource/ibm-plex-sans":"^5.1.0","@likec4/core":"workspace:*","@likec4/diagram":"workspace:*","@likec4/generators":"workspace:*","@likec4/icons":"workspace:*","@likec4/language-server":"workspace:*","@likec4/layouts":"workspace:*","@likec4/log":"workspace:*","@likec4/tsconfig":"workspace:*","@mantine/core":"7.13.4","@mantine/hooks":"7.13.4","@mantine/vanilla-extract":"7.13.4","@nanostores/react":"0.8.0","@react-hookz/web":"^24.0.4","@tabler/icons-react":"3.17.0","@tanstack/react-router":"1.45.13","@tanstack/router-cli":"1.45.13","@tanstack/router-vite-plugin":"1.45.13","@types/node":"^20.16.14","@types/prop-types":"^15.7.13","@types/react":"18.3.11","@types/react-dom":"18.3.1","@types/string-hash":"^1.1.3","@types/yargs":"^17.0.33","@vanilla-extract/css":"^1.16.0","@vanilla-extract/dynamic":"^2.1.2","@vanilla-extract/vite-plugin":"^4.0.17","@xyflow/react":"12.3.2","@xyflow/system":"0.0.43",autoprefixer:"^10.4.20",classnames:"^2.5.1",clsx:"^2.1.1",defu:"^6.1.4","dts-bundle-generator":"^9.5.1",esbuild:"^0.24.0","esbuild-node-externals":"^1.15.0",execa:"^9.3.1","fast-equals":"^5.0.1",fdir:"^6.4.2","framer-motion":"^11.11.9","get-port":"^7.1.0",glob:"^11.0.0","html-to-image":"^1.11.11",json5:"^2.2.3",langium:"3.2.0",mkdirp:"^3.0.1",nanostores:"0.11.3","npm-run-all2":"^6.2.6","p-limit":"^6.1.0","package-up":"^5.0.0",postcss:"^8.4.47","postcss-preset-mantine":"^1.17.0","pretty-ms":"^9.1.0","react-error-boundary":"^4.1.2","react-resizable-panels":"^2.1.4","react-shadow":"^20.5.0",remeda:"^2.15.0","std-env":"^3.7.0","string-hash":"^1.1.3","strip-indent":"^4.0.0",terser:"^5.33.0",tinyrainbow:"^1.2.0",tsx:"~4.9.3",turbo:"^2.2.3",typescript:"^5.6.3",ufo:"^1.5.4",unbuild:"^3.0.0-rc.11","vite-plugin-css-injected-by-js":"^3.5.2","vite-plugin-shadow-style":"^1.1.1",vitest:"^2.1.3",yargs:"17.7.2"},Loe="yarn@4.5.1",VN={name:Eoe,version:Doe,license:Toe,homepage:Roe,author:Soe,sponsor:koe,repository:$oe,engines:Coe,bugs:_oe,type:Aoe,bin:xoe,exports:Ioe,publishConfig:Poe,scripts:Noe,dependencies:Ooe,devDependencies:Foe,packageManager:Loe},og=Object.create(null),ad=t=>globalThis.process?.env||import.meta.env||globalThis.Deno?.env.toObject()||globalThis.__env__||(t?og:globalThis),ls=new Proxy(og,{get(t,e){return ad()[e]??og[e]},has(t,e){const n=ad();return e in n||e in og},set(t,e,n){const r=ad(!0);return r[e]=n,!0},deleteProperty(t,e){if(!e)return!1;const n=ad(!0);return delete n[e],!0},ownKeys(){const t=ad(!0);return Object.keys(t)}}),Moe=typeof process<"u"&&process.env&&process.env.NODE_ENV||"",zoe=[["APPVEYOR"],["AWS_AMPLIFY","AWS_APP_ID",{ci:!0}],["AZURE_PIPELINES","SYSTEM_TEAMFOUNDATIONCOLLECTIONURI"],["AZURE_STATIC","INPUT_AZURE_STATIC_WEB_APPS_API_TOKEN"],["APPCIRCLE","AC_APPCIRCLE"],["BAMBOO","bamboo_planKey"],["BITBUCKET","BITBUCKET_COMMIT"],["BITRISE","BITRISE_IO"],["BUDDY","BUDDY_WORKSPACE_ID"],["BUILDKITE"],["CIRCLE","CIRCLECI"],["CIRRUS","CIRRUS_CI"],["CLOUDFLARE_PAGES","CF_PAGES",{ci:!0}],["CODEBUILD","CODEBUILD_BUILD_ARN"],["CODEFRESH","CF_BUILD_ID"],["DRONE"],["DRONE","DRONE_BUILD_EVENT"],["DSARI"],["GITHUB_ACTIONS"],["GITLAB","GITLAB_CI"],["GITLAB","CI_MERGE_REQUEST_ID"],["GOCD","GO_PIPELINE_LABEL"],["LAYERCI"],["HUDSON","HUDSON_URL"],["JENKINS","JENKINS_URL"],["MAGNUM"],["NETLIFY"],["NETLIFY","NETLIFY_LOCAL",{ci:!1}],["NEVERCODE"],["RENDER"],["SAIL","SAILCI"],["SEMAPHORE"],["SCREWDRIVER"],["SHIPPABLE"],["SOLANO","TDDIUM"],["STRIDER"],["TEAMCITY","TEAMCITY_VERSION"],["TRAVIS"],["VERCEL","NOW_BUILDER"],["VERCEL","VERCEL",{ci:!1}],["VERCEL","VERCEL_ENV",{ci:!1}],["APPCENTER","APPCENTER_BUILD_ID"],["CODESANDBOX","CODESANDBOX_SSE",{ci:!1}],["STACKBLITZ"],["STORMKIT"],["CLEAVR"],["ZEABUR"],["CODESPHERE","CODESPHERE_APP_ID",{ci:!0}],["RAILWAY","RAILWAY_PROJECT_ID"],["RAILWAY","RAILWAY_SERVICE_ID"]];function Boe(){if(globalThis.process?.env)for(const t of zoe){const e=t[1]||t[0];if(globalThis.process?.env[e])return{name:t[0].toLowerCase(),...t[2]}}return globalThis.process?.env?.SHELL==="/bin/jsh"&&globalThis.process?.versions?.webcontainer?{name:"stackblitz",ci:!1}:{name:"",ci:!1}}const KN=Boe();KN.name;function bo(t){return t?t!=="false":!1}const qoe=globalThis.process?.platform||"",ag=bo(ls.CI)||KN.ci!==!1,YN=bo(globalThis.process?.stdout&&globalThis.process?.stdout.isTTY);bo(ls.DEBUG);const joe=Moe==="test"||bo(ls.TEST);bo(ls.MINIMAL);const Uoe=/^win/i.test(qoe);!bo(ls.NO_COLOR)&&(bo(ls.FORCE_COLOR)||(YN||Uoe)&&ls.TERM);const Goe=(globalThis.process?.versions?.node||"").replace(/^v/,"")||null;Number(Goe?.split(".")[0]);const Woe=globalThis.process||Object.create(null),XN={versions:{}};new Proxy(Woe,{get(t,e){if(e==="env")return ls;if(e in t)return t[e];if(e in XN)return XN[e]}});const Hoe=globalThis.process?.release?.name==="node",Voe=!!globalThis.Bun||!!globalThis.process?.versions?.bun,Koe=!!globalThis.Deno,Yoe=!!globalThis.fastly,Xoe=!!globalThis.Netlify,Joe=!!globalThis.EdgeRuntime,Zoe=globalThis.navigator?.userAgent==="Cloudflare-Workers",Qoe=!!globalThis.__lagon__,eae=[[Xoe,"netlify"],[Joe,"edge-light"],[Zoe,"workerd"],[Yoe,"fastly"],[Koe,"deno"],[Voe,"bun"],[Hoe,"node"],[Qoe,"lagon"]];function tae(){const t=eae.find(e=>e[0]);if(t)return{name:t[1]}}const nae=tae();nae?.name;const JN=lt.bold(lt.bgRed(lt.white("ERROR"))),rae=lt.bold(lt.yellow("WARN")),iae=lt.bold(lt.green("INFO"));function ZN(t){const e=NO("info",{prefix:t,allowClearScreen:!ag}),n=!ag;return{...e,info(r,i){e.info(`${iae} ${r}`,{timestamp:n,...i})},warn(r,i){e.warn(`${rae} ${r}`,{timestamp:n,...i})},error(r,i){if(r instanceof Error){e.error(`${JN} ${lt.red(r.stack??r.name+" "+r.message)}`,{timestamp:n,error:r,...i});return}e.error(`${JN} ${r}`,{timestamp:n,...i})}}}const A0=()=>{},sae={info:A0,warn:A0,error:A0},oae=1e6;function QN(t){const[e,n]=ld(t),r=e*1e3+n/oae;return{ms:r,pretty:bP(r)}}function aae(t){const e=ld();return{stopAndLog(n="done in "){n=lt.green(`${n}${QN(e).pretty}`),t?t.info(n):et.success(n)}}}class cae{constructor(e){this.services=e,this.layouter=e.likec4.Layouter}cache=new WeakMap;layouter;previousAction=Promise.resolve();limit=Np(2);inflightRequest;async computedViews(){try{this.inflightRequest??=Promise.resolve().then(async()=>await this.services.likec4.ModelBuilder.buildComputedModel());const e=await Promise.resolve(this.inflightRequest);return Object.values(e?.views??{})}finally{this.inflightRequest=void 0}}async layoutViews(){const e=this.services.logger,n=this.previousAction.then(async()=>{const r=(await this.computedViews()).map(i=>this.limit(async()=>{try{let s=this.cache.get(i);return s||(s=await this.layouter.layout(i),this.cache.set(i,s)),s}catch(s){return e.error(s),null}}));return(await Promise.all(r)).filter(ce)});return this.previousAction=n.catch(r=>(e.error(r),Promise.resolve([]))),await n}async diagrams(){return(await this.layoutViews()).map(e=>e.diagram)}async viewsAsGraphvizOut(){const e="All-LayoutedViews-DotWithSvg",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=(await this.computedViews()).map(s=>this.limit(async()=>{const{dot:o,svg:a}=await this.layouter.svg(s);return{id:s.id,dot:o,svg:a}})),i=await Promise.all(r);return n.set(e,i),i}async overviewGraph(){const e="OverviewGraph",n=this.services.WorkspaceCache;if(n.has(e))return await Promise.resolve(n.get(e));const r=await this.computedViews(),i=await this.layouter.layoutOverviewGraph(r);return n.set(e,i),i}}class uae{constructor(e){this.services=e}isInitialized=!1;async initWorkspace(e){if(this.isInitialized)throw new Error("Workspace already initialized");const n=this.services.logger,r=this.services.shared.workspace.WorkspaceManager;n.info(`${lt.dim("workspace:")} ${e.uri}`),r.initialize({capabilities:{},processId:null,rootUri:null,workspaceFolders:[e]}),await r.initializeWorkspace([e])}async init(){if(this.isInitialized)throw new Error("Workspace already initialized");this.isInitialized=!0;const e=this.services.logger,n=this.services.likec4.ModelBuilder,r=this.services.shared.workspace.LangiumDocuments,i=this.services.shared.workspace.DocumentBuilder,s=r.all.toArray();if(s.length===0)throw e.error("no LikeC4 sources found"),new Error("no LikeC4 sources found");e.info(`${lt.dim("workspace:")} found ${s.length} source files`),await i.build(s,{validation:!0});const o=await n.buildComputedModel(),a=th(o?.views??{}).length;if(a===0){e.warn(`${lt.dim("workspace:")} no views found`);return}e.info(`${lt.dim("workspace:")} ${lt.green(`\u2713 computed ${a} views`)}`);const c=await this.services.likec4.Views.diagrams();c.length===a?e.info(`${lt.dim("workspace:")} ${lt.green("\u2713 all views layouted")}`):e.warn(`${lt.dim("workspace:")} ${lt.yellow(`\u2717 layouted ${c.length} views`)}`)}}function eO(t){return e=>new t(e)}const lae={logger:()=>{throw new Error("Logger must be provided")},likec4:{Layouter:()=>{throw new Error("Layouter must be provided")},Views:eO(cae)},cli:{Workspace:eO(uae)}};function tO(t){const e=Fa(t,{useFileSystem:!0,logger:"default",graphviz:"wasm"});let n;switch(e.logger){case!1:n=sae;break;case"vite":n=ZN("c4:lsp ");break;case"default":n=et.withTag("lsp");break;default:n=e.logger}const r=e.graphviz==="binary";n.info(`${lt.dim("version")} ${VN.version}`),n.info(`${lt.dim("layout")} ${r?"binary":"wasm"}`);const i={logger:()=>n,likec4:{Layouter:()=>new LJ(r===!0?new boe:new zJ)}};return kK(e.logger===!1?"silent":"info"),e.logger!==!1&&e.logger!=="default"&&Oe.setReporters([{log:({level:s,...o},a)=>{const c=o.tag||"",u=o.args.map(d=>tv(d)?d.stack??d.message:typeof d=="string"?d:String(d));c&&u.unshift(`[${c}]`);const l=u.join(" ");switch(!0){case s>=Xe.debug:break;case s>=Xe.info:{n.info(l);break}case s>=Xe.log:{n.info(l);break}case s>=Xe.warn:{n.warn(l);break}case s>=Xe.fatal:{n.error(l);break}}}}]),tX(e.useFileSystem?cG:{},lae,i).likec4}const nO=t=>new Error(`Invalid model:
1820
+ ${t.getErrors().map(e=>` ${e.sourceFsPath}:${e.line} ${e.message.slice(0,200)}`).join(`
1821
+ `)}`);class ds{constructor(e,n,r){this.workspace=e,this.langium=n,this.isPrintErrorEnabled=r,this.logger=n.logger,this.langiumDocuments=n.shared.workspace.LangiumDocuments,this.views=n.likec4.Views,this.isPrintErrorEnabled&&this.printErrors()}static async fromSource(e,n){const r=tO(Fa(n,{useFileSystem:!1,logger:!1,graphviz:"wasm"})),i=Jt.from({scheme:"virtual",path:"/workspace"});await r.cli.Workspace.initWorkspace({uri:i.toString(),name:"virtual"});const s=Et.joinPath(i,"source.likec4");r.shared.workspace.LangiumDocuments.createDocument(s,e),await r.cli.Workspace.init();const o=new ds(i.path,r,n?.printErrors??!0);return n?.throwIfInvalid===!0&&o.hasErrors()?(o.dispose(),Promise.reject(nO(o))):o}static likec4Instances=new Map;static async fromWorkspace(e="",n){const r=dO(e);if(!uO(r))throw new Error(`Workspace not found: ${r}`);let i=ds.likec4Instances.get(r);if(!i){const s=tO(Fa(n,{useFileSystem:!0,logger:"default",graphviz:"wasm"}));await s.cli.Workspace.initWorkspace({uri:hO(r).toString(),name:fO(r)}),await s.cli.Workspace.init(),i=new ds(r,s,n?.printErrors??!0),ds.likec4Instances.set(r,i)}return n?.throwIfInvalid===!0&&i.hasErrors()?(i.dispose(),Promise.reject(nO(i))):i}modelComputedRef;modelLayoutedRef;logger;langiumDocuments;views;async diagrams(){return await this.langium.likec4.Views.diagrams()}model(){return this.computedModel()}computedModel(){let e=this.modelComputedRef?.deref();if(!e){const n=this.langium.likec4.ModelBuilder.unsafeSyncBuildModel();if(!n)throw new Error("Failed to build model");const r=this.langium.likec4.ModelBuilder.unsafeSyncBuildComputedModel(n);e=Ua.computed(r),this.modelComputedRef=new WeakRef(e)}return e}async layoutedModel(){let e=this.modelLayoutedRef?.deref();if(!e){const n=await this.langium.likec4.ModelBuilder.buildComputedModel();if(!n)throw new Error("Failed to build model");const r=await this.views.diagrams();e=Ua.layouted({__:"layouted",...n,views:ih(r,yr("id"))}),this.modelLayoutedRef=new WeakRef(e)}return e}getErrors(){return this.langiumDocuments.all.toArray().flatMap(e=>(e.diagnostics??[]).filter(n=>n.severity===Xc.Error).map(({message:n,range:r})=>({message:n,line:r.start.line,range:r,sourceFsPath:e.uri.fsPath})))}hasErrors(){return this.langiumDocuments.all.some(e=>e.diagnostics?.some(n=>n.severity===Xc.Error)??!1)}printErrors(){let e=!1;for(const n of this.langiumDocuments.all){const r=n.diagnostics?.filter(i=>i.severity===1);if(r&&r.length>0){e=!0;const i=r.flatMap(s=>{const o=s.range.start.line,a=s.message.split(`
1822
+ `);return a.length>10&&(a.length=10,a.push("...")),a.map((c,u)=>u===0?" "+lt.dim(`Line ${o}: `)+lt.red(c):" ".repeat(10)+lt.red(c))}).join(`
1823
+ `);this.logger.error(`Invalid ${n.uri.fsPath}
1824
+ ${i}`)}}return e}async notifyUpdate({changed:e,removed:n}){this.modelLayoutedRef=void 0,this.modelComputedRef=void 0;const r=this.langium.shared.workspace.WorkspaceLock;try{let i=!1;return await r.write(async s=>{await this.langium.shared.workspace.DocumentBuilder.update(e?[Jt.file(e)]:[],n?[Jt.file(n)]:[],s),i=!s.isCancellationRequested}),i}catch(i){return this.logger.error(i),!1}}onModelUpdate(e){const n=this.langium.likec4.ModelBuilder.onModelParsed(()=>e());return()=>{n.dispose()}}dispose(){for(const[e,n]of ds.likec4Instances)n===this&&ds.likec4Instances.delete(e)}}export{QN as $,Ss as A,Br as B,DD as C,nt as D,ce as E,Ze as F,Hi as G,VO as H,lt as I,KO as J,Np as K,we as L,Ga as M,YD as N,et as O,vi as P,Ak as Q,A2 as R,vE as S,Mo as T,ZN as U,qV as V,Aw as W,jV as X,oa as Y,kC as Z,Pk as _,Cr as a,aae as a0,kv as a1,yd as a2,qr as a3,$D as a4,Xe as a5,VN as a6,Ma as b,ko as c,Ie as d,kt as e,kD as f,wE as g,Gn as h,za as i,ds as j,$o as k,CC as l,Ua as m,pn as n,Qk as o,Rg as p,sn as q,qo as r,Cd as s,ja as t,vt as u,Dt as v,Ke as w,Qr as x,gd as y,Cg as z};