@xtandard/audit 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +386 -2
- package/bin/xtandard-audit.mjs +3 -0
- package/dist/basic-DU_nPrWV.mjs +176 -0
- package/dist/basic-DU_nPrWV.mjs.map +1 -0
- package/dist/basic-hcXnMF9X.cjs +199 -0
- package/dist/basic-hcXnMF9X.cjs.map +1 -0
- package/dist/canonical-BOgkrX9_.d.cts +17 -0
- package/dist/canonical-CL7gfwhb.d.mts +17 -0
- package/dist/chunk-D7D4PA-g.mjs +13 -0
- package/dist/cli.cjs +773 -0
- package/dist/cli.cjs.map +1 -0
- package/dist/cli.d.cts +46 -0
- package/dist/cli.d.mts +46 -0
- package/dist/cli.mjs +762 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/context-BtR9k9Mt.d.mts +52 -0
- package/dist/context-CJM87uG8.d.cts +52 -0
- package/dist/context-shared-AgBWIRUQ.d.mts +29 -0
- package/dist/context-shared-CUq3cSpV.d.cts +29 -0
- package/dist/context-shared-CupikwQo.mjs +39 -0
- package/dist/context-shared-CupikwQo.mjs.map +1 -0
- package/dist/context-shared-X2ulHHSB.cjs +44 -0
- package/dist/context-shared-X2ulHHSB.cjs.map +1 -0
- package/dist/context.cjs +82 -0
- package/dist/context.cjs.map +1 -0
- package/dist/context.d.cts +2 -0
- package/dist/context.d.mts +2 -0
- package/dist/context.mjs +78 -0
- package/dist/context.mjs.map +1 -0
- package/dist/contract-BljSE-Hx.mjs +33 -0
- package/dist/contract-BljSE-Hx.mjs.map +1 -0
- package/dist/contract-BmwHIiMR.d.mts +150 -0
- package/dist/contract-CWJSYoJl.d.cts +150 -0
- package/dist/contract-Cht05WYQ.d.mts +159 -0
- package/dist/contract-CqYQzB6e.d.cts +49 -0
- package/dist/contract-DYvBNdnR.cjs +74 -0
- package/dist/contract-DYvBNdnR.cjs.map +1 -0
- package/dist/contract-DlTo4u2t.d.cts +30 -0
- package/dist/contract-DlTo4u2t.d.mts +30 -0
- package/dist/contract-DsVL5-gy.cjs +50 -0
- package/dist/contract-DsVL5-gy.cjs.map +1 -0
- package/dist/contract-isM9SjjQ.mjs +39 -0
- package/dist/contract-isM9SjjQ.mjs.map +1 -0
- package/dist/contract-pU3wGFmo.d.cts +159 -0
- package/dist/contract-yPNuFnVy.d.mts +49 -0
- package/dist/core-C0ceVOTk.d.cts +513 -0
- package/dist/core-CTr7dw0v.cjs +1725 -0
- package/dist/core-CTr7dw0v.cjs.map +1 -0
- package/dist/core-IdGEbYdM.mjs +1541 -0
- package/dist/core-IdGEbYdM.mjs.map +1 -0
- package/dist/core-KtEHRScZ.d.mts +513 -0
- package/dist/core.cjs +9 -0
- package/dist/core.d.cts +2 -0
- package/dist/core.d.mts +2 -0
- package/dist/core.mjs +2 -0
- package/dist/create-fetch-handler-1pXSEhGi.d.cts +311 -0
- package/dist/create-fetch-handler-BwQQ_IWf.mjs +2156 -0
- package/dist/create-fetch-handler-BwQQ_IWf.mjs.map +1 -0
- package/dist/create-fetch-handler-D8cTMVX9.cjs +2232 -0
- package/dist/create-fetch-handler-D8cTMVX9.cjs.map +1 -0
- package/dist/create-fetch-handler-zioPVS18.d.mts +311 -0
- package/dist/elysia-shared-C7geKqPP.mjs +55 -0
- package/dist/elysia-shared-C7geKqPP.mjs.map +1 -0
- package/dist/elysia-shared-DT4bfekR.d.cts +20 -0
- package/dist/elysia-shared-DXyAyGz_.cjs +66 -0
- package/dist/elysia-shared-DXyAyGz_.cjs.map +1 -0
- package/dist/elysia-shared-DoL5ab52.d.mts +20 -0
- package/dist/entry-auth-basic.cjs +5 -0
- package/dist/entry-auth-basic.d.cts +83 -0
- package/dist/entry-auth-basic.d.mts +83 -0
- package/dist/entry-auth-basic.mjs +2 -0
- package/dist/entry-auth-delegated.cjs +28 -0
- package/dist/entry-auth-delegated.cjs.map +1 -0
- package/dist/entry-auth-delegated.d.cts +36 -0
- package/dist/entry-auth-delegated.d.mts +36 -0
- package/dist/entry-auth-delegated.mjs +27 -0
- package/dist/entry-auth-delegated.mjs.map +1 -0
- package/dist/entry-auth-none.cjs +4 -0
- package/dist/entry-auth-none.d.cts +25 -0
- package/dist/entry-auth-none.d.mts +25 -0
- package/dist/entry-auth-none.mjs +2 -0
- package/dist/entry-authorization-delegated.cjs +28 -0
- package/dist/entry-authorization-delegated.cjs.map +1 -0
- package/dist/entry-authorization-delegated.d.cts +32 -0
- package/dist/entry-authorization-delegated.d.mts +32 -0
- package/dist/entry-authorization-delegated.mjs +27 -0
- package/dist/entry-authorization-delegated.mjs.map +1 -0
- package/dist/entry-authorization-none.cjs +3 -0
- package/dist/entry-authorization-none.d.cts +18 -0
- package/dist/entry-authorization-none.d.mts +18 -0
- package/dist/entry-authorization-none.mjs +2 -0
- package/dist/entry-authorization-roles.cjs +8 -0
- package/dist/entry-authorization-roles.d.cts +64 -0
- package/dist/entry-authorization-roles.d.mts +64 -0
- package/dist/entry-authorization-roles.mjs +3 -0
- package/dist/entry-bun.cjs +55 -0
- package/dist/entry-bun.cjs.map +1 -0
- package/dist/entry-bun.d.cts +29 -0
- package/dist/entry-bun.d.mts +29 -0
- package/dist/entry-bun.mjs +52 -0
- package/dist/entry-bun.mjs.map +1 -0
- package/dist/entry-drizzle-audit.cjs +191 -0
- package/dist/entry-drizzle-audit.cjs.map +1 -0
- package/dist/entry-drizzle-audit.d.cts +118 -0
- package/dist/entry-drizzle-audit.d.mts +118 -0
- package/dist/entry-drizzle-audit.mjs +186 -0
- package/dist/entry-drizzle-audit.mjs.map +1 -0
- package/dist/entry-drizzle-mysql.cjs +75 -0
- package/dist/entry-drizzle-mysql.cjs.map +1 -0
- package/dist/entry-drizzle-mysql.d.cts +42 -0
- package/dist/entry-drizzle-mysql.d.mts +42 -0
- package/dist/entry-drizzle-mysql.mjs +71 -0
- package/dist/entry-drizzle-mysql.mjs.map +1 -0
- package/dist/entry-drizzle-pg.cjs +82 -0
- package/dist/entry-drizzle-pg.cjs.map +1 -0
- package/dist/entry-drizzle-pg.d.cts +48 -0
- package/dist/entry-drizzle-pg.d.mts +48 -0
- package/dist/entry-drizzle-pg.mjs +78 -0
- package/dist/entry-drizzle-pg.mjs.map +1 -0
- package/dist/entry-drizzle-sqlite.cjs +71 -0
- package/dist/entry-drizzle-sqlite.cjs.map +1 -0
- package/dist/entry-drizzle-sqlite.d.cts +37 -0
- package/dist/entry-drizzle-sqlite.d.mts +37 -0
- package/dist/entry-drizzle-sqlite.mjs +67 -0
- package/dist/entry-drizzle-sqlite.mjs.map +1 -0
- package/dist/entry-elysia.cjs +112 -0
- package/dist/entry-elysia.cjs.map +1 -0
- package/dist/entry-elysia.d.cts +710 -0
- package/dist/entry-elysia.d.mts +710 -0
- package/dist/entry-elysia.mjs +109 -0
- package/dist/entry-elysia.mjs.map +1 -0
- package/dist/entry-elysia2.cjs +101 -0
- package/dist/entry-elysia2.cjs.map +1 -0
- package/dist/entry-elysia2.d.cts +905 -0
- package/dist/entry-elysia2.d.mts +905 -0
- package/dist/entry-elysia2.mjs +98 -0
- package/dist/entry-elysia2.mjs.map +1 -0
- package/dist/entry-express.cjs +90 -0
- package/dist/entry-express.cjs.map +1 -0
- package/dist/entry-express.d.cts +24 -0
- package/dist/entry-express.d.mts +24 -0
- package/dist/entry-express.mjs +88 -0
- package/dist/entry-express.mjs.map +1 -0
- package/dist/entry-hono.cjs +36 -0
- package/dist/entry-hono.cjs.map +1 -0
- package/dist/entry-hono.d.cts +24 -0
- package/dist/entry-hono.d.mts +24 -0
- package/dist/entry-hono.mjs +34 -0
- package/dist/entry-hono.mjs.map +1 -0
- package/dist/entry-hooks-log.cjs +22 -0
- package/dist/entry-hooks-log.cjs.map +1 -0
- package/dist/entry-hooks-log.d.cts +23 -0
- package/dist/entry-hooks-log.d.mts +23 -0
- package/dist/entry-hooks-log.mjs +21 -0
- package/dist/entry-hooks-log.mjs.map +1 -0
- package/dist/entry-sinks-console.cjs +43 -0
- package/dist/entry-sinks-console.cjs.map +1 -0
- package/dist/entry-sinks-console.d.cts +26 -0
- package/dist/entry-sinks-console.d.mts +26 -0
- package/dist/entry-sinks-console.mjs +41 -0
- package/dist/entry-sinks-console.mjs.map +1 -0
- package/dist/entry-sinks-datadog.cjs +97 -0
- package/dist/entry-sinks-datadog.cjs.map +1 -0
- package/dist/entry-sinks-datadog.d.cts +66 -0
- package/dist/entry-sinks-datadog.d.mts +66 -0
- package/dist/entry-sinks-datadog.mjs +91 -0
- package/dist/entry-sinks-datadog.mjs.map +1 -0
- package/dist/entry-sinks-file.cjs +100 -0
- package/dist/entry-sinks-file.cjs.map +1 -0
- package/dist/entry-sinks-file.d.cts +70 -0
- package/dist/entry-sinks-file.d.mts +70 -0
- package/dist/entry-sinks-file.mjs +97 -0
- package/dist/entry-sinks-file.mjs.map +1 -0
- package/dist/entry-sinks-http.cjs +63 -0
- package/dist/entry-sinks-http.cjs.map +1 -0
- package/dist/entry-sinks-http.d.cts +55 -0
- package/dist/entry-sinks-http.d.mts +55 -0
- package/dist/entry-sinks-http.mjs +60 -0
- package/dist/entry-sinks-http.mjs.map +1 -0
- package/dist/entry-sinks-s3.cjs +115 -0
- package/dist/entry-sinks-s3.cjs.map +1 -0
- package/dist/entry-sinks-s3.d.cts +79 -0
- package/dist/entry-sinks-s3.d.mts +79 -0
- package/dist/entry-sinks-s3.mjs +112 -0
- package/dist/entry-sinks-s3.mjs.map +1 -0
- package/dist/entry-sinks-splunk.cjs +80 -0
- package/dist/entry-sinks-splunk.cjs.map +1 -0
- package/dist/entry-sinks-splunk.d.cts +58 -0
- package/dist/entry-sinks-splunk.d.mts +58 -0
- package/dist/entry-sinks-splunk.mjs +77 -0
- package/dist/entry-sinks-splunk.mjs.map +1 -0
- package/dist/entry-sinks-webhook.cjs +130 -0
- package/dist/entry-sinks-webhook.cjs.map +1 -0
- package/dist/entry-sinks-webhook.d.cts +69 -0
- package/dist/entry-sinks-webhook.d.mts +69 -0
- package/dist/entry-sinks-webhook.mjs +125 -0
- package/dist/entry-sinks-webhook.mjs.map +1 -0
- package/dist/entry-sinks-xtandard-webhooks.cjs +64 -0
- package/dist/entry-sinks-xtandard-webhooks.cjs.map +1 -0
- package/dist/entry-sinks-xtandard-webhooks.d.cts +64 -0
- package/dist/entry-sinks-xtandard-webhooks.d.mts +64 -0
- package/dist/entry-sinks-xtandard-webhooks.mjs +63 -0
- package/dist/entry-sinks-xtandard-webhooks.mjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.cjs +47 -0
- package/dist/entry-storage-cloudflare-kv.cjs.map +1 -0
- package/dist/entry-storage-cloudflare-kv.d.cts +42 -0
- package/dist/entry-storage-cloudflare-kv.d.mts +42 -0
- package/dist/entry-storage-cloudflare-kv.mjs +46 -0
- package/dist/entry-storage-cloudflare-kv.mjs.map +1 -0
- package/dist/entry-storage-drizzle.cjs +228 -0
- package/dist/entry-storage-drizzle.cjs.map +1 -0
- package/dist/entry-storage-drizzle.d.cts +43 -0
- package/dist/entry-storage-drizzle.d.mts +43 -0
- package/dist/entry-storage-drizzle.mjs +227 -0
- package/dist/entry-storage-drizzle.mjs.map +1 -0
- package/dist/entry-storage-file.cjs +175 -0
- package/dist/entry-storage-file.cjs.map +1 -0
- package/dist/entry-storage-file.d.cts +41 -0
- package/dist/entry-storage-file.d.mts +41 -0
- package/dist/entry-storage-file.mjs +171 -0
- package/dist/entry-storage-file.mjs.map +1 -0
- package/dist/entry-storage-libsql.cjs +133 -0
- package/dist/entry-storage-libsql.cjs.map +1 -0
- package/dist/entry-storage-libsql.d.cts +60 -0
- package/dist/entry-storage-libsql.d.mts +60 -0
- package/dist/entry-storage-libsql.mjs +132 -0
- package/dist/entry-storage-libsql.mjs.map +1 -0
- package/dist/entry-storage-memory.cjs +3 -0
- package/dist/entry-storage-memory.d.cts +2 -0
- package/dist/entry-storage-memory.d.mts +2 -0
- package/dist/entry-storage-memory.mjs +2 -0
- package/dist/entry-storage-mongodb.cjs +306 -0
- package/dist/entry-storage-mongodb.cjs.map +1 -0
- package/dist/entry-storage-mongodb.d.cts +65 -0
- package/dist/entry-storage-mongodb.d.mts +65 -0
- package/dist/entry-storage-mongodb.mjs +304 -0
- package/dist/entry-storage-mongodb.mjs.map +1 -0
- package/dist/entry-storage-postgres.cjs +261 -0
- package/dist/entry-storage-postgres.cjs.map +1 -0
- package/dist/entry-storage-postgres.d.cts +66 -0
- package/dist/entry-storage-postgres.d.mts +66 -0
- package/dist/entry-storage-postgres.mjs +260 -0
- package/dist/entry-storage-postgres.mjs.map +1 -0
- package/dist/entry-storage-redis.cjs +223 -0
- package/dist/entry-storage-redis.cjs.map +1 -0
- package/dist/entry-storage-redis.d.cts +77 -0
- package/dist/entry-storage-redis.d.mts +77 -0
- package/dist/entry-storage-redis.mjs +221 -0
- package/dist/entry-storage-redis.mjs.map +1 -0
- package/dist/entry-storage-sqlite.cjs +85 -0
- package/dist/entry-storage-sqlite.cjs.map +1 -0
- package/dist/entry-storage-sqlite.d.cts +40 -0
- package/dist/entry-storage-sqlite.d.mts +40 -0
- package/dist/entry-storage-sqlite.mjs +84 -0
- package/dist/entry-storage-sqlite.mjs.map +1 -0
- package/dist/entry-storage-unstorage.cjs +57 -0
- package/dist/entry-storage-unstorage.cjs.map +1 -0
- package/dist/entry-storage-unstorage.d.cts +29 -0
- package/dist/entry-storage-unstorage.d.mts +29 -0
- package/dist/entry-storage-unstorage.mjs +56 -0
- package/dist/entry-storage-unstorage.mjs.map +1 -0
- package/dist/export-B9S-JeYl.mjs +239 -0
- package/dist/export-B9S-JeYl.mjs.map +1 -0
- package/dist/export-BZq0KCCn.d.mts +70 -0
- package/dist/export-DYfMd-ep.cjs +280 -0
- package/dist/export-DYfMd-ep.cjs.map +1 -0
- package/dist/export-Dh8T8I1p.d.cts +70 -0
- package/dist/index.cjs +279 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +286 -0
- package/dist/index.d.mts +284 -0
- package/dist/index.mjs +177 -0
- package/dist/index.mjs.map +1 -0
- package/dist/integrity-BHhjTBNk.cjs +614 -0
- package/dist/integrity-BHhjTBNk.cjs.map +1 -0
- package/dist/integrity-kfY2DNAi.mjs +483 -0
- package/dist/integrity-kfY2DNAi.mjs.map +1 -0
- package/dist/memory-CfykUo9W.cjs +155 -0
- package/dist/memory-CfykUo9W.cjs.map +1 -0
- package/dist/memory-DrR-Tlbf.d.mts +28 -0
- package/dist/memory-GG2Nba1D.mjs +150 -0
- package/dist/memory-GG2Nba1D.mjs.map +1 -0
- package/dist/memory-HpFdlMR_.d.cts +28 -0
- package/dist/none-Be7r6kHH.cjs +33 -0
- package/dist/none-Be7r6kHH.cjs.map +1 -0
- package/dist/none-CGmIIbI8.cjs +49 -0
- package/dist/none-CGmIIbI8.cjs.map +1 -0
- package/dist/none-CkV5mZsB.mjs +33 -0
- package/dist/none-CkV5mZsB.mjs.map +1 -0
- package/dist/none-DBeBeU0Z.mjs +23 -0
- package/dist/none-DBeBeU0Z.mjs.map +1 -0
- package/dist/query-ChGGtlA7.cjs +243 -0
- package/dist/query-ChGGtlA7.cjs.map +1 -0
- package/dist/query-LvZbyi37.mjs +172 -0
- package/dist/query-LvZbyi37.mjs.map +1 -0
- package/dist/react.css +1 -0
- package/dist/react.js +31936 -0
- package/dist/recorder-B3dG3jbd.d.mts +64 -0
- package/dist/recorder-CGY7HK29.d.cts +64 -0
- package/dist/roles-BARtYLSX.cjs +112 -0
- package/dist/roles-BARtYLSX.cjs.map +1 -0
- package/dist/roles-D7Pg89IJ.mjs +83 -0
- package/dist/roles-D7Pg89IJ.mjs.map +1 -0
- package/dist/schema-DmU7Wp0F.d.cts +251 -0
- package/dist/schema-DmU7Wp0F.d.mts +251 -0
- package/dist/schema.cjs +20 -0
- package/dist/schema.cjs.map +1 -0
- package/dist/schema.d.cts +2 -0
- package/dist/schema.d.mts +2 -0
- package/dist/schema.mjs +17 -0
- package/dist/schema.mjs.map +1 -0
- package/dist/shared-CJOyJKqT.d.mts +20 -0
- package/dist/shared-DSDY-V0n.mjs +100 -0
- package/dist/shared-DSDY-V0n.mjs.map +1 -0
- package/dist/shared-EANCdRqn.d.cts +20 -0
- package/dist/shared-OOAq-U4S.cjs +141 -0
- package/dist/shared-OOAq-U4S.cjs.map +1 -0
- package/dist/sql-B7b6HzGy.cjs +280 -0
- package/dist/sql-B7b6HzGy.cjs.map +1 -0
- package/dist/sql-COjPyn3F.mjs +209 -0
- package/dist/sql-COjPyn3F.mjs.map +1 -0
- package/dist/sqlite-event-log-BnoG8eos.cjs +184 -0
- package/dist/sqlite-event-log-BnoG8eos.cjs.map +1 -0
- package/dist/sqlite-event-log-nXmS2DS_.mjs +179 -0
- package/dist/sqlite-event-log-nXmS2DS_.mjs.map +1 -0
- package/dist/streams-CRuxOYcb.d.cts +124 -0
- package/dist/streams-DU0_gvI8.d.mts +124 -0
- package/dist/table-BcarDd10.d.cts +48 -0
- package/dist/table-BcarDd10.d.mts +48 -0
- package/dist/testing.cjs +189 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.cts +103 -0
- package/dist/testing.d.mts +103 -0
- package/dist/testing.mjs +185 -0
- package/dist/testing.mjs.map +1 -0
- package/dist/types-elysia2/adapters/bun.d.ts +47 -0
- package/dist/types-elysia2/adapters/context-shared.d.ts +40 -0
- package/dist/types-elysia2/adapters/elysia-shared.d.ts +36 -0
- package/dist/types-elysia2/adapters/elysia2.d.ts +588 -0
- package/dist/types-elysia2/auth/contract.d.ts +26 -0
- package/dist/types-elysia2/authorization/contract.d.ts +54 -0
- package/dist/types-elysia2/canonical.d.ts +25 -0
- package/dist/types-elysia2/context.d.ts +61 -0
- package/dist/types-elysia2/core.d.ts +232 -0
- package/dist/types-elysia2/duration.d.ts +26 -0
- package/dist/types-elysia2/entry-elysia2.d.ts +10 -0
- package/dist/types-elysia2/event-log.d.ts +33 -0
- package/dist/types-elysia2/export.d.ts +77 -0
- package/dist/types-elysia2/hooks/contract.d.ts +177 -0
- package/dist/types-elysia2/id.d.ts +27 -0
- package/dist/types-elysia2/integrity.d.ts +193 -0
- package/dist/types-elysia2/keys.d.ts +91 -0
- package/dist/types-elysia2/portal.d.ts +137 -0
- package/dist/types-elysia2/query.d.ts +88 -0
- package/dist/types-elysia2/schema.d.ts +247 -0
- package/dist/types-elysia2/server/base-path.d.ts +15 -0
- package/dist/types-elysia2/server/cors.d.ts +36 -0
- package/dist/types-elysia2/server/create-fetch-handler.d.ts +140 -0
- package/dist/types-elysia2/server/openapi.d.ts +25 -0
- package/dist/types-elysia2/server/render-index-html.d.ts +18 -0
- package/dist/types-elysia2/server/routes.d.ts +83 -0
- package/dist/types-elysia2/server/static-assets.d.ts +13 -0
- package/dist/types-elysia2/standard-schema.d.ts +100 -0
- package/dist/types-elysia2/storage/contract.d.ts +106 -0
- package/dist/types-elysia2/streams.d.ts +134 -0
- package/dist/types-elysia2/transforms.d.ts +56 -0
- package/dist/types-elysia2/validation.d.ts +48 -0
- package/dist/types-react/canonical.d.ts +25 -0
- package/dist/types-react/context.d.ts +61 -0
- package/dist/types-react/core.d.ts +232 -0
- package/dist/types-react/duration.d.ts +26 -0
- package/dist/types-react/event-log.d.ts +33 -0
- package/dist/types-react/hooks/contract.d.ts +177 -0
- package/dist/types-react/id.d.ts +27 -0
- package/dist/types-react/integrity.d.ts +193 -0
- package/dist/types-react/keys.d.ts +91 -0
- package/dist/types-react/query.d.ts +88 -0
- package/dist/types-react/react.d.ts +114 -0
- package/dist/types-react/schema.d.ts +247 -0
- package/dist/types-react/standard-schema.d.ts +100 -0
- package/dist/types-react/storage/contract.d.ts +106 -0
- package/dist/types-react/streams.d.ts +134 -0
- package/dist/types-react/transforms.d.ts +56 -0
- package/dist/types-react/ui/App.d.ts +36 -0
- package/dist/types-react/ui/api.d.ts +61 -0
- package/dist/types-react/ui/components/ActionFilter.d.ts +17 -0
- package/dist/types-react/ui/components/ExportMenu.d.ts +13 -0
- package/dist/types-react/ui/components/JsonCodeEditor.d.ts +12 -0
- package/dist/types-react/ui/components/ThemeToggle.d.ts +2 -0
- package/dist/types-react/ui/components/Toast.d.ts +16 -0
- package/dist/types-react/ui/components/audit-bits.d.ts +91 -0
- package/dist/types-react/ui/components/integrity-bits.d.ts +19 -0
- package/dist/types-react/ui/components/primitives.d.ts +50 -0
- package/dist/types-react/ui/components/ui-bits.d.ts +22 -0
- package/dist/types-react/ui/lib/filters.d.ts +70 -0
- package/dist/types-react/ui/lib/format.d.ts +82 -0
- package/dist/types-react/ui/lib/nav-guard.d.ts +20 -0
- package/dist/types-react/ui/lib/portal-container.d.ts +24 -0
- package/dist/types-react/ui/lib/utils.d.ts +3 -0
- package/dist/types-react/ui/theme.d.ts +40 -0
- package/dist/types-react/ui/types.d.ts +67 -0
- package/dist/types-react/ui/views/ActionsView.d.ts +10 -0
- package/dist/types-react/ui/views/EventDrawer.d.ts +15 -0
- package/dist/types-react/ui/views/EventsView.d.ts +10 -0
- package/dist/types-react/ui/views/IntegrityView.d.ts +10 -0
- package/dist/types-react/ui/views/OverviewView.d.ts +9 -0
- package/dist/types-react/ui/views/StreamsView.d.ts +10 -0
- package/dist/types-react/ui/views/TenantsView.d.ts +6 -0
- package/dist/types-react/validation.d.ts +48 -0
- package/dist/ui/assets/favicon-BSj8MPnj.svg +11 -0
- package/dist/ui/assets/index-B-qrQSOM.css +1 -0
- package/dist/ui/assets/index-CemlP5hR.js +244 -0
- package/dist/ui/index.html +15 -0
- package/dist/validation-DFrLESZD.mjs +150 -0
- package/dist/validation-DFrLESZD.mjs.map +1 -0
- package/dist/validation-lb0YXrxx.cjs +235 -0
- package/dist/validation-lb0YXrxx.cjs.map +1 -0
- package/dist/verify.cjs +14 -0
- package/dist/verify.d.cts +5 -0
- package/dist/verify.d.mts +5 -0
- package/dist/verify.mjs +3 -0
- package/package.json +610 -4
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
var iD=Object.defineProperty;var zw=n=>{throw TypeError(n)};var sD=(n,e,t)=>e in n?iD(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Dt=(n,e,t)=>sD(n,typeof e!="symbol"?e+"":e,t),$g=(n,e,t)=>e.has(n)||zw("Cannot "+t);var H=(n,e,t)=>($g(n,e,"read from private field"),t?t.call(n):e.get(n)),Ue=(n,e,t)=>e.has(n)?zw("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),Ee=(n,e,t,i)=>($g(n,e,"write to private field"),i?i.call(n,t):e.set(n,t),t),tt=(n,e,t)=>($g(n,e,"access private method"),t);var _h=(n,e,t,i)=>({set _(r){Ee(n,e,r,t)},get _(){return H(n,e,i)}});function rD(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&i(a)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();function lD(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Zg={exports:{}},yu={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Pw;function oD(){if(Pw)return yu;Pw=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(i,r,o){var a=null;if(o!==void 0&&(a=""+o),r.key!==void 0&&(a=""+r.key),"key"in r){o={};for(var u in r)u!=="key"&&(o[u]=r[u])}else o=r;return r=o.ref,{$$typeof:n,type:i,key:a,ref:r!==void 0?r:null,props:o}}return yu.Fragment=e,yu.jsx=t,yu.jsxs=t,yu}var Iw;function aD(){return Iw||(Iw=1,Zg.exports=oD()),Zg.exports}var x=aD(),Jg={exports:{}},Xe={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Hw;function cD(){if(Hw)return Xe;Hw=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),a=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function v(L){return L===null||typeof L!="object"?null:(L=b&&L[b]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,A={};function C(L,_,J){this.props=L,this.context=_,this.refs=A,this.updater=J||S}C.prototype.isReactComponent={},C.prototype.setState=function(L,_){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,_,"setState")},C.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function T(){}T.prototype=C.prototype;function R(L,_,J){this.props=L,this.context=_,this.refs=A,this.updater=J||S}var N=R.prototype=new T;N.constructor=R,w(N,C.prototype),N.isPureReactComponent=!0;var O=Array.isArray;function z(){}var D={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function B(L,_,J){var le=J.ref;return{$$typeof:n,type:L,key:_,ref:le!==void 0?le:null,props:J}}function K(L,_){return B(L.type,_,L.props)}function F(L){return typeof L=="object"&&L!==null&&L.$$typeof===n}function Y(L){var _={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(J){return _[J]})}var V=/\/+/g;function Z(L,_){return typeof L=="object"&&L!==null&&L.key!=null?Y(""+L.key):_.toString(36)}function q(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(z,z):(L.status="pending",L.then(function(_){L.status==="pending"&&(L.status="fulfilled",L.value=_)},function(_){L.status==="pending"&&(L.status="rejected",L.reason=_)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function P(L,_,J,le,ae){var ee=typeof L;(ee==="undefined"||ee==="boolean")&&(L=null);var se=!1;if(L===null)se=!0;else switch(ee){case"bigint":case"string":case"number":se=!0;break;case"object":switch(L.$$typeof){case n:case e:se=!0;break;case m:return se=L._init,P(se(L._payload),_,J,le,ae)}}if(se)return ae=ae(L),se=le===""?"."+Z(L,0):le,O(ae)?(J="",se!=null&&(J=se.replace(V,"$&/")+"/"),P(ae,_,J,"",function(Ne){return Ne})):ae!=null&&(F(ae)&&(ae=K(ae,J+(ae.key==null||L&&L.key===ae.key?"":(""+ae.key).replace(V,"$&/")+"/")+se)),_.push(ae)),1;se=0;var fe=le===""?".":le+":";if(O(L))for(var me=0;me<L.length;me++)le=L[me],ee=fe+Z(le,me),se+=P(le,_,J,ee,ae);else if(me=v(L),typeof me=="function")for(L=me.call(L),me=0;!(le=L.next()).done;)le=le.value,ee=fe+Z(le,me++),se+=P(le,_,J,ee,ae);else if(ee==="object"){if(typeof L.then=="function")return P(q(L),_,J,le,ae);throw _=String(L),Error("Objects are not valid as a React child (found: "+(_==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":_)+"). If you meant to render a collection of children, use an array instead.")}return se}function W(L,_,J){if(L==null)return L;var le=[],ae=0;return P(L,le,"","",function(ee){return _.call(J,ee,ae++)}),le}function U(L){if(L._status===-1){var _=L._result;_=_(),_.then(function(J){(L._status===0||L._status===-1)&&(L._status=1,L._result=J)},function(J){(L._status===0||L._status===-1)&&(L._status=2,L._result=J)}),L._status===-1&&(L._status=0,L._result=_)}if(L._status===1)return L._result.default;throw L._result}var $=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var _=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(_))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},Q={map:W,forEach:function(L,_,J){W(L,function(){_.apply(this,arguments)},J)},count:function(L){var _=0;return W(L,function(){_++}),_},toArray:function(L){return W(L,function(_){return _})||[]},only:function(L){if(!F(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Xe.Activity=p,Xe.Children=Q,Xe.Component=C,Xe.Fragment=t,Xe.Profiler=r,Xe.PureComponent=R,Xe.StrictMode=i,Xe.Suspense=f,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return D.H.useMemoCache(L)}},Xe.cache=function(L){return function(){return L.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(L,_,J){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var le=w({},L.props),ae=L.key;if(_!=null)for(ee in _.key!==void 0&&(ae=""+_.key),_)!j.call(_,ee)||ee==="key"||ee==="__self"||ee==="__source"||ee==="ref"&&_.ref===void 0||(le[ee]=_[ee]);var ee=arguments.length-2;if(ee===1)le.children=J;else if(1<ee){for(var se=Array(ee),fe=0;fe<ee;fe++)se[fe]=arguments[fe+2];le.children=se}return B(L.type,ae,le)},Xe.createContext=function(L){return L={$$typeof:a,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:o,_context:L},L},Xe.createElement=function(L,_,J){var le,ae={},ee=null;if(_!=null)for(le in _.key!==void 0&&(ee=""+_.key),_)j.call(_,le)&&le!=="key"&&le!=="__self"&&le!=="__source"&&(ae[le]=_[le]);var se=arguments.length-2;if(se===1)ae.children=J;else if(1<se){for(var fe=Array(se),me=0;me<se;me++)fe[me]=arguments[me+2];ae.children=fe}if(L&&L.defaultProps)for(le in se=L.defaultProps,se)ae[le]===void 0&&(ae[le]=se[le]);return B(L,ee,ae)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(L){return{$$typeof:u,render:L}},Xe.isValidElement=F,Xe.lazy=function(L){return{$$typeof:m,_payload:{_status:-1,_result:L},_init:U}},Xe.memo=function(L,_){return{$$typeof:d,type:L,compare:_===void 0?null:_}},Xe.startTransition=function(L){var _=D.T,J={};D.T=J;try{var le=L(),ae=D.S;ae!==null&&ae(J,le),typeof le=="object"&&le!==null&&typeof le.then=="function"&&le.then(z,$)}catch(ee){$(ee)}finally{_!==null&&J.types!==null&&(_.types=J.types),D.T=_}},Xe.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},Xe.use=function(L){return D.H.use(L)},Xe.useActionState=function(L,_,J){return D.H.useActionState(L,_,J)},Xe.useCallback=function(L,_){return D.H.useCallback(L,_)},Xe.useContext=function(L){return D.H.useContext(L)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(L,_){return D.H.useDeferredValue(L,_)},Xe.useEffect=function(L,_){return D.H.useEffect(L,_)},Xe.useEffectEvent=function(L){return D.H.useEffectEvent(L)},Xe.useId=function(){return D.H.useId()},Xe.useImperativeHandle=function(L,_,J){return D.H.useImperativeHandle(L,_,J)},Xe.useInsertionEffect=function(L,_){return D.H.useInsertionEffect(L,_)},Xe.useLayoutEffect=function(L,_){return D.H.useLayoutEffect(L,_)},Xe.useMemo=function(L,_){return D.H.useMemo(L,_)},Xe.useOptimistic=function(L,_){return D.H.useOptimistic(L,_)},Xe.useReducer=function(L,_,J){return D.H.useReducer(L,_,J)},Xe.useRef=function(L){return D.H.useRef(L)},Xe.useState=function(L){return D.H.useState(L)},Xe.useSyncExternalStore=function(L,_,J){return D.H.useSyncExternalStore(L,_,J)},Xe.useTransition=function(){return D.H.useTransition()},Xe.version="19.2.7",Xe}var _w;function ff(){return _w||(_w=1,Jg.exports=cD()),Jg.exports}var E=ff();const Yt=lD(E),Sb=rD({__proto__:null,default:Yt},[E]);var e0={exports:{}},bu={},t0={exports:{}},n0={};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* scheduler.production.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/var Uw;function uD(){return Uw||(Uw=1,(function(n){function e(P,W){var U=P.length;P.push(W);e:for(;0<U;){var $=U-1>>>1,Q=P[$];if(0<r(Q,W))P[$]=W,P[U]=Q,U=$;else break e}}function t(P){return P.length===0?null:P[0]}function i(P){if(P.length===0)return null;var W=P[0],U=P.pop();if(U!==W){P[0]=U;e:for(var $=0,Q=P.length,L=Q>>>1;$<L;){var _=2*($+1)-1,J=P[_],le=_+1,ae=P[le];if(0>r(J,U))le<Q&&0>r(ae,J)?(P[$]=ae,P[le]=U,$=le):(P[$]=J,P[_]=U,$=_);else if(le<Q&&0>r(ae,U))P[$]=ae,P[le]=U,$=le;else break e}}return W}function r(P,W){var U=P.sortIndex-W.sortIndex;return U!==0?U:P.id-W.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var a=Date,u=a.now();n.unstable_now=function(){return a.now()-u}}var f=[],d=[],m=1,p=null,b=3,v=!1,S=!1,w=!1,A=!1,C=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function N(P){for(var W=t(d);W!==null;){if(W.callback===null)i(d);else if(W.startTime<=P)i(d),W.sortIndex=W.expirationTime,e(f,W);else break;W=t(d)}}function O(P){if(w=!1,N(P),!S)if(t(f)!==null)S=!0,z||(z=!0,Y());else{var W=t(d);W!==null&&q(O,W.startTime-P)}}var z=!1,D=-1,j=5,B=-1;function K(){return A?!0:!(n.unstable_now()-B<j)}function F(){if(A=!1,z){var P=n.unstable_now();B=P;var W=!0;try{e:{S=!1,w&&(w=!1,T(D),D=-1),v=!0;var U=b;try{t:{for(N(P),p=t(f);p!==null&&!(p.expirationTime>P&&K());){var $=p.callback;if(typeof $=="function"){p.callback=null,b=p.priorityLevel;var Q=$(p.expirationTime<=P);if(P=n.unstable_now(),typeof Q=="function"){p.callback=Q,N(P),W=!0;break t}p===t(f)&&i(f),N(P)}else i(f);p=t(f)}if(p!==null)W=!0;else{var L=t(d);L!==null&&q(O,L.startTime-P),W=!1}}break e}finally{p=null,b=U,v=!1}W=void 0}}finally{W?Y():z=!1}}}var Y;if(typeof R=="function")Y=function(){R(F)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,Z=V.port2;V.port1.onmessage=F,Y=function(){Z.postMessage(null)}}else Y=function(){C(F,0)};function q(P,W){D=C(function(){P(n.unstable_now())},W)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(P){P.callback=null},n.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<P?Math.floor(1e3/P):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(P){switch(b){case 1:case 2:case 3:var W=3;break;default:W=b}var U=b;b=W;try{return P()}finally{b=U}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(P,W){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var U=b;b=P;try{return W()}finally{b=U}},n.unstable_scheduleCallback=function(P,W,U){var $=n.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?$+U:$):U=$,P){case 1:var Q=-1;break;case 2:Q=250;break;case 5:Q=1073741823;break;case 4:Q=1e4;break;default:Q=5e3}return Q=U+Q,P={id:m++,callback:W,priorityLevel:P,startTime:U,expirationTime:Q,sortIndex:-1},U>$?(P.sortIndex=U,e(d,P),t(f)===null&&P===t(d)&&(w?(T(D),D=-1):w=!0,q(O,U-$))):(P.sortIndex=Q,e(f,P),S||v||(S=!0,z||(z=!0,Y()))),P},n.unstable_shouldYield=K,n.unstable_wrapCallback=function(P){var W=b;return function(){var U=b;b=W;try{return P.apply(this,arguments)}finally{b=U}}}})(n0)),n0}var Vw;function fD(){return Vw||(Vw=1,t0.exports=uD()),t0.exports}var i0={exports:{}},Vn={};/**
|
|
26
|
+
* @license React
|
|
27
|
+
* react-dom.production.js
|
|
28
|
+
*
|
|
29
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
+
*
|
|
31
|
+
* This source code is licensed under the MIT license found in the
|
|
32
|
+
* LICENSE file in the root directory of this source tree.
|
|
33
|
+
*/var qw;function hD(){if(qw)return Vn;qw=1;var n=ff();function e(f){var d="https://react.dev/errors/"+f;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)d+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var i={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function o(f,d,m){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:f,containerInfo:d,implementation:m}}var a=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(f,d){if(f==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return Vn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,Vn.createPortal=function(f,d){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return o(f,d,null,m)},Vn.flushSync=function(f){var d=a.T,m=i.p;try{if(a.T=null,i.p=2,f)return f()}finally{a.T=d,i.p=m,i.d.f()}},Vn.preconnect=function(f,d){typeof f=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,i.d.C(f,d))},Vn.prefetchDNS=function(f){typeof f=="string"&&i.d.D(f)},Vn.preinit=function(f,d){if(typeof f=="string"&&d&&typeof d.as=="string"){var m=d.as,p=u(m,d.crossOrigin),b=typeof d.integrity=="string"?d.integrity:void 0,v=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;m==="style"?i.d.S(f,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:v}):m==="script"&&i.d.X(f,{crossOrigin:p,integrity:b,fetchPriority:v,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Vn.preinitModule=function(f,d){if(typeof f=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var m=u(d.as,d.crossOrigin);i.d.M(f,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&i.d.M(f)},Vn.preload=function(f,d){if(typeof f=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var m=d.as,p=u(m,d.crossOrigin);i.d.L(f,m,{crossOrigin:p,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Vn.preloadModule=function(f,d){if(typeof f=="string")if(d){var m=u(d.as,d.crossOrigin);i.d.m(f,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else i.d.m(f)},Vn.requestFormReset=function(f){i.d.r(f)},Vn.unstable_batchedUpdates=function(f,d){return f(d)},Vn.useFormState=function(f,d,m){return a.H.useFormState(f,d,m)},Vn.useFormStatus=function(){return a.H.useHostTransitionStatus()},Vn.version="19.2.7",Vn}var Fw;function qC(){if(Fw)return i0.exports;Fw=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),i0.exports=hD(),i0.exports}/**
|
|
34
|
+
* @license React
|
|
35
|
+
* react-dom-client.production.js
|
|
36
|
+
*
|
|
37
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
+
*
|
|
39
|
+
* This source code is licensed under the MIT license found in the
|
|
40
|
+
* LICENSE file in the root directory of this source tree.
|
|
41
|
+
*/var Gw;function dD(){if(Gw)return bu;Gw=1;var n=fD(),e=ff(),t=qC();function i(s){var l="https://react.dev/errors/"+s;if(1<arguments.length){l+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)l+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+s+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function o(s){var l=s,c=s;if(s.alternate)for(;l.return;)l=l.return;else{s=l;do l=s,(l.flags&4098)!==0&&(c=l.return),s=l.return;while(s)}return l.tag===3?c:null}function a(s){if(s.tag===13){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function u(s){if(s.tag===31){var l=s.memoizedState;if(l===null&&(s=s.alternate,s!==null&&(l=s.memoizedState)),l!==null)return l.dehydrated}return null}function f(s){if(o(s)!==s)throw Error(i(188))}function d(s){var l=s.alternate;if(!l){if(l=o(s),l===null)throw Error(i(188));return l!==s?null:s}for(var c=s,h=l;;){var g=c.return;if(g===null)break;var y=g.alternate;if(y===null){if(h=g.return,h!==null){c=h;continue}break}if(g.child===y.child){for(y=g.child;y;){if(y===c)return f(g),s;if(y===h)return f(g),l;y=y.sibling}throw Error(i(188))}if(c.return!==h.return)c=g,h=y;else{for(var k=!1,M=g.child;M;){if(M===c){k=!0,c=g,h=y;break}if(M===h){k=!0,h=g,c=y;break}M=M.sibling}if(!k){for(M=y.child;M;){if(M===c){k=!0,c=y,h=g;break}if(M===h){k=!0,h=y,c=g;break}M=M.sibling}if(!k)throw Error(i(189))}}if(c.alternate!==h)throw Error(i(190))}if(c.tag!==3)throw Error(i(188));return c.stateNode.current===c?s:l}function m(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s;for(s=s.child;s!==null;){if(l=m(s),l!==null)return l;s=s.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),T=Symbol.for("react.consumer"),R=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),z=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function Y(s){return s===null||typeof s!="object"?null:(s=F&&s[F]||s["@@iterator"],typeof s=="function"?s:null)}var V=Symbol.for("react.client.reference");function Z(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===V?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case w:return"Fragment";case C:return"Profiler";case A:return"StrictMode";case O:return"Suspense";case z:return"SuspenseList";case B:return"Activity"}if(typeof s=="object")switch(s.$$typeof){case S:return"Portal";case R:return s.displayName||"Context";case T:return(s._context.displayName||"Context")+".Consumer";case N:var l=s.render;return s=s.displayName,s||(s=l.displayName||l.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case D:return l=s.displayName||null,l!==null?l:Z(s.type)||"Memo";case j:l=s._payload,s=s._init;try{return Z(s(l))}catch{}}return null}var q=Array.isArray,P=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U={pending:!1,data:null,method:null,action:null},$=[],Q=-1;function L(s){return{current:s}}function _(s){0>Q||(s.current=$[Q],$[Q]=null,Q--)}function J(s,l){Q++,$[Q]=s.current,s.current=l}var le=L(null),ae=L(null),ee=L(null),se=L(null);function fe(s,l){switch(J(ee,l),J(ae,s),J(le,null),l.nodeType){case 9:case 11:s=(s=l.documentElement)&&(s=s.namespaceURI)?rw(s):0;break;default:if(s=l.tagName,l=l.namespaceURI)l=rw(l),s=lw(l,s);else switch(s){case"svg":s=1;break;case"math":s=2;break;default:s=0}}_(le),J(le,s)}function me(){_(le),_(ae),_(ee)}function Ne(s){s.memoizedState!==null&&J(se,s);var l=le.current,c=lw(l,s.type);l!==c&&(J(ae,s),J(le,c))}function oe(s){ae.current===s&&(_(le),_(ae)),se.current===s&&(_(se),du._currentValue=U)}var xe,Se;function Ge(s){if(xe===void 0)try{throw Error()}catch(c){var l=c.stack.trim().match(/\n( *(at )?)/);xe=l&&l[1]||"",Se=-1<c.stack.indexOf(`
|
|
42
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
+
`+xe+s+Se}var De=!1;function pe(s,l){if(!s||De)return"";De=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(l){var he=function(){throw Error()};if(Object.defineProperty(he.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(he,[])}catch(re){var ie=re}Reflect.construct(s,[],he)}else{try{he.call()}catch(re){ie=re}s.call(he.prototype)}}else{try{throw Error()}catch(re){ie=re}(he=s())&&typeof he.catch=="function"&&he.catch(function(){})}}catch(re){if(re&&ie&&typeof re.stack=="string")return[re.stack,ie.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=h.DetermineComponentFrameRoot(),k=y[0],M=y[1];if(k&&M){var I=k.split(`
|
|
44
|
+
`),ne=M.split(`
|
|
45
|
+
`);for(g=h=0;h<I.length&&!I[h].includes("DetermineComponentFrameRoot");)h++;for(;g<ne.length&&!ne[g].includes("DetermineComponentFrameRoot");)g++;if(h===I.length||g===ne.length)for(h=I.length-1,g=ne.length-1;1<=h&&0<=g&&I[h]!==ne[g];)g--;for(;1<=h&&0<=g;h--,g--)if(I[h]!==ne[g]){if(h!==1||g!==1)do if(h--,g--,0>g||I[h]!==ne[g]){var ce=`
|
|
46
|
+
`+I[h].replace(" at new "," at ");return s.displayName&&ce.includes("<anonymous>")&&(ce=ce.replace("<anonymous>",s.displayName)),ce}while(1<=h&&0<=g);break}}}finally{De=!1,Error.prepareStackTrace=c}return(c=s?s.displayName||s.name:"")?Ge(c):""}function ye(s,l){switch(s.tag){case 26:case 27:case 5:return Ge(s.type);case 16:return Ge("Lazy");case 13:return s.child!==l&&l!==null?Ge("Suspense Fallback"):Ge("Suspense");case 19:return Ge("SuspenseList");case 0:case 15:return pe(s.type,!1);case 11:return pe(s.type.render,!1);case 1:return pe(s.type,!0);case 31:return Ge("Activity");default:return""}}function de(s){try{var l="",c=null;do l+=ye(s,c),c=s,s=s.return;while(s);return l}catch(h){return`
|
|
47
|
+
Error generating stack: `+h.message+`
|
|
48
|
+
`+h.stack}}var Ce=Object.prototype.hasOwnProperty,Te=n.unstable_scheduleCallback,Re=n.unstable_cancelCallback,Me=n.unstable_shouldYield,be=n.unstable_requestPaint,we=n.unstable_now,ve=n.unstable_getCurrentPriorityLevel,We=n.unstable_ImmediatePriority,nt=n.unstable_UserBlockingPriority,Qe=n.unstable_NormalPriority,ht=n.unstable_LowPriority,lt=n.unstable_IdlePriority,Ft=n.log,sn=n.unstable_setDisableYieldValue,Pt=null,He=null;function $e(s){if(typeof Ft=="function"&&sn(s),He&&typeof He.setStrictMode=="function")try{He.setStrictMode(Pt,s)}catch{}}var it=Math.clz32?Math.clz32:vt,yi=Math.log,Nn=Math.LN2;function vt(s){return s>>>=0,s===0?32:31-(yi(s)/Nn|0)|0}var Mt=256,Xt=262144,_e=4194304;function dt(s){var l=s&42;if(l!==0)return l;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return s&261888;case 262144:case 524288:case 1048576:case 2097152:return s&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function Et(s,l,c){var h=s.pendingLanes;if(h===0)return 0;var g=0,y=s.suspendedLanes,k=s.pingedLanes;s=s.warmLanes;var M=h&134217727;return M!==0?(h=M&~y,h!==0?g=dt(h):(k&=M,k!==0?g=dt(k):c||(c=M&~s,c!==0&&(g=dt(c))))):(M=h&~y,M!==0?g=dt(M):k!==0?g=dt(k):c||(c=h&~s,c!==0&&(g=dt(c)))),g===0?0:l!==0&&l!==g&&(l&y)===0&&(y=g&-g,c=l&-l,y>=c||y===32&&(c&4194048)!==0)?l:g}function Kt(s,l){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&l)===0}function Dn(s,l){switch(s){case 1:case 2:case 4:case 8:case 64:return l+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Un(){var s=_e;return _e<<=1,(_e&62914560)===0&&(_e=4194304),s}function Er(s){for(var l=[],c=0;31>c;c++)l.push(s);return l}function Fs(s,l){s.pendingLanes|=l,l!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function Vm(s,l,c,h,g,y){var k=s.pendingLanes;s.pendingLanes=c,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=c,s.entangledLanes&=c,s.errorRecoveryDisabledLanes&=c,s.shellSuspendCounter=0;var M=s.entanglements,I=s.expirationTimes,ne=s.hiddenUpdates;for(c=k&~c;0<c;){var ce=31-it(c),he=1<<ce;M[ce]=0,I[ce]=-1;var ie=ne[ce];if(ie!==null)for(ne[ce]=null,ce=0;ce<ie.length;ce++){var re=ie[ce];re!==null&&(re.lane&=-536870913)}c&=~he}h!==0&&Af(s,h,0),y!==0&&g===0&&s.tag!==0&&(s.suspendedLanes|=y&~(k&~l))}function Af(s,l,c){s.pendingLanes|=l,s.suspendedLanes&=~l;var h=31-it(l);s.entangledLanes|=l,s.entanglements[h]=s.entanglements[h]|1073741824|c&261930}function Uo(s,l){var c=s.entangledLanes|=l;for(s=s.entanglements;c;){var h=31-it(c),g=1<<h;g&l|s[h]&l&&(s[h]|=l),c&=~g}}function Ec(s,l){var c=l&-l;return c=(c&42)!==0?1:Ac(c),(c&(s.suspendedLanes|l))!==0?0:c}function Ac(s){switch(s){case 2:s=1;break;case 8:s=4;break;case 32:s=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:s=128;break;case 268435456:s=134217728;break;default:s=0}return s}function Tc(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function Ar(){var s=W.p;return s!==0?s:(s=window.event,s===void 0?32:Mw(s.type))}function Tf(s,l){var c=W.p;try{return W.p=s,l()}finally{W.p=c}}var ps=Math.random().toString(36).slice(2),Sn="__reactFiber$"+ps,jn="__reactProps$"+ps,Gs="__reactContainer$"+ps,Vo="__reactEvents$"+ps,KM="__reactListeners$"+ps,YM="__reactHandles$"+ps,Kv="__reactResources$"+ps,Rc="__reactMarker$"+ps;function qm(s){delete s[Sn],delete s[jn],delete s[Vo],delete s[KM],delete s[YM]}function qo(s){var l=s[Sn];if(l)return l;for(var c=s.parentNode;c;){if(l=c[Gs]||c[Sn]){if(c=l.alternate,l.child!==null||c!==null&&c.child!==null)for(s=dw(s);s!==null;){if(c=s[Sn])return c;s=dw(s)}return l}s=c,c=s.parentNode}return null}function Fo(s){if(s=s[Sn]||s[Gs]){var l=s.tag;if(l===5||l===6||l===13||l===31||l===26||l===27||l===3)return s}return null}function Mc(s){var l=s.tag;if(l===5||l===26||l===27||l===6)return s.stateNode;throw Error(i(33))}function Go(s){var l=s[Kv];return l||(l=s[Kv]={hoistableStyles:new Map,hoistableScripts:new Map}),l}function Rn(s){s[Rc]=!0}var Yv=new Set,Qv={};function zl(s,l){Ko(s,l),Ko(s+"Capture",l)}function Ko(s,l){for(Qv[s]=l,s=0;s<l.length;s++)Yv.add(l[s])}var QM=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Wv={},Xv={};function WM(s){return Ce.call(Xv,s)?!0:Ce.call(Wv,s)?!1:QM.test(s)?Xv[s]=!0:(Wv[s]=!0,!1)}function Rf(s,l,c){if(WM(l))if(c===null)s.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":s.removeAttribute(l);return;case"boolean":var h=l.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){s.removeAttribute(l);return}}s.setAttribute(l,""+c)}}function Mf(s,l,c){if(c===null)s.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(l);return}s.setAttribute(l,""+c)}}function Ks(s,l,c,h){if(h===null)s.removeAttribute(c);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":s.removeAttribute(c);return}s.setAttributeNS(l,c,""+h)}}function zi(s){switch(typeof s){case"bigint":case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function $v(s){var l=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function XM(s,l,c){var h=Object.getOwnPropertyDescriptor(s.constructor.prototype,l);if(!s.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var g=h.get,y=h.set;return Object.defineProperty(s,l,{configurable:!0,get:function(){return g.call(this)},set:function(k){c=""+k,y.call(this,k)}}),Object.defineProperty(s,l,{enumerable:h.enumerable}),{getValue:function(){return c},setValue:function(k){c=""+k},stopTracking:function(){s._valueTracker=null,delete s[l]}}}}function Fm(s){if(!s._valueTracker){var l=$v(s)?"checked":"value";s._valueTracker=XM(s,l,""+s[l])}}function Zv(s){if(!s)return!1;var l=s._valueTracker;if(!l)return!0;var c=l.getValue(),h="";return s&&(h=$v(s)?s.checked?"true":"false":s.value),s=h,s!==c?(l.setValue(s),!0):!1}function Of(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}var $M=/[\n"\\]/g;function Pi(s){return s.replace($M,function(l){return"\\"+l.charCodeAt(0).toString(16)+" "})}function Gm(s,l,c,h,g,y,k,M){s.name="",k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?s.type=k:s.removeAttribute("type"),l!=null?k==="number"?(l===0&&s.value===""||s.value!=l)&&(s.value=""+zi(l)):s.value!==""+zi(l)&&(s.value=""+zi(l)):k!=="submit"&&k!=="reset"||s.removeAttribute("value"),l!=null?Km(s,k,zi(l)):c!=null?Km(s,k,zi(c)):h!=null&&s.removeAttribute("value"),g==null&&y!=null&&(s.defaultChecked=!!y),g!=null&&(s.checked=g&&typeof g!="function"&&typeof g!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?s.name=""+zi(M):s.removeAttribute("name")}function Jv(s,l,c,h,g,y,k,M){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(s.type=y),l!=null||c!=null){if(!(y!=="submit"&&y!=="reset"||l!=null)){Fm(s);return}c=c!=null?""+zi(c):"",l=l!=null?""+zi(l):c,M||l===s.value||(s.value=l),s.defaultValue=l}h=h??g,h=typeof h!="function"&&typeof h!="symbol"&&!!h,s.checked=M?s.checked:!!h,s.defaultChecked=!!h,k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"&&(s.name=k),Fm(s)}function Km(s,l,c){l==="number"&&Of(s.ownerDocument)===s||s.defaultValue===""+c||(s.defaultValue=""+c)}function Yo(s,l,c,h){if(s=s.options,l){l={};for(var g=0;g<c.length;g++)l["$"+c[g]]=!0;for(c=0;c<s.length;c++)g=l.hasOwnProperty("$"+s[c].value),s[c].selected!==g&&(s[c].selected=g),g&&h&&(s[c].defaultSelected=!0)}else{for(c=""+zi(c),l=null,g=0;g<s.length;g++){if(s[g].value===c){s[g].selected=!0,h&&(s[g].defaultSelected=!0);return}l!==null||s[g].disabled||(l=s[g])}l!==null&&(l.selected=!0)}}function ex(s,l,c){if(l!=null&&(l=""+zi(l),l!==s.value&&(s.value=l),c==null)){s.defaultValue!==l&&(s.defaultValue=l);return}s.defaultValue=c!=null?""+zi(c):""}function tx(s,l,c,h){if(l==null){if(h!=null){if(c!=null)throw Error(i(92));if(q(h)){if(1<h.length)throw Error(i(93));h=h[0]}c=h}c==null&&(c=""),l=c}c=zi(l),s.defaultValue=c,h=s.textContent,h===c&&h!==""&&h!==null&&(s.value=h),Fm(s)}function Qo(s,l){if(l){var c=s.firstChild;if(c&&c===s.lastChild&&c.nodeType===3){c.nodeValue=l;return}}s.textContent=l}var ZM=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function nx(s,l,c){var h=l.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?h?s.setProperty(l,""):l==="float"?s.cssFloat="":s[l]="":h?s.setProperty(l,c):typeof c!="number"||c===0||ZM.has(l)?l==="float"?s.cssFloat=c:s[l]=(""+c).trim():s[l]=c+"px"}function ix(s,l,c){if(l!=null&&typeof l!="object")throw Error(i(62));if(s=s.style,c!=null){for(var h in c)!c.hasOwnProperty(h)||l!=null&&l.hasOwnProperty(h)||(h.indexOf("--")===0?s.setProperty(h,""):h==="float"?s.cssFloat="":s[h]="");for(var g in l)h=l[g],l.hasOwnProperty(g)&&c[g]!==h&&nx(s,g,h)}else for(var y in l)l.hasOwnProperty(y)&&nx(s,y,l[y])}function Ym(s){if(s.indexOf("-")===-1)return!1;switch(s){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var JM=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),eO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Nf(s){return eO.test(""+s)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":s}function Ys(){}var Qm=null;function Wm(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Wo=null,Xo=null;function sx(s){var l=Fo(s);if(l&&(s=l.stateNode)){var c=s[jn]||null;e:switch(s=l.stateNode,l.type){case"input":if(Gm(s,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),l=c.name,c.type==="radio"&&l!=null){for(c=s;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Pi(""+l)+'"][type="radio"]'),l=0;l<c.length;l++){var h=c[l];if(h!==s&&h.form===s.form){var g=h[jn]||null;if(!g)throw Error(i(90));Gm(h,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(l=0;l<c.length;l++)h=c[l],h.form===s.form&&Zv(h)}break e;case"textarea":ex(s,c.value,c.defaultValue);break e;case"select":l=c.value,l!=null&&Yo(s,!!c.multiple,l,!1)}}}var Xm=!1;function rx(s,l,c){if(Xm)return s(l,c);Xm=!0;try{var h=s(l);return h}finally{if(Xm=!1,(Wo!==null||Xo!==null)&&(bh(),Wo&&(l=Wo,s=Xo,Xo=Wo=null,sx(l),s)))for(l=0;l<s.length;l++)sx(s[l])}}function Oc(s,l){var c=s.stateNode;if(c===null)return null;var h=c[jn]||null;if(h===null)return null;c=h[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(s=s.type,h=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!h;break e;default:s=!1}if(s)return null;if(c&&typeof c!="function")throw Error(i(231,l,typeof c));return c}var Qs=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$m=!1;if(Qs)try{var Nc={};Object.defineProperty(Nc,"passive",{get:function(){$m=!0}}),window.addEventListener("test",Nc,Nc),window.removeEventListener("test",Nc,Nc)}catch{$m=!1}var Tr=null,Zm=null,Df=null;function lx(){if(Df)return Df;var s,l=Zm,c=l.length,h,g="value"in Tr?Tr.value:Tr.textContent,y=g.length;for(s=0;s<c&&l[s]===g[s];s++);var k=c-s;for(h=1;h<=k&&l[c-h]===g[y-h];h++);return Df=g.slice(s,1<h?1-h:void 0)}function jf(s){var l=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&l===13&&(s=13)):s=l,s===10&&(s=13),32<=s||s===13?s:0}function Lf(){return!0}function ox(){return!1}function si(s){function l(c,h,g,y,k){this._reactName=c,this._targetInst=g,this.type=h,this.nativeEvent=y,this.target=k,this.currentTarget=null;for(var M in s)s.hasOwnProperty(M)&&(c=s[M],this[M]=c?c(y):y[M]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Lf:ox,this.isPropagationStopped=ox,this}return p(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Lf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Lf)},persist:function(){},isPersistent:Lf}),l}var Pl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bf=si(Pl),Dc=p({},Pl,{view:0,detail:0}),tO=si(Dc),Jm,ep,jc,zf=p({},Dc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:np,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==jc&&(jc&&s.type==="mousemove"?(Jm=s.screenX-jc.screenX,ep=s.screenY-jc.screenY):ep=Jm=0,jc=s),Jm)},movementY:function(s){return"movementY"in s?s.movementY:ep}}),ax=si(zf),nO=p({},zf,{dataTransfer:0}),iO=si(nO),sO=p({},Dc,{relatedTarget:0}),tp=si(sO),rO=p({},Pl,{animationName:0,elapsedTime:0,pseudoElement:0}),lO=si(rO),oO=p({},Pl,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),aO=si(oO),cO=p({},Pl,{data:0}),cx=si(cO),uO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},fO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},hO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dO(s){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(s):(s=hO[s])?!!l[s]:!1}function np(){return dO}var mO=p({},Dc,{key:function(s){if(s.key){var l=uO[s.key]||s.key;if(l!=="Unidentified")return l}return s.type==="keypress"?(s=jf(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?fO[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:np,charCode:function(s){return s.type==="keypress"?jf(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?jf(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),pO=si(mO),gO=p({},zf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ux=si(gO),yO=p({},Dc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:np}),bO=si(yO),vO=p({},Pl,{propertyName:0,elapsedTime:0,pseudoElement:0}),xO=si(vO),SO=p({},zf,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),wO=si(SO),kO=p({},Pl,{newState:0,oldState:0}),CO=si(kO),EO=[9,13,27,32],ip=Qs&&"CompositionEvent"in window,Lc=null;Qs&&"documentMode"in document&&(Lc=document.documentMode);var AO=Qs&&"TextEvent"in window&&!Lc,fx=Qs&&(!ip||Lc&&8<Lc&&11>=Lc),hx=" ",dx=!1;function mx(s,l){switch(s){case"keyup":return EO.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function px(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var $o=!1;function TO(s,l){switch(s){case"compositionend":return px(l);case"keypress":return l.which!==32?null:(dx=!0,hx);case"textInput":return s=l.data,s===hx&&dx?null:s;default:return null}}function RO(s,l){if($o)return s==="compositionend"||!ip&&mx(s,l)?(s=lx(),Df=Zm=Tr=null,$o=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return fx&&l.locale!=="ko"?null:l.data;default:return null}}var MO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function gx(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l==="input"?!!MO[s.type]:l==="textarea"}function yx(s,l,c,h){Wo?Xo?Xo.push(h):Xo=[h]:Wo=h,l=Eh(l,"onChange"),0<l.length&&(c=new Bf("onChange","change",null,c,h),s.push({event:c,listeners:l}))}var Bc=null,zc=null;function OO(s){JS(s,0)}function Pf(s){var l=Mc(s);if(Zv(l))return s}function bx(s,l){if(s==="change")return l}var vx=!1;if(Qs){var sp;if(Qs){var rp="oninput"in document;if(!rp){var xx=document.createElement("div");xx.setAttribute("oninput","return;"),rp=typeof xx.oninput=="function"}sp=rp}else sp=!1;vx=sp&&(!document.documentMode||9<document.documentMode)}function Sx(){Bc&&(Bc.detachEvent("onpropertychange",wx),zc=Bc=null)}function wx(s){if(s.propertyName==="value"&&Pf(zc)){var l=[];yx(l,zc,s,Wm(s)),rx(OO,l)}}function NO(s,l,c){s==="focusin"?(Sx(),Bc=l,zc=c,Bc.attachEvent("onpropertychange",wx)):s==="focusout"&&Sx()}function DO(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Pf(zc)}function jO(s,l){if(s==="click")return Pf(l)}function LO(s,l){if(s==="input"||s==="change")return Pf(l)}function BO(s,l){return s===l&&(s!==0||1/s===1/l)||s!==s&&l!==l}var bi=typeof Object.is=="function"?Object.is:BO;function Pc(s,l){if(bi(s,l))return!0;if(typeof s!="object"||s===null||typeof l!="object"||l===null)return!1;var c=Object.keys(s),h=Object.keys(l);if(c.length!==h.length)return!1;for(h=0;h<c.length;h++){var g=c[h];if(!Ce.call(l,g)||!bi(s[g],l[g]))return!1}return!0}function kx(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Cx(s,l){var c=kx(s);s=0;for(var h;c;){if(c.nodeType===3){if(h=s+c.textContent.length,s<=l&&h>=l)return{node:c,offset:l-s};s=h}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=kx(c)}}function Ex(s,l){return s&&l?s===l?!0:s&&s.nodeType===3?!1:l&&l.nodeType===3?Ex(s,l.parentNode):"contains"in s?s.contains(l):s.compareDocumentPosition?!!(s.compareDocumentPosition(l)&16):!1:!1}function Ax(s){s=s!=null&&s.ownerDocument!=null&&s.ownerDocument.defaultView!=null?s.ownerDocument.defaultView:window;for(var l=Of(s.document);l instanceof s.HTMLIFrameElement;){try{var c=typeof l.contentWindow.location.href=="string"}catch{c=!1}if(c)s=l.contentWindow;else break;l=Of(s.document)}return l}function lp(s){var l=s&&s.nodeName&&s.nodeName.toLowerCase();return l&&(l==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||l==="textarea"||s.contentEditable==="true")}var zO=Qs&&"documentMode"in document&&11>=document.documentMode,Zo=null,op=null,Ic=null,ap=!1;function Tx(s,l,c){var h=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;ap||Zo==null||Zo!==Of(h)||(h=Zo,"selectionStart"in h&&lp(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),Ic&&Pc(Ic,h)||(Ic=h,h=Eh(op,"onSelect"),0<h.length&&(l=new Bf("onSelect","select",null,l,c),s.push({event:l,listeners:h}),l.target=Zo)))}function Il(s,l){var c={};return c[s.toLowerCase()]=l.toLowerCase(),c["Webkit"+s]="webkit"+l,c["Moz"+s]="moz"+l,c}var Jo={animationend:Il("Animation","AnimationEnd"),animationiteration:Il("Animation","AnimationIteration"),animationstart:Il("Animation","AnimationStart"),transitionrun:Il("Transition","TransitionRun"),transitionstart:Il("Transition","TransitionStart"),transitioncancel:Il("Transition","TransitionCancel"),transitionend:Il("Transition","TransitionEnd")},cp={},Rx={};Qs&&(Rx=document.createElement("div").style,"AnimationEvent"in window||(delete Jo.animationend.animation,delete Jo.animationiteration.animation,delete Jo.animationstart.animation),"TransitionEvent"in window||delete Jo.transitionend.transition);function Hl(s){if(cp[s])return cp[s];if(!Jo[s])return s;var l=Jo[s],c;for(c in l)if(l.hasOwnProperty(c)&&c in Rx)return cp[s]=l[c];return s}var Mx=Hl("animationend"),Ox=Hl("animationiteration"),Nx=Hl("animationstart"),PO=Hl("transitionrun"),IO=Hl("transitionstart"),HO=Hl("transitioncancel"),Dx=Hl("transitionend"),jx=new Map,up="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");up.push("scrollEnd");function ts(s,l){jx.set(s,l),zl(l,[s])}var If=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var l=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(l))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Ii=[],ea=0,fp=0;function Hf(){for(var s=ea,l=fp=ea=0;l<s;){var c=Ii[l];Ii[l++]=null;var h=Ii[l];Ii[l++]=null;var g=Ii[l];Ii[l++]=null;var y=Ii[l];if(Ii[l++]=null,h!==null&&g!==null){var k=h.pending;k===null?g.next=g:(g.next=k.next,k.next=g),h.pending=g}y!==0&&Lx(c,g,y)}}function _f(s,l,c,h){Ii[ea++]=s,Ii[ea++]=l,Ii[ea++]=c,Ii[ea++]=h,fp|=h,s.lanes|=h,s=s.alternate,s!==null&&(s.lanes|=h)}function hp(s,l,c,h){return _f(s,l,c,h),Uf(s)}function _l(s,l){return _f(s,null,null,l),Uf(s)}function Lx(s,l,c){s.lanes|=c;var h=s.alternate;h!==null&&(h.lanes|=c);for(var g=!1,y=s.return;y!==null;)y.childLanes|=c,h=y.alternate,h!==null&&(h.childLanes|=c),y.tag===22&&(s=y.stateNode,s===null||s._visibility&1||(g=!0)),s=y,y=y.return;return s.tag===3?(y=s.stateNode,g&&l!==null&&(g=31-it(c),s=y.hiddenUpdates,h=s[g],h===null?s[g]=[l]:h.push(l),l.lane=c|536870912),y):null}function Uf(s){if(50<lu)throw lu=0,Sg=null,Error(i(185));for(var l=s.return;l!==null;)s=l,l=s.return;return s.tag===3?s.stateNode:null}var ta={};function _O(s,l,c,h){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vi(s,l,c,h){return new _O(s,l,c,h)}function dp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Ws(s,l){var c=s.alternate;return c===null?(c=vi(s.tag,l,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=l,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&65011712,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,l=s.dependencies,c.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c.refCleanup=s.refCleanup,c}function Bx(s,l){s.flags&=65011714;var c=s.alternate;return c===null?(s.childLanes=0,s.lanes=l,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=c.childLanes,s.lanes=c.lanes,s.child=c.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=c.memoizedProps,s.memoizedState=c.memoizedState,s.updateQueue=c.updateQueue,s.type=c.type,l=c.dependencies,s.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext}),s}function Vf(s,l,c,h,g,y){var k=0;if(h=s,typeof s=="function")dp(s)&&(k=1);else if(typeof s=="string")k=GN(s,c,le.current)?26:s==="html"||s==="head"||s==="body"?27:5;else e:switch(s){case B:return s=vi(31,c,l,g),s.elementType=B,s.lanes=y,s;case w:return Ul(c.children,g,y,l);case A:k=8,g|=24;break;case C:return s=vi(12,c,l,g|2),s.elementType=C,s.lanes=y,s;case O:return s=vi(13,c,l,g),s.elementType=O,s.lanes=y,s;case z:return s=vi(19,c,l,g),s.elementType=z,s.lanes=y,s;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case R:k=10;break e;case T:k=9;break e;case N:k=11;break e;case D:k=14;break e;case j:k=16,h=null;break e}k=29,c=Error(i(130,s===null?"null":typeof s,"")),h=null}return l=vi(k,c,l,g),l.elementType=s,l.type=h,l.lanes=y,l}function Ul(s,l,c,h){return s=vi(7,s,h,l),s.lanes=c,s}function mp(s,l,c){return s=vi(6,s,null,l),s.lanes=c,s}function zx(s){var l=vi(18,null,null,0);return l.stateNode=s,l}function pp(s,l,c){return l=vi(4,s.children!==null?s.children:[],s.key,l),l.lanes=c,l.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},l}var Px=new WeakMap;function Hi(s,l){if(typeof s=="object"&&s!==null){var c=Px.get(s);return c!==void 0?c:(l={value:s,source:l,stack:de(l)},Px.set(s,l),l)}return{value:s,source:l,stack:de(l)}}var na=[],ia=0,qf=null,Hc=0,_i=[],Ui=0,Rr=null,gs=1,ys="";function Xs(s,l){na[ia++]=Hc,na[ia++]=qf,qf=s,Hc=l}function Ix(s,l,c){_i[Ui++]=gs,_i[Ui++]=ys,_i[Ui++]=Rr,Rr=s;var h=gs;s=ys;var g=32-it(h)-1;h&=~(1<<g),c+=1;var y=32-it(l)+g;if(30<y){var k=g-g%5;y=(h&(1<<k)-1).toString(32),h>>=k,g-=k,gs=1<<32-it(l)+g|c<<g|h,ys=y+s}else gs=1<<y|c<<g|h,ys=s}function gp(s){s.return!==null&&(Xs(s,1),Ix(s,1,0))}function yp(s){for(;s===qf;)qf=na[--ia],na[ia]=null,Hc=na[--ia],na[ia]=null;for(;s===Rr;)Rr=_i[--Ui],_i[Ui]=null,ys=_i[--Ui],_i[Ui]=null,gs=_i[--Ui],_i[Ui]=null}function Hx(s,l){_i[Ui++]=gs,_i[Ui++]=ys,_i[Ui++]=Rr,gs=l.id,ys=l.overflow,Rr=s}var Ln=null,Vt=null,gt=!1,Mr=null,Vi=!1,bp=Error(i(519));function Or(s){var l=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _c(Hi(l,s)),bp}function _x(s){var l=s.stateNode,c=s.type,h=s.memoizedProps;switch(l[Sn]=s,l[jn]=h,c){case"dialog":ut("cancel",l),ut("close",l);break;case"iframe":case"object":case"embed":ut("load",l);break;case"video":case"audio":for(c=0;c<au.length;c++)ut(au[c],l);break;case"source":ut("error",l);break;case"img":case"image":case"link":ut("error",l),ut("load",l);break;case"details":ut("toggle",l);break;case"input":ut("invalid",l),Jv(l,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":ut("invalid",l);break;case"textarea":ut("invalid",l),tx(l,h.value,h.defaultValue,h.children)}c=h.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||l.textContent===""+c||h.suppressHydrationWarning===!0||iw(l.textContent,c)?(h.popover!=null&&(ut("beforetoggle",l),ut("toggle",l)),h.onScroll!=null&&ut("scroll",l),h.onScrollEnd!=null&&ut("scrollend",l),h.onClick!=null&&(l.onclick=Ys),l=!0):l=!1,l||Or(s,!0)}function Ux(s){for(Ln=s.return;Ln;)switch(Ln.tag){case 5:case 31:case 13:Vi=!1;return;case 27:case 3:Vi=!0;return;default:Ln=Ln.return}}function sa(s){if(s!==Ln)return!1;if(!gt)return Ux(s),gt=!0,!1;var l=s.tag,c;if((c=l!==3&&l!==27)&&((c=l===5)&&(c=s.type,c=!(c!=="form"&&c!=="button")||zg(s.type,s.memoizedProps)),c=!c),c&&Vt&&Or(s),Ux(s),l===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));Vt=hw(s)}else if(l===31){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(317));Vt=hw(s)}else l===27?(l=Vt,Fr(s.type)?(s=Ug,Ug=null,Vt=s):Vt=l):Vt=Ln?Fi(s.stateNode.nextSibling):null;return!0}function Vl(){Vt=Ln=null,gt=!1}function vp(){var s=Mr;return s!==null&&(ai===null?ai=s:ai.push.apply(ai,s),Mr=null),s}function _c(s){Mr===null?Mr=[s]:Mr.push(s)}var xp=L(null),ql=null,$s=null;function Nr(s,l,c){J(xp,l._currentValue),l._currentValue=c}function Zs(s){s._currentValue=xp.current,_(xp)}function Sp(s,l,c){for(;s!==null;){var h=s.alternate;if((s.childLanes&l)!==l?(s.childLanes|=l,h!==null&&(h.childLanes|=l)):h!==null&&(h.childLanes&l)!==l&&(h.childLanes|=l),s===c)break;s=s.return}}function wp(s,l,c,h){var g=s.child;for(g!==null&&(g.return=s);g!==null;){var y=g.dependencies;if(y!==null){var k=g.child;y=y.firstContext;e:for(;y!==null;){var M=y;y=g;for(var I=0;I<l.length;I++)if(M.context===l[I]){y.lanes|=c,M=y.alternate,M!==null&&(M.lanes|=c),Sp(y.return,c,s),h||(k=null);break e}y=M.next}}else if(g.tag===18){if(k=g.return,k===null)throw Error(i(341));k.lanes|=c,y=k.alternate,y!==null&&(y.lanes|=c),Sp(k,c,s),k=null}else k=g.child;if(k!==null)k.return=g;else for(k=g;k!==null;){if(k===s){k=null;break}if(g=k.sibling,g!==null){g.return=k.return,k=g;break}k=k.return}g=k}}function ra(s,l,c,h){s=null;for(var g=l,y=!1;g!==null;){if(!y){if((g.flags&524288)!==0)y=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var k=g.alternate;if(k===null)throw Error(i(387));if(k=k.memoizedProps,k!==null){var M=g.type;bi(g.pendingProps.value,k.value)||(s!==null?s.push(M):s=[M])}}else if(g===se.current){if(k=g.alternate,k===null)throw Error(i(387));k.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(s!==null?s.push(du):s=[du])}g=g.return}s!==null&&wp(l,s,c,h),l.flags|=262144}function Ff(s){for(s=s.firstContext;s!==null;){if(!bi(s.context._currentValue,s.memoizedValue))return!0;s=s.next}return!1}function Fl(s){ql=s,$s=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function Bn(s){return Vx(ql,s)}function Gf(s,l){return ql===null&&Fl(s),Vx(s,l)}function Vx(s,l){var c=l._currentValue;if(l={context:l,memoizedValue:c,next:null},$s===null){if(s===null)throw Error(i(308));$s=l,s.dependencies={lanes:0,firstContext:l},s.flags|=524288}else $s=$s.next=l;return c}var UO=typeof AbortController<"u"?AbortController:function(){var s=[],l=this.signal={aborted:!1,addEventListener:function(c,h){s.push(h)}};this.abort=function(){l.aborted=!0,s.forEach(function(c){return c()})}},VO=n.unstable_scheduleCallback,qO=n.unstable_NormalPriority,mn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function kp(){return{controller:new UO,data:new Map,refCount:0}}function Uc(s){s.refCount--,s.refCount===0&&VO(qO,function(){s.controller.abort()})}var Vc=null,Cp=0,la=0,oa=null;function FO(s,l){if(Vc===null){var c=Vc=[];Cp=0,la=Tg(),oa={status:"pending",value:void 0,then:function(h){c.push(h)}}}return Cp++,l.then(qx,qx),l}function qx(){if(--Cp===0&&Vc!==null){oa!==null&&(oa.status="fulfilled");var s=Vc;Vc=null,la=0,oa=null;for(var l=0;l<s.length;l++)(0,s[l])()}}function GO(s,l){var c=[],h={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return s.then(function(){h.status="fulfilled",h.value=l;for(var g=0;g<c.length;g++)(0,c[g])(l)},function(g){for(h.status="rejected",h.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),h}var Fx=P.S;P.S=function(s,l){TS=we(),typeof l=="object"&&l!==null&&typeof l.then=="function"&&FO(s,l),Fx!==null&&Fx(s,l)};var Gl=L(null);function Ep(){var s=Gl.current;return s!==null?s:It.pooledCache}function Kf(s,l){l===null?J(Gl,Gl.current):J(Gl,l.pool)}function Gx(){var s=Ep();return s===null?null:{parent:mn._currentValue,pool:s}}var aa=Error(i(460)),Ap=Error(i(474)),Yf=Error(i(542)),Qf={then:function(){}};function Kx(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Yx(s,l,c){switch(c=s[c],c===void 0?s.push(l):c!==l&&(l.then(Ys,Ys),l=c),l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,Wx(s),s;default:if(typeof l.status=="string")l.then(Ys,Ys);else{if(s=It,s!==null&&100<s.shellSuspendCounter)throw Error(i(482));s=l,s.status="pending",s.then(function(h){if(l.status==="pending"){var g=l;g.status="fulfilled",g.value=h}},function(h){if(l.status==="pending"){var g=l;g.status="rejected",g.reason=h}})}switch(l.status){case"fulfilled":return l.value;case"rejected":throw s=l.reason,Wx(s),s}throw Yl=l,aa}}function Kl(s){try{var l=s._init;return l(s._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Yl=c,aa):c}}var Yl=null;function Qx(){if(Yl===null)throw Error(i(459));var s=Yl;return Yl=null,s}function Wx(s){if(s===aa||s===Yf)throw Error(i(483))}var ca=null,qc=0;function Wf(s){var l=qc;return qc+=1,ca===null&&(ca=[]),Yx(ca,s,l)}function Fc(s,l){l=l.props.ref,s.ref=l!==void 0?l:null}function Xf(s,l){throw l.$$typeof===b?Error(i(525)):(s=Object.prototype.toString.call(l),Error(i(31,s==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":s)))}function Xx(s){function l(X,G){if(s){var te=X.deletions;te===null?(X.deletions=[G],X.flags|=16):te.push(G)}}function c(X,G){if(!s)return null;for(;G!==null;)l(X,G),G=G.sibling;return null}function h(X){for(var G=new Map;X!==null;)X.key!==null?G.set(X.key,X):G.set(X.index,X),X=X.sibling;return G}function g(X,G){return X=Ws(X,G),X.index=0,X.sibling=null,X}function y(X,G,te){return X.index=te,s?(te=X.alternate,te!==null?(te=te.index,te<G?(X.flags|=67108866,G):te):(X.flags|=67108866,G)):(X.flags|=1048576,G)}function k(X){return s&&X.alternate===null&&(X.flags|=67108866),X}function M(X,G,te,ue){return G===null||G.tag!==6?(G=mp(te,X.mode,ue),G.return=X,G):(G=g(G,te),G.return=X,G)}function I(X,G,te,ue){var Fe=te.type;return Fe===w?ce(X,G,te.props.children,ue,te.key):G!==null&&(G.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===j&&Kl(Fe)===G.type)?(G=g(G,te.props),Fc(G,te),G.return=X,G):(G=Vf(te.type,te.key,te.props,null,X.mode,ue),Fc(G,te),G.return=X,G)}function ne(X,G,te,ue){return G===null||G.tag!==4||G.stateNode.containerInfo!==te.containerInfo||G.stateNode.implementation!==te.implementation?(G=pp(te,X.mode,ue),G.return=X,G):(G=g(G,te.children||[]),G.return=X,G)}function ce(X,G,te,ue,Fe){return G===null||G.tag!==7?(G=Ul(te,X.mode,ue,Fe),G.return=X,G):(G=g(G,te),G.return=X,G)}function he(X,G,te){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=mp(""+G,X.mode,te),G.return=X,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case v:return te=Vf(G.type,G.key,G.props,null,X.mode,te),Fc(te,G),te.return=X,te;case S:return G=pp(G,X.mode,te),G.return=X,G;case j:return G=Kl(G),he(X,G,te)}if(q(G)||Y(G))return G=Ul(G,X.mode,te,null),G.return=X,G;if(typeof G.then=="function")return he(X,Wf(G),te);if(G.$$typeof===R)return he(X,Gf(X,G),te);Xf(X,G)}return null}function ie(X,G,te,ue){var Fe=G!==null?G.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Fe!==null?null:M(X,G,""+te,ue);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case v:return te.key===Fe?I(X,G,te,ue):null;case S:return te.key===Fe?ne(X,G,te,ue):null;case j:return te=Kl(te),ie(X,G,te,ue)}if(q(te)||Y(te))return Fe!==null?null:ce(X,G,te,ue,null);if(typeof te.then=="function")return ie(X,G,Wf(te),ue);if(te.$$typeof===R)return ie(X,G,Gf(X,te),ue);Xf(X,te)}return null}function re(X,G,te,ue,Fe){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return X=X.get(te)||null,M(G,X,""+ue,Fe);if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case v:return X=X.get(ue.key===null?te:ue.key)||null,I(G,X,ue,Fe);case S:return X=X.get(ue.key===null?te:ue.key)||null,ne(G,X,ue,Fe);case j:return ue=Kl(ue),re(X,G,te,ue,Fe)}if(q(ue)||Y(ue))return X=X.get(te)||null,ce(G,X,ue,Fe,null);if(typeof ue.then=="function")return re(X,G,te,Wf(ue),Fe);if(ue.$$typeof===R)return re(X,G,te,Gf(G,ue),Fe);Xf(G,ue)}return null}function ze(X,G,te,ue){for(var Fe=null,kt=null,Ie=G,et=G=0,pt=null;Ie!==null&&et<te.length;et++){Ie.index>et?(pt=Ie,Ie=null):pt=Ie.sibling;var Ct=ie(X,Ie,te[et],ue);if(Ct===null){Ie===null&&(Ie=pt);break}s&&Ie&&Ct.alternate===null&&l(X,Ie),G=y(Ct,G,et),kt===null?Fe=Ct:kt.sibling=Ct,kt=Ct,Ie=pt}if(et===te.length)return c(X,Ie),gt&&Xs(X,et),Fe;if(Ie===null){for(;et<te.length;et++)Ie=he(X,te[et],ue),Ie!==null&&(G=y(Ie,G,et),kt===null?Fe=Ie:kt.sibling=Ie,kt=Ie);return gt&&Xs(X,et),Fe}for(Ie=h(Ie);et<te.length;et++)pt=re(Ie,X,et,te[et],ue),pt!==null&&(s&&pt.alternate!==null&&Ie.delete(pt.key===null?et:pt.key),G=y(pt,G,et),kt===null?Fe=pt:kt.sibling=pt,kt=pt);return s&&Ie.forEach(function(Wr){return l(X,Wr)}),gt&&Xs(X,et),Fe}function Ke(X,G,te,ue){if(te==null)throw Error(i(151));for(var Fe=null,kt=null,Ie=G,et=G=0,pt=null,Ct=te.next();Ie!==null&&!Ct.done;et++,Ct=te.next()){Ie.index>et?(pt=Ie,Ie=null):pt=Ie.sibling;var Wr=ie(X,Ie,Ct.value,ue);if(Wr===null){Ie===null&&(Ie=pt);break}s&&Ie&&Wr.alternate===null&&l(X,Ie),G=y(Wr,G,et),kt===null?Fe=Wr:kt.sibling=Wr,kt=Wr,Ie=pt}if(Ct.done)return c(X,Ie),gt&&Xs(X,et),Fe;if(Ie===null){for(;!Ct.done;et++,Ct=te.next())Ct=he(X,Ct.value,ue),Ct!==null&&(G=y(Ct,G,et),kt===null?Fe=Ct:kt.sibling=Ct,kt=Ct);return gt&&Xs(X,et),Fe}for(Ie=h(Ie);!Ct.done;et++,Ct=te.next())Ct=re(Ie,X,et,Ct.value,ue),Ct!==null&&(s&&Ct.alternate!==null&&Ie.delete(Ct.key===null?et:Ct.key),G=y(Ct,G,et),kt===null?Fe=Ct:kt.sibling=Ct,kt=Ct);return s&&Ie.forEach(function(nD){return l(X,nD)}),gt&&Xs(X,et),Fe}function Bt(X,G,te,ue){if(typeof te=="object"&&te!==null&&te.type===w&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case v:e:{for(var Fe=te.key;G!==null;){if(G.key===Fe){if(Fe=te.type,Fe===w){if(G.tag===7){c(X,G.sibling),ue=g(G,te.props.children),ue.return=X,X=ue;break e}}else if(G.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===j&&Kl(Fe)===G.type){c(X,G.sibling),ue=g(G,te.props),Fc(ue,te),ue.return=X,X=ue;break e}c(X,G);break}else l(X,G);G=G.sibling}te.type===w?(ue=Ul(te.props.children,X.mode,ue,te.key),ue.return=X,X=ue):(ue=Vf(te.type,te.key,te.props,null,X.mode,ue),Fc(ue,te),ue.return=X,X=ue)}return k(X);case S:e:{for(Fe=te.key;G!==null;){if(G.key===Fe)if(G.tag===4&&G.stateNode.containerInfo===te.containerInfo&&G.stateNode.implementation===te.implementation){c(X,G.sibling),ue=g(G,te.children||[]),ue.return=X,X=ue;break e}else{c(X,G);break}else l(X,G);G=G.sibling}ue=pp(te,X.mode,ue),ue.return=X,X=ue}return k(X);case j:return te=Kl(te),Bt(X,G,te,ue)}if(q(te))return ze(X,G,te,ue);if(Y(te)){if(Fe=Y(te),typeof Fe!="function")throw Error(i(150));return te=Fe.call(te),Ke(X,G,te,ue)}if(typeof te.then=="function")return Bt(X,G,Wf(te),ue);if(te.$$typeof===R)return Bt(X,G,Gf(X,te),ue);Xf(X,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,G!==null&&G.tag===6?(c(X,G.sibling),ue=g(G,te),ue.return=X,X=ue):(c(X,G),ue=mp(te,X.mode,ue),ue.return=X,X=ue),k(X)):c(X,G)}return function(X,G,te,ue){try{qc=0;var Fe=Bt(X,G,te,ue);return ca=null,Fe}catch(Ie){if(Ie===aa||Ie===Yf)throw Ie;var kt=vi(29,Ie,null,X.mode);return kt.lanes=ue,kt.return=X,kt}finally{}}}var Ql=Xx(!0),$x=Xx(!1),Dr=!1;function Tp(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rp(s,l){s=s.updateQueue,l.updateQueue===s&&(l.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function jr(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function Lr(s,l,c){var h=s.updateQueue;if(h===null)return null;if(h=h.shared,(At&2)!==0){var g=h.pending;return g===null?l.next=l:(l.next=g.next,g.next=l),h.pending=l,l=Uf(s),Lx(s,null,c),l}return _f(s,h,l,c),Uf(s)}function Gc(s,l,c){if(l=l.updateQueue,l!==null&&(l=l.shared,(c&4194048)!==0)){var h=l.lanes;h&=s.pendingLanes,c|=h,l.lanes=c,Uo(s,c)}}function Mp(s,l){var c=s.updateQueue,h=s.alternate;if(h!==null&&(h=h.updateQueue,c===h)){var g=null,y=null;if(c=c.firstBaseUpdate,c!==null){do{var k={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};y===null?g=y=k:y=y.next=k,c=c.next}while(c!==null);y===null?g=y=l:y=y.next=l}else g=y=l;c={baseState:h.baseState,firstBaseUpdate:g,lastBaseUpdate:y,shared:h.shared,callbacks:h.callbacks},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=l:s.next=l,c.lastBaseUpdate=l}var Op=!1;function Kc(){if(Op){var s=oa;if(s!==null)throw s}}function Yc(s,l,c,h){Op=!1;var g=s.updateQueue;Dr=!1;var y=g.firstBaseUpdate,k=g.lastBaseUpdate,M=g.shared.pending;if(M!==null){g.shared.pending=null;var I=M,ne=I.next;I.next=null,k===null?y=ne:k.next=ne,k=I;var ce=s.alternate;ce!==null&&(ce=ce.updateQueue,M=ce.lastBaseUpdate,M!==k&&(M===null?ce.firstBaseUpdate=ne:M.next=ne,ce.lastBaseUpdate=I))}if(y!==null){var he=g.baseState;k=0,ce=ne=I=null,M=y;do{var ie=M.lane&-536870913,re=ie!==M.lane;if(re?(mt&ie)===ie:(h&ie)===ie){ie!==0&&ie===la&&(Op=!0),ce!==null&&(ce=ce.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ze=s,Ke=M;ie=l;var Bt=c;switch(Ke.tag){case 1:if(ze=Ke.payload,typeof ze=="function"){he=ze.call(Bt,he,ie);break e}he=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Ke.payload,ie=typeof ze=="function"?ze.call(Bt,he,ie):ze,ie==null)break e;he=p({},he,ie);break e;case 2:Dr=!0}}ie=M.callback,ie!==null&&(s.flags|=64,re&&(s.flags|=8192),re=g.callbacks,re===null?g.callbacks=[ie]:re.push(ie))}else re={lane:ie,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ce===null?(ne=ce=re,I=he):ce=ce.next=re,k|=ie;if(M=M.next,M===null){if(M=g.shared.pending,M===null)break;re=M,M=re.next,re.next=null,g.lastBaseUpdate=re,g.shared.pending=null}}while(!0);ce===null&&(I=he),g.baseState=I,g.firstBaseUpdate=ne,g.lastBaseUpdate=ce,y===null&&(g.shared.lanes=0),Hr|=k,s.lanes=k,s.memoizedState=he}}function Zx(s,l){if(typeof s!="function")throw Error(i(191,s));s.call(l)}function Jx(s,l){var c=s.callbacks;if(c!==null)for(s.callbacks=null,s=0;s<c.length;s++)Zx(c[s],l)}var ua=L(null),$f=L(0);function e1(s,l){s=or,J($f,s),J(ua,l),or=s|l.baseLanes}function Np(){J($f,or),J(ua,ua.current)}function Dp(){or=$f.current,_(ua),_($f)}var xi=L(null),qi=null;function Br(s){var l=s.alternate;J(rn,rn.current&1),J(xi,s),qi===null&&(l===null||ua.current!==null||l.memoizedState!==null)&&(qi=s)}function jp(s){J(rn,rn.current),J(xi,s),qi===null&&(qi=s)}function t1(s){s.tag===22?(J(rn,rn.current),J(xi,s),qi===null&&(qi=s)):zr()}function zr(){J(rn,rn.current),J(xi,xi.current)}function Si(s){_(xi),qi===s&&(qi=null),_(rn)}var rn=L(0);function Zf(s){for(var l=s;l!==null;){if(l.tag===13){var c=l.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Hg(c)||_g(c)))return l}else if(l.tag===19&&(l.memoizedProps.revealOrder==="forwards"||l.memoizedProps.revealOrder==="backwards"||l.memoizedProps.revealOrder==="unstable_legacy-backwards"||l.memoizedProps.revealOrder==="together")){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Js=0,Ze=null,jt=null,pn=null,Jf=!1,fa=!1,Wl=!1,eh=0,Qc=0,ha=null,KO=0;function $t(){throw Error(i(321))}function Lp(s,l){if(l===null)return!1;for(var c=0;c<l.length&&c<s.length;c++)if(!bi(s[c],l[c]))return!1;return!0}function Bp(s,l,c,h,g,y){return Js=y,Ze=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,P.H=s===null||s.memoizedState===null?I1:Xp,Wl=!1,y=c(h,g),Wl=!1,fa&&(y=i1(l,c,h,g)),n1(s),y}function n1(s){P.H=$c;var l=jt!==null&&jt.next!==null;if(Js=0,pn=jt=Ze=null,Jf=!1,Qc=0,ha=null,l)throw Error(i(300));s===null||gn||(s=s.dependencies,s!==null&&Ff(s)&&(gn=!0))}function i1(s,l,c,h){Ze=s;var g=0;do{if(fa&&(ha=null),Qc=0,fa=!1,25<=g)throw Error(i(301));if(g+=1,pn=jt=null,s.updateQueue!=null){var y=s.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}P.H=H1,y=l(c,h)}while(fa);return y}function YO(){var s=P.H,l=s.useState()[0];return l=typeof l.then=="function"?Wc(l):l,s=s.useState()[0],(jt!==null?jt.memoizedState:null)!==s&&(Ze.flags|=1024),l}function zp(){var s=eh!==0;return eh=0,s}function Pp(s,l,c){l.updateQueue=s.updateQueue,l.flags&=-2053,s.lanes&=~c}function Ip(s){if(Jf){for(s=s.memoizedState;s!==null;){var l=s.queue;l!==null&&(l.pending=null),s=s.next}Jf=!1}Js=0,pn=jt=Ze=null,fa=!1,Qc=eh=0,ha=null}function Xn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?Ze.memoizedState=pn=s:pn=pn.next=s,pn}function ln(){if(jt===null){var s=Ze.alternate;s=s!==null?s.memoizedState:null}else s=jt.next;var l=pn===null?Ze.memoizedState:pn.next;if(l!==null)pn=l,jt=s;else{if(s===null)throw Ze.alternate===null?Error(i(467)):Error(i(310));jt=s,s={memoizedState:jt.memoizedState,baseState:jt.baseState,baseQueue:jt.baseQueue,queue:jt.queue,next:null},pn===null?Ze.memoizedState=pn=s:pn=pn.next=s}return pn}function th(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wc(s){var l=Qc;return Qc+=1,ha===null&&(ha=[]),s=Yx(ha,s,l),l=Ze,(pn===null?l.memoizedState:pn.next)===null&&(l=l.alternate,P.H=l===null||l.memoizedState===null?I1:Xp),s}function nh(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return Wc(s);if(s.$$typeof===R)return Bn(s)}throw Error(i(438,String(s)))}function Hp(s){var l=null,c=Ze.updateQueue;if(c!==null&&(l=c.memoCache),l==null){var h=Ze.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(l={data:h.data.map(function(g){return g.slice()}),index:0})))}if(l==null&&(l={data:[],index:0}),c===null&&(c=th(),Ze.updateQueue=c),c.memoCache=l,c=l.data[l.index],c===void 0)for(c=l.data[l.index]=Array(s),h=0;h<s;h++)c[h]=K;return l.index++,c}function er(s,l){return typeof l=="function"?l(s):l}function ih(s){var l=ln();return _p(l,jt,s)}function _p(s,l,c){var h=s.queue;if(h===null)throw Error(i(311));h.lastRenderedReducer=c;var g=s.baseQueue,y=h.pending;if(y!==null){if(g!==null){var k=g.next;g.next=y.next,y.next=k}l.baseQueue=g=y,h.pending=null}if(y=s.baseState,g===null)s.memoizedState=y;else{l=g.next;var M=k=null,I=null,ne=l,ce=!1;do{var he=ne.lane&-536870913;if(he!==ne.lane?(mt&he)===he:(Js&he)===he){var ie=ne.revertLane;if(ie===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),he===la&&(ce=!0);else if((Js&ie)===ie){ne=ne.next,ie===la&&(ce=!0);continue}else he={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},I===null?(M=I=he,k=y):I=I.next=he,Ze.lanes|=ie,Hr|=ie;he=ne.action,Wl&&c(y,he),y=ne.hasEagerState?ne.eagerState:c(y,he)}else ie={lane:he,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},I===null?(M=I=ie,k=y):I=I.next=ie,Ze.lanes|=he,Hr|=he;ne=ne.next}while(ne!==null&&ne!==l);if(I===null?k=y:I.next=M,!bi(y,s.memoizedState)&&(gn=!0,ce&&(c=oa,c!==null)))throw c;s.memoizedState=y,s.baseState=k,s.baseQueue=I,h.lastRenderedState=y}return g===null&&(h.lanes=0),[s.memoizedState,h.dispatch]}function Up(s){var l=ln(),c=l.queue;if(c===null)throw Error(i(311));c.lastRenderedReducer=s;var h=c.dispatch,g=c.pending,y=l.memoizedState;if(g!==null){c.pending=null;var k=g=g.next;do y=s(y,k.action),k=k.next;while(k!==g);bi(y,l.memoizedState)||(gn=!0),l.memoizedState=y,l.baseQueue===null&&(l.baseState=y),c.lastRenderedState=y}return[y,h]}function s1(s,l,c){var h=Ze,g=ln(),y=gt;if(y){if(c===void 0)throw Error(i(407));c=c()}else c=l();var k=!bi((jt||g).memoizedState,c);if(k&&(g.memoizedState=c,gn=!0),g=g.queue,Fp(o1.bind(null,h,g,s),[s]),g.getSnapshot!==l||k||pn!==null&&pn.memoizedState.tag&1){if(h.flags|=2048,da(9,{destroy:void 0},l1.bind(null,h,g,c,l),null),It===null)throw Error(i(349));y||(Js&127)!==0||r1(h,l,c)}return c}function r1(s,l,c){s.flags|=16384,s={getSnapshot:l,value:c},l=Ze.updateQueue,l===null?(l=th(),Ze.updateQueue=l,l.stores=[s]):(c=l.stores,c===null?l.stores=[s]:c.push(s))}function l1(s,l,c,h){l.value=c,l.getSnapshot=h,a1(l)&&c1(s)}function o1(s,l,c){return c(function(){a1(l)&&c1(s)})}function a1(s){var l=s.getSnapshot;s=s.value;try{var c=l();return!bi(s,c)}catch{return!0}}function c1(s){var l=_l(s,2);l!==null&&ci(l,s,2)}function Vp(s){var l=Xn();if(typeof s=="function"){var c=s;if(s=c(),Wl){$e(!0);try{c()}finally{$e(!1)}}}return l.memoizedState=l.baseState=s,l.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:er,lastRenderedState:s},l}function u1(s,l,c,h){return s.baseState=c,_p(s,jt,typeof h=="function"?h:er)}function QO(s,l,c,h,g){if(lh(s))throw Error(i(485));if(s=l.action,s!==null){var y={payload:g,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(k){y.listeners.push(k)}};P.T!==null?c(!0):y.isTransition=!1,h(y),c=l.pending,c===null?(y.next=l.pending=y,f1(l,y)):(y.next=c.next,l.pending=c.next=y)}}function f1(s,l){var c=l.action,h=l.payload,g=s.state;if(l.isTransition){var y=P.T,k={};P.T=k;try{var M=c(g,h),I=P.S;I!==null&&I(k,M),h1(s,l,M)}catch(ne){qp(s,l,ne)}finally{y!==null&&k.types!==null&&(y.types=k.types),P.T=y}}else try{y=c(g,h),h1(s,l,y)}catch(ne){qp(s,l,ne)}}function h1(s,l,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(h){d1(s,l,h)},function(h){return qp(s,l,h)}):d1(s,l,c)}function d1(s,l,c){l.status="fulfilled",l.value=c,m1(l),s.state=c,l=s.pending,l!==null&&(c=l.next,c===l?s.pending=null:(c=c.next,l.next=c,f1(s,c)))}function qp(s,l,c){var h=s.pending;if(s.pending=null,h!==null){h=h.next;do l.status="rejected",l.reason=c,m1(l),l=l.next;while(l!==h)}s.action=null}function m1(s){s=s.listeners;for(var l=0;l<s.length;l++)(0,s[l])()}function p1(s,l){return l}function g1(s,l){if(gt){var c=It.formState;if(c!==null){e:{var h=Ze;if(gt){if(Vt){t:{for(var g=Vt,y=Vi;g.nodeType!==8;){if(!y){g=null;break t}if(g=Fi(g.nextSibling),g===null){g=null;break t}}y=g.data,g=y==="F!"||y==="F"?g:null}if(g){Vt=Fi(g.nextSibling),h=g.data==="F!";break e}}Or(h)}h=!1}h&&(l=c[0])}}return c=Xn(),c.memoizedState=c.baseState=l,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:p1,lastRenderedState:l},c.queue=h,c=B1.bind(null,Ze,h),h.dispatch=c,h=Vp(!1),y=Wp.bind(null,Ze,!1,h.queue),h=Xn(),g={state:l,dispatch:null,action:s,pending:null},h.queue=g,c=QO.bind(null,Ze,g,y,c),g.dispatch=c,h.memoizedState=s,[l,c,!1]}function y1(s){var l=ln();return b1(l,jt,s)}function b1(s,l,c){if(l=_p(s,l,p1)[0],s=ih(er)[0],typeof l=="object"&&l!==null&&typeof l.then=="function")try{var h=Wc(l)}catch(k){throw k===aa?Yf:k}else h=l;l=ln();var g=l.queue,y=g.dispatch;return c!==l.memoizedState&&(Ze.flags|=2048,da(9,{destroy:void 0},WO.bind(null,g,c),null)),[h,y,s]}function WO(s,l){s.action=l}function v1(s){var l=ln(),c=jt;if(c!==null)return b1(l,c,s);ln(),l=l.memoizedState,c=ln();var h=c.queue.dispatch;return c.memoizedState=s,[l,h,!1]}function da(s,l,c,h){return s={tag:s,create:c,deps:h,inst:l,next:null},l=Ze.updateQueue,l===null&&(l=th(),Ze.updateQueue=l),c=l.lastEffect,c===null?l.lastEffect=s.next=s:(h=c.next,c.next=s,s.next=h,l.lastEffect=s),s}function x1(){return ln().memoizedState}function sh(s,l,c,h){var g=Xn();Ze.flags|=s,g.memoizedState=da(1|l,{destroy:void 0},c,h===void 0?null:h)}function rh(s,l,c,h){var g=ln();h=h===void 0?null:h;var y=g.memoizedState.inst;jt!==null&&h!==null&&Lp(h,jt.memoizedState.deps)?g.memoizedState=da(l,y,c,h):(Ze.flags|=s,g.memoizedState=da(1|l,y,c,h))}function S1(s,l){sh(8390656,8,s,l)}function Fp(s,l){rh(2048,8,s,l)}function XO(s){Ze.flags|=4;var l=Ze.updateQueue;if(l===null)l=th(),Ze.updateQueue=l,l.events=[s];else{var c=l.events;c===null?l.events=[s]:c.push(s)}}function w1(s){var l=ln().memoizedState;return XO({ref:l,nextImpl:s}),function(){if((At&2)!==0)throw Error(i(440));return l.impl.apply(void 0,arguments)}}function k1(s,l){return rh(4,2,s,l)}function C1(s,l){return rh(4,4,s,l)}function E1(s,l){if(typeof l=="function"){s=s();var c=l(s);return function(){typeof c=="function"?c():l(null)}}if(l!=null)return s=s(),l.current=s,function(){l.current=null}}function A1(s,l,c){c=c!=null?c.concat([s]):null,rh(4,4,E1.bind(null,l,s),c)}function Gp(){}function T1(s,l){var c=ln();l=l===void 0?null:l;var h=c.memoizedState;return l!==null&&Lp(l,h[1])?h[0]:(c.memoizedState=[s,l],s)}function R1(s,l){var c=ln();l=l===void 0?null:l;var h=c.memoizedState;if(l!==null&&Lp(l,h[1]))return h[0];if(h=s(),Wl){$e(!0);try{s()}finally{$e(!1)}}return c.memoizedState=[h,l],h}function Kp(s,l,c){return c===void 0||(Js&1073741824)!==0&&(mt&261930)===0?s.memoizedState=l:(s.memoizedState=c,s=MS(),Ze.lanes|=s,Hr|=s,c)}function M1(s,l,c,h){return bi(c,l)?c:ua.current!==null?(s=Kp(s,c,h),bi(s,l)||(gn=!0),s):(Js&42)===0||(Js&1073741824)!==0&&(mt&261930)===0?(gn=!0,s.memoizedState=c):(s=MS(),Ze.lanes|=s,Hr|=s,l)}function O1(s,l,c,h,g){var y=W.p;W.p=y!==0&&8>y?y:8;var k=P.T,M={};P.T=M,Wp(s,!1,l,c);try{var I=g(),ne=P.S;if(ne!==null&&ne(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ce=GO(I,h);Xc(s,l,ce,Ci(s))}else Xc(s,l,h,Ci(s))}catch(he){Xc(s,l,{then:function(){},status:"rejected",reason:he},Ci())}finally{W.p=y,k!==null&&M.types!==null&&(k.types=M.types),P.T=k}}function $O(){}function Yp(s,l,c,h){if(s.tag!==5)throw Error(i(476));var g=N1(s).queue;O1(s,g,l,U,c===null?$O:function(){return D1(s),c(h)})}function N1(s){var l=s.memoizedState;if(l!==null)return l;l={memoizedState:U,baseState:U,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:er,lastRenderedState:U},next:null};var c={};return l.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:er,lastRenderedState:c},next:null},s.memoizedState=l,s=s.alternate,s!==null&&(s.memoizedState=l),l}function D1(s){var l=N1(s);l.next===null&&(l=s.alternate.memoizedState),Xc(s,l.next.queue,{},Ci())}function Qp(){return Bn(du)}function j1(){return ln().memoizedState}function L1(){return ln().memoizedState}function ZO(s){for(var l=s.return;l!==null;){switch(l.tag){case 24:case 3:var c=Ci();s=jr(c);var h=Lr(l,s,c);h!==null&&(ci(h,l,c),Gc(h,l,c)),l={cache:kp()},s.payload=l;return}l=l.return}}function JO(s,l,c){var h=Ci();c={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},lh(s)?z1(l,c):(c=hp(s,l,c,h),c!==null&&(ci(c,s,h),P1(c,l,h)))}function B1(s,l,c){var h=Ci();Xc(s,l,c,h)}function Xc(s,l,c,h){var g={lane:h,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(lh(s))z1(l,g);else{var y=s.alternate;if(s.lanes===0&&(y===null||y.lanes===0)&&(y=l.lastRenderedReducer,y!==null))try{var k=l.lastRenderedState,M=y(k,c);if(g.hasEagerState=!0,g.eagerState=M,bi(M,k))return _f(s,l,g,0),It===null&&Hf(),!1}catch{}finally{}if(c=hp(s,l,g,h),c!==null)return ci(c,s,h),P1(c,l,h),!0}return!1}function Wp(s,l,c,h){if(h={lane:2,revertLane:Tg(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},lh(s)){if(l)throw Error(i(479))}else l=hp(s,c,h,2),l!==null&&ci(l,s,2)}function lh(s){var l=s.alternate;return s===Ze||l!==null&&l===Ze}function z1(s,l){fa=Jf=!0;var c=s.pending;c===null?l.next=l:(l.next=c.next,c.next=l),s.pending=l}function P1(s,l,c){if((c&4194048)!==0){var h=l.lanes;h&=s.pendingLanes,c|=h,l.lanes=c,Uo(s,c)}}var $c={readContext:Bn,use:nh,useCallback:$t,useContext:$t,useEffect:$t,useImperativeHandle:$t,useLayoutEffect:$t,useInsertionEffect:$t,useMemo:$t,useReducer:$t,useRef:$t,useState:$t,useDebugValue:$t,useDeferredValue:$t,useTransition:$t,useSyncExternalStore:$t,useId:$t,useHostTransitionStatus:$t,useFormState:$t,useActionState:$t,useOptimistic:$t,useMemoCache:$t,useCacheRefresh:$t};$c.useEffectEvent=$t;var I1={readContext:Bn,use:nh,useCallback:function(s,l){return Xn().memoizedState=[s,l===void 0?null:l],s},useContext:Bn,useEffect:S1,useImperativeHandle:function(s,l,c){c=c!=null?c.concat([s]):null,sh(4194308,4,E1.bind(null,l,s),c)},useLayoutEffect:function(s,l){return sh(4194308,4,s,l)},useInsertionEffect:function(s,l){sh(4,2,s,l)},useMemo:function(s,l){var c=Xn();l=l===void 0?null:l;var h=s();if(Wl){$e(!0);try{s()}finally{$e(!1)}}return c.memoizedState=[h,l],h},useReducer:function(s,l,c){var h=Xn();if(c!==void 0){var g=c(l);if(Wl){$e(!0);try{c(l)}finally{$e(!1)}}}else g=l;return h.memoizedState=h.baseState=g,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:g},h.queue=s,s=s.dispatch=JO.bind(null,Ze,s),[h.memoizedState,s]},useRef:function(s){var l=Xn();return s={current:s},l.memoizedState=s},useState:function(s){s=Vp(s);var l=s.queue,c=B1.bind(null,Ze,l);return l.dispatch=c,[s.memoizedState,c]},useDebugValue:Gp,useDeferredValue:function(s,l){var c=Xn();return Kp(c,s,l)},useTransition:function(){var s=Vp(!1);return s=O1.bind(null,Ze,s.queue,!0,!1),Xn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,l,c){var h=Ze,g=Xn();if(gt){if(c===void 0)throw Error(i(407));c=c()}else{if(c=l(),It===null)throw Error(i(349));(mt&127)!==0||r1(h,l,c)}g.memoizedState=c;var y={value:c,getSnapshot:l};return g.queue=y,S1(o1.bind(null,h,y,s),[s]),h.flags|=2048,da(9,{destroy:void 0},l1.bind(null,h,y,c,l),null),c},useId:function(){var s=Xn(),l=It.identifierPrefix;if(gt){var c=ys,h=gs;c=(h&~(1<<32-it(h)-1)).toString(32)+c,l="_"+l+"R_"+c,c=eh++,0<c&&(l+="H"+c.toString(32)),l+="_"}else c=KO++,l="_"+l+"r_"+c.toString(32)+"_";return s.memoizedState=l},useHostTransitionStatus:Qp,useFormState:g1,useActionState:g1,useOptimistic:function(s){var l=Xn();l.memoizedState=l.baseState=s;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return l.queue=c,l=Wp.bind(null,Ze,!0,c),c.dispatch=l,[s,l]},useMemoCache:Hp,useCacheRefresh:function(){return Xn().memoizedState=ZO.bind(null,Ze)},useEffectEvent:function(s){var l=Xn(),c={impl:s};return l.memoizedState=c,function(){if((At&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}},Xp={readContext:Bn,use:nh,useCallback:T1,useContext:Bn,useEffect:Fp,useImperativeHandle:A1,useInsertionEffect:k1,useLayoutEffect:C1,useMemo:R1,useReducer:ih,useRef:x1,useState:function(){return ih(er)},useDebugValue:Gp,useDeferredValue:function(s,l){var c=ln();return M1(c,jt.memoizedState,s,l)},useTransition:function(){var s=ih(er)[0],l=ln().memoizedState;return[typeof s=="boolean"?s:Wc(s),l]},useSyncExternalStore:s1,useId:j1,useHostTransitionStatus:Qp,useFormState:y1,useActionState:y1,useOptimistic:function(s,l){var c=ln();return u1(c,jt,s,l)},useMemoCache:Hp,useCacheRefresh:L1};Xp.useEffectEvent=w1;var H1={readContext:Bn,use:nh,useCallback:T1,useContext:Bn,useEffect:Fp,useImperativeHandle:A1,useInsertionEffect:k1,useLayoutEffect:C1,useMemo:R1,useReducer:Up,useRef:x1,useState:function(){return Up(er)},useDebugValue:Gp,useDeferredValue:function(s,l){var c=ln();return jt===null?Kp(c,s,l):M1(c,jt.memoizedState,s,l)},useTransition:function(){var s=Up(er)[0],l=ln().memoizedState;return[typeof s=="boolean"?s:Wc(s),l]},useSyncExternalStore:s1,useId:j1,useHostTransitionStatus:Qp,useFormState:v1,useActionState:v1,useOptimistic:function(s,l){var c=ln();return jt!==null?u1(c,jt,s,l):(c.baseState=s,[s,c.queue.dispatch])},useMemoCache:Hp,useCacheRefresh:L1};H1.useEffectEvent=w1;function $p(s,l,c,h){l=s.memoizedState,c=c(h,l),c=c==null?l:p({},l,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var Zp={enqueueSetState:function(s,l,c){s=s._reactInternals;var h=Ci(),g=jr(h);g.payload=l,c!=null&&(g.callback=c),l=Lr(s,g,h),l!==null&&(ci(l,s,h),Gc(l,s,h))},enqueueReplaceState:function(s,l,c){s=s._reactInternals;var h=Ci(),g=jr(h);g.tag=1,g.payload=l,c!=null&&(g.callback=c),l=Lr(s,g,h),l!==null&&(ci(l,s,h),Gc(l,s,h))},enqueueForceUpdate:function(s,l){s=s._reactInternals;var c=Ci(),h=jr(c);h.tag=2,l!=null&&(h.callback=l),l=Lr(s,h,c),l!==null&&(ci(l,s,c),Gc(l,s,c))}};function _1(s,l,c,h,g,y,k){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(h,y,k):l.prototype&&l.prototype.isPureReactComponent?!Pc(c,h)||!Pc(g,y):!0}function U1(s,l,c,h){s=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(c,h),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(c,h),l.state!==s&&Zp.enqueueReplaceState(l,l.state,null)}function Xl(s,l){var c=l;if("ref"in l){c={};for(var h in l)h!=="ref"&&(c[h]=l[h])}if(s=s.defaultProps){c===l&&(c=p({},c));for(var g in s)c[g]===void 0&&(c[g]=s[g])}return c}function V1(s){If(s)}function q1(s){console.error(s)}function F1(s){If(s)}function oh(s,l){try{var c=s.onUncaughtError;c(l.value,{componentStack:l.stack})}catch(h){setTimeout(function(){throw h})}}function G1(s,l,c){try{var h=s.onCaughtError;h(c.value,{componentStack:c.stack,errorBoundary:l.tag===1?l.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Jp(s,l,c){return c=jr(c),c.tag=3,c.payload={element:null},c.callback=function(){oh(s,l)},c}function K1(s){return s=jr(s),s.tag=3,s}function Y1(s,l,c,h){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var y=h.value;s.payload=function(){return g(y)},s.callback=function(){G1(l,c,h)}}var k=c.stateNode;k!==null&&typeof k.componentDidCatch=="function"&&(s.callback=function(){G1(l,c,h),typeof g!="function"&&(_r===null?_r=new Set([this]):_r.add(this));var M=h.stack;this.componentDidCatch(h.value,{componentStack:M!==null?M:""})})}function eN(s,l,c,h,g){if(c.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(l=c.alternate,l!==null&&ra(l,c,g,!0),c=xi.current,c!==null){switch(c.tag){case 31:case 13:return qi===null?vh():c.alternate===null&&Zt===0&&(Zt=3),c.flags&=-257,c.flags|=65536,c.lanes=g,h===Qf?c.flags|=16384:(l=c.updateQueue,l===null?c.updateQueue=new Set([h]):l.add(h),Cg(s,h,g)),!1;case 22:return c.flags|=65536,h===Qf?c.flags|=16384:(l=c.updateQueue,l===null?(l={transitions:null,markerInstances:null,retryQueue:new Set([h])},c.updateQueue=l):(c=l.retryQueue,c===null?l.retryQueue=new Set([h]):c.add(h)),Cg(s,h,g)),!1}throw Error(i(435,c.tag))}return Cg(s,h,g),vh(),!1}if(gt)return l=xi.current,l!==null?((l.flags&65536)===0&&(l.flags|=256),l.flags|=65536,l.lanes=g,h!==bp&&(s=Error(i(422),{cause:h}),_c(Hi(s,c)))):(h!==bp&&(l=Error(i(423),{cause:h}),_c(Hi(l,c))),s=s.current.alternate,s.flags|=65536,g&=-g,s.lanes|=g,h=Hi(h,c),g=Jp(s.stateNode,h,g),Mp(s,g),Zt!==4&&(Zt=2)),!1;var y=Error(i(520),{cause:h});if(y=Hi(y,c),ru===null?ru=[y]:ru.push(y),Zt!==4&&(Zt=2),l===null)return!0;h=Hi(h,c),c=l;do{switch(c.tag){case 3:return c.flags|=65536,s=g&-g,c.lanes|=s,s=Jp(c.stateNode,h,s),Mp(c,s),!1;case 1:if(l=c.type,y=c.stateNode,(c.flags&128)===0&&(typeof l.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(_r===null||!_r.has(y))))return c.flags|=65536,g&=-g,c.lanes|=g,g=K1(g),Y1(g,s,c,h),Mp(c,g),!1}c=c.return}while(c!==null);return!1}var eg=Error(i(461)),gn=!1;function zn(s,l,c,h){l.child=s===null?$x(l,null,c,h):Ql(l,s.child,c,h)}function Q1(s,l,c,h,g){c=c.render;var y=l.ref;if("ref"in h){var k={};for(var M in h)M!=="ref"&&(k[M]=h[M])}else k=h;return Fl(l),h=Bp(s,l,c,k,y,g),M=zp(),s!==null&&!gn?(Pp(s,l,g),tr(s,l,g)):(gt&&M&&gp(l),l.flags|=1,zn(s,l,h,g),l.child)}function W1(s,l,c,h,g){if(s===null){var y=c.type;return typeof y=="function"&&!dp(y)&&y.defaultProps===void 0&&c.compare===null?(l.tag=15,l.type=y,X1(s,l,y,h,g)):(s=Vf(c.type,null,h,l,l.mode,g),s.ref=l.ref,s.return=l,l.child=s)}if(y=s.child,!ag(s,g)){var k=y.memoizedProps;if(c=c.compare,c=c!==null?c:Pc,c(k,h)&&s.ref===l.ref)return tr(s,l,g)}return l.flags|=1,s=Ws(y,h),s.ref=l.ref,s.return=l,l.child=s}function X1(s,l,c,h,g){if(s!==null){var y=s.memoizedProps;if(Pc(y,h)&&s.ref===l.ref)if(gn=!1,l.pendingProps=h=y,ag(s,g))(s.flags&131072)!==0&&(gn=!0);else return l.lanes=s.lanes,tr(s,l,g)}return tg(s,l,c,h,g)}function $1(s,l,c,h){var g=h.children,y=s!==null?s.memoizedState:null;if(s===null&&l.stateNode===null&&(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((l.flags&128)!==0){if(y=y!==null?y.baseLanes|c:c,s!==null){for(h=l.child=s.child,g=0;h!==null;)g=g|h.lanes|h.childLanes,h=h.sibling;h=g&~y}else h=0,l.child=null;return Z1(s,l,y,c,h)}if((c&536870912)!==0)l.memoizedState={baseLanes:0,cachePool:null},s!==null&&Kf(l,y!==null?y.cachePool:null),y!==null?e1(l,y):Np(),t1(l);else return h=l.lanes=536870912,Z1(s,l,y!==null?y.baseLanes|c:c,c,h)}else y!==null?(Kf(l,y.cachePool),e1(l,y),zr(),l.memoizedState=null):(s!==null&&Kf(l,null),Np(),zr());return zn(s,l,g,c),l.child}function Zc(s,l){return s!==null&&s.tag===22||l.stateNode!==null||(l.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.sibling}function Z1(s,l,c,h,g){var y=Ep();return y=y===null?null:{parent:mn._currentValue,pool:y},l.memoizedState={baseLanes:c,cachePool:y},s!==null&&Kf(l,null),Np(),t1(l),s!==null&&ra(s,l,h,!0),l.childLanes=g,null}function ah(s,l){return l=uh({mode:l.mode,children:l.children},s.mode),l.ref=s.ref,s.child=l,l.return=s,l}function J1(s,l,c){return Ql(l,s.child,null,c),s=ah(l,l.pendingProps),s.flags|=2,Si(l),l.memoizedState=null,s}function tN(s,l,c){var h=l.pendingProps,g=(l.flags&128)!==0;if(l.flags&=-129,s===null){if(gt){if(h.mode==="hidden")return s=ah(l,h),l.lanes=536870912,Zc(null,s);if(jp(l),(s=Vt)?(s=fw(s,Vi),s=s!==null&&s.data==="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Rr!==null?{id:gs,overflow:ys}:null,retryLane:536870912,hydrationErrors:null},c=zx(s),c.return=l,l.child=c,Ln=l,Vt=null)):s=null,s===null)throw Or(l);return l.lanes=536870912,null}return ah(l,h)}var y=s.memoizedState;if(y!==null){var k=y.dehydrated;if(jp(l),g)if(l.flags&256)l.flags&=-257,l=J1(s,l,c);else if(l.memoizedState!==null)l.child=s.child,l.flags|=128,l=null;else throw Error(i(558));else if(gn||ra(s,l,c,!1),g=(c&s.childLanes)!==0,gn||g){if(h=It,h!==null&&(k=Ec(h,c),k!==0&&k!==y.retryLane))throw y.retryLane=k,_l(s,k),ci(h,s,k),eg;vh(),l=J1(s,l,c)}else s=y.treeContext,Vt=Fi(k.nextSibling),Ln=l,gt=!0,Mr=null,Vi=!1,s!==null&&Hx(l,s),l=ah(l,h),l.flags|=4096;return l}return s=Ws(s.child,{mode:h.mode,children:h.children}),s.ref=l.ref,l.child=s,s.return=l,s}function ch(s,l){var c=l.ref;if(c===null)s!==null&&s.ref!==null&&(l.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(i(284));(s===null||s.ref!==c)&&(l.flags|=4194816)}}function tg(s,l,c,h,g){return Fl(l),c=Bp(s,l,c,h,void 0,g),h=zp(),s!==null&&!gn?(Pp(s,l,g),tr(s,l,g)):(gt&&h&&gp(l),l.flags|=1,zn(s,l,c,g),l.child)}function eS(s,l,c,h,g,y){return Fl(l),l.updateQueue=null,c=i1(l,h,c,g),n1(s),h=zp(),s!==null&&!gn?(Pp(s,l,y),tr(s,l,y)):(gt&&h&&gp(l),l.flags|=1,zn(s,l,c,y),l.child)}function tS(s,l,c,h,g){if(Fl(l),l.stateNode===null){var y=ta,k=c.contextType;typeof k=="object"&&k!==null&&(y=Bn(k)),y=new c(h,y),l.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=Zp,l.stateNode=y,y._reactInternals=l,y=l.stateNode,y.props=h,y.state=l.memoizedState,y.refs={},Tp(l),k=c.contextType,y.context=typeof k=="object"&&k!==null?Bn(k):ta,y.state=l.memoizedState,k=c.getDerivedStateFromProps,typeof k=="function"&&($p(l,c,k,h),y.state=l.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(k=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),k!==y.state&&Zp.enqueueReplaceState(y,y.state,null),Yc(l,h,y,g),Kc(),y.state=l.memoizedState),typeof y.componentDidMount=="function"&&(l.flags|=4194308),h=!0}else if(s===null){y=l.stateNode;var M=l.memoizedProps,I=Xl(c,M);y.props=I;var ne=y.context,ce=c.contextType;k=ta,typeof ce=="object"&&ce!==null&&(k=Bn(ce));var he=c.getDerivedStateFromProps;ce=typeof he=="function"||typeof y.getSnapshotBeforeUpdate=="function",M=l.pendingProps!==M,ce||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(M||ne!==k)&&U1(l,y,h,k),Dr=!1;var ie=l.memoizedState;y.state=ie,Yc(l,h,y,g),Kc(),ne=l.memoizedState,M||ie!==ne||Dr?(typeof he=="function"&&($p(l,c,he,h),ne=l.memoizedState),(I=Dr||_1(l,c,I,h,ie,ne,k))?(ce||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(l.flags|=4194308)):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=h,l.memoizedState=ne),y.props=h,y.state=ne,y.context=k,h=I):(typeof y.componentDidMount=="function"&&(l.flags|=4194308),h=!1)}else{y=l.stateNode,Rp(s,l),k=l.memoizedProps,ce=Xl(c,k),y.props=ce,he=l.pendingProps,ie=y.context,ne=c.contextType,I=ta,typeof ne=="object"&&ne!==null&&(I=Bn(ne)),M=c.getDerivedStateFromProps,(ne=typeof M=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(k!==he||ie!==I)&&U1(l,y,h,I),Dr=!1,ie=l.memoizedState,y.state=ie,Yc(l,h,y,g),Kc();var re=l.memoizedState;k!==he||ie!==re||Dr||s!==null&&s.dependencies!==null&&Ff(s.dependencies)?(typeof M=="function"&&($p(l,c,M,h),re=l.memoizedState),(ce=Dr||_1(l,c,ce,h,ie,re,I)||s!==null&&s.dependencies!==null&&Ff(s.dependencies))?(ne||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(h,re,I),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(h,re,I)),typeof y.componentDidUpdate=="function"&&(l.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof y.componentDidUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(l.flags|=1024),l.memoizedProps=h,l.memoizedState=re),y.props=h,y.state=re,y.context=I,h=ce):(typeof y.componentDidUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(l.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||k===s.memoizedProps&&ie===s.memoizedState||(l.flags|=1024),h=!1)}return y=h,ch(s,l),h=(l.flags&128)!==0,y||h?(y=l.stateNode,c=h&&typeof c.getDerivedStateFromError!="function"?null:y.render(),l.flags|=1,s!==null&&h?(l.child=Ql(l,s.child,null,g),l.child=Ql(l,null,c,g)):zn(s,l,c,g),l.memoizedState=y.state,s=l.child):s=tr(s,l,g),s}function nS(s,l,c,h){return Vl(),l.flags|=256,zn(s,l,c,h),l.child}var ng={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ig(s){return{baseLanes:s,cachePool:Gx()}}function sg(s,l,c){return s=s!==null?s.childLanes&~c:0,l&&(s|=ki),s}function iS(s,l,c){var h=l.pendingProps,g=!1,y=(l.flags&128)!==0,k;if((k=y)||(k=s!==null&&s.memoizedState===null?!1:(rn.current&2)!==0),k&&(g=!0,l.flags&=-129),k=(l.flags&32)!==0,l.flags&=-33,s===null){if(gt){if(g?Br(l):zr(),(s=Vt)?(s=fw(s,Vi),s=s!==null&&s.data!=="&"?s:null,s!==null&&(l.memoizedState={dehydrated:s,treeContext:Rr!==null?{id:gs,overflow:ys}:null,retryLane:536870912,hydrationErrors:null},c=zx(s),c.return=l,l.child=c,Ln=l,Vt=null)):s=null,s===null)throw Or(l);return _g(s)?l.lanes=32:l.lanes=536870912,null}var M=h.children;return h=h.fallback,g?(zr(),g=l.mode,M=uh({mode:"hidden",children:M},g),h=Ul(h,g,c,null),M.return=l,h.return=l,M.sibling=h,l.child=M,h=l.child,h.memoizedState=ig(c),h.childLanes=sg(s,k,c),l.memoizedState=ng,Zc(null,h)):(Br(l),rg(l,M))}var I=s.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(y)l.flags&256?(Br(l),l.flags&=-257,l=lg(s,l,c)):l.memoizedState!==null?(zr(),l.child=s.child,l.flags|=128,l=null):(zr(),M=h.fallback,g=l.mode,h=uh({mode:"visible",children:h.children},g),M=Ul(M,g,c,null),M.flags|=2,h.return=l,M.return=l,h.sibling=M,l.child=h,Ql(l,s.child,null,c),h=l.child,h.memoizedState=ig(c),h.childLanes=sg(s,k,c),l.memoizedState=ng,l=Zc(null,h));else if(Br(l),_g(M)){if(k=M.nextSibling&&M.nextSibling.dataset,k)var ne=k.dgst;k=ne,h=Error(i(419)),h.stack="",h.digest=k,_c({value:h,source:null,stack:null}),l=lg(s,l,c)}else if(gn||ra(s,l,c,!1),k=(c&s.childLanes)!==0,gn||k){if(k=It,k!==null&&(h=Ec(k,c),h!==0&&h!==I.retryLane))throw I.retryLane=h,_l(s,h),ci(k,s,h),eg;Hg(M)||vh(),l=lg(s,l,c)}else Hg(M)?(l.flags|=192,l.child=s.child,l=null):(s=I.treeContext,Vt=Fi(M.nextSibling),Ln=l,gt=!0,Mr=null,Vi=!1,s!==null&&Hx(l,s),l=rg(l,h.children),l.flags|=4096);return l}return g?(zr(),M=h.fallback,g=l.mode,I=s.child,ne=I.sibling,h=Ws(I,{mode:"hidden",children:h.children}),h.subtreeFlags=I.subtreeFlags&65011712,ne!==null?M=Ws(ne,M):(M=Ul(M,g,c,null),M.flags|=2),M.return=l,h.return=l,h.sibling=M,l.child=h,Zc(null,h),h=l.child,M=s.child.memoizedState,M===null?M=ig(c):(g=M.cachePool,g!==null?(I=mn._currentValue,g=g.parent!==I?{parent:I,pool:I}:g):g=Gx(),M={baseLanes:M.baseLanes|c,cachePool:g}),h.memoizedState=M,h.childLanes=sg(s,k,c),l.memoizedState=ng,Zc(s.child,h)):(Br(l),c=s.child,s=c.sibling,c=Ws(c,{mode:"visible",children:h.children}),c.return=l,c.sibling=null,s!==null&&(k=l.deletions,k===null?(l.deletions=[s],l.flags|=16):k.push(s)),l.child=c,l.memoizedState=null,c)}function rg(s,l){return l=uh({mode:"visible",children:l},s.mode),l.return=s,s.child=l}function uh(s,l){return s=vi(22,s,null,l),s.lanes=0,s}function lg(s,l,c){return Ql(l,s.child,null,c),s=rg(l,l.pendingProps.children),s.flags|=2,l.memoizedState=null,s}function sS(s,l,c){s.lanes|=l;var h=s.alternate;h!==null&&(h.lanes|=l),Sp(s.return,l,c)}function og(s,l,c,h,g,y){var k=s.memoizedState;k===null?s.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:h,tail:c,tailMode:g,treeForkCount:y}:(k.isBackwards=l,k.rendering=null,k.renderingStartTime=0,k.last=h,k.tail=c,k.tailMode=g,k.treeForkCount=y)}function rS(s,l,c){var h=l.pendingProps,g=h.revealOrder,y=h.tail;h=h.children;var k=rn.current,M=(k&2)!==0;if(M?(k=k&1|2,l.flags|=128):k&=1,J(rn,k),zn(s,l,h,c),h=gt?Hc:0,!M&&s!==null&&(s.flags&128)!==0)e:for(s=l.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&sS(s,c,l);else if(s.tag===19)sS(s,c,l);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===l)break e;for(;s.sibling===null;){if(s.return===null||s.return===l)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}switch(g){case"forwards":for(c=l.child,g=null;c!==null;)s=c.alternate,s!==null&&Zf(s)===null&&(g=c),c=c.sibling;c=g,c===null?(g=l.child,l.child=null):(g=c.sibling,c.sibling=null),og(l,!1,g,c,y,h);break;case"backwards":case"unstable_legacy-backwards":for(c=null,g=l.child,l.child=null;g!==null;){if(s=g.alternate,s!==null&&Zf(s)===null){l.child=g;break}s=g.sibling,g.sibling=c,c=g,g=s}og(l,!0,c,null,y,h);break;case"together":og(l,!1,null,null,void 0,h);break;default:l.memoizedState=null}return l.child}function tr(s,l,c){if(s!==null&&(l.dependencies=s.dependencies),Hr|=l.lanes,(c&l.childLanes)===0)if(s!==null){if(ra(s,l,c,!1),(c&l.childLanes)===0)return null}else return null;if(s!==null&&l.child!==s.child)throw Error(i(153));if(l.child!==null){for(s=l.child,c=Ws(s,s.pendingProps),l.child=c,c.return=l;s.sibling!==null;)s=s.sibling,c=c.sibling=Ws(s,s.pendingProps),c.return=l;c.sibling=null}return l.child}function ag(s,l){return(s.lanes&l)!==0?!0:(s=s.dependencies,!!(s!==null&&Ff(s)))}function nN(s,l,c){switch(l.tag){case 3:fe(l,l.stateNode.containerInfo),Nr(l,mn,s.memoizedState.cache),Vl();break;case 27:case 5:Ne(l);break;case 4:fe(l,l.stateNode.containerInfo);break;case 10:Nr(l,l.type,l.memoizedProps.value);break;case 31:if(l.memoizedState!==null)return l.flags|=128,jp(l),null;break;case 13:var h=l.memoizedState;if(h!==null)return h.dehydrated!==null?(Br(l),l.flags|=128,null):(c&l.child.childLanes)!==0?iS(s,l,c):(Br(l),s=tr(s,l,c),s!==null?s.sibling:null);Br(l);break;case 19:var g=(s.flags&128)!==0;if(h=(c&l.childLanes)!==0,h||(ra(s,l,c,!1),h=(c&l.childLanes)!==0),g){if(h)return rS(s,l,c);l.flags|=128}if(g=l.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),J(rn,rn.current),h)break;return null;case 22:return l.lanes=0,$1(s,l,c,l.pendingProps);case 24:Nr(l,mn,s.memoizedState.cache)}return tr(s,l,c)}function lS(s,l,c){if(s!==null)if(s.memoizedProps!==l.pendingProps)gn=!0;else{if(!ag(s,c)&&(l.flags&128)===0)return gn=!1,nN(s,l,c);gn=(s.flags&131072)!==0}else gn=!1,gt&&(l.flags&1048576)!==0&&Ix(l,Hc,l.index);switch(l.lanes=0,l.tag){case 16:e:{var h=l.pendingProps;if(s=Kl(l.elementType),l.type=s,typeof s=="function")dp(s)?(h=Xl(s,h),l.tag=1,l=tS(null,l,s,h,c)):(l.tag=0,l=tg(null,l,s,h,c));else{if(s!=null){var g=s.$$typeof;if(g===N){l.tag=11,l=Q1(null,l,s,h,c);break e}else if(g===D){l.tag=14,l=W1(null,l,s,h,c);break e}}throw l=Z(s)||s,Error(i(306,l,""))}}return l;case 0:return tg(s,l,l.type,l.pendingProps,c);case 1:return h=l.type,g=Xl(h,l.pendingProps),tS(s,l,h,g,c);case 3:e:{if(fe(l,l.stateNode.containerInfo),s===null)throw Error(i(387));h=l.pendingProps;var y=l.memoizedState;g=y.element,Rp(s,l),Yc(l,h,null,c);var k=l.memoizedState;if(h=k.cache,Nr(l,mn,h),h!==y.cache&&wp(l,[mn],c,!0),Kc(),h=k.element,y.isDehydrated)if(y={element:h,isDehydrated:!1,cache:k.cache},l.updateQueue.baseState=y,l.memoizedState=y,l.flags&256){l=nS(s,l,h,c);break e}else if(h!==g){g=Hi(Error(i(424)),l),_c(g),l=nS(s,l,h,c);break e}else{switch(s=l.stateNode.containerInfo,s.nodeType){case 9:s=s.body;break;default:s=s.nodeName==="HTML"?s.ownerDocument.body:s}for(Vt=Fi(s.firstChild),Ln=l,gt=!0,Mr=null,Vi=!0,c=$x(l,null,h,c),l.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Vl(),h===g){l=tr(s,l,c);break e}zn(s,l,h,c)}l=l.child}return l;case 26:return ch(s,l),s===null?(c=yw(l.type,null,l.pendingProps,null))?l.memoizedState=c:gt||(c=l.type,s=l.pendingProps,h=Ah(ee.current).createElement(c),h[Sn]=l,h[jn]=s,Pn(h,c,s),Rn(h),l.stateNode=h):l.memoizedState=yw(l.type,s.memoizedProps,l.pendingProps,s.memoizedState),null;case 27:return Ne(l),s===null&>&&(h=l.stateNode=mw(l.type,l.pendingProps,ee.current),Ln=l,Vi=!0,g=Vt,Fr(l.type)?(Ug=g,Vt=Fi(h.firstChild)):Vt=g),zn(s,l,l.pendingProps.children,c),ch(s,l),s===null&&(l.flags|=4194304),l.child;case 5:return s===null&>&&((g=h=Vt)&&(h=DN(h,l.type,l.pendingProps,Vi),h!==null?(l.stateNode=h,Ln=l,Vt=Fi(h.firstChild),Vi=!1,g=!0):g=!1),g||Or(l)),Ne(l),g=l.type,y=l.pendingProps,k=s!==null?s.memoizedProps:null,h=y.children,zg(g,y)?h=null:k!==null&&zg(g,k)&&(l.flags|=32),l.memoizedState!==null&&(g=Bp(s,l,YO,null,null,c),du._currentValue=g),ch(s,l),zn(s,l,h,c),l.child;case 6:return s===null&>&&((s=c=Vt)&&(c=jN(c,l.pendingProps,Vi),c!==null?(l.stateNode=c,Ln=l,Vt=null,s=!0):s=!1),s||Or(l)),null;case 13:return iS(s,l,c);case 4:return fe(l,l.stateNode.containerInfo),h=l.pendingProps,s===null?l.child=Ql(l,null,h,c):zn(s,l,h,c),l.child;case 11:return Q1(s,l,l.type,l.pendingProps,c);case 7:return zn(s,l,l.pendingProps,c),l.child;case 8:return zn(s,l,l.pendingProps.children,c),l.child;case 12:return zn(s,l,l.pendingProps.children,c),l.child;case 10:return h=l.pendingProps,Nr(l,l.type,h.value),zn(s,l,h.children,c),l.child;case 9:return g=l.type._context,h=l.pendingProps.children,Fl(l),g=Bn(g),h=h(g),l.flags|=1,zn(s,l,h,c),l.child;case 14:return W1(s,l,l.type,l.pendingProps,c);case 15:return X1(s,l,l.type,l.pendingProps,c);case 19:return rS(s,l,c);case 31:return tN(s,l,c);case 22:return $1(s,l,c,l.pendingProps);case 24:return Fl(l),h=Bn(mn),s===null?(g=Ep(),g===null&&(g=It,y=kp(),g.pooledCache=y,y.refCount++,y!==null&&(g.pooledCacheLanes|=c),g=y),l.memoizedState={parent:h,cache:g},Tp(l),Nr(l,mn,g)):((s.lanes&c)!==0&&(Rp(s,l),Yc(l,null,null,c),Kc()),g=s.memoizedState,y=l.memoizedState,g.parent!==h?(g={parent:h,cache:h},l.memoizedState=g,l.lanes===0&&(l.memoizedState=l.updateQueue.baseState=g),Nr(l,mn,h)):(h=y.cache,Nr(l,mn,h),h!==g.cache&&wp(l,[mn],c,!0))),zn(s,l,l.pendingProps.children,c),l.child;case 29:throw l.pendingProps}throw Error(i(156,l.tag))}function nr(s){s.flags|=4}function cg(s,l,c,h,g){if((l=(s.mode&32)!==0)&&(l=!1),l){if(s.flags|=16777216,(g&335544128)===g)if(s.stateNode.complete)s.flags|=8192;else if(jS())s.flags|=8192;else throw Yl=Qf,Ap}else s.flags&=-16777217}function oS(s,l){if(l.type!=="stylesheet"||(l.state.loading&4)!==0)s.flags&=-16777217;else if(s.flags|=16777216,!ww(l))if(jS())s.flags|=8192;else throw Yl=Qf,Ap}function fh(s,l){l!==null&&(s.flags|=4),s.flags&16384&&(l=s.tag!==22?Un():536870912,s.lanes|=l,ya|=l)}function Jc(s,l){if(!gt)switch(s.tailMode){case"hidden":l=s.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?s.tail=null:c.sibling=null;break;case"collapsed":c=s.tail;for(var h=null;c!==null;)c.alternate!==null&&(h=c),c=c.sibling;h===null?l||s.tail===null?s.tail=null:s.tail.sibling=null:h.sibling=null}}function qt(s){var l=s.alternate!==null&&s.alternate.child===s.child,c=0,h=0;if(l)for(var g=s.child;g!==null;)c|=g.lanes|g.childLanes,h|=g.subtreeFlags&65011712,h|=g.flags&65011712,g.return=s,g=g.sibling;else for(g=s.child;g!==null;)c|=g.lanes|g.childLanes,h|=g.subtreeFlags,h|=g.flags,g.return=s,g=g.sibling;return s.subtreeFlags|=h,s.childLanes=c,l}function iN(s,l,c){var h=l.pendingProps;switch(yp(l),l.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return qt(l),null;case 1:return qt(l),null;case 3:return c=l.stateNode,h=null,s!==null&&(h=s.memoizedState.cache),l.memoizedState.cache!==h&&(l.flags|=2048),Zs(mn),me(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(s===null||s.child===null)&&(sa(l)?nr(l):s===null||s.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,vp())),qt(l),null;case 26:var g=l.type,y=l.memoizedState;return s===null?(nr(l),y!==null?(qt(l),oS(l,y)):(qt(l),cg(l,g,null,h,c))):y?y!==s.memoizedState?(nr(l),qt(l),oS(l,y)):(qt(l),l.flags&=-16777217):(s=s.memoizedProps,s!==h&&nr(l),qt(l),cg(l,g,s,h,c)),null;case 27:if(oe(l),c=ee.current,g=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&nr(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return qt(l),null}s=le.current,sa(l)?_x(l):(s=mw(g,h,c),l.stateNode=s,nr(l))}return qt(l),null;case 5:if(oe(l),g=l.type,s!==null&&l.stateNode!=null)s.memoizedProps!==h&&nr(l);else{if(!h){if(l.stateNode===null)throw Error(i(166));return qt(l),null}if(y=le.current,sa(l))_x(l);else{var k=Ah(ee.current);switch(y){case 1:y=k.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:y=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":y=k.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":y=k.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":y=k.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof h.is=="string"?k.createElement("select",{is:h.is}):k.createElement("select"),h.multiple?y.multiple=!0:h.size&&(y.size=h.size);break;default:y=typeof h.is=="string"?k.createElement(g,{is:h.is}):k.createElement(g)}}y[Sn]=l,y[jn]=h;e:for(k=l.child;k!==null;){if(k.tag===5||k.tag===6)y.appendChild(k.stateNode);else if(k.tag!==4&&k.tag!==27&&k.child!==null){k.child.return=k,k=k.child;continue}if(k===l)break e;for(;k.sibling===null;){if(k.return===null||k.return===l)break e;k=k.return}k.sibling.return=k.return,k=k.sibling}l.stateNode=y;e:switch(Pn(y,g,h),g){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&nr(l)}}return qt(l),cg(l,l.type,s===null?null:s.memoizedProps,l.pendingProps,c),null;case 6:if(s&&l.stateNode!=null)s.memoizedProps!==h&&nr(l);else{if(typeof h!="string"&&l.stateNode===null)throw Error(i(166));if(s=ee.current,sa(l)){if(s=l.stateNode,c=l.memoizedProps,h=null,g=Ln,g!==null)switch(g.tag){case 27:case 5:h=g.memoizedProps}s[Sn]=l,s=!!(s.nodeValue===c||h!==null&&h.suppressHydrationWarning===!0||iw(s.nodeValue,c)),s||Or(l,!0)}else s=Ah(s).createTextNode(h),s[Sn]=l,l.stateNode=s}return qt(l),null;case 31:if(c=l.memoizedState,s===null||s.memoizedState!==null){if(h=sa(l),c!==null){if(s===null){if(!h)throw Error(i(318));if(s=l.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(i(557));s[Sn]=l}else Vl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;qt(l),s=!1}else c=vp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=c),s=!0;if(!s)return l.flags&256?(Si(l),l):(Si(l),null);if((l.flags&128)!==0)throw Error(i(558))}return qt(l),null;case 13:if(h=l.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(g=sa(l),h!==null&&h.dehydrated!==null){if(s===null){if(!g)throw Error(i(318));if(g=l.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(i(317));g[Sn]=l}else Vl(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;qt(l),g=!1}else g=vp(),s!==null&&s.memoizedState!==null&&(s.memoizedState.hydrationErrors=g),g=!0;if(!g)return l.flags&256?(Si(l),l):(Si(l),null)}return Si(l),(l.flags&128)!==0?(l.lanes=c,l):(c=h!==null,s=s!==null&&s.memoizedState!==null,c&&(h=l.child,g=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(g=h.alternate.memoizedState.cachePool.pool),y=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(y=h.memoizedState.cachePool.pool),y!==g&&(h.flags|=2048)),c!==s&&c&&(l.child.flags|=8192),fh(l,l.updateQueue),qt(l),null);case 4:return me(),s===null&&Ng(l.stateNode.containerInfo),qt(l),null;case 10:return Zs(l.type),qt(l),null;case 19:if(_(rn),h=l.memoizedState,h===null)return qt(l),null;if(g=(l.flags&128)!==0,y=h.rendering,y===null)if(g)Jc(h,!1);else{if(Zt!==0||s!==null&&(s.flags&128)!==0)for(s=l.child;s!==null;){if(y=Zf(s),y!==null){for(l.flags|=128,Jc(h,!1),s=y.updateQueue,l.updateQueue=s,fh(l,s),l.subtreeFlags=0,s=c,c=l.child;c!==null;)Bx(c,s),c=c.sibling;return J(rn,rn.current&1|2),gt&&Xs(l,h.treeForkCount),l.child}s=s.sibling}h.tail!==null&&we()>gh&&(l.flags|=128,g=!0,Jc(h,!1),l.lanes=4194304)}else{if(!g)if(s=Zf(y),s!==null){if(l.flags|=128,g=!0,s=s.updateQueue,l.updateQueue=s,fh(l,s),Jc(h,!0),h.tail===null&&h.tailMode==="hidden"&&!y.alternate&&!gt)return qt(l),null}else 2*we()-h.renderingStartTime>gh&&c!==536870912&&(l.flags|=128,g=!0,Jc(h,!1),l.lanes=4194304);h.isBackwards?(y.sibling=l.child,l.child=y):(s=h.last,s!==null?s.sibling=y:l.child=y,h.last=y)}return h.tail!==null?(s=h.tail,h.rendering=s,h.tail=s.sibling,h.renderingStartTime=we(),s.sibling=null,c=rn.current,J(rn,g?c&1|2:c&1),gt&&Xs(l,h.treeForkCount),s):(qt(l),null);case 22:case 23:return Si(l),Dp(),h=l.memoizedState!==null,s!==null?s.memoizedState!==null!==h&&(l.flags|=8192):h&&(l.flags|=8192),h?(c&536870912)!==0&&(l.flags&128)===0&&(qt(l),l.subtreeFlags&6&&(l.flags|=8192)):qt(l),c=l.updateQueue,c!==null&&fh(l,c.retryQueue),c=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),h=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(h=l.memoizedState.cachePool.pool),h!==c&&(l.flags|=2048),s!==null&&_(Gl),null;case 24:return c=null,s!==null&&(c=s.memoizedState.cache),l.memoizedState.cache!==c&&(l.flags|=2048),Zs(mn),qt(l),null;case 25:return null;case 30:return null}throw Error(i(156,l.tag))}function sN(s,l){switch(yp(l),l.tag){case 1:return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 3:return Zs(mn),me(),s=l.flags,(s&65536)!==0&&(s&128)===0?(l.flags=s&-65537|128,l):null;case 26:case 27:case 5:return oe(l),null;case 31:if(l.memoizedState!==null){if(Si(l),l.alternate===null)throw Error(i(340));Vl()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 13:if(Si(l),s=l.memoizedState,s!==null&&s.dehydrated!==null){if(l.alternate===null)throw Error(i(340));Vl()}return s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 19:return _(rn),null;case 4:return me(),null;case 10:return Zs(l.type),null;case 22:case 23:return Si(l),Dp(),s!==null&&_(Gl),s=l.flags,s&65536?(l.flags=s&-65537|128,l):null;case 24:return Zs(mn),null;case 25:return null;default:return null}}function aS(s,l){switch(yp(l),l.tag){case 3:Zs(mn),me();break;case 26:case 27:case 5:oe(l);break;case 4:me();break;case 31:l.memoizedState!==null&&Si(l);break;case 13:Si(l);break;case 19:_(rn);break;case 10:Zs(l.type);break;case 22:case 23:Si(l),Dp(),s!==null&&_(Gl);break;case 24:Zs(mn)}}function eu(s,l){try{var c=l.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var g=h.next;c=g;do{if((c.tag&s)===s){h=void 0;var y=c.create,k=c.inst;h=y(),k.destroy=h}c=c.next}while(c!==g)}}catch(M){Nt(l,l.return,M)}}function Pr(s,l,c){try{var h=l.updateQueue,g=h!==null?h.lastEffect:null;if(g!==null){var y=g.next;h=y;do{if((h.tag&s)===s){var k=h.inst,M=k.destroy;if(M!==void 0){k.destroy=void 0,g=l;var I=c,ne=M;try{ne()}catch(ce){Nt(g,I,ce)}}}h=h.next}while(h!==y)}}catch(ce){Nt(l,l.return,ce)}}function cS(s){var l=s.updateQueue;if(l!==null){var c=s.stateNode;try{Jx(l,c)}catch(h){Nt(s,s.return,h)}}}function uS(s,l,c){c.props=Xl(s.type,s.memoizedProps),c.state=s.memoizedState;try{c.componentWillUnmount()}catch(h){Nt(s,l,h)}}function tu(s,l){try{var c=s.ref;if(c!==null){switch(s.tag){case 26:case 27:case 5:var h=s.stateNode;break;case 30:h=s.stateNode;break;default:h=s.stateNode}typeof c=="function"?s.refCleanup=c(h):c.current=h}}catch(g){Nt(s,l,g)}}function bs(s,l){var c=s.ref,h=s.refCleanup;if(c!==null)if(typeof h=="function")try{h()}catch(g){Nt(s,l,g)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(g){Nt(s,l,g)}else c.current=null}function fS(s){var l=s.type,c=s.memoizedProps,h=s.stateNode;try{e:switch(l){case"button":case"input":case"select":case"textarea":c.autoFocus&&h.focus();break e;case"img":c.src?h.src=c.src:c.srcSet&&(h.srcset=c.srcSet)}}catch(g){Nt(s,s.return,g)}}function ug(s,l,c){try{var h=s.stateNode;AN(h,s.type,c,l),h[jn]=l}catch(g){Nt(s,s.return,g)}}function hS(s){return s.tag===5||s.tag===3||s.tag===26||s.tag===27&&Fr(s.type)||s.tag===4}function fg(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||hS(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.tag===27&&Fr(s.type)||s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function hg(s,l,c){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(s,l):(l=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,l.appendChild(s),c=c._reactRootContainer,c!=null||l.onclick!==null||(l.onclick=Ys));else if(h!==4&&(h===27&&Fr(s.type)&&(c=s.stateNode,l=null),s=s.child,s!==null))for(hg(s,l,c),s=s.sibling;s!==null;)hg(s,l,c),s=s.sibling}function hh(s,l,c){var h=s.tag;if(h===5||h===6)s=s.stateNode,l?c.insertBefore(s,l):c.appendChild(s);else if(h!==4&&(h===27&&Fr(s.type)&&(c=s.stateNode),s=s.child,s!==null))for(hh(s,l,c),s=s.sibling;s!==null;)hh(s,l,c),s=s.sibling}function dS(s){var l=s.stateNode,c=s.memoizedProps;try{for(var h=s.type,g=l.attributes;g.length;)l.removeAttributeNode(g[0]);Pn(l,h,c),l[Sn]=s,l[jn]=c}catch(y){Nt(s,s.return,y)}}var ir=!1,yn=!1,dg=!1,mS=typeof WeakSet=="function"?WeakSet:Set,Mn=null;function rN(s,l){if(s=s.containerInfo,Lg=jh,s=Ax(s),lp(s)){if("selectionStart"in s)var c={start:s.selectionStart,end:s.selectionEnd};else e:{c=(c=s.ownerDocument)&&c.defaultView||window;var h=c.getSelection&&c.getSelection();if(h&&h.rangeCount!==0){c=h.anchorNode;var g=h.anchorOffset,y=h.focusNode;h=h.focusOffset;try{c.nodeType,y.nodeType}catch{c=null;break e}var k=0,M=-1,I=-1,ne=0,ce=0,he=s,ie=null;t:for(;;){for(var re;he!==c||g!==0&&he.nodeType!==3||(M=k+g),he!==y||h!==0&&he.nodeType!==3||(I=k+h),he.nodeType===3&&(k+=he.nodeValue.length),(re=he.firstChild)!==null;)ie=he,he=re;for(;;){if(he===s)break t;if(ie===c&&++ne===g&&(M=k),ie===y&&++ce===h&&(I=k),(re=he.nextSibling)!==null)break;he=ie,ie=he.parentNode}he=re}c=M===-1||I===-1?null:{start:M,end:I}}else c=null}c=c||{start:0,end:0}}else c=null;for(Bg={focusedElem:s,selectionRange:c},jh=!1,Mn=l;Mn!==null;)if(l=Mn,s=l.child,(l.subtreeFlags&1028)!==0&&s!==null)s.return=l,Mn=s;else for(;Mn!==null;){switch(l=Mn,y=l.alternate,s=l.flags,l.tag){case 0:if((s&4)!==0&&(s=l.updateQueue,s=s!==null?s.events:null,s!==null))for(c=0;c<s.length;c++)g=s[c],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((s&1024)!==0&&y!==null){s=void 0,c=l,g=y.memoizedProps,y=y.memoizedState,h=c.stateNode;try{var ze=Xl(c.type,g);s=h.getSnapshotBeforeUpdate(ze,y),h.__reactInternalSnapshotBeforeUpdate=s}catch(Ke){Nt(c,c.return,Ke)}}break;case 3:if((s&1024)!==0){if(s=l.stateNode.containerInfo,c=s.nodeType,c===9)Ig(s);else if(c===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":Ig(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((s&1024)!==0)throw Error(i(163))}if(s=l.sibling,s!==null){s.return=l.return,Mn=s;break}Mn=l.return}}function pS(s,l,c){var h=c.flags;switch(c.tag){case 0:case 11:case 15:rr(s,c),h&4&&eu(5,c);break;case 1:if(rr(s,c),h&4)if(s=c.stateNode,l===null)try{s.componentDidMount()}catch(k){Nt(c,c.return,k)}else{var g=Xl(c.type,l.memoizedProps);l=l.memoizedState;try{s.componentDidUpdate(g,l,s.__reactInternalSnapshotBeforeUpdate)}catch(k){Nt(c,c.return,k)}}h&64&&cS(c),h&512&&tu(c,c.return);break;case 3:if(rr(s,c),h&64&&(s=c.updateQueue,s!==null)){if(l=null,c.child!==null)switch(c.child.tag){case 27:case 5:l=c.child.stateNode;break;case 1:l=c.child.stateNode}try{Jx(s,l)}catch(k){Nt(c,c.return,k)}}break;case 27:l===null&&h&4&&dS(c);case 26:case 5:rr(s,c),l===null&&h&4&&fS(c),h&512&&tu(c,c.return);break;case 12:rr(s,c);break;case 31:rr(s,c),h&4&&bS(s,c);break;case 13:rr(s,c),h&4&&vS(s,c),h&64&&(s=c.memoizedState,s!==null&&(s=s.dehydrated,s!==null&&(c=mN.bind(null,c),LN(s,c))));break;case 22:if(h=c.memoizedState!==null||ir,!h){l=l!==null&&l.memoizedState!==null||yn,g=ir;var y=yn;ir=h,(yn=l)&&!y?lr(s,c,(c.subtreeFlags&8772)!==0):rr(s,c),ir=g,yn=y}break;case 30:break;default:rr(s,c)}}function gS(s){var l=s.alternate;l!==null&&(s.alternate=null,gS(l)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(l=s.stateNode,l!==null&&qm(l)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}var Gt=null,ri=!1;function sr(s,l,c){for(c=c.child;c!==null;)yS(s,l,c),c=c.sibling}function yS(s,l,c){if(He&&typeof He.onCommitFiberUnmount=="function")try{He.onCommitFiberUnmount(Pt,c)}catch{}switch(c.tag){case 26:yn||bs(c,l),sr(s,l,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:yn||bs(c,l);var h=Gt,g=ri;Fr(c.type)&&(Gt=c.stateNode,ri=!1),sr(s,l,c),uu(c.stateNode),Gt=h,ri=g;break;case 5:yn||bs(c,l);case 6:if(h=Gt,g=ri,Gt=null,sr(s,l,c),Gt=h,ri=g,Gt!==null)if(ri)try{(Gt.nodeType===9?Gt.body:Gt.nodeName==="HTML"?Gt.ownerDocument.body:Gt).removeChild(c.stateNode)}catch(y){Nt(c,l,y)}else try{Gt.removeChild(c.stateNode)}catch(y){Nt(c,l,y)}break;case 18:Gt!==null&&(ri?(s=Gt,cw(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,c.stateNode),Ea(s)):cw(Gt,c.stateNode));break;case 4:h=Gt,g=ri,Gt=c.stateNode.containerInfo,ri=!0,sr(s,l,c),Gt=h,ri=g;break;case 0:case 11:case 14:case 15:Pr(2,c,l),yn||Pr(4,c,l),sr(s,l,c);break;case 1:yn||(bs(c,l),h=c.stateNode,typeof h.componentWillUnmount=="function"&&uS(c,l,h)),sr(s,l,c);break;case 21:sr(s,l,c);break;case 22:yn=(h=yn)||c.memoizedState!==null,sr(s,l,c),yn=h;break;default:sr(s,l,c)}}function bS(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null))){s=s.dehydrated;try{Ea(s)}catch(c){Nt(l,l.return,c)}}}function vS(s,l){if(l.memoizedState===null&&(s=l.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{Ea(s)}catch(c){Nt(l,l.return,c)}}function lN(s){switch(s.tag){case 31:case 13:case 19:var l=s.stateNode;return l===null&&(l=s.stateNode=new mS),l;case 22:return s=s.stateNode,l=s._retryCache,l===null&&(l=s._retryCache=new mS),l;default:throw Error(i(435,s.tag))}}function dh(s,l){var c=lN(s);l.forEach(function(h){if(!c.has(h)){c.add(h);var g=pN.bind(null,s,h);h.then(g,g)}})}function li(s,l){var c=l.deletions;if(c!==null)for(var h=0;h<c.length;h++){var g=c[h],y=s,k=l,M=k;e:for(;M!==null;){switch(M.tag){case 27:if(Fr(M.type)){Gt=M.stateNode,ri=!1;break e}break;case 5:Gt=M.stateNode,ri=!1;break e;case 3:case 4:Gt=M.stateNode.containerInfo,ri=!0;break e}M=M.return}if(Gt===null)throw Error(i(160));yS(y,k,g),Gt=null,ri=!1,y=g.alternate,y!==null&&(y.return=null),g.return=null}if(l.subtreeFlags&13886)for(l=l.child;l!==null;)xS(l,s),l=l.sibling}var ns=null;function xS(s,l){var c=s.alternate,h=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:li(l,s),oi(s),h&4&&(Pr(3,s,s.return),eu(3,s),Pr(5,s,s.return));break;case 1:li(l,s),oi(s),h&512&&(yn||c===null||bs(c,c.return)),h&64&&ir&&(s=s.updateQueue,s!==null&&(h=s.callbacks,h!==null&&(c=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=c===null?h:c.concat(h))));break;case 26:var g=ns;if(li(l,s),oi(s),h&512&&(yn||c===null||bs(c,c.return)),h&4){var y=c!==null?c.memoizedState:null;if(h=s.memoizedState,c===null)if(h===null)if(s.stateNode===null){e:{h=s.type,c=s.memoizedProps,g=g.ownerDocument||g;t:switch(h){case"title":y=g.getElementsByTagName("title")[0],(!y||y[Rc]||y[Sn]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=g.createElement(h),g.head.insertBefore(y,g.querySelector("head > title"))),Pn(y,h,c),y[Sn]=s,Rn(y),h=y;break e;case"link":var k=xw("link","href",g).get(h+(c.href||""));if(k){for(var M=0;M<k.length;M++)if(y=k[M],y.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&y.getAttribute("rel")===(c.rel==null?null:c.rel)&&y.getAttribute("title")===(c.title==null?null:c.title)&&y.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){k.splice(M,1);break t}}y=g.createElement(h),Pn(y,h,c),g.head.appendChild(y);break;case"meta":if(k=xw("meta","content",g).get(h+(c.content||""))){for(M=0;M<k.length;M++)if(y=k[M],y.getAttribute("content")===(c.content==null?null:""+c.content)&&y.getAttribute("name")===(c.name==null?null:c.name)&&y.getAttribute("property")===(c.property==null?null:c.property)&&y.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&y.getAttribute("charset")===(c.charSet==null?null:c.charSet)){k.splice(M,1);break t}}y=g.createElement(h),Pn(y,h,c),g.head.appendChild(y);break;default:throw Error(i(468,h))}y[Sn]=s,Rn(y),h=y}s.stateNode=h}else Sw(g,s.type,s.stateNode);else s.stateNode=vw(g,h,s.memoizedProps);else y!==h?(y===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):y.count--,h===null?Sw(g,s.type,s.stateNode):vw(g,h,s.memoizedProps)):h===null&&s.stateNode!==null&&ug(s,s.memoizedProps,c.memoizedProps)}break;case 27:li(l,s),oi(s),h&512&&(yn||c===null||bs(c,c.return)),c!==null&&h&4&&ug(s,s.memoizedProps,c.memoizedProps);break;case 5:if(li(l,s),oi(s),h&512&&(yn||c===null||bs(c,c.return)),s.flags&32){g=s.stateNode;try{Qo(g,"")}catch(ze){Nt(s,s.return,ze)}}h&4&&s.stateNode!=null&&(g=s.memoizedProps,ug(s,g,c!==null?c.memoizedProps:g)),h&1024&&(dg=!0);break;case 6:if(li(l,s),oi(s),h&4){if(s.stateNode===null)throw Error(i(162));h=s.memoizedProps,c=s.stateNode;try{c.nodeValue=h}catch(ze){Nt(s,s.return,ze)}}break;case 3:if(Mh=null,g=ns,ns=Th(l.containerInfo),li(l,s),ns=g,oi(s),h&4&&c!==null&&c.memoizedState.isDehydrated)try{Ea(l.containerInfo)}catch(ze){Nt(s,s.return,ze)}dg&&(dg=!1,SS(s));break;case 4:h=ns,ns=Th(s.stateNode.containerInfo),li(l,s),oi(s),ns=h;break;case 12:li(l,s),oi(s);break;case 31:li(l,s),oi(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,dh(s,h)));break;case 13:li(l,s),oi(s),s.child.flags&8192&&s.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(ph=we()),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,dh(s,h)));break;case 22:g=s.memoizedState!==null;var I=c!==null&&c.memoizedState!==null,ne=ir,ce=yn;if(ir=ne||g,yn=ce||I,li(l,s),yn=ce,ir=ne,oi(s),h&8192)e:for(l=s.stateNode,l._visibility=g?l._visibility&-2:l._visibility|1,g&&(c===null||I||ir||yn||$l(s)),c=null,l=s;;){if(l.tag===5||l.tag===26){if(c===null){I=c=l;try{if(y=I.stateNode,g)k=y.style,typeof k.setProperty=="function"?k.setProperty("display","none","important"):k.display="none";else{M=I.stateNode;var he=I.memoizedProps.style,ie=he!=null&&he.hasOwnProperty("display")?he.display:null;M.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(ze){Nt(I,I.return,ze)}}}else if(l.tag===6){if(c===null){I=l;try{I.stateNode.nodeValue=g?"":I.memoizedProps}catch(ze){Nt(I,I.return,ze)}}}else if(l.tag===18){if(c===null){I=l;try{var re=I.stateNode;g?uw(re,!0):uw(I.stateNode,!1)}catch(ze){Nt(I,I.return,ze)}}}else if((l.tag!==22&&l.tag!==23||l.memoizedState===null||l===s)&&l.child!==null){l.child.return=l,l=l.child;continue}if(l===s)break e;for(;l.sibling===null;){if(l.return===null||l.return===s)break e;c===l&&(c=null),l=l.return}c===l&&(c=null),l.sibling.return=l.return,l=l.sibling}h&4&&(h=s.updateQueue,h!==null&&(c=h.retryQueue,c!==null&&(h.retryQueue=null,dh(s,c))));break;case 19:li(l,s),oi(s),h&4&&(h=s.updateQueue,h!==null&&(s.updateQueue=null,dh(s,h)));break;case 30:break;case 21:break;default:li(l,s),oi(s)}}function oi(s){var l=s.flags;if(l&2){try{for(var c,h=s.return;h!==null;){if(hS(h)){c=h;break}h=h.return}if(c==null)throw Error(i(160));switch(c.tag){case 27:var g=c.stateNode,y=fg(s);hh(s,y,g);break;case 5:var k=c.stateNode;c.flags&32&&(Qo(k,""),c.flags&=-33);var M=fg(s);hh(s,M,k);break;case 3:case 4:var I=c.stateNode.containerInfo,ne=fg(s);hg(s,ne,I);break;default:throw Error(i(161))}}catch(ce){Nt(s,s.return,ce)}s.flags&=-3}l&4096&&(s.flags&=-4097)}function SS(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var l=s;SS(l),l.tag===5&&l.flags&1024&&l.stateNode.reset(),s=s.sibling}}function rr(s,l){if(l.subtreeFlags&8772)for(l=l.child;l!==null;)pS(s,l.alternate,l),l=l.sibling}function $l(s){for(s=s.child;s!==null;){var l=s;switch(l.tag){case 0:case 11:case 14:case 15:Pr(4,l,l.return),$l(l);break;case 1:bs(l,l.return);var c=l.stateNode;typeof c.componentWillUnmount=="function"&&uS(l,l.return,c),$l(l);break;case 27:uu(l.stateNode);case 26:case 5:bs(l,l.return),$l(l);break;case 22:l.memoizedState===null&&$l(l);break;case 30:$l(l);break;default:$l(l)}s=s.sibling}}function lr(s,l,c){for(c=c&&(l.subtreeFlags&8772)!==0,l=l.child;l!==null;){var h=l.alternate,g=s,y=l,k=y.flags;switch(y.tag){case 0:case 11:case 15:lr(g,y,c),eu(4,y);break;case 1:if(lr(g,y,c),h=y,g=h.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(ne){Nt(h,h.return,ne)}if(h=y,g=h.updateQueue,g!==null){var M=h.stateNode;try{var I=g.shared.hiddenCallbacks;if(I!==null)for(g.shared.hiddenCallbacks=null,g=0;g<I.length;g++)Zx(I[g],M)}catch(ne){Nt(h,h.return,ne)}}c&&k&64&&cS(y),tu(y,y.return);break;case 27:dS(y);case 26:case 5:lr(g,y,c),c&&h===null&&k&4&&fS(y),tu(y,y.return);break;case 12:lr(g,y,c);break;case 31:lr(g,y,c),c&&k&4&&bS(g,y);break;case 13:lr(g,y,c),c&&k&4&&vS(g,y);break;case 22:y.memoizedState===null&&lr(g,y,c),tu(y,y.return);break;case 30:break;default:lr(g,y,c)}l=l.sibling}}function mg(s,l){var c=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(c=s.memoizedState.cachePool.pool),s=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(s=l.memoizedState.cachePool.pool),s!==c&&(s!=null&&s.refCount++,c!=null&&Uc(c))}function pg(s,l){s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Uc(s))}function is(s,l,c,h){if(l.subtreeFlags&10256)for(l=l.child;l!==null;)wS(s,l,c,h),l=l.sibling}function wS(s,l,c,h){var g=l.flags;switch(l.tag){case 0:case 11:case 15:is(s,l,c,h),g&2048&&eu(9,l);break;case 1:is(s,l,c,h);break;case 3:is(s,l,c,h),g&2048&&(s=null,l.alternate!==null&&(s=l.alternate.memoizedState.cache),l=l.memoizedState.cache,l!==s&&(l.refCount++,s!=null&&Uc(s)));break;case 12:if(g&2048){is(s,l,c,h),s=l.stateNode;try{var y=l.memoizedProps,k=y.id,M=y.onPostCommit;typeof M=="function"&&M(k,l.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(I){Nt(l,l.return,I)}}else is(s,l,c,h);break;case 31:is(s,l,c,h);break;case 13:is(s,l,c,h);break;case 23:break;case 22:y=l.stateNode,k=l.alternate,l.memoizedState!==null?y._visibility&2?is(s,l,c,h):nu(s,l):y._visibility&2?is(s,l,c,h):(y._visibility|=2,ma(s,l,c,h,(l.subtreeFlags&10256)!==0||!1)),g&2048&&mg(k,l);break;case 24:is(s,l,c,h),g&2048&&pg(l.alternate,l);break;default:is(s,l,c,h)}}function ma(s,l,c,h,g){for(g=g&&((l.subtreeFlags&10256)!==0||!1),l=l.child;l!==null;){var y=s,k=l,M=c,I=h,ne=k.flags;switch(k.tag){case 0:case 11:case 15:ma(y,k,M,I,g),eu(8,k);break;case 23:break;case 22:var ce=k.stateNode;k.memoizedState!==null?ce._visibility&2?ma(y,k,M,I,g):nu(y,k):(ce._visibility|=2,ma(y,k,M,I,g)),g&&ne&2048&&mg(k.alternate,k);break;case 24:ma(y,k,M,I,g),g&&ne&2048&&pg(k.alternate,k);break;default:ma(y,k,M,I,g)}l=l.sibling}}function nu(s,l){if(l.subtreeFlags&10256)for(l=l.child;l!==null;){var c=s,h=l,g=h.flags;switch(h.tag){case 22:nu(c,h),g&2048&&mg(h.alternate,h);break;case 24:nu(c,h),g&2048&&pg(h.alternate,h);break;default:nu(c,h)}l=l.sibling}}var iu=8192;function pa(s,l,c){if(s.subtreeFlags&iu)for(s=s.child;s!==null;)kS(s,l,c),s=s.sibling}function kS(s,l,c){switch(s.tag){case 26:pa(s,l,c),s.flags&iu&&s.memoizedState!==null&&KN(c,ns,s.memoizedState,s.memoizedProps);break;case 5:pa(s,l,c);break;case 3:case 4:var h=ns;ns=Th(s.stateNode.containerInfo),pa(s,l,c),ns=h;break;case 22:s.memoizedState===null&&(h=s.alternate,h!==null&&h.memoizedState!==null?(h=iu,iu=16777216,pa(s,l,c),iu=h):pa(s,l,c));break;default:pa(s,l,c)}}function CS(s){var l=s.alternate;if(l!==null&&(s=l.child,s!==null)){l.child=null;do l=s.sibling,s.sibling=null,s=l;while(s!==null)}}function su(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Mn=h,AS(h,s)}CS(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)ES(s),s=s.sibling}function ES(s){switch(s.tag){case 0:case 11:case 15:su(s),s.flags&2048&&Pr(9,s,s.return);break;case 3:su(s);break;case 12:su(s);break;case 22:var l=s.stateNode;s.memoizedState!==null&&l._visibility&2&&(s.return===null||s.return.tag!==13)?(l._visibility&=-3,mh(s)):su(s);break;default:su(s)}}function mh(s){var l=s.deletions;if((s.flags&16)!==0){if(l!==null)for(var c=0;c<l.length;c++){var h=l[c];Mn=h,AS(h,s)}CS(s)}for(s=s.child;s!==null;){switch(l=s,l.tag){case 0:case 11:case 15:Pr(8,l,l.return),mh(l);break;case 22:c=l.stateNode,c._visibility&2&&(c._visibility&=-3,mh(l));break;default:mh(l)}s=s.sibling}}function AS(s,l){for(;Mn!==null;){var c=Mn;switch(c.tag){case 0:case 11:case 15:Pr(8,c,l);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var h=c.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:Uc(c.memoizedState.cache)}if(h=c.child,h!==null)h.return=c,Mn=h;else e:for(c=s;Mn!==null;){h=Mn;var g=h.sibling,y=h.return;if(gS(h),h===c){Mn=null;break e}if(g!==null){g.return=y,Mn=g;break e}Mn=y}}}var oN={getCacheForType:function(s){var l=Bn(mn),c=l.data.get(s);return c===void 0&&(c=s(),l.data.set(s,c)),c},cacheSignal:function(){return Bn(mn).controller.signal}},aN=typeof WeakMap=="function"?WeakMap:Map,At=0,It=null,ct=null,mt=0,Ot=0,wi=null,Ir=!1,ga=!1,gg=!1,or=0,Zt=0,Hr=0,Zl=0,yg=0,ki=0,ya=0,ru=null,ai=null,bg=!1,ph=0,TS=0,gh=1/0,yh=null,_r=null,wn=0,Ur=null,ba=null,ar=0,vg=0,xg=null,RS=null,lu=0,Sg=null;function Ci(){return(At&2)!==0&&mt!==0?mt&-mt:P.T!==null?Tg():Ar()}function MS(){if(ki===0)if((mt&536870912)===0||gt){var s=Xt;Xt<<=1,(Xt&3932160)===0&&(Xt=262144),ki=s}else ki=536870912;return s=xi.current,s!==null&&(s.flags|=32),ki}function ci(s,l,c){(s===It&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)&&(va(s,0),Vr(s,mt,ki,!1)),Fs(s,c),((At&2)===0||s!==It)&&(s===It&&((At&2)===0&&(Zl|=c),Zt===4&&Vr(s,mt,ki,!1)),vs(s))}function OS(s,l,c){if((At&6)!==0)throw Error(i(327));var h=!c&&(l&127)===0&&(l&s.expiredLanes)===0||Kt(s,l),g=h?fN(s,l):kg(s,l,!0),y=h;do{if(g===0){ga&&!h&&Vr(s,l,0,!1);break}else{if(c=s.current.alternate,y&&!cN(c)){g=kg(s,l,!1),y=!1;continue}if(g===2){if(y=l,s.errorRecoveryDisabledLanes&y)var k=0;else k=s.pendingLanes&-536870913,k=k!==0?k:k&536870912?536870912:0;if(k!==0){l=k;e:{var M=s;g=ru;var I=M.current.memoizedState.isDehydrated;if(I&&(va(M,k).flags|=256),k=kg(M,k,!1),k!==2){if(gg&&!I){M.errorRecoveryDisabledLanes|=y,Zl|=y,g=4;break e}y=ai,ai=g,y!==null&&(ai===null?ai=y:ai.push.apply(ai,y))}g=k}if(y=!1,g!==2)continue}}if(g===1){va(s,0),Vr(s,l,0,!0);break}e:{switch(h=s,y=g,y){case 0:case 1:throw Error(i(345));case 4:if((l&4194048)!==l)break;case 6:Vr(h,l,ki,!Ir);break e;case 2:ai=null;break;case 3:case 5:break;default:throw Error(i(329))}if((l&62914560)===l&&(g=ph+300-we(),10<g)){if(Vr(h,l,ki,!Ir),Et(h,0,!0)!==0)break e;ar=l,h.timeoutHandle=ow(NS.bind(null,h,c,ai,yh,bg,l,ki,Zl,ya,Ir,y,"Throttled",-0,0),g);break e}NS(h,c,ai,yh,bg,l,ki,Zl,ya,Ir,y,null,-0,0)}}break}while(!0);vs(s)}function NS(s,l,c,h,g,y,k,M,I,ne,ce,he,ie,re){if(s.timeoutHandle=-1,he=l.subtreeFlags,he&8192||(he&16785408)===16785408){he={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ys},kS(l,y,he);var ze=(y&62914560)===y?ph-we():(y&4194048)===y?TS-we():0;if(ze=YN(he,ze),ze!==null){ar=y,s.cancelPendingCommit=ze(HS.bind(null,s,l,y,c,h,g,k,M,I,ce,he,null,ie,re)),Vr(s,y,k,!ne);return}}HS(s,l,y,c,h,g,k,M,I)}function cN(s){for(var l=s;;){var c=l.tag;if((c===0||c===11||c===15)&&l.flags&16384&&(c=l.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var h=0;h<c.length;h++){var g=c[h],y=g.getSnapshot;g=g.value;try{if(!bi(y(),g))return!1}catch{return!1}}if(c=l.child,l.subtreeFlags&16384&&c!==null)c.return=l,l=c;else{if(l===s)break;for(;l.sibling===null;){if(l.return===null||l.return===s)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Vr(s,l,c,h){l&=~yg,l&=~Zl,s.suspendedLanes|=l,s.pingedLanes&=~l,h&&(s.warmLanes|=l),h=s.expirationTimes;for(var g=l;0<g;){var y=31-it(g),k=1<<y;h[y]=-1,g&=~k}c!==0&&Af(s,c,l)}function bh(){return(At&6)===0?(ou(0),!1):!0}function wg(){if(ct!==null){if(Ot===0)var s=ct.return;else s=ct,$s=ql=null,Ip(s),ca=null,qc=0,s=ct;for(;s!==null;)aS(s.alternate,s),s=s.return;ct=null}}function va(s,l){var c=s.timeoutHandle;c!==-1&&(s.timeoutHandle=-1,MN(c)),c=s.cancelPendingCommit,c!==null&&(s.cancelPendingCommit=null,c()),ar=0,wg(),It=s,ct=c=Ws(s.current,null),mt=l,Ot=0,wi=null,Ir=!1,ga=Kt(s,l),gg=!1,ya=ki=yg=Zl=Hr=Zt=0,ai=ru=null,bg=!1,(l&8)!==0&&(l|=l&32);var h=s.entangledLanes;if(h!==0)for(s=s.entanglements,h&=l;0<h;){var g=31-it(h),y=1<<g;l|=s[g],h&=~y}return or=l,Hf(),c}function DS(s,l){Ze=null,P.H=$c,l===aa||l===Yf?(l=Qx(),Ot=3):l===Ap?(l=Qx(),Ot=4):Ot=l===eg?8:l!==null&&typeof l=="object"&&typeof l.then=="function"?6:1,wi=l,ct===null&&(Zt=1,oh(s,Hi(l,s.current)))}function jS(){var s=xi.current;return s===null?!0:(mt&4194048)===mt?qi===null:(mt&62914560)===mt||(mt&536870912)!==0?s===qi:!1}function LS(){var s=P.H;return P.H=$c,s===null?$c:s}function BS(){var s=P.A;return P.A=oN,s}function vh(){Zt=4,Ir||(mt&4194048)!==mt&&xi.current!==null||(ga=!0),(Hr&134217727)===0&&(Zl&134217727)===0||It===null||Vr(It,mt,ki,!1)}function kg(s,l,c){var h=At;At|=2;var g=LS(),y=BS();(It!==s||mt!==l)&&(yh=null,va(s,l)),l=!1;var k=Zt;e:do try{if(Ot!==0&&ct!==null){var M=ct,I=wi;switch(Ot){case 8:wg(),k=6;break e;case 3:case 2:case 9:case 6:xi.current===null&&(l=!0);var ne=Ot;if(Ot=0,wi=null,xa(s,M,I,ne),c&&ga){k=0;break e}break;default:ne=Ot,Ot=0,wi=null,xa(s,M,I,ne)}}uN(),k=Zt;break}catch(ce){DS(s,ce)}while(!0);return l&&s.shellSuspendCounter++,$s=ql=null,At=h,P.H=g,P.A=y,ct===null&&(It=null,mt=0,Hf()),k}function uN(){for(;ct!==null;)zS(ct)}function fN(s,l){var c=At;At|=2;var h=LS(),g=BS();It!==s||mt!==l?(yh=null,gh=we()+500,va(s,l)):ga=Kt(s,l);e:do try{if(Ot!==0&&ct!==null){l=ct;var y=wi;t:switch(Ot){case 1:Ot=0,wi=null,xa(s,l,y,1);break;case 2:case 9:if(Kx(y)){Ot=0,wi=null,PS(l);break}l=function(){Ot!==2&&Ot!==9||It!==s||(Ot=7),vs(s)},y.then(l,l);break e;case 3:Ot=7;break e;case 4:Ot=5;break e;case 7:Kx(y)?(Ot=0,wi=null,PS(l)):(Ot=0,wi=null,xa(s,l,y,7));break;case 5:var k=null;switch(ct.tag){case 26:k=ct.memoizedState;case 5:case 27:var M=ct;if(k?ww(k):M.stateNode.complete){Ot=0,wi=null;var I=M.sibling;if(I!==null)ct=I;else{var ne=M.return;ne!==null?(ct=ne,xh(ne)):ct=null}break t}}Ot=0,wi=null,xa(s,l,y,5);break;case 6:Ot=0,wi=null,xa(s,l,y,6);break;case 8:wg(),Zt=6;break e;default:throw Error(i(462))}}hN();break}catch(ce){DS(s,ce)}while(!0);return $s=ql=null,P.H=h,P.A=g,At=c,ct!==null?0:(It=null,mt=0,Hf(),Zt)}function hN(){for(;ct!==null&&!Me();)zS(ct)}function zS(s){var l=lS(s.alternate,s,or);s.memoizedProps=s.pendingProps,l===null?xh(s):ct=l}function PS(s){var l=s,c=l.alternate;switch(l.tag){case 15:case 0:l=eS(c,l,l.pendingProps,l.type,void 0,mt);break;case 11:l=eS(c,l,l.pendingProps,l.type.render,l.ref,mt);break;case 5:Ip(l);default:aS(c,l),l=ct=Bx(l,or),l=lS(c,l,or)}s.memoizedProps=s.pendingProps,l===null?xh(s):ct=l}function xa(s,l,c,h){$s=ql=null,Ip(l),ca=null,qc=0;var g=l.return;try{if(eN(s,g,l,c,mt)){Zt=1,oh(s,Hi(c,s.current)),ct=null;return}}catch(y){if(g!==null)throw ct=g,y;Zt=1,oh(s,Hi(c,s.current)),ct=null;return}l.flags&32768?(gt||h===1?s=!0:ga||(mt&536870912)!==0?s=!1:(Ir=s=!0,(h===2||h===9||h===3||h===6)&&(h=xi.current,h!==null&&h.tag===13&&(h.flags|=16384))),IS(l,s)):xh(l)}function xh(s){var l=s;do{if((l.flags&32768)!==0){IS(l,Ir);return}s=l.return;var c=iN(l.alternate,l,or);if(c!==null){ct=c;return}if(l=l.sibling,l!==null){ct=l;return}ct=l=s}while(l!==null);Zt===0&&(Zt=5)}function IS(s,l){do{var c=sN(s.alternate,s);if(c!==null){c.flags&=32767,ct=c;return}if(c=s.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!l&&(s=s.sibling,s!==null)){ct=s;return}ct=s=c}while(s!==null);Zt=6,ct=null}function HS(s,l,c,h,g,y,k,M,I){s.cancelPendingCommit=null;do Sh();while(wn!==0);if((At&6)!==0)throw Error(i(327));if(l!==null){if(l===s.current)throw Error(i(177));if(y=l.lanes|l.childLanes,y|=fp,Vm(s,c,y,k,M,I),s===It&&(ct=It=null,mt=0),ba=l,Ur=s,ar=c,vg=y,xg=g,RS=h,(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?(s.callbackNode=null,s.callbackPriority=0,gN(Qe,function(){return FS(),null})):(s.callbackNode=null,s.callbackPriority=0),h=(l.flags&13878)!==0,(l.subtreeFlags&13878)!==0||h){h=P.T,P.T=null,g=W.p,W.p=2,k=At,At|=4;try{rN(s,l,c)}finally{At=k,W.p=g,P.T=h}}wn=1,_S(),US(),VS()}}function _S(){if(wn===1){wn=0;var s=Ur,l=ba,c=(l.flags&13878)!==0;if((l.subtreeFlags&13878)!==0||c){c=P.T,P.T=null;var h=W.p;W.p=2;var g=At;At|=4;try{xS(l,s);var y=Bg,k=Ax(s.containerInfo),M=y.focusedElem,I=y.selectionRange;if(k!==M&&M&&M.ownerDocument&&Ex(M.ownerDocument.documentElement,M)){if(I!==null&&lp(M)){var ne=I.start,ce=I.end;if(ce===void 0&&(ce=ne),"selectionStart"in M)M.selectionStart=ne,M.selectionEnd=Math.min(ce,M.value.length);else{var he=M.ownerDocument||document,ie=he&&he.defaultView||window;if(ie.getSelection){var re=ie.getSelection(),ze=M.textContent.length,Ke=Math.min(I.start,ze),Bt=I.end===void 0?Ke:Math.min(I.end,ze);!re.extend&&Ke>Bt&&(k=Bt,Bt=Ke,Ke=k);var X=Cx(M,Ke),G=Cx(M,Bt);if(X&&G&&(re.rangeCount!==1||re.anchorNode!==X.node||re.anchorOffset!==X.offset||re.focusNode!==G.node||re.focusOffset!==G.offset)){var te=he.createRange();te.setStart(X.node,X.offset),re.removeAllRanges(),Ke>Bt?(re.addRange(te),re.extend(G.node,G.offset)):(te.setEnd(G.node,G.offset),re.addRange(te))}}}}for(he=[],re=M;re=re.parentNode;)re.nodeType===1&&he.push({element:re,left:re.scrollLeft,top:re.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<he.length;M++){var ue=he[M];ue.element.scrollLeft=ue.left,ue.element.scrollTop=ue.top}}jh=!!Lg,Bg=Lg=null}finally{At=g,W.p=h,P.T=c}}s.current=l,wn=2}}function US(){if(wn===2){wn=0;var s=Ur,l=ba,c=(l.flags&8772)!==0;if((l.subtreeFlags&8772)!==0||c){c=P.T,P.T=null;var h=W.p;W.p=2;var g=At;At|=4;try{pS(s,l.alternate,l)}finally{At=g,W.p=h,P.T=c}}wn=3}}function VS(){if(wn===4||wn===3){wn=0,be();var s=Ur,l=ba,c=ar,h=RS;(l.subtreeFlags&10256)!==0||(l.flags&10256)!==0?wn=5:(wn=0,ba=Ur=null,qS(s,s.pendingLanes));var g=s.pendingLanes;if(g===0&&(_r=null),Tc(c),l=l.stateNode,He&&typeof He.onCommitFiberRoot=="function")try{He.onCommitFiberRoot(Pt,l,void 0,(l.current.flags&128)===128)}catch{}if(h!==null){l=P.T,g=W.p,W.p=2,P.T=null;try{for(var y=s.onRecoverableError,k=0;k<h.length;k++){var M=h[k];y(M.value,{componentStack:M.stack})}}finally{P.T=l,W.p=g}}(ar&3)!==0&&Sh(),vs(s),g=s.pendingLanes,(c&261930)!==0&&(g&42)!==0?s===Sg?lu++:(lu=0,Sg=s):lu=0,ou(0)}}function qS(s,l){(s.pooledCacheLanes&=l)===0&&(l=s.pooledCache,l!=null&&(s.pooledCache=null,Uc(l)))}function Sh(){return _S(),US(),VS(),FS()}function FS(){if(wn!==5)return!1;var s=Ur,l=vg;vg=0;var c=Tc(ar),h=P.T,g=W.p;try{W.p=32>c?32:c,P.T=null,c=xg,xg=null;var y=Ur,k=ar;if(wn=0,ba=Ur=null,ar=0,(At&6)!==0)throw Error(i(331));var M=At;if(At|=4,ES(y.current),wS(y,y.current,k,c),At=M,ou(0,!1),He&&typeof He.onPostCommitFiberRoot=="function")try{He.onPostCommitFiberRoot(Pt,y)}catch{}return!0}finally{W.p=g,P.T=h,qS(s,l)}}function GS(s,l,c){l=Hi(c,l),l=Jp(s.stateNode,l,2),s=Lr(s,l,2),s!==null&&(Fs(s,2),vs(s))}function Nt(s,l,c){if(s.tag===3)GS(s,s,c);else for(;l!==null;){if(l.tag===3){GS(l,s,c);break}else if(l.tag===1){var h=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(_r===null||!_r.has(h))){s=Hi(c,s),c=K1(2),h=Lr(l,c,2),h!==null&&(Y1(c,h,l,s),Fs(h,2),vs(h));break}}l=l.return}}function Cg(s,l,c){var h=s.pingCache;if(h===null){h=s.pingCache=new aN;var g=new Set;h.set(l,g)}else g=h.get(l),g===void 0&&(g=new Set,h.set(l,g));g.has(c)||(gg=!0,g.add(c),s=dN.bind(null,s,l,c),l.then(s,s))}function dN(s,l,c){var h=s.pingCache;h!==null&&h.delete(l),s.pingedLanes|=s.suspendedLanes&c,s.warmLanes&=~c,It===s&&(mt&c)===c&&(Zt===4||Zt===3&&(mt&62914560)===mt&&300>we()-ph?(At&2)===0&&va(s,0):yg|=c,ya===mt&&(ya=0)),vs(s)}function KS(s,l){l===0&&(l=Un()),s=_l(s,l),s!==null&&(Fs(s,l),vs(s))}function mN(s){var l=s.memoizedState,c=0;l!==null&&(c=l.retryLane),KS(s,c)}function pN(s,l){var c=0;switch(s.tag){case 31:case 13:var h=s.stateNode,g=s.memoizedState;g!==null&&(c=g.retryLane);break;case 19:h=s.stateNode;break;case 22:h=s.stateNode._retryCache;break;default:throw Error(i(314))}h!==null&&h.delete(l),KS(s,c)}function gN(s,l){return Te(s,l)}var wh=null,Sa=null,Eg=!1,kh=!1,Ag=!1,qr=0;function vs(s){s!==Sa&&s.next===null&&(Sa===null?wh=Sa=s:Sa=Sa.next=s),kh=!0,Eg||(Eg=!0,bN())}function ou(s,l){if(!Ag&&kh){Ag=!0;do for(var c=!1,h=wh;h!==null;){if(s!==0){var g=h.pendingLanes;if(g===0)var y=0;else{var k=h.suspendedLanes,M=h.pingedLanes;y=(1<<31-it(42|s)+1)-1,y&=g&~(k&~M),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(c=!0,XS(h,y))}else y=mt,y=Et(h,h===It?y:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(y&3)===0||Kt(h,y)||(c=!0,XS(h,y));h=h.next}while(c);Ag=!1}}function yN(){YS()}function YS(){kh=Eg=!1;var s=0;qr!==0&&RN()&&(s=qr);for(var l=we(),c=null,h=wh;h!==null;){var g=h.next,y=QS(h,l);y===0?(h.next=null,c===null?wh=g:c.next=g,g===null&&(Sa=c)):(c=h,(s!==0||(y&3)!==0)&&(kh=!0)),h=g}wn!==0&&wn!==5||ou(s),qr!==0&&(qr=0)}function QS(s,l){for(var c=s.suspendedLanes,h=s.pingedLanes,g=s.expirationTimes,y=s.pendingLanes&-62914561;0<y;){var k=31-it(y),M=1<<k,I=g[k];I===-1?((M&c)===0||(M&h)!==0)&&(g[k]=Dn(M,l)):I<=l&&(s.expiredLanes|=M),y&=~M}if(l=It,c=mt,c=Et(s,s===l?c:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h=s.callbackNode,c===0||s===l&&(Ot===2||Ot===9)||s.cancelPendingCommit!==null)return h!==null&&h!==null&&Re(h),s.callbackNode=null,s.callbackPriority=0;if((c&3)===0||Kt(s,c)){if(l=c&-c,l===s.callbackPriority)return l;switch(h!==null&&Re(h),Tc(c)){case 2:case 8:c=nt;break;case 32:c=Qe;break;case 268435456:c=lt;break;default:c=Qe}return h=WS.bind(null,s),c=Te(c,h),s.callbackPriority=l,s.callbackNode=c,l}return h!==null&&h!==null&&Re(h),s.callbackPriority=2,s.callbackNode=null,2}function WS(s,l){if(wn!==0&&wn!==5)return s.callbackNode=null,s.callbackPriority=0,null;var c=s.callbackNode;if(Sh()&&s.callbackNode!==c)return null;var h=mt;return h=Et(s,s===It?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),h===0?null:(OS(s,h,l),QS(s,we()),s.callbackNode!=null&&s.callbackNode===c?WS.bind(null,s):null)}function XS(s,l){if(Sh())return null;OS(s,l,!0)}function bN(){ON(function(){(At&6)!==0?Te(We,yN):YS()})}function Tg(){if(qr===0){var s=la;s===0&&(s=Mt,Mt<<=1,(Mt&261888)===0&&(Mt=256)),qr=s}return qr}function $S(s){return s==null||typeof s=="symbol"||typeof s=="boolean"?null:typeof s=="function"?s:Nf(""+s)}function ZS(s,l){var c=l.ownerDocument.createElement("input");return c.name=l.name,c.value=l.value,s.id&&c.setAttribute("form",s.id),l.parentNode.insertBefore(c,l),s=new FormData(s),c.parentNode.removeChild(c),s}function vN(s,l,c,h,g){if(l==="submit"&&c&&c.stateNode===g){var y=$S((g[jn]||null).action),k=h.submitter;k&&(l=(l=k[jn]||null)?$S(l.formAction):k.getAttribute("formAction"),l!==null&&(y=l,k=null));var M=new Bf("action","action",null,h,g);s.push({event:M,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(qr!==0){var I=k?ZS(g,k):new FormData(g);Yp(c,{pending:!0,data:I,method:g.method,action:y},null,I)}}else typeof y=="function"&&(M.preventDefault(),I=k?ZS(g,k):new FormData(g),Yp(c,{pending:!0,data:I,method:g.method,action:y},y,I))},currentTarget:g}]})}}for(var Rg=0;Rg<up.length;Rg++){var Mg=up[Rg],xN=Mg.toLowerCase(),SN=Mg[0].toUpperCase()+Mg.slice(1);ts(xN,"on"+SN)}ts(Mx,"onAnimationEnd"),ts(Ox,"onAnimationIteration"),ts(Nx,"onAnimationStart"),ts("dblclick","onDoubleClick"),ts("focusin","onFocus"),ts("focusout","onBlur"),ts(PO,"onTransitionRun"),ts(IO,"onTransitionStart"),ts(HO,"onTransitionCancel"),ts(Dx,"onTransitionEnd"),Ko("onMouseEnter",["mouseout","mouseover"]),Ko("onMouseLeave",["mouseout","mouseover"]),Ko("onPointerEnter",["pointerout","pointerover"]),Ko("onPointerLeave",["pointerout","pointerover"]),zl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),zl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),zl("onBeforeInput",["compositionend","keypress","textInput","paste"]),zl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),zl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var au="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),wN=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(au));function JS(s,l){l=(l&4)!==0;for(var c=0;c<s.length;c++){var h=s[c],g=h.event;h=h.listeners;e:{var y=void 0;if(l)for(var k=h.length-1;0<=k;k--){var M=h[k],I=M.instance,ne=M.currentTarget;if(M=M.listener,I!==y&&g.isPropagationStopped())break e;y=M,g.currentTarget=ne;try{y(g)}catch(ce){If(ce)}g.currentTarget=null,y=I}else for(k=0;k<h.length;k++){if(M=h[k],I=M.instance,ne=M.currentTarget,M=M.listener,I!==y&&g.isPropagationStopped())break e;y=M,g.currentTarget=ne;try{y(g)}catch(ce){If(ce)}g.currentTarget=null,y=I}}}}function ut(s,l){var c=l[Vo];c===void 0&&(c=l[Vo]=new Set);var h=s+"__bubble";c.has(h)||(ew(l,s,2,!1),c.add(h))}function Og(s,l,c){var h=0;l&&(h|=4),ew(c,s,h,l)}var Ch="_reactListening"+Math.random().toString(36).slice(2);function Ng(s){if(!s[Ch]){s[Ch]=!0,Yv.forEach(function(c){c!=="selectionchange"&&(wN.has(c)||Og(c,!1,s),Og(c,!0,s))});var l=s.nodeType===9?s:s.ownerDocument;l===null||l[Ch]||(l[Ch]=!0,Og("selectionchange",!1,l))}}function ew(s,l,c,h){switch(Mw(l)){case 2:var g=XN;break;case 8:g=$N;break;default:g=Kg}c=g.bind(null,l,c,s),g=void 0,!$m||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(g=!0),h?g!==void 0?s.addEventListener(l,c,{capture:!0,passive:g}):s.addEventListener(l,c,!0):g!==void 0?s.addEventListener(l,c,{passive:g}):s.addEventListener(l,c,!1)}function Dg(s,l,c,h,g){var y=h;if((l&1)===0&&(l&2)===0&&h!==null)e:for(;;){if(h===null)return;var k=h.tag;if(k===3||k===4){var M=h.stateNode.containerInfo;if(M===g)break;if(k===4)for(k=h.return;k!==null;){var I=k.tag;if((I===3||I===4)&&k.stateNode.containerInfo===g)return;k=k.return}for(;M!==null;){if(k=qo(M),k===null)return;if(I=k.tag,I===5||I===6||I===26||I===27){h=y=k;continue e}M=M.parentNode}}h=h.return}rx(function(){var ne=y,ce=Wm(c),he=[];e:{var ie=jx.get(s);if(ie!==void 0){var re=Bf,ze=s;switch(s){case"keypress":if(jf(c)===0)break e;case"keydown":case"keyup":re=pO;break;case"focusin":ze="focus",re=tp;break;case"focusout":ze="blur",re=tp;break;case"beforeblur":case"afterblur":re=tp;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":re=ax;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":re=iO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":re=bO;break;case Mx:case Ox:case Nx:re=lO;break;case Dx:re=xO;break;case"scroll":case"scrollend":re=tO;break;case"wheel":re=wO;break;case"copy":case"cut":case"paste":re=aO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":re=ux;break;case"toggle":case"beforetoggle":re=CO}var Ke=(l&4)!==0,Bt=!Ke&&(s==="scroll"||s==="scrollend"),X=Ke?ie!==null?ie+"Capture":null:ie;Ke=[];for(var G=ne,te;G!==null;){var ue=G;if(te=ue.stateNode,ue=ue.tag,ue!==5&&ue!==26&&ue!==27||te===null||X===null||(ue=Oc(G,X),ue!=null&&Ke.push(cu(G,ue,te))),Bt)break;G=G.return}0<Ke.length&&(ie=new re(ie,ze,null,c,ce),he.push({event:ie,listeners:Ke}))}}if((l&7)===0){e:{if(ie=s==="mouseover"||s==="pointerover",re=s==="mouseout"||s==="pointerout",ie&&c!==Qm&&(ze=c.relatedTarget||c.fromElement)&&(qo(ze)||ze[Gs]))break e;if((re||ie)&&(ie=ce.window===ce?ce:(ie=ce.ownerDocument)?ie.defaultView||ie.parentWindow:window,re?(ze=c.relatedTarget||c.toElement,re=ne,ze=ze?qo(ze):null,ze!==null&&(Bt=o(ze),Ke=ze.tag,ze!==Bt||Ke!==5&&Ke!==27&&Ke!==6)&&(ze=null)):(re=null,ze=ne),re!==ze)){if(Ke=ax,ue="onMouseLeave",X="onMouseEnter",G="mouse",(s==="pointerout"||s==="pointerover")&&(Ke=ux,ue="onPointerLeave",X="onPointerEnter",G="pointer"),Bt=re==null?ie:Mc(re),te=ze==null?ie:Mc(ze),ie=new Ke(ue,G+"leave",re,c,ce),ie.target=Bt,ie.relatedTarget=te,ue=null,qo(ce)===ne&&(Ke=new Ke(X,G+"enter",ze,c,ce),Ke.target=te,Ke.relatedTarget=Bt,ue=Ke),Bt=ue,re&&ze)t:{for(Ke=kN,X=re,G=ze,te=0,ue=X;ue;ue=Ke(ue))te++;ue=0;for(var Fe=G;Fe;Fe=Ke(Fe))ue++;for(;0<te-ue;)X=Ke(X),te--;for(;0<ue-te;)G=Ke(G),ue--;for(;te--;){if(X===G||G!==null&&X===G.alternate){Ke=X;break t}X=Ke(X),G=Ke(G)}Ke=null}else Ke=null;re!==null&&tw(he,ie,re,Ke,!1),ze!==null&&Bt!==null&&tw(he,Bt,ze,Ke,!0)}}e:{if(ie=ne?Mc(ne):window,re=ie.nodeName&&ie.nodeName.toLowerCase(),re==="select"||re==="input"&&ie.type==="file")var kt=bx;else if(gx(ie))if(vx)kt=LO;else{kt=DO;var Ie=NO}else re=ie.nodeName,!re||re.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?ne&&Ym(ne.elementType)&&(kt=bx):kt=jO;if(kt&&(kt=kt(s,ne))){yx(he,kt,c,ce);break e}Ie&&Ie(s,ie,ne),s==="focusout"&&ne&&ie.type==="number"&&ne.memoizedProps.value!=null&&Km(ie,"number",ie.value)}switch(Ie=ne?Mc(ne):window,s){case"focusin":(gx(Ie)||Ie.contentEditable==="true")&&(Zo=Ie,op=ne,Ic=null);break;case"focusout":Ic=op=Zo=null;break;case"mousedown":ap=!0;break;case"contextmenu":case"mouseup":case"dragend":ap=!1,Tx(he,c,ce);break;case"selectionchange":if(zO)break;case"keydown":case"keyup":Tx(he,c,ce)}var et;if(ip)e:{switch(s){case"compositionstart":var pt="onCompositionStart";break e;case"compositionend":pt="onCompositionEnd";break e;case"compositionupdate":pt="onCompositionUpdate";break e}pt=void 0}else $o?mx(s,c)&&(pt="onCompositionEnd"):s==="keydown"&&c.keyCode===229&&(pt="onCompositionStart");pt&&(fx&&c.locale!=="ko"&&($o||pt!=="onCompositionStart"?pt==="onCompositionEnd"&&$o&&(et=lx()):(Tr=ce,Zm="value"in Tr?Tr.value:Tr.textContent,$o=!0)),Ie=Eh(ne,pt),0<Ie.length&&(pt=new cx(pt,s,null,c,ce),he.push({event:pt,listeners:Ie}),et?pt.data=et:(et=px(c),et!==null&&(pt.data=et)))),(et=AO?TO(s,c):RO(s,c))&&(pt=Eh(ne,"onBeforeInput"),0<pt.length&&(Ie=new cx("onBeforeInput","beforeinput",null,c,ce),he.push({event:Ie,listeners:pt}),Ie.data=et)),vN(he,s,ne,c,ce)}JS(he,l)})}function cu(s,l,c){return{instance:s,listener:l,currentTarget:c}}function Eh(s,l){for(var c=l+"Capture",h=[];s!==null;){var g=s,y=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||y===null||(g=Oc(s,c),g!=null&&h.unshift(cu(s,g,y)),g=Oc(s,l),g!=null&&h.push(cu(s,g,y))),s.tag===3)return h;s=s.return}return[]}function kN(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5&&s.tag!==27);return s||null}function tw(s,l,c,h,g){for(var y=l._reactName,k=[];c!==null&&c!==h;){var M=c,I=M.alternate,ne=M.stateNode;if(M=M.tag,I!==null&&I===h)break;M!==5&&M!==26&&M!==27||ne===null||(I=ne,g?(ne=Oc(c,y),ne!=null&&k.unshift(cu(c,ne,I))):g||(ne=Oc(c,y),ne!=null&&k.push(cu(c,ne,I)))),c=c.return}k.length!==0&&s.push({event:l,listeners:k})}var CN=/\r\n?/g,EN=/\u0000|\uFFFD/g;function nw(s){return(typeof s=="string"?s:""+s).replace(CN,`
|
|
49
|
+
`).replace(EN,"")}function iw(s,l){return l=nw(l),nw(s)===l}function Lt(s,l,c,h,g,y){switch(c){case"children":typeof h=="string"?l==="body"||l==="textarea"&&h===""||Qo(s,h):(typeof h=="number"||typeof h=="bigint")&&l!=="body"&&Qo(s,""+h);break;case"className":Mf(s,"class",h);break;case"tabIndex":Mf(s,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Mf(s,c,h);break;case"style":ix(s,h,y);break;case"data":if(l!=="object"){Mf(s,"data",h);break}case"src":case"href":if(h===""&&(l!=="a"||c!=="href")){s.removeAttribute(c);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(c);break}h=Nf(""+h),s.setAttribute(c,h);break;case"action":case"formAction":if(typeof h=="function"){s.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(c==="formAction"?(l!=="input"&&Lt(s,l,"name",g.name,g,null),Lt(s,l,"formEncType",g.formEncType,g,null),Lt(s,l,"formMethod",g.formMethod,g,null),Lt(s,l,"formTarget",g.formTarget,g,null)):(Lt(s,l,"encType",g.encType,g,null),Lt(s,l,"method",g.method,g,null),Lt(s,l,"target",g.target,g,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){s.removeAttribute(c);break}h=Nf(""+h),s.setAttribute(c,h);break;case"onClick":h!=null&&(s.onclick=Ys);break;case"onScroll":h!=null&&ut("scroll",s);break;case"onScrollEnd":h!=null&&ut("scrollend",s);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(g.children!=null)throw Error(i(60));s.innerHTML=c}}break;case"multiple":s.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":s.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){s.removeAttribute("xlink:href");break}c=Nf(""+h),s.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,""+h):s.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,""):s.removeAttribute(c);break;case"capture":case"download":h===!0?s.setAttribute(c,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?s.setAttribute(c,h):s.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?s.setAttribute(c,h):s.removeAttribute(c);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?s.removeAttribute(c):s.setAttribute(c,h);break;case"popover":ut("beforetoggle",s),ut("toggle",s),Rf(s,"popover",h);break;case"xlinkActuate":Ks(s,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":Ks(s,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":Ks(s,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":Ks(s,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":Ks(s,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":Ks(s,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":Ks(s,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":Ks(s,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":Ks(s,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":Rf(s,"is",h);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=JM.get(c)||c,Rf(s,c,h))}}function jg(s,l,c,h,g,y){switch(c){case"style":ix(s,h,y);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(i(61));if(c=h.__html,c!=null){if(g.children!=null)throw Error(i(60));s.innerHTML=c}}break;case"children":typeof h=="string"?Qo(s,h):(typeof h=="number"||typeof h=="bigint")&&Qo(s,""+h);break;case"onScroll":h!=null&&ut("scroll",s);break;case"onScrollEnd":h!=null&&ut("scrollend",s);break;case"onClick":h!=null&&(s.onclick=Ys);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Qv.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(g=c.endsWith("Capture"),l=c.slice(2,g?c.length-7:void 0),y=s[jn]||null,y=y!=null?y[c]:null,typeof y=="function"&&s.removeEventListener(l,y,g),typeof h=="function")){typeof y!="function"&&y!==null&&(c in s?s[c]=null:s.hasAttribute(c)&&s.removeAttribute(c)),s.addEventListener(l,h,g);break e}c in s?s[c]=h:h===!0?s.setAttribute(c,""):Rf(s,c,h)}}}function Pn(s,l,c){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ut("error",s),ut("load",s);var h=!1,g=!1,y;for(y in c)if(c.hasOwnProperty(y)){var k=c[y];if(k!=null)switch(y){case"src":h=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Lt(s,l,y,k,c,null)}}g&&Lt(s,l,"srcSet",c.srcSet,c,null),h&&Lt(s,l,"src",c.src,c,null);return;case"input":ut("invalid",s);var M=y=k=g=null,I=null,ne=null;for(h in c)if(c.hasOwnProperty(h)){var ce=c[h];if(ce!=null)switch(h){case"name":g=ce;break;case"type":k=ce;break;case"checked":I=ce;break;case"defaultChecked":ne=ce;break;case"value":y=ce;break;case"defaultValue":M=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(i(137,l));break;default:Lt(s,l,h,ce,c,null)}}Jv(s,y,M,I,ne,k,g,!1);return;case"select":ut("invalid",s),h=k=y=null;for(g in c)if(c.hasOwnProperty(g)&&(M=c[g],M!=null))switch(g){case"value":y=M;break;case"defaultValue":k=M;break;case"multiple":h=M;default:Lt(s,l,g,M,c,null)}l=y,c=k,s.multiple=!!h,l!=null?Yo(s,!!h,l,!1):c!=null&&Yo(s,!!h,c,!0);return;case"textarea":ut("invalid",s),y=g=h=null;for(k in c)if(c.hasOwnProperty(k)&&(M=c[k],M!=null))switch(k){case"value":h=M;break;case"defaultValue":g=M;break;case"children":y=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(i(91));break;default:Lt(s,l,k,M,c,null)}tx(s,h,g,y);return;case"option":for(I in c)if(c.hasOwnProperty(I)&&(h=c[I],h!=null))switch(I){case"selected":s.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:Lt(s,l,I,h,c,null)}return;case"dialog":ut("beforetoggle",s),ut("toggle",s),ut("cancel",s),ut("close",s);break;case"iframe":case"object":ut("load",s);break;case"video":case"audio":for(h=0;h<au.length;h++)ut(au[h],s);break;case"image":ut("error",s),ut("load",s);break;case"details":ut("toggle",s);break;case"embed":case"source":case"link":ut("error",s),ut("load",s);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ne in c)if(c.hasOwnProperty(ne)&&(h=c[ne],h!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,l));default:Lt(s,l,ne,h,c,null)}return;default:if(Ym(l)){for(ce in c)c.hasOwnProperty(ce)&&(h=c[ce],h!==void 0&&jg(s,l,ce,h,c,void 0));return}}for(M in c)c.hasOwnProperty(M)&&(h=c[M],h!=null&&Lt(s,l,M,h,c,null))}function AN(s,l,c,h){switch(l){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,y=null,k=null,M=null,I=null,ne=null,ce=null;for(re in c){var he=c[re];if(c.hasOwnProperty(re)&&he!=null)switch(re){case"checked":break;case"value":break;case"defaultValue":I=he;default:h.hasOwnProperty(re)||Lt(s,l,re,null,h,he)}}for(var ie in h){var re=h[ie];if(he=c[ie],h.hasOwnProperty(ie)&&(re!=null||he!=null))switch(ie){case"type":y=re;break;case"name":g=re;break;case"checked":ne=re;break;case"defaultChecked":ce=re;break;case"value":k=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(i(137,l));break;default:re!==he&&Lt(s,l,ie,re,h,he)}}Gm(s,k,M,I,ne,ce,y,g);return;case"select":re=k=M=ie=null;for(y in c)if(I=c[y],c.hasOwnProperty(y)&&I!=null)switch(y){case"value":break;case"multiple":re=I;default:h.hasOwnProperty(y)||Lt(s,l,y,null,h,I)}for(g in h)if(y=h[g],I=c[g],h.hasOwnProperty(g)&&(y!=null||I!=null))switch(g){case"value":ie=y;break;case"defaultValue":M=y;break;case"multiple":k=y;default:y!==I&&Lt(s,l,g,y,h,I)}l=M,c=k,h=re,ie!=null?Yo(s,!!c,ie,!1):!!h!=!!c&&(l!=null?Yo(s,!!c,l,!0):Yo(s,!!c,c?[]:"",!1));return;case"textarea":re=ie=null;for(M in c)if(g=c[M],c.hasOwnProperty(M)&&g!=null&&!h.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Lt(s,l,M,null,h,g)}for(k in h)if(g=h[k],y=c[k],h.hasOwnProperty(k)&&(g!=null||y!=null))switch(k){case"value":ie=g;break;case"defaultValue":re=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(i(91));break;default:g!==y&&Lt(s,l,k,g,h,y)}ex(s,ie,re);return;case"option":for(var ze in c)if(ie=c[ze],c.hasOwnProperty(ze)&&ie!=null&&!h.hasOwnProperty(ze))switch(ze){case"selected":s.selected=!1;break;default:Lt(s,l,ze,null,h,ie)}for(I in h)if(ie=h[I],re=c[I],h.hasOwnProperty(I)&&ie!==re&&(ie!=null||re!=null))switch(I){case"selected":s.selected=ie&&typeof ie!="function"&&typeof ie!="symbol";break;default:Lt(s,l,I,ie,h,re)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ke in c)ie=c[Ke],c.hasOwnProperty(Ke)&&ie!=null&&!h.hasOwnProperty(Ke)&&Lt(s,l,Ke,null,h,ie);for(ne in h)if(ie=h[ne],re=c[ne],h.hasOwnProperty(ne)&&ie!==re&&(ie!=null||re!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(i(137,l));break;default:Lt(s,l,ne,ie,h,re)}return;default:if(Ym(l)){for(var Bt in c)ie=c[Bt],c.hasOwnProperty(Bt)&&ie!==void 0&&!h.hasOwnProperty(Bt)&&jg(s,l,Bt,void 0,h,ie);for(ce in h)ie=h[ce],re=c[ce],!h.hasOwnProperty(ce)||ie===re||ie===void 0&&re===void 0||jg(s,l,ce,ie,h,re);return}}for(var X in c)ie=c[X],c.hasOwnProperty(X)&&ie!=null&&!h.hasOwnProperty(X)&&Lt(s,l,X,null,h,ie);for(he in h)ie=h[he],re=c[he],!h.hasOwnProperty(he)||ie===re||ie==null&&re==null||Lt(s,l,he,ie,h,re)}function sw(s){switch(s){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function TN(){if(typeof performance.getEntriesByType=="function"){for(var s=0,l=0,c=performance.getEntriesByType("resource"),h=0;h<c.length;h++){var g=c[h],y=g.transferSize,k=g.initiatorType,M=g.duration;if(y&&M&&sw(k)){for(k=0,M=g.responseEnd,h+=1;h<c.length;h++){var I=c[h],ne=I.startTime;if(ne>M)break;var ce=I.transferSize,he=I.initiatorType;ce&&sw(he)&&(I=I.responseEnd,k+=ce*(I<M?1:(M-ne)/(I-ne)))}if(--h,l+=8*(y+k)/(g.duration/1e3),s++,10<s)break}}if(0<s)return l/s/1e6}return navigator.connection&&(s=navigator.connection.downlink,typeof s=="number")?s:5}var Lg=null,Bg=null;function Ah(s){return s.nodeType===9?s:s.ownerDocument}function rw(s){switch(s){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lw(s,l){if(s===0)switch(l){case"svg":return 1;case"math":return 2;default:return 0}return s===1&&l==="foreignObject"?0:s}function zg(s,l){return s==="textarea"||s==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.children=="bigint"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Pg=null;function RN(){var s=window.event;return s&&s.type==="popstate"?s===Pg?!1:(Pg=s,!0):(Pg=null,!1)}var ow=typeof setTimeout=="function"?setTimeout:void 0,MN=typeof clearTimeout=="function"?clearTimeout:void 0,aw=typeof Promise=="function"?Promise:void 0,ON=typeof queueMicrotask=="function"?queueMicrotask:typeof aw<"u"?function(s){return aw.resolve(null).then(s).catch(NN)}:ow;function NN(s){setTimeout(function(){throw s})}function Fr(s){return s==="head"}function cw(s,l){var c=l,h=0;do{var g=c.nextSibling;if(s.removeChild(c),g&&g.nodeType===8)if(c=g.data,c==="/$"||c==="/&"){if(h===0){s.removeChild(g),Ea(l);return}h--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")h++;else if(c==="html")uu(s.ownerDocument.documentElement);else if(c==="head"){c=s.ownerDocument.head,uu(c);for(var y=c.firstChild;y;){var k=y.nextSibling,M=y.nodeName;y[Rc]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&y.rel.toLowerCase()==="stylesheet"||c.removeChild(y),y=k}}else c==="body"&&uu(s.ownerDocument.body);c=g}while(c);Ea(l)}function uw(s,l){var c=s;s=0;do{var h=c.nextSibling;if(c.nodeType===1?l?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(l?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),h&&h.nodeType===8)if(c=h.data,c==="/$"){if(s===0)break;s--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||s++;c=h}while(c)}function Ig(s){var l=s.firstChild;for(l&&l.nodeType===10&&(l=l.nextSibling);l;){var c=l;switch(l=l.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ig(c),qm(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}s.removeChild(c)}}function DN(s,l,c,h){for(;s.nodeType===1;){var g=c;if(s.nodeName.toLowerCase()!==l.toLowerCase()){if(!h&&(s.nodeName!=="INPUT"||s.type!=="hidden"))break}else if(h){if(!s[Rc])switch(l){case"meta":if(!s.hasAttribute("itemprop"))break;return s;case"link":if(y=s.getAttribute("rel"),y==="stylesheet"&&s.hasAttribute("data-precedence"))break;if(y!==g.rel||s.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||s.getAttribute("title")!==(g.title==null?null:g.title))break;return s;case"style":if(s.hasAttribute("data-precedence"))break;return s;case"script":if(y=s.getAttribute("src"),(y!==(g.src==null?null:g.src)||s.getAttribute("type")!==(g.type==null?null:g.type)||s.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&y&&s.hasAttribute("async")&&!s.hasAttribute("itemprop"))break;return s;default:return s}}else if(l==="input"&&s.type==="hidden"){var y=g.name==null?null:""+g.name;if(g.type==="hidden"&&s.getAttribute("name")===y)return s}else return s;if(s=Fi(s.nextSibling),s===null)break}return null}function jN(s,l,c){if(l==="")return null;for(;s.nodeType!==3;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!c||(s=Fi(s.nextSibling),s===null))return null;return s}function fw(s,l){for(;s.nodeType!==8;)if((s.nodeType!==1||s.nodeName!=="INPUT"||s.type!=="hidden")&&!l||(s=Fi(s.nextSibling),s===null))return null;return s}function Hg(s){return s.data==="$?"||s.data==="$~"}function _g(s){return s.data==="$!"||s.data==="$?"&&s.ownerDocument.readyState!=="loading"}function LN(s,l){var c=s.ownerDocument;if(s.data==="$~")s._reactRetry=l;else if(s.data!=="$?"||c.readyState!=="loading")l();else{var h=function(){l(),c.removeEventListener("DOMContentLoaded",h)};c.addEventListener("DOMContentLoaded",h),s._reactRetry=h}}function Fi(s){for(;s!=null;s=s.nextSibling){var l=s.nodeType;if(l===1||l===3)break;if(l===8){if(l=s.data,l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"||l==="F!"||l==="F")break;if(l==="/$"||l==="/&")return null}}return s}var Ug=null;function hw(s){s=s.nextSibling;for(var l=0;s;){if(s.nodeType===8){var c=s.data;if(c==="/$"||c==="/&"){if(l===0)return Fi(s.nextSibling);l--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||l++}s=s.nextSibling}return null}function dw(s){s=s.previousSibling;for(var l=0;s;){if(s.nodeType===8){var c=s.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(l===0)return s;l--}else c!=="/$"&&c!=="/&"||l++}s=s.previousSibling}return null}function mw(s,l,c){switch(l=Ah(c),s){case"html":if(s=l.documentElement,!s)throw Error(i(452));return s;case"head":if(s=l.head,!s)throw Error(i(453));return s;case"body":if(s=l.body,!s)throw Error(i(454));return s;default:throw Error(i(451))}}function uu(s){for(var l=s.attributes;l.length;)s.removeAttributeNode(l[0]);qm(s)}var Gi=new Map,pw=new Set;function Th(s){return typeof s.getRootNode=="function"?s.getRootNode():s.nodeType===9?s:s.ownerDocument}var cr=W.d;W.d={f:BN,r:zN,D:PN,C:IN,L:HN,m:_N,X:VN,S:UN,M:qN};function BN(){var s=cr.f(),l=bh();return s||l}function zN(s){var l=Fo(s);l!==null&&l.tag===5&&l.type==="form"?D1(l):cr.r(s)}var wa=typeof document>"u"?null:document;function gw(s,l,c){var h=wa;if(h&&typeof l=="string"&&l){var g=Pi(l);g='link[rel="'+s+'"][href="'+g+'"]',typeof c=="string"&&(g+='[crossorigin="'+c+'"]'),pw.has(g)||(pw.add(g),s={rel:s,crossOrigin:c,href:l},h.querySelector(g)===null&&(l=h.createElement("link"),Pn(l,"link",s),Rn(l),h.head.appendChild(l)))}}function PN(s){cr.D(s),gw("dns-prefetch",s,null)}function IN(s,l){cr.C(s,l),gw("preconnect",s,l)}function HN(s,l,c){cr.L(s,l,c);var h=wa;if(h&&s&&l){var g='link[rel="preload"][as="'+Pi(l)+'"]';l==="image"&&c&&c.imageSrcSet?(g+='[imagesrcset="'+Pi(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(g+='[imagesizes="'+Pi(c.imageSizes)+'"]')):g+='[href="'+Pi(s)+'"]';var y=g;switch(l){case"style":y=ka(s);break;case"script":y=Ca(s)}Gi.has(y)||(s=p({rel:"preload",href:l==="image"&&c&&c.imageSrcSet?void 0:s,as:l},c),Gi.set(y,s),h.querySelector(g)!==null||l==="style"&&h.querySelector(fu(y))||l==="script"&&h.querySelector(hu(y))||(l=h.createElement("link"),Pn(l,"link",s),Rn(l),h.head.appendChild(l)))}}function _N(s,l){cr.m(s,l);var c=wa;if(c&&s){var h=l&&typeof l.as=="string"?l.as:"script",g='link[rel="modulepreload"][as="'+Pi(h)+'"][href="'+Pi(s)+'"]',y=g;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=Ca(s)}if(!Gi.has(y)&&(s=p({rel:"modulepreload",href:s},l),Gi.set(y,s),c.querySelector(g)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(hu(y)))return}h=c.createElement("link"),Pn(h,"link",s),Rn(h),c.head.appendChild(h)}}}function UN(s,l,c){cr.S(s,l,c);var h=wa;if(h&&s){var g=Go(h).hoistableStyles,y=ka(s);l=l||"default";var k=g.get(y);if(!k){var M={loading:0,preload:null};if(k=h.querySelector(fu(y)))M.loading=5;else{s=p({rel:"stylesheet",href:s,"data-precedence":l},c),(c=Gi.get(y))&&Vg(s,c);var I=k=h.createElement("link");Rn(I),Pn(I,"link",s),I._p=new Promise(function(ne,ce){I.onload=ne,I.onerror=ce}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Rh(k,l,h)}k={type:"stylesheet",instance:k,count:1,state:M},g.set(y,k)}}}function VN(s,l){cr.X(s,l);var c=wa;if(c&&s){var h=Go(c).hoistableScripts,g=Ca(s),y=h.get(g);y||(y=c.querySelector(hu(g)),y||(s=p({src:s,async:!0},l),(l=Gi.get(g))&&qg(s,l),y=c.createElement("script"),Rn(y),Pn(y,"link",s),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},h.set(g,y))}}function qN(s,l){cr.M(s,l);var c=wa;if(c&&s){var h=Go(c).hoistableScripts,g=Ca(s),y=h.get(g);y||(y=c.querySelector(hu(g)),y||(s=p({src:s,async:!0,type:"module"},l),(l=Gi.get(g))&&qg(s,l),y=c.createElement("script"),Rn(y),Pn(y,"link",s),c.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},h.set(g,y))}}function yw(s,l,c,h){var g=(g=ee.current)?Th(g):null;if(!g)throw Error(i(446));switch(s){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(l=ka(c.href),c=Go(g).hoistableStyles,h=c.get(l),h||(h={type:"style",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){s=ka(c.href);var y=Go(g).hoistableStyles,k=y.get(s);if(k||(g=g.ownerDocument||g,k={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(s,k),(y=g.querySelector(fu(s)))&&!y._p&&(k.instance=y,k.state.loading=5),Gi.has(s)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},Gi.set(s,c),y||FN(g,s,c,k.state))),l&&h===null)throw Error(i(528,""));return k}if(l&&h!==null)throw Error(i(529,""));return null;case"script":return l=c.async,c=c.src,typeof c=="string"&&l&&typeof l!="function"&&typeof l!="symbol"?(l=Ca(c),c=Go(g).hoistableScripts,h=c.get(l),h||(h={type:"script",instance:null,count:0,state:null},c.set(l,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,s))}}function ka(s){return'href="'+Pi(s)+'"'}function fu(s){return'link[rel="stylesheet"]['+s+"]"}function bw(s){return p({},s,{"data-precedence":s.precedence,precedence:null})}function FN(s,l,c,h){s.querySelector('link[rel="preload"][as="style"]['+l+"]")?h.loading=1:(l=s.createElement("link"),h.preload=l,l.addEventListener("load",function(){return h.loading|=1}),l.addEventListener("error",function(){return h.loading|=2}),Pn(l,"link",c),Rn(l),s.head.appendChild(l))}function Ca(s){return'[src="'+Pi(s)+'"]'}function hu(s){return"script[async]"+s}function vw(s,l,c){if(l.count++,l.instance===null)switch(l.type){case"style":var h=s.querySelector('style[data-href~="'+Pi(c.href)+'"]');if(h)return l.instance=h,Rn(h),h;var g=p({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return h=(s.ownerDocument||s).createElement("style"),Rn(h),Pn(h,"style",g),Rh(h,c.precedence,s),l.instance=h;case"stylesheet":g=ka(c.href);var y=s.querySelector(fu(g));if(y)return l.state.loading|=4,l.instance=y,Rn(y),y;h=bw(c),(g=Gi.get(g))&&Vg(h,g),y=(s.ownerDocument||s).createElement("link"),Rn(y);var k=y;return k._p=new Promise(function(M,I){k.onload=M,k.onerror=I}),Pn(y,"link",h),l.state.loading|=4,Rh(y,c.precedence,s),l.instance=y;case"script":return y=Ca(c.src),(g=s.querySelector(hu(y)))?(l.instance=g,Rn(g),g):(h=c,(g=Gi.get(y))&&(h=p({},c),qg(h,g)),s=s.ownerDocument||s,g=s.createElement("script"),Rn(g),Pn(g,"link",h),s.head.appendChild(g),l.instance=g);case"void":return null;default:throw Error(i(443,l.type))}else l.type==="stylesheet"&&(l.state.loading&4)===0&&(h=l.instance,l.state.loading|=4,Rh(h,c.precedence,s));return l.instance}function Rh(s,l,c){for(var h=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=h.length?h[h.length-1]:null,y=g,k=0;k<h.length;k++){var M=h[k];if(M.dataset.precedence===l)y=M;else if(y!==g)break}y?y.parentNode.insertBefore(s,y.nextSibling):(l=c.nodeType===9?c.head:c,l.insertBefore(s,l.firstChild))}function Vg(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.title==null&&(s.title=l.title)}function qg(s,l){s.crossOrigin==null&&(s.crossOrigin=l.crossOrigin),s.referrerPolicy==null&&(s.referrerPolicy=l.referrerPolicy),s.integrity==null&&(s.integrity=l.integrity)}var Mh=null;function xw(s,l,c){if(Mh===null){var h=new Map,g=Mh=new Map;g.set(c,h)}else g=Mh,h=g.get(c),h||(h=new Map,g.set(c,h));if(h.has(s))return h;for(h.set(s,null),c=c.getElementsByTagName(s),g=0;g<c.length;g++){var y=c[g];if(!(y[Rc]||y[Sn]||s==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var k=y.getAttribute(l)||"";k=s+k;var M=h.get(k);M?M.push(y):h.set(k,[y])}}return h}function Sw(s,l,c){s=s.ownerDocument||s,s.head.insertBefore(c,l==="title"?s.querySelector("head > title"):null)}function GN(s,l,c){if(c===1||l.itemProp!=null)return!1;switch(s){case"meta":case"title":return!0;case"style":if(typeof l.precedence!="string"||typeof l.href!="string"||l.href==="")break;return!0;case"link":if(typeof l.rel!="string"||typeof l.href!="string"||l.href===""||l.onLoad||l.onError)break;switch(l.rel){case"stylesheet":return s=l.disabled,typeof l.precedence=="string"&&s==null;default:return!0}case"script":if(l.async&&typeof l.async!="function"&&typeof l.async!="symbol"&&!l.onLoad&&!l.onError&&l.src&&typeof l.src=="string")return!0}return!1}function ww(s){return!(s.type==="stylesheet"&&(s.state.loading&3)===0)}function KN(s,l,c,h){if(c.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var g=ka(h.href),y=l.querySelector(fu(g));if(y){l=y._p,l!==null&&typeof l=="object"&&typeof l.then=="function"&&(s.count++,s=Oh.bind(s),l.then(s,s)),c.state.loading|=4,c.instance=y,Rn(y);return}y=l.ownerDocument||l,h=bw(h),(g=Gi.get(g))&&Vg(h,g),y=y.createElement("link"),Rn(y);var k=y;k._p=new Promise(function(M,I){k.onload=M,k.onerror=I}),Pn(y,"link",h),c.instance=y}s.stylesheets===null&&(s.stylesheets=new Map),s.stylesheets.set(c,l),(l=c.state.preload)&&(c.state.loading&3)===0&&(s.count++,c=Oh.bind(s),l.addEventListener("load",c),l.addEventListener("error",c))}}var Fg=0;function YN(s,l){return s.stylesheets&&s.count===0&&Dh(s,s.stylesheets),0<s.count||0<s.imgCount?function(c){var h=setTimeout(function(){if(s.stylesheets&&Dh(s,s.stylesheets),s.unsuspend){var y=s.unsuspend;s.unsuspend=null,y()}},6e4+l);0<s.imgBytes&&Fg===0&&(Fg=62500*TN());var g=setTimeout(function(){if(s.waitingForImages=!1,s.count===0&&(s.stylesheets&&Dh(s,s.stylesheets),s.unsuspend)){var y=s.unsuspend;s.unsuspend=null,y()}},(s.imgBytes>Fg?50:800)+l);return s.unsuspend=c,function(){s.unsuspend=null,clearTimeout(h),clearTimeout(g)}}:null}function Oh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Dh(this,this.stylesheets);else if(this.unsuspend){var s=this.unsuspend;this.unsuspend=null,s()}}}var Nh=null;function Dh(s,l){s.stylesheets=null,s.unsuspend!==null&&(s.count++,Nh=new Map,l.forEach(QN,s),Nh=null,Oh.call(s))}function QN(s,l){if(!(l.state.loading&4)){var c=Nh.get(s);if(c)var h=c.get(null);else{c=new Map,Nh.set(s,c);for(var g=s.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<g.length;y++){var k=g[y];(k.nodeName==="LINK"||k.getAttribute("media")!=="not all")&&(c.set(k.dataset.precedence,k),h=k)}h&&c.set(null,h)}g=l.instance,k=g.getAttribute("data-precedence"),y=c.get(k)||h,y===h&&c.set(null,g),c.set(k,g),this.count++,h=Oh.bind(this),g.addEventListener("load",h),g.addEventListener("error",h),y?y.parentNode.insertBefore(g,y.nextSibling):(s=s.nodeType===9?s.head:s,s.insertBefore(g,s.firstChild)),l.state.loading|=4}}var du={$$typeof:R,Provider:null,Consumer:null,_currentValue:U,_currentValue2:U,_threadCount:0};function WN(s,l,c,h,g,y,k,M,I){this.tag=1,this.containerInfo=s,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Er(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Er(0),this.hiddenUpdates=Er(null),this.identifierPrefix=h,this.onUncaughtError=g,this.onCaughtError=y,this.onRecoverableError=k,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function kw(s,l,c,h,g,y,k,M,I,ne,ce,he){return s=new WN(s,l,c,k,I,ne,ce,he,M),l=1,y===!0&&(l|=24),y=vi(3,null,null,l),s.current=y,y.stateNode=s,l=kp(),l.refCount++,s.pooledCache=l,l.refCount++,y.memoizedState={element:h,isDehydrated:c,cache:l},Tp(y),s}function Cw(s){return s?(s=ta,s):ta}function Ew(s,l,c,h,g,y){g=Cw(g),h.context===null?h.context=g:h.pendingContext=g,h=jr(l),h.payload={element:c},y=y===void 0?null:y,y!==null&&(h.callback=y),c=Lr(s,h,l),c!==null&&(ci(c,s,l),Gc(c,s,l))}function Aw(s,l){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<l?c:l}}function Gg(s,l){Aw(s,l),(s=s.alternate)&&Aw(s,l)}function Tw(s){if(s.tag===13||s.tag===31){var l=_l(s,67108864);l!==null&&ci(l,s,67108864),Gg(s,67108864)}}function Rw(s){if(s.tag===13||s.tag===31){var l=Ci();l=Ac(l);var c=_l(s,l);c!==null&&ci(c,s,l),Gg(s,l)}}var jh=!0;function XN(s,l,c,h){var g=P.T;P.T=null;var y=W.p;try{W.p=2,Kg(s,l,c,h)}finally{W.p=y,P.T=g}}function $N(s,l,c,h){var g=P.T;P.T=null;var y=W.p;try{W.p=8,Kg(s,l,c,h)}finally{W.p=y,P.T=g}}function Kg(s,l,c,h){if(jh){var g=Yg(h);if(g===null)Dg(s,l,h,Lh,c),Ow(s,h);else if(JN(g,s,l,c,h))h.stopPropagation();else if(Ow(s,h),l&4&&-1<ZN.indexOf(s)){for(;g!==null;){var y=Fo(g);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var k=dt(y.pendingLanes);if(k!==0){var M=y;for(M.pendingLanes|=2,M.entangledLanes|=2;k;){var I=1<<31-it(k);M.entanglements[1]|=I,k&=~I}vs(y),(At&6)===0&&(gh=we()+500,ou(0))}}break;case 31:case 13:M=_l(y,2),M!==null&&ci(M,y,2),bh(),Gg(y,2)}if(y=Yg(h),y===null&&Dg(s,l,h,Lh,c),y===g)break;g=y}g!==null&&h.stopPropagation()}else Dg(s,l,h,null,c)}}function Yg(s){return s=Wm(s),Qg(s)}var Lh=null;function Qg(s){if(Lh=null,s=qo(s),s!==null){var l=o(s);if(l===null)s=null;else{var c=l.tag;if(c===13){if(s=a(l),s!==null)return s;s=null}else if(c===31){if(s=u(l),s!==null)return s;s=null}else if(c===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;s=null}else l!==s&&(s=null)}}return Lh=s,null}function Mw(s){switch(s){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ve()){case We:return 2;case nt:return 8;case Qe:case ht:return 32;case lt:return 268435456;default:return 32}default:return 32}}var Wg=!1,Gr=null,Kr=null,Yr=null,mu=new Map,pu=new Map,Qr=[],ZN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Ow(s,l){switch(s){case"focusin":case"focusout":Gr=null;break;case"dragenter":case"dragleave":Kr=null;break;case"mouseover":case"mouseout":Yr=null;break;case"pointerover":case"pointerout":mu.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":pu.delete(l.pointerId)}}function gu(s,l,c,h,g,y){return s===null||s.nativeEvent!==y?(s={blockedOn:l,domEventName:c,eventSystemFlags:h,nativeEvent:y,targetContainers:[g]},l!==null&&(l=Fo(l),l!==null&&Tw(l)),s):(s.eventSystemFlags|=h,l=s.targetContainers,g!==null&&l.indexOf(g)===-1&&l.push(g),s)}function JN(s,l,c,h,g){switch(l){case"focusin":return Gr=gu(Gr,s,l,c,h,g),!0;case"dragenter":return Kr=gu(Kr,s,l,c,h,g),!0;case"mouseover":return Yr=gu(Yr,s,l,c,h,g),!0;case"pointerover":var y=g.pointerId;return mu.set(y,gu(mu.get(y)||null,s,l,c,h,g)),!0;case"gotpointercapture":return y=g.pointerId,pu.set(y,gu(pu.get(y)||null,s,l,c,h,g)),!0}return!1}function Nw(s){var l=qo(s.target);if(l!==null){var c=o(l);if(c!==null){if(l=c.tag,l===13){if(l=a(c),l!==null){s.blockedOn=l,Tf(s.priority,function(){Rw(c)});return}}else if(l===31){if(l=u(c),l!==null){s.blockedOn=l,Tf(s.priority,function(){Rw(c)});return}}else if(l===3&&c.stateNode.current.memoizedState.isDehydrated){s.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}s.blockedOn=null}function Bh(s){if(s.blockedOn!==null)return!1;for(var l=s.targetContainers;0<l.length;){var c=Yg(s.nativeEvent);if(c===null){c=s.nativeEvent;var h=new c.constructor(c.type,c);Qm=h,c.target.dispatchEvent(h),Qm=null}else return l=Fo(c),l!==null&&Tw(l),s.blockedOn=c,!1;l.shift()}return!0}function Dw(s,l,c){Bh(s)&&c.delete(l)}function eD(){Wg=!1,Gr!==null&&Bh(Gr)&&(Gr=null),Kr!==null&&Bh(Kr)&&(Kr=null),Yr!==null&&Bh(Yr)&&(Yr=null),mu.forEach(Dw),pu.forEach(Dw)}function zh(s,l){s.blockedOn===l&&(s.blockedOn=null,Wg||(Wg=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,eD)))}var Ph=null;function jw(s){Ph!==s&&(Ph=s,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ph===s&&(Ph=null);for(var l=0;l<s.length;l+=3){var c=s[l],h=s[l+1],g=s[l+2];if(typeof h!="function"){if(Qg(h||c)===null)continue;break}var y=Fo(c);y!==null&&(s.splice(l,3),l-=3,Yp(y,{pending:!0,data:g,method:c.method,action:h},h,g))}}))}function Ea(s){function l(I){return zh(I,s)}Gr!==null&&zh(Gr,s),Kr!==null&&zh(Kr,s),Yr!==null&&zh(Yr,s),mu.forEach(l),pu.forEach(l);for(var c=0;c<Qr.length;c++){var h=Qr[c];h.blockedOn===s&&(h.blockedOn=null)}for(;0<Qr.length&&(c=Qr[0],c.blockedOn===null);)Nw(c),c.blockedOn===null&&Qr.shift();if(c=(s.ownerDocument||s).$$reactFormReplay,c!=null)for(h=0;h<c.length;h+=3){var g=c[h],y=c[h+1],k=g[jn]||null;if(typeof y=="function")k||jw(c);else if(k){var M=null;if(y&&y.hasAttribute("formAction")){if(g=y,k=y[jn]||null)M=k.formAction;else if(Qg(g)!==null)continue}else M=k.action;typeof M=="function"?c[h+1]=M:(c.splice(h,3),h-=3),jw(c)}}}function Lw(){function s(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(k){return g=k})},focusReset:"manual",scroll:"manual"})}function l(){g!==null&&(g(),g=null),h||setTimeout(c,20)}function c(){if(!h&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,g=null;return navigation.addEventListener("navigate",s),navigation.addEventListener("navigatesuccess",l),navigation.addEventListener("navigateerror",l),setTimeout(c,100),function(){h=!0,navigation.removeEventListener("navigate",s),navigation.removeEventListener("navigatesuccess",l),navigation.removeEventListener("navigateerror",l),g!==null&&(g(),g=null)}}}function Xg(s){this._internalRoot=s}Ih.prototype.render=Xg.prototype.render=function(s){var l=this._internalRoot;if(l===null)throw Error(i(409));var c=l.current,h=Ci();Ew(c,h,s,l,null,null)},Ih.prototype.unmount=Xg.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var l=s.containerInfo;Ew(s.current,2,null,s,null,null),bh(),l[Gs]=null}};function Ih(s){this._internalRoot=s}Ih.prototype.unstable_scheduleHydration=function(s){if(s){var l=Ar();s={blockedOn:null,target:s,priority:l};for(var c=0;c<Qr.length&&l!==0&&l<Qr[c].priority;c++);Qr.splice(c,0,s),c===0&&Nw(s)}};var Bw=e.version;if(Bw!=="19.2.7")throw Error(i(527,Bw,"19.2.7"));W.findDOMNode=function(s){var l=s._reactInternals;if(l===void 0)throw typeof s.render=="function"?Error(i(188)):(s=Object.keys(s).join(","),Error(i(268,s)));return s=d(l),s=s!==null?m(s):null,s=s===null?null:s.stateNode,s};var tD={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:P,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Hh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Hh.isDisabled&&Hh.supportsFiber)try{Pt=Hh.inject(tD),He=Hh}catch{}}return bu.createRoot=function(s,l){if(!r(s))throw Error(i(299));var c=!1,h="",g=V1,y=q1,k=F1;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(y=l.onCaughtError),l.onRecoverableError!==void 0&&(k=l.onRecoverableError)),l=kw(s,1,!1,null,null,c,h,null,g,y,k,Lw),s[Gs]=l.current,Ng(s),new Xg(l)},bu.hydrateRoot=function(s,l,c){if(!r(s))throw Error(i(299));var h=!1,g="",y=V1,k=q1,M=F1,I=null;return c!=null&&(c.unstable_strictMode===!0&&(h=!0),c.identifierPrefix!==void 0&&(g=c.identifierPrefix),c.onUncaughtError!==void 0&&(y=c.onUncaughtError),c.onCaughtError!==void 0&&(k=c.onCaughtError),c.onRecoverableError!==void 0&&(M=c.onRecoverableError),c.formState!==void 0&&(I=c.formState)),l=kw(s,1,!0,l,c??null,h,g,I,y,k,M,Lw),l.context=Cw(null),c=l.current,h=Ci(),h=Ac(h),g=jr(h),g.callback=null,Lr(c,g,h),c=h,l.current.lanes=c,Fs(l,c),vs(l),s[Gs]=l.current,Ng(s),new Ih(l)},bu.version="19.2.7",bu}var Kw;function mD(){if(Kw)return e0.exports;Kw=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),e0.exports=dD(),e0.exports}var pD=mD(),s0={exports:{}},r0={};/**
|
|
50
|
+
* @license React
|
|
51
|
+
* use-sync-external-store-shim.production.js
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE file in the root directory of this source tree.
|
|
57
|
+
*/var Yw;function gD(){if(Yw)return r0;Yw=1;var n=ff();function e(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var t=typeof Object.is=="function"?Object.is:e,i=n.useState,r=n.useEffect,o=n.useLayoutEffect,a=n.useDebugValue;function u(p,b){var v=b(),S=i({inst:{value:v,getSnapshot:b}}),w=S[0].inst,A=S[1];return o(function(){w.value=v,w.getSnapshot=b,f(w)&&A({inst:w})},[p,v,b]),r(function(){return f(w)&&A({inst:w}),p(function(){f(w)&&A({inst:w})})},[p]),a(v),v}function f(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!t(p,v)}catch{return!0}}function d(p,b){return b()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:u;return r0.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:m,r0}var Qw;function FC(){return Qw||(Qw=1,s0.exports=gD()),s0.exports}var wb=FC();const yD=Sb.useInsertionEffect,bD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",vD=bD?E.useLayoutEffect:E.useEffect,xD=yD||vD,kb=n=>{const e=E.useRef([n,(...t)=>e[0](...t)]).current;return xD(()=>{e[0]=n}),e[1]},SD="popstate",Cb="pushState",Eb="replaceState",wD="hashchange",Ww=[SD,Cb,Eb,wD],kD=n=>{for(const e of Ww)addEventListener(e,n);return()=>{for(const e of Ww)removeEventListener(e,n)}},GC=(n,e)=>wb.useSyncExternalStore(kD,n,e),Xw=()=>location.search,CD=({ssrSearch:n}={})=>GC(Xw,n!=null?()=>n:Xw),$w=()=>location.pathname,ED=({ssrPath:n}={})=>GC($w,n!=null?()=>n:$w),AD=(n,{replace:e=!1,state:t=null}={})=>history[e?Eb:Cb](t,"",n),KC=(n={})=>[ED(n),AD],Zw=Symbol.for("wouter_v3");if(typeof history<"u"&&typeof window[Zw]>"u"){for(const n of[Cb,Eb]){const e=history[n];history[n]=function(){const t=e.apply(this,arguments),i=new Event(n);return i.arguments=arguments,dispatchEvent(i),t}}Object.defineProperty(window,Zw,{value:!0})}var gc=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fo,nl,Ga,NC,TD=(NC=class extends gc{constructor(){super();Ue(this,fo);Ue(this,nl);Ue(this,Ga);Ee(this,Ga,e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e();return window.addEventListener("visibilitychange",t,!1),()=>{window.removeEventListener("visibilitychange",t)}}})}onSubscribe(){H(this,nl)||this.setEventListener(H(this,Ga))}onUnsubscribe(){var e;this.hasListeners()||((e=H(this,nl))==null||e.call(this),Ee(this,nl,void 0))}setEventListener(e){var t;Ee(this,Ga,e),(t=H(this,nl))==null||t.call(this),Ee(this,nl,e(i=>{typeof i=="boolean"?this.setFocused(i):this.onFocus()}))}setFocused(e){H(this,fo)!==e&&(Ee(this,fo,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){var e;return typeof H(this,fo)=="boolean"?H(this,fo):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},fo=new WeakMap,nl=new WeakMap,Ga=new WeakMap,NC),Ab=new TD,RD={setTimeout:(n,e)=>setTimeout(n,e),clearTimeout:n=>clearTimeout(n),setInterval:(n,e)=>setInterval(n,e),clearInterval:n=>clearInterval(n)},il,xb,DC,MD=(DC=class{constructor(){Ue(this,il,RD);Ue(this,xb,!1)}setTimeoutProvider(n){Ee(this,il,n)}setTimeout(n,e){return H(this,il).setTimeout(n,e)}clearTimeout(n){H(this,il).clearTimeout(n)}setInterval(n,e){return H(this,il).setInterval(n,e)}clearInterval(n){H(this,il).clearInterval(n)}},il=new WeakMap,xb=new WeakMap,DC),lo=new MD;function OD(n){setTimeout(n,0)}var ND=typeof window>"u"||"Deno"in globalThis;function Zn(){}function DD(n,e){return typeof n=="function"?n(e):n}function K0(n){return typeof n=="number"&&n>=0&&n!==1/0}function YC(n,e){return Math.max(n+(e||0)-Date.now(),0)}function ml(n,e){return typeof n=="function"?n(e):n}function Ri(n,e){return typeof n=="function"?n(e):n}function Jw(n,e){const{type:t="all",exact:i,fetchStatus:r,predicate:o,queryKey:a,stale:u}=n;if(a){if(i){if(e.queryHash!==Tb(a,e.options))return!1}else if(!qu(e.queryKey,a))return!1}if(t!=="all"){const f=e.isActive();if(t==="active"&&!f||t==="inactive"&&f)return!1}return!(typeof u=="boolean"&&e.isStale()!==u||r&&r!==e.state.fetchStatus||o&&!o(e))}function e2(n,e){const{exact:t,status:i,predicate:r,mutationKey:o}=n;if(o){if(!e.options.mutationKey)return!1;if(t){if(Co(e.options.mutationKey)!==Co(o))return!1}else if(!qu(e.options.mutationKey,o))return!1}return!(i&&e.state.status!==i||r&&!r(e))}function Tb(n,e){return((e==null?void 0:e.queryKeyHashFn)||Co)(n)}function Co(n){return JSON.stringify(n,(e,t)=>Y0(t)?Object.keys(t).sort().reduce((i,r)=>(i[r]=t[r],i),{}):t)}function qu(n,e){return n===e?!0:typeof n!=typeof e?!1:n&&e&&typeof n=="object"&&typeof e=="object"?Object.keys(e).every(t=>qu(n[t],e[t])):!1}var jD=Object.prototype.hasOwnProperty;function QC(n,e,t=0){if(n===e)return n;if(t>500)return e;const i=t2(n)&&t2(e);if(!i&&!(Y0(n)&&Y0(e)))return e;const o=(i?n:Object.keys(n)).length,a=i?e:Object.keys(e),u=a.length,f=i?new Array(u):{};let d=0;for(let m=0;m<u;m++){const p=i?m:a[m],b=n[p],v=e[p];if(b===v){f[p]=b,(i?m<o:jD.call(n,p))&&d++;continue}if(b===null||v===null||typeof b!="object"||typeof v!="object"){f[p]=v;continue}const S=QC(b,v,t+1);f[p]=S,S===b&&d++}return o===u&&d===o?n:f}function jd(n,e){if(!e||Object.keys(n).length!==Object.keys(e).length)return!1;for(const t in n)if(n[t]!==e[t])return!1;return!0}function t2(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Y0(n){if(!n2(n))return!1;const e=n.constructor;if(e===void 0)return!0;const t=e.prototype;return!(!n2(t)||!t.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function n2(n){return Object.prototype.toString.call(n)==="[object Object]"}function LD(n){return new Promise(e=>{lo.setTimeout(e,n)})}function Q0(n,e,t){return typeof t.structuralSharing=="function"?t.structuralSharing(n,e):t.structuralSharing!==!1?QC(n,e):e}function BD(n){return n}function zD(n,e,t=0){const i=[...n,e];return t&&i.length>t?i.slice(1):i}function PD(n,e,t=0){const i=[e,...n];return t&&i.length>t?i.slice(0,-1):i}var Rb=Symbol();function WC(n,e){return!n.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!n.queryFn||n.queryFn===Rb?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function Mb(n,e){return typeof n=="function"?n(...e):!!n}function ID(n,e,t){let i=!1,r;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(r??(r=e()),i||(i=!0,r.aborted?t():r.addEventListener("abort",t,{once:!0})),r)}),n}var Fu=(()=>{let n=()=>ND;return{isServer(){return n()},setIsServer(e){n=e}}})();function W0(){let n,e;const t=new Promise((r,o)=>{n=r,e=o});t.status="pending",t.catch(()=>{});function i(r){Object.assign(t,r),delete t.resolve,delete t.reject}return t.resolve=r=>{i({status:"fulfilled",value:r}),n(r)},t.reject=r=>{i({status:"rejected",reason:r}),e(r)},t}var HD=OD;function _D(){let n=[],e=0,t=u=>{u()},i=u=>{u()},r=HD;const o=u=>{e?n.push(u):r(()=>{t(u)})},a=()=>{const u=n;n=[],u.length&&r(()=>{i(()=>{u.forEach(f=>{t(f)})})})};return{batch:u=>{let f;e++;try{f=u()}finally{e--,e||a()}return f},batchCalls:u=>(...f)=>{o(()=>{u(...f)})},schedule:o,setNotifyFunction:u=>{t=u},setBatchNotifyFunction:u=>{i=u},setScheduler:u=>{r=u}}}var En=_D(),Ka,sl,Ya,jC,UD=(jC=class extends gc{constructor(){super();Ue(this,Ka,!0);Ue(this,sl);Ue(this,Ya);Ee(this,Ya,e=>{if(typeof window<"u"&&window.addEventListener){const t=()=>e(!0),i=()=>e(!1);return window.addEventListener("online",t,!1),window.addEventListener("offline",i,!1),()=>{window.removeEventListener("online",t),window.removeEventListener("offline",i)}}})}onSubscribe(){H(this,sl)||this.setEventListener(H(this,Ya))}onUnsubscribe(){var e;this.hasListeners()||((e=H(this,sl))==null||e.call(this),Ee(this,sl,void 0))}setEventListener(e){var t;Ee(this,Ya,e),(t=H(this,sl))==null||t.call(this),Ee(this,sl,e(this.setOnline.bind(this)))}setOnline(e){H(this,Ka)!==e&&(Ee(this,Ka,e),this.listeners.forEach(i=>{i(e)}))}isOnline(){return H(this,Ka)}},Ka=new WeakMap,sl=new WeakMap,Ya=new WeakMap,jC),Ld=new UD;function VD(n){return Math.min(1e3*2**n,3e4)}function XC(n){return(n??"online")==="online"?Ld.isOnline():!0}var X0=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function $C(n){let e=!1,t=0,i;const r=W0(),o=()=>r.status!=="pending",a=w=>{var A;if(!o()){const C=new X0(w);b(C),(A=n.onCancel)==null||A.call(n,C)}},u=()=>{e=!0},f=()=>{e=!1},d=()=>Ab.isFocused()&&(n.networkMode==="always"||Ld.isOnline())&&n.canRun(),m=()=>XC(n.networkMode)&&n.canRun(),p=w=>{o()||(i==null||i(),r.resolve(w))},b=w=>{o()||(i==null||i(),r.reject(w))},v=()=>new Promise(w=>{var A;i=C=>{(o()||d())&&w(C)},(A=n.onPause)==null||A.call(n)}).then(()=>{var w;i=void 0,o()||(w=n.onContinue)==null||w.call(n)}),S=()=>{if(o())return;let w;const A=t===0?n.initialPromise:void 0;try{w=A??n.fn()}catch(C){w=Promise.reject(C)}Promise.resolve(w).then(p).catch(C=>{var z;if(o())return;const T=n.retry??(Fu.isServer()?0:3),R=n.retryDelay??VD,N=typeof R=="function"?R(t,C):R,O=T===!0||typeof T=="number"&&t<T||typeof T=="function"&&T(t,C);if(e||!O){b(C);return}t++,(z=n.onFail)==null||z.call(n,t,C),LD(N).then(()=>d()?void 0:v()).then(()=>{e?b(C):S()})})};return{promise:r,status:()=>r.status,cancel:a,continue:()=>(i==null||i(),r),cancelRetry:u,continueRetry:f,canStart:m,start:()=>(m()?S():v().then(S),r)}}var ho,LC,ZC=(LC=class{constructor(){Ue(this,ho)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),K0(this.gcTime)&&Ee(this,ho,lo.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Fu.isServer()?1/0:300*1e3))}clearGcTimeout(){H(this,ho)!==void 0&&(lo.clearTimeout(H(this,ho)),Ee(this,ho,void 0))}},ho=new WeakMap,LC);function qD(n){return{onFetch:(e,t)=>{var m,p,b,v,S;const i=e.options,r=(b=(p=(m=e.fetchOptions)==null?void 0:m.meta)==null?void 0:p.fetchMore)==null?void 0:b.direction,o=((v=e.state.data)==null?void 0:v.pages)||[],a=((S=e.state.data)==null?void 0:S.pageParams)||[];let u={pages:[],pageParams:[]},f=0;const d=async()=>{let w=!1;const A=R=>{ID(R,()=>e.signal,()=>w=!0)},C=WC(e.options,e.fetchOptions),T=async(R,N,O)=>{if(w)return Promise.reject(e.signal.reason);if(N==null&&R.pages.length)return Promise.resolve(R);const D=(()=>{const F={client:e.client,queryKey:e.queryKey,pageParam:N,direction:O?"backward":"forward",meta:e.options.meta};return A(F),F})(),j=await C(D),{maxPages:B}=e.options,K=O?PD:zD;return{pages:K(R.pages,j,B),pageParams:K(R.pageParams,N,B)}};if(r&&o.length){const R=r==="backward",N=R?JC:$0,O={pages:o,pageParams:a},z=N(i,O);u=await T(O,z,R)}else{const R=n??o.length;do{const N=f===0?a[0]??i.initialPageParam:$0(i,u);if(f>0&&N==null)break;u=await T(u,N),f++}while(f<R)}return u};e.options.persister?e.fetchFn=()=>{var w,A;return(A=(w=e.options).persister)==null?void 0:A.call(w,d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},t)}:e.fetchFn=d}}}function $0(n,{pages:e,pageParams:t}){const i=e.length-1;return e.length>0?n.getNextPageParam(e[i],e,t[i],t):void 0}function JC(n,{pages:e,pageParams:t}){var i;return e.length>0?(i=n.getPreviousPageParam)==null?void 0:i.call(n,e[0],e,t[0],t):void 0}function FD(n,e){return e?$0(n,e)!=null:!1}function GD(n,e){return!e||!n.getPreviousPageParam?!1:JC(n,e)!=null}var Qa,mo,Wa,Ki,po,On,lf,go,Ti,eE,fr,BC,KD=(BC=class extends ZC{constructor(e){super();Ue(this,Ti);Ue(this,Qa);Ue(this,mo);Ue(this,Wa);Ue(this,Ki);Ue(this,po);Ue(this,On);Ue(this,lf);Ue(this,go);Ee(this,go,!1),Ee(this,lf,e.defaultOptions),this.setOptions(e.options),this.observers=[],Ee(this,po,e.client),Ee(this,Ki,H(this,po).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Ee(this,mo,s2(this.options)),this.state=e.state??H(this,mo),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return H(this,Qa)}get promise(){var e;return(e=H(this,On))==null?void 0:e.promise}setOptions(e){if(this.options={...H(this,lf),...e},e!=null&&e._type&&Ee(this,Qa,e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const t=s2(this.options);t.data!==void 0&&(this.setState(i2(t.data,t.dataUpdatedAt)),Ee(this,mo,t))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&H(this,Ki).remove(this)}setData(e,t){const i=Q0(this.state.data,e,this.options);return tt(this,Ti,fr).call(this,{data:i,type:"success",dataUpdatedAt:t==null?void 0:t.updatedAt,manual:t==null?void 0:t.manual}),i}setState(e){tt(this,Ti,fr).call(this,{type:"setState",state:e})}cancel(e){var i,r;const t=(i=H(this,On))==null?void 0:i.promise;return(r=H(this,On))==null||r.cancel(e),t?t.then(Zn).catch(Zn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return H(this,mo)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Ri(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Rb||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>ml(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!YC(this.state.dataUpdatedAt,e)}onFocus(){var t;const e=this.observers.find(i=>i.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(t=H(this,On))==null||t.continue()}onOnline(){var t;const e=this.observers.find(i=>i.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(t=H(this,On))==null||t.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),H(this,Ki).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(H(this,On)&&(H(this,go)||tt(this,Ti,eE).call(this)?H(this,On).cancel({revert:!0}):H(this,On).cancelRetry()),this.scheduleGc()),H(this,Ki).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||tt(this,Ti,fr).call(this,{type:"invalidate"})}async fetch(e,t){var d,m,p,b,v,S,w,A,C,T,R;if(this.state.fetchStatus!=="idle"&&((d=H(this,On))==null?void 0:d.status())!=="rejected"){if(this.state.data!==void 0&&(t!=null&&t.cancelRefetch))this.cancel({silent:!0});else if(H(this,On))return H(this,On).continueRetry(),H(this,On).promise}if(e&&this.setOptions(e),!this.options.queryFn){const N=this.observers.find(O=>O.options.queryFn);N&&this.setOptions(N.options)}const i=new AbortController,r=N=>{Object.defineProperty(N,"signal",{enumerable:!0,get:()=>(Ee(this,go,!0),i.signal)})},o=()=>{const N=WC(this.options,t),z=(()=>{const D={client:H(this,po),queryKey:this.queryKey,meta:this.meta};return r(D),D})();return Ee(this,go,!1),this.options.persister?this.options.persister(N,z,this):N(z)},u=(()=>{const N={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:H(this,po),state:this.state,fetchFn:o};return r(N),N})(),f=H(this,Qa)==="infinite"?qD(this.options.pages):this.options.behavior;f==null||f.onFetch(u,this),Ee(this,Wa,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((m=u.fetchOptions)==null?void 0:m.meta))&&tt(this,Ti,fr).call(this,{type:"fetch",meta:(p=u.fetchOptions)==null?void 0:p.meta}),Ee(this,On,$C({initialPromise:t==null?void 0:t.initialPromise,fn:u.fetchFn,onCancel:N=>{N instanceof X0&&N.revert&&this.setState({...H(this,Wa),fetchStatus:"idle"}),i.abort()},onFail:(N,O)=>{tt(this,Ti,fr).call(this,{type:"failed",failureCount:N,error:O})},onPause:()=>{tt(this,Ti,fr).call(this,{type:"pause"})},onContinue:()=>{tt(this,Ti,fr).call(this,{type:"continue"})},retry:u.options.retry,retryDelay:u.options.retryDelay,networkMode:u.options.networkMode,canRun:()=>!0}));try{const N=await H(this,On).start();if(N===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(N),(v=(b=H(this,Ki).config).onSuccess)==null||v.call(b,N,this),(w=(S=H(this,Ki).config).onSettled)==null||w.call(S,N,this.state.error,this),N}catch(N){if(N instanceof X0){if(N.silent)return H(this,On).promise;if(N.revert){if(this.state.data===void 0)throw N;return this.state.data}}throw tt(this,Ti,fr).call(this,{type:"error",error:N}),(C=(A=H(this,Ki).config).onError)==null||C.call(A,N,this),(R=(T=H(this,Ki).config).onSettled)==null||R.call(T,this.state.data,N,this),N}finally{this.scheduleGc()}}},Qa=new WeakMap,mo=new WeakMap,Wa=new WeakMap,Ki=new WeakMap,po=new WeakMap,On=new WeakMap,lf=new WeakMap,go=new WeakMap,Ti=new WeakSet,eE=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},fr=function(e){const t=i=>{switch(e.type){case"failed":return{...i,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...i,fetchStatus:"paused"};case"continue":return{...i,fetchStatus:"fetching"};case"fetch":return{...i,...tE(i.data,this.options),fetchMeta:e.meta??null};case"success":const r={...i,...i2(e.data,e.dataUpdatedAt),dataUpdateCount:i.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ee(this,Wa,e.manual?r:void 0),r;case"error":const o=e.error;return{...i,error:o,errorUpdateCount:i.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:i.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...i,isInvalidated:!0};case"setState":return{...i,...e.state}}};this.state=t(this.state),En.batch(()=>{this.observers.forEach(i=>{i.onQueryUpdate()}),H(this,Ki).notify({query:this,type:"updated",action:e})})},BC);function tE(n,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:XC(e.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function i2(n,e){return{data:n,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function s2(n){const e=typeof n.initialData=="function"?n.initialData():n.initialData,t=e!==void 0,i=t?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:t?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:t?"success":"pending",fetchStatus:"idle"}}var ui,yt,of,$n,yo,Xa,dr,rl,af,$a,Za,bo,vo,ll,Ja,Rt,Tu,Z0,J0,ey,ty,ny,iy,sy,iE,zC,nE=(zC=class extends gc{constructor(e,t){super();Ue(this,Rt);Ue(this,ui);Ue(this,yt);Ue(this,of);Ue(this,$n);Ue(this,yo);Ue(this,Xa);Ue(this,dr);Ue(this,rl);Ue(this,af);Ue(this,$a);Ue(this,Za);Ue(this,bo);Ue(this,vo);Ue(this,ll);Ue(this,Ja,new Set);this.options=t,Ee(this,ui,e),Ee(this,rl,null),Ee(this,dr,W0()),this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(H(this,yt).addObserver(this),r2(H(this,yt),this.options)?tt(this,Rt,Tu).call(this):this.updateResult(),tt(this,Rt,ty).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ry(H(this,yt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ry(H(this,yt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,tt(this,Rt,ny).call(this),tt(this,Rt,iy).call(this),H(this,yt).removeObserver(this)}setOptions(e){const t=this.options,i=H(this,yt);if(this.options=H(this,ui).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ri(this.options.enabled,H(this,yt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");tt(this,Rt,sy).call(this),H(this,yt).setOptions(this.options),t._defaulted&&!jd(this.options,t)&&H(this,ui).getQueryCache().notify({type:"observerOptionsUpdated",query:H(this,yt),observer:this});const r=this.hasListeners();r&&l2(H(this,yt),i,this.options,t)&&tt(this,Rt,Tu).call(this),this.updateResult(),r&&(H(this,yt)!==i||Ri(this.options.enabled,H(this,yt))!==Ri(t.enabled,H(this,yt))||ml(this.options.staleTime,H(this,yt))!==ml(t.staleTime,H(this,yt)))&&tt(this,Rt,Z0).call(this);const o=tt(this,Rt,J0).call(this);r&&(H(this,yt)!==i||Ri(this.options.enabled,H(this,yt))!==Ri(t.enabled,H(this,yt))||o!==H(this,ll))&&tt(this,Rt,ey).call(this,o)}getOptimisticResult(e){const t=H(this,ui).getQueryCache().build(H(this,ui),e),i=this.createResult(t,e);return QD(this,i)&&(Ee(this,$n,i),Ee(this,Xa,this.options),Ee(this,yo,H(this,yt).state)),i}getCurrentResult(){return H(this,$n)}trackResult(e,t){return new Proxy(e,{get:(i,r)=>(this.trackProp(r),t==null||t(r),r==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&H(this,dr).status==="pending"&&H(this,dr).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(i,r))})}trackProp(e){H(this,Ja).add(e)}getCurrentQuery(){return H(this,yt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const t=H(this,ui).defaultQueryOptions(e),i=H(this,ui).getQueryCache().build(H(this,ui),t);return i.fetch().then(()=>this.createResult(i,t))}fetch(e){return tt(this,Rt,Tu).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),H(this,$n)))}createResult(e,t){var B;const i=H(this,yt),r=this.options,o=H(this,$n),a=H(this,yo),u=H(this,Xa),d=e!==i?e.state:H(this,of),{state:m}=e;let p={...m},b=!1,v;if(t._optimisticResults){const K=this.hasListeners(),F=!K&&r2(e,t),Y=K&&l2(e,i,t,r);(F||Y)&&(p={...p,...tE(m.data,e.options)}),t._optimisticResults==="isRestoring"&&(p.fetchStatus="idle")}let{error:S,errorUpdatedAt:w,status:A}=p;v=p.data;let C=!1;if(t.placeholderData!==void 0&&v===void 0&&A==="pending"){let K;o!=null&&o.isPlaceholderData&&t.placeholderData===(u==null?void 0:u.placeholderData)?(K=o.data,C=!0):K=typeof t.placeholderData=="function"?t.placeholderData((B=H(this,Za))==null?void 0:B.state.data,H(this,Za)):t.placeholderData,K!==void 0&&(A="success",v=Q0(o==null?void 0:o.data,K,t),b=!0)}if(t.select&&v!==void 0&&!C)if(o&&v===(a==null?void 0:a.data)&&t.select===H(this,af))v=H(this,$a);else try{Ee(this,af,t.select),v=t.select(v),v=Q0(o==null?void 0:o.data,v,t),Ee(this,$a,v),Ee(this,rl,null)}catch(K){Ee(this,rl,K)}H(this,rl)&&(S=H(this,rl),v=H(this,$a),w=Date.now(),A="error");const T=p.fetchStatus==="fetching",R=A==="pending",N=A==="error",O=R&&T,z=v!==void 0,j={status:A,fetchStatus:p.fetchStatus,isPending:R,isSuccess:A==="success",isError:N,isInitialLoading:O,isLoading:O,data:v,dataUpdatedAt:p.dataUpdatedAt,error:S,errorUpdatedAt:w,failureCount:p.fetchFailureCount,failureReason:p.fetchFailureReason,errorUpdateCount:p.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:p.dataUpdateCount>d.dataUpdateCount||p.errorUpdateCount>d.errorUpdateCount,isFetching:T,isRefetching:T&&!R,isLoadingError:N&&!z,isPaused:p.fetchStatus==="paused",isPlaceholderData:b,isRefetchError:N&&z,isStale:Ob(e,t),refetch:this.refetch,promise:H(this,dr),isEnabled:Ri(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const K=j.data!==void 0,F=j.status==="error"&&!K,Y=q=>{F?q.reject(j.error):K&&q.resolve(j.data)},V=()=>{const q=Ee(this,dr,j.promise=W0());Y(q)},Z=H(this,dr);switch(Z.status){case"pending":e.queryHash===i.queryHash&&Y(Z);break;case"fulfilled":(F||j.data!==Z.value)&&V();break;case"rejected":(!F||j.error!==Z.reason)&&V();break}}return j}updateResult(){const e=H(this,$n),t=this.createResult(H(this,yt),this.options);if(Ee(this,yo,H(this,yt).state),Ee(this,Xa,this.options),H(this,yo).data!==void 0&&Ee(this,Za,H(this,yt)),jd(t,e))return;Ee(this,$n,t);const i=()=>{if(!e)return!0;const{notifyOnChangeProps:r}=this.options,o=typeof r=="function"?r():r;if(o==="all"||!o&&!H(this,Ja).size)return!0;const a=new Set(o??H(this,Ja));return this.options.throwOnError&&a.add("error"),Object.keys(H(this,$n)).some(u=>{const f=u;return H(this,$n)[f]!==e[f]&&a.has(f)})};tt(this,Rt,iE).call(this,{listeners:i()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&tt(this,Rt,ty).call(this)}},ui=new WeakMap,yt=new WeakMap,of=new WeakMap,$n=new WeakMap,yo=new WeakMap,Xa=new WeakMap,dr=new WeakMap,rl=new WeakMap,af=new WeakMap,$a=new WeakMap,Za=new WeakMap,bo=new WeakMap,vo=new WeakMap,ll=new WeakMap,Ja=new WeakMap,Rt=new WeakSet,Tu=function(e){tt(this,Rt,sy).call(this);let t=H(this,yt).fetch(this.options,e);return e!=null&&e.throwOnError||(t=t.catch(Zn)),t},Z0=function(){tt(this,Rt,ny).call(this);const e=ml(this.options.staleTime,H(this,yt));if(Fu.isServer()||H(this,$n).isStale||!K0(e))return;const i=YC(H(this,$n).dataUpdatedAt,e)+1;Ee(this,bo,lo.setTimeout(()=>{H(this,$n).isStale||this.updateResult()},i))},J0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(H(this,yt)):this.options.refetchInterval)??!1},ey=function(e){tt(this,Rt,iy).call(this),Ee(this,ll,e),!(Fu.isServer()||Ri(this.options.enabled,H(this,yt))===!1||!K0(H(this,ll))||H(this,ll)===0)&&Ee(this,vo,lo.setInterval(()=>{(this.options.refetchIntervalInBackground||Ab.isFocused())&&tt(this,Rt,Tu).call(this)},H(this,ll)))},ty=function(){tt(this,Rt,Z0).call(this),tt(this,Rt,ey).call(this,tt(this,Rt,J0).call(this))},ny=function(){H(this,bo)!==void 0&&(lo.clearTimeout(H(this,bo)),Ee(this,bo,void 0))},iy=function(){H(this,vo)!==void 0&&(lo.clearInterval(H(this,vo)),Ee(this,vo,void 0))},sy=function(){const e=H(this,ui).getQueryCache().build(H(this,ui),this.options);if(e===H(this,yt))return;const t=H(this,yt);Ee(this,yt,e),Ee(this,of,e.state),this.hasListeners()&&(t==null||t.removeObserver(this),e.addObserver(this))},iE=function(e){En.batch(()=>{e.listeners&&this.listeners.forEach(t=>{t(H(this,$n))}),H(this,ui).getQueryCache().notify({query:H(this,yt),type:"observerResultsUpdated"})})},zC);function YD(n,e){return Ri(e.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&Ri(e.retryOnMount,n)===!1)}function r2(n,e){return YD(n,e)||n.state.data!==void 0&&ry(n,e,e.refetchOnMount)}function ry(n,e,t){if(Ri(e.enabled,n)!==!1&&ml(e.staleTime,n)!=="static"){const i=typeof t=="function"?t(n):t;return i==="always"||i!==!1&&Ob(n,e)}return!1}function l2(n,e,t,i){return(n!==e||Ri(i.enabled,n)===!1)&&(!t.suspense||n.state.status!=="error")&&Ob(n,t)}function Ob(n,e){return Ri(e.enabled,n)!==!1&&n.isStaleByTime(ml(e.staleTime,n))}function QD(n,e){return!jd(n.getCurrentResult(),e)}var WD=class extends nE{constructor(n,e){super(n,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(n){n._type="infinite",super.setOptions(n)}getOptimisticResult(n){return n._type="infinite",super.getOptimisticResult(n)}fetchNextPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(n){return this.fetch({...n,meta:{fetchMore:{direction:"backward"}}})}createResult(n,e){var S,w;const{state:t}=n,i=super.createResult(n,e),{isFetching:r,isRefetching:o,isError:a,isRefetchError:u}=i,f=(w=(S=t.fetchMeta)==null?void 0:S.fetchMore)==null?void 0:w.direction,d=a&&f==="forward",m=r&&f==="forward",p=a&&f==="backward",b=r&&f==="backward";return{...i,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:FD(e,t.data),hasPreviousPage:GD(e,t.data),isFetchNextPageError:d,isFetchingNextPage:m,isFetchPreviousPageError:p,isFetchingPreviousPage:b,isRefetchError:u&&!d&&!p,isRefetching:o&&!m&&!b}}},cf,Es,qn,xo,As,$r,PC,XD=(PC=class extends ZC{constructor(e){super();Ue(this,As);Ue(this,cf);Ue(this,Es);Ue(this,qn);Ue(this,xo);Ee(this,cf,e.client),this.mutationId=e.mutationId,Ee(this,qn,e.mutationCache),Ee(this,Es,[]),this.state=e.state||sE(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){H(this,Es).includes(e)||(H(this,Es).push(e),this.clearGcTimeout(),H(this,qn).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Ee(this,Es,H(this,Es).filter(t=>t!==e)),this.scheduleGc(),H(this,qn).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){H(this,Es).length||(this.state.status==="pending"?this.scheduleGc():H(this,qn).remove(this))}continue(){var e;return((e=H(this,xo))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var a,u,f,d,m,p,b,v,S,w,A,C,T,R,N,O,z,D;const t=()=>{tt(this,As,$r).call(this,{type:"continue"})},i={client:H(this,cf),meta:this.options.meta,mutationKey:this.options.mutationKey};Ee(this,xo,$C({fn:()=>this.options.mutationFn?this.options.mutationFn(e,i):Promise.reject(new Error("No mutationFn found")),onFail:(j,B)=>{tt(this,As,$r).call(this,{type:"failed",failureCount:j,error:B})},onPause:()=>{tt(this,As,$r).call(this,{type:"pause"})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>H(this,qn).canRun(this)}));const r=this.state.status==="pending",o=!H(this,xo).canStart();try{if(r)t();else{tt(this,As,$r).call(this,{type:"pending",variables:e,isPaused:o}),H(this,qn).config.onMutate&&await H(this,qn).config.onMutate(e,this,i);const B=await((u=(a=this.options).onMutate)==null?void 0:u.call(a,e,i));B!==this.state.context&&tt(this,As,$r).call(this,{type:"pending",context:B,variables:e,isPaused:o})}const j=await H(this,xo).start();return await((d=(f=H(this,qn).config).onSuccess)==null?void 0:d.call(f,j,e,this.state.context,this,i)),await((p=(m=this.options).onSuccess)==null?void 0:p.call(m,j,e,this.state.context,i)),await((v=(b=H(this,qn).config).onSettled)==null?void 0:v.call(b,j,null,this.state.variables,this.state.context,this,i)),await((w=(S=this.options).onSettled)==null?void 0:w.call(S,j,null,e,this.state.context,i)),tt(this,As,$r).call(this,{type:"success",data:j}),j}catch(j){try{await((C=(A=H(this,qn).config).onError)==null?void 0:C.call(A,j,e,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((R=(T=this.options).onError)==null?void 0:R.call(T,j,e,this.state.context,i))}catch(B){Promise.reject(B)}try{await((O=(N=H(this,qn).config).onSettled)==null?void 0:O.call(N,void 0,j,this.state.variables,this.state.context,this,i))}catch(B){Promise.reject(B)}try{await((D=(z=this.options).onSettled)==null?void 0:D.call(z,void 0,j,e,this.state.context,i))}catch(B){Promise.reject(B)}throw tt(this,As,$r).call(this,{type:"error",error:j}),j}finally{H(this,qn).runNext(this)}}},cf=new WeakMap,Es=new WeakMap,qn=new WeakMap,xo=new WeakMap,As=new WeakSet,$r=function(e){const t=i=>{switch(e.type){case"failed":return{...i,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...i,isPaused:!0};case"continue":return{...i,isPaused:!1};case"pending":return{...i,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...i,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...i,data:void 0,error:e.error,failureCount:i.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=t(this.state),En.batch(()=>{H(this,Es).forEach(i=>{i.onMutationUpdate(e)}),H(this,qn).notify({mutation:this,type:"updated",action:e})})},PC);function sE(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var mr,rs,uf,IC,$D=(IC=class extends gc{constructor(e={}){super();Ue(this,mr);Ue(this,rs);Ue(this,uf);this.config=e,Ee(this,mr,new Set),Ee(this,rs,new Map),Ee(this,uf,0)}build(e,t,i){const r=new XD({client:e,mutationCache:this,mutationId:++_h(this,uf)._,options:e.defaultMutationOptions(t),state:i});return this.add(r),r}add(e){H(this,mr).add(e);const t=Uh(e);if(typeof t=="string"){const i=H(this,rs).get(t);i?i.push(e):H(this,rs).set(t,[e])}this.notify({type:"added",mutation:e})}remove(e){if(H(this,mr).delete(e)){const t=Uh(e);if(typeof t=="string"){const i=H(this,rs).get(t);if(i)if(i.length>1){const r=i.indexOf(e);r!==-1&&i.splice(r,1)}else i[0]===e&&H(this,rs).delete(t)}}this.notify({type:"removed",mutation:e})}canRun(e){const t=Uh(e);if(typeof t=="string"){const i=H(this,rs).get(t),r=i==null?void 0:i.find(o=>o.state.status==="pending");return!r||r===e}else return!0}runNext(e){var i;const t=Uh(e);if(typeof t=="string"){const r=(i=H(this,rs).get(t))==null?void 0:i.find(o=>o!==e&&o.state.isPaused);return(r==null?void 0:r.continue())??Promise.resolve()}else return Promise.resolve()}clear(){En.batch(()=>{H(this,mr).forEach(e=>{this.notify({type:"removed",mutation:e})}),H(this,mr).clear(),H(this,rs).clear()})}getAll(){return Array.from(H(this,mr))}find(e){const t={exact:!0,...e};return this.getAll().find(i=>e2(t,i))}findAll(e={}){return this.getAll().filter(t=>e2(e,t))}notify(e){En.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){const e=this.getAll().filter(t=>t.state.isPaused);return En.batch(()=>Promise.all(e.map(t=>t.continue().catch(Zn))))}},mr=new WeakMap,rs=new WeakMap,uf=new WeakMap,IC);function Uh(n){var e;return(e=n.options.scope)==null?void 0:e.id}var pr,ol,fi,gr,xr,Sd,ly,HC,ZD=(HC=class extends gc{constructor(t,i){super();Ue(this,xr);Ue(this,pr);Ue(this,ol);Ue(this,fi);Ue(this,gr);Ee(this,pr,t),this.setOptions(i),this.bindMethods(),tt(this,xr,Sd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var r;const i=this.options;this.options=H(this,pr).defaultMutationOptions(t),jd(this.options,i)||H(this,pr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:H(this,fi),observer:this}),i!=null&&i.mutationKey&&this.options.mutationKey&&Co(i.mutationKey)!==Co(this.options.mutationKey)?this.reset():((r=H(this,fi))==null?void 0:r.state.status)==="pending"&&H(this,fi).setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=H(this,fi))==null||t.removeObserver(this)}onMutationUpdate(t){tt(this,xr,Sd).call(this),tt(this,xr,ly).call(this,t)}getCurrentResult(){return H(this,ol)}reset(){var t;(t=H(this,fi))==null||t.removeObserver(this),Ee(this,fi,void 0),tt(this,xr,Sd).call(this),tt(this,xr,ly).call(this)}mutate(t,i){var r;return Ee(this,gr,i),(r=H(this,fi))==null||r.removeObserver(this),Ee(this,fi,H(this,pr).getMutationCache().build(H(this,pr),this.options)),H(this,fi).addObserver(this),H(this,fi).execute(t)}},pr=new WeakMap,ol=new WeakMap,fi=new WeakMap,gr=new WeakMap,xr=new WeakSet,Sd=function(){var i;const t=((i=H(this,fi))==null?void 0:i.state)??sE();Ee(this,ol,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},ly=function(t){En.batch(()=>{var i,r,o,a,u,f,d,m;if(H(this,gr)&&this.hasListeners()){const p=H(this,ol).variables,b=H(this,ol).context,v={client:H(this,pr),meta:this.options.meta,mutationKey:this.options.mutationKey};if((t==null?void 0:t.type)==="success"){try{(r=(i=H(this,gr)).onSuccess)==null||r.call(i,t.data,p,b,v)}catch(S){Promise.reject(S)}try{(a=(o=H(this,gr)).onSettled)==null||a.call(o,t.data,null,p,b,v)}catch(S){Promise.reject(S)}}else if((t==null?void 0:t.type)==="error"){try{(f=(u=H(this,gr)).onError)==null||f.call(u,t.error,p,b,v)}catch(S){Promise.reject(S)}try{(m=(d=H(this,gr)).onSettled)==null||m.call(d,void 0,t.error,p,b,v)}catch(S){Promise.reject(S)}}}this.listeners.forEach(p=>{p(H(this,ol))})})},HC),Ts,_C,JD=(_C=class extends gc{constructor(e={}){super();Ue(this,Ts);this.config=e,Ee(this,Ts,new Map)}build(e,t,i){const r=t.queryKey,o=t.queryHash??Tb(r,t);let a=this.get(o);return a||(a=new KD({client:e,queryKey:r,queryHash:o,options:e.defaultQueryOptions(t),state:i,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){H(this,Ts).has(e.queryHash)||(H(this,Ts).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const t=H(this,Ts).get(e.queryHash);t&&(e.destroy(),t===e&&H(this,Ts).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){En.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return H(this,Ts).get(e)}getAll(){return[...H(this,Ts).values()]}find(e){const t={exact:!0,...e};return this.getAll().find(i=>Jw(t,i))}findAll(e={}){const t=this.getAll();return Object.keys(e).length>0?t.filter(i=>Jw(e,i)):t}notify(e){En.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){En.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){En.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ts=new WeakMap,_C),Jt,al,cl,ec,tc,ul,nc,ic,UC,e3=(UC=class{constructor(n={}){Ue(this,Jt);Ue(this,al);Ue(this,cl);Ue(this,ec);Ue(this,tc);Ue(this,ul);Ue(this,nc);Ue(this,ic);Ee(this,Jt,n.queryCache||new JD),Ee(this,al,n.mutationCache||new $D),Ee(this,cl,n.defaultOptions||{}),Ee(this,ec,new Map),Ee(this,tc,new Map),Ee(this,ul,0)}mount(){_h(this,ul)._++,H(this,ul)===1&&(Ee(this,nc,Ab.subscribe(async n=>{n&&(await this.resumePausedMutations(),H(this,Jt).onFocus())})),Ee(this,ic,Ld.subscribe(async n=>{n&&(await this.resumePausedMutations(),H(this,Jt).onOnline())})))}unmount(){var n,e;_h(this,ul)._--,H(this,ul)===0&&((n=H(this,nc))==null||n.call(this),Ee(this,nc,void 0),(e=H(this,ic))==null||e.call(this),Ee(this,ic,void 0))}isFetching(n){return H(this,Jt).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return H(this,al).findAll({...n,status:"pending"}).length}getQueryData(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=H(this,Jt).get(e.queryHash))==null?void 0:t.state.data}ensureQueryData(n){const e=this.defaultQueryOptions(n),t=H(this,Jt).build(this,e),i=t.state.data;return i===void 0?this.fetchQuery(n):(n.revalidateIfStale&&t.isStaleByTime(ml(e.staleTime,t))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(n){return H(this,Jt).findAll(n).map(({queryKey:e,state:t})=>{const i=t.data;return[e,i]})}setQueryData(n,e,t){const i=this.defaultQueryOptions({queryKey:n}),r=H(this,Jt).get(i.queryHash),o=r==null?void 0:r.state.data,a=DD(e,o);if(a!==void 0)return H(this,Jt).build(this,i).setData(a,{...t,manual:!0})}setQueriesData(n,e,t){return En.batch(()=>H(this,Jt).findAll(n).map(({queryKey:i})=>[i,this.setQueryData(i,e,t)]))}getQueryState(n){var t;const e=this.defaultQueryOptions({queryKey:n});return(t=H(this,Jt).get(e.queryHash))==null?void 0:t.state}removeQueries(n){const e=H(this,Jt);En.batch(()=>{e.findAll(n).forEach(t=>{e.remove(t)})})}resetQueries(n,e){const t=H(this,Jt);return En.batch(()=>(t.findAll(n).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...n},e)))}cancelQueries(n,e={}){const t={revert:!0,...e},i=En.batch(()=>H(this,Jt).findAll(n).map(r=>r.cancel(t)));return Promise.all(i).then(Zn).catch(Zn)}invalidateQueries(n,e={}){return En.batch(()=>(H(this,Jt).findAll(n).forEach(t=>{t.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},e)))}refetchQueries(n,e={}){const t={...e,cancelRefetch:e.cancelRefetch??!0},i=En.batch(()=>H(this,Jt).findAll(n).filter(r=>!r.isDisabled()&&!r.isStatic()).map(r=>{let o=r.fetch(void 0,t);return t.throwOnError||(o=o.catch(Zn)),r.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(i).then(Zn)}fetchQuery(n){const e=this.defaultQueryOptions(n);e.retry===void 0&&(e.retry=!1);const t=H(this,Jt).build(this,e);return t.isStaleByTime(ml(e.staleTime,t))?t.fetch(e):Promise.resolve(t.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Zn).catch(Zn)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Zn).catch(Zn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Ld.isOnline()?H(this,al).resumePausedMutations():Promise.resolve()}getQueryCache(){return H(this,Jt)}getMutationCache(){return H(this,al)}getDefaultOptions(){return H(this,cl)}setDefaultOptions(n){Ee(this,cl,n)}setQueryDefaults(n,e){H(this,ec).set(Co(n),{queryKey:n,defaultOptions:e})}getQueryDefaults(n){const e=[...H(this,ec).values()],t={};return e.forEach(i=>{qu(n,i.queryKey)&&Object.assign(t,i.defaultOptions)}),t}setMutationDefaults(n,e){H(this,tc).set(Co(n),{mutationKey:n,defaultOptions:e})}getMutationDefaults(n){const e=[...H(this,tc).values()],t={};return e.forEach(i=>{qu(n,i.mutationKey)&&Object.assign(t,i.defaultOptions)}),t}defaultQueryOptions(n){if(n._defaulted)return n;const e={...H(this,cl).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return e.queryHash||(e.queryHash=Tb(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===Rb&&(e.enabled=!1),e}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...H(this,cl).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){H(this,Jt).clear(),H(this,al).clear()}},Jt=new WeakMap,al=new WeakMap,cl=new WeakMap,ec=new WeakMap,tc=new WeakMap,ul=new WeakMap,nc=new WeakMap,ic=new WeakMap,UC),rE=E.createContext(void 0),Lo=n=>{const e=E.useContext(rE);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},t3=({client:n,children:e})=>(E.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),x.jsx(rE.Provider,{value:n,children:e})),lE=E.createContext(!1),n3=()=>E.useContext(lE);lE.Provider;function i3(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var s3=E.createContext(i3()),r3=()=>E.useContext(s3),l3=(n,e,t)=>{const i=t!=null&&t.state.error&&typeof n.throwOnError=="function"?Mb(n.throwOnError,[t.state.error,t]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||i)&&(e.isReset()||(n.retryOnMount=!1))},o3=n=>{E.useEffect(()=>{n.clearReset()},[n])},a3=({result:n,errorResetBoundary:e,throwOnError:t,query:i,suspense:r})=>n.isError&&!e.isReset()&&!n.isFetching&&i&&(r&&n.data===void 0||Mb(t,[n.error,i])),c3=n=>{if(n.suspense){const t=r=>r==="static"?r:Math.max(r??1e3,1e3),i=n.staleTime;n.staleTime=typeof i=="function"?(...r)=>t(i(...r)):t(i),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},u3=(n,e)=>n.isLoading&&n.isFetching&&!e,f3=(n,e)=>(n==null?void 0:n.suspense)&&e.isPending,o2=(n,e,t)=>e.fetchOptimistic(n).catch(()=>{t.clearReset()});function oE(n,e,t){var v,S,w,A;const i=n3(),r=r3(),o=Lo(),a=o.defaultQueryOptions(n);(S=(v=o.getDefaultOptions().queries)==null?void 0:v._experimental_beforeQuery)==null||S.call(v,a);const u=o.getQueryCache().get(a.queryHash),f=n.subscribed!==!1;a._optimisticResults=i?"isRestoring":f?"optimistic":void 0,c3(a),l3(a,r,u),o3(r);const d=!o.getQueryCache().get(a.queryHash),[m]=E.useState(()=>new e(o,a)),p=m.getOptimisticResult(a),b=!i&&f;if(E.useSyncExternalStore(E.useCallback(C=>{const T=b?m.subscribe(En.batchCalls(C)):Zn;return m.updateResult(),T},[m,b]),()=>m.getCurrentResult(),()=>m.getCurrentResult()),E.useEffect(()=>{m.setOptions(a)},[a,m]),f3(a,p))throw o2(a,m,r);if(a3({result:p,errorResetBoundary:r,throwOnError:a.throwOnError,query:u,suspense:a.suspense}))throw p.error;if((A=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||A.call(w,a,p),a.experimental_prefetchInRender&&!Fu.isServer()&&u3(p,i)){const C=d?o2(a,m,r):u==null?void 0:u.promise;C==null||C.catch(Zn).finally(()=>{m.updateResult()})}return a.notifyOnChangeProps?p:m.trackResult(p)}function Li(n,e){return oE(n,nE)}function Eo(n,e){const t=Lo(),[i]=E.useState(()=>new ZD(t,n));E.useEffect(()=>{i.setOptions(n)},[i,n]);const r=E.useSyncExternalStore(E.useCallback(a=>i.subscribe(En.batchCalls(a)),[i]),()=>i.getCurrentResult(),()=>i.getCurrentResult()),o=E.useCallback((a,u)=>{i.mutate(a,u).catch(Zn)},[i]);if(r.error&&Mb(i.options.throwOnError,[r.error]))throw r.error;return{...r,mutate:o,mutateAsync:r.mutate}}function h3(n,e){return oE(n,WD)}function d3(n,e){if(n instanceof RegExp)return{keys:!1,pattern:n};var t,i,r,o,a=[],u="",f=n.split("/");for(f[0]||f.shift();r=f.shift();)t=r[0],t==="*"?(a.push(t),u+=r[1]==="?"?"(?:/(.*))?":"/(.*)"):t===":"?(i=r.indexOf("?",1),o=r.indexOf(".",1),a.push(r.substring(1,~i?i:~o?o:r.length)),u+=~i&&!~o?"(?:/([^/]+?))?":"/([^/]+?)",~o&&(u+=(~i?"?":"")+"\\"+r.substring(o))):u+="/"+r;return{keys:a,pattern:new RegExp("^"+u+(e?"(?=$|/)":"/?$"),"i")}}const m3=(n,e)=>e.toLowerCase().indexOf(n.toLowerCase())?"~"+e:e.slice(n.length)||"/",aE=(n="")=>n==="/"?"":n,p3=(n,e)=>n[0]==="~"?n.slice(1):aE(e)+n,g3=(n="",e)=>m3(oy(aE(n)),oy(e)),y3=n=>n[0]==="?"?n.slice(1):n,oy=n=>{try{return decodeURI(n)}catch{return n}},b3=n=>oy(y3(n)),cE={hook:KC,searchHook:CD,parser:d3,base:"",ssrPath:void 0,ssrSearch:void 0,ssrContext:void 0,hrefs:n=>n,aroundNav:(n,e,t)=>n(e,t)},uE=E.createContext(cE),yc=()=>E.useContext(uE),fE={},hE=E.createContext(fE),v3=()=>E.useContext(hE),pm=n=>{const[e,t]=n.hook(n);return[g3(n.base,e),kb((i,r)=>n.aroundNav(t,p3(i,n.base),r))]},dE=()=>pm(yc()),x3=()=>{const n=yc();return b3(n.searchHook(n))},mE=(n,e,t,i)=>{const{pattern:r,keys:o}=e instanceof RegExp?{keys:!1,pattern:e}:n(e||"*",i),a=r.exec(t)||[],[u,...f]=a;return u!==void 0?[!0,(()=>{const d=o!==!1?Object.fromEntries(o.map((p,b)=>[p,f[b]])):a.groups;let m={...f};return d&&Object.assign(m,d),m})(),...i?[u]:[]]:[!1,null]},pE=({children:n,...e})=>{var m,p,b;const t=yc(),i=e.hook?cE:t;let r=i;const[o,a=e.ssrSearch??""]=((m=e.ssrPath)==null?void 0:m.split("?"))??[];o&&(e.ssrSearch=a,e.ssrPath=o),e.hrefs=e.hrefs??((p=e.hook)==null?void 0:p.hrefs),e.searchHook=e.searchHook??((b=e.hook)==null?void 0:b.searchHook);let u=E.useRef({}),f=u.current,d=f;for(let v in i){const S=v==="base"?i[v]+(e[v]??""):e[v]??i[v];f===d&&S!==d[v]&&(u.current=d={...d}),d[v]=S,(S!==i[v]||S!==r[v])&&(r=d)}return E.createElement(uE.Provider,{value:r,children:n})},a2=({children:n,component:e},t)=>e?E.createElement(e,{params:t}):typeof n=="function"?n(t):n,S3=n=>{let e=E.useRef(fE);const t=e.current;return e.current=Object.keys(n).length!==Object.keys(t).length||Object.entries(n).some(([i,r])=>r!==t[i])?n:t};function gE(){const[n,e]=dE(),t=x3(),i=E.useMemo(()=>new URLSearchParams(t),[t]);let r=i;const o=kb((a,u)=>{r=new URLSearchParams(typeof a=="function"?a(r):a),e(n+(r.size?"?"+r:""),u)});return[i,o]}const Aa=({path:n,nest:e,match:t,...i})=>{const r=yc(),[o]=pm(r),[a,u,f]=t??mE(r.parser,n,o,e),d=S3({...v3(),...u});if(!a)return null;const m=f?E.createElement(pE,{base:f},a2(i,d)):a2(i,d);return E.createElement(hE.Provider,{value:d,children:m})};E.forwardRef((n,e)=>{const t=yc(),[i,r]=pm(t),{to:o="",href:a=o,onClick:u,asChild:f,children:d,className:m,replace:p,state:b,transition:v,...S}=n,w=kb(C=>{C.ctrlKey||C.metaKey||C.altKey||C.shiftKey||C.button!==0||(u==null||u(C),C.defaultPrevented||(C.preventDefault(),r(a,n)))}),A=t.hrefs(a[0]==="~"?a.slice(1):t.base+a,t);return f&&E.isValidElement(d)?E.cloneElement(d,{onClick:w,href:A}):E.createElement("a",{...S,onClick:w,href:A,className:m!=null&&m.call?m(i===a):m,children:d,ref:e})});const yE=n=>Array.isArray(n)?n.flatMap(e=>yE(e&&e.type===E.Fragment?e.props.children:e)):[n],w3=({children:n,location:e})=>{const t=yc(),[i]=pm(t);for(const r of yE(n)){let o=0;if(E.isValidElement(r)&&(o=mE(t.parser,r.props.path,e||i,r.props.nest))[0])return E.cloneElement(r,{match:o})}return null},Ru={v:[]},c2=()=>Ru.v.forEach(n=>n()),k3=n=>(Ru.v.push(n)===1&&addEventListener("hashchange",c2),()=>{Ru.v=Ru.v.filter(e=>e!==n),Ru.v.length||removeEventListener("hashchange",c2)}),C3=()=>"/"+location.hash.replace(/^#?\/?/,""),E3=(n,{state:e=null,replace:t=!1}={})=>{const i=location.href,[r,o]=n.replace(/^#?\/?/,"").split("?"),a=new URL(location.href);a.hash=`/${r}`,o&&(a.search=o);const u=a.href;t?history.replaceState(e,"",u):history.pushState(e,"",u);const f=typeof HashChangeEvent<"u"?new HashChangeEvent("hashchange",{oldURL:i,newURL:u}):new Event("hashchange",{detail:{oldURL:i,newURL:u}});dispatchEvent(f)},bE=({ssrPath:n="/"}={})=>[wb.useSyncExternalStore(k3,C3,()=>n),E3];bE.hrefs=n=>"#"+n;/**
|
|
58
|
+
* @license lucide-react v1.23.0 - ISC
|
|
59
|
+
*
|
|
60
|
+
* This source code is licensed under the ISC license.
|
|
61
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
62
|
+
*/const vE=(...n)=>n.filter((e,t,i)=>!!e&&e.trim()!==""&&i.indexOf(e)===t).join(" ").trim();/**
|
|
63
|
+
* @license lucide-react v1.23.0 - ISC
|
|
64
|
+
*
|
|
65
|
+
* This source code is licensed under the ISC license.
|
|
66
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
67
|
+
*/const A3=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
68
|
+
* @license lucide-react v1.23.0 - ISC
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the ISC license.
|
|
71
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/const T3=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,i)=>i?i.toUpperCase():t.toLowerCase());/**
|
|
73
|
+
* @license lucide-react v1.23.0 - ISC
|
|
74
|
+
*
|
|
75
|
+
* This source code is licensed under the ISC license.
|
|
76
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
77
|
+
*/const u2=n=>{const e=T3(n);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
78
|
+
* @license lucide-react v1.23.0 - ISC
|
|
79
|
+
*
|
|
80
|
+
* This source code is licensed under the ISC license.
|
|
81
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
82
|
+
*/var l0={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
|
|
83
|
+
* @license lucide-react v1.23.0 - ISC
|
|
84
|
+
*
|
|
85
|
+
* This source code is licensed under the ISC license.
|
|
86
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
87
|
+
*/const R3=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1},M3=E.createContext({}),O3=()=>E.useContext(M3),N3=E.forwardRef(({color:n,size:e,strokeWidth:t,absoluteStrokeWidth:i,className:r="",children:o,iconNode:a,...u},f)=>{const{size:d=24,strokeWidth:m=2,absoluteStrokeWidth:p=!1,color:b="currentColor",className:v=""}=O3()??{},S=i??p?Number(t??m)*24/Number(e??d):t??m;return E.createElement("svg",{ref:f,...l0,width:e??d??l0.width,height:e??d??l0.height,stroke:n??b,strokeWidth:S,className:vE("lucide",v,r),...!o&&!R3(u)&&{"aria-hidden":"true"},...u},[...a.map(([w,A])=>E.createElement(w,A)),...Array.isArray(o)?o:[o]])});/**
|
|
88
|
+
* @license lucide-react v1.23.0 - ISC
|
|
89
|
+
*
|
|
90
|
+
* This source code is licensed under the ISC license.
|
|
91
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
92
|
+
*/const Wt=(n,e)=>{const t=E.forwardRef(({className:i,...r},o)=>E.createElement(N3,{ref:o,iconNode:e,className:vE(`lucide-${A3(u2(n))}`,`lucide-${n}`,i),...r}));return t.displayName=u2(n),t};/**
|
|
93
|
+
* @license lucide-react v1.23.0 - ISC
|
|
94
|
+
*
|
|
95
|
+
* This source code is licensed under the ISC license.
|
|
96
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
97
|
+
*/const D3=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],xE=Wt("check",D3);/**
|
|
98
|
+
* @license lucide-react v1.23.0 - ISC
|
|
99
|
+
*
|
|
100
|
+
* This source code is licensed under the ISC license.
|
|
101
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
102
|
+
*/const j3=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],L3=Wt("chevron-down",j3);/**
|
|
103
|
+
* @license lucide-react v1.23.0 - ISC
|
|
104
|
+
*
|
|
105
|
+
* This source code is licensed under the ISC license.
|
|
106
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
107
|
+
*/const B3=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Nb=Wt("chevron-right",B3);/**
|
|
108
|
+
* @license lucide-react v1.23.0 - ISC
|
|
109
|
+
*
|
|
110
|
+
* This source code is licensed under the ISC license.
|
|
111
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
112
|
+
*/const z3=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],P3=Wt("chevrons-up-down",z3);/**
|
|
113
|
+
* @license lucide-react v1.23.0 - ISC
|
|
114
|
+
*
|
|
115
|
+
* This source code is licensed under the ISC license.
|
|
116
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
117
|
+
*/const I3=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],H3=Wt("copy",I3);/**
|
|
118
|
+
* @license lucide-react v1.23.0 - ISC
|
|
119
|
+
*
|
|
120
|
+
* This source code is licensed under the ISC license.
|
|
121
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
122
|
+
*/const _3=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],U3=Wt("download",_3);/**
|
|
123
|
+
* @license lucide-react v1.23.0 - ISC
|
|
124
|
+
*
|
|
125
|
+
* This source code is licensed under the ISC license.
|
|
126
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
127
|
+
*/const V3=[["path",{d:"M21 21H8a2 2 0 0 1-1.42-.587l-3.994-3.999a2 2 0 0 1 0-2.828l10-10a2 2 0 0 1 2.829 0l5.999 6a2 2 0 0 1 0 2.828L12.834 21",key:"g5wo59"}],["path",{d:"m5.082 11.09 8.828 8.828",key:"1wx5vj"}]],q3=Wt("eraser",V3);/**
|
|
128
|
+
* @license lucide-react v1.23.0 - ISC
|
|
129
|
+
*
|
|
130
|
+
* This source code is licensed under the ISC license.
|
|
131
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
132
|
+
*/const F3=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],G3=Wt("external-link",F3);/**
|
|
133
|
+
* @license lucide-react v1.23.0 - ISC
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the ISC license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/const K3=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],Y3=Wt("lock",K3);/**
|
|
138
|
+
* @license lucide-react v1.23.0 - ISC
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the ISC license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const Q3=[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]],W3=Wt("monitor",Q3);/**
|
|
143
|
+
* @license lucide-react v1.23.0 - ISC
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the ISC license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/const X3=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],$3=Wt("moon",X3);/**
|
|
148
|
+
* @license lucide-react v1.23.0 - ISC
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the ISC license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/const Z3=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],J3=Wt("pen-line",Z3);/**
|
|
153
|
+
* @license lucide-react v1.23.0 - ISC
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the ISC license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/const ej=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],tj=Wt("pencil",ej);/**
|
|
158
|
+
* @license lucide-react v1.23.0 - ISC
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the ISC license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/const nj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ij=Wt("plus",nj);/**
|
|
163
|
+
* @license lucide-react v1.23.0 - ISC
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the ISC license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/const sj=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],rj=Wt("refresh-cw",sj);/**
|
|
168
|
+
* @license lucide-react v1.23.0 - ISC
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the ISC license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/const lj=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],f2=Wt("rotate-ccw",lj);/**
|
|
173
|
+
* @license lucide-react v1.23.0 - ISC
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the ISC license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/const oj=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],aj=Wt("search",oj);/**
|
|
178
|
+
* @license lucide-react v1.23.0 - ISC
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the ISC license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/const cj=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],uj=Wt("shield-alert",cj);/**
|
|
183
|
+
* @license lucide-react v1.23.0 - ISC
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the ISC license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/const fj=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Bd=Wt("shield-check",fj);/**
|
|
188
|
+
* @license lucide-react v1.23.0 - ISC
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the ISC license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/const hj=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}],["path",{d:"M12 17h.01",key:"p32p05"}]],dj=Wt("shield-question-mark",hj);/**
|
|
193
|
+
* @license lucide-react v1.23.0 - ISC
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the ISC license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/const mj=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],pj=Wt("sun",mj);/**
|
|
198
|
+
* @license lucide-react v1.23.0 - ISC
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the ISC license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/const gj=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],yj=Wt("trash-2",gj);/**
|
|
203
|
+
* @license lucide-react v1.23.0 - ISC
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the ISC license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/const bj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],gm=Wt("x",bj);class Bo extends Error{constructor(e,t){super(t.error),this.status=e,this.body=t,this.name="AuditApiError"}}let vj="same-origin",xj=(n,e)=>fetch(n,e),ay=null;function Sj(n){ay=n}async function SE(n,e){const t=await xj(n,{credentials:vj,...e,headers:{"Content-Type":"application/json",...ay?{Authorization:`Bearer ${ay}`}:{},...(e==null?void 0:e.headers)??{}}});if(!t.ok){let i;try{i=await t.json()}catch{i={status:t.status,error:t.statusText}}throw new Bo(t.status,{...i,status:t.status})}return t}async function ii(n,e){const i=await(await SE(n,e)).text();if(i)return JSON.parse(i)}const Al=n=>`api/tenants/${encodeURIComponent(n)}`,ym=n=>{const e=new URLSearchParams;for(const[i,r]of Object.entries(n))r!==void 0&&r!==""&&e.set(i,String(r));const t=e.toString();return t?`?${t}`:""};function wj(){return ii("config")}function kj(){return ii("api/overview")}function Db(){return ii("api/tenants")}function Cj(n){return ii(Al(n))}function Ej(n,e,t={}){const i=n?`${Al(n)}/events`:"api/events";return ii(`${i}${ym({...e,...t})}`)}function Aj(n,e){return ii(`${Al(n)}/events/${encodeURIComponent(e)}`)}function Tj(n,e,t){return ii(`${Al(n)}/events/${encodeURIComponent(e)}/erase`,{method:"POST",body:JSON.stringify(t)})}async function Rj(n,e,t){const i=await SE(`${Al(n)}/export${ym({...t,format:e})}`);return{blob:await i.blob(),contentDisposition:i.headers.get("content-disposition")}}function wE(n,e={}){return ii(`${Al(n)}/verify${ym(e)}`)}function jb(n){return ii(`${Al(n)}/checkpoints`)}function Mj(n){return ii(`${Al(n)}/checkpoints`,{method:"POST"})}const Oj=()=>"api/integrity/keys";function kE(){return ii("api/actions")}function Nj(n,e){return ii(`api/actions/${encodeURIComponent(n)}`,{method:"PUT",body:JSON.stringify(e)})}function Dj(n){return ii(`api/actions/${encodeURIComponent(n)}`,{method:"DELETE"})}function jj(){return ii("api/streams")}function Lj(n,e){return ii(`api/streams/${encodeURIComponent(n)}/retry${ym({tenant:e})}`,{method:"POST"})}const CE="xtandard-audit:theme",EE="(prefers-color-scheme: dark)",cy=new Set;function uy(){try{const n=localStorage.getItem(CE);if(n==="light"||n==="dark"||n==="system")return n}catch{}return"system"}function Bj(){return typeof matchMedia<"u"&&matchMedia(EE).matches}function zj(n){return n==="system"?Bj()?"dark":"light":n}function Pj(n){try{localStorage.setItem(CE,n)}catch{}for(const e of cy)e(n)}function Ij(n){return cy.add(n),()=>cy.delete(n)}function Hj(n){if(typeof matchMedia>"u")return()=>{};const e=matchMedia(EE);return e.addEventListener("change",n),()=>e.removeEventListener("change",n)}function o0(n){typeof document<"u"&&(document.documentElement.dataset.theme=zj(n))}function _j(){o0(uy()),Ij(o0),Hj(()=>{uy()==="system"&&o0("system")})}function AE(n){var e,t,i="";if(typeof n=="string"||typeof n=="number")i+=n;else if(typeof n=="object")if(Array.isArray(n)){var r=n.length;for(e=0;e<r;e++)n[e]&&(t=AE(n[e]))&&(i&&(i+=" "),i+=t)}else for(t in n)n[t]&&(i&&(i+=" "),i+=t);return i}function Uj(){for(var n,e,t=0,i="",r=arguments.length;t<r;t++)(n=arguments[t])&&(e=AE(n))&&(i&&(i+=" "),i+=e);return i}const Vj=(n,e)=>{const t=new Array(n.length+e.length);for(let i=0;i<n.length;i++)t[i]=n[i];for(let i=0;i<e.length;i++)t[n.length+i]=e[i];return t},qj=(n,e)=>({classGroupId:n,validator:e}),TE=(n=new Map,e=null,t)=>({nextPart:n,validators:e,classGroupId:t}),zd="-",h2=[],Fj="arbitrary..",Gj=n=>{const e=Yj(n),{conflictingClassGroups:t,conflictingClassGroupModifiers:i}=n;return{getClassGroupId:a=>{if(a.startsWith("[")&&a.endsWith("]"))return Kj(a);const u=a.split(zd),f=u[0]===""&&u.length>1?1:0;return RE(u,f,e)},getConflictingClassGroupIds:(a,u)=>{if(u){const f=i[a],d=t[a];return f?d?Vj(d,f):f:d||h2}return t[a]||h2}}},RE=(n,e,t)=>{if(n.length-e===0)return t.classGroupId;const r=n[e],o=t.nextPart.get(r);if(o){const d=RE(n,e+1,o);if(d)return d}const a=t.validators;if(a===null)return;const u=e===0?n.join(zd):n.slice(e).join(zd),f=a.length;for(let d=0;d<f;d++){const m=a[d];if(m.validator(u))return m.classGroupId}},Kj=n=>n.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=n.slice(1,-1),t=e.indexOf(":"),i=e.slice(0,t);return i?Fj+i:void 0})(),Yj=n=>{const{theme:e,classGroups:t}=n;return Qj(t,e)},Qj=(n,e)=>{const t=TE();for(const i in n){const r=n[i];Lb(r,t,i,e)}return t},Lb=(n,e,t,i)=>{const r=n.length;for(let o=0;o<r;o++){const a=n[o];Wj(a,e,t,i)}},Wj=(n,e,t,i)=>{if(typeof n=="string"){Xj(n,e,t);return}if(typeof n=="function"){$j(n,e,t,i);return}Zj(n,e,t,i)},Xj=(n,e,t)=>{const i=n===""?e:ME(e,n);i.classGroupId=t},$j=(n,e,t,i)=>{if(Jj(n)){Lb(n(i),e,t,i);return}e.validators===null&&(e.validators=[]),e.validators.push(qj(t,n))},Zj=(n,e,t,i)=>{const r=Object.entries(n),o=r.length;for(let a=0;a<o;a++){const[u,f]=r[a];Lb(f,ME(e,u),t,i)}},ME=(n,e)=>{let t=n;const i=e.split(zd),r=i.length;for(let o=0;o<r;o++){const a=i[o];let u=t.nextPart.get(a);u||(u=TE(),t.nextPart.set(a,u)),t=u}return t},Jj=n=>"isThemeGetter"in n&&n.isThemeGetter===!0,e4=n=>{if(n<1)return{get:()=>{},set:()=>{}};let e=0,t=Object.create(null),i=Object.create(null);const r=(o,a)=>{t[o]=a,e++,e>n&&(e=0,i=t,t=Object.create(null))};return{get(o){let a=t[o];if(a!==void 0)return a;if((a=i[o])!==void 0)return r(o,a),a},set(o,a){o in t?t[o]=a:r(o,a)}}},fy="!",d2=":",t4=[],m2=(n,e,t,i,r)=>({modifiers:n,hasImportantModifier:e,baseClassName:t,maybePostfixModifierPosition:i,isExternal:r}),n4=n=>{const{prefix:e,experimentalParseClassName:t}=n;let i=r=>{const o=[];let a=0,u=0,f=0,d;const m=r.length;for(let w=0;w<m;w++){const A=r[w];if(a===0&&u===0){if(A===d2){o.push(r.slice(f,w)),f=w+1;continue}if(A==="/"){d=w;continue}}A==="["?a++:A==="]"?a--:A==="("?u++:A===")"&&u--}const p=o.length===0?r:r.slice(f);let b=p,v=!1;p.endsWith(fy)?(b=p.slice(0,-1),v=!0):p.startsWith(fy)&&(b=p.slice(1),v=!0);const S=d&&d>f?d-f:void 0;return m2(o,v,b,S)};if(e){const r=e+d2,o=i;i=a=>a.startsWith(r)?o(a.slice(r.length)):m2(t4,!1,a,void 0,!0)}if(t){const r=i;i=o=>t({className:o,parseClassName:r})}return i},i4=n=>{const e=new Map;return n.orderSensitiveModifiers.forEach((t,i)=>{e.set(t,1e6+i)}),t=>{const i=[];let r=[];for(let o=0;o<t.length;o++){const a=t[o],u=a[0]==="[",f=e.has(a);u||f?(r.length>0&&(r.sort(),i.push(...r),r=[]),i.push(a)):r.push(a)}return r.length>0&&(r.sort(),i.push(...r)),i}},s4=n=>({cache:e4(n.cacheSize),parseClassName:n4(n),sortModifiers:i4(n),postfixLookupClassGroupIds:r4(n),...Gj(n)}),r4=n=>{const e=Object.create(null),t=n.postfixLookupClassGroups;if(t)for(let i=0;i<t.length;i++)e[t[i]]=!0;return e},l4=/\s+/,o4=(n,e)=>{const{parseClassName:t,getClassGroupId:i,getConflictingClassGroupIds:r,sortModifiers:o,postfixLookupClassGroupIds:a}=e,u=[],f=n.trim().split(l4);let d="";for(let m=f.length-1;m>=0;m-=1){const p=f[m],{isExternal:b,modifiers:v,hasImportantModifier:S,baseClassName:w,maybePostfixModifierPosition:A}=t(p);if(b){d=p+(d.length>0?" "+d:d);continue}let C=!!A,T;if(C){const D=w.substring(0,A);T=i(D);const j=T&&a[T]?i(w):void 0;j&&j!==T&&(T=j,C=!1)}else T=i(w);if(!T){if(!C){d=p+(d.length>0?" "+d:d);continue}if(T=i(w),!T){d=p+(d.length>0?" "+d:d);continue}C=!1}const R=v.length===0?"":v.length===1?v[0]:o(v).join(":"),N=S?R+fy:R,O=N+T;if(u.indexOf(O)>-1)continue;u.push(O);const z=r(T,C);for(let D=0;D<z.length;++D){const j=z[D];u.push(N+j)}d=p+(d.length>0?" "+d:d)}return d},a4=(...n)=>{let e=0,t,i,r="";for(;e<n.length;)(t=n[e++])&&(i=OE(t))&&(r&&(r+=" "),r+=i);return r},OE=n=>{if(typeof n=="string")return n;let e,t="";for(let i=0;i<n.length;i++)n[i]&&(e=OE(n[i]))&&(t&&(t+=" "),t+=e);return t},c4=(n,...e)=>{let t,i,r,o;const a=f=>{const d=e.reduce((m,p)=>p(m),n());return t=s4(d),i=t.cache.get,r=t.cache.set,o=u,u(f)},u=f=>{const d=i(f);if(d)return d;const m=o4(f,t);return r(f,m),m};return o=a,(...f)=>o(a4(...f))},u4=[],kn=n=>{const e=t=>t[n]||u4;return e.isThemeGetter=!0,e},NE=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,DE=/^\((?:(\w[\w-]*):)?(.+)\)$/i,f4=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,h4=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,d4=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,m4=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,p4=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,g4=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Xr=n=>f4.test(n),st=n=>!!n&&!Number.isNaN(Number(n)),xs=n=>!!n&&Number.isInteger(Number(n)),a0=n=>n.endsWith("%")&&st(n.slice(0,-1)),ur=n=>h4.test(n),jE=()=>!0,y4=n=>d4.test(n)&&!m4.test(n),Bb=()=>!1,b4=n=>p4.test(n),v4=n=>g4.test(n),x4=n=>!je(n)&&!Be(n),S4=n=>n.startsWith("@container")&&(n[10]==="/"&&n[11]!==void 0||n[11]==="s"&&n[16]!==void 0&&n.startsWith("-size/",10)||n[11]==="n"&&n[18]!==void 0&&n.startsWith("-normal/",10)),w4=n=>Tl(n,zE,Bb),je=n=>NE.test(n),Jl=n=>Tl(n,PE,y4),p2=n=>Tl(n,O4,st),k4=n=>Tl(n,HE,jE),C4=n=>Tl(n,IE,Bb),g2=n=>Tl(n,LE,Bb),E4=n=>Tl(n,BE,v4),Vh=n=>Tl(n,_E,b4),Be=n=>DE.test(n),vu=n=>zo(n,PE),A4=n=>zo(n,IE),y2=n=>zo(n,LE),T4=n=>zo(n,zE),R4=n=>zo(n,BE),qh=n=>zo(n,_E,!0),M4=n=>zo(n,HE,!0),Tl=(n,e,t)=>{const i=NE.exec(n);return i?i[1]?e(i[1]):t(i[2]):!1},zo=(n,e,t=!1)=>{const i=DE.exec(n);return i?i[1]?e(i[1]):t:!1},LE=n=>n==="position"||n==="percentage",BE=n=>n==="image"||n==="url",zE=n=>n==="length"||n==="size"||n==="bg-size",PE=n=>n==="length",O4=n=>n==="number",IE=n=>n==="family-name",HE=n=>n==="number"||n==="weight",_E=n=>n==="shadow",N4=()=>{const n=kn("color"),e=kn("font"),t=kn("text"),i=kn("font-weight"),r=kn("tracking"),o=kn("leading"),a=kn("breakpoint"),u=kn("container"),f=kn("spacing"),d=kn("radius"),m=kn("shadow"),p=kn("inset-shadow"),b=kn("text-shadow"),v=kn("drop-shadow"),S=kn("blur"),w=kn("perspective"),A=kn("aspect"),C=kn("ease"),T=kn("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],N=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...N(),Be,je],z=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],j=()=>[Be,je,f],B=()=>[Xr,"full","auto",...j()],K=()=>[xs,"none","subgrid",Be,je],F=()=>["auto",{span:["full",xs,Be,je]},xs,Be,je],Y=()=>[xs,"auto",Be,je],V=()=>["auto","min","max","fr",Be,je],Z=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],q=()=>["start","end","center","stretch","center-safe","end-safe"],P=()=>["auto",...j()],W=()=>[Xr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...j()],U=()=>[Xr,"screen","full","dvw","lvw","svw","min","max","fit",...j()],$=()=>[Xr,"screen","full","lh","dvh","lvh","svh","min","max","fit",...j()],Q=()=>[n,Be,je],L=()=>[...N(),y2,g2,{position:[Be,je]}],_=()=>["no-repeat",{repeat:["","x","y","space","round"]}],J=()=>["auto","cover","contain",T4,w4,{size:[Be,je]}],le=()=>[a0,vu,Jl],ae=()=>["","none","full",d,Be,je],ee=()=>["",st,vu,Jl],se=()=>["solid","dashed","dotted","double"],fe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],me=()=>[st,a0,y2,g2],Ne=()=>["","none",S,Be,je],oe=()=>["none",st,Be,je],xe=()=>["none",st,Be,je],Se=()=>[st,Be,je],Ge=()=>[Xr,"full",...j()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[ur],breakpoint:[ur],color:[jE],container:[ur],"drop-shadow":[ur],ease:["in","out","in-out"],font:[x4],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[ur],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[ur],shadow:[ur],spacing:["px",st],text:[ur],"text-shadow":[ur],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Xr,je,Be,A]}],container:["container"],"container-type":[{"@container":["","normal","size",Be,je]}],"container-named":[S4],columns:[{columns:[st,je,Be,u]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:B()}],"inset-x":[{"inset-x":B()}],"inset-y":[{"inset-y":B()}],start:[{"inset-s":B(),start:B()}],end:[{"inset-e":B(),end:B()}],"inset-bs":[{"inset-bs":B()}],"inset-be":[{"inset-be":B()}],top:[{top:B()}],right:[{right:B()}],bottom:[{bottom:B()}],left:[{left:B()}],visibility:["visible","invisible","collapse"],z:[{z:[xs,"auto",Be,je]}],basis:[{basis:[Xr,"full","auto",u,...j()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[st,Xr,"auto","initial","none",je]}],grow:[{grow:["",st,Be,je]}],shrink:[{shrink:["",st,Be,je]}],order:[{order:[xs,"first","last","none",Be,je]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:F()}],"col-start":[{"col-start":Y()}],"col-end":[{"col-end":Y()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:F()}],"row-start":[{"row-start":Y()}],"row-end":[{"row-end":Y()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:j()}],"gap-x":[{"gap-x":j()}],"gap-y":[{"gap-y":j()}],"justify-content":[{justify:[...Z(),"normal"]}],"justify-items":[{"justify-items":[...q(),"normal"]}],"justify-self":[{"justify-self":["auto",...q()]}],"align-content":[{content:["normal",...Z()]}],"align-items":[{items:[...q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...q(),{baseline:["","last"]}]}],"place-content":[{"place-content":Z()}],"place-items":[{"place-items":[...q(),"baseline"]}],"place-self":[{"place-self":["auto",...q()]}],p:[{p:j()}],px:[{px:j()}],py:[{py:j()}],ps:[{ps:j()}],pe:[{pe:j()}],pbs:[{pbs:j()}],pbe:[{pbe:j()}],pt:[{pt:j()}],pr:[{pr:j()}],pb:[{pb:j()}],pl:[{pl:j()}],m:[{m:P()}],mx:[{mx:P()}],my:[{my:P()}],ms:[{ms:P()}],me:[{me:P()}],mbs:[{mbs:P()}],mbe:[{mbe:P()}],mt:[{mt:P()}],mr:[{mr:P()}],mb:[{mb:P()}],ml:[{ml:P()}],"space-x":[{"space-x":j()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":j()}],"space-y-reverse":["space-y-reverse"],size:[{size:W()}],"inline-size":[{inline:["auto",...U()]}],"min-inline-size":[{"min-inline":["auto",...U()]}],"max-inline-size":[{"max-inline":["none",...U()]}],"block-size":[{block:["auto",...$()]}],"min-block-size":[{"min-block":["auto",...$()]}],"max-block-size":[{"max-block":["none",...$()]}],w:[{w:[u,"screen",...W()]}],"min-w":[{"min-w":[u,"screen","none",...W()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[a]},...W()]}],h:[{h:["screen","lh",...W()]}],"min-h":[{"min-h":["screen","lh","none",...W()]}],"max-h":[{"max-h":["screen","lh",...W()]}],"font-size":[{text:["base",t,vu,Jl]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,M4,k4]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",a0,je]}],"font-family":[{font:[A4,C4,e]}],"font-features":[{"font-features":[je]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,Be,je]}],"line-clamp":[{"line-clamp":[st,"none",Be,p2]}],leading:[{leading:[o,...j()]}],"list-image":[{"list-image":["none",Be,je]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Be,je]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:Q()}],"text-color":[{text:Q()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...se(),"wavy"]}],"text-decoration-thickness":[{decoration:[st,"from-font","auto",Be,Jl]}],"text-decoration-color":[{decoration:Q()}],"underline-offset":[{"underline-offset":[st,"auto",Be,je]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"tab-size":[{tab:[xs,Be,je]}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Be,je]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Be,je]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:_()}],"bg-size":[{bg:J()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},xs,Be,je],radial:["",Be,je],conic:[xs,Be,je]},R4,E4]}],"bg-color":[{bg:Q()}],"gradient-from-pos":[{from:le()}],"gradient-via-pos":[{via:le()}],"gradient-to-pos":[{to:le()}],"gradient-from":[{from:Q()}],"gradient-via":[{via:Q()}],"gradient-to":[{to:Q()}],rounded:[{rounded:ae()}],"rounded-s":[{"rounded-s":ae()}],"rounded-e":[{"rounded-e":ae()}],"rounded-t":[{"rounded-t":ae()}],"rounded-r":[{"rounded-r":ae()}],"rounded-b":[{"rounded-b":ae()}],"rounded-l":[{"rounded-l":ae()}],"rounded-ss":[{"rounded-ss":ae()}],"rounded-se":[{"rounded-se":ae()}],"rounded-ee":[{"rounded-ee":ae()}],"rounded-es":[{"rounded-es":ae()}],"rounded-tl":[{"rounded-tl":ae()}],"rounded-tr":[{"rounded-tr":ae()}],"rounded-br":[{"rounded-br":ae()}],"rounded-bl":[{"rounded-bl":ae()}],"border-w":[{border:ee()}],"border-w-x":[{"border-x":ee()}],"border-w-y":[{"border-y":ee()}],"border-w-s":[{"border-s":ee()}],"border-w-e":[{"border-e":ee()}],"border-w-bs":[{"border-bs":ee()}],"border-w-be":[{"border-be":ee()}],"border-w-t":[{"border-t":ee()}],"border-w-r":[{"border-r":ee()}],"border-w-b":[{"border-b":ee()}],"border-w-l":[{"border-l":ee()}],"divide-x":[{"divide-x":ee()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":ee()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...se(),"hidden","none"]}],"divide-style":[{divide:[...se(),"hidden","none"]}],"border-color":[{border:Q()}],"border-color-x":[{"border-x":Q()}],"border-color-y":[{"border-y":Q()}],"border-color-s":[{"border-s":Q()}],"border-color-e":[{"border-e":Q()}],"border-color-bs":[{"border-bs":Q()}],"border-color-be":[{"border-be":Q()}],"border-color-t":[{"border-t":Q()}],"border-color-r":[{"border-r":Q()}],"border-color-b":[{"border-b":Q()}],"border-color-l":[{"border-l":Q()}],"divide-color":[{divide:Q()}],"outline-style":[{outline:[...se(),"none","hidden"]}],"outline-offset":[{"outline-offset":[st,Be,je]}],"outline-w":[{outline:["",st,vu,Jl]}],"outline-color":[{outline:Q()}],shadow:[{shadow:["","none",m,qh,Vh]}],"shadow-color":[{shadow:Q()}],"inset-shadow":[{"inset-shadow":["none",p,qh,Vh]}],"inset-shadow-color":[{"inset-shadow":Q()}],"ring-w":[{ring:ee()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:Q()}],"ring-offset-w":[{"ring-offset":[st,Jl]}],"ring-offset-color":[{"ring-offset":Q()}],"inset-ring-w":[{"inset-ring":ee()}],"inset-ring-color":[{"inset-ring":Q()}],"text-shadow":[{"text-shadow":["none",b,qh,Vh]}],"text-shadow-color":[{"text-shadow":Q()}],opacity:[{opacity:[st,Be,je]}],"mix-blend":[{"mix-blend":[...fe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":fe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[st]}],"mask-image-linear-from-pos":[{"mask-linear-from":me()}],"mask-image-linear-to-pos":[{"mask-linear-to":me()}],"mask-image-linear-from-color":[{"mask-linear-from":Q()}],"mask-image-linear-to-color":[{"mask-linear-to":Q()}],"mask-image-t-from-pos":[{"mask-t-from":me()}],"mask-image-t-to-pos":[{"mask-t-to":me()}],"mask-image-t-from-color":[{"mask-t-from":Q()}],"mask-image-t-to-color":[{"mask-t-to":Q()}],"mask-image-r-from-pos":[{"mask-r-from":me()}],"mask-image-r-to-pos":[{"mask-r-to":me()}],"mask-image-r-from-color":[{"mask-r-from":Q()}],"mask-image-r-to-color":[{"mask-r-to":Q()}],"mask-image-b-from-pos":[{"mask-b-from":me()}],"mask-image-b-to-pos":[{"mask-b-to":me()}],"mask-image-b-from-color":[{"mask-b-from":Q()}],"mask-image-b-to-color":[{"mask-b-to":Q()}],"mask-image-l-from-pos":[{"mask-l-from":me()}],"mask-image-l-to-pos":[{"mask-l-to":me()}],"mask-image-l-from-color":[{"mask-l-from":Q()}],"mask-image-l-to-color":[{"mask-l-to":Q()}],"mask-image-x-from-pos":[{"mask-x-from":me()}],"mask-image-x-to-pos":[{"mask-x-to":me()}],"mask-image-x-from-color":[{"mask-x-from":Q()}],"mask-image-x-to-color":[{"mask-x-to":Q()}],"mask-image-y-from-pos":[{"mask-y-from":me()}],"mask-image-y-to-pos":[{"mask-y-to":me()}],"mask-image-y-from-color":[{"mask-y-from":Q()}],"mask-image-y-to-color":[{"mask-y-to":Q()}],"mask-image-radial":[{"mask-radial":[Be,je]}],"mask-image-radial-from-pos":[{"mask-radial-from":me()}],"mask-image-radial-to-pos":[{"mask-radial-to":me()}],"mask-image-radial-from-color":[{"mask-radial-from":Q()}],"mask-image-radial-to-color":[{"mask-radial-to":Q()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":N()}],"mask-image-conic-pos":[{"mask-conic":[st]}],"mask-image-conic-from-pos":[{"mask-conic-from":me()}],"mask-image-conic-to-pos":[{"mask-conic-to":me()}],"mask-image-conic-from-color":[{"mask-conic-from":Q()}],"mask-image-conic-to-color":[{"mask-conic-to":Q()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:_()}],"mask-size":[{mask:J()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Be,je]}],filter:[{filter:["","none",Be,je]}],blur:[{blur:Ne()}],brightness:[{brightness:[st,Be,je]}],contrast:[{contrast:[st,Be,je]}],"drop-shadow":[{"drop-shadow":["","none",v,qh,Vh]}],"drop-shadow-color":[{"drop-shadow":Q()}],grayscale:[{grayscale:["",st,Be,je]}],"hue-rotate":[{"hue-rotate":[st,Be,je]}],invert:[{invert:["",st,Be,je]}],saturate:[{saturate:[st,Be,je]}],sepia:[{sepia:["",st,Be,je]}],"backdrop-filter":[{"backdrop-filter":["","none",Be,je]}],"backdrop-blur":[{"backdrop-blur":Ne()}],"backdrop-brightness":[{"backdrop-brightness":[st,Be,je]}],"backdrop-contrast":[{"backdrop-contrast":[st,Be,je]}],"backdrop-grayscale":[{"backdrop-grayscale":["",st,Be,je]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[st,Be,je]}],"backdrop-invert":[{"backdrop-invert":["",st,Be,je]}],"backdrop-opacity":[{"backdrop-opacity":[st,Be,je]}],"backdrop-saturate":[{"backdrop-saturate":[st,Be,je]}],"backdrop-sepia":[{"backdrop-sepia":["",st,Be,je]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":j()}],"border-spacing-x":[{"border-spacing-x":j()}],"border-spacing-y":[{"border-spacing-y":j()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Be,je]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[st,"initial",Be,je]}],ease:[{ease:["linear","initial",C,Be,je]}],delay:[{delay:[st,Be,je]}],animate:[{animate:["none",T,Be,je]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,Be,je]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:Se()}],"skew-x":[{"skew-x":Se()}],"skew-y":[{"skew-y":Se()}],transform:[{transform:[Be,je,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Ge()}],"translate-x":[{"translate-x":Ge()}],"translate-y":[{"translate-y":Ge()}],"translate-z":[{"translate-z":Ge()}],"translate-none":["translate-none"],zoom:[{zoom:[xs,Be,je]}],accent:[{accent:Q()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:Q()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Be,je]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scrollbar-thumb-color":[{"scrollbar-thumb":Q()}],"scrollbar-track-color":[{"scrollbar-track":Q()}],"scrollbar-gutter":[{"scrollbar-gutter":["auto","stable","both"]}],"scrollbar-w":[{scrollbar:["auto","thin","none"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mbs":[{"scroll-mbs":j()}],"scroll-mbe":[{"scroll-mbe":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pbs":[{"scroll-pbs":j()}],"scroll-pbe":[{"scroll-pbe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Be,je]}],fill:[{fill:["none",...Q()]}],"stroke-w":[{stroke:[st,vu,Jl,p2]}],stroke:[{stroke:["none",...Q()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{"container-named":["container-type"],overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},postfixLookupClassGroups:["container-type"],orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},D4=c4(N4);function bt(...n){return D4(Uj(n))}const j4=[{value:"system",label:"System theme",Icon:W3},{value:"light",label:"Light theme",Icon:pj},{value:"dark",label:"Dark theme",Icon:$3}];function L4(){const[n,e]=E.useState(()=>uy()),t=i=>{e(i),Pj(i)};return x.jsx("div",{role:"group","aria-label":"Theme",className:"inline-flex gap-0.5 rounded-md border border-border bg-secondary/50 p-0.5",children:j4.map(({value:i,label:r,Icon:o})=>{const a=n===i;return x.jsx("button",{type:"button",title:r,"aria-label":r,"aria-pressed":a,onClick:()=>t(i),className:bt("inline-flex h-6 w-7 items-center justify-center rounded-[5px] outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring",a?"bg-card text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:x.jsx(o,{className:"size-3.5"})},i)})})}function Pd({controlled:n,default:e,name:t,state:i="value"}){const{current:r}=E.useRef(n!==void 0),[o,a]=E.useState(e),u=r?n:o,f=E.useCallback(d=>{r||a(d)},[]);return[u,f]}const b2={};function pi(n,e){const t=E.useRef(b2);return t.current===b2&&(t.current=n(e)),t}const c0=Sb[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0,-3)],B4=c0&&c0!==E.useLayoutEffect?c0:n=>n();function Le(n){const e=pi(z4).current;return e.next=n,B4(e.effect),e.trampoline}function z4(){const n={next:void 0,callback:P4,trampoline:(...e)=>{var t;return(t=n.callback)==null?void 0:t.call(n,...e)},effect:()=>{n.callback=n.next}};return n}function P4(){}function Sr(n,e,t,i){const r=pi(UE).current;return H4(r,n,e,t,i)&&VE(r,[n,e,t,i]),r.callback}function I4(n){const e=pi(UE).current;return _4(e,n)&&VE(e,n),e.callback}function UE(){return{callback:null,cleanup:null,refs:[]}}function H4(n,e,t,i,r){return n.refs[0]!==e||n.refs[1]!==t||n.refs[2]!==i||n.refs[3]!==r}function _4(n,e){return n.refs.length!==e.length||n.refs.some((t,i)=>t!==e[i])}function VE(n,e){if(n.refs=e,e.every(t=>t==null)){n.callback=null;return}n.callback=t=>{if(n.cleanup&&(n.cleanup(),n.cleanup=null),t!=null){const i=Array(e.length).fill(null);for(let r=0;r<e.length;r+=1){const o=e[r];if(o!=null)switch(typeof o){case"function":{const a=o(t);typeof a=="function"&&(i[r]=a);break}case"object":{o.current=t;break}}}n.cleanup=()=>{for(let r=0;r<e.length;r+=1){const o=e[r];if(o!=null)switch(typeof o){case"function":{const a=i[r];typeof a=="function"?a():o(null);break}case"object":{o.current=null;break}}}}}}}const U4=()=>{},Pe=typeof document<"u"?E.useLayoutEffect:U4,zb={clip:"rect(0 0 0 0)",overflow:"hidden",whiteSpace:"nowrap",position:"fixed",top:0,left:0,border:0,padding:0,width:1,height:1,margin:-1};function Qn(n,...e){const t=new URL(`https://base-ui.com/production-error/${n}`);return e.forEach(i=>t.searchParams.append("args[]",i)),`Base UI error #${n}; visit ${t} for the full message.`}const V4=parseInt(E.version,10);function Pb(n){return V4>=n}function v2(n){if(!E.isValidElement(n))return null;const e=n,t=e.props;return(Pb(19)?t==null?void 0:t.ref:e.ref)??null}function hy(n,e){if(n&&!e)return n;if(!n&&e)return e;if(n||e)return{...n,...e}}function q4(n,e){const t={};for(const i in n){const r=n[i];if(e!=null&&e.hasOwnProperty(i)){const o=e[i](r);o!=null&&Object.assign(t,o);continue}r===!0?t[`data-${i.toLowerCase()}`]="":r&&(t[`data-${i.toLowerCase()}`]=r.toString())}return t}function F4(n,e){return typeof n=="function"?n(e):n}function G4(n,e){return typeof n=="function"?n(e):n}const Lu={};function hf(n,e,t,i,r){let o={...dy(n,Lu)};return e&&(o=Mu(o,e)),t&&(o=Mu(o,t)),i&&(o=Mu(o,i)),r&&(o=Mu(o,r)),o}function K4(n){if(n.length===0)return Lu;if(n.length===1)return dy(n[0],Lu);let e={...dy(n[0],Lu)};for(let t=1;t<n.length;t+=1)e=Mu(e,n[t]);return e}function Mu(n,e){return qE(e)?e(n):Y4(n,e)}function Y4(n,e){if(!e)return n;for(const t in e){const i=e[t];switch(t){case"style":{n[t]=hy(n.style,i);break}case"className":{n[t]=FE(n.className,i);break}default:Q4(t,i)?n[t]=W4(n[t],i):n[t]=i}}return n}function Q4(n,e){const t=n.charCodeAt(0),i=n.charCodeAt(1),r=n.charCodeAt(2);return t===111&&i===110&&r>=65&&r<=90&&(typeof e=="function"||typeof e>"u")}function qE(n){return typeof n=="function"}function dy(n,e){return qE(n)?n(e):n??Lu}function W4(n,e){return e?n?t=>{if(X4(t)){const r=t;my(r);const o=e(r);return r.baseUIHandlerPrevented||n==null||n(r),o}const i=e(t);return n==null||n(t),i}:e:n}function my(n){return n.preventBaseUIHandler=()=>{n.baseUIHandlerPrevented=!0},n}function FE(n,e){return e?n?e+" "+n:e:n}function X4(n){return n!=null&&typeof n=="object"&&"nativeEvent"in n}function Oi(){}const Sl=Object.freeze([]),cn=Object.freeze({}),$4=500,Z4=500,J4={style:{transition:"none"}},e5="data-base-ui-click-trigger",GE={fallbackAxisSide:"none"},t5={clipPath:"inset(50%)",position:"fixed",top:0,left:0};function dn(n,e,t={}){const i=e.render,r=n5(e,t);if(t.enabled===!1)return null;const o=t.state??cn;return i5(n,i,r,o)}function n5(n,e={}){const{className:t,style:i,render:r}=n,{state:o=cn,ref:a,props:u,stateAttributesMapping:f,enabled:d=!0}=e,m=d?F4(t,o):void 0,p=d?G4(i,o):void 0,b=d?q4(o,f):cn,v=d?hy(b,Array.isArray(u)?K4(u):u)??cn:cn;return typeof document<"u"&&(d?Array.isArray(a)?v.ref=I4([v.ref,v2(r),...a]):v.ref=Sr(v.ref,v2(r),a):Sr(null,null)),d?(m!==void 0&&(v.className=FE(v.className,m)),p!==void 0&&(v.style=hy(v.style,p)),v):cn}function i5(n,e,t,i){if(e){if(typeof e=="function")return e(t,i);const r=hf(t,e.props);return r.ref=t.ref,E.cloneElement(e,r)}if(n&&typeof n=="string")return s5(n,t);throw new Error(Qn(8))}function s5(n,e){return n==="button"?E.createElement("button",{type:"button",...e,key:e.key}):n==="img"?E.createElement("img",{alt:"",...e,key:e.key}):E.createElement(n,e)}const r5={...Sb};let x2=0;function l5(n,e="mui"){const[t,i]=E.useState(n),r=n||t;return E.useEffect(()=>{t==null&&(x2+=1,i(`${e}-${x2}`))},[t,e]),r}const S2=r5.useId;function Po(n,e){if(S2!==void 0){const t=S2();return n??(e?`${e}-${t}`:t)}return l5(n,e)}function bm(n){return Po(n,"base-ui")}function vm(){return typeof window<"u"}function Rl(n){return Ib(n)?(n.nodeName||"").toLowerCase():"#document"}function xn(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function qs(n){var e;return(e=(Ib(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Ib(n){return vm()?n instanceof Node||n instanceof xn(n).Node:!1}function Tt(n){return vm()?n instanceof Element||n instanceof xn(n).Element:!1}function Qt(n){return vm()?n instanceof HTMLElement||n instanceof xn(n).HTMLElement:!1}function py(n){return!vm()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof xn(n).ShadowRoot}function Io(n){const{overflow:e,overflowX:t,overflowY:i,display:r}=Bi(n);return/auto|scroll|overlay|hidden|clip/.test(e+i+t)&&r!=="inline"&&r!=="contents"}function o5(n){return/^(table|td|th)$/.test(Rl(n))}function xm(n){try{if(n.matches(":popover-open"))return!0}catch{}try{return n.matches(":modal")}catch{return!1}}const a5=/transform|translate|scale|rotate|perspective|filter/,c5=/paint|layout|strict|content/,eo=n=>!!n&&n!=="none";let u0;function Hb(n){const e=Tt(n)?Bi(n):n;return eo(e.transform)||eo(e.translate)||eo(e.scale)||eo(e.rotate)||eo(e.perspective)||!Sm()&&(eo(e.backdropFilter)||eo(e.filter))||a5.test(e.willChange||"")||c5.test(e.contain||"")}function u5(n){let e=Us(n);for(;Qt(e)&&!Ps(e);){if(Hb(e))return e;if(xm(e))return null;e=Us(e)}return null}function Sm(){return u0==null&&(u0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),u0}function Ps(n){return/^(html|body|#document)$/.test(Rl(n))}function Bi(n){return xn(n).getComputedStyle(n)}function wm(n){return Tt(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function Us(n){if(Rl(n)==="html")return n;const e=n.assignedSlot||n.parentNode||py(n)&&n.host||qs(n);return py(e)?e.host:e}function KE(n){const e=Us(n);return Ps(e)?n.ownerDocument?n.ownerDocument.body:n.body:Qt(e)&&Io(e)?e:KE(e)}function pl(n,e,t){var i;e===void 0&&(e=[]),t===void 0&&(t=!0);const r=KE(n),o=r===((i=n.ownerDocument)==null?void 0:i.body),a=xn(r);if(o){const u=gy(a);return e.concat(a,a.visualViewport||[],Io(r)?r:[],u&&t?pl(u):[])}else return e.concat(r,pl(r,[],t))}function gy(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}const YE=E.createContext(void 0);function _b(n=!1){const e=E.useContext(YE);if(e===void 0&&!n)throw new Error(Qn(16));return e}function f5(n){const{focusableWhenDisabled:e,disabled:t,composite:i=!1,tabIndex:r=0,isNativeButton:o}=n,a=i&&e!==!1,u=i&&e===!1;return{props:E.useMemo(()=>{const d={onKeyDown(m){t&&e&&m.key!=="Tab"&&m.preventDefault()}};return i||(d.tabIndex=r,!o&&t&&(d.tabIndex=e?r:-1)),(o&&(e||a)||!o&&t)&&(d["aria-disabled"]=t),o&&(!e||u)&&(d.disabled=t),d},[i,t,e,a,u,o,r])}}function bc(n={}){const{disabled:e=!1,focusableWhenDisabled:t,tabIndex:i=0,native:r=!0}=n,o=E.useRef(null),a=_b(!0)!==void 0,u=Le(()=>{const b=o.current;return!!((b==null?void 0:b.tagName)==="A"&&(b!=null&&b.href))}),{props:f}=f5({focusableWhenDisabled:t,disabled:e,composite:a,tabIndex:i,isNativeButton:r}),d=E.useCallback(()=>{const b=o.current;h5(b)&&a&&e&&f.disabled===void 0&&b.disabled&&(b.disabled=!1)},[e,f.disabled,a]);Pe(d,[d]);const m=E.useCallback((b={})=>{const{onClick:v,onMouseDown:S,onKeyUp:w,onKeyDown:A,onPointerDown:C,...T}=b;return hf({type:r?"button":void 0,onClick(N){if(e){N.preventDefault();return}v==null||v(N)},onMouseDown(N){e||S==null||S(N)},onKeyDown(N){if(e||(my(N),A==null||A(N)),N.baseUIHandlerPrevented)return;const O=N.target===N.currentTarget&&!r&&!u()&&!e,z=N.key==="Enter",D=N.key===" ";O&&((D||z)&&N.preventDefault(),z&&(v==null||v(N)))},onKeyUp(N){e||(my(N),w==null||w(N)),!N.baseUIHandlerPrevented&&N.target===N.currentTarget&&!r&&!e&&N.key===" "&&(v==null||v(N))},onPointerDown(N){if(e){N.preventDefault();return}C==null||C(N)}},r?void 0:{role:"button"},f,T)},[e,f,r,u]),p=Le(b=>{o.current=b,d()});return{getButtonProps:m,buttonRef:p}}function h5(n){return Qt(n)&&n.tagName==="BUTTON"}let w2=(function(n){return n.disabled="data-disabled",n.valid="data-valid",n.invalid="data-invalid",n.touched="data-touched",n.dirty="data-dirty",n.filled="data-filled",n.focused="data-focused",n})({});const d5={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},m5={valid(n){return n===null?null:n?{[w2.valid]:""}:{[w2.invalid]:""}}};var Zi=qC();function p5(n,e){return{...n,state:{...n.state,valid:!e&&n.state.valid}}}const g5=E.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Oi,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});function QE(){return E.useContext(g5)}const y5=E.createContext({invalid:void 0,name:void 0,validityData:{state:d5,errors:[],error:"",value:"",initialValue:null},setValidityData:Oi,disabled:void 0,touched:!1,setTouched:Oi,dirty:!1,setDirty:Oi,filled:!1,setFilled:Oi,focused:!1,setFocused:Oi,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(n=cn)=>n,getInputValidationProps:(n=cn)=>n,inputRef:{current:null},commit:async()=>{}}});function Ub(n=!0){const e=E.useContext(y5);if(e.setValidityData===Oi&&!n)throw new Error(Qn(28));return e}function b5(n){const{enabled:e=!0,value:t,id:i,name:r,controlRef:o,commit:a}=n,{formRef:u}=QE(),{invalid:f,markedDirtyRef:d,validityData:m,setValidityData:p}=Ub(),b=Le(n.getValue);Pe(()=>{if(!e)return;let v=t;v===void 0&&(v=b()),m.initialValue===null&&v!==null&&p(S=>({...S,initialValue:v}))},[e,p,t,m.initialValue,b]),Pe(()=>{!e||!i||u.current.fields.set(i,{getValue:b,name:r,controlRef:o,validityData:p5(m,f),validate(){let v=t;v===void 0&&(v=b()),d.current=!0,Zi.flushSync(()=>a(v))}})},[a,o,e,u,b,i,f,d,r,m,t]),Pe(()=>{const v=u.current.fields;return()=>{i&&v.delete(i)}},[u,i])}const v5=E.createContext({controlId:void 0,setControlId:Oi,labelId:void 0,setLabelId:Oi,messageIds:[],setMessageIds:Oi,getDescriptionProps:n=>n});function Vb(){return E.useContext(v5)}function x5(n={}){const{id:e,implicit:t=!1,controlRef:i}=n,{controlId:r,setControlId:o}=Vb(),a=bm(e);return Pe(()=>{if(!(!t&&!e||o===Oi)){if(t){const u=i==null?void 0:i.current;Tt(u)&&u.closest("label")!=null?o(e??null):o(r??a)}else e&&o(e);return()=>{e&&o(void 0)}}},[e,i,r,o,t,a]),r??a}const km="none",So="trigger-press",Ni="trigger-hover",Id="trigger-focus",qb="outside-press",Bu="item-press",S5="close-press",Ao="focus-out",Fb="escape-key",wd="list-navigation",WE="cancel-open",Ou="sibling-open",XE="imperative-action",w5="window-resize";function Je(n,e,t,i){let r=!1,o=!1;const a=cn;return{reason:n,event:e??new Event("base-ui"),cancel(){r=!0},allowPropagation(){o=!0},get isCanceled(){return r},get isPropagationAllowed(){return o},trigger:t,...a}}function k5(n,e){const t=E.useRef(n),i=Le(e);Pe(()=>{t.current!==n&&i(t.current)},[n,i]),Pe(()=>{t.current=n},[n])}function C5(n){const e=E.useRef(!0);e.current&&(e.current=!1,n())}function bn(n){const e=pi(E5,n).current;return e.next=n,Pe(e.effect),e}function E5(n){const e={current:n,next:n,effect:()=>{e.current=e.next}};return e}var Hd=Symbol("NOT_FOUND");function A5(n,e=`expected a function, instead received ${typeof n}`){if(typeof n!="function")throw new TypeError(e)}function T5(n,e="expected all items to be functions, instead received the following types: "){if(!n.every(t=>typeof t=="function")){const t=n.map(i=>typeof i=="function"?`function ${i.name||"unnamed"}()`:typeof i).join(", ");throw new TypeError(`${e}[${t}]`)}}var k2=n=>Array.isArray(n)?n:[n];function R5(n){const e=Array.isArray(n[0])?n[0]:n;return T5(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function M5(n,e){const t=[],{length:i}=n;for(let r=0;r<i;r++)t.push(n[r].apply(null,e));return t}function O5(n){let e;return{get(t){return e&&n(e.key,t)?e.value:Hd},put(t,i){e={key:t,value:i}},getEntries(){return e?[e]:[]},clear(){e=void 0}}}function N5(n,e){let t=[];function i(u){const f=t.findIndex(d=>e(u,d.key));if(f>-1){const d=t[f];return f>0&&(t.splice(f,1),t.unshift(d)),d.value}return Hd}function r(u,f){i(u)===Hd&&(t.unshift({key:u,value:f}),t.length>n&&t.pop())}function o(){return t}function a(){t=[]}return{get:i,put:r,getEntries:o,clear:a}}var D5=(n,e)=>n===e;function j5(n){return function(t,i){if(t===null||i===null||t.length!==i.length)return!1;const{length:r}=t;for(let o=0;o<r;o++)if(!n(t[o],i[o]))return!1;return!0}}function L5(n,e){const t=typeof e=="object"?e:{equalityCheck:e},{equalityCheck:i=D5,maxSize:r=1,resultEqualityCheck:o}=t,a=j5(i);let u=0;const f=r<=1?O5(a):N5(r,a);function d(){let m=f.get(arguments);if(m===Hd){if(m=n.apply(null,arguments),u++,o){const b=f.getEntries().find(v=>o(v.value,m));b&&(m=b.value,u!==0&&u--)}f.put(arguments,m)}return m}return d.clearCache=()=>{f.clear(),d.resetResultsCount()},d.resultsCount=()=>u,d.resetResultsCount=()=>{u=0},d}var B5=class{constructor(n){this.value=n}deref(){return this.value}},z5=()=>typeof WeakRef>"u"?B5:WeakRef,$E=z5(),P5=0,C2=1;function Fh(){return{s:P5,v:void 0,o:null,p:null}}function I5(n){return n instanceof $E?n.deref():n}function H5(n,e={}){let t=Fh();const{resultEqualityCheck:i}=e;let r,o=0;function a(){let u=t;const{length:f}=arguments;for(let p=0,b=f;p<b;p++){const v=arguments[p];if(typeof v=="function"||typeof v=="object"&&v!==null){let S=u.o;S===null&&(u.o=S=new WeakMap);const w=S.get(v);w===void 0?(u=Fh(),S.set(v,u)):u=w}else{let S=u.p;S===null&&(u.p=S=new Map);const w=S.get(v);w===void 0?(u=Fh(),S.set(v,u)):u=w}}const d=u;let m;if(u.s===C2)m=u.v;else if(m=n.apply(null,arguments),o++,i){const p=I5(r);p!=null&&i(p,m)&&(m=p,o!==0&&o--),r=typeof m=="object"&&m!==null||typeof m=="function"?new $E(m):m}return d.s=C2,d.v=m,m}return a.clearCache=()=>{t=Fh(),a.resetResultsCount()},a.resultsCount=()=>o,a.resetResultsCount=()=>{o=0},a}function _5(n,...e){const t=typeof n=="function"?{memoize:n,memoizeOptions:e}:n,i=(...r)=>{let o=0,a=0,u,f={},d=r.pop();typeof d=="object"&&(f=d,d=r.pop()),A5(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const m={...t,...f},{memoize:p,memoizeOptions:b=[],argsMemoize:v=H5,argsMemoizeOptions:S=[]}=m,w=k2(b),A=k2(S),C=R5(r),T=p(function(){return o++,d.apply(null,arguments)},...w),R=v(function(){a++;const O=M5(C,arguments);return u=T.apply(null,O),u},...A);return Object.assign(R,{resultFunc:d,memoizedResultFunc:T,dependencies:C,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>u,recomputations:()=>o,resetRecomputations:()=>{o=0},memoize:p,argsMemoize:v})};return Object.assign(i,{withTypes:()=>i}),i}_5({memoize:L5,memoizeOptions:{maxSize:1,equalityCheck:Object.is}});const Ae=(n,e,t,i,r,o,...a)=>{if(a.length>0)throw new Error(Qn(1));let u;if(n)u=n;else throw new Error("Missing arguments");return u};var f0={exports:{}},h0={};/**
|
|
208
|
+
* @license React
|
|
209
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
210
|
+
*
|
|
211
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
212
|
+
*
|
|
213
|
+
* This source code is licensed under the MIT license found in the
|
|
214
|
+
* LICENSE file in the root directory of this source tree.
|
|
215
|
+
*/var E2;function U5(){if(E2)return h0;E2=1;var n=ff(),e=FC();function t(d,m){return d===m&&(d!==0||1/d===1/m)||d!==d&&m!==m}var i=typeof Object.is=="function"?Object.is:t,r=e.useSyncExternalStore,o=n.useRef,a=n.useEffect,u=n.useMemo,f=n.useDebugValue;return h0.useSyncExternalStoreWithSelector=function(d,m,p,b,v){var S=o(null);if(S.current===null){var w={hasValue:!1,value:null};S.current=w}else w=S.current;S=u(function(){function C(z){if(!T){if(T=!0,R=z,z=b(z),v!==void 0&&w.hasValue){var D=w.value;if(v(D,z))return N=D}return N=z}if(D=N,i(R,z))return D;var j=b(z);return v!==void 0&&v(D,j)?(R=z,D):(R=z,N=j)}var T=!1,R,N,O=p===void 0?null:p;return[function(){return C(m())},O===null?void 0:function(){return C(O())}]},[m,p,b,v]);var A=r(d,S[0],S[1]);return a(function(){w.hasValue=!0,w.value=A},[A]),f(A),A},h0}var A2;function V5(){return A2||(A2=1,f0.exports=U5()),f0.exports}var q5=V5();const F5=Pb(19),G5=F5?K5:Y5;function ot(n,e,t,i,r){return G5(n,e,t,i,r)}function K5(n,e,t,i,r){const o=E.useCallback(()=>e(n.getSnapshot(),t,i,r),[n,e,t,i,r]);return wb.useSyncExternalStore(n.subscribe,o,o)}function Y5(n,e,t,i,r){return q5.useSyncExternalStoreWithSelector(n.subscribe,n.getSnapshot,n.getSnapshot,o=>e(o,t,i,r))}class ja{constructor(e){Dt(this,"subscribe",e=>(this.listeners.add(e),()=>{this.listeners.delete(e)}));Dt(this,"getSnapshot",()=>this.state);this.state=e,this.listeners=new Set,this.updateTick=0}setState(e){if(this.state===e)return;this.state=e,this.updateTick+=1;const t=this.updateTick;for(const i of this.listeners){if(t!==this.updateTick)return;i(e)}}update(e){for(const t in e)if(!Object.is(this.state[t],e[t])){ja.prototype.setState.call(this,{...this.state,...e});return}}set(e,t){Object.is(this.state[e],t)||ja.prototype.setState.call(this,{...this.state,[e]:t})}notifyAll(){const e={...this.state};ja.prototype.setState.call(this,e)}}class Gb extends ja{constructor(t,i={},r){super(t);Dt(this,"controlledValues",new Map);Dt(this,"select",(t,i,r,o)=>{const a=this.selectors[t];return a(this.state,i,r,o)});Dt(this,"useState",(t,i,r,o)=>{E.useDebugValue(t);const a=this.selectors[t];return ot(this,a,i,r,o)});this.context=i,this.selectors=r}useSyncedValue(t,i){E.useDebugValue(t),Pe(()=>{this.state[t]!==i&&this.set(t,i)},[t,i])}useSyncedValueWithCleanup(t,i){Pe(()=>(this.state[t]!==i&&this.set(t,i),()=>{this.set(t,void 0)}),[t,i])}useSyncedValues(t){const i=Object.values(t);Pe(()=>{this.update(t)},i)}useControlledProp(t,i,r){E.useDebugValue(t);const o=i!==void 0;this.controlledValues.has(t)||(this.controlledValues.set(t,o),!o&&!Object.is(this.state[t],r)&&super.setState({...this.state,[t]:r})),Pe(()=>{o&&!Object.is(this.state[t],i)&&super.setState({...this.state,[t]:i})},[t,i,r,o])}set(t,i){this.controlledValues.get(t)!==!0&&super.set(t,i)}update(t){const i={...t};for(const r in i)if(Object.hasOwn(i,r)&&this.controlledValues.get(r)===!0){delete i[r];continue}super.update(i)}setState(t){const i={...t};for(const r in i)if(Object.hasOwn(i,r)&&this.controlledValues.get(r)===!0){delete i[r];continue}super.setState({...this.state,...i})}useContextCallback(t,i){E.useDebugValue(t);const r=Le(i??Oi);this.context[t]=r}useStateSetter(t){const i=E.useRef(void 0);return i.current===void 0&&(i.current=r=>{this.set(t,r)}),i.current}observe(t,i){let r;typeof t=="function"?r=t:r=this.selectors[t];let o=r(this.state);return i(o,o,this),this.subscribe(a=>{const u=r(a);if(!Object.is(o,u)){const f=o;o=u,i(u,f,this)}})}}const Q5=[];function ZE(n){E.useEffect(n,Q5)}const Gh=null;class W5{constructor(){Dt(this,"callbacks",[]);Dt(this,"callbacksCount",0);Dt(this,"nextId",1);Dt(this,"startId",1);Dt(this,"isScheduled",!1);Dt(this,"tick",e=>{var r;this.isScheduled=!1;const t=this.callbacks,i=this.callbacksCount;if(this.callbacks=[],this.callbacksCount=0,this.startId=this.nextId,i>0)for(let o=0;o<t.length;o+=1)(r=t[o])==null||r.call(t,e)})}request(e){const t=this.nextId;return this.nextId+=1,this.callbacks.push(e),this.callbacksCount+=1,(!this.isScheduled||!1)&&(requestAnimationFrame(this.tick),this.isScheduled=!0),t}cancel(e){const t=e-this.startId;t<0||t>=this.callbacks.length||(this.callbacks[t]=null,this.callbacksCount-=1)}}const Kh=new W5;class Rs{constructor(){Dt(this,"currentId",Gh);Dt(this,"cancel",()=>{this.currentId!==Gh&&(Kh.cancel(this.currentId),this.currentId=Gh)});Dt(this,"disposeEffect",()=>this.cancel)}static create(){return new Rs}static request(e){return Kh.request(e)}static cancel(e){return Kh.cancel(e)}request(e){this.cancel(),this.currentId=Kh.request(()=>{this.currentId=Gh,e()})}}function df(){const n=pi(Rs.create).current;return ZE(n.disposeEffect),n}const xu=0;class To{constructor(){Dt(this,"currentId",xu);Dt(this,"clear",()=>{this.currentId!==xu&&(clearTimeout(this.currentId),this.currentId=xu)});Dt(this,"disposeEffect",()=>this.clear)}static create(){return new To}start(e,t){this.clear(),this.currentId=setTimeout(()=>{this.currentId=xu,t()},e)}isStarted(){return this.currentId!==xu}}function An(){const n=pi(To.create).current;return ZE(n.disposeEffect),n}const vc=typeof navigator<"u",d0=Z5(),JE=eL(),eA=J5(),tA=typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter:none"),X5=d0.platform==="MacIntel"&&d0.maxTouchPoints>1?!0:/iP(hone|ad|od)|iOS/.test(d0.platform),nA=vc&&/apple/i.test(navigator.vendor),yy=vc&&/android/i.test(JE)||/android/i.test(eA),$5=vc&&JE.toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints,iA=eA.includes("jsdom/");function Z5(){if(!vc)return{platform:"",maxTouchPoints:-1};const n=navigator.userAgentData;return n!=null&&n.platform?{platform:n.platform,maxTouchPoints:navigator.maxTouchPoints}:{platform:navigator.platform??"",maxTouchPoints:navigator.maxTouchPoints??-1}}function J5(){if(!vc)return"";const n=navigator.userAgentData;return n&&Array.isArray(n.brands)?n.brands.map(({brand:e,version:t})=>`${e}/${t}`).join(" "):navigator.userAgent}function eL(){if(!vc)return"";const n=navigator.userAgentData;return n!=null&&n.platform?n.platform:navigator.platform??""}const by="data-base-ui-focusable",sA="active",rA="selected",lA="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])",gl="ArrowLeft",yl="ArrowRight",Kb="ArrowUp",mf="ArrowDown";function Ms(n){var t;let e=n.activeElement;for(;((t=e==null?void 0:e.shadowRoot)==null?void 0:t.activeElement)!=null;)e=e.shadowRoot.activeElement;return e}function ft(n,e){var i;if(!n||!e)return!1;const t=(i=e.getRootNode)==null?void 0:i.call(e);if(n.contains(e))return!0;if(t&&py(t)){let r=e;for(;r;){if(n===r)return!0;r=r.parentNode||r.host}}return!1}function ei(n){return"composedPath"in n?n.composedPath()[0]:n.target}function ss(n,e){if(e==null)return!1;if("composedPath"in n)return n.composedPath().includes(e);const t=n;return t.target!=null&&e.contains(t.target)}function tL(n){return n.matches("html,body")}function an(n){return(n==null?void 0:n.ownerDocument)||document}function Yb(n){return Qt(n)&&n.matches(lA)}function vy(n){return n?n.getAttribute("role")==="combobox"&&Yb(n):!1}function nL(n){if(!n||iA)return!0;try{return n.matches(":focus-visible")}catch{return!0}}function Gu(n){return n?n.hasAttribute(by)?n:n.querySelector(`[${by}]`)||n:null}function wo(n,e,t=!0){return n.filter(r=>{var o;return r.parentId===e&&(!t||((o=r.context)==null?void 0:o.open))}).flatMap(r=>[r,...wo(n,r.id,t)])}function T2(n,e){var r;let t=[],i=(r=n.find(o=>o.id===e))==null?void 0:r.parentId;for(;i;){const o=n.find(a=>a.id===i);i=o==null?void 0:o.parentId,o&&(t=t.concat(o))}return t}function Gn(n){n.preventDefault(),n.stopPropagation()}function iL(n){return"nativeEvent"in n}function oA(n){return n.mozInputSource===0&&n.isTrusted?!0:yy&&n.pointerType?n.type==="click"&&n.buttons===1:n.detail===0&&!n.pointerType}function aA(n){return iA?!1:!yy&&n.width===0&&n.height===0||yy&&n.width===1&&n.height===1&&n.pressure===0&&n.detail===0&&n.pointerType==="mouse"||n.width<1&&n.height<1&&n.pressure===0&&n.detail===0&&n.pointerType==="touch"}function sc(n,e){const t=["mouse","pen"];return e||t.push("",void 0),t.includes(n)}function cA(n){const e=n.type;return e==="click"||e==="mousedown"||e==="keydown"||e==="keyup"}const sL=["top","right","bottom","left"],rc=Math.min,Mi=Math.max,_d=Math.round,Ma=Math.floor,Is=n=>({x:n,y:n}),rL={left:"right",right:"left",bottom:"top",top:"bottom"};function xy(n,e,t){return Mi(n,rc(e,t))}function wr(n,e){return typeof n=="function"?n(e):n}function ji(n){return n.split("-")[0]}function Ml(n){return n.split("-")[1]}function Qb(n){return n==="x"?"y":"x"}function Wb(n){return n==="y"?"height":"width"}function Qi(n){const e=n[0];return e==="t"||e==="b"?"y":"x"}function Xb(n){return Qb(Qi(n))}function lL(n,e,t){t===void 0&&(t=!1);const i=Ml(n),r=Xb(n),o=Wb(r);let a=r==="x"?i===(t?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(a=Ud(a)),[a,Ud(a)]}function oL(n){const e=Ud(n);return[Sy(n),e,Sy(e)]}function Sy(n){return n.includes("start")?n.replace("start","end"):n.replace("end","start")}const R2=["left","right"],M2=["right","left"],aL=["top","bottom"],cL=["bottom","top"];function uL(n,e,t){switch(n){case"top":case"bottom":return t?e?M2:R2:e?R2:M2;case"left":case"right":return e?aL:cL;default:return[]}}function fL(n,e,t,i){const r=Ml(n);let o=uL(ji(n),t==="start",i);return r&&(o=o.map(a=>a+"-"+r),e&&(o=o.concat(o.map(Sy)))),o}function Ud(n){const e=ji(n);return rL[e]+n.slice(e.length)}function hL(n){return{top:0,right:0,bottom:0,left:0,...n}}function uA(n){return typeof n!="number"?hL(n):{top:n,right:n,bottom:n,left:n}}function Vd(n){const{x:e,y:t,width:i,height:r}=n;return{width:i,height:r,top:t,left:e,right:e+i,bottom:t+r,x:e,y:t}}function Yh(n,e,t){return Math.floor(n/e)!==t}function La(n,e){return e<0||e>=n.current.length}function kd(n,e){return In(n,{disabledIndices:e})}function wy(n,e){return In(n,{decrement:!0,startingIndex:n.current.length,disabledIndices:e})}function In(n,{startingIndex:e=-1,decrement:t=!1,disabledIndices:i,amount:r=1}={}){let o=e;do o+=t?-r:r;while(o>=0&&o<=n.current.length-1&&bl(n,o,i));return o}function fA(n,{event:e,orientation:t,loopFocus:i,rtl:r,cols:o,disabledIndices:a,minIndex:u,maxIndex:f,prevIndex:d,stopEvent:m=!1}){let p=d;const b=[],v={};let S=!1;{let C=null,T=-1;n.current.forEach((R,N)=>{if(R==null)return;const O=R.closest('[role="row"]');O&&(S=!0),(O!==C||T===-1)&&(C=O,T+=1,b[T]=[]),b[T].push(N),v[N]=T})}const w=S&&b.length>0&&b.some(C=>C.length!==o);function A(C){if(!w||d===-1)return;const T=v[d];if(T==null)return;const R=b[T].indexOf(d);let N=C==="up"?T-1:T+1;i&&(N<0?N=b.length-1:N>=b.length&&(N=0));const O=new Set;for(;N>=0&&N<b.length&&!O.has(N);){O.add(N);const z=b[N];if(z.length===0){N=C==="up"?N-1:N+1;continue}const D=Math.min(R,z.length-1);for(let j=D;j>=0;j-=1){const B=z[j];if(!bl(n,B,a))return B}N=C==="up"?N-1:N+1,i&&(N<0?N=b.length-1:N>=b.length&&(N=0))}}if(e.key===Kb){const C=A("up");if(C!==void 0)m&&Gn(e),p=C;else{if(m&&Gn(e),d===-1)p=f;else if(p=In(n,{startingIndex:p,amount:o,decrement:!0,disabledIndices:a}),i&&(d-o<u||p<0)){const T=d%o,R=f%o,N=f-(R-T);R===T?p=f:p=R>T?N:N-o}La(n,p)&&(p=d)}}if(e.key===mf){const C=A("down");C!==void 0?(m&&Gn(e),p=C):(m&&Gn(e),d===-1?p=u:(p=In(n,{startingIndex:d,amount:o,disabledIndices:a}),i&&d+o>f&&(p=In(n,{startingIndex:d%o-o,amount:o,disabledIndices:a}))),La(n,p)&&(p=d))}if(t==="both"){const C=Ma(d/o);e.key===(r?gl:yl)&&(m&&Gn(e),d%o!==o-1?(p=In(n,{startingIndex:d,disabledIndices:a}),i&&Yh(p,o,C)&&(p=In(n,{startingIndex:d-d%o-1,disabledIndices:a}))):i&&(p=In(n,{startingIndex:d-d%o-1,disabledIndices:a})),Yh(p,o,C)&&(p=d)),e.key===(r?yl:gl)&&(m&&Gn(e),d%o!==0?(p=In(n,{startingIndex:d,decrement:!0,disabledIndices:a}),i&&Yh(p,o,C)&&(p=In(n,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:a}))):i&&(p=In(n,{startingIndex:d+(o-d%o),decrement:!0,disabledIndices:a})),Yh(p,o,C)&&(p=d));const T=Ma(f/o)===C;La(n,p)&&(i&&T?p=e.key===(r?yl:gl)?f:In(n,{startingIndex:d-d%o-1,disabledIndices:a}):p=d)}return p}function hA(n,e,t){const i=[];let r=0;return n.forEach(({width:o,height:a},u)=>{let f=!1;for(t&&(r=0);!f;){const d=[];for(let m=0;m<o;m+=1)for(let p=0;p<a;p+=1)d.push(r+m+p*e);r%e+o<=e&&d.every(m=>i[m]==null)?(d.forEach(m=>{i[m]=u}),f=!0):r+=1}}),[...i]}function dA(n,e,t,i,r){if(n===-1)return-1;const o=t.indexOf(n),a=e[n];switch(r){case"tl":return o;case"tr":return a?o+a.width-1:o;case"bl":return a?o+(a.height-1)*i:o;case"br":return t.lastIndexOf(n);default:return-1}}function mA(n,e){return e.flatMap((t,i)=>n.includes(t)?[i]:[])}function bl(n,e,t){if(typeof t=="function")return t(e);if(t)return t.includes(e);const i=n.current[e];return i?i.hasAttribute("disabled")||i.getAttribute("aria-disabled")==="true":!1}/*!
|
|
216
|
+
* tabbable 6.5.0
|
|
217
|
+
* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
|
|
218
|
+
*/var dL=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","area[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],qd=dL.join(","),pA=typeof Element>"u",lc=pA?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,Fd=!pA&&Element.prototype.getRootNode?function(n){var e;return n==null||(e=n.getRootNode)===null||e===void 0?void 0:e.call(n)}:function(n){return n==null?void 0:n.ownerDocument},Gd=function(e,t){var i;t===void 0&&(t=!0);var r=e==null||(i=e.getAttribute)===null||i===void 0?void 0:i.call(e,"inert"),o=r===""||r==="true",a=o||t&&e&&(typeof e.closest=="function"?e.closest("[inert]"):Gd(e.parentNode));return a},mL=function(e){var t,i=e==null||(t=e.getAttribute)===null||t===void 0?void 0:t.call(e,"contenteditable");return i===""||i==="true"},gA=function(e,t,i){if(Gd(e))return[];var r=Array.prototype.slice.apply(e.querySelectorAll(qd));return t&&lc.call(e,qd)&&r.unshift(e),r=r.filter(i),r},Kd=function(e,t,i){for(var r=[],o=Array.from(e);o.length;){var a=o.shift();if(!Gd(a,!1))if(a.tagName==="SLOT"){var u=a.assignedElements(),f=u.length?u:a.children,d=Kd(f,!0,i);i.flatten?r.push.apply(r,d):r.push({scopeParent:a,candidates:d})}else{var m=lc.call(a,qd);m&&i.filter(a)&&(t||!e.includes(a))&&r.push(a);var p=a.shadowRoot||typeof i.getShadowRoot=="function"&&i.getShadowRoot(a),b=!Gd(p,!1)&&(!i.shadowRootFilter||i.shadowRootFilter(a));if(p&&b){var v=Kd(p===!0?a.children:p.children,!0,i);i.flatten?r.push.apply(r,v):r.push({scopeParent:a,candidates:v})}else o.unshift.apply(o,a.children)}}return r},yA=function(e){return!isNaN(parseInt(e.getAttribute("tabindex"),10))},bA=function(e){if(!e)throw new Error("No node provided");return e.tabIndex<0&&(/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||mL(e))&&!yA(e)?0:e.tabIndex},pL=function(e,t){var i=bA(e);return i<0&&t&&!yA(e)?0:i},gL=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},vA=function(e){return e.tagName==="INPUT"},yL=function(e){return vA(e)&&e.type==="hidden"},bL=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(i){return i.tagName==="SUMMARY"});return t},vL=function(e,t){for(var i=0;i<e.length;i++)if(e[i].checked&&e[i].form===t)return e[i]},xL=function(e){if(!e.name)return!0;var t=e.form||Fd(e),i=function(u){return t.querySelectorAll('input[type="radio"][name="'+u+'"]')},r;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")r=i(window.CSS.escape(e.name));else try{r=i(e.name)}catch(a){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",a.message),!1}var o=vL(r,e.form);return!o||o===e},SL=function(e){return vA(e)&&e.type==="radio"},wL=function(e){return SL(e)&&!xL(e)},kL=function(e){var t,i=e&&Fd(e),r=(t=i)===null||t===void 0?void 0:t.host,o=!1;if(i&&i!==e){var a,u,f;for(o=!!((a=r)!==null&&a!==void 0&&(u=a.ownerDocument)!==null&&u!==void 0&&u.contains(r)||e!=null&&(f=e.ownerDocument)!==null&&f!==void 0&&f.contains(e));!o&&r;){var d,m,p;i=Fd(r),r=(d=i)===null||d===void 0?void 0:d.host,o=!!((m=r)!==null&&m!==void 0&&(p=m.ownerDocument)!==null&&p!==void 0&&p.contains(r))}}return o},O2=function(e){var t=e.getBoundingClientRect(),i=t.width,r=t.height;return i===0&&r===0},CL=function(e,t){var i=t.displayCheck,r=t.getShadowRoot;if(i==="full-native"&&"checkVisibility"in e){var o=e.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!o}var a=getComputedStyle(e),u=a.visibility;if(u==="hidden"||u==="collapse")return!0;var f=lc.call(e,"details>summary:first-of-type"),d=f?e.parentElement:e;if(lc.call(d,"details:not([open]) *"))return!0;if(!i||i==="full"||i==="full-native"||i==="legacy-full"){if(typeof r=="function"){for(var m=e;e;){var p=e.parentElement,b=Fd(e);if(p&&!p.shadowRoot&&r(p)===!0)return O2(e);e.assignedSlot?e=e.assignedSlot:!p&&b!==e.ownerDocument?e=b.host:e=p}e=m}if(kL(e))return!e.getClientRects().length;if(i!=="legacy-full")return!0}else if(i==="non-zero-area")return O2(e);return!1},EL=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var i=0;i<t.children.length;i++){var r=t.children.item(i);if(r.tagName==="LEGEND")return lc.call(t,"fieldset[disabled] *")?!0:!r.contains(e)}return!0}t=t.parentElement}return!1},ky=function(e,t){return!(t.disabled||yL(t)||CL(t,e)||bL(t)||EL(t))},Cy=function(e,t){return!(wL(t)||bA(t)<0||!ky(e,t))},AL=function(e){var t=parseInt(e.getAttribute("tabindex"),10);return!!(isNaN(t)||t>=0)},xA=function(e){var t=[],i=[];return e.forEach(function(r,o){var a=!!r.scopeParent,u=a?r.scopeParent:r,f=pL(u,a),d=a?xA(r.candidates):u;f===0?a?t.push.apply(t,d):t.push(u):i.push({documentOrder:o,tabIndex:f,item:r,isScope:a,content:d})}),i.sort(gL).reduce(function(r,o){return o.isScope?r.push.apply(r,o.content):r.push(o.content),r},[]).concat(t)},pf=function(e,t){t=t||{};var i;return t.getShadowRoot?i=Kd([e],t.includeContainer,{filter:Cy.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:AL}):i=gA(e,t.includeContainer,Cy.bind(null,t)),xA(i)},TL=function(e,t){t=t||{};var i;return t.getShadowRoot?i=Kd([e],t.includeContainer,{filter:ky.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):i=gA(e,t.includeContainer,ky.bind(null,t)),i},SA=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return lc.call(e,qd)===!1?!1:Cy(t,e)};const xc=()=>({getShadowRoot:!0,displayCheck:typeof ResizeObserver=="function"&&ResizeObserver.toString().includes("[native code]")?"full":"none"});function wA(n,e){const t=pf(n,xc()),i=t.length;if(i===0)return;const r=Ms(an(n)),o=t.indexOf(r),a=o===-1?e===1?0:i-1:o+e;return t[a]}function $b(n){return wA(an(n).body,1)||n}function kA(n){return wA(an(n).body,-1)||n}function CA(n,e){if(!n)return null;const t=pf(an(n).body,xc()),i=t.length;if(i===0)return null;const r=t.indexOf(n);if(r===-1)return null;const o=(r+e+i)%i;return t[o]}function RL(n){return CA(n,1)}function ML(n){return CA(n,-1)}function Ba(n,e){const t=e||n.currentTarget,i=n.relatedTarget;return!i||!ft(t,i)}function OL(n){pf(n,xc()).forEach(t=>{t.dataset.tabindex=t.getAttribute("tabindex")||"",t.setAttribute("tabindex","-1")})}function N2(n){n.querySelectorAll("[data-tabindex]").forEach(t=>{const i=t.dataset.tabindex;delete t.dataset.tabindex,i?t.setAttribute("tabindex",i):t.removeAttribute("tabindex")})}function EA(){const n=new Map;return{emit(e,t){var i;(i=n.get(e))==null||i.forEach(r=>r(t))},on(e,t){n.has(e)||n.set(e,new Set),n.get(e).add(t)},off(e,t){var i;(i=n.get(e))==null||i.delete(t)}}}class Zb{constructor(){Dt(this,"nodesRef",{current:[]});Dt(this,"events",EA())}addNode(e){this.nodesRef.current.push(e)}removeNode(e){const t=this.nodesRef.current.findIndex(i=>i===e);t!==-1&&this.nodesRef.current.splice(t,1)}}const AA=E.createContext(null),TA=E.createContext(null),Cr=()=>{var n;return((n=E.useContext(AA))==null?void 0:n.id)||null},Ol=n=>{const e=E.useContext(TA);return n??e};function RA(n){const e=Po(),t=Ol(n),i=Cr();return Pe(()=>{if(!e)return;const r={id:e,parentId:i};return t==null||t.addNode(r),()=>{t==null||t.removeNode(r)}},[t,e,i]),e}function NL(n){const{children:e,id:t}=n,i=Cr();return x.jsx(AA.Provider,{value:E.useMemo(()=>({id:t,parentId:i}),[t,i]),children:e})}function DL(n){const{children:e,externalTree:t}=n,i=pi(()=>t??new Zb).current;return x.jsx(TA.Provider,{value:i,children:e})}function oc(n){return`data-base-ui-${n}`}function m0(n,e,t){if(t&&!sc(t))return 0;if(typeof n=="number")return n;if(typeof n=="function"){const i=n();return typeof i=="number"?i:i==null?void 0:i[e]}return n==null?void 0:n[e]}function cs(n){return(n==null?void 0:n.ownerDocument)||document}const ac=E.forwardRef(function(e,t){const[i,r]=E.useState();Pe(()=>{nA&&r("button")},[]);const o={tabIndex:0,role:i};return x.jsx("span",{...e,ref:t,style:zb,"aria-hidden":i?void 0:!0,...o,"data-base-ui-focus-guard":""})});let D2=0;function Cd(n,e={}){const{preventScroll:t=!1,cancelPrevious:i=!0,sync:r=!1}=e;i&&cancelAnimationFrame(D2);const o=()=>n==null?void 0:n.focus({preventScroll:t});r?o():D2=requestAnimationFrame(o)}const za={inert:new WeakMap,"aria-hidden":new WeakMap,none:new WeakMap};function j2(n){return n==="inert"?za.inert:n==="aria-hidden"?za["aria-hidden"]:za.none}let Qh=new WeakSet,Wh={},p0=0;const MA=n=>n&&(n.host||MA(n.parentNode)),jL=(n,e)=>e.map(t=>{if(n.contains(t))return t;const i=MA(t);return n.contains(i)?i:null}).filter(t=>t!=null);function LL(n,e,t,i){const r="data-base-ui-inert",o=i?"inert":t?"aria-hidden":null,a=jL(e,n),u=new Set,f=new Set(a),d=[];Wh[r]||(Wh[r]=new WeakMap);const m=Wh[r];a.forEach(p),b(e),u.clear();function p(v){!v||u.has(v)||(u.add(v),v.parentNode&&p(v.parentNode))}function b(v){!v||f.has(v)||[].forEach.call(v.children,S=>{if(Rl(S)!=="script")if(u.has(S))b(S);else{const w=o?S.getAttribute(o):null,A=w!==null&&w!=="false",C=j2(o),T=(C.get(S)||0)+1,R=(m.get(S)||0)+1;C.set(S,T),m.set(S,R),d.push(S),T===1&&A&&Qh.add(S),R===1&&S.setAttribute(r,""),!A&&o&&S.setAttribute(o,o==="inert"?"":"true")}})}return p0+=1,()=>{d.forEach(v=>{const S=j2(o),A=(S.get(v)||0)-1,C=(m.get(v)||0)-1;S.set(v,A),m.set(v,C),A||(!Qh.has(v)&&o&&v.removeAttribute(o),Qh.delete(v)),C||v.removeAttribute(r)}),p0-=1,p0||(za.inert=new WeakMap,za["aria-hidden"]=new WeakMap,za.none=new WeakMap,Qh=new WeakSet,Wh={})}}function BL(n,e=!1,t=!1){const i=an(n[0]).body;return LL(n.concat(Array.from(i.querySelectorAll("[aria-live]"))),i,e,t)}const OA=E.createContext(null),NA=()=>E.useContext(OA),zL=oc("portal");function PL(n={}){const{ref:e,container:t,componentProps:i=cn,elementProps:r,elementState:o}=n,a=Po(),u=NA(),f=u==null?void 0:u.portalNode,[d,m]=E.useState(null),[p,b]=E.useState(null),v=E.useRef(null);Pe(()=>{if(t===null){v.current&&(v.current=null,b(null),m(null));return}if(a==null)return;const A=(t&&(Ib(t)?t:t.current))??f??document.body;if(A==null){v.current&&(v.current=null,b(null),m(null));return}v.current!==A&&(v.current=A,b(null),m(A))},[t,f,a]);const S=dn("div",i,{ref:[e,b],state:o,props:[{id:a,[zL]:""},r]});return{portalNode:p,portalSubtree:d&&S?Zi.createPortal(S,d):null}}const Jb=E.forwardRef(function(e,t){const{children:i,container:r,className:o,render:a,renderGuards:u,...f}=e,{portalNode:d,portalSubtree:m}=PL({container:r,ref:t,componentProps:e,elementProps:f}),p=E.useRef(null),b=E.useRef(null),v=E.useRef(null),S=E.useRef(null),[w,A]=E.useState(null),C=w==null?void 0:w.modal,T=w==null?void 0:w.open,R=typeof u=="boolean"?u:!!w&&!w.modal&&w.open&&!!d;E.useEffect(()=>{if(!d||C)return;function O(z){d&&Ba(z)&&(z.type==="focusin"?N2:OL)(d)}return d.addEventListener("focusin",O,!0),d.addEventListener("focusout",O,!0),()=>{d.removeEventListener("focusin",O,!0),d.removeEventListener("focusout",O,!0)}},[d,C]),E.useEffect(()=>{!d||T||N2(d)},[T,d]);const N=E.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:b,beforeInsideRef:v,afterInsideRef:S,portalNode:d,setFocusManagerState:A}),[d]);return x.jsxs(E.Fragment,{children:[m,x.jsxs(OA.Provider,{value:N,children:[R&&d&&x.jsx(ac,{"data-type":"outside",ref:p,onFocus:O=>{var z;if(Ba(O,d))(z=v.current)==null||z.focus();else{const D=w?w.domReference:null,j=kA(D);j==null||j.focus()}}}),R&&d&&x.jsx("span",{"aria-owns":d.id,style:t5}),d&&Zi.createPortal(i,d),R&&d&&x.jsx(ac,{"data-type":"outside",ref:b,onFocus:O=>{var z;if(Ba(O,d))(z=S.current)==null||z.focus();else{const D=w?w.domReference:null,j=$b(D);j==null||j.focus(),w!=null&&w.closeOnFocusOut&&(w==null||w.onOpenChange(!1,Je(Ao,O.nativeEvent)))}}})]})]})});function no(n){return n==null?n:"current"in n?n.current:n}function IL(n,e){const t=xn(n.target);return n instanceof t.KeyboardEvent?"keyboard":n instanceof t.FocusEvent?e||"keyboard":"pointerType"in n?n.pointerType||"keyboard":"touches"in n?"touch":n instanceof t.MouseEvent?e||(n.detail===0?"keyboard":"mouse"):""}const L2=20;let fl=[];function ev(){fl=fl.filter(n=>n.isConnected)}function HL(n){ev(),n&&Rl(n)!=="body"&&(fl.push(n),fl.length>L2&&(fl=fl.slice(-L2)))}function g0(){return ev(),fl[fl.length-1]}function _L(n){if(!n)return null;const e=xc();return SA(n,e)?n:pf(n,e)[0]||n}function UL(n){return!n||!n.isConnected?!1:typeof n.checkVisibility=="function"?n.checkVisibility():Bi(n).display!=="none"}function B2(n,e){var a;if(!e.current.includes("floating")&&!((a=n.getAttribute("role"))!=null&&a.includes("dialog")))return;const t=xc(),r=TL(n,t).filter(u=>{const f=u.getAttribute("data-tabindex")||"";return SA(u,t)||u.hasAttribute("data-tabindex")&&!f.startsWith("-")}),o=n.getAttribute("tabindex");e.current.includes("floating")||r.length===0?o!=="0"&&n.setAttribute("tabindex","0"):(o!=="-1"||n.hasAttribute("data-tabindex")&&n.getAttribute("data-tabindex")!=="-1")&&(n.setAttribute("tabindex","-1"),n.setAttribute("data-tabindex","-1"))}function tv(n){const{context:e,children:t,disabled:i=!1,order:r=["content"],initialFocus:o=!0,returnFocus:a=!0,restoreFocus:u=!1,modal:f=!0,closeOnFocusOut:d=!0,openInteractionType:m="",getInsideElements:p=()=>[],nextFocusableElement:b,previousFocusableElement:v,beforeContentFocusGuardRef:S,externalTree:w}=n,A="rootStore"in e?e.rootStore:e,C=A.useState("open"),T=A.useState("domReferenceElement"),R=A.useState("floatingElement"),{events:N,dataRef:O}=A.context,z=Le(()=>{var pe;return(pe=O.current.floatingContext)==null?void 0:pe.nodeId}),D=Le(p),j=o===!1,B=vy(T)&&j,K=bn(r),F=bn(o),Y=bn(a),V=bn(m),Z=Ol(w),q=NA(),P=E.useRef(null),W=E.useRef(null),U=E.useRef(!1),$=E.useRef(!1),Q=E.useRef(!1),L=E.useRef(-1),_=E.useRef(""),J=E.useRef(""),le=An(),ae=An(),ee=df(),se=q!=null,fe=Gu(R),me=Le((pe=fe)=>pe?pf(pe,xc()):[]),Ne=Le(pe=>{const ye=me(pe);return K.current.map(()=>ye).filter(Boolean).flat()});E.useEffect(()=>{if(i||!f)return;function pe(de){de.key==="Tab"&&ft(fe,Ms(an(fe)))&&me().length===0&&!B&&Gn(de)}const ye=an(fe);return ye.addEventListener("keydown",pe),()=>{ye.removeEventListener("keydown",pe)}},[i,T,fe,f,K,B,me,Ne]),E.useEffect(()=>{if(i||!R)return;function pe(ye){const de=ei(ye),Te=me().indexOf(de);Te!==-1&&(L.current=Te)}return R.addEventListener("focusin",pe),()=>{R.removeEventListener("focusin",pe)}},[i,R,me]),E.useEffect(()=>{if(i||!C)return;const pe=an(fe);function ye(){Q.current=!1}function de(Te){const Re=ei(Te),Me=ft(R,Re)||ft(T,Re)||ft(q==null?void 0:q.portalNode,Re);Q.current=!Me,J.current=Te.pointerType||"keyboard"}function Ce(){J.current="keyboard"}return pe.addEventListener("pointerdown",de,!0),pe.addEventListener("pointerup",ye,!0),pe.addEventListener("pointercancel",ye,!0),pe.addEventListener("keydown",Ce,!0),()=>{pe.removeEventListener("pointerdown",de,!0),pe.removeEventListener("pointerup",ye,!0),pe.removeEventListener("pointercancel",ye,!0),pe.removeEventListener("keydown",Ce,!0)}},[i,R,T,fe,C,q]),E.useEffect(()=>{if(i||!d)return;function pe(){$.current=!0,ae.start(0,()=>{$.current=!1})}function ye(Re){const Me=Re.relatedTarget,be=Re.currentTarget,we=ei(Re);queueMicrotask(()=>{const ve=z(),We=A.context.triggerElements,nt=!(ft(T,Me)||ft(R,Me)||ft(Me,R)||ft(q==null?void 0:q.portalNode,Me)||Me!=null&&We.hasElement(Me)||We.hasMatchingElement(Qe=>ft(Qe,Me))||Me!=null&&Me.hasAttribute(oc("focus-guard"))||Z&&(wo(Z.nodesRef.current,ve).find(Qe=>{var ht,lt;return ft((ht=Qe.context)==null?void 0:ht.elements.floating,Me)||ft((lt=Qe.context)==null?void 0:lt.elements.domReference,Me)})||T2(Z.nodesRef.current,ve).find(Qe=>{var ht,lt,Ft;return[(ht=Qe.context)==null?void 0:ht.elements.floating,Gu((lt=Qe.context)==null?void 0:lt.elements.floating)].includes(Me)||((Ft=Qe.context)==null?void 0:Ft.elements.domReference)===Me})));if(be===T&&fe&&B2(fe,K),u&&be!==T&&!UL(we)&&Ms(an(fe))===an(fe).body){if(Qt(fe)&&(fe.focus(),u==="popup")){ee.request(()=>{fe.focus()});return}const Qe=L.current,ht=me(),lt=ht[Qe]||ht[ht.length-1]||fe;Qt(lt)&<.focus()}if(O.current.insideReactTree){O.current.insideReactTree=!1;return}(B||!f)&&Me&&nt&&!$.current&&(B||Me!==g0())&&(U.current=!0,A.setOpen(!1,Je(Ao,Re)))})}function de(){Q.current||(O.current.insideReactTree=!0,le.start(0,()=>{O.current.insideReactTree=!1}))}const Ce=Qt(T)?T:null,Te=[];if(!(!R&&!Ce))return Ce&&(Ce.addEventListener("focusout",ye),Ce.addEventListener("pointerdown",pe),Te.push(()=>{Ce.removeEventListener("focusout",ye),Ce.removeEventListener("pointerdown",pe)})),R&&(R.addEventListener("focusout",ye),q&&(R.addEventListener("focusout",de,!0),Te.push(()=>{R.removeEventListener("focusout",de,!0)})),Te.push(()=>{R.removeEventListener("focusout",ye)})),()=>{Te.forEach(Re=>{Re()})}},[i,T,R,fe,f,Z,q,A,d,u,me,B,z,K,O,le,ae,ee]);const oe=E.useRef(null),xe=E.useRef(null),Se=Sr(oe,S,q==null?void 0:q.beforeInsideRef),Ge=Sr(xe,q==null?void 0:q.afterInsideRef);E.useEffect(()=>{var Re,Me,be;if(i||!R||!C)return;const pe=Array.from(((Re=q==null?void 0:q.portalNode)==null?void 0:Re.querySelectorAll(`[${oc("portal")}]`))||[]),de=(be=(Me=(Z?T2(Z.nodesRef.current,z()):[]).find(we=>{var ve;return vy(((ve=we.context)==null?void 0:ve.elements.domReference)||null)}))==null?void 0:Me.context)==null?void 0:be.elements.domReference,Ce=[R,de,...pe,...D(),P.current,W.current,oe.current,xe.current,q==null?void 0:q.beforeOutsideRef.current,q==null?void 0:q.afterOutsideRef.current,no(v),no(b),B?T:null].filter(we=>we!=null),Te=BL(Ce,f||B);return()=>{Te()}},[C,i,T,R,f,K,q,B,Z,z,D,b,v]),Pe(()=>{if(!C||i||!Qt(fe))return;const pe=an(fe),ye=Ms(pe);queueMicrotask(()=>{const de=Ne(fe),Ce=F.current,Te=typeof Ce=="function"?Ce(V.current||""):Ce;if(Te===void 0||Te===!1)return;let Re;Te===!0||Te===null?Re=de[0]||fe:Re=no(Te),Re=Re||de[0]||fe,!ft(fe,ye)&&Cd(Re,{preventScroll:Re===fe})})},[i,C,fe,j,Ne,F,V]),Pe(()=>{if(i||!fe)return;const pe=an(fe),ye=Ms(pe);HL(ye);function de(Re){if(Re.open||(_.current=IL(Re.nativeEvent,J.current)),Re.reason===Ni&&Re.nativeEvent.type==="mouseleave"&&(U.current=!0),Re.reason===qb)if(Re.nested)U.current=!1;else if(oA(Re.nativeEvent)||aA(Re.nativeEvent))U.current=!1;else{let Me=!1;document.createElement("div").focus({get preventScroll(){return Me=!0,!1}}),Me?U.current=!1:U.current=!0}}N.on("openchange",de);const Ce=pe.createElement("span");Ce.setAttribute("tabindex","-1"),Ce.setAttribute("aria-hidden","true"),Object.assign(Ce.style,zb),se&&T&&T.insertAdjacentElement("afterend",Ce);function Te(){const Re=Y.current;let Me=typeof Re=="function"?Re(_.current):Re;if(Me===void 0||Me===!1)return null;if(Me===null&&(Me=!0),typeof Me=="boolean"){const we=T||g0();return we&&we.isConnected?we:Ce}const be=T||g0()||Ce;return no(Me)||be}return()=>{N.off("openchange",de);const Re=Ms(pe),Me=ft(R,Re)||Z&&wo(Z.nodesRef.current,z(),!1).some(we=>{var ve;return ft((ve=we.context)==null?void 0:ve.elements.floating,Re)}),be=Te();queueMicrotask(()=>{const we=_L(be),ve=typeof Y.current!="boolean";Y.current&&!U.current&&Qt(we)&&(!(!ve&&we!==Re&&Re!==pe.body)||Me)&&we.focus({preventScroll:!0}),Ce.remove()})}},[i,R,fe,Y,O,N,Z,se,T,z]),E.useEffect(()=>{queueMicrotask(()=>{U.current=!1})},[i]),E.useEffect(()=>{if(i||!C)return;function pe(de){const Ce=ei(de);Ce!=null&&Ce.closest(`[${e5}]`)&&($.current=!0)}const ye=an(fe);return ye.addEventListener("pointerdown",pe,!0),()=>{ye.removeEventListener("pointerdown",pe,!0)}},[i,C,fe]),Pe(()=>{if(!i&&q)return q.setFocusManagerState({modal:f,closeOnFocusOut:d,open:C,onOpenChange:A.setOpen,domReference:T}),()=>{q.setFocusManagerState(null)}},[i,q,f,C,A,d,T]),Pe(()=>{if(!(i||!fe))return B2(fe,K),()=>{queueMicrotask(ev)}},[i,fe,K]);const De=!i&&(f?!B:!0)&&(se||f);return x.jsxs(E.Fragment,{children:[De&&x.jsx(ac,{"data-type":"inside",ref:Se,onFocus:pe=>{var ye;if(f){const de=Ne();Cd(de[de.length-1])}else if(q!=null&&q.portalNode)if(U.current=!1,Ba(pe,q.portalNode)){const de=$b(T);de==null||de.focus()}else(ye=no(v??q.beforeOutsideRef))==null||ye.focus()}}),t,De&&x.jsx(ac,{"data-type":"inside",ref:Ge,onFocus:pe=>{var ye;if(f)Cd(Ne()[0]);else if(q!=null&&q.portalNode)if(d&&(U.current=!0),Ba(pe,q.portalNode)){const de=kA(T);de==null||de.focus()}else(ye=no(b??q.afterOutsideRef))==null||ye.focus()}})]})}function DA(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.context.dataRef,{enabled:r=!0,event:o="click",toggle:a=!0,ignoreMouse:u=!1,stickIfOpen:f=!0,touchOpenDelay:d=0}=e,m=E.useRef(void 0),p=df(),b=An(),v=E.useMemo(()=>({onPointerDown(S){m.current=S.pointerType},onMouseDown(S){const w=m.current,A=S.nativeEvent,C=t.select("open");if(S.button!==0||o==="click"||sc(w,!0)&&u)return;const T=i.current.openEvent,R=T==null?void 0:T.type,N=t.select("domReferenceElement")!==S.currentTarget,O=C&&N||!(C&&a&&(!(T&&f)||R==="click"||R==="mousedown"));if(Yb(A.target)){const D=Je(So,A,A.target);O&&w==="touch"&&d>0?b.start(d,()=>{t.setOpen(!0,D)}):t.setOpen(O,D);return}const z=S.currentTarget;p.request(()=>{const D=Je(So,A,z);O&&w==="touch"&&d>0?b.start(d,()=>{t.setOpen(!0,D)}):t.setOpen(O,D)})},onClick(S){if(o==="mousedown-only")return;const w=m.current;if(o==="mousedown"&&w){m.current=void 0;return}if(sc(w,!0)&&u)return;const A=t.select("open"),C=i.current.openEvent,T=t.select("domReferenceElement")!==S.currentTarget,R=A&&T||!(A&&a&&(!(C&&f)||cA(C))),N=Je(So,S.nativeEvent,S.currentTarget);R&&w==="touch"&&d>0?b.start(d,()=>{t.setOpen(!0,N)}):t.setOpen(R,N)},onKeyDown(){m.current=void 0}}),[i,o,u,t,f,a,p,b,d]);return E.useMemo(()=>r?{reference:v}:cn,[r,v])}function z2(n,e,t){let{reference:i,floating:r}=n;const o=Qi(e),a=Xb(e),u=Wb(a),f=ji(e),d=o==="y",m=i.x+i.width/2-r.width/2,p=i.y+i.height/2-r.height/2,b=i[u]/2-r[u]/2;let v;switch(f){case"top":v={x:m,y:i.y-r.height};break;case"bottom":v={x:m,y:i.y+i.height};break;case"right":v={x:i.x+i.width,y:p};break;case"left":v={x:i.x-r.width,y:p};break;default:v={x:i.x,y:i.y}}switch(Ml(e)){case"start":v[a]-=b*(t&&d?-1:1);break;case"end":v[a]+=b*(t&&d?-1:1);break}return v}async function VL(n,e){var t;e===void 0&&(e={});const{x:i,y:r,platform:o,rects:a,elements:u,strategy:f}=n,{boundary:d="clippingAncestors",rootBoundary:m="viewport",elementContext:p="floating",altBoundary:b=!1,padding:v=0}=wr(e,n),S=uA(v),A=u[b?p==="floating"?"reference":"floating":p],C=Vd(await o.getClippingRect({element:(t=await(o.isElement==null?void 0:o.isElement(A)))==null||t?A:A.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(u.floating)),boundary:d,rootBoundary:m,strategy:f})),T=p==="floating"?{x:i,y:r,width:a.floating.width,height:a.floating.height}:a.reference,R=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u.floating)),N=await(o.isElement==null?void 0:o.isElement(R))?await(o.getScale==null?void 0:o.getScale(R))||{x:1,y:1}:{x:1,y:1},O=Vd(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:T,offsetParent:R,strategy:f}):T);return{top:(C.top-O.top+S.top)/N.y,bottom:(O.bottom-C.bottom+S.bottom)/N.y,left:(C.left-O.left+S.left)/N.x,right:(O.right-C.right+S.right)/N.x}}const qL=50,FL=async(n,e,t)=>{const{placement:i="bottom",strategy:r="absolute",middleware:o=[],platform:a}=t,u=a.detectOverflow?a:{...a,detectOverflow:VL},f=await(a.isRTL==null?void 0:a.isRTL(e));let d=await a.getElementRects({reference:n,floating:e,strategy:r}),{x:m,y:p}=z2(d,i,f),b=i,v=0;const S={};for(let w=0;w<o.length;w++){const A=o[w];if(!A)continue;const{name:C,fn:T}=A,{x:R,y:N,data:O,reset:z}=await T({x:m,y:p,initialPlacement:i,placement:b,strategy:r,middlewareData:S,rects:d,platform:u,elements:{reference:n,floating:e}});m=R??m,p=N??p,S[C]={...S[C],...O},z&&v<qL&&(v++,typeof z=="object"&&(z.placement&&(b=z.placement),z.rects&&(d=z.rects===!0?await a.getElementRects({reference:n,floating:e,strategy:r}):z.rects),{x:m,y:p}=z2(d,b,f)),w=-1)}return{x:m,y:p,placement:b,strategy:r,middlewareData:S}},GL=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(e){var t,i;const{placement:r,middlewareData:o,rects:a,initialPlacement:u,platform:f,elements:d}=e,{mainAxis:m=!0,crossAxis:p=!0,fallbackPlacements:b,fallbackStrategy:v="bestFit",fallbackAxisSideDirection:S="none",flipAlignment:w=!0,...A}=wr(n,e);if((t=o.arrow)!=null&&t.alignmentOffset)return{};const C=ji(r),T=Qi(u),R=ji(u)===u,N=await(f.isRTL==null?void 0:f.isRTL(d.floating)),O=b||(R||!w?[Ud(u)]:oL(u)),z=S!=="none";!b&&z&&O.push(...fL(u,w,S,N));const D=[u,...O],j=await f.detectOverflow(e,A),B=[];let K=((i=o.flip)==null?void 0:i.overflows)||[];if(m&&B.push(j[C]),p){const Z=lL(r,a,N);B.push(j[Z[0]],j[Z[1]])}if(K=[...K,{placement:r,overflows:B}],!B.every(Z=>Z<=0)){var F,Y;const Z=(((F=o.flip)==null?void 0:F.index)||0)+1,q=D[Z];if(q&&(!(p==="alignment"?T!==Qi(q):!1)||K.every(U=>Qi(U.placement)===T?U.overflows[0]>0:!0)))return{data:{index:Z,overflows:K},reset:{placement:q}};let P=(Y=K.filter(W=>W.overflows[0]<=0).sort((W,U)=>W.overflows[1]-U.overflows[1])[0])==null?void 0:Y.placement;if(!P)switch(v){case"bestFit":{var V;const W=(V=K.filter(U=>{if(z){const $=Qi(U.placement);return $===T||$==="y"}return!0}).map(U=>[U.placement,U.overflows.filter($=>$>0).reduce(($,Q)=>$+Q,0)]).sort((U,$)=>U[1]-$[1])[0])==null?void 0:V[0];W&&(P=W);break}case"initialPlacement":P=u;break}if(r!==P)return{reset:{placement:P}}}return{}}}};function P2(n,e){return{top:n.top-e.height,right:n.right-e.width,bottom:n.bottom-e.height,left:n.left-e.width}}function I2(n){return sL.some(e=>n[e]>=0)}const KL=function(n){return n===void 0&&(n={}),{name:"hide",options:n,async fn(e){const{rects:t,platform:i}=e,{strategy:r="referenceHidden",...o}=wr(n,e);switch(r){case"referenceHidden":{const a=await i.detectOverflow(e,{...o,elementContext:"reference"}),u=P2(a,t.reference);return{data:{referenceHiddenOffsets:u,referenceHidden:I2(u)}}}case"escaped":{const a=await i.detectOverflow(e,{...o,altBoundary:!0}),u=P2(a,t.floating);return{data:{escapedOffsets:u,escaped:I2(u)}}}default:return{}}}}},jA=new Set(["left","top"]);async function YL(n,e){const{placement:t,platform:i,elements:r}=n,o=await(i.isRTL==null?void 0:i.isRTL(r.floating)),a=ji(t),u=Ml(t),f=Qi(t)==="y",d=jA.has(a)?-1:1,m=o&&f?-1:1,p=wr(e,n);let{mainAxis:b,crossAxis:v,alignmentAxis:S}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:p.mainAxis||0,crossAxis:p.crossAxis||0,alignmentAxis:p.alignmentAxis};return u&&typeof S=="number"&&(v=u==="end"?S*-1:S),f?{x:v*m,y:b*d}:{x:b*d,y:v*m}}const QL=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(e){var t,i;const{x:r,y:o,placement:a,middlewareData:u}=e,f=await YL(e,n);return a===((t=u.offset)==null?void 0:t.placement)&&(i=u.arrow)!=null&&i.alignmentOffset?{}:{x:r+f.x,y:o+f.y,data:{...f,placement:a}}}}},WL=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){const{x:t,y:i,placement:r,platform:o}=e,{mainAxis:a=!0,crossAxis:u=!1,limiter:f={fn:C=>{let{x:T,y:R}=C;return{x:T,y:R}}},...d}=wr(n,e),m={x:t,y:i},p=await o.detectOverflow(e,d),b=Qi(ji(r)),v=Qb(b);let S=m[v],w=m[b];if(a){const C=v==="y"?"top":"left",T=v==="y"?"bottom":"right",R=S+p[C],N=S-p[T];S=xy(R,S,N)}if(u){const C=b==="y"?"top":"left",T=b==="y"?"bottom":"right",R=w+p[C],N=w-p[T];w=xy(R,w,N)}const A=f.fn({...e,[v]:S,[b]:w});return{...A,data:{x:A.x-t,y:A.y-i,enabled:{[v]:a,[b]:u}}}}}},XL=function(n){return n===void 0&&(n={}),{options:n,fn(e){const{x:t,y:i,placement:r,rects:o,middlewareData:a}=e,{offset:u=0,mainAxis:f=!0,crossAxis:d=!0}=wr(n,e),m={x:t,y:i},p=Qi(r),b=Qb(p);let v=m[b],S=m[p];const w=wr(u,e),A=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(f){const R=b==="y"?"height":"width",N=o.reference[b]-o.floating[R]+A.mainAxis,O=o.reference[b]+o.reference[R]-A.mainAxis;v<N?v=N:v>O&&(v=O)}if(d){var C,T;const R=b==="y"?"width":"height",N=jA.has(ji(r)),O=o.reference[p]-o.floating[R]+(N&&((C=a.offset)==null?void 0:C[p])||0)+(N?0:A.crossAxis),z=o.reference[p]+o.reference[R]+(N?0:((T=a.offset)==null?void 0:T[p])||0)-(N?A.crossAxis:0);S<O?S=O:S>z&&(S=z)}return{[b]:v,[p]:S}}}},$L=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(e){var t,i;const{placement:r,rects:o,platform:a,elements:u}=e,{apply:f=()=>{},...d}=wr(n,e),m=await a.detectOverflow(e,d),p=ji(r),b=Ml(r),v=Qi(r)==="y",{width:S,height:w}=o.floating;let A,C;p==="top"||p==="bottom"?(A=p,C=b===(await(a.isRTL==null?void 0:a.isRTL(u.floating))?"start":"end")?"left":"right"):(C=p,A=b==="end"?"top":"bottom");const T=w-m.top-m.bottom,R=S-m.left-m.right,N=rc(w-m[A],T),O=rc(S-m[C],R),z=!e.middlewareData.shift;let D=N,j=O;if((t=e.middlewareData.shift)!=null&&t.enabled.x&&(j=R),(i=e.middlewareData.shift)!=null&&i.enabled.y&&(D=T),z&&!b){const K=Mi(m.left,0),F=Mi(m.right,0),Y=Mi(m.top,0),V=Mi(m.bottom,0);v?j=S-2*(K!==0||F!==0?K+F:Mi(m.left,m.right)):D=w-2*(Y!==0||V!==0?Y+V:Mi(m.top,m.bottom))}await f({...e,availableWidth:j,availableHeight:D});const B=await a.getDimensions(u.floating);return S!==B.width||w!==B.height?{reset:{rects:!0}}:{}}}};function LA(n){const e=Bi(n);let t=parseFloat(e.width)||0,i=parseFloat(e.height)||0;const r=Qt(n),o=r?n.offsetWidth:t,a=r?n.offsetHeight:i,u=_d(t)!==o||_d(i)!==a;return u&&(t=o,i=a),{width:t,height:i,$:u}}function nv(n){return Tt(n)?n:n.contextElement}function Pa(n){const e=nv(n);if(!Qt(e))return Is(1);const t=e.getBoundingClientRect(),{width:i,height:r,$:o}=LA(e);let a=(o?_d(t.width):t.width)/i,u=(o?_d(t.height):t.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!u||!Number.isFinite(u))&&(u=1),{x:a,y:u}}const ZL=Is(0);function BA(n){const e=xn(n);return!Sm()||!e.visualViewport?ZL:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function JL(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==xn(n)?!1:e}function Ro(n,e,t,i){e===void 0&&(e=!1),t===void 0&&(t=!1);const r=n.getBoundingClientRect(),o=nv(n);let a=Is(1);e&&(i?Tt(i)&&(a=Pa(i)):a=Pa(n));const u=JL(o,t,i)?BA(o):Is(0);let f=(r.left+u.x)/a.x,d=(r.top+u.y)/a.y,m=r.width/a.x,p=r.height/a.y;if(o){const b=xn(o),v=i&&Tt(i)?xn(i):i;let S=b,w=gy(S);for(;w&&i&&v!==S;){const A=Pa(w),C=w.getBoundingClientRect(),T=Bi(w),R=C.left+(w.clientLeft+parseFloat(T.paddingLeft))*A.x,N=C.top+(w.clientTop+parseFloat(T.paddingTop))*A.y;f*=A.x,d*=A.y,m*=A.x,p*=A.y,f+=R,d+=N,S=xn(w),w=gy(S)}}return Vd({width:m,height:p,x:f,y:d})}function Cm(n,e){const t=wm(n).scrollLeft;return e?e.left+t:Ro(qs(n)).left+t}function zA(n,e){const t=n.getBoundingClientRect(),i=t.left+e.scrollLeft-Cm(n,t),r=t.top+e.scrollTop;return{x:i,y:r}}function eB(n){let{elements:e,rect:t,offsetParent:i,strategy:r}=n;const o=r==="fixed",a=qs(i),u=e?xm(e.floating):!1;if(i===a||u&&o)return t;let f={scrollLeft:0,scrollTop:0},d=Is(1);const m=Is(0),p=Qt(i);if((p||!p&&!o)&&((Rl(i)!=="body"||Io(a))&&(f=wm(i)),p)){const v=Ro(i);d=Pa(i),m.x=v.x+i.clientLeft,m.y=v.y+i.clientTop}const b=a&&!p&&!o?zA(a,f):Is(0);return{width:t.width*d.x,height:t.height*d.y,x:t.x*d.x-f.scrollLeft*d.x+m.x+b.x,y:t.y*d.y-f.scrollTop*d.y+m.y+b.y}}function tB(n){return Array.from(n.getClientRects())}function nB(n){const e=qs(n),t=wm(n),i=n.ownerDocument.body,r=Mi(e.scrollWidth,e.clientWidth,i.scrollWidth,i.clientWidth),o=Mi(e.scrollHeight,e.clientHeight,i.scrollHeight,i.clientHeight);let a=-t.scrollLeft+Cm(n);const u=-t.scrollTop;return Bi(i).direction==="rtl"&&(a+=Mi(e.clientWidth,i.clientWidth)-r),{width:r,height:o,x:a,y:u}}const H2=25;function iB(n,e){const t=xn(n),i=qs(n),r=t.visualViewport;let o=i.clientWidth,a=i.clientHeight,u=0,f=0;if(r){o=r.width,a=r.height;const m=Sm();(!m||m&&e==="fixed")&&(u=r.offsetLeft,f=r.offsetTop)}const d=Cm(i);if(d<=0){const m=i.ownerDocument,p=m.body,b=getComputedStyle(p),v=m.compatMode==="CSS1Compat"&&parseFloat(b.marginLeft)+parseFloat(b.marginRight)||0,S=Math.abs(i.clientWidth-p.clientWidth-v);S<=H2&&(o-=S)}else d<=H2&&(o+=d);return{width:o,height:a,x:u,y:f}}function sB(n,e){const t=Ro(n,!0,e==="fixed"),i=t.top+n.clientTop,r=t.left+n.clientLeft,o=Qt(n)?Pa(n):Is(1),a=n.clientWidth*o.x,u=n.clientHeight*o.y,f=r*o.x,d=i*o.y;return{width:a,height:u,x:f,y:d}}function _2(n,e,t){let i;if(e==="viewport")i=iB(n,t);else if(e==="document")i=nB(qs(n));else if(Tt(e))i=sB(e,t);else{const r=BA(n);i={x:e.x-r.x,y:e.y-r.y,width:e.width,height:e.height}}return Vd(i)}function PA(n,e){const t=Us(n);return t===e||!Tt(t)||Ps(t)?!1:Bi(t).position==="fixed"||PA(t,e)}function rB(n,e){const t=e.get(n);if(t)return t;let i=pl(n,[],!1).filter(u=>Tt(u)&&Rl(u)!=="body"),r=null;const o=Bi(n).position==="fixed";let a=o?Us(n):n;for(;Tt(a)&&!Ps(a);){const u=Bi(a),f=Hb(a);!f&&u.position==="fixed"&&(r=null),(o?!f&&!r:!f&&u.position==="static"&&!!r&&(r.position==="absolute"||r.position==="fixed")||Io(a)&&!f&&PA(n,a))?i=i.filter(m=>m!==a):r=u,a=Us(a)}return e.set(n,i),i}function lB(n){let{element:e,boundary:t,rootBoundary:i,strategy:r}=n;const a=[...t==="clippingAncestors"?xm(e)?[]:rB(e,this._c):[].concat(t),i],u=_2(e,a[0],r);let f=u.top,d=u.right,m=u.bottom,p=u.left;for(let b=1;b<a.length;b++){const v=_2(e,a[b],r);f=Mi(v.top,f),d=rc(v.right,d),m=rc(v.bottom,m),p=Mi(v.left,p)}return{width:d-p,height:m-f,x:p,y:f}}function oB(n){const{width:e,height:t}=LA(n);return{width:e,height:t}}function aB(n,e,t){const i=Qt(e),r=qs(e),o=t==="fixed",a=Ro(n,!0,o,e);let u={scrollLeft:0,scrollTop:0};const f=Is(0);function d(){f.x=Cm(r)}if(i||!i&&!o)if((Rl(e)!=="body"||Io(r))&&(u=wm(e)),i){const v=Ro(e,!0,o,e);f.x=v.x+e.clientLeft,f.y=v.y+e.clientTop}else r&&d();o&&!i&&r&&d();const m=r&&!i&&!o?zA(r,u):Is(0),p=a.left+u.scrollLeft-f.x-m.x,b=a.top+u.scrollTop-f.y-m.y;return{x:p,y:b,width:a.width,height:a.height}}function y0(n){return Bi(n).position==="static"}function U2(n,e){if(!Qt(n)||Bi(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return qs(n)===t&&(t=t.ownerDocument.body),t}function IA(n,e){const t=xn(n);if(xm(n))return t;if(!Qt(n)){let r=Us(n);for(;r&&!Ps(r);){if(Tt(r)&&!y0(r))return r;r=Us(r)}return t}let i=U2(n,e);for(;i&&o5(i)&&y0(i);)i=U2(i,e);return i&&Ps(i)&&y0(i)&&!Hb(i)?t:i||u5(n)||t}const cB=async function(n){const e=this.getOffsetParent||IA,t=this.getDimensions,i=await t(n.floating);return{reference:aB(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:i.width,height:i.height}}};function uB(n){return Bi(n).direction==="rtl"}const fB={convertOffsetParentRelativeRectToViewportRelativeRect:eB,getDocumentElement:qs,getClippingRect:lB,getOffsetParent:IA,getElementRects:cB,getClientRects:tB,getDimensions:oB,getScale:Pa,isElement:Tt,isRTL:uB};function HA(n,e){return n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height}function hB(n,e){let t=null,i;const r=qs(n);function o(){var u;clearTimeout(i),(u=t)==null||u.disconnect(),t=null}function a(u,f){u===void 0&&(u=!1),f===void 0&&(f=1),o();const d=n.getBoundingClientRect(),{left:m,top:p,width:b,height:v}=d;if(u||e(),!b||!v)return;const S=Ma(p),w=Ma(r.clientWidth-(m+b)),A=Ma(r.clientHeight-(p+v)),C=Ma(m),R={rootMargin:-S+"px "+-w+"px "+-A+"px "+-C+"px",threshold:Mi(0,rc(1,f))||1};let N=!0;function O(z){const D=z[0].intersectionRatio;if(D!==f){if(!N)return a();D?a(!1,D):i=setTimeout(()=>{a(!1,1e-7)},1e3)}D===1&&!HA(d,n.getBoundingClientRect())&&a(),N=!1}try{t=new IntersectionObserver(O,{...R,root:r.ownerDocument})}catch{t=new IntersectionObserver(O,R)}t.observe(n)}return a(!0),o}function V2(n,e,t,i){i===void 0&&(i={});const{ancestorScroll:r=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:f=!1}=i,d=nv(n),m=r||o?[...d?pl(d):[],...e?pl(e):[]]:[];m.forEach(C=>{r&&C.addEventListener("scroll",t,{passive:!0}),o&&C.addEventListener("resize",t)});const p=d&&u?hB(d,t):null;let b=-1,v=null;a&&(v=new ResizeObserver(C=>{let[T]=C;T&&T.target===d&&v&&e&&(v.unobserve(e),cancelAnimationFrame(b),b=requestAnimationFrame(()=>{var R;(R=v)==null||R.observe(e)})),t()}),d&&!f&&v.observe(d),e&&v.observe(e));let S,w=f?Ro(n):null;f&&A();function A(){const C=Ro(n);w&&!HA(w,C)&&t(),w=C,S=requestAnimationFrame(A)}return t(),()=>{var C;m.forEach(T=>{r&&T.removeEventListener("scroll",t),o&&T.removeEventListener("resize",t)}),p==null||p(),(C=v)==null||C.disconnect(),v=null,f&&cancelAnimationFrame(S)}}const dB=QL,mB=WL,pB=GL,gB=$L,yB=KL,bB=XL,vB=(n,e,t)=>{const i=new Map,r={platform:fB,...t},o={...r.platform,_c:i};return FL(n,e,{...r,platform:o})};var xB=typeof document<"u",SB=function(){},Ed=xB?E.useLayoutEffect:SB;function Yd(n,e){if(n===e)return!0;if(typeof n!=typeof e)return!1;if(typeof n=="function"&&n.toString()===e.toString())return!0;let t,i,r;if(n&&e&&typeof n=="object"){if(Array.isArray(n)){if(t=n.length,t!==e.length)return!1;for(i=t;i--!==0;)if(!Yd(n[i],e[i]))return!1;return!0}if(r=Object.keys(n),t=r.length,t!==Object.keys(e).length)return!1;for(i=t;i--!==0;)if(!{}.hasOwnProperty.call(e,r[i]))return!1;for(i=t;i--!==0;){const o=r[i];if(!(o==="_owner"&&n.$$typeof)&&!Yd(n[o],e[o]))return!1}return!0}return n!==n&&e!==e}function _A(n){return typeof window>"u"?1:(n.ownerDocument.defaultView||window).devicePixelRatio||1}function q2(n,e){const t=_A(n);return Math.round(e*t)/t}function b0(n){const e=E.useRef(n);return Ed(()=>{e.current=n}),e}function wB(n){n===void 0&&(n={});const{placement:e="bottom",strategy:t="absolute",middleware:i=[],platform:r,elements:{reference:o,floating:a}={},transform:u=!0,whileElementsMounted:f,open:d}=n,[m,p]=E.useState({x:0,y:0,strategy:t,placement:e,middlewareData:{},isPositioned:!1}),[b,v]=E.useState(i);Yd(b,i)||v(i);const[S,w]=E.useState(null),[A,C]=E.useState(null),T=E.useCallback(U=>{U!==z.current&&(z.current=U,w(U))},[]),R=E.useCallback(U=>{U!==D.current&&(D.current=U,C(U))},[]),N=o||S,O=a||A,z=E.useRef(null),D=E.useRef(null),j=E.useRef(m),B=f!=null,K=b0(f),F=b0(r),Y=b0(d),V=E.useCallback(()=>{if(!z.current||!D.current)return;const U={placement:e,strategy:t,middleware:b};F.current&&(U.platform=F.current),vB(z.current,D.current,U).then($=>{const Q={...$,isPositioned:Y.current!==!1};Z.current&&!Yd(j.current,Q)&&(j.current=Q,Zi.flushSync(()=>{p(Q)}))})},[b,e,t,F,Y]);Ed(()=>{d===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,p(U=>({...U,isPositioned:!1})))},[d]);const Z=E.useRef(!1);Ed(()=>(Z.current=!0,()=>{Z.current=!1}),[]),Ed(()=>{if(N&&(z.current=N),O&&(D.current=O),N&&O){if(K.current)return K.current(N,O,V);V()}},[N,O,V,K,B]);const q=E.useMemo(()=>({reference:z,floating:D,setReference:T,setFloating:R}),[T,R]),P=E.useMemo(()=>({reference:N,floating:O}),[N,O]),W=E.useMemo(()=>{const U={position:t,left:0,top:0};if(!P.floating)return U;const $=q2(P.floating,m.x),Q=q2(P.floating,m.y);return u?{...U,transform:"translate("+$+"px, "+Q+"px)",..._A(P.floating)>=1.5&&{willChange:"transform"}}:{position:t,left:$,top:Q}},[t,u,P.floating,m.x,m.y]);return E.useMemo(()=>({...m,update:V,refs:q,elements:P,floatingStyles:W}),[m,V,q,P,W])}const kB=(n,e)=>{const t=dB(n);return{name:t.name,fn:t.fn,options:[n,e]}},CB=(n,e)=>{const t=mB(n);return{name:t.name,fn:t.fn,options:[n,e]}},EB=(n,e)=>({fn:bB(n).fn,options:[n,e]}),AB=(n,e)=>{const t=pB(n);return{name:t.name,fn:t.fn,options:[n,e]}},TB=(n,e)=>{const t=gB(n);return{name:t.name,fn:t.fn,options:[n,e]}},RB=(n,e)=>{const t=yB(n);return{name:t.name,fn:t.fn,options:[n,e]}},MB={intentional:"onClick",sloppy:"onPointerDown"};function OB(n){return{escapeKey:typeof n=="boolean"?n:(n==null?void 0:n.escapeKey)??!1,outsidePress:typeof n=="boolean"?n:(n==null?void 0:n.outsidePress)??!0}}function iv(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingElement"),o=t.useState("referenceElement"),a=t.useState("domReferenceElement"),{onOpenChange:u,dataRef:f}=t.context,{enabled:d=!0,escapeKey:m=!0,outsidePress:p=!0,outsidePressEvent:b="sloppy",referencePress:v=!1,referencePressEvent:S="sloppy",ancestorScroll:w=!1,bubbles:A,externalTree:C}=e,T=Ol(C),R=Le(typeof p=="function"?p:()=>!1),N=typeof p=="function"?R:p,O=E.useRef(!1),{escapeKey:z,outsidePress:D}=OB(A),j=E.useRef(null),B=An(),K=An(),F=Le(()=>{K.clear(),f.current.insideReactTree=!1}),Y=E.useRef(!1),V=E.useRef(""),Z=Le(oe=>{V.current=oe.pointerType}),q=Le(()=>{const oe=V.current,xe=oe==="pen"||!oe?"mouse":oe,Se=typeof b=="function"?b():b;return typeof Se=="string"?Se:Se[xe]}),P=Le(oe=>{var pe;if(!i||!d||!m||oe.key!=="Escape"||Y.current)return;const xe=(pe=f.current.floatingContext)==null?void 0:pe.nodeId,Se=T?wo(T.nodesRef.current,xe):[];if(!z&&Se.length>0){let ye=!0;if(Se.forEach(de=>{var Ce;(Ce=de.context)!=null&&Ce.open&&!de.context.dataRef.current.__escapeKeyBubbles&&(ye=!1)}),!ye)return}const Ge=iL(oe)?oe.nativeEvent:oe,De=Je(Fb,Ge);t.setOpen(!1,De),!z&&!De.isPropagationAllowed&&oe.stopPropagation()}),W=Le(oe=>{const xe=q();return xe==="intentional"&&oe.type!=="click"||xe==="sloppy"&&oe.type==="click"}),U=Le(()=>{f.current.insideReactTree=!0,K.start(0,F)}),$=Le((oe,xe=!1)=>{var Re;if(W(oe)){F();return}if(f.current.insideReactTree){F();return}if(q()==="intentional"&&xe||typeof N=="function"&&!N(oe))return;const Se=ei(oe),Ge=`[${oc("inert")}]`,De=an(t.select("floatingElement")).querySelectorAll(Ge),pe=t.context.triggerElements;if(Se&&(pe.hasElement(Se)||pe.hasMatchingElement(Me=>ft(Me,Se))))return;let ye=Tt(Se)?Se:null;for(;ye&&!Ps(ye);){const Me=Us(ye);if(Ps(Me)||!Tt(Me))break;ye=Me}if(De.length&&Tt(Se)&&!tL(Se)&&!ft(Se,t.select("floatingElement"))&&Array.from(De).every(Me=>!ft(ye,Me)))return;if(Qt(Se)&&!("touches"in oe)){const Me=Ps(Se),be=Bi(Se),we=/auto|scroll/,ve=Me||we.test(be.overflowX),We=Me||we.test(be.overflowY),nt=ve&&Se.clientWidth>0&&Se.scrollWidth>Se.clientWidth,Qe=We&&Se.clientHeight>0&&Se.scrollHeight>Se.clientHeight,ht=be.direction==="rtl",lt=Qe&&(ht?oe.offsetX<=Se.offsetWidth-Se.clientWidth:oe.offsetX>Se.clientWidth),Ft=nt&&oe.offsetY>Se.clientHeight;if(lt||Ft)return}const de=(Re=f.current.floatingContext)==null?void 0:Re.nodeId,Ce=T&&wo(T.nodesRef.current,de).some(Me=>{var be;return ss(oe,(be=Me.context)==null?void 0:be.elements.floating)});if(ss(oe,t.select("floatingElement"))||ss(oe,t.select("domReferenceElement"))||Ce)return;const Te=T?wo(T.nodesRef.current,de):[];if(Te.length>0){let Me=!0;if(Te.forEach(be=>{var we;(we=be.context)!=null&&we.open&&!be.context.dataRef.current.__outsidePressBubbles&&(Me=!1)}),!Me)return}t.setOpen(!1,Je(qb,oe)),F()}),Q=Le(oe=>{q()!=="sloppy"||oe.pointerType==="touch"||!t.select("open")||!d||ss(oe,t.select("floatingElement"))||ss(oe,t.select("domReferenceElement"))||$(oe)}),L=Le(oe=>{if(q()!=="sloppy"||!t.select("open")||!d||ss(oe,t.select("floatingElement"))||ss(oe,t.select("domReferenceElement")))return;const xe=oe.touches[0];xe&&(j.current={startTime:Date.now(),startX:xe.clientX,startY:xe.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},B.start(1e3,()=>{j.current&&(j.current.dismissOnTouchEnd=!1,j.current.dismissOnMouseDown=!1)}))}),_=Le(oe=>{const xe=ei(oe);function Se(){L(oe),xe==null||xe.removeEventListener(oe.type,Se)}xe==null||xe.addEventListener(oe.type,Se)}),J=Le(oe=>{const xe=O.current;if(O.current=!1,B.clear(),oe.type==="mousedown"&&j.current&&!j.current.dismissOnMouseDown)return;const Se=ei(oe);function Ge(){oe.type==="pointerdown"?Q(oe):$(oe,xe),Se==null||Se.removeEventListener(oe.type,Ge)}Se==null||Se.addEventListener(oe.type,Ge)}),le=Le(oe=>{if(q()!=="sloppy"||!j.current||ss(oe,t.select("floatingElement"))||ss(oe,t.select("domReferenceElement")))return;const xe=oe.touches[0];if(!xe)return;const Se=Math.abs(xe.clientX-j.current.startX),Ge=Math.abs(xe.clientY-j.current.startY),De=Math.sqrt(Se*Se+Ge*Ge);De>5&&(j.current.dismissOnTouchEnd=!0),De>10&&($(oe),B.clear(),j.current=null)}),ae=Le(oe=>{const xe=ei(oe);function Se(){le(oe),xe==null||xe.removeEventListener(oe.type,Se)}xe==null||xe.addEventListener(oe.type,Se)}),ee=Le(oe=>{q()!=="sloppy"||!j.current||ss(oe,t.select("floatingElement"))||ss(oe,t.select("domReferenceElement"))||(j.current.dismissOnTouchEnd&&$(oe),B.clear(),j.current=null)}),se=Le(oe=>{const xe=ei(oe);function Se(){ee(oe),xe==null||xe.removeEventListener(oe.type,Se)}xe==null||xe.addEventListener(oe.type,Se)});E.useEffect(()=>{if(!i||!d)return;f.current.__escapeKeyBubbles=z,f.current.__outsidePressBubbles=D;const oe=new To;function xe(ye){t.setOpen(!1,Je(km,ye))}function Se(){oe.clear(),Y.current=!0}function Ge(){oe.start(Sm()?5:0,()=>{Y.current=!1})}const De=an(r);De.addEventListener("pointerdown",Z,!0),m&&(De.addEventListener("keydown",P),De.addEventListener("compositionstart",Se),De.addEventListener("compositionend",Ge)),N&&(De.addEventListener("click",J,!0),De.addEventListener("pointerdown",J,!0),De.addEventListener("touchstart",_,!0),De.addEventListener("touchmove",ae,!0),De.addEventListener("touchend",se,!0),De.addEventListener("mousedown",J,!0));let pe=[];return w&&(Tt(a)&&(pe=pl(a)),Tt(r)&&(pe=pe.concat(pl(r))),!Tt(o)&&o&&o.contextElement&&(pe=pe.concat(pl(o.contextElement)))),pe=pe.filter(ye=>{var de;return ye!==((de=De.defaultView)==null?void 0:de.visualViewport)}),pe.forEach(ye=>{ye.addEventListener("scroll",xe,{passive:!0})}),()=>{De.removeEventListener("pointerdown",Z,!0),m&&(De.removeEventListener("keydown",P),De.removeEventListener("compositionstart",Se),De.removeEventListener("compositionend",Ge)),N&&(De.removeEventListener("click",J,!0),De.removeEventListener("pointerdown",J,!0),De.removeEventListener("touchstart",_,!0),De.removeEventListener("touchmove",ae,!0),De.removeEventListener("touchend",se,!0),De.removeEventListener("mousedown",J,!0)),pe.forEach(ye=>{ye.removeEventListener("scroll",xe)}),oe.clear()}},[f,r,o,a,m,N,i,u,w,d,z,D,P,$,J,Q,_,ae,se,Z,t]),E.useEffect(F,[N,F]);const fe=E.useMemo(()=>({onKeyDown:P,...v&&{[MB[S]]:oe=>{t.setOpen(!1,Je(So,oe.nativeEvent))},...S!=="intentional"&&{onClick(oe){t.setOpen(!1,Je(So,oe.nativeEvent))}}}}),[P,t,v,S]),me=Le(oe=>{const xe=ei(oe.nativeEvent);!ft(t.select("floatingElement"),xe)||oe.button!==0||(O.current=!0)}),Ne=E.useMemo(()=>({onKeyDown:P,onPointerDown:me,onMouseDown:me,onMouseUp:me,onClickCapture:U,onMouseDownCapture:U,onPointerDownCapture:U,onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[P,me,U]);return E.useMemo(()=>d?{reference:fe,floating:Ne,trigger:fe}:{},[d,fe,Ne])}const NB={open:Ae(n=>n.open),domReferenceElement:Ae(n=>n.domReferenceElement),referenceElement:Ae(n=>n.positionReference??n.referenceElement),floatingElement:Ae(n=>n.floatingElement),floatingId:Ae(n=>n.floatingId)};class sv extends Gb{constructor(t){const{nested:i,noEmit:r,onOpenChange:o,triggerElements:a,...u}=t;super({...u,positionReference:u.referenceElement,domReferenceElement:u.referenceElement},{onOpenChange:o,dataRef:{current:{}},events:EA(),nested:i,noEmit:r,triggerElements:a},NB);Dt(this,"setOpen",(t,i)=>{var r,o;if((!t||!this.state.open||cA(i.event))&&(this.context.dataRef.current.openEvent=t?i.event:void 0),!this.context.noEmit){const a={open:t,reason:i.reason,nativeEvent:i.event,nested:this.context.nested,triggerElement:i.trigger};this.context.events.emit("openchange",a)}(o=(r=this.context).onOpenChange)==null||o.call(r,t,i)})}}function rv(n,e=!1,t=!1){const[i,r]=E.useState(n&&e?"idle":void 0),[o,a]=E.useState(n);return n&&!o&&(a(!0),r("starting")),!n&&o&&i!=="ending"&&!t&&r("ending"),!n&&!o&&i==="ending"&&r(void 0),Pe(()=>{if(!n&&o&&i!=="ending"&&t){const u=Rs.request(()=>{r("ending")});return()=>{Rs.cancel(u)}}},[n,o,i,t]),Pe(()=>{if(!n||e)return;const u=Rs.request(()=>{Zi.flushSync(()=>{r(void 0)})});return()=>{Rs.cancel(u)}},[e,n]),Pe(()=>{if(!n||!e)return;n&&o&&i!=="idle"&&r("starting");const u=Rs.request(()=>{r("idle")});return()=>{Rs.cancel(u)}},[e,n,o,r,i]),E.useMemo(()=>({mounted:o,setMounted:a,transitionStatus:i}),[o,i])}function DB(n,e=!1,t=!0){const i=df();return Le((r,o=null)=>{i.cancel();const a=no(n);a!=null&&(typeof a.getAnimations!="function"||globalThis.BASE_UI_ANIMATIONS_DISABLED?r():i.request(()=>{function u(){a&&Promise.all(a.getAnimations().map(f=>f.finished)).then(()=>{o!=null&&o.aborted||Zi.flushSync(r)}).catch(()=>{if(t){if(o!=null&&o.aborted)return;Zi.flushSync(r)}else a.getAnimations().length>0&&a.getAnimations().some(f=>f.pending||f.playState!=="finished")&&u()})}e?i.request(u):u()}))})}function Sc(n){const{enabled:e=!0,open:t,ref:i,onComplete:r}=n,o=bn(t),a=Le(r),u=DB(i,t);E.useEffect(()=>{e&&u(()=>{t===o.current&&a()})},[e,t,a,u,o])}function jB(n,e){const t=E.useRef(null);return E.useCallback(i=>{if(n!==void 0&&(t.current!==null&&(e.context.triggerElements.delete(t.current),t.current=null),i!==null))return t.current=n,e.context.triggerElements.add(n,i),()=>{t.current!==null&&(e.context.triggerElements.delete(t.current),t.current=null)}},[e,n])}function LB(n,e,t,i){const r=t.useState("isMountedByTrigger",n),o=jB(n,t),a=Le(u=>{const f=o(u);return u!==null&&t.select("open")&&t.select("activeTriggerId")==null&&t.update({activeTriggerId:n,activeTriggerElement:u,...i}),f});return Pe(()=>{r&&t.update({activeTriggerElement:e.current,...i})},[r,t,e,...Object.values(i)]),{registerTrigger:a,isMountedByThisTrigger:r}}function UA(n){const e=n.useState("open");Pe(()=>{if(e&&!n.select("activeTriggerId")&&n.context.triggerElements.size===1){const t=n.context.triggerElements.entries().next();if(!t.done){const[i,r]=t.value;n.update({activeTriggerId:i,activeTriggerElement:r})}}},[e,n])}function VA(n,e,t){const{mounted:i,setMounted:r,transitionStatus:o}=rv(n);e.useSyncedValues({mounted:i,transitionStatus:o});const a=Le(()=>{var f,d;r(!1),e.update({activeTriggerId:null,activeTriggerElement:null,mounted:!1}),t==null||t(),(d=(f=e.context).onOpenChangeComplete)==null||d.call(f,!1)}),u=e.useState("preventUnmountingOnClose");return Sc({enabled:!u,open:n,ref:e.context.popupRef,onComplete(){n||a()}}),{forceUnmount:a,transitionStatus:o}}class Em{constructor(){this.elements=new Set,this.idMap=new Map}add(e,t){const i=this.idMap.get(e);i!==t&&(i!==void 0&&this.elements.delete(i),this.elements.add(t),this.idMap.set(e,t))}delete(e){const t=this.idMap.get(e);t&&(this.elements.delete(t),this.idMap.delete(e))}hasElement(e){return this.elements.has(e)}hasMatchingElement(e){for(const t of this.elements)if(e(t))return!0;return!1}getById(e){return this.idMap.get(e)}entries(){return this.idMap.entries()}get size(){return this.idMap.size}}function BB(){return new sv({open:!1,floatingElement:null,referenceElement:null,triggerElements:new Em,floatingId:"",nested:!1,noEmit:!1,onOpenChange:void 0})}function qA(){return{open:!1,mounted:!1,transitionStatus:"idle",floatingRootContext:BB(),preventUnmountingOnClose:!1,payload:void 0,activeTriggerId:null,activeTriggerElement:null,popupElement:null,positionerElement:null,activeTriggerProps:cn,inactiveTriggerProps:cn,popupProps:cn}}const FA={open:Ae(n=>n.open),mounted:Ae(n=>n.mounted),transitionStatus:Ae(n=>n.transitionStatus),floatingRootContext:Ae(n=>n.floatingRootContext),preventUnmountingOnClose:Ae(n=>n.preventUnmountingOnClose),payload:Ae(n=>n.payload),activeTriggerId:Ae(n=>n.activeTriggerId),activeTriggerElement:Ae(n=>n.mounted?n.activeTriggerElement:null),isTriggerActive:Ae((n,e)=>e!==void 0&&n.activeTriggerId===e),isOpenedByTrigger:Ae((n,e)=>e!==void 0&&n.activeTriggerId===e&&n.open),isMountedByTrigger:Ae((n,e)=>e!==void 0&&n.activeTriggerId===e&&n.mounted),triggerProps:Ae((n,e)=>e?n.activeTriggerProps:n.inactiveTriggerProps),popupProps:Ae(n=>n.popupProps),popupElement:Ae(n=>n.popupElement),positionerElement:Ae(n=>n.positionerElement)};function GA(n){const{open:e=!1,onOpenChange:t,elements:i={}}=n,r=Po(),o=Cr()!=null,a=pi(()=>new sv({open:e,onOpenChange:t,referenceElement:i.reference??null,floatingElement:i.floating??null,triggerElements:i.triggers??new Em,floatingId:r,nested:o,noEmit:n.noEmit||!1})).current;return Pe(()=>{const u={open:e,floatingId:r};i.reference!==void 0&&(u.referenceElement=i.reference,u.domReferenceElement=Tt(i.reference)?i.reference:null),i.floating!==void 0&&(u.floatingElement=i.floating),a.update(u)},[e,r,i.reference,i.floating,a]),a.context.onOpenChange=t,a.context.nested=o,a.context.noEmit=n.noEmit||!1,a}function zB(n={}){const{nodeId:e,externalTree:t}=n,i=GA(n),r=n.rootContext||i,o={reference:r.useState("referenceElement"),floating:r.useState("floatingElement"),domReference:r.useState("domReferenceElement")},[a,u]=E.useState(null),f=E.useRef(null),d=Ol(t);Pe(()=>{o.domReference&&(f.current=o.domReference)},[o.domReference]);const m=wB({...n,elements:{...o,...a&&{reference:a}}}),p=E.useCallback(D=>{const j=Tt(D)?{getBoundingClientRect:()=>D.getBoundingClientRect(),getClientRects:()=>D.getClientRects(),contextElement:D}:D;u(j),m.refs.setReference(j)},[m.refs]),[b,v]=E.useState(null),[S,w]=E.useState(null);r.useSyncedValue("referenceElement",b),r.useSyncedValue("domReferenceElement",Tt(b)?b:null),r.useSyncedValue("floatingElement",S);const A=E.useCallback(D=>{(Tt(D)||D===null)&&(f.current=D,v(D)),(Tt(m.refs.reference.current)||m.refs.reference.current===null||D!==null&&!Tt(D))&&m.refs.setReference(D)},[m.refs,v]),C=E.useCallback(D=>{w(D),m.refs.setFloating(D)},[m.refs]),T=E.useMemo(()=>({...m.refs,setReference:A,setFloating:C,setPositionReference:p,domReference:f}),[m.refs,A,C,p]),R=E.useMemo(()=>({...m.elements,domReference:o.domReference}),[m.elements,o.domReference]),N=r.useState("open"),O=r.useState("floatingId"),z=E.useMemo(()=>({...m,dataRef:r.context.dataRef,open:N,onOpenChange:r.setOpen,events:r.context.events,floatingId:O,refs:T,elements:R,nodeId:e,rootStore:r}),[m,T,R,e,r,N,O]);return Pe(()=>{r.context.dataRef.current.floatingContext=z;const D=d==null?void 0:d.nodesRef.current.find(j=>j.id===e);D&&(D.context=z)}),E.useMemo(()=>({...m,context:z,refs:T,elements:R,rootStore:r}),[m,T,R,z,r])}function KA(n){const{popupStore:e,noEmit:t=!1,treatPopupAsFloatingElement:i=!1,onOpenChange:r}=n,o=Po(),a=Cr()!=null,u=e.useState("open"),f=e.useState("activeTriggerElement"),d=e.useState(i?"popupElement":"positionerElement"),m=e.context.triggerElements,p=pi(()=>new sv({open:u,referenceElement:f,floatingElement:d,triggerElements:m,onOpenChange:r,floatingId:o,nested:a,noEmit:t})).current;return Pe(()=>{const b={open:u,floatingId:o,referenceElement:f,floatingElement:d};Tt(f)&&(b.domReferenceElement=f),p.update(b)},[u,o,f,d,p]),p.context.onOpenChange=r,p.context.nested=a,p.context.noEmit=t,p}const v0=$5&&nA;function PB(n,e={}){const t="rootStore"in n?n.rootStore:n,{events:i,dataRef:r}=t.context,{enabled:o=!0,visibleOnly:a=!0}=e,u=E.useRef(!1),f=An(),d=E.useRef(!0);E.useEffect(()=>{const p=t.select("domReferenceElement");if(!o)return;const b=xn(p);function v(){!t.select("open")&&Qt(p)&&p===Ms(an(p))&&(u.current=!0)}function S(){d.current=!0}function w(){d.current=!1}return b.addEventListener("blur",v),v0&&(b.addEventListener("keydown",S,!0),b.addEventListener("pointerdown",w,!0)),()=>{b.removeEventListener("blur",v),v0&&(b.removeEventListener("keydown",S,!0),b.removeEventListener("pointerdown",w,!0))}},[t,o]),E.useEffect(()=>{if(!o)return;function p(b){(b.reason===So||b.reason===Fb)&&(u.current=!0)}return i.on("openchange",p),()=>{i.off("openchange",p)}},[i,o]);const m=E.useMemo(()=>({onMouseLeave(){u.current=!1},onFocus(p){if(u.current)return;const b=ei(p.nativeEvent);if(a&&Tt(b)){if(v0&&!p.relatedTarget){if(!d.current&&!Yb(b))return}else if(!nL(b))return}t.setOpen(!0,Je(Id,p.nativeEvent,p.currentTarget))},onBlur(p){u.current=!1;const b=p.relatedTarget,v=p.nativeEvent,S=Tt(b)&&b.hasAttribute(oc("focus-guard"))&&b.getAttribute("data-type")==="outside";f.start(0,()=>{var C;const w=t.select("domReferenceElement"),A=Ms(w?w.ownerDocument:document);!b&&A===w||ft((C=r.current.floatingContext)==null?void 0:C.refs.floating.current,A)||ft(w,A)||S||t.context.triggerElements.hasElement(p.relatedTarget)||t.setOpen(!1,Je(Id,v))})}}),[r,t,a,f]);return E.useMemo(()=>o?{reference:m,trigger:m}:{},[o,m])}const Ey=oc("safe-polygon"),IB=`button,a,[role="button"],select,[tabindex]:not([tabindex="-1"]),${lA}`;function HB(n){return n?!!n.closest(IB):!1}function YA(n){const e=E.useRef(void 0),t=E.useRef(!1),i=E.useRef(void 0),r=E.useRef(!0),o=E.useRef(!1),a=E.useRef(()=>{}),u=E.useRef(!1),f=An(),d=An(),m=E.useRef(void 0);return E.useMemo(()=>{const p=n.context.dataRef.current;return p.hoverInteractionState||(p.hoverInteractionState={pointerTypeRef:e,interactedInsideRef:t,handlerRef:i,blockMouseMoveRef:r,performedPointerEventsMutationRef:o,unbindMouseMoveRef:a,restTimeoutPendingRef:u,openChangeTimeout:f,restTimeout:d,handleCloseOptionsRef:m}),p.hoverInteractionState},[n,e,t,i,r,o,a,u,f,d,m])}const _B=new Set(["click","mousedown"]);function UB(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingElement"),o=t.useState("domReferenceElement"),{dataRef:a}=t.context,{enabled:u=!0,closeDelay:f=0,externalTree:d}=e,{pointerTypeRef:m,interactedInsideRef:p,handlerRef:b,performedPointerEventsMutationRef:v,unbindMouseMoveRef:S,restTimeoutPendingRef:w,openChangeTimeout:A,handleCloseOptionsRef:C}=YA(t),T=Ol(d),R=Cr(),N=Le(()=>p.current?!0:a.current.openEvent?_B.has(a.current.openEvent.type):!1),O=Le(()=>{var F;const K=(F=a.current.openEvent)==null?void 0:F.type;return(K==null?void 0:K.includes("mouse"))&&K!=="mousedown"}),z=E.useCallback((K,F=!0)=>{const Y=VB(f,m.current);Y&&!b.current?A.start(Y,()=>t.setOpen(!1,Je(Ni,K))):F&&(A.clear(),t.setOpen(!1,Je(Ni,K)))},[f,b,t,m,A]),D=Le(()=>{S.current(),b.current=void 0}),j=Le(()=>{if(v.current){const K=an(r).body;K.style.pointerEvents="",K.removeAttribute(Ey),v.current=!1}}),B=Le(K=>{const F=ei(K);if(!HB(F)){p.current=!1;return}p.current=!0});Pe(()=>{i||(m.current=void 0,w.current=!1,p.current=!1,D(),j())},[i,m,w,p,D,j]),E.useEffect(()=>()=>{D()},[D]),E.useEffect(()=>j,[j]),Pe(()=>{var K,F,Y;if(u&&i&&(K=C.current)!=null&&K.blockPointerEvents&&O()&&Tt(o)&&r){v.current=!0;const V=an(r).body;V.setAttribute(Ey,"");const Z=o,q=r,P=(Y=(F=T==null?void 0:T.nodesRef.current.find(W=>W.id===R))==null?void 0:F.context)==null?void 0:Y.elements.floating;return P&&(P.style.pointerEvents=""),V.style.pointerEvents="none",Z.style.pointerEvents="auto",q.style.pointerEvents="auto",()=>{V.style.pointerEvents="",Z.style.pointerEvents="",q.style.pointerEvents=""}}},[u,i,o,r,C,O,T,R,v]),E.useEffect(()=>{if(!u)return;function K(Z){if(N()||!a.current.floatingContext)return;const q=t.context.triggerElements;Z.relatedTarget&&q.hasElement(Z.relatedTarget)||(j(),D(),N()||z(Z))}function F(Z){var q;A.clear(),j(),(q=b.current)==null||q.call(b,Z),D()}function Y(Z){N()||z(Z,!1)}const V=r;return V&&(V.addEventListener("mouseleave",K),V.addEventListener("mouseenter",F),V.addEventListener("mouseleave",Y),V.addEventListener("pointerdown",B,!0)),()=>{V&&(V.removeEventListener("mouseleave",K),V.removeEventListener("mouseenter",F),V.removeEventListener("mouseleave",Y),V.removeEventListener("pointerdown",B,!0))}})}function VB(n,e){return e&&!sc(e)?0:typeof n=="function"?n():n}function x0(n){return typeof n=="function"?n():n}const qB={current:null};function FB(n,e={}){var W;const t="rootStore"in n?n.rootStore:n,{dataRef:i,events:r}=t.context,{enabled:o=!0,delay:a=0,handleClose:u=null,mouseOnly:f=!1,restMs:d=0,move:m=!0,triggerElementRef:p=qB,externalTree:b,isActiveTrigger:v=!0}=e,S=Ol(b),{pointerTypeRef:w,interactedInsideRef:A,handlerRef:C,blockMouseMoveRef:T,performedPointerEventsMutationRef:R,unbindMouseMoveRef:N,restTimeoutPendingRef:O,openChangeTimeout:z,restTimeout:D,handleCloseOptionsRef:j}=YA(t),B=bn(u),K=bn(a),F=bn(d);v&&(j.current=(W=B.current)==null?void 0:W.__options);const Y=Le(()=>A.current?!0:i.current.openEvent?["click","mousedown"].includes(i.current.openEvent.type):!1),V=E.useCallback((U,$=!0)=>{const Q=m0(K.current,"close",w.current);Q&&!C.current?z.start(Q,()=>t.setOpen(!1,Je(Ni,U))):$&&(z.clear(),t.setOpen(!1,Je(Ni,U)))},[K,C,t,w,z]),Z=Le(()=>{N.current(),C.current=void 0}),q=Le(()=>{if(R.current){const U=an(t.select("domReferenceElement")).body;U.style.pointerEvents="",U.removeAttribute(Ey),R.current=!1}});E.useEffect(()=>{if(!o)return;function U($){$.open||(z.clear(),D.clear(),T.current=!0,O.current=!1)}return r.on("openchange",U),()=>{r.off("openchange",U)}},[o,r,z,D,T,O]);const P=Le(U=>{var Q;if(Y()||!i.current.floatingContext)return;const $=t.context.triggerElements;U.relatedTarget&&$.hasElement(U.relatedTarget)||(Q=B.current)==null||Q.call(B,{...i.current.floatingContext,tree:S,x:U.clientX,y:U.clientY,onClose(){q(),Z(),Y()||V(U)}})(U)});return E.useEffect(()=>{if(!o)return;const U=p.current??(v?t.select("domReferenceElement"):null);if(!Tt(U))return;function $(_){if(z.clear(),T.current=!1,f&&!sc(w.current)||x0(F.current)>0&&!m0(K.current,"open"))return;const J=m0(K.current,"open",w.current),le=t.select("domReferenceElement"),ae=t.context.triggerElements,ee=(ae.hasElement(_.target)||ae.hasMatchingElement(fe=>ft(fe,_.target)))&&(!le||!ft(le,_.target)),se=_.currentTarget??null;J?z.start(J,()=>{t.select("open")||t.setOpen(!0,Je(Ni,_,se))}):(!t.select("open")||ee)&&t.setOpen(!0,Je(Ni,_,se))}function Q(_){if(Y()){q();return}N.current();const J=t.select("domReferenceElement"),le=an(J);D.clear(),O.current=!1;const ae=t.context.triggerElements;if(_.relatedTarget&&ae.hasElement(_.relatedTarget))return;if(B.current&&i.current.floatingContext){t.select("open")||z.clear(),C.current=B.current({...i.current.floatingContext,tree:S,x:_.clientX,y:_.clientY,onClose(){q(),Z(),Y()||V(_,!0)}});const se=C.current;se(_),le.addEventListener("mousemove",se),N.current=()=>{le.removeEventListener("mousemove",se)};return}(w.current==="touch"?!ft(t.select("floatingElement"),_.relatedTarget):!0)&&V(_)}function L(_){P(_)}return t.select("open")&&U.addEventListener("mouseleave",L),m&&U.addEventListener("mousemove",$,{once:!0}),U.addEventListener("mouseenter",$),U.addEventListener("mouseleave",Q),()=>{U.removeEventListener("mouseleave",L),m&&U.removeEventListener("mousemove",$),U.removeEventListener("mouseenter",$),U.removeEventListener("mouseleave",Q)}},[Z,q,T,i,K,V,t,o,B,P,v,Y,f,m,w,F,D,O,z,p,S,N,C]),E.useMemo(()=>{function U($){w.current=$.pointerType}return{onPointerDown:U,onPointerEnter:U,onMouseMove($){const{nativeEvent:Q}=$,L=$.currentTarget,_=t.select("domReferenceElement"),J=t.context.triggerElements,le=t.select("open"),ae=(J.hasElement($.target)||J.hasMatchingElement(se=>ft(se,$.target)))&&(!_||!ft(_,$.target));if(f&&!sc(w.current)||le&&!ae||x0(F.current)===0||!ae&&O.current&&$.movementX**2+$.movementY**2<2)return;D.clear();function ee(){!T.current&&(!le||ae)&&t.setOpen(!0,Je(Ni,Q,L))}w.current==="touch"?Zi.flushSync(()=>{ee()}):ae&&le?ee():(O.current=!0,D.start(x0(F.current),ee))}}},[T,f,t,w,F,D,O])}function Am(n=[]){const e=n.map(d=>d==null?void 0:d.reference),t=n.map(d=>d==null?void 0:d.floating),i=n.map(d=>d==null?void 0:d.item),r=n.map(d=>d==null?void 0:d.trigger),o=E.useCallback(d=>Xh(d,n,"reference"),e),a=E.useCallback(d=>Xh(d,n,"floating"),t),u=E.useCallback(d=>Xh(d,n,"item"),i),f=E.useCallback(d=>Xh(d,n,"trigger"),r);return E.useMemo(()=>({getReferenceProps:o,getFloatingProps:a,getItemProps:u,getTriggerProps:f}),[o,a,u,f])}function Xh(n,e,t){var a;const i=new Map,r=t==="item",o={};t==="floating"&&(o.tabIndex=-1,o[by]="");for(const u in n)r&&n&&(u===sA||u===rA)||(o[u]=n[u]);for(let u=0;u<e.length;u+=1){let f;const d=(a=e[u])==null?void 0:a[t];typeof d=="function"?f=n?d(n):null:f=d,f&&F2(o,f,r,i)}return F2(o,n,r,i),o}function F2(n,e,t,i){var r;for(const o in e){const a=e[o];t&&(o===sA||o===rA)||(o.startsWith("on")?(i.has(o)||i.set(o,[]),typeof a=="function"&&((r=i.get(o))==null||r.push(a),n[o]=(...u)=>{var f;return(f=i.get(o))==null?void 0:f.map(d=>d(...u)).find(d=>d!==void 0)})):n[o]=a)}}const GB="Escape";function Tm(n,e,t){switch(n){case"vertical":return e;case"horizontal":return t;default:return e||t}}function $h(n,e){return Tm(e,n===Kb||n===mf,n===gl||n===yl)}function S0(n,e,t){return Tm(e,n===mf,t?n===gl:n===yl)||n==="Enter"||n===" "||n===""}function KB(n,e,t){return Tm(e,t?n===gl:n===yl,n===mf)}function YB(n,e,t,i){const r=t?n===yl:n===gl,o=n===Kb;return e==="both"||e==="horizontal"&&i&&i>1?n===GB:Tm(e,r,o)}function QA(n,e){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingElement"),o=t.useState("domReferenceElement"),a=t.context.dataRef,{listRef:u,activeIndex:f,onNavigate:d=()=>{},enabled:m=!0,selectedIndex:p=null,allowEscape:b=!1,loopFocus:v=!1,nested:S=!1,rtl:w=!1,virtual:A=!1,focusItemOnOpen:C="auto",focusItemOnHover:T=!0,openOnArrowKeyDown:R=!0,disabledIndices:N=void 0,orientation:O="vertical",parentOrientation:z,cols:D=1,scrollItemIntoView:j=!0,itemSizes:B,dense:K=!1,id:F,resetOnPointerLeave:Y=!0,externalTree:V}=e,Z=Gu(r),q=bn(Z),P=Cr(),W=Ol(V);Pe(()=>{a.current.orientation=O},[a,O]);const U=vy(o),$=E.useRef(C),Q=E.useRef(p??-1),L=E.useRef(null),_=E.useRef(!0),J=Le(be=>{d(Q.current===-1?null:Q.current,be)}),le=E.useRef(J),ae=E.useRef(!!r),ee=E.useRef(i),se=E.useRef(!1),fe=E.useRef(!1),me=bn(N),Ne=bn(i),oe=bn(j),xe=bn(p),Se=bn(Y),Ge=Le(()=>{function be(nt){A?W==null||W.events.emit("virtualfocus",nt):Cd(nt,{sync:se.current,preventScroll:!0})}const we=u.current[Q.current],ve=fe.current;we&&be(we),(se.current?nt=>nt():requestAnimationFrame)(()=>{var lt;const nt=u.current[Q.current]||we;if(!nt)return;we||be(nt);const Qe=oe.current;Qe&&pe&&(ve||!_.current)&&((lt=nt.scrollIntoView)==null||lt.call(nt,typeof Qe=="boolean"?{block:"nearest",inline:"nearest"}:Qe))})});Pe(()=>{m&&(i&&r?(Q.current=p??-1,$.current&&p!=null&&(fe.current=!0,J())):ae.current&&(Q.current=-1,le.current()))},[m,i,r,p,J]),Pe(()=>{if(m){if(!i){se.current=!1;return}if(r)if(f==null){if(se.current=!1,xe.current!=null)return;if(ae.current&&(Q.current=-1,Ge()),(!ee.current||!ae.current)&&$.current&&(L.current!=null||$.current===!0&&L.current==null)){let be=0;const we=()=>{u.current[0]==null?(be<2&&(be?requestAnimationFrame:queueMicrotask)(we),be+=1):(Q.current=L.current==null||S0(L.current,O,w)||S?kd(u):wy(u),L.current=null,J())};we()}}else La(u,f)||(Q.current=f,Ge(),fe.current=!1)}},[m,i,r,f,xe,S,u,O,w,J,Ge,me]),Pe(()=>{var nt,Qe;if(!m||r||!W||A||!ae.current)return;const be=W.nodesRef.current,we=(Qe=(nt=be.find(ht=>ht.id===P))==null?void 0:nt.context)==null?void 0:Qe.elements.floating,ve=Ms(an(r)),We=be.some(ht=>ht.context&&ft(ht.context.elements.floating,ve));we&&!We&&_.current&&we.focus({preventScroll:!0})},[m,r,W,P,A]),Pe(()=>{le.current=J,ee.current=i,ae.current=!!r}),Pe(()=>{i||(L.current=null,$.current=C)},[i,C]);const De=f!=null,pe=E.useMemo(()=>{function be(ve){if(!Ne.current)return;const We=u.current.indexOf(ve.currentTarget);We!==-1&&Q.current!==We&&(Q.current=We,J(ve))}return{onFocus(ve){se.current=!0,be(ve)},onClick:({currentTarget:ve})=>ve.focus({preventScroll:!0}),onMouseMove(ve){se.current=!0,fe.current=!1,T&&be(ve)},onPointerLeave(ve){var nt;if(!Ne.current||!_.current||ve.pointerType==="touch")return;se.current=!0;const We=ve.relatedTarget;!T||u.current.includes(We)||Se.current&&(Q.current=-1,J(ve),A||(nt=q.current)==null||nt.focus({preventScroll:!0}))}}},[Ne,q,T,u,J,Se,A]),ye=E.useCallback(()=>{var be,we,ve;return z??((ve=(we=(be=W==null?void 0:W.nodesRef.current.find(We=>We.id===P))==null?void 0:be.context)==null?void 0:we.dataRef)==null?void 0:ve.current.orientation)},[P,W,z]),de=Le(be=>{if(_.current=!1,se.current=!0,be.which===229||!Ne.current&&be.currentTarget===q.current)return;if(S&&YB(be.key,O,w,D)){$h(be.key,ye())||Gn(be),t.setOpen(!1,Je(wd,be.nativeEvent)),Qt(o)&&(A?W==null||W.events.emit("virtualfocus",o):o.focus());return}const we=Q.current,ve=kd(u,N),We=wy(u,N);if(U||(be.key==="Home"&&(Gn(be),Q.current=ve,J(be)),be.key==="End"&&(Gn(be),Q.current=We,J(be))),D>1){const nt=B||Array.from({length:u.current.length},()=>({width:1,height:1})),Qe=hA(nt,D,K),ht=Qe.findIndex(sn=>sn!=null&&!bl(u,sn,N)),lt=Qe.reduce((sn,Pt,He)=>Pt!=null&&!bl(u,Pt,N)?He:sn,-1),Ft=Qe[fA({current:Qe.map(sn=>sn!=null?u.current[sn]:null)},{event:be,orientation:O,loopFocus:v,rtl:w,cols:D,disabledIndices:mA([...(typeof N!="function"?N:null)||u.current.map((sn,Pt)=>bl(u,Pt,N)?Pt:void 0),void 0],Qe),minIndex:ht,maxIndex:lt,prevIndex:dA(Q.current>We?ve:Q.current,nt,Qe,D,be.key===mf?"bl":be.key===(w?gl:yl)?"tr":"tl"),stopEvent:!0})];if(Ft!=null&&(Q.current=Ft,J(be)),O==="both")return}if($h(be.key,O)){if(Gn(be),i&&!A&&Ms(be.currentTarget.ownerDocument)===be.currentTarget){Q.current=S0(be.key,O,w)?ve:We,J(be);return}S0(be.key,O,w)?v?we>=We?b&&we!==u.current.length?Q.current=-1:(se.current=!1,Q.current=ve):Q.current=In(u,{startingIndex:we,disabledIndices:N}):Q.current=Math.min(We,In(u,{startingIndex:we,disabledIndices:N})):v?we<=ve?b&&we!==-1?Q.current=u.current.length:(se.current=!1,Q.current=We):Q.current=In(u,{startingIndex:we,decrement:!0,disabledIndices:N}):Q.current=Math.max(ve,In(u,{startingIndex:we,decrement:!0,disabledIndices:N})),La(u,Q.current)&&(Q.current=-1),J(be)}}),Ce=E.useMemo(()=>A&&i&&De&&{"aria-activedescendant":`${F}-${f}`},[A,i,De,F,f]),Te=E.useMemo(()=>({"aria-orientation":O==="both"?void 0:O,...U?{}:Ce,onKeyDown(be){if(be.key==="Tab"&&be.shiftKey&&i&&!A){const we=ei(be.nativeEvent);if(we&&!ft(q.current,we))return;Gn(be),t.setOpen(!1,Je(Ao,be.nativeEvent)),Qt(o)&&o.focus();return}de(be)},onPointerMove(){_.current=!0}}),[Ce,de,q,O,U,t,i,A,o]),Re=E.useMemo(()=>{function be(ve){C==="auto"&&oA(ve.nativeEvent)&&($.current=!A)}function we(ve){$.current=C,C==="auto"&&aA(ve.nativeEvent)&&($.current=!0)}return{onKeyDown(ve){const We=t.select("open");_.current=!1;const nt=ve.key.startsWith("Arrow"),Qe=KB(ve.key,ye(),w),ht=$h(ve.key,O),lt=(S?Qe:ht)||ve.key==="Enter"||ve.key.trim()==="";if(A&&We)return de(ve);if(!(!We&&!R&&nt)){if(lt){const Ft=$h(ve.key,ye());L.current=S&&Ft?null:ve.key}if(S){Qe&&(Gn(ve),We?(Q.current=kd(u,me.current),J(ve)):t.setOpen(!0,Je(wd,ve.nativeEvent,ve.currentTarget)));return}ht&&(xe.current!=null&&(Q.current=xe.current),Gn(ve),!We&&R?t.setOpen(!0,Je(wd,ve.nativeEvent,ve.currentTarget)):de(ve),We&&J(ve))}},onFocus(ve){t.select("open")&&!A&&(Q.current=-1,J(ve))},onPointerDown:we,onPointerEnter:we,onMouseDown:be,onClick:be}},[de,me,C,u,S,J,t,R,O,ye,w,xe,A]),Me=E.useMemo(()=>({...Ce,...Re}),[Ce,Re]);return E.useMemo(()=>m?{reference:Me,floating:Te,item:pe,trigger:Re}:{},[m,Me,Te,Re,pe])}const QB=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function WA(n,e={}){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.useState("floatingId"),o=t.useState("domReferenceElement"),a=t.useState("floatingElement"),{enabled:u=!0,role:f="dialog"}=e,d=Po(),m=(o==null?void 0:o.id)||d,p=E.useMemo(()=>{var R;return((R=Gu(a))==null?void 0:R.id)||r},[a,r]),b=QB.get(f)??f,S=Cr()!=null,w=E.useMemo(()=>b==="tooltip"||f==="label"?cn:{"aria-haspopup":b==="alertdialog"?"dialog":b,"aria-expanded":"false",...b==="listbox"&&{role:"combobox"},...b==="menu"&&S&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[b,S,f]),A=E.useMemo(()=>b==="tooltip"||f==="label"?{[`aria-${f==="label"?"labelledby":"describedby"}`]:i?p:void 0}:{...w,"aria-expanded":i?"true":"false","aria-controls":i?p:void 0,...b==="menu"&&{id:m}},[b,p,i,m,f,w]),C=E.useMemo(()=>{const R={id:p,...b&&{role:b}};return b==="tooltip"||f==="label"?R:{...R,...b==="menu"&&{"aria-labelledby":m}}},[b,p,m,f]),T=E.useCallback(({active:R,selected:N})=>{const O={role:"option",...R&&{id:`${p}-fui-option`}};switch(f){case"select":case"combobox":return{...O,"aria-selected":N}}return{}},[p,f]);return E.useMemo(()=>u?{reference:A,floating:C,item:T,trigger:w}:{},[u,A,C,w,T])}function XA(n,e){const t="rootStore"in n?n.rootStore:n,i=t.useState("open"),r=t.context.dataRef,{listRef:o,activeIndex:a,onMatch:u,onTypingChange:f,enabled:d=!0,findMatch:m=null,resetMs:p=750,ignoreKeys:b=Sl,selectedIndex:v=null}=e,S=An(),w=E.useRef(""),A=E.useRef(v??a??-1),C=E.useRef(null);Pe(()=>{i&&(S.clear(),C.current=null,w.current="")},[i,S]),Pe(()=>{i&&w.current===""&&(A.current=v??a??-1)},[i,v,a]);const T=Le(z=>{z?r.current.typing||(r.current.typing=z,f==null||f(z)):r.current.typing&&(r.current.typing=z,f==null||f(z))}),R=Le(z=>{function D(Y,V,Z){const q=m?m(V,Z):V.find(P=>(P==null?void 0:P.toLocaleLowerCase().indexOf(Z.toLocaleLowerCase()))===0);return q?Y.indexOf(q):-1}const j=o.current;if(w.current.length>0&&w.current[0]!==" "&&(D(j,j,w.current)===-1?T(!1):z.key===" "&&Gn(z)),j==null||b.includes(z.key)||z.key.length!==1||z.ctrlKey||z.metaKey||z.altKey)return;i&&z.key!==" "&&(Gn(z),T(!0)),j.every(Y=>{var V,Z;return Y?((V=Y[0])==null?void 0:V.toLocaleLowerCase())!==((Z=Y[1])==null?void 0:Z.toLocaleLowerCase()):!0})&&w.current===z.key&&(w.current="",A.current=C.current),w.current+=z.key,S.start(p,()=>{w.current="",A.current=C.current,T(!1)});const K=A.current,F=D(j,[...j.slice((K||0)+1),...j.slice(0,(K||0)+1)],w.current);F!==-1?(u==null||u(F),C.current=F):z.key!==" "&&(w.current="",T(!1))}),N=E.useMemo(()=>({onKeyDown:R}),[R]),O=E.useMemo(()=>({onKeyDown:R,onKeyUp(z){z.key===" "&&T(!1)}}),[R,T]);return E.useMemo(()=>d?{reference:N,floating:O}:{},[d,N,O])}function G2(n,e){const[t,i]=n;let r=!1;const o=e.length;for(let a=0,u=o-1;a<o;u=a++){const[f,d]=e[a]||[0,0],[m,p]=e[u]||[0,0];d>=i!=p>=i&&t<=(m-f)*(i-d)/(p-d)+f&&(r=!r)}return r}function WB(n,e){return n[0]>=e.x&&n[0]<=e.x+e.width&&n[1]>=e.y&&n[1]<=e.y+e.height}function XB(n={}){const{buffer:e=.5,blockPointerEvents:t=!1,requireIntent:i=!0}=n,r=new To;let o=!1,a=null,u=null,f=typeof performance<"u"?performance.now():0;function d(p,b){const v=performance.now(),S=v-f;if(a===null||u===null||S===0)return a=p,u=b,f=v,null;const w=p-a,A=b-u,T=Math.sqrt(w*w+A*A)/S;return a=p,u=b,f=v,T}const m=({x:p,y:b,placement:v,elements:S,onClose:w,nodeId:A,tree:C})=>function(R){function N(){r.clear(),w()}if(r.clear(),!S.domReference||!S.floating||v==null||p==null||b==null)return;const{clientX:O,clientY:z}=R,D=[O,z],j=ei(R),B=R.type==="mouseleave",K=ft(S.floating,j),F=ft(S.domReference,j),Y=S.domReference.getBoundingClientRect(),V=S.floating.getBoundingClientRect(),Z=v.split("-")[0],q=p>V.right-V.width/2,P=b>V.bottom-V.height/2,W=WB(D,Y),U=V.width>Y.width,$=V.height>Y.height,Q=(U?Y:V).left,L=(U?Y:V).right,_=($?Y:V).top,J=($?Y:V).bottom;if(K&&(o=!0,!B))return;if(F&&(o=!1),F&&!B){o=!0;return}if(B&&Tt(R.relatedTarget)&&ft(S.floating,R.relatedTarget)||C&&wo(C.nodesRef.current,A).some(({context:ee})=>ee==null?void 0:ee.open))return;if(Z==="top"&&b>=Y.bottom-1||Z==="bottom"&&b<=Y.top+1||Z==="left"&&p>=Y.right-1||Z==="right"&&p<=Y.left+1)return N();let le=[];switch(Z){case"top":le=[[Q,Y.top+1],[Q,V.bottom-1],[L,V.bottom-1],[L,Y.top+1]];break;case"bottom":le=[[Q,V.top+1],[Q,Y.bottom-1],[L,Y.bottom-1],[L,V.top+1]];break;case"left":le=[[V.right-1,J],[V.right-1,_],[Y.left+1,_],[Y.left+1,J]];break;case"right":le=[[Y.right-1,J],[Y.right-1,_],[V.left+1,_],[V.left+1,J]];break}function ae([ee,se]){switch(Z){case"top":{const fe=[U?ee+e/2:q?ee+e*4:ee-e*4,se+e+1],me=[U?ee-e/2:q?ee+e*4:ee-e*4,se+e+1],Ne=[[V.left,q||U?V.bottom-e:V.top],[V.right,q?U?V.bottom-e:V.top:V.bottom-e]];return[fe,me,...Ne]}case"bottom":{const fe=[U?ee+e/2:q?ee+e*4:ee-e*4,se-e],me=[U?ee-e/2:q?ee+e*4:ee-e*4,se-e],Ne=[[V.left,q||U?V.top+e:V.bottom],[V.right,q?U?V.top+e:V.bottom:V.top+e]];return[fe,me,...Ne]}case"left":{const fe=[ee+e+1,$?se+e/2:P?se+e*4:se-e*4],me=[ee+e+1,$?se-e/2:P?se+e*4:se-e*4];return[...[[P||$?V.right-e:V.left,V.top],[P?$?V.right-e:V.left:V.right-e,V.bottom]],fe,me]}case"right":{const fe=[ee-e,$?se+e/2:P?se+e*4:se-e*4],me=[ee-e,$?se-e/2:P?se+e*4:se-e*4],Ne=[[P||$?V.left+e:V.right,V.top],[P?$?V.left+e:V.right:V.left+e,V.bottom]];return[fe,me,...Ne]}default:return[]}}if(!G2([O,z],le)){if(o&&!W)return N();if(!B&&i){const ee=d(R.clientX,R.clientY);if(ee!==null&&ee<.1)return N()}G2([O,z],ae([p,b]))?!o&&i&&r.start(40,N):N()}};return m.__options={blockPointerEvents:t},m}const $A=E.createContext(null),ZA=E.createContext(null);function Nl(){const n=E.useContext($A);if(n===null)throw new Error(Qn(60));return n}function JA(){const n=E.useContext(ZA);if(n===null)throw new Error(Qn(61));return n}const $B=(n,e)=>Object.is(n,e);function cc(n,e,t){return n==null||e==null?Object.is(n,e):t(n,e)}function w0(n,e,t){return!n||n.length===0?!1:n.some(i=>i===void 0?!1:cc(i,e,t))}function Ay(n,e,t){return!n||n.length===0?-1:n.findIndex(i=>i===void 0?!1:cc(i,e,t))}function ZB(n,e,t){return n.filter(i=>!cc(i,e,t))}function Ty(n){if(n==null)return"";if(typeof n=="string")return n;try{return JSON.stringify(n)}catch{return String(n)}}function JB(n){return n!=null&&n.length>0&&typeof n[0]=="object"&&n[0]!=null&&"items"in n[0]}function Nu(n,e){if(e&&n!=null)return e(n)??"";if(n&&typeof n=="object"){if("label"in n&&n.label!=null)return String(n.label);if("value"in n)return String(n.value)}return Ty(n)}function Ad(n,e){return e&&n!=null?e(n)??"":n&&typeof n=="object"&&"value"in n&&"label"in n?Ty(n.value):Ty(n)}function ez(n,e,t){if(t&&n!=null)return t(n);if(n&&typeof n=="object"&&"label"in n&&n.label!=null)return n.label;if(e&&!Array.isArray(e))return e[n]??Nu(n,t);if(Array.isArray(e)){const i=JB(e)?e.flatMap(r=>r.items):e;if(n==null){const r=i.find(o=>o.value==null);return r&&r.label!=null?r.label:Nu(n,t)}if(typeof n!="object"){const r=i.find(o=>o&&o.value===n);return r&&r.label!=null?r.label:Nu(n,t)}if("value"in n){const r=i.find(o=>o&&o.value===n.value);if(r&&r.label!=null)return r.label}}return Nu(n,t)}function tz(n,e){return!Array.isArray(n)||n.length===0?"":n.map(t=>Nu(t,e)).join(", ")}const rt={id:Ae(n=>n.id),modal:Ae(n=>n.modal),multiple:Ae(n=>n.multiple),items:Ae(n=>n.items),itemToStringLabel:Ae(n=>n.itemToStringLabel),itemToStringValue:Ae(n=>n.itemToStringValue),isItemEqualToValue:Ae(n=>n.isItemEqualToValue),value:Ae(n=>n.value),open:Ae(n=>n.open),mounted:Ae(n=>n.mounted),forceMount:Ae(n=>n.forceMount),transitionStatus:Ae(n=>n.transitionStatus),touchModality:Ae(n=>n.touchModality),activeIndex:Ae(n=>n.activeIndex),selectedIndex:Ae(n=>n.selectedIndex),isActive:Ae((n,e)=>n.activeIndex===e),isSelected:Ae((n,e,t)=>{const i=n.isItemEqualToValue,r=n.value;return n.multiple?Array.isArray(r)&&r.some(o=>cc(o,t,i)):n.selectedIndex===e&&n.selectedIndex!==null?!0:cc(r,t,i)}),isSelectedByFocus:Ae((n,e)=>n.selectedIndex===e),popupProps:Ae(n=>n.popupProps),triggerProps:Ae(n=>n.triggerProps),triggerElement:Ae(n=>n.triggerElement),positionerElement:Ae(n=>n.positionerElement),listElement:Ae(n=>n.listElement),scrollUpArrowVisible:Ae(n=>n.scrollUpArrowVisible),scrollDownArrowVisible:Ae(n=>n.scrollDownArrowVisible),hasScrollArrows:Ae(n=>n.hasScrollArrows),serializedValue:Ae(n=>{const{multiple:e,value:t,itemToStringValue:i}=n;return e&&Array.isArray(t)&&t.length===0?"":Ad(t,i)})};function nz(n){const{id:e,value:t,defaultValue:i=null,onValueChange:r,open:o,defaultOpen:a=!1,onOpenChange:u,name:f,disabled:d=!1,readOnly:m=!1,required:p=!1,modal:b=!0,actionsRef:v,inputRef:S,onOpenChangeComplete:w,items:A,multiple:C=!1,itemToStringLabel:T,itemToStringValue:R,isItemEqualToValue:N=$B,highlightItemOnHover:O=!0,children:z}=n,{clearErrors:D}=QE(),{setDirty:j,shouldValidateOnChange:B,validityData:K,setFilled:F,name:Y,disabled:V,validation:Z}=Ub(),{controlId:q}=Vb(),P=x5({id:e}),W=V||d,U=Y??f,[$,Q]=Pd({controlled:t,default:C?i??Sl:i,name:"Select",state:"value"}),[L,_]=Pd({controlled:o,default:a,name:"Select",state:"open"}),J=E.useRef([]),le=E.useRef([]),ae=E.useRef(null),ee=E.useRef(null),se=E.useRef(0),fe=E.useRef(null),me=E.useRef([]),Ne=E.useRef(!1),oe=E.useRef(!1),xe=E.useRef(null),Se=E.useRef({allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}),Ge=E.useRef(!1),{mounted:De,setMounted:pe,transitionStatus:ye}=rv(L),de=pi(()=>new ja({id:P,modal:b,multiple:C,itemToStringLabel:T,itemToStringValue:R,isItemEqualToValue:N,value:$,open:L,mounted:De,transitionStatus:ye,items:A,forceMount:!1,touchModality:!1,activeIndex:null,selectedIndex:null,popupProps:{},triggerProps:{},triggerElement:null,positionerElement:null,listElement:null,scrollUpArrowVisible:!1,scrollDownArrowVisible:!1,hasScrollArrows:!1})).current,Ce=ot(de,rt.activeIndex),Te=ot(de,rt.selectedIndex),Re=ot(de,rt.triggerElement),Me=ot(de,rt.positionerElement),be=E.useMemo(()=>C&&Array.isArray($)&&$.length===0?"":Ad($,R),[C,$,R]),we=bn(de.state.triggerElement);b5({id:P,commit:Z.commit,value:$,controlRef:we,name:U,getValue:()=>$});const ve=E.useRef($);Pe(()=>{$!==ve.current&&de.set("forceMount",!0)},[de,$]),Pe(()=>{F($!==null)},[$,F]),Pe(function(){if(L)return;const dt=me.current;if(C){const Kt=Array.isArray($)?$:[];if(Kt.length===0){de.set("selectedIndex",null);return}const Dn=Kt[Kt.length-1],Un=Ay(dt,Dn,N);de.set("selectedIndex",Un===-1?null:Un);return}const Et=Ay(dt,$,N);de.set("selectedIndex",Et===-1?null:Et)},[C,L,$,me,N,de]),k5($,()=>{D(U),j($!==K.initialValue),B()?Z.commit($):Z.commit($,!0)});const We=Le((_e,dt)=>{if(u==null||u(_e,dt),!dt.isCanceled&&(_(_e),!_e&&de.state.activeIndex!==null)){const Et=J.current[de.state.activeIndex];queueMicrotask(()=>{Et==null||Et.setAttribute("tabindex","-1")})}}),nt=Le(()=>{pe(!1),de.set("activeIndex",null),w==null||w(!1)});Sc({enabled:!v,open:L,ref:ae,onComplete(){L||nt()}}),E.useImperativeHandle(v,()=>({unmount:nt}),[nt]);const Qe=Le((_e,dt)=>{r==null||r(_e,dt),!dt.isCanceled&&Q(_e)}),ht=Le(()=>{const _e=de.state.listElement||ae.current;if(!_e)return;const dt=_e.scrollTop,Et=_e.scrollTop+_e.clientHeight,Kt=dt>1,Dn=Et<_e.scrollHeight-1;de.state.scrollUpArrowVisible!==Kt&&de.set("scrollUpArrowVisible",Kt),de.state.scrollDownArrowVisible!==Dn&&de.set("scrollDownArrowVisible",Dn)}),lt=GA({open:L,onOpenChange:We,elements:{reference:Re,floating:Me}}),Ft=DA(lt,{enabled:!m&&!W,event:"mousedown"}),sn=iv(lt,{bubbles:!1}),Pt=QA(lt,{enabled:!m&&!W,listRef:J,activeIndex:Ce,selectedIndex:Te,disabledIndices:Sl,onNavigate(_e){_e===null&&!L||de.set("activeIndex",_e)},focusItemOnHover:!1}),He=XA(lt,{enabled:!m&&!W&&(L||!C),listRef:le,activeIndex:Ce,selectedIndex:Te,onMatch(_e){L?de.set("activeIndex",_e):Qe(me.current[_e],Je("none"))},onTypingChange(_e){Ne.current=_e}}),{getReferenceProps:$e,getFloatingProps:it,getItemProps:yi}=Am([Ft,sn,Pt,He]);C5(()=>{de.update({popupProps:it(),triggerProps:$e()})}),Pe(()=>{de.update({id:P,modal:b,multiple:C,value:$,open:L,mounted:De,transitionStatus:ye,popupProps:it(),triggerProps:$e(),items:A,itemToStringLabel:T,itemToStringValue:R,isItemEqualToValue:N})},[de,P,b,C,$,L,De,ye,it,$e,A,T,R,N]);const Nn=E.useMemo(()=>({store:de,name:U,required:p,disabled:W,readOnly:m,multiple:C,itemToStringLabel:T,itemToStringValue:R,highlightItemOnHover:O,setValue:Qe,setOpen:We,listRef:J,popupRef:ae,scrollHandlerRef:ee,handleScrollArrowVisibility:ht,scrollArrowsMountedCountRef:se,getItemProps:yi,events:lt.context.events,valueRef:fe,valuesRef:me,labelsRef:le,typingRef:Ne,selectionRef:Se,selectedItemTextRef:xe,validation:Z,onOpenChangeComplete:w,keyboardActiveRef:oe,alignItemWithTriggerActiveRef:Ge,initialValueRef:ve}),[de,U,p,W,m,C,T,R,O,Qe,We,yi,lt.context.events,Z,w,ht]),vt=Sr(S,Z.inputRef),Mt=C&&Array.isArray($)&&$.length>0,Xt=E.useMemo(()=>!C||!Array.isArray($)||!U?null:$.map(_e=>{const dt=Ad(_e,R);return x.jsx("input",{type:"hidden",name:U,value:dt},dt)}),[C,$,U,R]);return x.jsx($A.Provider,{value:Nn,children:x.jsxs(ZA.Provider,{value:lt,children:[z,x.jsx("input",{...Z.getInputValidationProps({onFocus(){var _e;(_e=de.state.triggerElement)==null||_e.focus()},onChange(_e){if(_e.nativeEvent.defaultPrevented)return;const dt=_e.target.value,Et=Je(km,_e.nativeEvent);function Kt(){if(C)return;const Dn=me.current.find(Un=>Ad(Un,R).toLowerCase()===dt.toLowerCase());Dn!=null&&(j(Dn!==K.initialValue),Qe(Dn,Et),B()&&Z.commit(Dn))}de.set("forceMount",!0),queueMicrotask(Kt)}}),id:e||q||void 0,name:C?void 0:U,value:be,disabled:W,required:p&&!Mt,readOnly:m,ref:vt,style:zb,tabIndex:-1,"aria-hidden":!0}),Xt]})})}let Qd=(function(n){return n.startingStyle="data-starting-style",n.endingStyle="data-ending-style",n})({});const iz={[Qd.startingStyle]:""},sz={[Qd.endingStyle]:""},gf={transitionStatus(n){return n==="starting"?iz:n==="ending"?sz:null}};let oo=(function(n){return n.open="data-open",n.closed="data-closed",n[n.startingStyle=Qd.startingStyle]="startingStyle",n[n.endingStyle=Qd.endingStyle]="endingStyle",n.anchorHidden="data-anchor-hidden",n})({}),Ry=(function(n){return n.popupOpen="data-popup-open",n.pressed="data-pressed",n})({});const rz={[Ry.popupOpen]:""},lz={[Ry.popupOpen]:"",[Ry.pressed]:""},oz={[oo.open]:""},az={[oo.closed]:""},cz={[oo.anchorHidden]:""},uz={open(n){return n?rz:null}},My={open(n){return n?lz:null}},wc={open(n){return n?oz:az},anchorHidden(n){return n?cz:null}};function eT(n){const e=n.getBoundingClientRect(),t=window.getComputedStyle(n,"::before"),i=window.getComputedStyle(n,"::after");if(!(t.content!=="none"||i.content!=="none"))return e;const o=parseFloat(t.width)||0,a=parseFloat(t.height)||0,u=parseFloat(i.width)||0,f=parseFloat(i.height)||0,d=Math.max(e.width,o,u),m=Math.max(e.height,a,f),p=d-e.width,b=m-e.height;return{left:e.left-p/2,right:e.right+p/2,top:e.top-b/2,bottom:e.bottom+b/2}}const Zh=2,fz={...My,...m5,value:()=>null},hz=E.forwardRef(function(e,t){const{render:i,className:r,disabled:o=!1,nativeButton:a=!0,...u}=e,{setTouched:f,setFocused:d,validationMode:m,state:p,disabled:b}=Ub(),{labelId:v}=Vb(),{store:S,setOpen:w,selectionRef:A,validation:C,readOnly:T,alignItemWithTriggerActiveRef:R,disabled:N,keyboardActiveRef:O}=Nl(),z=b||N||o,D=ot(S,rt.open),j=ot(S,rt.value),B=ot(S,rt.triggerProps),K=ot(S,rt.positionerElement),F=ot(S,rt.listElement),Y=ot(S,rt.serializedValue),V=bn(K),Z=E.useRef(null),q=An(),P=An(),{getButtonProps:W,buttonRef:U}=bc({disabled:z,native:a}),$=Le(ee=>{S.set("triggerElement",ee)}),Q=Sr(t,Z,U,$),L=An(),_=An();E.useEffect(()=>{if(D)return _.start(200,()=>{A.current.allowUnselectedMouseUp=!0,L.start(200,()=>{A.current.allowSelectedMouseUp=!0})}),()=>{L.clear(),_.clear()};A.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1},P.clear()},[D,A,P,L,_]);const J=E.useMemo(()=>{var ee;return(F==null?void 0:F.id)??((ee=Gu(K))==null?void 0:ee.id)},[F,K]),le=hf(B,{role:"combobox","aria-expanded":D?"true":"false","aria-haspopup":"listbox","aria-controls":D?J:void 0,"aria-labelledby":v,"aria-readonly":T||void 0,tabIndex:z?-1:0,ref:Q,onFocus(ee){d(!0),D&&R.current&&w(!1,Je(Ao,ee.nativeEvent)),q.start(0,()=>{S.set("forceMount",!0)})},onBlur(){f(!0),d(!1),m==="onBlur"&&C.commit(j)},onPointerMove({pointerType:ee}){O.current=!1,S.set("touchModality",ee==="touch")},onPointerDown({pointerType:ee}){S.set("touchModality",ee==="touch")},onKeyDown(){O.current=!0},onMouseDown(ee){if(D)return;const se=cs(ee.currentTarget);function fe(me){if(!Z.current)return;const Ne=me.target;if(ft(Z.current,Ne)||ft(V.current,Ne)||Ne===Z.current)return;const oe=eT(Z.current);me.clientX>=oe.left-Zh&&me.clientX<=oe.right+Zh&&me.clientY>=oe.top-Zh&&me.clientY<=oe.bottom+Zh||w(!1,Je(WE,me))}P.start(0,()=>{se.addEventListener("mouseup",fe,{once:!0})})}},C.getValidationProps,u,W);le.role="combobox";const ae=E.useMemo(()=>({...p,open:D,disabled:z,value:j,readOnly:T,placeholder:!Y}),[p,D,z,j,T,Y]);return dn("button",e,{ref:[t,Z],state:ae,stateAttributesMapping:fz,props:le})}),dz={value:()=>null},mz=E.forwardRef(function(e,t){const{className:i,render:r,children:o,...a}=e,{store:u,valueRef:f}=Nl(),d=ot(u,rt.value),m=ot(u,rt.items),p=ot(u,rt.itemToStringLabel),b=ot(u,rt.serializedValue),v=E.useMemo(()=>({value:d,placeholder:!b}),[d,b]),S=typeof o=="function"?o(d):o??(Array.isArray(d)?tz(d,p):ez(d,m,p));return dn("span",e,{state:v,ref:[t,f],props:[{children:S},a],stateAttributesMapping:dz})}),pz=E.forwardRef(function(e,t){const{className:i,render:r,...o}=e,{store:a}=Nl(),u=ot(a,rt.open),f=E.useMemo(()=>({open:u}),[u]);return dn("span",e,{state:f,ref:t,props:[{"aria-hidden":!0,children:"▼"},o],stateAttributesMapping:uz})}),gz=E.createContext(void 0),yz=E.forwardRef(function(e,t){const{store:i}=Nl(),r=ot(i,rt.mounted),o=ot(i,rt.forceMount);return r||o?x.jsx(gz.Provider,{value:!0,children:x.jsx(Jb,{ref:t,...e})}):null});function lv(n){return Pb(19)?n:n?"true":void 0}let K2={},Y2={},Q2="";function bz(n){if(typeof document>"u")return!1;const e=cs(n);return xn(e).innerWidth-e.documentElement.clientWidth>0}function vz(n){const e=cs(n),t=e.documentElement,i=e.body,r=Io(t)?t:i,o=r.style.overflow;return r.style.overflow="hidden",()=>{r.style.overflow=o}}function xz(n){var b,v;const e=cs(n),t=e.documentElement,i=e.body,r=xn(t);let o=0,a=0;const u=Rs.create(),f=typeof CSS<"u"&&((b=CSS.supports)==null?void 0:b.call(CSS,"scrollbar-gutter","stable"));if(tA&&(((v=r.visualViewport)==null?void 0:v.scale)??1)!==1)return()=>{};function d(){const S=r.getComputedStyle(t),w=r.getComputedStyle(i),T=(S.scrollbarGutter||"").includes("both-edges")?"stable both-edges":"stable";o=t.scrollTop,a=t.scrollLeft,K2={scrollbarGutter:t.style.scrollbarGutter,overflowY:t.style.overflowY,overflowX:t.style.overflowX},Q2=t.style.scrollBehavior,Y2={position:i.style.position,height:i.style.height,width:i.style.width,boxSizing:i.style.boxSizing,overflowY:i.style.overflowY,overflowX:i.style.overflowX,scrollBehavior:i.style.scrollBehavior};const R=t.scrollHeight>t.clientHeight,N=t.scrollWidth>t.clientWidth,O=S.overflowY==="scroll"||w.overflowY==="scroll",z=S.overflowX==="scroll"||w.overflowX==="scroll",D=Math.max(0,r.innerWidth-t.clientWidth),j=Math.max(0,r.innerHeight-t.clientHeight),B=parseFloat(w.marginTop)+parseFloat(w.marginBottom),K=parseFloat(w.marginLeft)+parseFloat(w.marginRight),F=Io(t)?t:i;if(f){t.style.scrollbarGutter=T,F.style.overflowY="hidden",F.style.overflowX="hidden";return}Object.assign(t.style,{scrollbarGutter:T,overflowY:"hidden",overflowX:"hidden"}),(R||O)&&(t.style.overflowY="scroll"),(N||z)&&(t.style.overflowX="scroll"),Object.assign(i.style,{position:"relative",height:B||j?`calc(100dvh - ${B+j}px)`:"100dvh",width:K||D?`calc(100vw - ${K+D}px)`:"100vw",boxSizing:"border-box",overflow:"hidden",scrollBehavior:"unset"}),i.scrollTop=o,i.scrollLeft=a,t.setAttribute("data-base-ui-scroll-locked",""),t.style.scrollBehavior="unset"}function m(){Object.assign(t.style,K2),Object.assign(i.style,Y2),f||(t.scrollTop=o,t.scrollLeft=a,t.removeAttribute("data-base-ui-scroll-locked"),t.style.scrollBehavior=Q2)}function p(){m(),u.request(d)}return d(),r.addEventListener("resize",p),()=>{u.cancel(),m(),typeof r.removeEventListener=="function"&&r.removeEventListener("resize",p)}}class Sz{constructor(){Dt(this,"lockCount",0);Dt(this,"restore",null);Dt(this,"timeoutLock",To.create());Dt(this,"timeoutUnlock",To.create());Dt(this,"release",()=>{this.lockCount-=1,this.lockCount===0&&this.restore&&this.timeoutUnlock.start(0,this.unlock)});Dt(this,"unlock",()=>{var e;this.lockCount===0&&this.restore&&((e=this.restore)==null||e.call(this),this.restore=null)})}acquire(e){return this.lockCount+=1,this.lockCount===1&&this.restore===null&&this.timeoutLock.start(0,()=>this.lock(e)),this.release}lock(e){if(this.lockCount===0||this.restore!==null)return;const i=cs(e).documentElement,r=xn(i).getComputedStyle(i).overflowY;if(r==="hidden"||r==="clip"){this.restore=Oi;return}const o=X5||!bz(e);this.restore=o?vz(e):xz(e)}}const wz=new Sz;function ov(n=!0,e=null){Pe(()=>{if(n)return wz.acquire(e)},[n,e])}const tT=E.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function kz(){return E.useContext(tT)}function av(n){const{children:e,elementsRef:t,labelsRef:i,onMapChange:r}=n,o=Le(r),a=E.useRef(0),u=pi(Ez).current,f=pi(Cz).current,[d,m]=E.useState(0),p=E.useRef(d),b=Le((C,T)=>{f.set(C,T??null),p.current+=1,m(p.current)}),v=Le(C=>{f.delete(C),p.current+=1,m(p.current)}),S=E.useMemo(()=>{const C=new Map;return Array.from(f.keys()).filter(R=>R.isConnected).sort(Az).forEach((R,N)=>{const O=f.get(R)??{};C.set(R,{...O,index:N})}),C},[f,d]);Pe(()=>{if(typeof MutationObserver!="function"||S.size===0)return;const C=new MutationObserver(T=>{const R=new Set,N=O=>R.has(O)?R.delete(O):R.add(O);T.forEach(O=>{O.removedNodes.forEach(N),O.addedNodes.forEach(N)}),R.size===0&&(p.current+=1,m(p.current))});return S.forEach((T,R)=>{R.parentElement&&C.observe(R.parentElement,{childList:!0})}),()=>{C.disconnect()}},[S]),Pe(()=>{p.current===d&&(t.current.length!==S.size&&(t.current.length=S.size),i&&i.current.length!==S.size&&(i.current.length=S.size),a.current=S.size),o(S)},[o,S,t,i,d]),Pe(()=>()=>{t.current=[]},[t]),Pe(()=>()=>{i&&(i.current=[])},[i]);const w=Le(C=>(u.add(C),()=>{u.delete(C)}));Pe(()=>{u.forEach(C=>C(S))},[u,S]);const A=E.useMemo(()=>({register:b,unregister:v,subscribeMapChange:w,elementsRef:t,labelsRef:i,nextIndexRef:a}),[b,v,w,t,i,a]);return x.jsx(tT.Provider,{value:A,children:e})}function Cz(){return new Map}function Ez(){return new Set}function Az(n,e){const t=n.compareDocumentPosition(e);return t&Node.DOCUMENT_POSITION_FOLLOWING||t&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:t&Node.DOCUMENT_POSITION_PRECEDING||t&Node.DOCUMENT_POSITION_CONTAINS?1:0}const Tz=E.createContext(void 0);function cv(){const n=E.useContext(Tz);return(n==null?void 0:n.direction)??"ltr"}const Rz=n=>({name:"arrow",options:n,async fn(e){var $,Q;const{x:t,y:i,placement:r,rects:o,platform:a,elements:u,middlewareData:f}=e,{element:d,padding:m=0,offsetParent:p="real"}=wr(n,e)||{};if(d==null)return{};const b=uA(m),v={x:t,y:i},S=Xb(r),w=Wb(S),A=await a.getDimensions(d),C=S==="y",T=C?"top":"left",R=C?"bottom":"right",N=C?"clientHeight":"clientWidth",O=o.reference[w]+o.reference[S]-v[S]-o.floating[w],z=v[S]-o.reference[S],D=p==="real"?await(($=a.getOffsetParent)==null?void 0:$.call(a,d)):u.floating;let j=u.floating[N]||o.floating[w];(!j||!await((Q=a.isElement)==null?void 0:Q.call(a,D)))&&(j=u.floating[N]||o.floating[w]);const B=O/2-z/2,K=j/2-A[w]/2-1,F=Math.min(b[T],K),Y=Math.min(b[R],K),V=F,Z=j-A[w]-Y,q=j/2-A[w]/2+B,P=xy(V,q,Z),W=!f.arrow&&Ml(r)!=null&&q!==P&&o.reference[w]/2-(q<V?F:Y)-A[w]/2<0,U=W?q<V?q-V:q-Z:0;return{[S]:v[S]+U,data:{[S]:P,centerOffset:q-P-U,...W&&{alignmentOffset:U}},reset:W}}}),Mz=(n,e)=>({...Rz(n),options:[n,e]}),Oz={name:"hide",async fn(n){var u;const{width:e,height:t,x:i,y:r}=n.rects.reference,o=e===0&&t===0&&i===0&&r===0;return{data:{referenceHidden:((u=(await RB().fn(n)).data)==null?void 0:u.referenceHidden)||o}}}},Nz={sideX:"left",sideY:"top"};function nT(n,e,t){const i=n==="inline-start"||n==="inline-end";return{top:"top",right:i?t?"inline-start":"inline-end":"right",bottom:"bottom",left:i?t?"inline-end":"inline-start":"left"}[e]}function W2(n,e,t){const{rects:i,placement:r}=n;return{side:nT(e,ji(r),t),align:Ml(r)||"center",anchor:{width:i.reference.width,height:i.reference.height},positioner:{width:i.floating.width,height:i.floating.height}}}function iT(n){var yi,Nn;const{anchor:e,positionMethod:t="absolute",side:i="bottom",sideOffset:r=0,align:o="center",alignOffset:a=0,collisionBoundary:u,collisionPadding:f=5,sticky:d=!1,arrowPadding:m=5,disableAnchorTracking:p=!1,keepMounted:b=!1,floatingRootContext:v,mounted:S,collisionAvoidance:w,shiftCrossAxis:A=!1,nodeId:C,adaptiveOrigin:T,lazyFlip:R=!1,externalTree:N}=n,[O,z]=E.useState(null);!S&&O!==null&&z(null);const D=w.side||"flip",j=w.align||"flip",B=w.fallbackAxisSide||"end",K=typeof e=="function"?e:void 0,F=Le(K),Y=K?F:e,V=bn(e),q=cv()==="rtl",P=O||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":q?"left":"right","inline-start":q?"right":"left"}[i],W=o==="center"?P:`${P}-${o}`;let U=f;const $=1,Q=i==="bottom"?$:0,L=i==="top"?$:0,_=i==="right"?$:0,J=i==="left"?$:0;typeof U=="number"?U={top:U+Q,right:U+J,bottom:U+L,left:U+_}:U&&(U={top:(U.top||0)+Q,right:(U.right||0)+J,bottom:(U.bottom||0)+L,left:(U.left||0)+_});const le={boundary:u==="clipping-ancestors"?"clippingAncestors":u,padding:U},ae=E.useRef(null),ee=bn(r),se=bn(a),Ne=[kB(vt=>{const Mt=W2(vt,i,q),Xt=typeof ee.current=="function"?ee.current(Mt):ee.current,_e=typeof se.current=="function"?se.current(Mt):se.current;return{mainAxis:Xt,crossAxis:_e,alignmentAxis:_e}},[typeof r!="function"?r:0,typeof a!="function"?a:0,q,i])],oe=j==="none"&&D!=="shift",xe=!oe&&(d||A||D==="shift"),Se=D==="none"?null:AB({...le,padding:{top:U.top+$,right:U.right+$,bottom:U.bottom+$,left:U.left+$},mainAxis:!A&&D==="flip",crossAxis:j==="flip"?"alignment":!1,fallbackAxisSideDirection:B}),Ge=oe?null:CB(vt=>{const Mt=cs(vt.elements.floating).documentElement;return{...le,rootBoundary:A?{x:0,y:0,width:Mt.clientWidth,height:Mt.clientHeight}:void 0,mainAxis:j!=="none",crossAxis:xe,limiter:d||A?void 0:EB(Xt=>{if(!ae.current)return{};const{width:_e,height:dt}=ae.current.getBoundingClientRect(),Et=Qi(ji(Xt.placement)),Kt=Et==="y"?_e:dt,Dn=Et==="y"?U.left+U.right:U.top+U.bottom;return{offset:Kt/2+Dn/2}})}},[le,d,A,U,j]);D==="shift"||j==="shift"||o==="center"?Ne.push(Ge,Se):Ne.push(Se,Ge),Ne.push(TB({...le,apply({elements:{floating:vt},rects:{reference:Mt},availableWidth:Xt,availableHeight:_e}){Object.entries({"--available-width":`${Xt}px`,"--available-height":`${_e}px`,"--anchor-width":`${Mt.width}px`,"--anchor-height":`${Mt.height}px`}).forEach(([dt,Et])=>{vt.style.setProperty(dt,Et)})}}),Mz(()=>({element:ae.current||document.createElement("div"),padding:m,offsetParent:"floating"}),[m]),{name:"transformOrigin",fn(vt){var jn,Gs,Vo;const{elements:Mt,middlewareData:Xt,placement:_e,rects:dt,y:Et}=vt,Kt=ji(_e),Dn=Qi(Kt),Un=ae.current,Er=((jn=Xt.arrow)==null?void 0:jn.x)||0,Fs=((Gs=Xt.arrow)==null?void 0:Gs.y)||0,Vm=(Un==null?void 0:Un.clientWidth)||0,Af=(Un==null?void 0:Un.clientHeight)||0,Uo=Er+Vm/2,Ec=Fs+Af/2,Ac=Math.abs(((Vo=Xt.shift)==null?void 0:Vo.y)||0),Tc=dt.reference.height/2,Ar=typeof r=="function"?r(W2(vt,i,q)):r,Tf=Ac>Ar,ps={top:`${Uo}px calc(100% + ${Ar}px)`,bottom:`${Uo}px ${-Ar}px`,left:`calc(100% + ${Ar}px) ${Ec}px`,right:`${-Ar}px ${Ec}px`}[Kt],Sn=`${Uo}px ${dt.reference.y+Tc-Et}px`;return Mt.floating.style.setProperty("--transform-origin",xe&&Dn==="y"&&Tf?Sn:ps),{}}},Oz,T),Pe(()=>{!S&&v&&v.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[S,v]);const De=E.useMemo(()=>({elementResize:!p&&typeof ResizeObserver<"u",layoutShift:!p&&typeof IntersectionObserver<"u"}),[p]),{refs:pe,elements:ye,x:de,y:Ce,middlewareData:Te,update:Re,placement:Me,context:be,isPositioned:we,floatingStyles:ve}=zB({rootContext:v,placement:W,middleware:Ne,strategy:t,whileElementsMounted:b?void 0:(...vt)=>V2(...vt,De),nodeId:C,externalTree:N}),{sideX:We,sideY:nt}=Te.adaptiveOrigin||Nz,Qe=we?t:"fixed",ht=E.useMemo(()=>T?{position:Qe,[We]:de,[nt]:Ce}:{position:Qe,...ve},[T,Qe,We,de,nt,Ce,ve]),lt=E.useRef(null);Pe(()=>{if(!S)return;const vt=V.current,Mt=typeof vt=="function"?vt():vt,_e=(X2(Mt)?Mt.current:Mt)||null||null;_e!==lt.current&&(pe.setPositionReference(_e),lt.current=_e)},[S,pe,Y,V]),E.useEffect(()=>{if(!S)return;const vt=V.current;typeof vt!="function"&&X2(vt)&&vt.current!==lt.current&&(pe.setPositionReference(vt.current),lt.current=vt.current)},[S,pe,Y,V]),E.useEffect(()=>{if(b&&S&&ye.domReference&&ye.floating)return V2(ye.domReference,ye.floating,Re,De)},[b,S,ye,Re,De]);const Ft=ji(Me),sn=nT(i,Ft,q),Pt=Ml(Me)||"center",He=!!((yi=Te.hide)!=null&&yi.referenceHidden);Pe(()=>{R&&S&&we&&z(Ft)},[R,S,we,Ft]);const $e=E.useMemo(()=>{var vt,Mt;return{position:"absolute",top:(vt=Te.arrow)==null?void 0:vt.y,left:(Mt=Te.arrow)==null?void 0:Mt.x}},[Te.arrow]),it=((Nn=Te.arrow)==null?void 0:Nn.centerOffset)!==0;return E.useMemo(()=>({positionerStyles:ht,arrowStyles:$e,arrowRef:ae,arrowUncentered:it,side:sn,align:Pt,physicalSide:Ft,anchorHidden:He,refs:pe,context:be,isPositioned:we,update:Re}),[ht,$e,ae,it,sn,Pt,Ft,He,pe,be,we,Re])}function X2(n){return n!=null&&"current"in n}const sT=E.createContext(void 0);function Dz(){const n=E.useContext(sT);if(!n)throw new Error(Qn(59));return n}const uv=E.forwardRef(function(e,t){const{cutout:i,...r}=e;let o;if(i){const a=i==null?void 0:i.getBoundingClientRect();o=`polygon(
|
|
219
|
+
0% 0%,
|
|
220
|
+
100% 0%,
|
|
221
|
+
100% 100%,
|
|
222
|
+
0% 100%,
|
|
223
|
+
0% 0%,
|
|
224
|
+
${a.left}px ${a.top}px,
|
|
225
|
+
${a.left}px ${a.bottom}px,
|
|
226
|
+
${a.right}px ${a.bottom}px,
|
|
227
|
+
${a.right}px ${a.top}px,
|
|
228
|
+
${a.left}px ${a.top}px
|
|
229
|
+
)`}return x.jsx("div",{ref:t,role:"presentation","data-base-ui-inert":"",...r,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:o}})});function Wd(n,e){n&&Object.assign(n.style,e)}const jz={position:"relative",maxHeight:"100%",overflowX:"hidden",overflowY:"auto"},Lz={position:"fixed"},Bz=E.forwardRef(function(e,t){const{anchor:i,positionMethod:r="absolute",className:o,render:a,side:u="bottom",align:f="center",sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b,arrowPadding:v=5,sticky:S=!1,disableAnchorTracking:w,alignItemWithTrigger:A=!0,collisionAvoidance:C=GE,...T}=e,{store:R,listRef:N,labelsRef:O,alignItemWithTriggerActiveRef:z,selectedItemTextRef:D,valuesRef:j,initialValueRef:B,popupRef:K,setValue:F}=Nl(),Y=JA(),V=ot(R,rt.open),Z=ot(R,rt.mounted),q=ot(R,rt.modal),P=ot(R,rt.value),W=ot(R,rt.touchModality),U=ot(R,rt.positionerElement),$=ot(R,rt.triggerElement),Q=ot(R,rt.isItemEqualToValue),L=E.useRef(null),_=E.useRef(null),[J,le]=E.useState(A),ae=Z&&J&&!W;!Z&&J!==A&&le(A),Pe(()=>{Z||(rt.scrollUpArrowVisible(R.state)&&R.set("scrollUpArrowVisible",!1),rt.scrollDownArrowVisible(R.state)&&R.set("scrollDownArrowVisible",!1))},[R,Z]),E.useImperativeHandle(z,()=>ae),ov((ae||q)&&V&&!W,$);const ee=iT({anchor:i,floatingRootContext:Y,positionMethod:r,mounted:Z,side:u,sideOffset:d,align:f,alignOffset:m,arrowPadding:v,collisionBoundary:p,collisionPadding:b,sticky:S,disableAnchorTracking:w??ae,collisionAvoidance:C,keepMounted:!0}),se=ae?"none":ee.side,fe=ae?Lz:ee.positionerStyles,me=E.useMemo(()=>{const pe={};return V||(pe.pointerEvents="none"),{role:"presentation",hidden:!Z,style:{...fe,...pe}}},[V,Z,fe]),Ne=E.useMemo(()=>({open:V,side:se,align:ee.align,anchorHidden:ee.anchorHidden}),[V,se,ee.align,ee.anchorHidden]),oe=Le(pe=>{R.set("positionerElement",pe)}),xe=dn("div",e,{ref:[t,oe],state:Ne,stateAttributesMapping:wc,props:[me,T]}),Se=E.useRef(0),Ge=Le(pe=>{if(pe.size===0&&Se.current===0||j.current.length===0)return;const ye=Se.current;if(Se.current=pe.size,pe.size===ye)return;const de=Je(km);if(ye!==0&&!R.state.multiple&&P!==null&&Ay(j.current,P,Q)===-1){const Te=B.current,Me=Te!=null&&w0(j.current,Te,Q)?Te:null;F(Me,de),Me===null&&(R.set("selectedIndex",null),D.current=null)}if(ye!==0&&R.state.multiple&&Array.isArray(P)){const Ce=P.filter(Te=>w0(j.current,Te,Q));(Ce.length!==P.length||Ce.some(Te=>!w0(P,Te,Q)))&&(F(Ce,de),Ce.length===0&&(R.set("selectedIndex",null),D.current=null))}if(V&&ae){R.update({scrollUpArrowVisible:!1,scrollDownArrowVisible:!1});const Ce={height:""};Wd(U,Ce),Wd(K.current,Ce)}}),De=E.useMemo(()=>({...ee,side:se,alignItemWithTriggerActive:ae,setControlledAlignItemWithTrigger:le,scrollUpArrowRef:L,scrollDownArrowRef:_}),[ee,se,ae,le]);return x.jsx(av,{elementsRef:N,labelsRef:O,onMapChange:Ge,children:x.jsxs(sT.Provider,{value:De,children:[Z&&q&&x.jsx(uv,{inert:lv(!V),cutout:$}),xe]})})});function rT(n){const e=n.currentTarget.getBoundingClientRect();return e.top+1<=n.clientY&&n.clientY<=e.bottom-1&&e.left+1<=n.clientX&&n.clientX<=e.right-1}const Jh="base-ui-disable-scrollbar",$2={className:Jh,element:x.jsx("style",{href:Jh,precedence:"base-ui:low",children:`.${Jh}{scrollbar-width:none}.${Jh}::-webkit-scrollbar{display:none}`})},zz=E.createContext(void 0);function fv(n){return E.useContext(zz)}const Ia="ArrowUp",ao="ArrowDown",Ku="ArrowLeft",Ha="ArrowRight",yf="Home",bf="End",lT=new Set([Ku,Ha]),Pz=new Set([Ku,Ha,yf,bf]),oT=new Set([Ia,ao]),Iz=new Set([Ia,ao,yf,bf]),aT=new Set([...lT,...oT]),Hz=new Set([...aT,yf,bf]),hv=new Set([Ia,ao,Ku,Ha,yf,bf]),_z="Shift",Uz="Control",Vz="Alt",qz="Meta",Fz=new Set([_z,Uz,Vz,qz]);function Gz(n){return Qt(n)&&n.tagName==="INPUT"}function Z2(n){return!!(Gz(n)&&n.selectionStart!=null||Qt(n)&&n.tagName==="TEXTAREA")}function J2(n,e,t,i){if(!n||!e||!e.scrollTo)return;let r=n.scrollLeft,o=n.scrollTop;const a=n.clientWidth<n.scrollWidth,u=n.clientHeight<n.scrollHeight;if(a&&i!=="vertical"){const f=ek(n,e,"left"),d=ed(n),m=ed(e);t==="ltr"&&(f+e.offsetWidth+m.scrollMarginRight>n.scrollLeft+n.clientWidth-d.scrollPaddingRight?r=f+e.offsetWidth+m.scrollMarginRight-n.clientWidth+d.scrollPaddingRight:f-m.scrollMarginLeft<n.scrollLeft+d.scrollPaddingLeft&&(r=f-m.scrollMarginLeft-d.scrollPaddingLeft)),t==="rtl"&&(f-m.scrollMarginRight<n.scrollLeft+d.scrollPaddingLeft?r=f-m.scrollMarginLeft-d.scrollPaddingLeft:f+e.offsetWidth+m.scrollMarginRight>n.scrollLeft+n.clientWidth-d.scrollPaddingRight&&(r=f+e.offsetWidth+m.scrollMarginRight-n.clientWidth+d.scrollPaddingRight))}if(u&&i!=="horizontal"){const f=ek(n,e,"top"),d=ed(n),m=ed(e);f-m.scrollMarginTop<n.scrollTop+d.scrollPaddingTop?o=f-m.scrollMarginTop-d.scrollPaddingTop:f+e.offsetHeight+m.scrollMarginBottom>n.scrollTop+n.clientHeight-d.scrollPaddingBottom&&(o=f+e.offsetHeight+m.scrollMarginBottom-n.clientHeight+d.scrollPaddingBottom)}n.scrollTo({left:r,top:o,behavior:"auto"})}function ek(n,e,t){const i=t==="left"?"offsetLeft":"offsetTop";let r=0;for(;e.offsetParent&&(r+=e[i],e.offsetParent!==n);)e=e.offsetParent;return r}function ed(n){const e=getComputedStyle(n);return{scrollMarginTop:parseFloat(e.scrollMarginTop)||0,scrollMarginRight:parseFloat(e.scrollMarginRight)||0,scrollMarginBottom:parseFloat(e.scrollMarginBottom)||0,scrollMarginLeft:parseFloat(e.scrollMarginLeft)||0,scrollPaddingTop:parseFloat(e.scrollPaddingTop)||0,scrollPaddingRight:parseFloat(e.scrollPaddingRight)||0,scrollPaddingBottom:parseFloat(e.scrollPaddingBottom)||0,scrollPaddingLeft:parseFloat(e.scrollPaddingLeft)||0}}function cT(n){return n==="starting"?J4:cn}const Kz={...wc,...gf},Yz=E.forwardRef(function(e,t){const{render:i,className:r,...o}=e,{store:a,popupRef:u,onOpenChangeComplete:f,setOpen:d,valueRef:m,selectedItemTextRef:p,keyboardActiveRef:b,multiple:v,handleScrollArrowVisibility:S,scrollHandlerRef:w}=Nl(),{side:A,align:C,alignItemWithTriggerActive:T,setControlledAlignItemWithTrigger:R,scrollDownArrowRef:N,scrollUpArrowRef:O}=Dz(),z=fv()!=null,D=JA(),j=An(),B=ot(a,rt.id),K=ot(a,rt.open),F=ot(a,rt.mounted),Y=ot(a,rt.popupProps),V=ot(a,rt.transitionStatus),Z=ot(a,rt.triggerElement),q=ot(a,rt.positionerElement),P=ot(a,rt.listElement),W=E.useRef(0),U=E.useRef(!1),$=E.useRef(0),Q=E.useRef(!1),L=E.useRef({}),_=df(),J=Le(se=>{if(!q||!u.current||!Q.current)return;if(U.current||!T){S();return}const fe=q.style.top==="0px",me=q.style.bottom==="0px",Ne=q.getBoundingClientRect().height,oe=cs(q),xe=getComputedStyle(q),Se=parseFloat(xe.marginTop),Ge=parseFloat(xe.marginBottom),De=oe.documentElement.clientHeight-Se-Ge,pe=se.scrollTop,ye=se.scrollHeight,de=se.clientHeight,Ce=ye-de;let Te=null,Re=null,Me=!1;if(fe){const be=Ce-pe,we=Ne+be,ve=Math.min(we,De);Te=ve,ve!==De?Re=Ce:Me=!0}else if(me){const be=pe-0,we=Ne+be,ve=Math.min(we,De),We=we-De;Te=ve,ve!==De?Re=0:(Me=!0,pe<Ce&&(Re=pe-(be-We)))}Te!=null&&(q.style.height=`${Te}px`),Re!=null&&(se.scrollTop=Re),Me&&(U.current=!0),S()});E.useImperativeHandle(w,()=>J,[J]),Sc({open:K,ref:u,onComplete(){K&&(f==null||f(!0))}});const le=E.useMemo(()=>({open:K,transitionStatus:V,side:A,align:C}),[K,V,A,C]);Pe(()=>{!q||!u.current||Object.keys(L.current).length||(L.current={top:q.style.top||"0",left:q.style.left||"0",right:q.style.right,height:q.style.height,bottom:q.style.bottom,minHeight:q.style.minHeight,maxHeight:q.style.maxHeight,marginTop:q.style.marginTop,marginBottom:q.style.marginBottom})},[u,q]),Pe(()=>{F||T||(Q.current=!1,U.current=!1,W.current=0,$.current=0,Wd(q,L.current))},[F,T,q,u]),Pe(()=>{const se=u.current;if(!(!F||!Z||!q||!se)){if(!T){Q.current=!0,_.request(S);return}queueMicrotask(()=>{var dt;const fe=getComputedStyle(q),me=getComputedStyle(se),Ne=cs(Z),oe=xn(q),xe=Z.getBoundingClientRect(),Se=q.getBoundingClientRect(),Ge=xe.left,De=xe.height,pe=P||se,ye=pe.scrollHeight,de=parseFloat(me.borderBottomWidth),Ce=parseFloat(fe.marginTop)||10,Te=parseFloat(fe.marginBottom)||10,Re=parseFloat(fe.minHeight)||100,Me=5,be=5,we=20,ve=Ne.documentElement.clientHeight-Ce-Te,We=Ne.documentElement.clientWidth,nt=ve-xe.bottom+De,Qe=p.current,ht=m.current;let lt=0,Ft=0;if(Qe&&ht){const Et=ht.getBoundingClientRect(),Kt=Qe.getBoundingClientRect(),Dn=Et.left-Ge,Un=Kt.left-Se.left,Er=Et.top-xe.top+Et.height/2,Fs=Kt.top-Se.top+Kt.height/2;lt=Dn-Un,Ft=Fs-Er}const sn=nt+Ft+Te+de;let Pt=Math.min(ve,sn);const He=ve-Ce-Te,$e=sn-Pt,it=Math.max(Me,Ge+lt),yi=We-be,Nn=Math.max(0,it+Se.width-yi);q.style.left=`${it-Nn}px`,q.style.height=`${Pt}px`,q.style.maxHeight="auto",q.style.marginTop=`${Ce}px`,q.style.marginBottom=`${Te}px`,se.style.height="100%";const vt=pe.scrollHeight-pe.clientHeight,Mt=$e>=vt;Mt&&(Pt=Math.min(ve,Se.height)-($e-vt));const Xt=xe.top<we||xe.bottom>ve-we||Pt<Math.min(ye,Re),_e=(((dt=oe.visualViewport)==null?void 0:dt.scale)??1)!==1&&tA;if(Xt||_e){Q.current=!0,Wd(q,L.current),Zi.flushSync(()=>R(!1));return}if(Mt){const Et=Math.max(0,ve-sn);q.style.top=Se.height>=He?"0":`${Et}px`,q.style.height=`${Pt}px`,pe.scrollTop=pe.scrollHeight-pe.clientHeight,W.current=Math.max(Re,Pt)}else q.style.bottom="0",W.current=Math.max(Re,Pt),pe.scrollTop=$e;W.current===ve&&(U.current=!0),S(),setTimeout(()=>{Q.current=!0})})}},[a,F,q,Z,m,p,u,S,T,R,_,N,O,P]),E.useEffect(()=>{if(!T||!q||!F)return;const se=xn(q);function fe(me){d(!1,Je(w5,me))}return se.addEventListener("resize",fe),()=>{se.removeEventListener("resize",fe)}},[d,T,q,F]);const ae={...P?{role:"presentation","aria-orientation":void 0}:{role:"listbox","aria-multiselectable":v||void 0,id:`${B}-list`},onKeyDown(se){b.current=!0,z&&hv.has(se.key)&&se.stopPropagation()},onMouseMove(){b.current=!1},onPointerLeave(se){if(rT(se)||se.pointerType==="touch")return;const fe=se.currentTarget;j.start(0,()=>{a.set("activeIndex",null),fe.focus({preventScroll:!0})})},onScroll(se){var fe;P||(fe=w.current)==null||fe.call(w,se.currentTarget)},...T&&{style:P?{height:"100%"}:jz}},ee=dn("div",e,{ref:[t,u],state:le,stateAttributesMapping:Kz,props:[Y,ae,cT(V),{className:!P&&T?$2.className:void 0},o]});return x.jsxs(E.Fragment,{children:[$2.element,x.jsx(tv,{context:D,modal:!1,disabled:!F,restoreFocus:!0,children:ee})]})});let uT=(function(n){return n[n.None=0]="None",n[n.GuessFromOrder=1]="GuessFromOrder",n})({});function dv(n={}){const{label:e,metadata:t,textRef:i,indexGuessBehavior:r,index:o}=n,{register:a,unregister:u,subscribeMapChange:f,elementsRef:d,labelsRef:m,nextIndexRef:p}=kz(),b=E.useRef(-1),[v,S]=E.useState(o??(r===uT.GuessFromOrder?()=>{if(b.current===-1){const C=p.current;p.current+=1,b.current=C}return b.current}:-1)),w=E.useRef(null),A=E.useCallback(C=>{var T;if(w.current=C,v!==-1&&C!==null&&(d.current[v]=C,m)){const R=e!==void 0;m.current[v]=R?e:((T=i==null?void 0:i.current)==null?void 0:T.textContent)??C.textContent}},[v,d,m,e,i]);return Pe(()=>{if(o!=null)return;const C=w.current;if(C)return a(C,t),()=>{u(C)}},[o,a,u,t]),Pe(()=>{if(o==null)return f(C=>{var R;const T=w.current?(R=C.get(w.current))==null?void 0:R.index:null;T!=null&&S(T)})},[o,f,S]),E.useMemo(()=>({ref:A,index:v}),[v,A])}const fT=E.createContext(void 0);function mv(){const n=E.useContext(fT);if(!n)throw new Error(Qn(57));return n}const Qz=E.memo(E.forwardRef(function(e,t){const{render:i,className:r,value:o=null,label:a,disabled:u=!1,nativeButton:f=!1,...d}=e,m=E.useRef(null),p=dv({label:a,textRef:m,indexGuessBehavior:uT.GuessFromOrder}),{store:b,getItemProps:v,setOpen:S,setValue:w,selectionRef:A,typingRef:C,valuesRef:T,keyboardActiveRef:R,multiple:N,highlightItemOnHover:O}=Nl(),z=An(),D=ot(b,rt.isActive,p.index),j=ot(b,rt.isSelected,p.index,o),B=ot(b,rt.isSelectedByFocus,p.index),K=ot(b,rt.isItemEqualToValue),F=p.index,Y=F!==-1,V=E.useRef(null),Z=bn(F);Pe(()=>{if(!Y)return;const ee=T.current;return ee[F]=o,()=>{delete ee[F]}},[Y,F,o,T]),Pe(()=>{if(!Y)return;const ee=b.state.value;let se=ee;N&&Array.isArray(ee)&&ee.length>0&&(se=ee[ee.length-1]),se!==void 0&&cc(se,o,K)&&b.set("selectedIndex",F)},[Y,F,N,K,b,o]);const q=E.useMemo(()=>({disabled:u,selected:j,highlighted:D}),[u,j,D]),P=v({active:D,selected:j});P.onFocus=void 0,P.id=void 0;const W=E.useRef(null),U=E.useRef("mouse"),$=E.useRef(!1),{getButtonProps:Q,buttonRef:L}=bc({disabled:u,focusableWhenDisabled:!0,native:f});function _(ee){const se=b.state.value;if(N){const fe=Array.isArray(se)?se:[],me=j?ZB(fe,o,K):[...fe,o];w(me,Je(Bu,ee))}else w(o,Je(Bu,ee)),S(!1,Je(Bu,ee))}const J={role:"option","aria-selected":j,"aria-disabled":u||void 0,tabIndex:D?0:-1,onFocus(){b.set("activeIndex",F)},onMouseEnter(){!R.current&&b.state.selectedIndex===null&&b.set("activeIndex",F)},onMouseMove(){O&&b.set("activeIndex",F)},onMouseLeave(ee){!O||R.current||rT(ee)||z.start(0,()=>{b.state.activeIndex===F&&b.set("activeIndex",null)})},onTouchStart(){A.current={allowSelectedMouseUp:!1,allowUnselectedMouseUp:!1}},onKeyDown(ee){W.current=ee.key,b.set("activeIndex",F)},onClick(ee){$.current=!1,!(ee.type==="keydown"&&W.current===null)&&(u||W.current===" "&&C.current||U.current!=="touch"&&!D||(W.current=null,_(ee.nativeEvent)))},onPointerEnter(ee){U.current=ee.pointerType},onPointerDown(ee){U.current=ee.pointerType,$.current=!0},onMouseUp(ee){if(u)return;if($.current){$.current=!1;return}const se=!A.current.allowSelectedMouseUp&&j,fe=!A.current.allowUnselectedMouseUp&&!j;se||fe||U.current!=="touch"&&!D||_(ee.nativeEvent)}},le=dn("div",e,{ref:[L,t,p.ref,V],state:q,props:[P,J,d,Q]}),ae=E.useMemo(()=>({selected:j,indexRef:Z,textRef:m,selectedByFocus:B,hasRegistered:Y}),[j,Z,m,B,Y]);return x.jsx(fT.Provider,{value:ae,children:le})})),Wz=E.forwardRef(function(e,t){const i=e.keepMounted??!1,{selected:r}=mv();return i||r?x.jsx(Xz,{...e,ref:t}):null}),Xz=E.memo(E.forwardRef((n,e)=>{const{render:t,className:i,keepMounted:r,...o}=n,{selected:a}=mv(),u=E.useRef(null),{transitionStatus:f,setMounted:d}=rv(a),m=E.useMemo(()=>({selected:a,transitionStatus:f}),[a,f]),p=dn("span",n,{ref:[e,u],state:m,props:[{"aria-hidden":!0,children:"✔️"},o],stateAttributesMapping:gf});return Sc({open:a,ref:u,onComplete(){a||d(!1)}}),p})),$z=E.memo(E.forwardRef(function(e,t){const{indexRef:i,textRef:r,selectedByFocus:o,hasRegistered:a}=mv(),{selectedItemTextRef:u}=Nl(),{className:f,render:d,...m}=e,p=E.useCallback(v=>{if(!v||!a)return;const S=u.current===null||!u.current.isConnected;(o||S&&i.current===0)&&(u.current=v)},[u,i,o,a]);return dn("div",e,{ref:[p,t,r],props:m})}));function Zz(n){const e=E.useRef(""),t=E.useCallback(r=>{r.defaultPrevented||(e.current=r.pointerType,n(r,r.pointerType))},[n]);return{onClick:E.useCallback(r=>{if(r.detail===0){n(r,"keyboard");return}"pointerType"in r&&n(r,r.pointerType),n(r,e.current),e.current=""},[n]),onPointerDown:t}}function hT(n){const[e,t]=E.useState(null),i=Le((u,f)=>{n||t(f)}),r=E.useCallback(()=>{t(null)},[]),{onClick:o,onPointerDown:a}=Zz(i);return E.useMemo(()=>({openMethod:e,reset:r,triggerProps:{onClick:o,onPointerDown:a}}),[e,r,o,a])}function Jz(n){return n==null||n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true"}const e8="data-composite-item-active",t8=[];function n8(n){const{itemSizes:e,cols:t=1,loopFocus:i=!0,dense:r=!1,orientation:o="both",direction:a,highlightedIndex:u,onHighlightedIndexChange:f,rootRef:d,enableHomeAndEndKeys:m=!1,stopEventPropagation:p=!1,disabledIndices:b,modifierKeys:v=t8}=n,[S,w]=E.useState(0),A=t>1,C=E.useRef(null),T=Sr(C,d),R=E.useRef([]),N=E.useRef(!1),O=u??S,z=Le((B,K=!1)=>{if((f??w)(B),K){const F=R.current[B];J2(C.current,F,a,o)}}),D=Le(B=>{if(B.size===0||N.current)return;N.current=!0;const K=Array.from(B.keys()),F=K.find(V=>V==null?void 0:V.hasAttribute(e8))??null,Y=F?K.indexOf(F):-1;Y!==-1&&z(Y),J2(C.current,F,a,o)}),j=E.useMemo(()=>({"aria-orientation":o==="both"?void 0:o,ref:T,onFocus(B){!C.current||!Z2(B.target)||B.target.setSelectionRange(0,B.target.value.length??0)},onKeyDown(B){const K=m?Hz:aT;if(!K.has(B.key)||i8(B,v)||!C.current)return;const Y=a==="rtl",V=Y?Ku:Ha,Z={horizontal:V,vertical:ao,both:V}[o],q=Y?Ha:Ku,P={horizontal:q,vertical:Ia,both:q}[o];if(Z2(B.target)&&!Jz(B.target)){const J=B.target.selectionStart,le=B.target.selectionEnd,ae=B.target.value??"";if(J==null||B.shiftKey||J!==le||B.key!==P&&J<ae.length||B.key!==Z&&J>0)return}let W=O;const U=kd(R,b),$=wy(R,b);if(A){const J=e||Array.from({length:R.current.length},()=>({width:1,height:1})),le=hA(J,t,r),ae=le.findIndex(se=>se!=null&&!bl(R,se,b)),ee=le.reduce((se,fe,me)=>fe!=null&&!bl(R,fe,b)?me:se,-1);W=le[fA({current:le.map(se=>se?R.current[se]:null)},{event:B,orientation:o,loopFocus:i,cols:t,disabledIndices:mA([...b||R.current.map((se,fe)=>bl(R,fe)?fe:void 0),void 0],le),minIndex:ae,maxIndex:ee,prevIndex:dA(O>$?U:O,J,le,t,B.key===ao?"bl":B.key===Ha?"tr":"tl"),rtl:Y})]}const Q={horizontal:[V],vertical:[ao],both:[V,ao]}[o],L={horizontal:[q],vertical:[Ia],both:[q,Ia]}[o],_=A?K:{horizontal:m?Pz:lT,vertical:m?Iz:oT,both:K}[o];m&&(B.key===yf?W=U:B.key===bf&&(W=$)),W===O&&(Q.includes(B.key)||L.includes(B.key))&&(i&&W===$&&Q.includes(B.key)?W=U:i&&W===U&&L.includes(B.key)?W=$:W=In(R,{startingIndex:W,decrement:L.includes(B.key),disabledIndices:b})),W!==O&&!La(R,W)&&(p&&B.stopPropagation(),_.has(B.key)&&B.preventDefault(),z(W,!0),queueMicrotask(()=>{var J;(J=R.current[W])==null||J.focus()}))}}),[t,r,a,b,R,m,O,A,e,i,T,v,z,o,p]);return E.useMemo(()=>({props:j,highlightedIndex:O,onHighlightedIndexChange:z,elementsRef:R,disabledIndices:b,onMapChange:D,relayKeyboardEvent:j.onKeyDown}),[j,O,z,R,b,D])}function i8(n,e){for(const t of Fz.values())if(!e.includes(t)&&n.getModifierState(t))return!0;return!1}function s8(n){const{render:e,className:t,refs:i=Sl,props:r=Sl,state:o=cn,stateAttributesMapping:a,highlightedIndex:u,onHighlightedIndexChange:f,orientation:d,dense:m,itemSizes:p,loopFocus:b,cols:v,enableHomeAndEndKeys:S,onMapChange:w,stopEventPropagation:A=!0,rootRef:C,disabledIndices:T,modifierKeys:R,highlightItemOnHover:N=!1,tag:O="div",...z}=n,D=cv(),{props:j,highlightedIndex:B,onHighlightedIndexChange:K,elementsRef:F,onMapChange:Y,relayKeyboardEvent:V}=n8({itemSizes:p,cols:v,loopFocus:b,dense:m,orientation:d,highlightedIndex:u,onHighlightedIndexChange:f,rootRef:C,stopEventPropagation:A,enableHomeAndEndKeys:S,direction:D,disabledIndices:T,modifierKeys:R}),Z=dn(O,n,{state:o,ref:i,props:[j,...r,z],stateAttributesMapping:a}),q=E.useMemo(()=>({highlightedIndex:B,onHighlightedIndexChange:K,highlightItemOnHover:N,relayKeyboardEvent:V}),[B,K,N,V]);return x.jsx(YE.Provider,{value:q,children:x.jsx(av,{elementsRef:F,onMapChange:P=>{w==null||w(P),Y(P)},children:Z})})}const dT=E.createContext(void 0);function r8(n=!0){const e=E.useContext(dT);if(e===void 0&&!n)throw new Error(Qn(7));return e}let l8=(function(n){return n.disabled="data-disabled",n.orientation="data-orientation",n.multiple="data-multiple",n})({});const tk={multiple(n){return n?{[l8.multiple]:""}:null}},o8=E.forwardRef(function(e,t){const{defaultValue:i,disabled:r=!1,loopFocus:o=!0,onValueChange:a,orientation:u="horizontal",multiple:f=!1,value:d,className:m,render:p,...b}=e,v=fv(),S=E.useMemo(()=>{if(d===void 0)return i??[]},[d,i]),w=((v==null?void 0:v.disabled)??!1)||r,[A,C]=Pd({controlled:d,default:S,name:"ToggleGroup",state:"value"}),T=Le((D,j,B)=>{let K;if(f?(K=A.slice(),j?K.push(D):K.splice(A.indexOf(D),1)):K=j?[D]:[],Array.isArray(K)){if(a==null||a(K,B),B.isCanceled)return;C(K)}}),R=E.useMemo(()=>({disabled:w,multiple:f,orientation:u}),[w,u,f]),N=E.useMemo(()=>({disabled:w,orientation:u,setGroupValue:T,value:A}),[w,u,T,A]),O={role:"group"},z=dn("div",e,{enabled:!!v,state:R,ref:t,props:[O,b],stateAttributesMapping:tk});return x.jsx(dT.Provider,{value:N,children:v?z:x.jsx(s8,{render:p,className:m,state:R,refs:[t],props:[O,b],stateAttributesMapping:tk,loopFocus:o})})});function a8(n={}){const{highlightItemOnHover:e,highlightedIndex:t,onHighlightedIndexChange:i}=_b(),{ref:r,index:o}=dv(n),a=t===o,u=E.useRef(null),f=Sr(r,u);return{compositeProps:E.useMemo(()=>({tabIndex:a?0:-1,onFocus(){i(o)},onMouseMove(){const m=u.current;if(!e||!m)return;const p=m.hasAttribute("disabled")||m.ariaDisabled==="true";!a&&!p&&m.focus()}}),[a,i,o,e]),compositeRef:f,index:o}}function mT(n){const{render:e,className:t,state:i=cn,props:r=Sl,refs:o=Sl,metadata:a,stateAttributesMapping:u,tag:f="div",...d}=n,{compositeProps:m,compositeRef:p}=a8({metadata:a});return dn(f,n,{state:i,ref:[...o,p],props:[m,...r,d],stateAttributesMapping:u})}const c8=E.forwardRef(function(e,t){const{className:i,defaultPressed:r=!1,disabled:o=!1,form:a,onPressedChange:u,pressed:f,render:d,type:m,value:p,nativeButton:b=!0,...v}=e,S=p??"",w=r8(),A=(w==null?void 0:w.value)??[],C=w?void 0:r,T=(o||(w==null?void 0:w.disabled))??!1,[R,N]=Pd({controlled:w&&S?(A==null?void 0:A.indexOf(S))>-1:f,default:C,name:"Toggle",state:"pressed"}),O=Le((Y,V)=>{var Z;(Z=w==null?void 0:w.setGroupValue)==null||Z.call(w,S,Y,V),u==null||u(Y,V)}),{getButtonProps:z,buttonRef:D}=bc({disabled:T,native:b}),j=E.useMemo(()=>({disabled:T,pressed:R}),[T,R]),B=[D,t],K=[{"aria-pressed":R,onClick(Y){const V=!R,Z=Je(km,Y.nativeEvent);O(V,Z),!Z.isCanceled&&N(V)}},v,z],F=dn("button",e,{enabled:!w,state:j,ref:B,props:K});return w?x.jsx(mT,{tag:"button",render:d,className:i,state:j,refs:B,props:K}):F});let u8;function Rm(){return u8}function f8({value:n,onValueChange:e,options:t,size:i="md"}){return x.jsx(o8,{value:[n],onValueChange:r=>{const o=r.find(a=>a!==n)??r[0];o&&e(o)},className:"inline-flex items-center gap-0.5 rounded-md border border-border bg-secondary/50 p-0.5",children:t.map(r=>x.jsx(c8,{value:r.value,"aria-label":r["aria-label"],className:bt("inline-flex items-center justify-center gap-1.5 rounded-[5px] font-medium text-muted-foreground outline-none transition-colors","hover:text-foreground","data-[pressed]:bg-card data-[pressed]:text-foreground data-[pressed]:shadow-sm","focus-visible:ring-2 focus-visible:ring-ring",i==="sm"?"h-6 px-2 text-xs":"h-7 px-2.5 text-[13px]"),children:r.label},r.value))})}function pT({value:n,onValueChange:e,options:t,placeholder:i="Select…",disabled:r,className:o,"aria-label":a}){return x.jsxs(nz,{items:t,value:n,onValueChange:u=>e(u),disabled:r,children:[x.jsxs(hz,{"aria-label":a,className:bt("inline-flex h-9 min-w-0 items-center justify-between gap-2 rounded-md border border-input bg-secondary/40 px-3 text-[13px] text-foreground outline-none transition-colors","hover:bg-secondary/70 focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50 data-[popup-open]:border-ring",o),children:[x.jsx(mz,{className:"truncate",children:u=>{const f=t.find(d=>d.value===u);return f?f.label:x.jsx("span",{className:"text-muted-foreground",children:i})}}),x.jsx(pz,{children:x.jsx(P3,{className:"size-3.5 shrink-0 text-muted-foreground"})})]}),x.jsx(yz,{container:Rm(),children:x.jsx(Bz,{sideOffset:6,className:"z-50 outline-none",alignItemWithTrigger:!1,children:x.jsx(Yz,{className:bt("max-h-[min(20rem,var(--available-height))] min-w-[var(--anchor-width)] overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-xl outline-none","origin-[var(--transform-origin)] transition-[transform,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0"),children:t.map(u=>x.jsxs(Qz,{value:u.value,className:bt("flex cursor-pointer select-none items-start gap-2 rounded-md py-1.5 pl-2 pr-2 text-[13px] outline-none","data-[highlighted]:bg-accent/15 data-[highlighted]:text-foreground"),children:[x.jsx("span",{className:"flex w-4 shrink-0 items-center justify-center pt-0.5",children:x.jsx(Wz,{children:x.jsx(xE,{className:"size-3.5 text-accent"})})}),x.jsxs("span",{className:"flex flex-col",children:[x.jsx($z,{children:u.label}),u.description?x.jsx("span",{className:"text-xs text-muted-foreground",children:u.description}):null]})]},u.value))})})})]})}const Yu=E.forwardRef(function({className:e,...t},i){return x.jsx("input",{ref:i,className:bt("h-9 w-full rounded-md border border-input bg-secondary/40 px-3 text-[13px] text-foreground outline-none transition-colors placeholder:text-muted-foreground","hover:bg-secondary/60 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t})}),gT=E.forwardRef(function({className:e,...t},i){return x.jsx("textarea",{ref:i,className:bt("w-full rounded-md border border-input bg-secondary/40 px-3 py-2 text-[13px] text-foreground outline-none transition-colors placeholder:text-muted-foreground","hover:bg-secondary/60 focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring","disabled:cursor-not-allowed disabled:opacity-50",e),...t})}),yT=E.createContext(void 0);function kc(n){const e=E.useContext(yT);if(n===!1&&e===void 0)throw new Error(Qn(27));return e}const h8={...wc,...gf},bT=E.forwardRef(function(e,t){const{render:i,className:r,forceRender:o=!1,...a}=e,{store:u}=kc(),f=u.useState("open"),d=u.useState("nested"),m=u.useState("mounted"),p=u.useState("transitionStatus"),b=E.useMemo(()=>({open:f,transitionStatus:p}),[f,p]);return dn("div",e,{state:b,ref:[u.context.backdropRef,t],stateAttributesMapping:h8,props:[{role:"presentation",hidden:!m,style:{userSelect:"none",WebkitUserSelect:"none"}},a],enabled:o||!d})}),d8=E.forwardRef(function(e,t){const{render:i,className:r,disabled:o=!1,nativeButton:a=!0,...u}=e,{store:f}=kc(),d=f.useState("open");function m(S){d&&f.setOpen(!1,Je(S5,S.nativeEvent))}const{getButtonProps:p,buttonRef:b}=bc({disabled:o,native:a}),v=E.useMemo(()=>({disabled:o}),[o]);return dn("button",e,{state:v,ref:[t,b],props:[{onClick:m},u,p]})});let m8=(function(n){return n.nestedDialogs="--nested-dialogs",n})({}),p8=(function(n){return n[n.open=oo.open]="open",n[n.closed=oo.closed]="closed",n[n.startingStyle=oo.startingStyle]="startingStyle",n[n.endingStyle=oo.endingStyle]="endingStyle",n.nested="data-nested",n.nestedDialogOpen="data-nested-dialog-open",n})({});const vT=E.createContext(void 0);function g8(){const n=E.useContext(vT);if(n===void 0)throw new Error(Qn(26));return n}const y8={...wc,...gf,nestedDialogOpen(n){return n?{[p8.nestedDialogOpen]:""}:null}},xT=E.forwardRef(function(e,t){const{className:i,finalFocus:r,initialFocus:o,render:a,...u}=e,{store:f}=kc(),d=f.useState("descriptionElementId"),m=f.useState("disablePointerDismissal"),p=f.useState("floatingRootContext"),b=f.useState("popupProps"),v=f.useState("modal"),S=f.useState("mounted"),w=f.useState("nested"),A=f.useState("nestedOpenDialogCount"),C=f.useState("open"),T=f.useState("openMethod"),R=f.useState("titleElementId"),N=f.useState("transitionStatus"),O=f.useState("role");g8(),Sc({open:C,ref:f.context.popupRef,onComplete(){var F,Y;C&&((Y=(F=f.context).onOpenChangeComplete)==null||Y.call(F,!0))}});function z(F){return F==="touch"?f.context.popupRef.current:!0}const D=o===void 0?z:o,j=A>0,B=E.useMemo(()=>({open:C,nested:w,transitionStatus:N,nestedDialogOpen:j}),[C,w,N,j]),K=dn("div",e,{state:B,props:[b,{"aria-labelledby":R??void 0,"aria-describedby":d??void 0,role:O,tabIndex:-1,hidden:!S,onKeyDown(F){hv.has(F.key)&&F.stopPropagation()},style:{[m8.nestedDialogs]:A}},u],ref:[t,f.context.popupRef,f.useStateSetter("popupElement")],stateAttributesMapping:y8});return x.jsx(tv,{context:p,openInteractionType:T,disabled:!S,closeOnFocusOut:!m,initialFocus:D,returnFocus:r,modal:v!==!1,restoreFocus:"popup",children:K})}),ST=E.forwardRef(function(e,t){const{keepMounted:i=!1,...r}=e,{store:o}=kc(),a=o.useState("mounted"),u=o.useState("modal");return a||i?x.jsx(vT.Provider,{value:i,children:x.jsxs(Jb,{ref:t,...r,children:[a&&u===!0&&x.jsx(uv,{ref:o.context.internalBackdropRef,inert:lv(!open)}),e.children]})}):null});function b8(n){const{store:e,parentContext:t,actionsRef:i}=n,r=e.useState("open"),o=e.useState("disablePointerDismissal"),a=e.useState("modal"),u=e.useState("popupElement"),{openMethod:f,triggerProps:d,reset:m}=hT(r);UA(e);const{forceUnmount:p}=VA(r,e,()=>{m()}),b=Le(K=>{const F=Je(K);return F.preventUnmountOnClose=()=>{e.set("preventUnmountingOnClose",!0)},F}),v=E.useCallback(()=>{e.setOpen(!1,b(XE))},[e,b]);E.useImperativeHandle(i,()=>({unmount:p,close:v}),[p,v]);const S=KA({popupStore:e,onOpenChange:e.setOpen,treatPopupAsFloatingElement:!0,noEmit:!0}),[w,A]=E.useState(0),C=w===0,T=WA(S),R=iv(S,{outsidePressEvent(){return e.context.internalBackdropRef.current||e.context.backdropRef.current?"intentional":{mouse:a==="trap-focus"?"sloppy":"intentional",touch:"sloppy"}},outsidePress(K){if("button"in K&&K.button!==0||"touches"in K&&K.touches.length!==1)return!1;const F=ei(K);if(C&&!o){const Y=F;return a&&(e.context.internalBackdropRef.current||e.context.backdropRef.current)?e.context.internalBackdropRef.current===Y||e.context.backdropRef.current===Y||ft(Y,u)&&!(Y!=null&&Y.hasAttribute("data-base-ui-portal")):!0}return!1},escapeKey:C});ov(r&&a===!0,u);const{getReferenceProps:N,getFloatingProps:O,getTriggerProps:z}=Am([T,R]);e.useContextCallback("onNestedDialogOpen",K=>{A(K+1)}),e.useContextCallback("onNestedDialogClose",()=>{A(0)}),E.useEffect(()=>(t!=null&&t.onNestedDialogOpen&&r&&t.onNestedDialogOpen(w),t!=null&&t.onNestedDialogClose&&!r&&t.onNestedDialogClose(),()=>{t!=null&&t.onNestedDialogClose&&r&&t.onNestedDialogClose()}),[r,t,w]);const D=E.useMemo(()=>N(d),[N,d]),j=E.useMemo(()=>z(d),[z,d]),B=E.useMemo(()=>O(),[O]);e.useSyncedValues({openMethod:f,activeTriggerProps:D,inactiveTriggerProps:j,popupProps:B,floatingRootContext:S,nestedOpenDialogCount:w})}const v8={...FA,modal:Ae(n=>n.modal),nested:Ae(n=>n.nested),nestedOpenDialogCount:Ae(n=>n.nestedOpenDialogCount),disablePointerDismissal:Ae(n=>n.disablePointerDismissal),openMethod:Ae(n=>n.openMethod),descriptionElementId:Ae(n=>n.descriptionElementId),titleElementId:Ae(n=>n.titleElementId),viewportElement:Ae(n=>n.viewportElement),role:Ae(n=>n.role)};class x8 extends Gb{constructor(t){super(S8(t),{popupRef:E.createRef(),backdropRef:E.createRef(),internalBackdropRef:E.createRef(),triggerElements:new Em,onOpenChange:void 0,onOpenChangeComplete:void 0},v8);Dt(this,"setOpen",(t,i)=>{var u,f,d,m;if(i.preventUnmountOnClose=()=>{this.set("preventUnmountingOnClose",!0)},!t&&i.trigger==null&&this.state.activeTriggerId!=null&&(i.trigger=this.state.activeTriggerElement??void 0),(f=(u=this.context).onOpenChange)==null||f.call(u,t,i),i.isCanceled)return;const r={open:t,nativeEvent:i.event,reason:i.reason,nested:this.state.nested};(d=this.state.floatingRootContext.context.events)==null||d.emit("openchange",r);const o={open:t},a=((m=i.trigger)==null?void 0:m.id)??null;(a||t)&&(o.activeTriggerId=a,o.activeTriggerElement=i.trigger??null),this.update(o)})}}function S8(n={}){return{...qA(),modal:!0,disablePointerDismissal:!1,popupElement:null,viewportElement:null,descriptionElementId:void 0,titleElementId:void 0,openMethod:null,nested:!1,nestedOpenDialogCount:0,role:"dialog",...n}}function wT(n){const{children:e,open:t,defaultOpen:i=!1,onOpenChange:r,onOpenChangeComplete:o,disablePointerDismissal:a=!1,modal:u=!0,actionsRef:f,handle:d,triggerId:m,defaultTriggerId:p=null}=n,b=kc(!0),v=!!b,S=pi(()=>(d==null?void 0:d.store)??new x8({open:t??i,activeTriggerId:m!==void 0?m:p,modal:u,disablePointerDismissal:a,nested:v})).current;S.useControlledProp("open",t,i),S.useControlledProp("activeTriggerId",m,p),S.useSyncedValues({disablePointerDismissal:a,nested:v,modal:u}),S.useContextCallback("onOpenChange",r),S.useContextCallback("onOpenChangeComplete",o);const w=S.useState("payload");b8({store:S,actionsRef:f,parentContext:b==null?void 0:b.store.context});const A=E.useMemo(()=>({store:S}),[S]);return x.jsx(yT.Provider,{value:A,children:typeof e=="function"?e({payload:w}):e})}const kT=E.forwardRef(function(e,t){const{render:i,className:r,id:o,...a}=e,{store:u}=kc(),f=bm(o);return u.useSyncedValueWithCleanup("titleElementId",f),dn("h2",e,{ref:t,props:[{id:f},a]})});function us(n){if(!n)return"—";const e=new Date(n);return Number.isNaN(e.getTime())?"—":new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit",second:"2-digit"}).format(e)}function Hs(n,e=Date.now()){if(!n)return"—";const t=Date.parse(n);if(Number.isNaN(t))return"—";const i=e-t,r=Math.abs(i);if(r<1e4)return"just now";const o=[[1e3,"s"],[6e4,"m"],[36e5,"h"],[864e5,"d"]];let a=Math.round(r/1e3),u="s";for(const[f,d]of o)r>=f&&(a=Math.round(r/f),u=d);return i>=0?`${a}${u} ago`:`in ${a}${u}`}function co(n){return n==null||!Number.isFinite(n)?"—":new Intl.NumberFormat("en-US").format(n)}function w8(n,e){return n.length>e?`${n.slice(0,e-1)}…`:n}function Xd(n,e=12){if(!n)return"—";const[t,i]=n.includes(":")?n.split(":",2):["",n],r=i??"",o=r.length>e?`${r.slice(0,e)}…`:r;return t?`${t}:${o}`:o}function k8(n,e){const t=n==null?void 0:n.allowed;return t?t.includes(e):!0}function CT(n){return!n||ET(n)?"—":n.name||n.email||n.id||"—"}function nk(n){return`${n.type} ${n.name||n.id}`}function C8(n){if(!Array.isArray(n)||n.length===0)return"—";const[e,...t]=n;return t.length>0?`${nk(e)} +${t.length}`:nk(e)}function ET(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&n.$erased===!0}function pv(n){var e;return((e=n.integrity)==null?void 0:e.erased)??[]}function E8(n){switch(n){case"success":return"border-success/30 bg-success/10 text-success";case"failure":return"border-destructive/30 bg-destructive/10 text-destructive";default:return"border-border bg-secondary/60 text-muted-foreground"}}function A8(n){const e=new Map;for(const t of[...n].sort((i,r)=>i.name.localeCompare(r.name))){const i=t.group??"",r=e.get(i)??[];r.push(t),e.set(i,r)}return[...e.entries()].sort(([t],[i])=>t===""?1:i===""?-1:t.localeCompare(i)).map(([t,i])=>({group:t||"Ungrouped",actions:i}))}function T8(n){return n.source!=="code"}function gv(n){return n.failures>0?"failing":n.lag>0?"lagging":"healthy"}function Oy(n){let e="healthy";for(const t of n)for(const i of t.tenants){const r=gv(i);if(r==="failing")return"failing";r==="lagging"&&(e="lagging")}return e}function R8(n){switch(n){case"healthy":return"border-success/30 bg-success/10 text-success";case"lagging":return"border-warning/30 bg-warning/10 text-warning";case"failing":return"border-destructive/30 bg-destructive/10 text-destructive"}}function M8(n){switch(n){case"genesis":return"Genesis (seq 1)";case"checkpoint":return"Signed checkpoint";case"unanchored":return"Unanchored";case"none":return"None (empty range)"}}function O8(n,e=[]){var o;if(!n.ok){const a=n.issues.length;return{tone:"fail",title:`Verification failed: ${a} issue${a===1?"":"s"} found`,detail:((o=n.issues[0])==null?void 0:o.message)??"The log does not match its hash chain."}}if(n.checked===0||n.toSeq===null)return{tone:"ok",title:"No events to verify",detail:"The log is empty."};if(n.signedThrough===null)return{tone:"warn",title:`Chain intact through #${n.toSeq}`,detail:"Not yet anchored by a signed checkpoint."};const t=[...e].filter(a=>a.seq===n.signedThrough).sort((a,u)=>u.at.localeCompare(a.at))[0],i=t==null?void 0:t.keyId,r=[i?`Signed by key ${i}`:"Signed checkpoint verified"];return n.toSeq>n.signedThrough&&r.push(`#${n.signedThrough+1}–#${n.toSeq} intact, not yet signed`),{tone:"ok",title:`Verified through #${n.signedThrough}`,detail:r.join(" · "),...i?{keyId:i}:{}}}const N8={csv:"csv",json:"json",jsonl:"jsonl",bundle:"bundle.json"};function ik(n,e,t){const i=t==null?void 0:t.match(/filename\*?=(?:UTF-8'')?"?([^";]+)"?/i);if(i!=null&&i[1])try{return decodeURIComponent(i[1])}catch{return i[1]}return`audit-${n.replace(/[^a-zA-Z0-9._-]+/g,"_")||"tenant"}.${N8[e]}`}const D8={primary:"bg-primary text-primary-foreground hover:bg-primary/90 border border-transparent",secondary:"bg-secondary/60 text-foreground border border-border hover:bg-secondary",ghost:"bg-transparent text-muted-foreground hover:bg-secondary/60 hover:text-foreground border border-transparent",danger:"bg-transparent text-destructive border border-destructive/30 hover:bg-destructive/10"},j8={sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-9 px-3.5 text-[13px] gap-2",icon:"h-8 w-8 justify-center"},vn=E.forwardRef(function({className:e,variant:t="secondary",size:i="md",loading:r=!1,icon:o,children:a,disabled:u,...f},d){return x.jsxs("button",{ref:d,disabled:u||r,className:bt("inline-flex shrink-0 items-center rounded-md font-medium outline-none transition-colors","focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50",D8[t],j8[i],e),...f,children:[r?x.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",className:"animate-spin","aria-hidden":!0,children:x.jsx("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"20",strokeDashoffset:"10",strokeLinecap:"round"})}):o,a]})});function L8(n,e){switch(e.type){case"add":return{toasts:[...n.toasts,e.toast]};case"remove":return{toasts:n.toasts.filter(t=>t.id!==e.id)};default:return n}}const AT=E.createContext(null);function Ho(){const n=E.useContext(AT);if(!n)throw new Error("useToast must be used within ToastProvider");return n}const B8={success:"bg-success",error:"bg-destructive",warning:"bg-warning",info:"bg-accent"},z8={success:"border-l-[var(--success)]",error:"border-l-[var(--destructive)]",warning:"border-l-[var(--warning)]",info:"border-l-[var(--accent)]"};function P8({toast:n,onRemove:e}){return E.useEffect(()=>{const t=setTimeout(()=>e(n.id),4500);return()=>clearTimeout(t)},[n.id,e]),x.jsxs("div",{role:"alert",className:bt("flex min-w-[280px] max-w-sm items-start gap-2.5 rounded-lg border border-border bg-card px-3.5 py-3 shadow-lg","border-l-[3px]",z8[n.kind]),style:{animation:"toastIn 160ms ease-out"},children:[x.jsx("span",{className:bt("mt-1 size-2 shrink-0 rounded-full",B8[n.kind]),"aria-hidden":!0}),x.jsxs("div",{className:"flex-1 min-w-0",children:[x.jsx("p",{className:"m-0 text-[13px] font-medium text-foreground leading-snug",children:n.message}),n.detail&&x.jsx("p",{className:"mt-1 text-xs text-muted-foreground leading-snug",children:n.detail})]}),x.jsx("button",{"aria-label":"Dismiss",onClick:()=>e(n.id),className:"shrink-0 rounded-sm text-muted-foreground hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring outline-none",children:x.jsx(gm,{className:"size-3.5"})}),x.jsx("style",{children:`
|
|
230
|
+
@keyframes toastIn {
|
|
231
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
232
|
+
to { opacity: 1; transform: translateY(0); }
|
|
233
|
+
}
|
|
234
|
+
`})]})}function I8({children:n}){const[e,t]=E.useReducer(L8,{toasts:[]}),i=E.useCallback((o,a,u)=>{const f=`${Date.now()}-${Math.random()}`;t({type:"add",toast:{id:f,kind:o,message:a,detail:u}})},[]),r=E.useCallback(o=>{t({type:"remove",id:o})},[]);return x.jsxs(AT.Provider,{value:{add:i},children:[n,x.jsx("div",{"aria-live":"polite","aria-atomic":"false",className:"fixed bottom-6 right-6 z-[9999] flex flex-col gap-2",children:e.toasts.map(o=>x.jsx(P8,{toast:o,onRemove:r},o.id))})]})}function TT({className:n}){return x.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",className:bt("animate-spin",n),"aria-hidden":!0,children:x.jsx("circle",{cx:"8",cy:"8",r:"6",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"24",strokeDashoffset:"12",strokeLinecap:"round"})})}function Dl({label:n}){return x.jsxs("div",{className:"mt-8 flex items-center justify-center gap-2 text-[13px] text-muted-foreground",children:[x.jsx(TT,{}),n]})}const yv="inline-flex items-center rounded-md border px-1.5 py-0.5 text-[11px] font-medium uppercase tracking-wide";function bv({outcome:n}){return n?x.jsx("span",{className:bt(yv,E8(n)),children:n}):x.jsx("span",{className:"text-xs text-muted-foreground",children:"—"})}function Ny({health:n}){return x.jsx("span",{className:bt(yv,R8(n)),children:n})}function Ds({tone:n,children:e}){const t={success:"border-success/30 bg-success/10 text-success",warning:"border-warning/30 bg-warning/10 text-warning",destructive:"border-destructive/30 bg-destructive/10 text-destructive",accent:"border-accent/30 bg-accent/10 text-accent",muted:"border-border bg-secondary/60 text-muted-foreground"};return x.jsx("span",{className:bt(yv,t[n]),children:e})}function en({className:n,children:e}){return x.jsx("span",{className:bt("font-mono text-[12px] text-foreground",n),children:e})}function vf({value:n,label:e="Copy",className:t}){const i=Ho(),[r,o]=E.useState(!1);return E.useEffect(()=>{if(!r)return;const a=setTimeout(()=>o(!1),1500);return()=>clearTimeout(a)},[r]),x.jsx("button",{type:"button",title:e,"aria-label":e,onClick:async a=>{a.stopPropagation();try{await navigator.clipboard.writeText(n),o(!0)}catch{i.add("error","Copy failed","Clipboard access was denied by the browser.")}},className:bt("inline-flex size-6 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none transition-colors","hover:bg-secondary/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",t),children:r?x.jsx(xE,{className:"size-3.5 text-success"}):x.jsx(H3,{className:"size-3.5"})})}function vl({title:n,description:e,actions:t}){return x.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-4",children:[x.jsxs("div",{children:[x.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:n}),e?x.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:e}):null]}),t]})}function k0({title:n,description:e,actions:t,children:i,className:r}){return x.jsxs("section",{className:bt("rounded-xl border border-border bg-card",r),children:[x.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-border px-4 py-3",children:[x.jsxs("div",{children:[x.jsx("h2",{className:"text-[13px] font-semibold text-foreground",children:n}),e?x.jsx("p",{className:"mt-0.5 text-xs text-muted-foreground",children:e}):null]}),t]}),x.jsx("div",{className:"px-4 py-4",children:i})]})}function td({label:n,value:e,hint:t,tone:i}){return x.jsxs("div",{className:"rounded-xl border border-border bg-card px-4 py-4",children:[x.jsx("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:n}),x.jsx("p",{className:bt("mt-1.5 text-2xl font-semibold tabular-nums tracking-tight",i),children:e}),t?x.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:t}):null]})}function zt({label:n,children:e,copy:t}){return x.jsxs("div",{className:"grid grid-cols-[8rem_1fr] items-start gap-3 py-1.5",children:[x.jsx("dt",{className:"pt-0.5 text-xs text-muted-foreground",children:n}),x.jsxs("dd",{className:"m-0 flex min-w-0 items-start gap-1 text-[13px] text-foreground",children:[x.jsx("span",{className:"min-w-0 flex-1 break-all",children:e}),t?x.jsx(vf,{value:t,label:`Copy ${n.toLowerCase()}`}):null]})]})}function RT({open:n,onClose:e,title:t,children:i,footer:r,wide:o}){return x.jsx(wT,{open:n,onOpenChange:a=>!a&&e(),children:x.jsxs(ST,{container:Rm(),children:[x.jsx(bT,{className:"fixed inset-0 z-50 bg-black/50 backdrop-blur-sm"}),x.jsxs(xT,{className:bt("fixed left-1/2 top-1/2 z-50 flex max-h-[85vh] w-full -translate-x-1/2 -translate-y-1/2 flex-col rounded-xl border border-border bg-card shadow-2xl outline-none",o?"max-w-2xl":"max-w-md"),children:[x.jsx("div",{className:"border-b border-border px-5 py-4",children:x.jsx(kT,{className:"text-[15px] font-semibold text-foreground",children:t})}),x.jsx("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-y-auto px-5 py-5",children:i}),r?x.jsx("div",{className:"flex items-center justify-end gap-2 border-t border-border px-5 py-3",children:r}):null]})]})})}function MT({open:n,onClose:e,onConfirm:t,title:i,confirmLabel:r,danger:o,loading:a,children:u,confirmDisabled:f}){return x.jsx(RT,{open:n,onClose:e,title:i,footer:x.jsxs(x.Fragment,{children:[x.jsx(vn,{variant:"secondary",onClick:e,disabled:a,children:"Cancel"}),x.jsx(vn,{variant:o?"danger":"primary",loading:a,disabled:f,onClick:t,children:r})]}),children:u})}function H8({open:n,onClose:e,title:t,subtitle:i,actions:r,children:o}){return x.jsx(wT,{open:n,onOpenChange:a=>!a&&e(),children:x.jsxs(ST,{container:Rm(),children:[x.jsx(bT,{className:"fixed inset-0 z-50 bg-black/40 backdrop-blur-[1px] transition-opacity data-[ending-style]:opacity-0 data-[starting-style]:opacity-0"}),x.jsxs(xT,{"data-testid":"drawer",className:bt("fixed inset-y-0 right-0 z-50 flex w-full max-w-xl flex-col border-l border-border bg-card shadow-2xl outline-none","transition-transform data-[ending-style]:translate-x-full data-[starting-style]:translate-x-full"),children:[x.jsxs("div",{className:"flex items-start gap-3 border-b border-border px-5 py-4",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx(kT,{className:"truncate font-mono text-[15px] font-semibold text-foreground",children:t}),i?x.jsx("div",{className:"mt-0.5 text-xs text-muted-foreground",children:i}):null]}),r,x.jsx(d8,{"aria-label":"Close",className:"inline-flex size-8 shrink-0 items-center justify-center rounded-md text-muted-foreground outline-none hover:bg-secondary/60 hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:x.jsx(gm,{className:"size-4"})})]}),x.jsx("div",{className:"min-h-0 flex-1 overflow-y-auto px-5 py-5",children:o})]})]})})}function Ji({children:n}){return x.jsx("div",{className:"mt-4 rounded-xl border border-border bg-card px-4 py-16 text-center",children:x.jsx("p",{className:"text-[13px] text-muted-foreground",children:n})})}function xl({children:n}){return x.jsx("div",{className:"mx-auto max-w-6xl px-4 py-8 sm:px-6",children:n})}const _8={healthy:"text-success",lagging:"text-warning",failing:"text-destructive"};function U8({ctx:n}){var m;const e=Li({queryKey:["overview"],queryFn:kj,refetchInterval:15e3}),t=((m=n.config.features)==null?void 0:m.streams)!==!1&&n.can("stream:read");if(e.isLoading)return x.jsxs(xl,{children:[x.jsx(vl,{title:"Overview"}),x.jsx(Dl,{label:"Loading overview…"})]});if(e.isError||!e.data)return x.jsxs(xl,{children:[x.jsx(vl,{title:"Overview"}),x.jsx(Ji,{children:"Failed to load the overview."})]});const{tenants:i,events:r,recent:o,streams:a}=e.data,u=Oy(a),f=a.reduce((p,b)=>p+b.tenants.length,0),d=a.reduce((p,b)=>p+b.tenants.reduce((v,S)=>v+S.lag,0),0);return x.jsxs(xl,{children:[x.jsx(vl,{title:"Overview",description:"Every tenant's tamper-evident log at a glance."}),x.jsxs("div",{className:"mt-6 grid grid-cols-1 gap-3 sm:grid-cols-3",children:[x.jsx(td,{label:"Tenants",value:co(i),hint:"Organizations with a log"}),x.jsx(td,{label:"Events",value:co(r),hint:"Retained across all tenants",tone:"text-chart-1"}),t?x.jsx(td,{label:"Streams",value:a.length===0?"—":u,hint:a.length===0?"No streams configured":`${a.length} stream${a.length===1?"":"s"} · ${f} cursor${f===1?"":"s"} · ${co(d)} behind`,tone:a.length===0?void 0:_8[u]}):x.jsx(td,{label:"Streams",value:"—",hint:"Streaming is not enabled"})]}),x.jsxs("div",{className:"mt-8",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Recent events"}),x.jsx("button",{onClick:()=>n.go("/events"),className:"text-xs font-medium text-muted-foreground hover:text-foreground",children:"View all"})]}),o.length===0?x.jsx(Ji,{children:"No events recorded yet."}):x.jsx("div",{className:"mt-3 overflow-hidden rounded-xl border border-border bg-card",children:x.jsx("ul",{className:"divide-y divide-border",children:o.map(p=>x.jsx("li",{children:x.jsxs("button",{onClick:()=>n.go("/events",{event:p.id,eventTenant:p.tenant}),className:"group flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-secondary/30",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx("span",{className:"block truncate font-mono text-[13px] font-medium text-foreground",children:p.action}),x.jsxs("span",{className:"mt-0.5 block truncate text-xs text-muted-foreground",children:[CT(p.actor)," · ",x.jsx("span",{className:"font-mono",children:p.tenant})]})]}),x.jsx(bv,{outcome:p.outcome}),x.jsx("span",{className:"whitespace-nowrap text-xs tabular-nums text-muted-foreground",title:us(p.occurredAt),children:Hs(p.occurredAt)}),x.jsx(Nb,{className:"size-4 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5 group-hover:text-muted-foreground"})]})},`${p.tenant}/${p.id}`))})})]}),t&&a.length>0&&x.jsxs("div",{className:"mt-8",children:[x.jsxs("div",{className:"flex items-center justify-between",children:[x.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Stream health"}),x.jsx("button",{onClick:()=>n.go("/streams"),className:"text-xs font-medium text-muted-foreground hover:text-foreground",children:"Details"})]}),x.jsx("div",{className:"mt-3 overflow-hidden rounded-xl border border-border bg-card",children:x.jsx("ul",{className:"divide-y divide-border",children:a.map(p=>{const b=Oy([p]),v=p.tenants.reduce((w,A)=>w+A.lag,0),S=p.tenants.filter(w=>gv(w)==="failing").length;return x.jsxs("li",{className:"flex items-center gap-3 px-4 py-3",children:[x.jsx(Ny,{health:b}),x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx(en,{className:"block truncate font-medium",children:p.name}),x.jsxs("span",{className:"text-xs text-muted-foreground",children:[p.kind," · ",p.tenants.length," tenant",p.tenants.length===1?"":"s",S>0?` · ${S} failing`:""]})]}),x.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:[co(v)," behind"]})]},p.name)})})})]})]})}const OT=[{value:"all",label:"All time"},{value:"15m",label:"Last 15 minutes"},{value:"1h",label:"Last hour"},{value:"24h",label:"Last 24 hours"},{value:"7d",label:"Last 7 days"},{value:"30d",label:"Last 30 days"},{value:"custom",label:"Custom range"}],V8={"15m":15*6e4,"1h":36e5,"24h":864e5,"7d":7*864e5,"30d":30*864e5},q8={actions:[],actorId:"",actorType:"",targetType:"",targetId:"",outcome:"",range:"all",from:"",to:"",search:""},Fn={actions:"actions",actorId:"actor",actorType:"actorType",targetType:"targetType",targetId:"targetId",outcome:"outcome",range:"range",from:"from",to:"to",search:"q"},F8=Object.values(Fn),G8=n=>OT.some(e=>e.value===n);function K8(n){const e=[];for(const t of n)for(const i of t.split(",")){const r=i.trim();r&&!e.includes(r)&&e.push(r)}return e}function Y8(n){const e=a=>n.get(a)??"",t=e(Fn.outcome),i=n.get(Fn.range),r=e(Fn.from),o=e(Fn.to);return{actions:K8(n.getAll(Fn.actions)),actorId:e(Fn.actorId),actorType:e(Fn.actorType),targetType:e(Fn.targetType),targetId:e(Fn.targetId),outcome:t==="success"||t==="failure"?t:"",range:G8(i)?i:r||o?"custom":"all",from:r,to:o,search:e(Fn.search)}}function sk(n,e=new URLSearchParams){const t=new URLSearchParams(e);for(const r of F8)t.delete(r);n.actions.length>0&&t.set(Fn.actions,n.actions.join(","));const i=["actorId","actorType","targetType","targetId","outcome","search"];for(const r of i){const o=n[r].trim();o&&t.set(Fn[r],o)}return n.range!=="all"&&t.set(Fn.range,n.range),n.range==="custom"&&(n.from&&t.set(Fn.from,n.from),n.to&&t.set(Fn.to,n.to)),t}function NT(n){let e=n.actions.length>0?1:0;for(const t of["actorId","actorType","targetType","targetId","outcome","search"])n[t].trim()&&e++;return n.range!=="all"&&(n.range!=="custom"||n.from||n.to)&&e++,e}function Q8(n,e=Date.now()){const t={};return n.actions.length>0&&(t.actions=n.actions.join(",")),n.actorId.trim()&&(t.actorId=n.actorId.trim()),n.actorType.trim()&&(t.actorType=n.actorType.trim()),n.targetType.trim()&&(t.targetType=n.targetType.trim()),n.targetId.trim()&&(t.targetId=n.targetId.trim()),n.outcome&&(t.outcome=n.outcome),n.search.trim()&&(t.search=n.search.trim()),n.range==="custom"?(n.from&&(t.from=n.from),n.to&&(t.to=n.to)):n.range!=="all"&&(t.from=new Date(e-V8[n.range]).toISOString()),t}const nd=n=>String(n).padStart(2,"0");function rk(n){if(!n)return"";const e=new Date(n);return Number.isNaN(e.getTime())?"":`${e.getFullYear()}-${nd(e.getMonth()+1)}-${nd(e.getDate())}T${nd(e.getHours())}:${nd(e.getMinutes())}`}function lk(n){if(!n)return"";const e=new Date(n);return Number.isNaN(e.getTime())?"":e.toISOString()}function ok(n){return n.endsWith("*")}function W8(n){const e=new Set;for(const t of n){const i=t.split(".");for(let r=1;r<i.length;r++)e.add(`${i.slice(0,r).join(".")}.*`)}return[...e].sort()}function X8(n,e,t=[],i=12){const o=[...W8(n),...[...new Set(n)].sort()].filter(d=>!t.includes(d)),a=e.trim().toLowerCase();if(!a)return o.slice(0,i);const u=[],f=[];for(const d of o){const m=d.toLowerCase();m.startsWith(a)?u.push(d):m.includes(a)&&f.push(d)}return[...u,...f].slice(0,i)}function $8({value:n,onChange:e,names:t,className:i}){const[r,o]=E.useState(""),[a,u]=E.useState(!1),[f,d]=E.useState(0),m=E.useRef(null),p=E.useId(),b=X8(t,r,n),v=r.trim(),S=C=>{const T=C.trim();T&&!n.includes(T)&&e([...n,T]),o(""),d(0)},w=C=>e(n.filter(T=>T!==C)),A=C=>{if(C.key==="ArrowDown")C.preventDefault(),u(!0),d(T=>Math.min(T+1,Math.max(b.length-1,0)));else if(C.key==="ArrowUp")C.preventDefault(),d(T=>Math.max(T-1,0));else if(C.key==="Enter"){C.preventDefault();const T=a?b[f]:void 0;v&&(!T||!T.toLowerCase().startsWith(v.toLowerCase()))?S(v):T?S(T):v&&S(v)}else C.key==="Backspace"&&!r&&n.length>0?w(n[n.length-1]):C.key==="Escape"&&u(!1)};return x.jsxs("div",{className:bt("relative",i),children:[x.jsxs("div",{className:bt("flex min-h-9 w-full flex-wrap items-center gap-1 rounded-md border border-input bg-secondary/40 px-2 py-1 text-[13px] transition-colors","hover:bg-secondary/60 focus-within:border-ring focus-within:ring-2 focus-within:ring-ring"),onClick:()=>{var C;return(C=m.current)==null?void 0:C.focus()},children:[n.map(C=>x.jsxs("span",{className:bt("inline-flex items-center gap-1 rounded border px-1.5 py-0.5 font-mono text-[11px]",ok(C)?"border-accent/30 bg-accent/10 text-accent":"border-border bg-card text-foreground"),children:[C,x.jsx("button",{type:"button","aria-label":`Remove ${C}`,onClick:T=>{T.stopPropagation(),w(C)},className:"rounded-sm text-muted-foreground outline-none hover:text-foreground focus-visible:ring-2 focus-visible:ring-ring",children:x.jsx(gm,{className:"size-3"})})]},C)),x.jsx("input",{ref:m,value:r,onChange:C=>{o(C.target.value),u(!0),d(0)},onFocus:()=>u(!0),onBlur:()=>u(!1),onKeyDown:A,role:"combobox","aria-label":"Filter by action","aria-expanded":a&&b.length>0,"aria-controls":p,"aria-autocomplete":"list",placeholder:n.length===0?"Actions (e.g. invoice.*)":"",className:"h-7 min-w-[8rem] flex-1 bg-transparent font-mono text-[12px] text-foreground outline-none placeholder:font-sans placeholder:text-[13px] placeholder:text-muted-foreground"})]}),a&&b.length>0&&x.jsx("ul",{id:p,role:"listbox","aria-label":"Action suggestions",className:"absolute left-0 right-0 top-full z-30 mt-1 max-h-64 overflow-y-auto rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-xl",children:b.map((C,T)=>x.jsxs("li",{role:"option","aria-selected":T===f,onMouseDown:R=>{R.preventDefault(),S(C)},onMouseEnter:()=>d(T),className:bt("flex cursor-pointer items-center justify-between gap-2 rounded-md px-2 py-1.5 font-mono text-[12px]",T===f&&"bg-accent/15"),children:[x.jsx("span",{className:"truncate",children:C}),ok(C)&&x.jsx("span",{className:"font-sans text-[11px] text-muted-foreground",children:"family"})]},C))})]})}const DT=E.createContext(void 0);function jT(n){const e=E.useContext(DT);if(e===void 0&&!n)throw new Error(Qn(33));return e}const LT=E.createContext(void 0);function _o(n){const e=E.useContext(LT);if(e===void 0&&!n)throw new Error(Qn(36));return e}const Z8=E.createContext(void 0);function Mm(n=!0){const e=E.useContext(Z8);if(e===void 0&&!n)throw new Error(Qn(25));return e}const J8={type:"regular-item"};function e6(n){const{closeOnClick:e,disabled:t=!1,highlighted:i,id:r,store:o,nativeButton:a,itemMetadata:u,nodeId:f}=n,d=E.useRef(null),m=Mm(!0),p=m!==void 0,{events:b}=o.useState("floatingTreeRoot"),{getButtonProps:v,buttonRef:S}=bc({disabled:t,focusableWhenDisabled:!0,native:a}),w=E.useCallback(C=>hf({id:r,role:"menuitem",tabIndex:i?0:-1,onMouseMove(T){f&&b.emit("itemhover",{nodeId:f,target:T.currentTarget})},onMouseEnter(){u.type==="submenu-trigger"&&u.setActive()},onKeyUp(T){T.key===" "&&o.context.typingRef.current&&T.preventBaseUIHandler()},onClick(T){e&&b.emit("close",{domEvent:T,reason:Bu})},onMouseUp(T){if(m){const R=m.initialCursorPointRef.current;if(m.initialCursorPointRef.current=null,p&&R&&Math.abs(T.clientX-R.x)<=1&&Math.abs(T.clientY-R.y)<=1)return}d.current&&o.context.allowMouseUpTriggerRef.current&&(!p||T.button===2)&&u.type==="regular-item"&&d.current.click()}},C,v),[r,i,v,e,b,o,p,m,u,f]),A=Sr(d,S);return E.useMemo(()=>({getItemProps:w,itemRef:A}),[w,A])}const t6=E.forwardRef(function(e,t){const{render:i,className:r,id:o,label:a,nativeButton:u=!1,disabled:f=!1,closeOnClick:d=!0,...m}=e,p=dv({label:a}),b=jT(!0),v=bm(o),{store:S}=_o(),w=S.useState("isActive",p.index),A=S.useState("itemProps"),{getItemProps:C,itemRef:T}=e6({closeOnClick:d,disabled:f,highlighted:w,id:v,store:S,nativeButton:u,nodeId:b==null?void 0:b.nodeId,itemMetadata:J8}),R=E.useMemo(()=>({disabled:f,highlighted:w}),[f,w]);return dn("div",e,{state:R,props:[A,m,C],ref:[T,t,p.ref]})}),n6={...wc,...gf},i6=E.forwardRef(function(e,t){const{render:i,className:r,finalFocus:o,...a}=e,{store:u}=_o(),{side:f,align:d}=jT(),m=fv()!=null,p=u.useState("open"),b=u.useState("transitionStatus"),v=u.useState("popupProps"),S=u.useState("mounted"),w=u.useState("instantType"),A=u.useState("activeTriggerElement"),C=u.useState("parent"),T=u.useState("lastOpenChangeReason"),R=u.useState("rootId"),N=u.useState("floatingRootContext"),O=u.useState("floatingTreeRoot"),z=u.useState("closeDelay"),D=u.useState("activeTriggerElement");Sc({open:p,ref:u.context.popupRef,onComplete(){var V,Z;p&&((Z=(V=u.context).onOpenChangeComplete)==null||Z.call(V,!0))}}),E.useEffect(()=>{function V(Z){u.setOpen(!1,Je(Z.reason,Z.domEvent))}return O.events.on("close",V),()=>{O.events.off("close",V)}},[O.events,u]);const j=u.useState("hoverEnabled"),B=u.useState("disabled");UB(N,{enabled:j&&!B&&C.type!=="context-menu"&&C.type!=="menubar",closeDelay:z});const K=E.useMemo(()=>({transitionStatus:b,side:f,align:d,open:p,nested:C.type==="menu",instant:w}),[b,f,d,p,C.type,w]),F=dn("div",e,{state:K,ref:[t,u.context.popupRef],stateAttributesMapping:n6,props:[v,{onKeyDown(V){m&&hv.has(V.key)&&V.stopPropagation()}},cT(b),a,{"data-rootownerid":R}]});let Y=C.type===void 0||C.type==="context-menu";return(A||C.type==="menubar"&&T!==qb)&&(Y=!0),x.jsx(tv,{context:N,modal:!1,disabled:!S,returnFocus:o===void 0?Y:o,initialFocus:C.type!=="menu",restoreFocus:!0,externalTree:C.type!=="menubar"?O:void 0,previousFocusableElement:D,nextFocusableElement:C.type===void 0?u.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:C.type===void 0?u.context.beforeContentFocusGuardRef:void 0,children:F})}),BT=E.createContext(void 0);function s6(){const n=E.useContext(BT);if(n===void 0)throw new Error(Qn(32));return n}const r6=E.forwardRef(function(e,t){const{keepMounted:i=!1,...r}=e,{store:o}=_o();return o.useState("mounted")||i?x.jsx(BT.Provider,{value:i,children:x.jsx(Jb,{ref:t,...r})}):null}),l6=E.forwardRef(function(e,t){var me;const{anchor:i,positionMethod:r="absolute",className:o,render:a,side:u,align:f,sideOffset:d=0,alignOffset:m=0,collisionBoundary:p="clipping-ancestors",collisionPadding:b=5,arrowPadding:v=5,sticky:S=!1,disableAnchorTracking:w=!1,collisionAvoidance:A=GE,...C}=e,{store:T}=_o(),R=s6(),N=Mm(!0),O=T.useState("parent"),z=T.useState("floatingRootContext"),D=T.useState("floatingTreeRoot"),j=T.useState("mounted"),B=T.useState("open"),K=T.useState("modal"),F=T.useState("activeTriggerElement"),Y=T.useState("lastOpenChangeReason"),V=T.useState("floatingNodeId"),Z=T.useState("floatingParentNodeId");let q=i,P=d,W=m,U=f;O.type==="context-menu"&&(q=i??((me=O.context)==null?void 0:me.anchor),U=U??"start",!u&&U!=="center"&&(W=e.alignOffset??2,P=e.sideOffset??-5));let $=u,Q=U;O.type==="menu"?($=$??"inline-end",Q=Q??"start"):O.type==="menubar"&&($=$??"bottom",Q=Q??"start");const L=O.type==="context-menu",_=iT({anchor:q,floatingRootContext:z,positionMethod:N?"fixed":r,mounted:j,side:$,sideOffset:P,align:Q,alignOffset:W,arrowPadding:L?0:v,collisionBoundary:p,collisionPadding:b,sticky:S,nodeId:V,keepMounted:R,disableAnchorTracking:w,collisionAvoidance:A,shiftCrossAxis:L,externalTree:D}),J=E.useMemo(()=>{const Ne={};return B||(Ne.pointerEvents="none"),{role:"presentation",hidden:!j,style:{..._.positionerStyles,...Ne}}},[B,j,_.positionerStyles]);E.useEffect(()=>{function Ne(oe){oe.open?(oe.parentNodeId===V&&T.set("hoverEnabled",!1),oe.nodeId!==V&&oe.parentNodeId===T.select("floatingParentNodeId")&&T.setOpen(!1,Je(Ou))):oe.parentNodeId===V&&oe.reason!==Ou&&T.set("hoverEnabled",!0)}return D.events.on("menuopenchange",Ne),()=>{D.events.off("menuopenchange",Ne)}},[T,D.events,V]),E.useEffect(()=>{if(T.select("floatingParentNodeId")==null)return;function Ne(oe){if(oe.open||oe.nodeId!==T.select("floatingParentNodeId"))return;const xe=oe.reason??Ou;T.setOpen(!1,Je(xe))}return D.events.on("menuopenchange",Ne),()=>{D.events.off("menuopenchange",Ne)}},[D.events,T]),E.useEffect(()=>{function Ne(oe){!B||oe.nodeId!==T.select("floatingParentNodeId")||oe.target&&F&&F!==oe.target&&T.setOpen(!1,Je(Ou))}return D.events.on("itemhover",Ne),()=>{D.events.off("itemhover",Ne)}},[D.events,B,F,T]),E.useEffect(()=>{const Ne={open:B,nodeId:V,parentNodeId:Z,reason:T.select("lastOpenChangeReason")};D.events.emit("menuopenchange",Ne)},[D.events,B,T,V,Z]);const le=E.useMemo(()=>({open:B,side:_.side,align:_.align,anchorHidden:_.anchorHidden,nested:O.type==="menu"}),[B,_.side,_.align,_.anchorHidden,O.type]),ae=E.useMemo(()=>({side:_.side,align:_.align,arrowRef:_.arrowRef,arrowUncentered:_.arrowUncentered,arrowStyles:_.arrowStyles,nodeId:_.context.nodeId}),[_.side,_.align,_.arrowRef,_.arrowUncentered,_.arrowStyles,_.context.nodeId]),ee=dn("div",e,{state:le,stateAttributesMapping:wc,ref:[t,T.useStateSetter("positionerElement")],props:[J,C]}),se=j&&O.type!=="menu"&&(O.type!=="menubar"&&K&&Y!==Ni||O.type==="menubar"&&O.context.modal);let fe=null;return O.type==="menubar"?fe=O.context.contentElement:O.type===void 0&&(fe=F),x.jsxs(DT.Provider,{value:ae,children:[se&&x.jsx(uv,{ref:O.type==="context-menu"||O.type==="nested-context-menu"?O.context.internalBackdropRef:null,inert:lv(!B),cutout:fe}),x.jsx(NL,{id:V,children:x.jsx(av,{elementsRef:T.context.itemDomElements,labelsRef:T.context.itemLabels,children:ee})})]})}),o6=E.createContext(null);function zT(n){return E.useContext(o6)}const a6={...FA,disabled:Ae(n=>n.parent.type==="menubar"&&n.parent.context.disabled||n.disabled),modal:Ae(n=>(n.parent.type===void 0||n.parent.type==="context-menu")&&(n.modal??!0)),allowMouseEnter:Ae(n=>n.parent.type==="menu"?n.parent.store.select("allowMouseEnter"):n.allowMouseEnter),stickIfOpen:Ae(n=>n.stickIfOpen),parent:Ae(n=>n.parent),rootId:Ae(n=>n.parent.type==="menu"?n.parent.store.select("rootId"):n.parent.type!==void 0?n.parent.context.rootId:n.rootId),activeIndex:Ae(n=>n.activeIndex),isActive:Ae((n,e)=>n.activeIndex===e),hoverEnabled:Ae(n=>n.hoverEnabled),instantType:Ae(n=>n.instantType),lastOpenChangeReason:Ae(n=>n.openChangeReason),floatingTreeRoot:Ae(n=>n.parent.type==="menu"?n.parent.store.select("floatingTreeRoot"):n.floatingTreeRoot),floatingNodeId:Ae(n=>n.floatingNodeId),floatingParentNodeId:Ae(n=>n.floatingParentNodeId),itemProps:Ae(n=>n.itemProps),closeDelay:Ae(n=>n.closeDelay),keyboardEventRelay:Ae(n=>{if(n.keyboardEventRelay)return n.keyboardEventRelay;if(n.parent.type==="menu")return n.parent.store.select("keyboardEventRelay")})};class vv extends Gb{constructor(t){super({...c6(),...t},{positionerRef:E.createRef(),popupRef:E.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:E.createRef(),beforeContentFocusGuardRef:E.createRef(),onOpenChangeComplete:void 0,triggerElements:new Em},a6);Dt(this,"unsubscribeParentListener",null);this.observe(Ae(i=>i.allowMouseEnter),(i,r)=>{this.state.parent.type==="menu"&&i!==r&&this.state.parent.store.set("allowMouseEnter",i)}),this.unsubscribeParentListener=this.observe("parent",i=>{var r;if((r=this.unsubscribeParentListener)==null||r.call(this),i.type==="menu"){this.unsubscribeParentListener=i.store.subscribe(()=>{this.notifyAll()}),this.context.allowMouseUpTriggerRef=i.store.context.allowMouseUpTriggerRef;return}i.type!==void 0&&(this.context.allowMouseUpTriggerRef=i.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(t,i){this.state.floatingRootContext.context.events.emit("setOpen",{open:t,eventDetails:i})}static useStore(t,i){return pi(()=>t??new vv(i)).current}}function c6(){return{...qA(),disabled:!1,modal:!0,allowMouseEnter:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Zb,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:cn,keyboardEventRelay:void 0,closeDelay:0}}const u6=E.createContext(void 0);function f6(){return E.useContext(u6)}function h6(n){const{children:e,open:t,onOpenChange:i,onOpenChangeComplete:r,defaultOpen:o=!1,disabled:a=!1,modal:u,loopFocus:f=!0,orientation:d="vertical",actionsRef:m,closeParentOnEsc:p=!0,handle:b,triggerId:v,defaultTriggerId:S=null,highlightItemOnHover:w=!0}=n,A=Mm(!0),C=_o(!0),T=zT(),R=f6(),N=E.useMemo(()=>R&&C?{type:"menu",store:C.store}:T?{type:"menubar",context:T}:A&&!C?{type:"context-menu",context:A}:{type:void 0},[A,C,T,R]),O=vv.useStore(b==null?void 0:b.store,{parent:N}),z=O.useState("floatingTreeRoot"),D=RA(z),j=Cr();Pe(()=>{A&&!C?O.update({parent:{type:"context-menu",context:A},floatingNodeId:D,floatingParentNodeId:j}):C&&O.update({floatingNodeId:D,floatingParentNodeId:j})},[A,C,D,j,O]),O.useControlledProp("open",t,o),O.useControlledProp("activeTriggerId",v,S),O.useContextCallback("onOpenChangeComplete",r);const B=O.useState("open"),K=O.useState("activeTriggerElement"),F=O.useState("positionerElement"),Y=O.useState("hoverEnabled"),V=O.useState("modal"),Z=O.useState("disabled"),q=O.useState("lastOpenChangeReason"),P=O.useState("parent"),W=O.useState("activeIndex"),U=O.useState("payload"),$=O.useState("floatingParentNodeId"),Q=E.useRef(null),L=$!=null;let _;O.useSyncedValues({disabled:a,modal:P.type===void 0?u:void 0,rootId:Po()});const{openMethod:J,triggerProps:le,reset:ae}=hT(B);UA(O);const{forceUnmount:ee}=VA(B,O,()=>{O.update({allowMouseEnter:!1,stickIfOpen:!0}),ae()}),se=E.useRef(P.type!=="context-menu"),fe=An();E.useEffect(()=>{if(B||(Q.current=null),P.type==="context-menu"){if(!B){fe.clear(),se.current=!1;return}fe.start(500,()=>{se.current=!0})}},[fe,B,P.type]),ov(B&&V&&q!==Ni&&J!=="touch",F),Pe(()=>{!B&&!Y&&O.set("hoverEnabled",!0)},[B,Y,O]);const me=E.useRef(!0),Ne=An(),oe=Le((He,$e)=>{const it=$e.reason;if(B===He&&$e.trigger===K||($e.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},!He&&$e.trigger==null&&($e.trigger=K??void 0),i==null||i(He,$e),$e.isCanceled))return;const yi={open:He,nativeEvent:$e.event,reason:$e.reason,nested:L};_==null||_.emit("openchange",yi);const Nn=$e.event;if(He===!1&&(Nn==null?void 0:Nn.type)==="click"&&Nn.pointerType==="touch"&&!me.current)return;if(!He&&W!==null){const _e=O.context.itemDomElements.current[W];queueMicrotask(()=>{_e==null||_e.setAttribute("tabindex","-1")})}He&&it===Id?(me.current=!1,Ne.start(300,()=>{me.current=!0})):(me.current=!0,Ne.clear());const vt=(it===So||it===Bu)&&Nn.detail===0&&(Nn==null?void 0:Nn.isTrusted),Mt=!He&&(it===Fb||it==null);function Xt(){var Et;const _e={open:He,openChangeReason:it};Q.current=$e.event??null;const dt=((Et=$e.trigger)==null?void 0:Et.id)??null;(dt||He)&&(_e.activeTriggerId=dt,_e.activeTriggerElement=$e.trigger??null),O.update(_e)}it===Ni?Zi.flushSync(Xt):Xt(),P.type==="menubar"&&(it===Id||it===Ao||it===Ni||it===wd||it===Ou)?O.set("instantType","group"):vt||Mt?O.set("instantType",vt?"click":"dismiss"):O.set("instantType",void 0)}),xe=E.useCallback(He=>{const $e=Je(He);return $e.preventUnmountOnClose=()=>{O.set("preventUnmountingOnClose",!0)},$e},[O]),Se=E.useCallback(()=>{O.setOpen(!1,xe(XE))},[O,xe]);E.useImperativeHandle(m,()=>({unmount:ee,close:Se}),[ee,Se]);let Ge;P.type==="context-menu"&&(Ge=P.context),E.useImperativeHandle(Ge==null?void 0:Ge.positionerRef,()=>F,[F]),E.useImperativeHandle(Ge==null?void 0:Ge.actionsRef,()=>({setOpen:oe}),[oe]);const De=KA({popupStore:O,onOpenChange:oe});_=De.context.events,E.useEffect(()=>{const He=({open:$e,eventDetails:it})=>oe($e,it);return _.on("setOpen",He),()=>{_==null||_.off("setOpen",He)}},[_,oe]);const pe=iv(De,{enabled:!Z,bubbles:p&&P.type==="menu",outsidePress(){var He;return P.type!=="context-menu"||((He=Q.current)==null?void 0:He.type)==="contextmenu"?!0:se.current},externalTree:L?z:void 0}),ye=WA(De,{role:"menu"}),de=cv(),Ce=E.useCallback(He=>{O.select("activeIndex")!==He&&O.set("activeIndex",He)},[O]),Te=QA(De,{enabled:!Z,listRef:O.context.itemDomElements,activeIndex:W,nested:P.type!==void 0,loopFocus:f,orientation:d,parentOrientation:P.type==="menubar"?P.context.orientation:void 0,rtl:de==="rtl",disabledIndices:Sl,onNavigate:Ce,openOnArrowKeyDown:P.type!=="context-menu",externalTree:L?z:void 0,focusItemOnHover:w}),Re=E.useCallback(He=>{O.context.typingRef.current=He},[O]),Me=XA(De,{listRef:O.context.itemLabels,activeIndex:W,resetMs:$4,onMatch:He=>{B&&He!==W&&O.set("activeIndex",He)},onTypingChange:Re}),{getReferenceProps:be,getFloatingProps:we,getItemProps:ve,getTriggerProps:We}=Am([pe,ye,Te,Me]),nt=E.useMemo(()=>{const He=hf(be(),{onMouseEnter(){O.set("hoverEnabled",!0)},onMouseMove(){O.set("allowMouseEnter",!0)}},le);return delete He.role,He},[be,O,le]),Qe=E.useMemo(()=>{const He=We();if(!He)return He;const{role:$e,["aria-controls"]:it,...yi}=He;return yi},[We]),ht=df(),lt=E.useMemo(()=>we({onMouseEnter(){P.type==="menu"&&ht.request(()=>O.set("hoverEnabled",!1))},onMouseMove(){O.set("allowMouseEnter",!0)},onClick(){O.select("hoverEnabled")&&O.set("hoverEnabled",!1)},onKeyDown(He){const $e=O.select("keyboardEventRelay");$e&&!He.isPropagationStopped()&&$e(He)}}),[we,P.type,ht,O]),Ft=E.useMemo(()=>ve(),[ve]);O.useSyncedValues({floatingRootContext:De,activeTriggerProps:nt,inactiveTriggerProps:Qe,popupProps:lt,itemProps:Ft});const sn=E.useMemo(()=>({store:O,parent:N}),[O,N]),Pt=x.jsx(LT.Provider,{value:sn,children:typeof e=="function"?e({payload:U}):e});return P.type===void 0||P.type==="context-menu"?x.jsx(DL,{externalTree:z,children:Pt}):Pt}function PT(n){if(Qt(n)&&n.hasAttribute("data-rootownerid"))return n.getAttribute("data-rootownerid")??void 0;if(!Ps(n))return PT(Us(n))}function d6(n){const{enabled:e=!0,mouseDownAction:t,open:i}=n,r=E.useRef(!1);return E.useMemo(()=>e?{onMouseDown:o=>{(t==="open"&&!i||t==="close"&&i)&&(r.current=!0,cs(o.currentTarget).addEventListener("click",()=>{r.current=!1},{once:!0}))},onClick:o=>{r.current&&(r.current=!1,o.preventBaseUIHandler())}}:cn,[e,t,i])}const id=2,m6=E.forwardRef(function(e,t){const{render:i,className:r,disabled:o=!1,nativeButton:a=!0,id:u,openOnHover:f,delay:d=100,closeDelay:m=0,handle:p,payload:b,...v}=e,S=_o(!0),w=(p==null?void 0:p.store)??(S==null?void 0:S.store);if(!w)throw new Error(Qn(85));const A=bm(u),C=w.useState("isTriggerActive",A),T=w.useState("floatingRootContext"),R=w.useState("isOpenedByTrigger",A),N=E.useRef(null),O=g6(),z=_b(!0),D=Ol(),j=E.useMemo(()=>D??new Zb,[D]),B=RA(j),K=Cr(),{registerTrigger:F,isMountedByThisTrigger:Y}=LB(A,N,w,{payload:b,closeDelay:m,parent:O,floatingTreeRoot:j,floatingNodeId:B,floatingParentNodeId:K,keyboardEventRelay:z==null?void 0:z.relayKeyboardEvent}),V=w.useState("disabled"),Z=o||V||O.type==="menubar"&&O.context.disabled,{getButtonProps:q,buttonRef:P}=bc({disabled:Z,native:a});E.useEffect(()=>{!R&&O.type===void 0&&(w.context.allowMouseUpTriggerRef.current=!1)},[w,R,O.type]);const W=E.useRef(null),U=An(),$=Le(ye=>{if(!W.current)return;U.clear(),w.context.allowMouseUpTriggerRef.current=!1;const de=ye.target;if(ft(W.current,de)||ft(w.select("positionerElement"),de)||de===W.current||de!=null&&PT(de)===w.select("rootId"))return;const Ce=eT(W.current);ye.clientX>=Ce.left-id&&ye.clientX<=Ce.right+id&&ye.clientY>=Ce.top-id&&ye.clientY<=Ce.bottom+id||j.events.emit("close",{domEvent:ye,reason:WE})});E.useEffect(()=>{R&&w.select("lastOpenChangeReason")===Ni&&cs(W.current).addEventListener("mouseup",$,{once:!0})},[R,$,w]);const Q=O.type==="menubar"&&O.context.hasSubmenuOpen,_=FB(T,{enabled:(f??Q??!1)&&!Z&&O.type!=="context-menu"&&(O.type!=="menubar"||Q&&!Y),handleClose:XB({blockPointerEvents:O.type!=="menubar"}),mouseOnly:!0,move:!1,restMs:O.type===void 0?d:void 0,delay:{close:m},triggerElementRef:N,externalTree:j,isActiveTrigger:C}),J=p6(R,w.select("lastOpenChangeReason")),le=DA(T,{enabled:!Z&&O.type!=="context-menu",event:R&&O.type==="menubar"?"click":"mousedown",toggle:!0,ignoreMouse:!1,stickIfOpen:O.type===void 0?J:!1}),ae=PB(T,{enabled:!Z&&(O.type!=="menubar"&&R||Q)}),ee=d6({open:R,enabled:O.type==="menubar",mouseDownAction:"open"}),se=Am([le,ae]),fe=O.type==="menubar",me=E.useMemo(()=>({disabled:Z,open:R}),[Z,R]),Ne=w.useState("triggerProps",Y),oe=[W,t,P,F,N],xe=[se.getReferenceProps(),_??cn,Ne,{"aria-haspopup":"menu",id:A,onMouseDown:ye=>{if(w.select("open"))return;U.start(200,()=>{w.context.allowMouseUpTriggerRef.current=!0}),cs(ye.currentTarget).addEventListener("mouseup",$,{once:!0})}},fe?{role:"menuitem"}:{},ee,v,q],Se=E.useRef(null),Ge=Le(ye=>{Zi.flushSync(()=>{w.setOpen(!1,Je(Ao,ye.nativeEvent,ye.currentTarget))});const de=ML(Se.current);de==null||de.focus()}),De=Le(ye=>{var Ce;const de=w.select("positionerElement");if(de&&Ba(ye,de))(Ce=w.context.beforeContentFocusGuardRef.current)==null||Ce.focus();else{Zi.flushSync(()=>{w.setOpen(!1,Je(Ao,ye.nativeEvent,ye.currentTarget))});let Te=RL(N.current);for(;Te!==null&&ft(de,Te)||Te!=null&&Te.hasAttribute("aria-hidden");){const Re=Te;if(Te=$b(Te),Te===Re)break}Te==null||Te.focus()}}),pe=dn("button",e,{enabled:!fe,stateAttributesMapping:My,state:me,ref:oe,props:xe});return fe?x.jsx(mT,{tag:"button",render:i,className:r,state:me,refs:oe,props:xe,stateAttributesMapping:My}):R?x.jsxs(E.Fragment,{children:[x.jsx(ac,{ref:Se,onFocus:Ge},`${A}-pre-focus-guard`),x.jsx(E.Fragment,{children:pe},A),x.jsx(ac,{ref:w.context.triggerFocusTargetRef,onFocus:De},`${A}-post-focus-guard`)]}):x.jsx(E.Fragment,{children:pe},A)});function p6(n,e){const t=An(),[i,r]=E.useState(!1);return Pe(()=>{n&&e==="trigger-hover"?(r(!0),t.start(Z4,()=>{r(!1)})):n||(t.clear(),r(!1))},[n,e,t]),i}function g6(){const n=Mm(!0),e=_o(!0),t=zT();return E.useMemo(()=>t?{type:"menubar",context:t}:n&&!e?{type:"context-menu",context:n}:{type:void 0},[n,e,t])}const y6=[{value:"csv",label:"CSV",description:"Spreadsheet-friendly, one row per event"},{value:"json",label:"JSON",description:"A JSON array of events"},{value:"jsonl",label:"JSONL",description:"One event per line (streaming / SIEM)"},{value:"bundle",label:"Verifiable bundle",description:"Events + signed checkpoints, checkable offline"}];function b6(n,e){const t=URL.createObjectURL(n),i=document.createElement("a");i.href=t,i.download=e,i.rel="noopener",i.style.display="none",document.body.appendChild(i),i.click(),i.remove(),setTimeout(()=>URL.revokeObjectURL(t),3e4)}function v6({tenant:n,query:e,disabledReason:t}){const i=Ho(),[r,o]=E.useState(null),a=async f=>{o(f);try{const{blob:d,contentDisposition:m}=await Rj(n,f,e);b6(d,ik(n,f,m)),i.add("success","Export ready",`${ik(n,f,m)}`)}catch(d){i.add("error","Export failed",d instanceof Bo?d.body.error:"The export could not be downloaded.")}finally{o(null)}},u=!!t||r!==null;return x.jsxs(h6,{children:[x.jsxs(m6,{disabled:u,title:t,className:bt("inline-flex h-9 shrink-0 items-center gap-2 rounded-md border border-border bg-secondary/60 px-3.5 text-[13px] font-medium text-foreground outline-none transition-colors","hover:bg-secondary focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background","disabled:pointer-events-none disabled:opacity-50"),children:[r?x.jsx(TT,{className:"size-3.5"}):x.jsx(U3,{className:"size-3.5"}),"Export",x.jsx(L3,{className:"size-3.5 text-muted-foreground"})]}),x.jsx(r6,{container:Rm(),children:x.jsx(l6,{sideOffset:6,align:"end",className:"z-50 outline-none",children:x.jsx(i6,{className:bt("w-72 rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-xl outline-none","origin-[var(--transform-origin)] transition-[transform,opacity] data-[ending-style]:scale-95 data-[ending-style]:opacity-0 data-[starting-style]:scale-95 data-[starting-style]:opacity-0"),children:y6.map(f=>x.jsxs(t6,{onClick:()=>a(f.value),className:"flex cursor-pointer select-none flex-col rounded-md px-2 py-1.5 text-[13px] outline-none data-[highlighted]:bg-accent/15",children:[x.jsx("span",{className:"font-medium",children:f.label}),x.jsx("span",{className:"text-xs text-muted-foreground",children:f.description})]},f.value))})})})]})}const x6={ok:Bd,warn:dj,fail:uj},ak={ok:"text-success",warn:"text-warning",fail:"text-destructive"};function IT({report:n,checkpoints:e}){const t=O8(n,e),i=x6[t.tone];return x.jsxs("div",{className:"flex items-start gap-2.5","data-testid":"verify-summary",children:[x.jsx(i,{className:bt("mt-0.5 size-5 shrink-0",ak[t.tone]),"aria-hidden":!0}),x.jsxs("div",{className:"min-w-0",children:[x.jsx("p",{className:bt("m-0 text-[14px] font-semibold",ak[t.tone]),children:t.title}),x.jsx("p",{className:"m-0 mt-0.5 text-xs text-muted-foreground",children:t.detail})]})]})}function HT({report:n,checkpoints:e}){return x.jsxs("div",{className:"flex flex-col gap-4",children:[x.jsx(IT,{report:n,checkpoints:e}),x.jsxs("dl",{className:"m-0 grid grid-cols-1 gap-x-6 sm:grid-cols-2",children:[x.jsx(zt,{label:"Result",children:n.ok?x.jsx(Ds,{tone:"success",children:"ok"}):x.jsx(Ds,{tone:"destructive",children:"failed"})}),x.jsxs(zt,{label:"Events checked",children:[x.jsx("span",{className:"tabular-nums",children:n.checked}),n.fromSeq!==null&&n.toSeq!==null?x.jsxs("span",{className:"text-muted-foreground",children:[" ","(#",n.fromSeq,"–#",n.toSeq,")"]}):null]}),x.jsx(zt,{label:"Anchor",children:M8(n.anchor)}),x.jsx(zt,{label:"Signed through",children:n.signedThrough===null?x.jsx("span",{className:"text-muted-foreground",children:"not signed yet"}):x.jsxs("span",{className:"tabular-nums",children:["#",n.signedThrough]})}),x.jsxs(zt,{label:"Checkpoints",children:[x.jsx("span",{className:"tabular-nums",children:n.checkpointsVerified})," verified"]}),x.jsx(zt,{label:"Links checked",children:n.linksChecked?"yes":"no (subset)"}),x.jsx(zt,{label:"Head hash",copy:n.headHash??void 0,children:x.jsx(en,{children:Xd(n.headHash,16)})})]}),n.issues.length>0&&x.jsxs("div",{children:[x.jsx("h3",{className:"text-[12px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Issues"}),x.jsx("ul",{className:"mt-2 divide-y divide-border rounded-lg border border-destructive/30",children:n.issues.map((t,i)=>x.jsxs("li",{className:"flex flex-wrap items-baseline gap-2 px-3 py-2 text-[13px]",children:[x.jsx(Ds,{tone:"destructive",children:t.kind}),t.seq!==void 0&&x.jsxs(en,{className:"text-muted-foreground",children:["#",t.seq]}),t.section&&x.jsx(en,{className:"text-muted-foreground",children:t.section}),x.jsx("span",{className:"min-w-0 flex-1 text-foreground",children:t.message})]},i))})]}),n.erased.length>0&&x.jsxs("div",{children:[x.jsx("h3",{className:"text-[12px] font-semibold uppercase tracking-wider text-muted-foreground",children:"Erased sections"}),x.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:"Content removed after the fact; the digests are kept, so the chain still verifies."}),x.jsx("ul",{className:"mt-2 divide-y divide-border rounded-lg border border-border",children:n.erased.map(t=>x.jsxs("li",{className:"flex flex-wrap items-center gap-2 px-3 py-2",children:[x.jsxs(en,{className:"text-muted-foreground",children:["#",t.seq]}),x.jsx(en,{className:"min-w-0 flex-1 truncate",children:t.eventId}),t.sections.map(i=>x.jsx(Ds,{tone:"warning",children:i},i))]},t.eventId))})]})]})}function S6({tenant:n}){const[e,t]=E.useState(!1),i=Eo({mutationFn:()=>wE(n)}),r=Li({queryKey:["checkpoints",n],queryFn:()=>jb(n),enabled:i.isSuccess,staleTime:3e4});return x.jsxs("section",{"aria-label":"Log integrity",className:"flex flex-col gap-3 rounded-xl border border-border bg-card px-4 py-3",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[x.jsx("div",{className:"min-w-0 flex-1",children:i.data?x.jsx(IT,{report:i.data,checkpoints:r.data}):i.isError?x.jsx("p",{className:"m-0 text-[13px] text-destructive",children:i.error instanceof Bo?i.error.body.error:"Verification could not run."}):x.jsxs("div",{className:"flex items-start gap-2.5",children:[x.jsx(Bd,{className:"mt-0.5 size-5 shrink-0 text-muted-foreground","aria-hidden":!0}),x.jsxs("div",{children:[x.jsx("p",{className:"m-0 text-[13px] font-semibold text-foreground",children:"Tamper-evident log"}),x.jsx("p",{className:"m-0 mt-0.5 text-xs text-muted-foreground",children:"Every event is hash-chained to the one before it and periodically signed. Check that nothing was altered or removed."})]})]})}),i.data&&x.jsx(vn,{variant:"ghost",size:"sm",onClick:()=>t(o=>!o),children:e?"Hide details":"Details"}),x.jsx(vn,{variant:"secondary",size:"sm",loading:i.isPending,icon:x.jsx(Bd,{className:"size-3.5"}),onClick:()=>i.mutate(),disabled:!n,children:i.data?"Verify again":"Verify log integrity"})]}),e&&i.data&&x.jsx("div",{className:"border-t border-border pt-3",children:x.jsx(HT,{report:i.data,checkpoints:r.data})})]})}const Dy=["actor","targets","context","metadata","description"];let jy=[],_T=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?_T:jy).push(t=t+n[e])})();function w6(n){if(n<768)return!1;for(let e=0,t=jy.length;;){let i=e+t>>1;if(n<jy[i])t=i;else if(n>=_T[i])e=i+1;else return!0;if(e==t)return!1}}function ck(n){return n>=127462&&n<=127487}const uk=8205;function k6(n,e,t=!0,i=!0){return(t?UT:C6)(n,e,i)}function UT(n,e,t){if(e==n.length)return e;e&&VT(n.charCodeAt(e))&&qT(n.charCodeAt(e-1))&&e--;let i=C0(n,e);for(e+=fk(i);e<n.length;){let r=C0(n,e);if(i==uk||r==uk||t&&w6(r))e+=fk(r),i=r;else if(ck(r)){let o=0,a=e-2;for(;a>=0&&ck(C0(n,a));)o++,a-=2;if(o%2==0)break;e+=2}else break}return e}function C6(n,e,t){for(;e>1;){let i=UT(n,e-2,t);if(i<e)return i;e--}return 0}function C0(n,e){let t=n.charCodeAt(e);if(!qT(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return VT(i)?(t-55296<<10)+(i-56320)+65536:t}function VT(n){return n>=56320&&n<57344}function qT(n){return n>=55296&&n<56320}function fk(n){return n<65536?1:2}class wt{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=uc(this,e,t);let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),Os.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=uc(this,e,t);let i=[];return this.decompose(e,t,i,0),Os.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),r=new zu(this),o=new zu(e);for(let a=t,u=t;;){if(r.next(a),o.next(a),a=0,r.lineBreak!=o.lineBreak||r.done!=o.done||r.value!=o.value)return!1;if(u+=r.value.length,r.done||u>=i)return!0}}iter(e=1){return new zu(this,e)}iterRange(e,t=this.length){return new FT(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new GT(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?wt.empty:e.length<=32?new on(e):Os.from(on.split(e,[]))}}class on extends wt{constructor(e,t=E6(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let o=0;;o++){let a=this.text[o],u=r+a.length;if((t?i:u)>=e)return new A6(r,u,i,a);r=u+1,i++}}decompose(e,t,i,r){let o=e<=0&&t>=this.length?this:new on(hk(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let a=i.pop(),u=Td(o.text,a.text.slice(),0,o.length);if(u.length<=32)i.push(new on(u,a.length+o.length));else{let f=u.length>>1;i.push(new on(u.slice(0,f)),new on(u.slice(f)))}}else i.push(o)}replace(e,t,i){if(!(i instanceof on))return super.replace(e,t,i);[e,t]=uc(this,e,t);let r=Td(this.text,Td(i.text,hk(this.text,0,e)),t),o=this.length+i.length-(t-e);return r.length<=32?new on(r,o):Os.from(on.split(r,[]),o)}sliceString(e,t=this.length,i=`
|
|
235
|
+
`){[e,t]=uc(this,e,t);let r="";for(let o=0,a=0;o<=t&&a<this.text.length;a++){let u=this.text[a],f=o+u.length;o>e&&a&&(r+=i),e<f&&t>o&&(r+=u.slice(Math.max(0,e-o),t-o)),o=f+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let o of e)i.push(o),r+=o.length+1,i.length==32&&(t.push(new on(i,r)),i=[],r=-1);return r>-1&&t.push(new on(i,r)),t}}class Os extends wt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let o=0;;o++){let a=this.children[o],u=r+a.length,f=i+a.lines-1;if((t?f:u)>=e)return a.lineInner(e,t,i,r);r=u+1,i=f+1}}decompose(e,t,i,r){for(let o=0,a=0;a<=t&&o<this.children.length;o++){let u=this.children[o],f=a+u.length;if(e<=f&&t>=a){let d=r&((a<=e?1:0)|(f>=t?2:0));a>=e&&f<=t&&!d?i.push(u):u.decompose(e-a,t-a,i,d)}a=f+1}}replace(e,t,i){if([e,t]=uc(this,e,t),i.lines<this.lines)for(let r=0,o=0;r<this.children.length;r++){let a=this.children[r],u=o+a.length;if(e>=o&&t<=u){let f=a.replace(e-o,t-o,i),d=this.lines-a.lines+f.lines;if(f.lines<d>>4&&f.lines>d>>6){let m=this.children.slice();return m[r]=f,new Os(m,this.length-(t-e)+i.length)}return super.replace(o,u,f)}o=u+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|
236
|
+
`){[e,t]=uc(this,e,t);let r="";for(let o=0,a=0;o<this.children.length&&a<=t;o++){let u=this.children[o],f=a+u.length;a>e&&o&&(r+=i),e<f&&t>a&&(r+=u.sliceString(e-a,t-a,i)),a=f+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Os))return 0;let i=0,[r,o,a,u]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,o+=t){if(r==a||o==u)return i;let f=this.children[r],d=e.children[o];if(f!=d)return i+f.scanIdentical(d,t);i+=f.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let v of e)i+=v.lines;if(i<32){let v=[];for(let S of e)S.flatten(v);return new on(v,t)}let r=Math.max(32,i>>5),o=r<<1,a=r>>1,u=[],f=0,d=-1,m=[];function p(v){let S;if(v.lines>o&&v instanceof Os)for(let w of v.children)p(w);else v.lines>a&&(f>a||!f)?(b(),u.push(v)):v instanceof on&&f&&(S=m[m.length-1])instanceof on&&v.lines+S.lines<=32?(f+=v.lines,d+=v.length+1,m[m.length-1]=new on(S.text.concat(v.text),S.length+1+v.length)):(f+v.lines>r&&b(),f+=v.lines,d+=v.length+1,m.push(v))}function b(){f!=0&&(u.push(m.length==1?m[0]:Os.from(m,d)),d=-1,f=m.length=0)}for(let v of e)p(v);return b(),u.length==1?u[0]:new Os(u,t)}}wt.empty=new on([""],0);function E6(n){let e=-1;for(let t of n)e+=t.length+1;return e}function Td(n,e,t=0,i=1e9){for(let r=0,o=0,a=!0;o<n.length&&r<=i;o++){let u=n[o],f=r+u.length;f>=t&&(f>i&&(u=u.slice(0,i-r)),r<t&&(u=u.slice(t-r)),a?(e[e.length-1]+=u,a=!1):e.push(u)),r=f+1}return e}function hk(n,e,t){return Td(n,[""],e,t)}class zu{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof on?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],o=this.offsets[i],a=o>>1,u=r instanceof on?r.text.length:r.children.length;if(a==(t>0?u:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((o&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
237
|
+
`,this;e--}else if(r instanceof on){let f=r.text[a+(t<0?-1:0)];if(this.offsets[i]+=t,f.length>Math.max(0,e))return this.value=e==0?f:t>0?f.slice(e):f.slice(0,f.length-e),this;e-=f.length}else{let f=r.children[a+(t<0?-1:0)];e>f.length?(e-=f.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(f),this.offsets.push(t>0?1:(f instanceof on?f.text.length:f.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class FT{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new zu(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class GT{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(wt.prototype[Symbol.iterator]=function(){return this.iter()},zu.prototype[Symbol.iterator]=FT.prototype[Symbol.iterator]=GT.prototype[Symbol.iterator]=function(){return this});class A6{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}}function uc(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Yn(n,e,t=!0,i=!0){return k6(n,e,t,i)}function T6(n){return n>=56320&&n<57344}function R6(n){return n>=55296&&n<56320}function M6(n,e){let t=n.charCodeAt(e);if(!R6(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return T6(i)?(t-55296<<10)+(i-56320)+65536:t}function O6(n){return n<65536?1:2}const Ly=/\r\n?|\n/;var Di=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(Di||(Di={}));class _s{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,r=0;t<this.sections.length;){let o=this.sections[t++],a=this.sections[t++];a<0?(e(i,r,o),r+=o):r+=a,i+=o}}iterChangedRanges(e,t=!1){By(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];r<0?e.push(i,r):e.push(r,i)}return new _s(e)}composeDesc(e){return this.empty?e:e.empty?this:KT(this,e)}mapDesc(e,t=!1){return e.empty?this:zy(this,e,t)}mapPos(e,t=-1,i=Di.Simple){let r=0,o=0;for(let a=0;a<this.sections.length;){let u=this.sections[a++],f=this.sections[a++],d=r+u;if(f<0){if(d>e)return o+(e-r);o+=u}else{if(i!=Di.Simple&&d>=e&&(i==Di.TrackDel&&r<e&&d>e||i==Di.TrackBefore&&r<e||i==Di.TrackAfter&&d>e))return null;if(d>e||d==e&&t<0&&!u)return e==r||t<0?o:o+f;o+=f}r=d}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return o}touchesRange(e,t=e){for(let i=0,r=0;i<this.sections.length&&r<=t;){let o=this.sections[i++],a=this.sections[i++],u=r+o;if(a>=0&&r<=t&&u>=e)return r<e&&u>t?"cover":!0;r=u}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],r=this.sections[t++];e+=(e?" ":"")+i+(r>=0?":"+r:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new _s(e)}static create(e){return new _s(e)}}class Cn extends _s{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return By(this,(t,i,r,o,a)=>e=e.replace(r,r+(i-t),a),!1),e}mapDesc(e,t=!1){return zy(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,o=0;r<t.length;r+=2){let a=t[r],u=t[r+1];if(u>=0){t[r]=u,t[r+1]=a;let f=r>>1;for(;i.length<f;)i.push(wt.empty);i.push(a?e.slice(o,o+a):wt.empty)}o+=a}return new Cn(t,i)}compose(e){return this.empty?e:e.empty?this:KT(this,e,!0)}map(e,t=!1){return e.empty?this:zy(this,e,t,!0)}iterChanges(e,t=!1){By(this,e,t)}get desc(){return _s.create(this.sections)}filter(e){let t=[],i=[],r=[],o=new Qu(this);e:for(let a=0,u=0;;){let f=a==e.length?1e9:e[a++];for(;u<f||u==f&&o.len==0;){if(o.done)break e;let m=Math.min(o.len,f-u);Kn(r,m,-1);let p=o.ins==-1?-1:o.off==0?o.ins:0;Kn(t,m,p),p>0&&hl(i,t,o.text),o.forward(m),u+=m}let d=e[a++];for(;u<d;){if(o.done)break e;let m=Math.min(o.len,d-u);Kn(t,m,-1),Kn(r,m,o.ins==-1?-1:o.off==0?o.ins:0),o.forward(m),u+=m}}return{changes:new Cn(t,i),filtered:_s.create(r)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t],r=this.sections[t+1];r<0?e.push(i):r==0?e.push([i]):e.push([i].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,i){let r=[],o=[],a=0,u=null;function f(m=!1){if(!m&&!r.length)return;a<t&&Kn(r,t-a,-1);let p=new Cn(r,o);u=u?u.compose(p.map(u)):p,r=[],o=[],a=0}function d(m){if(Array.isArray(m))for(let p of m)d(p);else if(m instanceof Cn){if(m.length!=t)throw new RangeError(`Mismatched change set length (got ${m.length}, expected ${t})`);f(),u=u?u.compose(m.map(u)):m}else{let{from:p,to:b=p,insert:v}=m;if(p>b||p<0||b>t)throw new RangeError(`Invalid change range ${p} to ${b} (in doc of length ${t})`);let S=v?typeof v=="string"?wt.of(v.split(i||Ly)):v:wt.empty,w=S.length;if(p==b&&w==0)return;p<a&&f(),p>a&&Kn(r,p-a,-1),Kn(r,b-p,w),hl(o,r,S),a=b}}return d(e),f(!u),u}static empty(e){return new Cn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;r<e.length;r++){let o=e[r];if(typeof o=="number")t.push(o,-1);else{if(!Array.isArray(o)||typeof o[0]!="number"||o.some((a,u)=>u&&typeof a!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(o.length==1)t.push(o[0],0);else{for(;i.length<r;)i.push(wt.empty);i[r]=wt.of(o.slice(1)),t.push(o[0],i[r].length)}}}return new Cn(t,i)}static createSet(e,t){return new Cn(e,t)}}function Kn(n,e,t,i=!1){if(e==0&&t<=0)return;let r=n.length-2;r>=0&&t<=0&&t==n[r+1]?n[r]+=e:r>=0&&e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function hl(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<i;)n.push(wt.empty);n.push(t)}}function By(n,e,t){let i=n.inserted;for(let r=0,o=0,a=0;a<n.sections.length;){let u=n.sections[a++],f=n.sections[a++];if(f<0)r+=u,o+=u;else{let d=r,m=o,p=wt.empty;for(;d+=u,m+=f,f&&i&&(p=p.append(i[a-2>>1])),!(t||a==n.sections.length||n.sections[a+1]<0);)u=n.sections[a++],f=n.sections[a++];e(r,d,o,m,p),r=d,o=m}}}function zy(n,e,t,i=!1){let r=[],o=i?[]:null,a=new Qu(n),u=new Qu(e);for(let f=-1;;){if(a.done&&u.len||u.done&&a.len)throw new Error("Mismatched change set lengths");if(a.ins==-1&&u.ins==-1){let d=Math.min(a.len,u.len);Kn(r,d,-1),a.forward(d),u.forward(d)}else if(u.ins>=0&&(a.ins<0||f==a.i||a.off==0&&(u.len<a.len||u.len==a.len&&!t))){let d=u.len;for(Kn(r,u.ins,-1);d;){let m=Math.min(a.len,d);a.ins>=0&&f<a.i&&a.len<=m&&(Kn(r,0,a.ins),o&&hl(o,r,a.text),f=a.i),a.forward(m),d-=m}u.next()}else if(a.ins>=0){let d=0,m=a.len;for(;m;)if(u.ins==-1){let p=Math.min(m,u.len);d+=p,m-=p,u.forward(p)}else if(u.ins==0&&u.len<m)m-=u.len,u.next();else break;Kn(r,d,f<a.i?a.ins:0),o&&f<a.i&&hl(o,r,a.text),f=a.i,a.forward(a.len-m)}else{if(a.done&&u.done)return o?Cn.createSet(r,o):_s.create(r);throw new Error("Mismatched change set lengths")}}}function KT(n,e,t=!1){let i=[],r=t?[]:null,o=new Qu(n),a=new Qu(e);for(let u=!1;;){if(o.done&&a.done)return r?Cn.createSet(i,r):_s.create(i);if(o.ins==0)Kn(i,o.len,0,u),o.next();else if(a.len==0&&!a.done)Kn(i,0,a.ins,u),r&&hl(r,i,a.text),a.next();else{if(o.done||a.done)throw new Error("Mismatched change set lengths");{let f=Math.min(o.len2,a.len),d=i.length;if(o.ins==-1){let m=a.ins==-1?-1:a.off?0:a.ins;Kn(i,f,m,u),r&&m&&hl(r,i,a.text)}else a.ins==-1?(Kn(i,o.off?0:o.len,f,u),r&&hl(r,i,o.textBit(f))):(Kn(i,o.off?0:o.len,a.off?0:a.ins,u),r&&!a.off&&hl(r,i,a.text));u=(o.ins>f||a.ins>=0&&a.len>f)&&(u||i.length>d),o.forward2(f),a.forward(f)}}}}class Qu{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?wt.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?wt.empty:t[i].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class el{constructor(e,t,i,r){this.from=e,this.to=t,this.flags=i,this.goalColumn=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get undirectional(){return(this.flags&64)>0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}map(e,t=-1){let i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new el(i,r,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return ge.range(e,t,void 0,void 0,i);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ge.range(this.anchor,r,void 0,void 0,i)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return ge.range(e.anchor,e.head)}static create(e,t,i,r){return new el(e,t,i,r)}}class ge{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ge.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(e.ranges[i],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new ge([this.main],0)}addRange(e,t=!0){return ge.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let i=this.ranges.slice();return i[t]=e,ge.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new ge(e.ranges.map(t=>el.fromJSON(t)),e.main)}static single(e,t=e){return new ge([ge.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,r=0;r<e.length;r++){let o=e[r];if(o.empty?o.from<=i:o.from<i)return ge.normalized(e.slice(),t);i=o.to}return new ge(e,t)}static cursor(e,t=0,i,r){return el.create(e,e,(t==0?0:t<0?8:16)|(i==null?7:Math.min(6,i)),r)}static range(e,t,i,r,o){let a=r==null?7:Math.min(6,r);return!o&&e!=t&&(o=t<e?1:-1),o&&(a|=o<0?8:16),t<e?el.create(t,e,a|32,i):el.create(e,t,a,i)}static undirectionalRange(e,t){return el.create(e,t,64,void 0)}static normalized(e,t=0){let i=e[t];e.sort((r,o)=>r.from-o.from),t=e.indexOf(i);for(let r=1;r<e.length;r++){let o=e[r],a=e[r-1];if(o.empty?o.from<=a.to:o.from<a.to){let u=a.from,f=Math.max(o.to,a.to);r<=t&&t--,e.splice(--r,2,o.anchor>o.head?ge.range(f,u):ge.range(u,f))}}return new ge(e,t)}}function YT(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let xv=0;class Ve{constructor(e,t,i,r,o){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=xv++,this.default=e([]),this.extensions=typeof o=="function"?o(this):o}get reader(){return this}static define(e={}){return new Ve(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:Sv),!!e.static,e.enables)}of(e){return new Rd([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Rd(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new Rd(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function Sv(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class Rd{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=xv++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,o=this.id,a=e[o]>>1,u=this.type==2,f=!1,d=!1,m=[];for(let p of this.dependencies)p=="doc"?f=!0:p=="selection"?d=!0:(((t=e[p.id])!==null&&t!==void 0?t:1)&1)==0&&m.push(e[p.id]);return{create(p){return p.values[a]=i(p),1},update(p,b){if(f&&b.docChanged||d&&(b.docChanged||b.selection)||Py(p,m)){let v=i(p);if(u?!dk(v,p.values[a],r):!r(v,p.values[a]))return p.values[a]=v,1}return 0},reconfigure:(p,b)=>{let v,S=b.config.address[o];if(S!=null){let w=Zd(b,S);if(this.dependencies.every(A=>A instanceof Ve?b.facet(A)===p.facet(A):A instanceof jl?b.field(A,!1)==p.field(A,!1):!0)||(u?dk(v=i(p),w,r):r(v=i(p),w)))return p.values[a]=w,0}else v=i(p);return p.values[a]=v,1}}}}function dk(n,e,t){if(n.length!=e.length)return!1;for(let i=0;i<n.length;i++)if(!t(n[i],e[i]))return!1;return!0}function Py(n,e){let t=!1;for(let i of e)Pu(n,i)&1&&(t=!0);return t}function N6(n,e,t){let i=t.map(f=>n[f.id]),r=t.map(f=>f.type),o=i.filter(f=>!(f&1)),a=n[e.id]>>1;function u(f){let d=[];for(let m=0;m<i.length;m++){let p=Zd(f,i[m]);if(r[m]==2)for(let b of p)d.push(b);else d.push(p)}return e.combine(d)}return{create(f){for(let d of i)Pu(f,d);return f.values[a]=u(f),1},update(f,d){if(!Py(f,o))return 0;let m=u(f);return e.compare(m,f.values[a])?0:(f.values[a]=m,1)},reconfigure(f,d){let m=Py(f,i),p=d.config.facets[e.id],b=d.facet(e);if(p&&!m&&Sv(t,p))return f.values[a]=b,0;let v=u(f);return e.compare(v,b)?(f.values[a]=b,0):(f.values[a]=v,1)}}}const sd=Ve.define({static:!0});class jl{constructor(e,t,i,r,o){this.id=e,this.createF=t,this.updateF=i,this.compareF=r,this.spec=o,this.provides=void 0}static define(e){let t=new jl(xv++,e.create,e.update,e.compare||((i,r)=>i===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(sd).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let o=i.values[t],a=this.updateF(o,r);return this.compareF(o,a)?0:(i.values[t]=a,1)},reconfigure:(i,r)=>{let o=i.facet(sd),a=r.facet(sd),u;return(u=o.find(f=>f.field==this))&&u!=a.find(f=>f.field==this)?(i.values[t]=u.create(i),1):r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,sd.of({field:this,create:e})]}get extension(){return this}}const ro={lowest:4,low:3,default:2,high:1,highest:0};function Su(n){return e=>new QT(e,n)}const wv={highest:Su(ro.highest),high:Su(ro.high),default:Su(ro.default),low:Su(ro.low),lowest:Su(ro.lowest)};class QT{constructor(e,t){this.inner=e,this.prec=t}}class xf{of(e){return new Iy(this,e)}reconfigure(e){return xf.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Iy{constructor(e,t){this.compartment=e,this.inner=t}}class $d{constructor(e,t,i,r,o,a){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=o,this.facets=a,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,i){let r=[],o=Object.create(null),a=new Map;for(let b of D6(e,t,a))b instanceof jl?r.push(b):(o[b.facet.id]||(o[b.facet.id]=[])).push(b);let u=Object.create(null),f=[],d=[];for(let b of r)u[b.id]=d.length<<1,d.push(v=>b.slot(v));let m=i==null?void 0:i.config.facets;for(let b in o){let v=o[b],S=v[0].facet,w=m&&m[b]||[];if(v.every(A=>A.type==0))if(u[S.id]=f.length<<1|1,Sv(w,v))f.push(i.facet(S));else{let A=S.combine(v.map(C=>C.value));f.push(i&&S.compare(A,i.facet(S))?i.facet(S):A)}else{for(let A of v)A.type==0?(u[A.id]=f.length<<1|1,f.push(A.value)):(u[A.id]=d.length<<1,d.push(C=>A.dynamicSlot(C)));u[S.id]=d.length<<1,d.push(A=>N6(A,S,v))}}let p=d.map(b=>b(u));return new $d(e,a,p,u,f,o)}}function D6(n,e,t){let i=[[],[],[],[],[]],r=new Map;function o(a,u){let f=r.get(a);if(f!=null){if(f<=u)return;let d=i[f].indexOf(a);d>-1&&i[f].splice(d,1),a instanceof Iy&&t.delete(a.compartment)}if(r.set(a,u),Array.isArray(a))for(let d of a)o(d,u);else if(a instanceof Iy){if(t.has(a.compartment))throw new RangeError("Duplicate use of compartment in extensions");let d=e.get(a.compartment)||a.inner;t.set(a.compartment,d),o(d,u)}else if(a instanceof QT)o(a.inner,a.prec);else if(a instanceof jl)i[u].push(a),a.provides&&o(a.provides,u);else if(a instanceof Rd)i[u].push(a),a.facet.extensions&&o(a.facet.extensions,ro.default);else{let d=a.extension;if(!d)throw new Error(`Unrecognized extension value in extension set (${a}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);o(d,u)}}return o(n,ro.default),i.reduce((a,u)=>a.concat(u))}function Pu(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function Zd(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const WT=Ve.define(),Hy=Ve.define({combine:n=>n.some(e=>e),static:!0}),XT=Ve.define({combine:n=>n.length?n[0]:void 0,static:!0}),$T=Ve.define(),ZT=Ve.define(),JT=Ve.define(),eR=Ve.define({combine:n=>n.length?n[0]:!1});class Ll{constructor(e,t){this.type=e,this.value=t}static define(){return new j6}}class j6{of(e){return new Ll(this,e)}}class L6{constructor(e){this.map=e}of(e){return new un(this,e)}}class un{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new un(this.type,t)}is(e){return this.type==e}static define(e={}){return new L6(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let o=r.map(t);o&&i.push(o)}return i}}un.reconfigure=un.define();un.appendConfig=un.define();class Tn{constructor(e,t,i,r,o,a){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=o,this.scrollIntoView=a,this._doc=null,this._state=null,i&&YT(i,t.newLength),o.some(u=>u.type==Tn.time)||(this.annotations=o.concat(Tn.time.of(Date.now())))}static create(e,t,i,r,o,a){return new Tn(e,t,i,r,o,a)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(Tn.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Tn.time=Ll.define();Tn.userEvent=Ll.define();Tn.addToHistory=Ll.define();Tn.remote=Ll.define();function B6(n,e){let t=[];for(let i=0,r=0;;){let o,a;if(i<n.length&&(r==e.length||e[r]>=n[i]))o=n[i++],a=n[i++];else if(r<e.length)o=e[r++],a=e[r++];else return t;!t.length||t[t.length-1]<o?t.push(o,a):t[t.length-1]<a&&(t[t.length-1]=a)}}function tR(n,e,t){var i;let r,o,a;return t?(r=e.changes,o=Cn.empty(e.changes.length),a=n.changes.compose(e.changes)):(r=e.changes.map(n.changes),o=n.changes.mapDesc(e.changes,!0),a=n.changes.compose(r)),{changes:a,selection:e.selection?e.selection.map(o):(i=n.selection)===null||i===void 0?void 0:i.map(r),effects:un.mapEffects(n.effects,r).concat(un.mapEffects(e.effects,o)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function _y(n,e,t){let i=e.selection,r=_a(e.annotations);return e.userEvent&&(r=r.concat(Tn.userEvent.of(e.userEvent))),{changes:e.changes instanceof Cn?e.changes:Cn.of(e.changes||[],t,n.facet(XT)),selection:i&&(i instanceof ge?i:ge.single(i.anchor,i.head)),effects:_a(e.effects),annotations:r,scrollIntoView:!!e.scrollIntoView}}function nR(n,e,t){let i=_y(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let o=1;o<e.length;o++){e[o].filter===!1&&(t=!1);let a=!!e[o].sequential;i=tR(i,_y(n,e[o],a?i.changes.newLength:n.doc.length),a)}let r=Tn.create(n,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return P6(t?z6(r):r)}function z6(n){let e=n.startState,t=!0;for(let r of e.facet($T)){let o=r(n);if(o===!1){t=!1;break}Array.isArray(o)&&(t=t===!0?o:B6(t,o))}if(t!==!0){let r,o;if(t===!1)o=n.changes.invertedDesc,r=Cn.empty(e.doc.length);else{let a=n.changes.filter(t);r=a.changes,o=a.filtered.mapDesc(a.changes).invertedDesc}n=Tn.create(e,r,n.selection&&n.selection.map(o),un.mapEffects(n.effects,o),n.annotations,n.scrollIntoView)}let i=e.facet(ZT);for(let r=i.length-1;r>=0;r--){let o=i[r](n);o instanceof Tn?n=o:Array.isArray(o)&&o.length==1&&o[0]instanceof Tn?n=o[0]:n=nR(e,_a(o),!1)}return n}function P6(n){let e=n.startState,t=e.facet(JT),i=n;for(let r=t.length-1;r>=0;r--){let o=t[r](n);o&&Object.keys(o).length&&(i=tR(i,_y(e,o,n.changes.newLength),!0))}return i==n?n:Tn.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const I6=[];function _a(n){return n==null?I6:Array.isArray(n)?n:[n]}var br=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(br||(br={}));const H6=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Uy;try{Uy=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function _6(n){if(Uy)return Uy.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||H6.test(t)))return!0}return!1}function U6(n){return e=>{if(!/\S/.test(e))return br.Space;if(_6(e))return br.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return br.Word;return br.Other}}class xt{constructor(e,t,i,r,o,a){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=o,a&&(a._state=this);for(let u=0;u<this.config.dynamicSlots.length;u++)Pu(this,u<<1);this.computeSlot=null}field(e,t=!0){let i=this.config.address[e.id];if(i==null){if(t)throw new RangeError("Field is not present in this state");return}return Pu(this,i),Zd(this,i)}update(...e){return nR(this,e,!0)}applyTransaction(e){let t=this.config,{base:i,compartments:r}=t;for(let u of e.effects)u.is(xf.reconfigure)?(t&&(r=new Map,t.compartments.forEach((f,d)=>r.set(d,f)),t=null),r.set(u.value.compartment,u.value.extension)):u.is(un.reconfigure)?(t=null,i=u.value):u.is(un.appendConfig)&&(t=null,i=_a(i).concat(u.value));let o;t?o=e.startState.values.slice():(t=$d.resolve(i,r,this),o=new xt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(f,d)=>d.reconfigure(f,this),null).values);let a=e.startState.facet(Hy)?e.newSelection:e.newSelection.asSingle();new xt(t,e.newDoc,a,o,(u,f)=>f.update(u,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:ge.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),o=[i.range],a=_a(i.effects);for(let u=1;u<t.ranges.length;u++){let f=e(t.ranges[u]),d=this.changes(f.changes),m=d.map(r);for(let b=0;b<u;b++)o[b]=o[b].map(m);let p=r.mapDesc(d,!0);o.push(f.range.map(p)),r=r.compose(m),a=un.mapEffects(a,m).concat(un.mapEffects(_a(f.effects),p))}return{changes:r,selection:ge.create(o,t.mainIndex),effects:a}}changes(e=[]){return e instanceof Cn?e:Cn.of(e,this.doc.length,this.facet(xt.lineSeparator))}toText(e){return wt.of(e.split(this.facet(xt.lineSeparator)||Ly))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(Pu(this,t),Zd(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let i in e){let r=e[i];r instanceof jl&&this.config.address[r.id]!=null&&(t[i]=r.spec.toJSON(this.field(e[i]),this))}return t}static fromJSON(e,t={},i){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let r=[];if(i){for(let o in i)if(Object.prototype.hasOwnProperty.call(e,o)){let a=i[o],u=e[o];r.push(a.init(f=>a.spec.fromJSON(u,f)))}}return xt.create({doc:e.doc,selection:ge.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=$d.resolve(e.extensions||[],new Map),i=e.doc instanceof wt?e.doc:wt.of((e.doc||"").split(t.staticFacet(xt.lineSeparator)||Ly)),r=e.selection?e.selection instanceof ge?e.selection:ge.single(e.selection.anchor,e.selection.head):ge.single(0);return YT(r,i.length),t.staticFacet(Hy)||(r=r.asSingle()),new xt(t,i,r,t.dynamicSlots.map(()=>null),(o,a)=>a.create(o),null)}get tabSize(){return this.facet(xt.tabSize)}get lineBreak(){return this.facet(xt.lineSeparator)||`
|
|
238
|
+
`}get readOnly(){return this.facet(eR)}phrase(e,...t){for(let i of this.facet(xt.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let o=+(r||1);return!o||o>t.length?i:t[o-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let o of this.facet(WT))for(let a of o(this,t,i))Object.prototype.hasOwnProperty.call(a,e)&&r.push(a[e]);return r}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return U6(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),o=this.charCategorizer(e),a=e-i,u=e-i;for(;a>0;){let f=Yn(t,a,!1);if(o(t.slice(f,a))!=br.Word)break;a=f}for(;u<r;){let f=Yn(t,u);if(o(t.slice(u,f))!=br.Word)break;u=f}return a==u?null:ge.range(a+i,u+i)}}xt.allowMultipleSelections=Hy;xt.tabSize=Ve.define({combine:n=>n.length?n[0]:4});xt.lineSeparator=XT;xt.readOnly=eR;xt.phrases=Ve.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});xt.languageData=WT;xt.changeFilter=$T;xt.transactionFilter=ZT;xt.transactionExtender=JT;xf.reconfigure=un.define();function kv(n,e,t={}){let i={};for(let r of n)for(let o of Object.keys(r)){let a=r[o],u=i[o];if(u===void 0)i[o]=a;else if(!(u===a||a===void 0))if(Object.hasOwnProperty.call(t,o))i[o]=t[o](u,a);else throw new Error("Config merge conflict for field "+o)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Mo{eq(e){return this==e}range(e,t=e){return Vy.create(e,t,this)}}Mo.prototype.startSide=Mo.prototype.endSide=0;Mo.prototype.point=!1;Mo.prototype.mapMode=Di.TrackDel;function Cv(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let Vy=class iR{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new iR(e,t,i)}};function qy(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Ev{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let o=i?this.to:this.from;for(let a=r,u=o.length;;){if(a==u)return a;let f=a+u>>1,d=o[f]-e||(i?this.value[f].endSide:this.value[f].startSide)-t;if(f==a)return d>=0?a:u;d>=0?u=f:a=f+1}}between(e,t,i,r){for(let o=this.findIndex(t,-1e9,!0),a=this.findIndex(i,1e9,!1,o);o<a;o++)if(r(this.from[o]+e,this.to[o]+e,this.value[o])===!1)return!1}map(e,t){let i=[],r=[],o=[],a=-1,u=-1;for(let f=0;f<this.value.length;f++){let d=this.value[f],m=this.from[f]+e,p=this.to[f]+e,b,v;if(m==p){let S=t.mapPos(m,d.startSide,d.mapMode);if(S==null||(b=v=S,d.startSide!=d.endSide&&(v=t.mapPos(m,d.endSide),v<b)))continue}else if(b=t.mapPos(m,d.startSide),v=t.mapPos(p,d.endSide),b>v||b==v&&d.startSide>0&&d.endSide<=0)continue;(v-b||d.endSide-d.startSide)<0||(a<0&&(a=b),d.point&&(u=Math.max(u,v-b)),i.push(d),r.push(b-a),o.push(v-a))}return{mapped:i.length?new Ev(r,o,i,u):null,pos:a}}}class St{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new St(e,t,i,r)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:r=0,filterTo:o=this.length}=e,a=e.filter;if(t.length==0&&!a)return this;if(i&&(t=t.slice().sort(qy)),this.isEmpty)return t.length?St.of(t):this;let u=new sR(this,null,-1).goto(0),f=0,d=[],m=new Wu;for(;u.value||f<t.length;)if(f<t.length&&(u.from-t[f].from||u.startSide-t[f].value.startSide)>=0){let p=t[f++];m.addInner(p.from,p.to,p.value)||d.push(p)}else u.rangeIndex==1&&u.chunkIndex<this.chunk.length&&(f==t.length||this.chunkEnd(u.chunkIndex)<t[f].from)&&(!a||r>this.chunkEnd(u.chunkIndex)||o<this.chunkPos[u.chunkIndex])&&m.addChunk(this.chunkPos[u.chunkIndex],this.chunk[u.chunkIndex])?u.nextChunk():((!a||r>u.to||o<u.from||a(u.from,u.to,u.value))&&(m.addInner(u.from,u.to,u.value)||d.push(Vy.create(u.from,u.to,u.value))),u.next());return m.finishInner(this.nextLayer.isEmpty&&!d.length?St.empty:this.nextLayer.update({add:d,filter:a,filterFrom:r,filterTo:o}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],i=[],r=-1;for(let a=0;a<this.chunk.length;a++){let u=this.chunkPos[a],f=this.chunk[a],d=e.touchesRange(u,u+f.length);if(d===!1)r=Math.max(r,f.maxPoint),t.push(f),i.push(e.mapPos(u));else if(d===!0){let{mapped:m,pos:p}=f.map(u,e);m&&(r=Math.max(r,m.maxPoint),t.push(m),i.push(p))}}let o=this.nextLayer.map(e);return t.length==0?o:new St(i,t,o||St.empty,r)}between(e,t,i){if(!this.isEmpty){for(let r=0;r<this.chunk.length;r++){let o=this.chunkPos[r],a=this.chunk[r];if(t>=o&&e<=o+a.length&&a.between(o,e-o,t-o,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Xu.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Xu.from(e).goto(t)}static compare(e,t,i,r,o=-1){let a=e.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=o),u=t.filter(p=>p.maxPoint>0||!p.isEmpty&&p.maxPoint>=o),f=mk(a,u,i),d=new wu(a,f,o),m=new wu(u,f,o);i.iterGaps((p,b,v)=>pk(d,p,m,b,v,r)),i.empty&&i.length==0&&pk(d,0,m,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let o=e.filter(m=>!m.isEmpty&&t.indexOf(m)<0),a=t.filter(m=>!m.isEmpty&&e.indexOf(m)<0);if(o.length!=a.length)return!1;if(!o.length)return!0;let u=mk(o,a),f=new wu(o,u,0).goto(i),d=new wu(a,u,0).goto(i);for(;;){if(f.to!=d.to||!Fy(f.active,d.active)||f.point&&(!d.point||!Cv(f.point,d.point)))return!1;if(f.to>r)return!0;f.next(),d.next()}}static spans(e,t,i,r,o=-1){let a=new wu(e,null,o).goto(t),u=t,f=a.openStart;for(;;){let d=Math.min(a.to,i);if(a.point){let m=a.activeForPoint(a.to),p=a.pointFrom<t?m.length+1:a.point.startSide<0?m.length:Math.min(m.length,f);r.point(u,d,a.point,m,p,a.pointRank),f=Math.min(a.openEnd(d),m.length)}else d>u&&(r.span(u,d,a.active,f),f=a.openEnd(d));if(a.to>i)return f+(a.point&&a.to>i?1:0);u=a.to,a.next()}}static of(e,t=!1){let i=new Wu;for(let r of e instanceof Vy?[e]:t?V6(e):e)i.add(r.from,r.to,r.value);return i.finish()}static join(e){if(!e.length)return St.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let r=e[i];r!=St.empty;r=r.nextLayer)t=new St(r.chunkPos,r.chunk,t,Math.max(r.maxPoint,t.maxPoint));return t}}St.empty=new St([],[],null,-1);function V6(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let i=n[t];if(qy(e,i)>0)return n.slice().sort(qy);e=i}return n}St.empty.nextLayer=St.empty;class Wu{finishChunk(e){this.chunks.push(new Ev(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new Wu)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(St.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=St.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function mk(n,e,t){let i=new Map;for(let o of n)for(let a=0;a<o.chunk.length;a++)o.chunk[a].maxPoint<=0&&i.set(o.chunk[a],o.chunkPos[a]);let r=new Set;for(let o of e)for(let a=0;a<o.chunk.length;a++){let u=i.get(o.chunk[a]);u!=null&&(t?t.mapPos(u):u)==o.chunkPos[a]&&!(t!=null&&t.touchesRange(u,u+o.chunk[a].length))&&r.add(o.chunk[a])}return r}class sR{constructor(e,t,i,r=0){this.layer=e,this.skip=t,this.minPoint=i,this.rank=r}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,i){for(;this.chunkIndex<this.layer.chunk.length;){let r=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(r)||this.layer.chunkEnd(this.chunkIndex)<e||r.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let r=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!i||this.rangeIndex<r)&&this.setRangeIndex(r)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],i=e+t.from[this.rangeIndex];if(this.from=i,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class Xu{constructor(e){this.heap=e}static from(e,t=null,i=-1){let r=[];for(let o=0;o<e.length;o++)for(let a=e[o];!a.isEmpty;a=a.nextLayer)a.maxPoint>=i&&r.push(new sR(a,t,i,o));return r.length==1?r[0]:new Xu(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)E0(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)E0(this.heap,i);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),E0(this.heap,0)}}}function E0(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1<n.length&&r.compare(n[i+1])>=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class wu{constructor(e,t,i){this.minPoint=i,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Xu.from(e,t,i)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){rd(this.active,e),rd(this.activeTo,e),rd(this.activeRank,e),this.minActive=gk(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:o}=this.cursor;for(;t<this.activeRank.length&&(o-this.activeRank[t]||r-this.activeTo[t])>0;)t++;ld(this.active,t,i),ld(this.activeTo,t,r),ld(this.activeRank,t,o),e&&ld(e,t,this.cursor.from),this.minActive=gk(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let r=this.minActive;if(r>-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&rd(i,r)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let o=this.cursor.value;if(!o.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=o,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=o.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let r=i.length-1;r>=0&&i[r]<e;r--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function pk(n,e,t,i,r,o){n.goto(e),t.goto(i);let a=i+r,u=i,f=i-e,d=!!o.boundChange;for(let m=!1;;){let p=n.to+f-t.to,b=p||n.endSide-t.endSide,v=b<0?n.to+f:t.to,S=Math.min(v,a);if(n.point||t.point?(n.point&&t.point&&Cv(n.point,t.point)&&Fy(n.activeForPoint(n.to),t.activeForPoint(t.to))||o.comparePoint(u,S,n.point,t.point),m=!1):(m&&o.boundChange(u),S>u&&!Fy(n.active,t.active)&&o.compareRange(u,S,n.active,t.active),d&&S<a&&(p||n.openEnd(v)!=t.openEnd(v))&&(m=!0)),v>a)break;u=v,b<=0&&n.next(),b>=0&&t.next()}}function Fy(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Cv(n[t],e[t]))return!1;return!0}function rd(n,e){for(let t=e,i=n.length-1;t<i;t++)n[t]=n[t+1];n.pop()}function ld(n,e,t){for(let i=n.length-1;i>=e;i--)n[i+1]=n[i];n[e]=t}function gk(n,e){let t=-1,i=1e9;for(let r=0;r<e.length;r++)(e[r]-i||n[r].endSide-n[t].endSide)<0&&(t=r,i=e[r]);return t}function Om(n,e,t=n.length){let i=0;for(let r=0;r<t&&r<n.length;)n.charCodeAt(r)==9?(i+=e-i%e,r++):(i++,r=Yn(n,r));return i}function q6(n,e,t,i){for(let r=0,o=0;;){if(o>=e)return r;if(r==n.length)break;o+=n.charCodeAt(r)==9?t-o%t:1,r=Yn(n,r)}return n.length}const Gy="ͼ",yk=typeof Symbol>"u"?"__"+Gy:Symbol.for(Gy),Ky=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),bk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class wl{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(a){return/^@/.test(a)?[a]:a.split(/,\s*/)}function o(a,u,f,d){let m=[],p=/^@(\w+)\b/.exec(a[0]),b=p&&p[1]=="keyframes";if(p&&u==null)return f.push(a[0]+";");for(let v in u){let S=u[v];if(/&/.test(v))o(v.split(/,\s*/).map(w=>a.map(A=>w.replace(/&/,A))).reduce((w,A)=>w.concat(A)),S,f);else if(S&&typeof S=="object"){if(!p)throw new RangeError("The value of a property ("+v+") should be a primitive value.");o(r(v),S,m,b)}else S!=null&&m.push(v.replace(/_.*/,"").replace(/[A-Z]/g,w=>"-"+w.toLowerCase())+": "+S+";")}(m.length||b)&&f.push((i&&!p&&!d?a.map(i):a).join(", ")+" {"+m.join(" ")+"}")}for(let a in e)o(r(a),e[a],this.rules)}getRules(){return this.rules.join(`
|
|
239
|
+
`)}static newName(){let e=bk[yk]||1;return bk[yk]=e+1,Gy+e.toString(36)}static mount(e,t,i){let r=e[Ky],o=i&&i.nonce;r?o&&r.setNonce(o):r=new F6(e,o),r.mount(Array.isArray(t)?t:[t],e)}}let vk=new Map;class F6{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let o=vk.get(i);if(o)return e[Ky]=o;this.sheet=new r.CSSStyleSheet,vk.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ky]=this}mount(e,t){let i=this.sheet,r=0,o=0;for(let a=0;a<e.length;a++){let u=e[a],f=this.modules.indexOf(u);if(f<o&&f>-1&&(this.modules.splice(f,1),o--,f=-1),f==-1){if(this.modules.splice(o++,0,u),i)for(let d=0;d<u.rules.length;d++)i.insertRule(u.rules[d],r++)}else{for(;o<f;)r+=this.modules[o++].rules.length;r+=u.rules.length,o++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let a="";for(let f=0;f<this.modules.length;f++)a+=this.modules[f].getRules()+`
|
|
240
|
+
`;this.styleTag.textContent=a;let u=t.head||t;this.styleTag.parentNode!=u&&u.insertBefore(this.styleTag,u.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var kl={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},$u={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},G6=typeof navigator<"u"&&/Mac/.test(navigator.platform),K6=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _n=0;_n<10;_n++)kl[48+_n]=kl[96+_n]=String(_n);for(var _n=1;_n<=24;_n++)kl[_n+111]="F"+_n;for(var _n=65;_n<=90;_n++)kl[_n]=String.fromCharCode(_n+32),$u[_n]=String.fromCharCode(_n);for(var A0 in kl)$u.hasOwnProperty(A0)||($u[A0]=kl[A0]);function Y6(n){var e=G6&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||K6&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?$u:kl)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}let Jn=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Yy=typeof document<"u"?document:{documentElement:{style:{}}};const Qy=/Edge\/(\d+)/.exec(Jn.userAgent),rR=/MSIE \d/.test(Jn.userAgent),Wy=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Jn.userAgent),Nm=!!(rR||Wy||Qy),xk=!Nm&&/gecko\/(\d+)/i.test(Jn.userAgent),T0=!Nm&&/Chrome\/(\d+)/.exec(Jn.userAgent),Sk="webkitFontSmoothing"in Yy.documentElement.style,Xy=!Nm&&/Apple Computer/.test(Jn.vendor),wk=Xy&&(/Mobile\/\w+/.test(Jn.userAgent)||Jn.maxTouchPoints>2);var Oe={mac:wk||/Mac/.test(Jn.platform),windows:/Win/.test(Jn.platform),linux:/Linux|X11/.test(Jn.platform),ie:Nm,ie_version:rR?Yy.documentMode||6:Wy?+Wy[1]:Qy?+Qy[1]:0,gecko:xk,gecko_version:xk?+(/Firefox\/(\d+)/.exec(Jn.userAgent)||[0,0])[1]:0,chrome:!!T0,chrome_version:T0?+T0[1]:0,ios:wk,android:/Android\b/.test(Jn.userAgent),webkit:Sk,webkit_version:Sk?+(/\bAppleWebKit\/(\d+)/.exec(Jn.userAgent)||[0,0])[1]:0,safari:Xy,safari_version:Xy?+(/\bVersion\/(\d+(\.\d+)?)/.exec(Jn.userAgent)||[0,0])[1]:0,tabSize:Yy.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function Av(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const Jd=Object.create(null);function Tv(n,e,t){if(n==e)return!0;n||(n=Jd),e||(e=Jd);let i=Object.keys(n),r=Object.keys(e);if(i.length-0!=r.length-0)return!1;for(let o of i)if(o!=t&&(r.indexOf(o)==-1||n[o]!==e[o]))return!1;return!0}function Q6(n,e){for(let t=n.attributes.length-1;t>=0;t--){let i=n.attributes[t].name;e[i]==null&&n.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?n.style.cssText=i:n.getAttribute(t)!=i&&n.setAttribute(t,i)}}function kk(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function W6(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let i=n.attributes[t];e[i.name]=i.value}return e}class Sf{eq(e){return!1}updateDOM(e,t,i){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var mi=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})(mi||(mi={}));class _t extends Mo{constructor(e,t,i,r){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new wf(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Oo(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:o,end:a}=lR(e,t);i=(o?t?-3e8:-1:5e8)-1,r=(a?t?2e8:1:-6e8)+1}return new Oo(e,i,r,t,e.widget||null,!0)}static line(e){return new kf(e)}static set(e,t=!1){return St.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}_t.none=St.empty;class wf extends _t{constructor(e){let{start:t,end:i}=lR(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?Av(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||Jd}eq(e){return this==e||e instanceof wf&&this.tagName==e.tagName&&Tv(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}wf.prototype.point=!1;class kf extends _t{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof kf&&this.spec.class==e.spec.class&&Tv(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}kf.prototype.mapMode=Di.TrackBefore;kf.prototype.point=!0;class Oo extends _t{constructor(e,t,i,r,o,a){super(t,i,o,e),this.block=r,this.isReplace=a,this.mapMode=r?t<=0?Di.TrackBefore:Di.TrackAfter:Di.TrackDel}get type(){return this.startSide!=this.endSide?mi.WidgetRange:this.startSide<=0?mi.WidgetBefore:mi.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Oo&&X6(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Oo.prototype.point=!0;function lR(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function X6(n,e){return n==e||!!(n&&e&&n.compare(e))}function Ua(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class Zu extends Mo{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof Zu&&this.tagName==e.tagName&&Tv(this.attributes,e.attributes)}static create(e){return new Zu(e.tagName,e.attributes||Jd,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return St.of(e,t)}}Zu.prototype.startSide=Zu.prototype.endSide=-1;function Ju(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function $y(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function Iu(n,e){if(!e.anchorNode)return!1;try{return $y(n,e.anchorNode)}catch{return!1}}function Hu(n){return n.nodeType==3?tf(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function _u(n,e,t,i){return t?Ck(n,e,t,i,-1)||Ck(n,e,t,i,1):!1}function Cl(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function em(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function Ck(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:kr(n))){if(n.nodeName=="DIV")return!1;let o=n.parentNode;if(!o||o.nodeType!=1)return!1;e=Cl(n)+(r<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?kr(n):0}else return!1}}function kr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function ef(n,e){let{left:t,right:i}=n;if(t==i)return n;let r=e?t:i;return{left:r,right:r,top:n.top,bottom:n.bottom}}function $6(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function oR(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Z6(n,e,t,i,r,o,a,u){let f=n.ownerDocument,d=f.defaultView||window;for(let m=n,p=!1;m&&!p;)if(m.nodeType==1){let b,v=m==f.body,S=1,w=1;if(v)b=$6(d);else{if(/^(fixed|sticky)$/.test(getComputedStyle(m).position)&&(p=!0),m.scrollHeight<=m.clientHeight&&m.scrollWidth<=m.clientWidth){m=m.assignedSlot||m.parentNode;continue}let T=m.getBoundingClientRect();({scaleX:S,scaleY:w}=oR(m,T)),b={left:T.left,right:T.left+m.clientWidth*S,top:T.top,bottom:T.top+m.clientHeight*w}}let A=0,C=0;if(r=="nearest")e.top<b.top+a?(C=e.top-(b.top+a),t>0&&e.bottom>b.bottom+C&&(C=e.bottom-b.bottom+a)):e.bottom>b.bottom-a&&(C=e.bottom-b.bottom+a,t<0&&e.top-C<b.top&&(C=e.top-(b.top+a)));else{let T=e.bottom-e.top,R=b.bottom-b.top;C=(r=="center"&&T<=R?e.top+T/2-R/2:r=="start"||r=="center"&&t<0?e.top-a:e.bottom-R+a)-b.top}if(i=="nearest"?e.left<b.left+o?(A=e.left-(b.left+o),t>0&&e.right>b.right+A&&(A=e.right-b.right+o)):e.right>b.right-o&&(A=e.right-b.right+o,t<0&&e.left<b.left+A&&(A=e.left-(b.left+o))):A=(i=="center"?e.left+(e.right-e.left)/2-(b.right-b.left)/2:i=="start"==u?e.left-o:e.right-(b.right-b.left)+o)-b.left,A||C)if(v)d.scrollBy(A,C);else{let T=0,R=0;if(C){let N=m.scrollTop;m.scrollTop+=C/w,R=(m.scrollTop-N)*w}if(A){let N=m.scrollLeft;m.scrollLeft+=A/S,T=(m.scrollLeft-N)*S}e={left:e.left-T,top:e.top-R,right:e.right-T,bottom:e.bottom-R},T&&Math.abs(T-A)<1&&(i="nearest"),R&&Math.abs(R-C)<1&&(r="nearest")}if(v)break;(e.top<b.top||e.bottom>b.bottom||e.left<b.left||e.right>b.right)&&(e={left:Math.max(e.left,b.left),right:Math.min(e.right,b.right),top:Math.max(e.top,b.top),bottom:Math.min(e.bottom,b.bottom)}),m=m.assignedSlot||m.parentNode}else if(m.nodeType==11)m=m.host;else break}function aR(n,e=!0){let t=n.ownerDocument,i=null,r=null;for(let o=n.parentNode;o&&!(o==t.body||(!e||i)&&r);)if(o.nodeType==1)!r&&o.scrollHeight>o.clientHeight&&(r=o),e&&!i&&o.scrollWidth>o.clientWidth&&(i=o),o=o.assignedSlot||o.parentNode;else if(o.nodeType==11)o=o.host;else break;return{x:i,y:r}}class J6{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:i}=e;this.set(t,Math.min(e.anchorOffset,t?kr(t):0),i,Math.min(e.focusOffset,i?kr(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let io=null;Oe.safari&&Oe.safari_version>=26&&(io=!1);function cR(n){if(n.setActive)return n.setActive();if(io)return n.focus(io);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(io==null?{get preventScroll(){return io={preventScroll:!0},!0}}:void 0),!io){io=!1;for(let t=0;t<e.length;){let i=e[t++],r=e[t++],o=e[t++];i.scrollTop!=r&&(i.scrollTop=r),i.scrollLeft!=o&&(i.scrollLeft=o)}}}let Ek;function tf(n,e,t=e){let i=Ek||(Ek=document.createRange());return i.setEnd(n,t),i.setStart(n,e),i}function Va(n,e,t,i){let r={key:e,code:e,keyCode:t,which:t,cancelable:!0};i&&({altKey:r.altKey,ctrlKey:r.ctrlKey,shiftKey:r.shiftKey,metaKey:r.metaKey}=i);let o=new KeyboardEvent("keydown",r);o.synthetic=!0,n.dispatchEvent(o);let a=new KeyboardEvent("keyup",r);return a.synthetic=!0,n.dispatchEvent(a),o.defaultPrevented||a.defaultPrevented}function eP(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function tP(n,e){let t=e.focusNode,i=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=i)return!1;for(i=Math.min(i,kr(t));;)if(i){if(t.nodeType!=1)return!1;let r=t.childNodes[i-1];r.contentEditable=="false"?i--:(t=r,i=kr(t))}else{if(t==n)return!0;i=Cl(t),t=t.parentNode}}function uR(n){return n instanceof Window?n.pageYOffset>Math.max(0,n.document.documentElement.scrollHeight-n.innerHeight-4):n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function fR(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i>0)return{node:t,offset:i};if(t.nodeType==1&&i>0){if(t.contentEditable=="false")return null;t=t.childNodes[i-1],i=kr(t)}else if(t.parentNode&&!em(t))i=Cl(t),t=t.parentNode;else return null}}function hR(n,e){for(let t=n,i=e;;){if(t.nodeType==3&&i<t.nodeValue.length)return{node:t,offset:i};if(t.nodeType==1&&i<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[i],i=0}else if(t.parentNode&&!em(t))i=Cl(t)+1,t=t.parentNode;else return null}}class os{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new os(e.parentNode,Cl(e),t)}static after(e,t){return new os(e.parentNode,Cl(e)+1,t)}}var fn=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(fn||(fn={}));const No=fn.LTR,Rv=fn.RTL;function dR(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const nP=dR("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),iP=dR("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Zy=Object.create(null),Ss=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);Zy[e]=t,Zy[t]=-e}function mR(n){return n<=247?nP[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?iP[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const sP=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class js{get dir(){return this.level%2?Rv:No}constructor(e,t,i){this.from=e,this.to=t,this.level=i}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,i,r){let o=-1;for(let a=0;a<e.length;a++){let u=e[a];if(u.from<=t&&u.to>=t){if(u.level==i)return a;(o<0||(r!=0?r<0?u.from<t:u.to>t:e[o].level>u.level))&&(o=a)}}if(o<0)throw new RangeError("Index out of range");return o}}function pR(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let i=n[t],r=e[t];if(i.from!=r.from||i.to!=r.to||i.direction!=r.direction||!pR(i.inner,r.inner))return!1}return!0}const Ht=[];function rP(n,e,t,i,r){for(let o=0;o<=i.length;o++){let a=o?i[o-1].to:e,u=o<i.length?i[o].from:t,f=o?256:r;for(let d=a,m=f,p=f;d<u;d++){let b=mR(n.charCodeAt(d));b==512?b=m:b==8&&p==4&&(b=16),Ht[d]=b==4?2:b,b&7&&(p=b),m=b}for(let d=a,m=f,p=f;d<u;d++){let b=Ht[d];if(b==128)d<u-1&&m==Ht[d+1]&&m&24?b=Ht[d]=m:Ht[d]=256;else if(b==64){let v=d+1;for(;v<u&&Ht[v]==64;)v++;let S=d&&m==8||v<t&&Ht[v]==8?p==1?1:8:256;for(let w=d;w<v;w++)Ht[w]=S;d=v-1}else b==8&&p==1&&(Ht[d]=1);m=b,b&7&&(p=b)}}}function lP(n,e,t,i,r){let o=r==1?2:1;for(let a=0,u=0,f=0;a<=i.length;a++){let d=a?i[a-1].to:e,m=a<i.length?i[a].from:t;for(let p=d,b,v,S;p<m;p++)if(v=Zy[b=n.charCodeAt(p)])if(v<0){for(let w=u-3;w>=0;w-=3)if(Ss[w+1]==-v){let A=Ss[w+2],C=A&2?r:A&4?A&1?o:r:0;C&&(Ht[p]=Ht[Ss[w]]=C),u=w;break}}else{if(Ss.length==189)break;Ss[u++]=p,Ss[u++]=b,Ss[u++]=f}else if((S=Ht[p])==2||S==1){let w=S==r;f=w?0:1;for(let A=u-3;A>=0;A-=3){let C=Ss[A+2];if(C&2)break;if(w)Ss[A+2]|=2;else{if(C&4)break;Ss[A+2]|=4}}}}}function oP(n,e,t,i){for(let r=0,o=i;r<=t.length;r++){let a=r?t[r-1].to:n,u=r<t.length?t[r].from:e;for(let f=a;f<u;){let d=Ht[f];if(d==256){let m=f+1;for(;;)if(m==u){if(r==t.length)break;m=t[r++].to,u=r<t.length?t[r].from:e}else if(Ht[m]==256)m++;else break;let p=o==1,b=(m<e?Ht[m]:i)==1,v=p==b?p?1:2:i;for(let S=m,w=r,A=w?t[w-1].to:n;S>f;)S==A&&(S=t[--w].from,A=w?t[w-1].to:n),Ht[--S]=v;f=m}else o=d,f++}}}function Jy(n,e,t,i,r,o,a){let u=i%2?2:1;if(i%2==r%2)for(let f=e,d=0;f<t;){let m=!0,p=!1;if(d==o.length||f<o[d].from){let w=Ht[f];w!=u&&(m=!1,p=w==16)}let b=!m&&u==1?[]:null,v=m?i:i+1,S=f;e:for(;;)if(d<o.length&&S==o[d].from){if(p)break e;let w=o[d];if(!m)for(let A=w.to,C=d+1;;){if(A==t)break e;if(C<o.length&&o[C].from==A)A=o[C++].to;else{if(Ht[A]==u)break e;break}}if(d++,b)b.push(w);else{w.from>f&&a.push(new js(f,w.from,v));let A=w.direction==No!=!(v%2);eb(n,A?i+1:i,r,w.inner,w.from,w.to,a),f=w.to}S=w.to}else{if(S==t||(m?Ht[S]!=u:Ht[S]==u))break;S++}b?Jy(n,f,S,i+1,r,b,a):f<S&&a.push(new js(f,S,v)),f=S}else for(let f=t,d=o.length;f>e;){let m=!0,p=!1;if(!d||f>o[d-1].to){let w=Ht[f-1];w!=u&&(m=!1,p=w==16)}let b=!m&&u==1?[]:null,v=m?i:i+1,S=f;e:for(;;)if(d&&S==o[d-1].to){if(p)break e;let w=o[--d];if(!m)for(let A=w.from,C=d;;){if(A==e)break e;if(C&&o[C-1].to==A)A=o[--C].from;else{if(Ht[A-1]==u)break e;break}}if(b)b.push(w);else{w.to<f&&a.push(new js(w.to,f,v));let A=w.direction==No!=!(v%2);eb(n,A?i+1:i,r,w.inner,w.from,w.to,a),f=w.from}S=w.from}else{if(S==e||(m?Ht[S-1]!=u:Ht[S-1]==u))break;S--}b?Jy(n,S,f,i+1,r,b,a):S<f&&a.push(new js(S,f,v)),f=S}}function eb(n,e,t,i,r,o,a){let u=e%2?2:1;rP(n,r,o,i,u),lP(n,r,o,i,u),oP(r,o,i,u),Jy(n,r,o,e,t,i,a)}function aP(n,e,t){if(!n)return[new js(0,0,e==Rv?1:0)];if(e==No&&!t.length&&!sP.test(n))return gR(n.length);if(t.length)for(;n.length>Ht.length;)Ht[Ht.length]=256;let i=[],r=e==No?0:1;return eb(n,r,r,t,0,n.length,i),i}function gR(n){return[new js(0,n,0)]}let yR="";function cP(n,e,t,i,r){var o;let a=i.head-n.from,u=js.find(e,a,(o=i.bidiLevel)!==null&&o!==void 0?o:-1,i.assoc),f=e[u],d=f.side(r,t);if(a==d){let b=u+=r?1:-1;if(b<0||b>=e.length)return null;f=e[u=b],a=f.side(!r,t),d=f.side(r,t)}let m=Yn(n.text,a,f.forward(r,t));(m<f.from||m>f.to)&&(m=d),yR=n.text.slice(Math.min(a,m),Math.max(a,m));let p=u==(r?e.length-1:0)?null:e[u+(r?1:-1)];return p&&m==d&&p.level+(r?0:1)<f.level?ge.cursor(p.side(!r,t)+n.from,p.forward(r,t)?1:-1,p.level):ge.cursor(m+n.from,f.forward(r,t)?-1:1,f.level)}function uP(n,e,t){for(let i=e;i<t;i++){let r=mR(n.charCodeAt(i));if(r==1)return No;if(r==2||r==4)return Rv}return No}const bR=Ve.define(),vR=Ve.define(),xR=Ve.define(),SR=Ve.define(),tb=Ve.define(),wR=Ve.define(),kR=Ve.define(),Mv=Ve.define(),Ov=Ve.define(),CR=Ve.define({combine:n=>n.some(e=>e)}),fP=Ve.define({combine:n=>n.some(e=>e)}),ER=Ve.define();class qa{constructor(e,t,i,r,o,a=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=o,this.isSnapshot=a}map(e){return e.empty?this:new qa(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new qa(ge.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const od=un.define({map:(n,e)=>n.map(e)}),AR=un.define();function Ls(n,e,t){let i=n.facet(SR);i.length?i[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const yr=Ve.define({combine:n=>n.length?n[0]:!0});let hP=0;const Oa=Ve.define({combine(n){return n.filter((e,t)=>{for(let i=0;i<t;i++)if(n[i].plugin==e.plugin)return!1;return!0})}});class fs{constructor(e,t,i,r,o){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.baseExtensions=o(this),this.extension=this.baseExtensions.concat(Oa.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Oa.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:o,decorations:a}=t||{};return new fs(hP++,e,i,r,u=>{let f=[];return a&&f.push(Dm.of(d=>{let m=d.plugin(u);return m?a(m):_t.none})),o&&f.push(o(u)),f})}static fromClass(e,t){return fs.define((i,r)=>new e(i,r),t)}}class R0{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(i){if(Ls(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){Ls(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(i){Ls(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const TR=Ve.define(),Nv=Ve.define(),Dm=Ve.define(),RR=Ve.define(),Dv=Ve.define(),Cf=Ve.define(),MR=Ve.define();function Ak(n,e){let t=n.state.facet(MR);if(!t.length)return t;let i=t.map(o=>o instanceof Function?o(n):o),r=[];return St.spans(i,e.from,e.to,{point(){},span(o,a,u,f){let d=o-e.from,m=a-e.from,p=r;for(let b=u.length-1;b>=0;b--,f--){let v=u[b].spec.bidiIsolate,S;if(v==null&&(v=uP(e.text,d,m)),f>0&&p.length&&(S=p[p.length-1]).to==d&&S.direction==v)S.to=m,p=S.inner;else{let w={from:d,to:m,direction:v,inner:[]};p.push(w),p=w.inner}}}}),r}const OR=Ve.define();function NR(n){let e=0,t=0,i=0,r=0;for(let o of n.state.facet(OR)){let a=o(n);a&&(a.left!=null&&(e=Math.max(e,a.left)),a.right!=null&&(t=Math.max(t,a.right)),a.top!=null&&(i=Math.max(i,a.top)),a.bottom!=null&&(r=Math.max(r,a.bottom)))}return{left:e,right:t,top:i,bottom:r}}const Du=Ve.define();class Wi{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Wi(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toA<i.fromA)break;i=i.join(r),e.splice(t-1,1)}}return e.splice(t,0,i),e}static extendWithRanges(e,t){if(t.length==0)return e;let i=[];for(let r=0,o=0,a=0;;){let u=r<e.length?e[r].fromB:1e9,f=o<t.length?t[o]:1e9,d=Math.min(u,f);if(d==1e9)break;let m=d+a,p=d,b=m;for(;;)if(o<t.length&&t[o]<=p){let v=t[o+1];o+=2,p=Math.max(p,v);for(let S=r;S<e.length&&e[S].fromB<=p;S++)a=e[S].toA-e[S].toB;b=Math.max(b,v+a)}else if(r<e.length&&e[r].fromB<=p){let v=e[r++];p=Math.max(p,v.toB),b=Math.max(b,v.toA),a=v.toA-v.toB}else break;i.push(new Wi(m,b,d,p))}return i}}class tm{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=Cn.empty(this.startState.doc.length);for(let o of i)this.changes=this.changes.compose(o.changes);let r=[];this.changes.iterChangedRanges((o,a,u,f)=>r.push(new Wi(o,a,u,f))),this.changedRanges=r}static create(e,t,i){return new tm(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const dP=[];class nn{constructor(e,t,i=0){this.dom=e,this.length=t,this.flags=i,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return dP}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&Q6(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let i=t;for(let r of this.children){if(r==e)return i;i+=r.length+r.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t,i){return null}domPosFor(e,t){let i=Cl(this.dom),r=this.length?e>0:t>0;return new os(this.parent.dom,i+(r?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof Lm)return e;return null}static get(e){return e.cmTile}}class jm extends nn{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,i=null,r,o=(e==null?void 0:e.node)==t?e:null,a=0;for(let u of this.children){if(u.sync(e),a+=u.length+u.breakAfter,r=i?i.nextSibling:t.firstChild,o&&r!=u.dom&&(o.written=!0),u.dom.parentNode==t)for(;r&&r!=u.dom;)r=Tk(r);else t.insertBefore(u.dom,r);i=u.dom}for(r=i?i.nextSibling:t.firstChild,o&&r&&(o.written=!0);r;)r=Tk(r);this.length=a}}function Tk(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class Lm extends jm{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=nn.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,r=0,o=0;;)if(r==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&o++,r=t.pop()}else{let a=i.children[r++];if(a instanceof vr)t.push(r),i=a,r=0;else{let u=o+a.length,f=e(a,o);if(f!==void 0)return f;o=u+a.breakAfter}}}resolveBlock(e,t){let i,r=-1,o,a=-1;if(this.blockTiles((u,f)=>{let d=f+u.length;if(e>=f&&e<=d){if(u.isWidget()&&t>=-1&&t<=1){if(u.flags&32)return!0;u.flags&16&&(i=void 0)}(f<e||e==d&&(t<-1?u.length:u.covers(1)))&&(!i||!u.isWidget()&&i.isWidget())&&(i=u,r=e-f),(d>e||e==f&&(t>1?u.length:u.covers(-1)))&&(!o||!u.isWidget()&&o.isWidget())&&(o=u,a=e-f)}}),!i&&!o)throw new Error("No tile at position "+e);return i&&t<0||!o?{tile:i,offset:r}:{tile:o,offset:a}}}class vr extends jm{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let i=new vr(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class fc extends jm{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let r=new fc(t||document.createElement("div"),e);return(!t||!i)&&(r.flags|=4),r}get domAttrs(){return this.attrs}resolveInline(e,t,i){let r=null,o=-1,a=null,u=-1;function f(m,p){for(let b=0,v=0;b<m.children.length&&v<=p;b++){let S=m.children[b],w=v+S.length;w>=p&&(S.isComposite()?f(S,p-v):(!a||a.isHidden&&(t>0&&!(a.flags&32)||i&&pP(a,S)))&&(w>p||S.flags&32)?(a=S,u=p-v):(v<p||S.flags&16&&!S.isHidden)&&(r=S,o=p-v)),v=w}}f(this,e);let d=(t<0?r:a)||r||a;return d?{tile:d,offset:d==r?o:u}:null}coordsIn(e,t,i){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t,i):mP(this)}domIn(e,t){let i=this.resolveInline(e,t);if(i){let{tile:r,offset:o}=i;if(this.dom.contains(r.dom))return r.isText()?new os(r.dom,Math.min(r.dom.nodeValue.length,o)):r.domPosFor(o,r.flags&16?1:r.flags&32?-1:t);let a=i.tile.parent,u=!1;for(let f of a.children){if(u)return new os(f.dom,0);f==i.tile&&(u=!0)}}return new os(this.dom,0)}}function mP(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=Hu(e);return t[t.length-1]||null}function pP(n,e){let t=n.coordsIn(0,1),i=e.coordsIn(0,1);return t&&i&&i.top<t.bottom}class hi extends jm{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let i=new hi(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class uo extends nn{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t,i){let r=this.dom.nodeValue.length;e>r&&(e=r);let o=e,a=e,u=0;e==0&&t<0||e==r&&t>=0?Oe.chrome||Oe.gecko||(e?(o--,u=1):a<r&&(a++,u=-1)):t<0?o--:a<r&&a++;let f=tf(this.dom,o,a).getClientRects();if(!f.length)return null;let d=f[(u?u<0:t>=0)?0:f.length-1];return Oe.safari&&!u&&d.width==0&&(d=Array.prototype.find.call(f,m=>m.width)||d),i==null?d:ef(d,(u?u>0:t<0)==i)}static of(e,t){let i=new uo(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class Do extends nn{constructor(e,t,i,r){super(e,t,r),this.widget=i}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,i){let r=this.widget.coordsAt(this.dom,e,t);if(r)return r;if(i)return ef(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let o=this.dom.getClientRects(),a=null;if(!o.length)return null;let u=this.flags&16?!0:this.flags&32?!1:e>0;for(let f=u?o.length-1:0;a=o[f],!(e>0?f==0:f==o.length-1||a.top<a.bottom);f+=u?-1:1);return ef(a,!u)}}get overrideDOMText(){if(!this.length)return wt.empty;let{root:e}=this;if(!e)return wt.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,i,r,o){return o||(o=e.toDOM(t),e.editable||(o.contentEditable="false")),new Do(o,i,e,r)}}class nm extends nn{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return wt.empty}coordsIn(e,t,i){let r=this.dom.getBoundingClientRect();return i==null?r:ef(r,t>0==i)}}class gP{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,i){let{tile:r,index:o,beforeBreak:a,parents:u}=this;for(;e||t>0;)if(r.isComposite())if(a){if(!e)break;i&&i.break(),e--,a=!1}else if(o==r.children.length){if(!e&&!u.length)break;i&&i.leave(r),a=!!r.breakAfter,{tile:r,index:o}=u.pop(),o++}else{let f=r.children[o],d=f.breakAfter;(t>0?f.length<=e:f.length<e)&&(!i||i.skip(f,0,f.length)!==!1||!f.isComposite)?(a=!!d,o++,e-=f.length):(u.push({tile:r,index:o}),r=f,o=0,i&&f.isComposite()&&i.enter(f))}else if(o==r.length)a=!!r.breakAfter,{tile:r,index:o}=u.pop(),o++;else if(e){let f=Math.min(e,r.length-o);i&&i.skip(r,o,o+f),e-=f,o+=f}else break;return this.tile=r,this.index=o,this.beforeBreak=a,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class yP{constructor(e,t,i,r){this.from=e,this.to=t,this.wrapper=i,this.rank=r}}class bP{constructor(e,t,i){this.cache=e,this.root=t,this.blockWrappers=i,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,i,r){var o;this.flushBuffer();let a=this.ensureMarks(t,i),u=a.lastChild;if(u&&u.isText()&&!(u.flags&8)&&u.length+e.length<512){this.cache.reused.set(u,2);let f=a.children[a.children.length-1]=new uo(u.dom,u.text+e);f.parent=a}else a.append(r||uo.of(e,(o=this.cache.find(uo))===null||o===void 0?void 0:o.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let i=this.curLine;i.dom!=t.line.dom&&(i.setDOM(this.cache.reused.has(t.line)?M0(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let r=i;for(let u=t.marks.length-1;u>=0;u--){let f=t.marks[u],d=r.lastChild;if(d instanceof hi&&d.mark.eq(f.mark))d.dom!=f.dom&&d.setDOM(M0(f.dom)),r=d;else{if(this.cache.reused.get(f)){let p=nn.get(f.dom);p&&p.setDOM(M0(f.dom))}let m=hi.of(f.mark,f.dom);r.append(m),r=m}this.cache.reused.set(f,2)}let o=nn.get(e.text);o&&this.cache.reused.set(o,2);let a=new uo(e.text,e.text.nodeValue);a.flags|=8,this.pos=e.range.toB,r.append(a)}addInlineWidget(e,t,i){let r=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);r||this.flushBuffer();let o=this.ensureMarks(t,i);!r&&!(e.flags&16)&&o.append(this.getBuffer(1)),o.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,i){this.flushBuffer(),this.ensureMarks(t,i).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var i;e||(e=DR);let r=fc.start(e,t||((i=this.cache.find(fc))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=r)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var i;let r=this.curLine;for(let o=e.length-1;o>=0;o--){let a=e[o],u;if(t>0&&(u=r.lastChild)&&u instanceof hi&&u.mark.eq(a))r=u,t--;else{let f=hi.of(a,(i=this.cache.find(hi,d=>d.mark.eq(a)))===null||i===void 0?void 0:i.dom);r.append(f),r=f,t=0}}return r}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!Rk(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Oe.ios&&Rk(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(O0,0,32)||new Do(O0.toDOM(),0,O0,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=e.rank*102+e.value.rank,i=new yP(e.from,e.to,e.value,t),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-i.rank||this.wrappers[r-1].to-i.to)<0;)r--;this.wrappers.splice(r,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let r=t.lastChild;if(i.from<this.pos&&r instanceof vr&&r.wrapper.eq(i.wrapper))t=r;else{let o=vr.of(i.wrapper,(e=this.cache.find(vr,a=>a.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(o),t=o}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),i=this.cache.find(nm,void 0,1);return i&&(i.flags=t),i||new nm(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class vP{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:a}=this.cursor.next(this.skipCount);if(this.skipCount=0,a)throw new Error("Ran out of text content when drawing inline views");this.text=r;let u=this.textOff=Math.min(e,r.length);return o?null:r.slice(0,u)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const im=[Do,fc,uo,hi,nm,vr,Lm];for(let n=0;n<im.length;n++)im[n].bucket=n;class xP{constructor(e){this.view=e,this.buckets=im.map(()=>[]),this.index=im.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,i=this.buckets[t];i.length<6?i.push(e):i[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,i=2){let r=e.bucket,o=this.buckets[r],a=this.index[r];for(let u=0;u<o.length;u++){let f=(u+a)%o.length,d=o[f];if((!t||t(d))&&!this.reused.has(d))return o.splice(f,1),f<a&&this.index[r]--,this.reused.set(d,i),d}return null}findWidget(e,t,i){let r=this.buckets[0];if(r.length)for(let o=0,a=0;;o++){if(o==r.length){if(a)return null;a=1,o=0}let u=r[o];if(!this.reused.has(u)&&(a==0?u.widget.compare(e):u.widget.constructor==e.constructor&&e.updateDOM(u.dom,this.view,u.widget)))return r.splice(o,1),o<this.index[0]&&this.index[0]--,u.widget==e&&u.length==t&&(u.flags&497)==i?(this.reused.set(u,1),u):(this.reused.set(u,2),new Do(u.dom,t,e,u.flags&-498|i))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class SP{constructor(e,t,i,r,o){this.view=e,this.decorations=r,this.disallowBlockEffectsFor=o,this.openWidget=!1,this.openMarks=0,this.cache=new xP(e),this.text=new vP(e.state.doc),this.builder=new bP(this.cache,new Lm(e,e.contentDOM),St.iter(i)),this.cache.reused.set(t,2),this.old=new gP(t),this.reuseWalker={skip:(a,u,f)=>{if(this.cache.add(a),a.isComposite())return!1},enter:a=>this.cache.add(a),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let r=0,o=0,a=0;;){let u=a<e.length?e[a++]:null,f=u?u.fromA:this.old.root.length;if(f>r){let d=f-r;this.preserve(d,!a,!u),r=f,o+=d}if(!u)break;t&&u.fromA<=t.range.fromA&&u.toA>=t.range.toA?(this.forward(u.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(o,t.range.fromB),this.builder.flushBuffer(),this.cache.clear(),this.builder.addComposition(t,i),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,u.toA),this.emit(t.range.toB,u.toB)):(this.forward(u.fromA,u.toA),this.emit(o,u.toB)),o=u.toB,r=u.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,i){let r=CP(this.old),o=this.openMarks;this.old.advance(e,i?1:-1,{skip:(a,u,f)=>{if(a.isWidget())if(this.openWidget)this.builder.continueWidget(f-u);else{let d=f>0||u<a.length?Do.of(a.widget,this.view,f-u,a.flags&496,this.cache.maybeReuse(a)):this.cache.reuse(a);d.flags&256?(d.flags&=-2,this.builder.addBlockWidget(d)):(this.builder.ensureLine(null),this.builder.addInlineWidget(d,r,o),o=r.length)}else if(a.isText())this.builder.ensureLine(null),!u&&f==a.length&&!this.cache.reused.has(a)?this.builder.addText(a.text,r,o,this.cache.reuse(a)):(this.cache.add(a),this.builder.addText(a.text.slice(u,f),r,o)),o=r.length;else if(a.isLine())a.flags&=-2,this.cache.reused.set(a,1),this.builder.addLine(a);else if(a instanceof nm)this.cache.add(a);else if(a instanceof hi)this.builder.ensureLine(null),this.builder.addMark(a,r,o),this.cache.reused.set(a,1),o=r.length;else return!1;this.openWidget=!1},enter:a=>{a.isLine()?this.builder.addLineStart(a.attrs,this.cache.maybeReuse(a)):(this.cache.add(a),a instanceof hi&&r.unshift(a.mark)),this.openWidget=!1},leave:a=>{a.isLine()?r.length&&(r.length=o=0):a instanceof hi&&(r.shift(),o=Math.min(o,r.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,r=this.builder,o=0,a=St.spans(this.decorations,e,t,{point:(u,f,d,m,p,b)=>{if(d instanceof Oo){if(this.disallowBlockEffectsFor[b]){if(d.block)throw new RangeError("Block decorations may not be specified via plugins");if(f>this.view.state.doc.lineAt(u).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(o=m.length,p>m.length)r.continueWidget(f-u);else{let v=d.widget||(d.block?hc.block:hc.inline),S=wP(d),w=this.cache.findWidget(v,f-u,S)||Do.of(v,this.view,f-u,S);d.block?(d.startSide>0&&r.addLineStartIfNotCovered(i),r.addBlockWidget(w)):(r.ensureLine(i),r.addInlineWidget(w,m,p))}i=null}else i=kP(i,d);f>u&&this.text.skip(f-u)},span:(u,f,d,m)=>{for(let p=u;p<f;){let b=this.text.next(Math.min(512,f-p));b==null?(r.addLineStartIfNotCovered(i),r.addBreak(),p++):(r.ensureLine(i),r.addText(b,d,p==u?m:d.length),p+=b.length),i=null}o=d.length}});this.openWidget=a>o,this.openWidget||r.addLineStartIfNotCovered(i),this.openMarks=a}forward(e,t,i=1){t-e<=10?this.old.advance(t-e,i,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,i,this.reuseWalker))}getCompositionContext(e){let t=[],i=null;for(let r=e.parentNode;;r=r.parentNode){let o=nn.get(r);if(r==this.view.contentDOM)break;o instanceof hi?t.push(o):o!=null&&o.isLine()?i=o:o instanceof vr||(r.nodeName=="DIV"&&!i&&r!=this.view.contentDOM?i=new fc(r,DR):i||t.push(hi.of(new wf({tagName:r.nodeName.toLowerCase(),attributes:W6(r)}),r)))}return{line:i,marks:t}}}function Rk(n,e){let t=i=>{for(let r of i.children)if((e?r.isText():r.length)||t(r))return!0;return!1};return t(n)}function wP(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const DR={class:"cm-line"};function kP(n,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(n||(n={class:"cm-line"}),t&&Av(t,n),i&&(n.class+=" "+i)),n}function CP(n){let e=[];for(let t=n.parents.length;t>1;t--){let i=t==n.parents.length?n.tile:n.parents[t].tile;i instanceof hi&&e.push(i.mark)}return e}function M0(n){let e=nn.get(n);return e&&e.setDOM(n.cloneNode()),n}class hc extends Sf{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}hc.inline=new hc("span");hc.block=new hc("div");const O0=new class extends Sf{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Mk{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=_t.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new Lm(e,e.contentDOM),this.updateInner([new Wi(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:m,toA:p})=>p<this.minWidthFrom||m>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let r=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!jP(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let o=r>-1?AP(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){let{from:m,to:p}=this.hasComposition;i=new Wi(m,p,e.changes.mapPos(m,-1),e.changes.mapPos(p,1)).addToSet(i.slice())}this.hasComposition=o?{from:o.range.fromB,to:o.range.toB}:null,(Oe.ie||Oe.chrome)&&!o&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let a=this.decorations,u=this.blockWrappers;this.updateDeco();let f=MP(a,this.decorations,e.changes);f.length&&(i=Wi.extendWithRanges(i,f));let d=NP(u,this.blockWrappers,e.changes);return d.length&&(i=Wi.extendWithRanges(i,d)),o&&!i.some(m=>m.fromA<=o.range.fromA&&m.toA>=o.range.toA)&&(i=o.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,o),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:i}=this.view;i.ignore(()=>{if(t||e.length){let a=this.tile,u=new SP(this.view,a,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&nn.get(t.text)&&u.cache.reused.set(nn.get(t.text),2),this.tile=u.run(e,t),nb(a,u.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=Oe.chrome||Oe.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(o),o&&(o.written||i.selectionRange.focusNode!=o.node||!this.tile.dom.contains(o.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let r=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let o of this.tile.children)o.isWidget()&&o.widget instanceof N0&&r.push(o.dom);i.updateGaps(r)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let i of t.effects)i.is(AR)&&(this.editContextFormatting=i.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:i}=this.tile,r=this.view.root.activeElement,o=r==i,a=!o&&!(this.view.state.facet(yr)||i.tabIndex>-1)&&Iu(i,this.view.observer.selectionRange)&&!(r&&i.contains(r));if(!(o||t||a))return;let u=this.forceSelection;this.forceSelection=!1;let f=this.view.state.selection.main,d,m;if(f.empty?m=d=this.inlineDOMNearPos(f.anchor,f.assoc||1):(m=this.inlineDOMNearPos(f.head,f.head==f.from?1:-1),d=this.inlineDOMNearPos(f.anchor,f.anchor==f.from?1:-1)),Oe.gecko&&f.empty&&!this.hasComposition&&EP(d)){let b=document.createTextNode("");this.view.observer.ignore(()=>d.node.insertBefore(b,d.node.childNodes[d.offset]||null)),d=m=new os(b,0),u=!0}let p=this.view.observer.selectionRange;(u||!p.focusNode||(!_u(d.node,d.offset,p.anchorNode,p.anchorOffset)||!_u(m.node,m.offset,p.focusNode,p.focusOffset))&&!this.suppressWidgetCursorChange(p,f))&&(this.view.observer.ignore(()=>{Oe.android&&Oe.chrome&&i.contains(p.focusNode)&&DP(p.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let b=Ju(this.view.root);if(b)if(f.empty){if(Oe.gecko){let v=TP(d.node,d.offset);if(v&&v!=3){let S=(v==1?fR:hR)(d.node,d.offset);S&&(d=new os(S.node,S.offset))}}b.collapse(d.node,d.offset),f.bidiLevel!=null&&b.caretBidiLevel!==void 0&&(b.caretBidiLevel=f.bidiLevel)}else if(b.extend){b.collapse(d.node,d.offset);try{b.extend(m.node,m.offset)}catch{}}else{let v=document.createRange();f.anchor>f.head&&([d,m]=[m,d]),v.setEnd(m.node,m.offset),v.setStart(d.node,d.offset),b.removeAllRanges(),b.addRange(v)}a&&this.view.root.activeElement==i&&(i.blur(),r&&r.focus())}),this.view.observer.setSelectionRange(d,m)),this.impreciseAnchor=d.precise?null:new os(p.anchorNode,p.anchorOffset),this.impreciseHead=m.precise?null:new os(p.focusNode,p.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&_u(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Ju(e.root),{anchorNode:r,anchorOffset:o}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let a=this.lineAt(t.head,t.assoc);if(!a)return;let u=a.posAtStart;if(t.head==u||t.head==u+a.length)return;let f=this.coordsAt(t.head,-1),d=this.coordsAt(t.head,1);if(!f||!d||f.bottom>d.top)return;let m=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(m.node,m.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let p=e.observer.selectionRange;e.docView.posFromDOM(p.anchorNode,p.anchorOffset)!=t.from&&i.collapse(r,o)}posFromDOM(e,t){let i=this.tile.nearest(e);if(!i)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let r=i.posAtStart;if(i.isComposite()){let o;if(e==i.dom)o=i.dom.childNodes[t];else{let a=kr(e)==0?0:t==0?-1:1;for(;;){let u=e.parentNode;if(u==i.dom)break;a==0&&u.firstChild!=u.lastChild&&(e==u.firstChild?a=-1:a=1),e=u}a<0?o=e:o=e.nextSibling}if(o==i.dom.firstChild)return r;for(;o&&!nn.get(o);)o=o.nextSibling;if(!o)return r+i.length;for(let a=0,u=r;;a++){let f=i.children[a];if(f.dom==o)return u;u+=f.length+f.breakAfter}}else return i.isText()?e==i.dom?r+t:r+(t?i.length:0):r}domAtPos(e,t){let{tile:i,offset:r}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(r,t):i.domIn(r,t)}inlineDOMNearPos(e,t){let i,r=-1,o=!1,a,u=-1,f=!1;return this.tile.blockTiles((d,m)=>{if(d.isWidget()){if(d.flags&32&&m>=e)return!0;d.flags&16&&(o=!0)}else{let p=m+d.length;if(m<=e&&(i=d,r=e-m,o=p<e),p>=e&&!a&&(a=d,u=e-m,f=m>e),m>e&&a)return!0}}),!i&&!a?this.domAtPos(e,t):(o&&a?i=null:f&&i&&(a=null),i&&t<0||!a?i.domIn(r,t):a.domIn(u,t))}coordsAt(e,t,i){let{tile:r,offset:o}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof N0?null:r.coordsInWidget(o,t,!0):r.coordsIn(o,t,i)}lineAt(e,t){let{tile:i}=this.tile.resolveBlock(e,t);return i.isLine()?i:null}coordsForChar(e){let{tile:t,offset:i}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function r(o,a){if(o.isComposite())for(let u of o.children){if(u.length>=a){let f=r(u,a);if(f)return f}if(a-=u.length,a<0)break}else if(o.isText()&&a<o.length){let u=Yn(o.text,a);if(u==a)return null;let f=tf(o.dom,a,u).getClientRects();for(let d=0;d<f.length;d++){let m=f[d];if(d==f.length-1||m.top<m.bottom&&m.left<m.right)return m}}return null}return r(t,i)}measureVisibleLineHeights(e){let t=[],{from:i,to:r}=e,o=this.view.contentDOM.clientWidth,a=o>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,u=-1,f=this.view.textDirection==fn.LTR,d=0,m=(p,b,v)=>{for(let S=0;S<p.children.length&&!(b>r);S++){let w=p.children[S],A=b+w.length,C=w.dom.getBoundingClientRect(),{height:T}=C;if(v&&!S&&(d+=C.top-v.top),w instanceof vr)A>i&&m(w,b,C);else if(b>=i&&(d>0&&t.push(-d),t.push(T+d),d=0,a)){let R=w.dom.lastChild,N=R?Hu(R):[];if(N.length){let O=N[N.length-1],z=f?O.right-C.left:C.right-O.left;z>u&&(u=z,this.minWidth=o,this.minWidthFrom=b,this.minWidthTo=A)}}v&&S==p.children.length-1&&(d+=v.bottom-C.bottom),b=A+w.breakAfter}};return m(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?fn.RTL:fn.LTR}measureTextSize(){let e=this.tile.blockTiles(a=>{if(a.isLine()&&a.children.length&&a.length<=20){let u=0,f;for(let d of a.children){if(!d.isText()||/[^ -~]/.test(d.text))return;let m=Hu(d.dom);if(m.length!=1)return;u+=m[0].width,f=m[0].height}if(u)return{lineHeight:a.dom.getBoundingClientRect().height,charWidth:u/a.length,textHeight:f}}});if(e)return e;let t=document.createElement("div"),i,r,o;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let a=Hu(t.firstChild)[0];i=t.getBoundingClientRect().height,r=a&&a.width?a.width/27:7,o=a&&a.height?a.height:i,t.remove()}),{lineHeight:i,charWidth:r,textHeight:o}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let o=r==t.viewports.length?null:t.viewports[r],a=o?o.from-1:this.view.state.doc.length;if(a>i){let u=(t.lineBlockAt(a).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(_t.replace({widget:new N0(u),block:!0,inclusive:!0,isBlockGap:!0}).range(i,a))}if(!o)break;i=o.to+1}return _t.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Dm).map(o=>(this.dynamicDecorationMap[e++]=typeof o=="function")?o(this.view):o),i=!1,r=this.view.state.facet(Dv).map((o,a)=>{let u=typeof o=="function";return u&&(i=!0),u?o(this.view):o});for(r.length&&(this.dynamicDecorationMap[e++]=i,t.push(St.join(r))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(RR).map(o=>typeof o=="function"?o(this.view):o)}scrollIntoView(e){if(e.isSnapshot){let d=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=d.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let d of this.view.state.facet(ER))try{if(d(this.view,e.range,e))return!0}catch(m){Ls(this.view.state,m,"scroll handler")}let{range:t}=e,i=this.coordsAt(t.head,t.assoc||(t.head>t.anchor?-1:1)),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let o=NR(this.view),a={left:i.left-o.left,top:i.top-o.top,right:i.right+o.right,bottom:i.bottom+o.bottom},{offsetWidth:u,offsetHeight:f}=this.view.scrollDOM;if(Z6(this.view.scrollDOM,a,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,u),-u),Math.max(Math.min(e.yMargin,f),-f),this.view.textDirection==fn.LTR),window.visualViewport&&window.innerHeight-window.visualViewport.height>1&&(i.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||i.bottom<window.pageYOffset+window.visualViewport.offsetTop)){let d=this.view.docView.lineAt(t.head,1);d&&d.dom.scrollIntoView({block:"nearest"})}}lineHasWidget(e){let t=i=>i.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){nb(this.tile)}}function nb(n,e){let t=e==null?void 0:e.get(n);if(t!=1){t==null&&n.destroy();for(let i of n.children)nb(i,e)}}function EP(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function jR(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let i=fR(t.focusNode,t.focusOffset),r=hR(t.focusNode,t.focusOffset),o=i||r;if(r&&i&&r.node!=i.node){let u=nn.get(r.node);if(!u||u.isText()&&u.text!=r.node.nodeValue)o=r;else if(n.docView.lastCompositionAfterCursor){let f=nn.get(i.node);!f||f.isText()&&f.text!=i.node.nodeValue||(o=r)}}if(n.docView.lastCompositionAfterCursor=o!=i,!o)return null;let a=e-o.offset;return{from:a,to:a+o.node.nodeValue.length,node:o.node}}function AP(n,e,t){let i=jR(n,t);if(!i)return null;let{node:r,from:o,to:a}=i,u=r.nodeValue;if(/[\n\r]/.test(u)||n.state.doc.sliceString(i.from,i.to)!=u)return null;let f=e.invertedDesc;return{range:new Wi(f.mapPos(o),f.mapPos(a),o,a),text:r}}function TP(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let RP=class{constructor(){this.changes=[]}compareRange(e,t){Ua(e,t,this.changes)}comparePoint(e,t){Ua(e,t,this.changes)}boundChange(e){Ua(e,e,this.changes)}};function MP(n,e,t){let i=new RP;return St.compare(n,e,t,i),i.changes}class OP{constructor(){this.changes=[]}compareRange(e,t){Ua(e,t,this.changes)}comparePoint(){}boundChange(e){Ua(e,e,this.changes)}}function NP(n,e,t){let i=new OP;return St.compare(n,e,t,i),i.changes}function DP(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function jP(n,e){let t=!1;return e&&n.iterChangedRanges((i,r)=>{i<e.to&&r>e.from&&(t=!0)}),t}class N0 extends Sf{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function LP(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),o=e-r.from;if(r.length==0)return ge.cursor(e);o==0?t=1:o==r.length&&(t=-1);let a=o,u=o;t<0?a=Yn(r.text,o,!1):u=Yn(r.text,o);let f=i(r.text.slice(a,u));for(;a>0;){let d=Yn(r.text,a,!1);if(i(r.text.slice(d,a))!=f)break;a=d}for(;u<r.length;){let d=Yn(r.text,u);if(i(r.text.slice(u,d))!=f)break;u=d}return ge.undirectionalRange(a+r.from,u+r.from)}function BP(n,e,t,i,r){let o=Math.round((i-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let u=n.viewState.heightOracle.textHeight,f=Math.floor((r-t.top-(n.defaultLineHeight-u)*.5)/u);o+=f*n.viewState.heightOracle.lineLength}let a=n.state.sliceDoc(t.from,t.to);return t.from+q6(a,o,n.state.tabSize)}function zP(n,e,t){let i=n.lineBlockAt(e);if(Array.isArray(i.type)){let r;for(let o of i.type){if(o.from>e)break;if(!(o.to<e)){if(o.from<e&&o.to>e)return o;(!r||o.type==mi.Text&&(r.type!=o.type||(t<0?o.from<e:o.to>e)))&&(r=o)}}return r||i}return i}function PP(n,e,t,i){let r=zP(n,e.head,e.assoc||-1),o=!i||r.type!=mi.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(o){let a=n.dom.getBoundingClientRect(),u=n.textDirectionAt(r.from),f=n.posAtCoords({x:t==(u==fn.LTR)?a.right-1:a.left+1,y:(o.top+o.bottom)/2});if(f!=null)return ge.cursor(f,t?-1:1)}return ge.cursor(t?r.to:r.from,t?-1:1)}function Ok(n,e,t,i){let r=n.state.doc.lineAt(e.head),o=n.bidiSpans(r),a=n.textDirectionAt(r.from);for(let u=e,f=null;;){let d=cP(r,o,a,u,t),m=yR;if(!d){if(r.number==(t?n.state.doc.lines:1))return u;m=`
|
|
241
|
+
`,r=n.state.doc.line(r.number+(t?1:-1)),o=n.bidiSpans(r),d=n.visualLineSide(r,!t)}if(f){if(!f(m))return u}else{if(!i)return d;f=i(m)}u=d}}function IP(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return o=>{let a=i(o);return r==br.Space&&(r=a),r==a}}function HP(n,e,t,i){let r=e.head,o=t?1:-1;if(r==(t?n.state.doc.length:0))return ge.cursor(r,e.assoc);let a=e.goalColumn,u,f=n.contentDOM.getBoundingClientRect(),d=n.coordsAtPos(r,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),m=n.documentTop;if(d)a==null&&(a=d.left-f.left),u=o<0?d.top:d.bottom;else{let S=n.viewState.lineBlockAt(r);a==null&&(a=Math.min(f.right-f.left,n.defaultCharacterWidth*(r-S.from))),u=(o<0?S.top:S.bottom)+m}let p=f.left+a,b=n.viewState.heightOracle.textHeight>>1,v=i??b;for(let S=0;;S+=b){let w=u+(v+S)*o,A=ib(n,{x:p,y:w},!1,o);if(t?w>f.bottom:w<f.top)return ge.cursor(A.pos,A.assoc);let C=n.coordsAtPos(A.pos,A.assoc),T=C?(C.top+C.bottom)/2:0;if(!C||(t?T>u:T<u))return ge.cursor(A.pos,A.assoc,void 0,a)}}function Uu(n,e,t){for(;;){let i=0;for(let r of n)r.between(e-1,e+1,(o,a,u)=>{if(e>o&&e<a){let f=i||t||(e-o<a-e?-1:1);e=f<0?o:a,i=f}});if(!i)return e}}function LR(n,e){let t=null;for(let i=0;i<e.ranges.length;i++){let r=e.ranges[i],o=null;if(r.empty){let a=Uu(n,r.from,0);a!=r.from&&(o=ge.cursor(a,-1))}else{let a=Uu(n,r.from,-1),u=Uu(n,r.to,1);(a!=r.from||u!=r.to)&&(r.undirectional?o=ge.undirectionalRange(r.from,r.to):o=ge.range(r.from==r.anchor?a:u,r.from==r.head?a:u))}o&&(t||(t=e.ranges.slice()),t[i]=o)}return t?ge.create(t,e.mainIndex):e}function D0(n,e,t){let i=Uu(n.state.facet(Cf).map(r=>r(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:ge.cursor(i,i<t.from?1:-1)}class Ns{constructor(e,t){this.pos=e,this.assoc=t}}function ib(n,e,t,i){let r=n.contentDOM.getBoundingClientRect(),o=r.top+n.viewState.paddingTop,{x:a,y:u}=e,f=u-o,d;for(;;){if(f<0)return new Ns(0,1);if(f>n.viewState.docHeight)return new Ns(n.state.doc.length,-1);if(d=n.elementAtHeight(f),i==null)break;if(d.type==mi.Text){if(i<0?d.to<n.viewport.from:d.from>n.viewport.to)break;let b=n.docView.coordsAt(i<0?d.from:d.to,i>0?-1:1);if(b&&(i<0?b.top<=f+o:b.bottom>=f+o))break}let p=n.viewState.heightOracle.textHeight/2;f=i>0?d.bottom+p:d.top-p}if(n.viewport.from>=d.to||n.viewport.to<=d.from){if(t)return null;if(d.type==mi.Text){let p=BP(n,r,d,a,u);return new Ns(p,p==d.from?1:-1)}}if(d.type!=mi.Text)return f<(d.top+d.bottom)/2?new Ns(d.from,1):new Ns(d.to,-1);let m=n.docView.lineAt(d.from,2);return(!m||m.length!=d.length)&&(m=n.docView.lineAt(d.from,-2)),new _P(n,a,u,n.textDirectionAt(d.from)).scanTile(m,d.from)}class _P{constructor(e,t,i,r){this.view=e,this.x=t,this.y=i,this.baseDir=r,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[js.find(r,e-i.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:i,spans:r}=this.bidiSpansAt(e);return r[js.find(r,e-i.from,-1,t)].dir}bidiIn(e,t){let{spans:i,line:r}=this.bidiSpansAt(e);return i.length>1||i.length&&(i[0].level!=this.baseDir||i[0].to+r.from<t)}scan(e,t,i=!1){let r=0,o=e.length-1,a=new Set,u=this.bidiIn(e[0],e[o]),f,d,m=-1,p=1e9,b;e:for(;r<o;){let S=o-r,w=r+o>>1;t:if(a.has(w)){let C=r+Math.floor(Math.random()*S);for(let T=0;T<S;T++){if(!a.has(C)){w=C;break t}C++,C==o&&(C=r)}break e}a.add(w);let A=t(w);if(A)for(let C=0;C<A.length;C++){let T=A[C],R=0;if(!(T.width==0&&A.length>1)){if(T.bottom<this.y)(!f||f.bottom<T.bottom)&&(f=T),R=1;else if(T.top>this.y)(!d||d.top>T.top)&&(d=T),R=-1;else{let N=T.left>this.x?this.x-T.left:T.right<this.x?this.x-T.right:0,O=Math.abs(N);O<p&&(m=w,p=O,b=T),N&&(R=N<0==(this.baseDir==fn.LTR)?-1:1)}R==-1&&(!u||this.baseDirAt(e[w],1))?o=w:R==1&&(!u||this.baseDirAt(e[w+1],-1))&&(r=w+1)}}}if(!b){if(!d&&!f)return{i:e[0],after:!1};let S=f&&(!d||this.y-f.bottom<d.top-this.y)?f:d;return this.y=(S.top+S.bottom)/2,this.scan(e,t,!0)}if(p&&!i){let{top:S,bottom:w}=b;if(f&&f.bottom>(S+S+w)/3)return this.y=f.bottom-1,this.scan(e,t,!0);if(d&&d.top<(S+w+w)/3)return this.y=d.top+1,this.scan(e,t,!0)}let v=(u?this.dirAt(e[m],1):this.baseDir)==fn.LTR;return{i:m,after:this.x>(b.left+b.right)/2==v}}scanText(e,t){let i=[];for(let o=0;o<e.length;o=Yn(e.text,o))i.push(t+o);i.push(t+e.length);let r=this.scan(i,o=>{let a=i[o]-t,u=i[o+1]-t;return tf(e.dom,a,u).getClientRects()});return r.after?new Ns(i[r.i+1],-1):new Ns(i[r.i],1)}scanTile(e,t){if(!e.length)return new Ns(t,1);if(e.children.length==1){let u=e.children[0];if(u.isText())return this.scanText(u,t);if(u.isComposite())return this.scanTile(u,t)}let i=[t];for(let u=0,f=t;u<e.children.length;u++)i.push(f+=e.children[u].length);let r=this.scan(i,u=>{let f=e.children[u];return f.flags&48?null:(f.dom.nodeType==1?f.dom:tf(f.dom,0,f.length)).getClientRects()}),o=e.children[r.i],a=i[r.i];return o.isText()?this.scanText(o,a):o.isComposite()?this.scanTile(o,a):r.after?new Ns(i[r.i+1],-1):new Ns(a,1)}}const Ra="";class UP{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(xt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ra}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let o=this.text.length;this.readNode(r);let a=nn.get(r),u=r.nextSibling;if(u==t){a!=null&&a.breakAfter&&!u&&i!=this.view.contentDOM&&this.lineBreak();break}let f=nn.get(u);(a&&f?a.breakAfter:(a?a.breakAfter:em(r))||em(u)&&(r.nodeName!="BR"||a!=null&&a.isWidget())&&this.text.length>o)&&!qP(u,t)&&this.lineBreak(),r=u}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let o=-1,a=1,u;if(this.lineSeparator?(o=t.indexOf(this.lineSeparator,i),a=this.lineSeparator.length):(u=r.exec(t))&&(o=u.index,a=u[0].length),this.append(t.slice(i,o<0?t.length:o)),o<0)break;if(this.lineBreak(),a>1)for(let f of this.points)f.node==e&&f.pos>this.text.length&&(f.pos-=a-1);i=o+a}}readNode(e){let t=nn.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(VP(e,i.node,i.offset)?t:0))}}function VP(n,e,t){for(;;){if(!e||t<kr(e))return!1;if(e==n)return!0;t=Cl(e)+1,e=e.parentNode}}function qP(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let i=nn.get(n);if(!(i!=null&&i.isWidget()))return!1;i&&(t||(t=[])).push(i)}if(t)for(let i of t){let r=i.overrideDOMText;if(r!=null&&r.length)return!1}return!0}class Nk{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class FP{constructor(e,t,i,r){this.typeOver=r,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:o,impreciseAnchor:a}=e.docView,u=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=BR(e.docView.tile,t,i,0))){let f=o||a?[]:KP(e),d=new UP(f,e);d.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=d.text,this.newSel=YP(f,this.bounds.from)}else{let f=e.observer.selectionRange,d=o&&o.node==f.focusNode&&o.offset==f.focusOffset||!$y(e.contentDOM,f.focusNode)?u.main.head:e.docView.posFromDOM(f.focusNode,f.focusOffset),m=a&&a.node==f.anchorNode&&a.offset==f.anchorOffset||!$y(e.contentDOM,f.anchorNode)?u.main.anchor:e.docView.posFromDOM(f.anchorNode,f.anchorOffset),p=e.viewport;if((Oe.ios||Oe.chrome)&&d!=m&&Math.min(d,m)<=u.main.from&&Math.max(d,m)>=u.main.to&&(p.from>0||p.to<e.state.doc.length)){let b=Math.min(d,m),v=Math.max(d,m),S=p.from-b,w=p.to-v;(S==0||S==1||b==0)&&(w==0||w==-1||v==e.state.doc.length)&&(d=0,m=e.state.doc.length)}if(e.inputState.composing>-1&&u.ranges.length>1)this.newSel=u.replaceRange(ge.range(m,d));else if(e.lineWrapping&&m==d&&!(u.main.empty&&u.main.head==d)&&e.inputState.lastTouchTime>Date.now()-100){let b=e.coordsAtPos(d,-1),v=0;b&&(v=e.inputState.lastTouchY<=b.bottom?-1:1),this.newSel=ge.create([ge.cursor(d,v)])}else this.newSel=ge.single(m,d)}}}function BR(n,e,t,i){if(n.isComposite()){let r=-1,o=-1,a=-1,u=-1;for(let f=0,d=i,m=i;f<n.children.length;f++){let p=n.children[f],b=d+p.length;if(d<e&&b>t)return BR(p,e,t,d);if(b>=e&&r==-1&&(r=f,o=d),d>t&&p.dom.parentNode==n.dom){a=f,u=m;break}m=b,d=b+p.breakAfter}return{from:o,to:u<0?i+n.length:u,startDOM:(r?n.children[r-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:a<n.children.length&&a>=0?n.children[a].dom:null}}else return n.isText()?{from:i,to:i+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function zR(n,e){let t,{newSel:i}=e,{state:r}=n,o=r.selection.main,a=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:u,to:f}=e.bounds,d=o.from,m=null;(a===8||Oe.android&&e.text.length<f-u)&&(d=o.to,m="end");let p=r.doc.sliceString(u,f,Ra),b,v;!o.empty&&o.from>=u&&o.to<=f&&(e.typeOver||p!=e.text)&&p.slice(0,o.from-u)==e.text.slice(0,o.from-u)&&p.slice(o.to-u)==e.text.slice(b=e.text.length-(p.length-(o.to-u)))?t={from:o.from,to:o.to,insert:wt.of(e.text.slice(o.from-u,b).split(Ra))}:(v=PR(p,e.text,d-u,m))&&(Oe.chrome&&a==13&&v.toB==v.from+2&&e.text.slice(v.from,v.toB)==Ra+Ra&&v.toB--,t={from:u+v.from,to:u+v.toA,insert:wt.of(e.text.slice(v.from,v.toB).split(Ra))})}else i&&(!n.hasFocus&&r.facet(yr)||sm(i,o))&&(i=null);if(!t&&!i)return!1;if((Oe.mac||Oe.android)&&t&&t.from==t.to&&t.from==o.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=ge.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:wt.of([t.insert.toString().replace("."," ")])}):r.doc.lineAt(o.from).to<o.to&&n.docView.lineHasWidget(o.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:o.from,to:o.to,insert:r.toText(n.inputState.insertingText)}:Oe.chrome&&t&&t.from==t.to&&t.from==o.head&&t.insert.toString()==`
|
|
242
|
+
`&&n.lineWrapping&&(i&&(i=ge.single(i.main.anchor-1,i.main.head-1)),t={from:o.from,to:o.to,insert:wt.of([" "])}),t)return jv(n,t,i,a);if(i&&!sm(i,o)){let u=!1,f="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(u=!0),f=n.inputState.lastSelectionOrigin,f=="select.pointer"&&(i=LR(r.facet(Cf).map(d=>d(n)),i))),n.dispatch({selection:i,scrollIntoView:u,userEvent:f}),!0}else return!1}function jv(n,e,t,i=-1){if(Oe.ios&&n.inputState.flushIOSKey(e))return!0;let r=n.state.selection.main;if(Oe.android&&(e.to==r.to&&(e.from==r.from||e.from==r.from-1&&n.state.sliceDoc(e.from,r.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Va(n.contentDOM,"Enter",13)||(e.from==r.from-1&&e.to==r.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>r.head)&&Va(n.contentDOM,"Backspace",8)||e.from==r.from&&e.to==r.to+1&&e.insert.length==0&&Va(n.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let a,u=()=>a||(a=GP(n,e,t));return n.state.facet(wR).some(f=>f(n,e.from,e.to,o,u))||n.dispatch(u()),!0}function GP(n,e,t){let i,r=n.state,o=r.selection.main,a=-1;if(e.from==e.to&&e.from<o.from||e.from>o.to){let f=e.from<o.from?-1:1,d=f<0?o.from:o.to,m=Uu(r.facet(Cf).map(p=>p(n)),d,f);e.from==m&&(a=m)}if(a>-1)i={changes:e,selection:ge.cursor(e.from+e.insert.length,-1)};else if(e.from>=o.from&&e.to<=o.to&&e.to-e.from>=(o.to-o.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let f=o.from<e.from?r.sliceDoc(o.from,e.from):"",d=o.to>e.to?r.sliceDoc(e.to,o.to):"";i=r.replaceSelection(n.state.toText(f+e.insert.sliceString(0,void 0,n.state.lineBreak)+d))}else{let f=r.changes(e),d=t&&t.main.to<=f.newLength?t.main:void 0;if(r.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=o.to+10&&e.to>=o.to-10){let m=n.state.sliceDoc(e.from,e.to),p,b=t&&jR(n,t.main.head);if(b){let S=e.insert.length-(e.to-e.from);p={from:b.from,to:b.to-S}}else p=n.state.doc.lineAt(o.head);let v=o.to-e.to;i=r.changeByRange(S=>{if(S.from==o.from&&S.to==o.to)return{changes:f,range:d||S.map(f)};let w=S.to-v,A=w-m.length;if(n.state.sliceDoc(A,w)!=m||w>=p.from&&A<=p.to)return{range:S};let C=r.changes({from:A,to:w,insert:e.insert}),T=S.to-o.to;return{changes:C,range:d?ge.range(Math.max(0,d.anchor+T),Math.max(0,d.head+T)):S.map(C)}})}else i={changes:f,selection:d&&r.selection.replaceRange(d)}}let u="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,u+=".compose",n.inputState.compositionFirstChange&&(u+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:u,scrollIntoView:!0})}function PR(n,e,t,i){let r=Math.min(n.length,e.length),o=0;for(;o<r&&n.charCodeAt(o)==e.charCodeAt(o);)o++;if(o==r&&n.length==e.length)return null;let a=n.length,u=e.length;for(;a>0&&u>0&&n.charCodeAt(a-1)==e.charCodeAt(u-1);)a--,u--;if(i=="end"){let f=Math.max(0,o-Math.min(a,u));t-=a+f-o}if(a<o&&n.length<e.length){let f=t<=o&&t>=a?o-t:0;o-=f,u=o+(u-a),a=o}else if(u<o){let f=t<=o&&t>=u?o-t:0;o-=f,a=o+(a-u),u=o}return{from:o,toA:a,toB:u}}function KP(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:o}=n.observer.selectionRange;return t&&(e.push(new Nk(t,i)),(r!=t||o!=i)&&e.push(new Nk(r,o))),e}function YP(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?ge.single(t+e,i+e):null}function sm(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class QP{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.touchActive=!1,this.lastTouchTime=0,this.lastTouchX=0,this.lastTouchY=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.lastWheelEvent=0,this.pendingIOSKey=void 0,this.lastIOSMomentumScroll=0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Oe.safari&&e.contentDOM.addEventListener("input",()=>null),Oe.gecko&&uI(e.contentDOM.ownerDocument)}handleEvent(e){!iI(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=XP(e),i=this.handlers,r=this.view.contentDOM;for(let o in t)if(o!="scroll"){let a=!t[o].handlers.length,u=i[o];u&&a!=!u.handlers.length&&(r.removeEventListener(o,this.handleEvent),u=null),u||r.addEventListener(o,this.handleEvent,{passive:a})}for(let o in i)o!="scroll"&&!t[o]&&r.removeEventListener(o,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&HR.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Oe.android&&Oe.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;if(Oe.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&(IR.some(t=>t.keyCode==e.keyCode)&&!e.ctrlKey||$P.indexOf(e.key)>-1&&e.ctrlKey)){let t={ctrlKey:e.ctrlKey,altKey:e.altKey,metaKey:e.metaKey,shiftKey:e.shiftKey};return t.shiftKey&&Oe.ios&&!/^(off|none)$/.test(this.view.contentDOM.autocapitalize)&&WP(this.view.win)&&(t.shiftKey=!1),this.pendingIOSKey={key:e.key,keyCode:e.keyCode,mods:t},setTimeout(()=>this.flushIOSKey(),250),!0}return e.keyCode!=229&&this.view.observer.forceFlush(),!1}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Va(this.view.contentDOM,t.key,t.keyCode,t.mods))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Oe.safari&&!Oe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function WP(n){return n.visualViewport?n.visualViewport.height*n.visualViewport.scale/n.document.documentElement.clientHeight<.85:!1}function Dk(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){Ls(t.state,r)}}}function XP(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec,o=r&&r.plugin.domEventHandlers,a=r&&r.plugin.domEventObservers;if(o)for(let u in o){let f=o[u];f&&t(u).handlers.push(Dk(i.value,f))}if(a)for(let u in a){let f=a[u];f&&t(u).observers.push(Dk(i.value,f))}}for(let i in hs)t(i).handlers.push(hs[i]);for(let i in ni)t(i).observers.push(ni[i]);return e}const IR=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$P="dthko",HR=[16,17,18,20,91,92,224,225],ad=6;function cd(n){return Math.max(0,n)*.7+8}function ZP(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class JP{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=aR(e.contentDOM),this.atoms=e.state.facet(Cf).map(a=>a(e));let o=e.contentDOM.ownerDocument;o.addEventListener("mousemove",this.move=this.move.bind(this)),o.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(xt.allowMultipleSelections)&&eI(e,t),this.dragging=nI(e,t)&&VR(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&ZP(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,r=0,o=0,a=this.view.win.innerWidth,u=this.view.win.innerHeight;this.scrollParents.x&&({left:r,right:a}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:o,bottom:u}=this.scrollParents.y.getBoundingClientRect());let f=NR(this.view);e.clientX-f.left<=r+ad?t=-cd(r-e.clientX):e.clientX+f.right>=a-ad&&(t=cd(e.clientX-a)),e.clientY-f.top<=o+ad?i=-cd(o-e.clientY):e.clientY+f.bottom>=u-ad&&(i=cd(e.clientY-u)),this.setScrollSpeed(t,i)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,i=LR(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!i.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function eI(n,e){let t=n.state.facet(bR);return t.length?t[0](e):Oe.mac?e.metaKey:e.ctrlKey}function tI(n,e){let t=n.state.facet(vR);return t.length?t[0](e):Oe.mac?!e.altKey:!e.ctrlKey}function nI(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Ju(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let o=0;o<r.length;o++){let a=r[o];if(a.left<=e.clientX&&a.right>=e.clientX&&a.top<=e.clientY&&a.bottom>=e.clientY)return!0}return!1}function iI(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=nn.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const hs=Object.create(null),ni=Object.create(null),_R=Oe.ie&&Oe.ie_version<15||Oe.ios&&Oe.webkit_version<604;function sI(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),UR(n,t.value)},50)}function Bm(n,e,t){for(let i of n.facet(e))t=i(t,n);return t}function UR(n,e){e=Bm(n.state,Mv,e);let{state:t}=n,i,r=1,o=t.toText(e),a=o.lines==t.selection.ranges.length;if(sb!=null&&t.selection.ranges.every(f=>f.empty)&&sb==o.toString()){let f=-1;i=t.changeByRange(d=>{let m=t.doc.lineAt(d.from);if(m.from==f)return{range:d};f=m.from;let p=t.toText((a?o.line(r++).text:e)+t.lineBreak);return{changes:{from:m.from,insert:p},range:ge.cursor(d.from+p.length)}})}else a?i=t.changeByRange(f=>{let d=o.line(r++);return{changes:{from:f.from,to:f.to,insert:d.text},range:ge.cursor(f.from+d.length)}}):i=t.replaceSelection(o);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ni.scroll=n=>{let e=n.inputState;e.lastScrollTop=n.scrollDOM.scrollTop,e.lastScrollLeft=n.scrollDOM.scrollLeft,Oe.ios&&!e.touchActive&&(e.lastIOSMomentumScroll=Date.now())};ni.wheel=ni.mousewheel=n=>{n.inputState.lastWheelEvent=Date.now()};hs.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ni.touchstart=(n,e)=>{let t=n.inputState,i=e.targetTouches[0];t.touchActive=!0,t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};ni.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};ni.touchend=(n,e)=>{n.inputState.touchActive=!1};hs.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(xR))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=lI(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new JP(n,e,t,i)),i&&n.observer.ignore(()=>{cR(n.contentDOM);let o=n.root.activeElement;o&&!o.contains(n.contentDOM)&&o.blur()});let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function jk(n,e,t,i){if(i==1)return ge.cursor(e,t);if(i==2)return LP(n.state,e,t);{let r=n.docView.lineAt(e,t),o=n.state.doc.lineAt(r?r.posAtEnd:e),a=r?r.posAtStart:o.from,u=r?r.posAtEnd:o.to;return u<n.state.doc.length&&u==o.to&&u++,ge.undirectionalRange(a,u)}}const rI=Oe.ie&&Oe.ie_version<=11;let Lk=null,Bk=0,zk=0;function VR(n){if(!rI)return n.detail;let e=Lk,t=zk;return Lk=n,zk=Date.now(),Bk=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Bk+1)%3:1}function lI(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=VR(e),r=n.state.selection;return{update(o){o.docChanged&&(t.pos=o.changes.mapPos(t.pos),r=r.map(o.changes))},get(o,a,u){let f=n.posAndSideAtCoords({x:o.clientX,y:o.clientY},!1),d,m=jk(n,f.pos,f.assoc,i);if(t.pos!=f.pos&&!a){let p=jk(n,t.pos,t.assoc,i),b=Math.min(p.from,m.from),v=Math.max(p.to,m.to);m=b<m.from?ge.range(b,v,m.assoc):ge.range(v,b,m.assoc)}return a?r.replaceRange(r.main.extend(m.from,m.to,m.assoc)):u&&i==1&&r.ranges.length>1&&(d=oI(r,f.pos))?d:u?r.addRange(m):ge.create([m])}}}function oI(n,e){for(let t=0;t<n.ranges.length;t++){let{from:i,to:r}=n.ranges[t];if(i<=e&&r>=e)return ge.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}hs.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.tile.nearest(e.target);if(r&&r.isWidget()){let o=r.posAtStart,a=o+r.length;(o>=t.to||a<=t.from)&&(t=ge.undirectionalRange(o,a))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Bm(n.state,Ov,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};hs.dragend=n=>(n.inputState.draggedContent=null,!1);function Pk(n,e,t,i){if(t=Bm(n.state,Mv,t),!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:o}=n.inputState,a=i&&o&&tI(n,e)?{from:o.from,to:o.to}:null,u={from:r,insert:t},f=n.state.changes(a?[a,u]:u);n.focus(),n.dispatch({changes:f,selection:{anchor:f.mapPos(r,-1),head:f.mapPos(r,1)},userEvent:a?"move.drop":"input.drop"}),n.inputState.draggedContent=null}hs.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,o=()=>{++r==t.length&&Pk(n,e,i.filter(a=>a!=null).join(n.state.lineBreak),!1)};for(let a=0;a<t.length;a++){let u=new FileReader;u.onerror=o,u.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(u.result)||(i[a]=u.result),o()},u.readAsText(t[a])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Pk(n,e,i,!0),!0}return!1};hs.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=_R?null:e.clipboardData;return t?(UR(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(sI(n),!1)};function aI(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function cI(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:o}of n.selection.ranges){let a=n.doc.lineAt(o);a.number>r&&(e.push(a.text),t.push({from:a.from,to:Math.min(n.doc.length,a.to+1)})),r=a.number}i=!0}return{text:Bm(n,Ov,e.join(n.lineBreak)),ranges:t,linewise:i}}let sb=null;hs.copy=hs.cut=(n,e)=>{if(!Iu(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:r}=cI(n.state);if(!t&&!r)return!1;sb=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let o=_R?null:e.clipboardData;return o?(o.clearData(),o.setData("text/plain",t),!0):(aI(n,t),!1)};const qR=Ll.define();function FR(n,e){let t=[];for(let i of n.facet(kR)){let r=i(n,e);r&&t.push(r)}return t.length?n.update({effects:t,annotations:qR.of(!0)}):null}function GR(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=FR(n.state,e);t?n.dispatch(t):n.update([])}},10)}ni.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),GR(n)};ni.blur=n=>{n.observer.clearSelectionRange(),GR(n)};ni.compositionstart=ni.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ni.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Oe.chrome&&Oe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ni.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};hs.beforeinput=(n,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let o=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),a=e.getTargetRanges();if(o&&a.length){let u=a[0],f=n.posAtDOM(u.startContainer,u.startOffset),d=n.posAtDOM(u.endContainer,u.endOffset);return jv(n,{from:f,to:d,insert:n.state.toText(o)},null),!0}}let r;if(Oe.chrome&&Oe.android&&(r=IR.find(o=>o.inputType==e.inputType))&&(n.observer.delayAndroidKey(r.key,r.keyCode),r.key=="Backspace"||r.key=="Delete")){let o=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var a;(((a=window.visualViewport)===null||a===void 0?void 0:a.height)||0)>o+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Oe.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Oe.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ni.compositionend(n,e),20),!1};const Ik=new Set;function uI(n){Ik.has(n)||(Ik.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Hk=["pre-wrap","normal","pre-line","break-spaces"];let dc=!1;function _k(){dc=!1}class fI{constructor(e){this.lineWrapping=e,this.doc=wt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Hk.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i<e.length;i++){let r=e[i];r<0?i++:this.heightSamples[Math.floor(r*10)]||(t=!0,this.heightSamples[Math.floor(r*10)]=!0)}return t}refresh(e,t,i,r,o,a){let u=Hk.indexOf(e)>-1,f=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=u;if(this.lineWrapping=u,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=o,f){this.heightSamples={};for(let d=0;d<a.length;d++){let m=a[d];m<0?d++:this.heightSamples[Math.floor(m*10)]=!0}}return f}}class hI{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class ls{constructor(e,t,i,r,o){this.from=e,this.length=t,this.top=i,this.height=r,this._content=o}get type(){return typeof this._content=="number"?mi.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Oo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new ls(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var Ut=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(Ut||(Ut={}));const Md=.001;class ti{constructor(e,t,i=2){this.length=e,this.height=t,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Md&&(dc=!0),this.height=e)}replace(e,t,i){return ti.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let o=this,a=i.doc;for(let u=r.length-1;u>=0;u--){let{fromA:f,toA:d,fromB:m,toB:p}=r[u],b=o.lineAt(f,Ut.ByPosNoHeight,i.setDoc(t),0,0),v=b.to>=d?b:o.lineAt(d,Ut.ByPosNoHeight,i,0,0);for(p+=v.to-d,d=v.to;u>0&&b.from<=r[u-1].toA;)f=r[u-1].fromA,m=r[u-1].fromB,u--,f<b.from&&(b=o.lineAt(f,Ut.ByPosNoHeight,i,0,0));m+=b.from-f,f=b.from;let S=Lv.build(i.setDoc(a),e,m,p);o=rm(o,o.replace(f,d,S))}return o.updateHeight(i,0)}static empty(){return new Ai(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,i=e.length,r=0,o=0;for(;;)if(t==i)if(r>o*2){let u=e[t-1];u.break?e.splice(--t,1,u.left,null,u.right):e.splice(--t,1,u.left,u.right),i+=1+u.break,r-=u.size}else if(o>r*2){let u=e[i];u.break?e.splice(i,1,u.left,null,u.right):e.splice(i,1,u.left,u.right),i+=2+u.break,o-=u.size}else break;else if(r<o){let u=e[t++];u&&(r+=u.size)}else{let u=e[--i];u&&(o+=u.size)}let a=0;return e[t-1]==null?(a=1,t--):e[t]==null&&(a=1,i++),new mI(ti.of(e.slice(0,t)),a,ti.of(e.slice(i)))}}function rm(n,e){return n==e?n:(n.constructor!=e.constructor&&(dc=!0),e)}ti.prototype.size=1;const dI=_t.replace({});class KR extends ti{constructor(e,t,i){super(e,t),this.deco=i,this.spaceAbove=0}mainBlock(e,t){return new ls(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,i,r){return this.spaceAbove&&e<i+this.spaceAbove?new ls(r,0,i,this.spaceAbove,dI):this.mainBlock(i,r)}lineAt(e,t,i,r,o){let a=this.mainBlock(r,o);return this.spaceAbove?this.blockAt(0,i,r,o).join(a):a}forEachLine(e,t,i,r,o,a){e<=o+this.length&&t>=o&&a(this.lineAt(0,Ut.ByPos,i,r,o))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setMeasuredHeight(r),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ai extends KR{constructor(e,t,i){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=i}mainBlock(e,t){return new ls(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof Ai||r instanceof Hn&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof Hn?r=new Ai(r.length,this.height,this.spaceAbove):r.height=this.height,this.outdated||(r.outdated=!1),r):ti.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setMeasuredHeight(r):(i||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Hn extends ti{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,o=r-i+1,a,u=0;if(e.lineWrapping){let f=Math.min(this.height,e.lineHeight*o);a=f/o,this.length>o+1&&(u=(this.height-f)/(this.length-o-1))}else a=this.height/o;return{firstLine:i,lastLine:r,perLine:a,perChar:u}}blockAt(e,t,i,r){let{firstLine:o,lastLine:a,perLine:u,perChar:f}=this.heightMetrics(t,r);if(t.lineWrapping){let d=r+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length)),m=t.doc.lineAt(d),p=u+m.length*f,b=Math.max(i,e-p/2);return new ls(m.from,m.length,b,p,0)}else{let d=Math.max(0,Math.min(a-o,Math.floor((e-i)/u))),{from:m,length:p}=t.doc.line(o+d);return new ls(m,p,i+u*d,u,0)}}lineAt(e,t,i,r,o){if(t==Ut.ByHeight)return this.blockAt(e,i,r,o);if(t==Ut.ByPosNoHeight){let{from:v,to:S}=i.doc.lineAt(e);return new ls(v,S-v,0,0,0)}let{firstLine:a,perLine:u,perChar:f}=this.heightMetrics(i,o),d=i.doc.lineAt(e),m=u+d.length*f,p=d.number-a,b=r+u*p+f*(d.from-o-p);return new ls(d.from,d.length,Math.max(r,Math.min(b,r+this.height-m)),m,0)}forEachLine(e,t,i,r,o,a){e=Math.max(e,o),t=Math.min(t,o+this.length);let{firstLine:u,perLine:f,perChar:d}=this.heightMetrics(i,o);for(let m=e,p=r;m<=t;){let b=i.doc.lineAt(m);if(m==e){let S=b.number-u;p+=f*S+d*(e-o-S)}let v=f+d*b.length;a(new ls(b.from,b.length,p,v,0)),p+=v,m=b.to+1}}replace(e,t,i){let r=this.length-t;if(r>0){let o=i[i.length-1];o instanceof Hn?i[i.length-1]=new Hn(o.length+r):i.push(null,new Hn(r-1))}if(e>0){let o=i[0];o instanceof Hn?i[0]=new Hn(e+o.length):i.unshift(new Hn(e-1),null)}return ti.of(i)}decomposeLeft(e,t){t.push(new Hn(e-1),null)}decomposeRight(e,t){t.push(null,new Hn(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let o=t+this.length;if(r&&r.from<=t+this.length&&r.more){let a=[],u=Math.max(t,r.from),f=-1;for(r.from>t&&a.push(new Hn(r.from-t-1).updateHeight(e,t));u<=o&&r.more;){let m=e.doc.lineAt(u).length;a.length&&a.push(null);let p=r.heights[r.index++],b=0;p<0&&(b=-p,p=r.heights[r.index++]),f==-1?f=p:Math.abs(p-f)>=Md&&(f=-2);let v=new Ai(m,p,b);v.outdated=!1,a.push(v),u+=m+1}u<=o&&a.push(null,new Hn(o-u).updateHeight(e,u));let d=ti.of(a);return(f<0||Math.abs(d.height-this.height)>=Md||Math.abs(f-this.heightMetrics(e,t).perLine)>=Md)&&(dc=!0),rm(this,d)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class mI extends ti{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let o=i+this.left.height;return e<o?this.left.blockAt(e,t,i,r):this.right.blockAt(e,t,o,r+this.left.length+this.break)}lineAt(e,t,i,r,o){let a=r+this.left.height,u=o+this.left.length+this.break,f=t==Ut.ByHeight?e<a:e<u,d=f?this.left.lineAt(e,t,i,r,o):this.right.lineAt(e,t,i,a,u);if(this.break||(f?d.to<u:d.from>u))return d;let m=t==Ut.ByPosNoHeight?Ut.ByPosNoHeight:Ut.ByPos;return f?d.join(this.right.lineAt(u,m,i,a,u)):this.left.lineAt(u,m,i,r,o).join(d)}forEachLine(e,t,i,r,o,a){let u=r+this.left.height,f=o+this.left.length+this.break;if(this.break)e<f&&this.left.forEachLine(e,t,i,r,o,a),t>=f&&this.right.forEachLine(e,t,i,u,f,a);else{let d=this.lineAt(f,Ut.ByPos,i,r,o);e<d.from&&this.left.forEachLine(e,d.from-1,i,r,o,a),d.to>=e&&d.from<=t&&a(d),t>d.to&&this.right.forEachLine(d.to+1,t,i,u,f,a)}}replace(e,t,i){let r=this.left.length+this.break;if(t<r)return this.balanced(this.left.replace(e,t,i),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let o=[];e>0&&this.decomposeLeft(e,o);let a=o.length;for(let u of i)o.push(u);if(e>0&&Uk(o,a-1),t<this.length){let u=o.length;this.decomposeRight(t,o),Uk(o,u)}return ti.of(o)}decomposeLeft(e,t){let i=this.left.length;if(e<=i)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(i++,e>=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e<i&&this.left.decomposeRight(e,t),this.break&&e<r&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?ti.of(this.break?[e,null,t]:[e,t]):(this.left=rm(this.left,e),this.right=rm(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,i=!1,r){let{left:o,right:a}=this,u=t+o.length+this.break,f=null;return r&&r.from<=t+o.length&&r.more?f=o=o.updateHeight(e,t,i,r):o.updateHeight(e,t,i),r&&r.from<=u+a.length&&r.more?f=a=a.updateHeight(e,u,i,r):a.updateHeight(e,u,i),f?this.balanced(o,a):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Uk(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof Hn&&(i=n[e+1])instanceof Hn&&n.splice(e-1,3,new Hn(t.length+1+i.length))}const pI=5;class Lv{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof Ai?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new Ai(i-this.pos,-1,0)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e<t||i.heightRelevant){let r=i.widget?i.widget.estimatedHeight:0,o=i.widget?i.widget.lineBreaks:0;r<0&&(r=this.oracle.lineHeight);let a=t-e;i.block?this.addBlock(new KR(a,r,i)):(a||o||r>=pI)&&this.addLineDeco(r,o,a)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ai(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new Hn(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ai)return e;let t=new Ai(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ai)&&!this.isCovered?this.nodes.push(new Ai(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=e;for(let r of this.nodes)r instanceof Ai&&r.updateHeight(this.oracle,i),i+=r?r.length:1;return this.nodes}static build(e,t,i,r){let o=new Lv(i,e);return St.spans(t,i,r,o,0),o.finish(i)}}function gI(n,e,t){let i=new yI;return St.compare(n,e,t,i,0),i.changes}class yI{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,i,r){(e<t||i&&i.heightRelevant||r&&r.heightRelevant)&&Ua(e,t,this.changes,5)}}function bI(n,e){let t=n.getBoundingClientRect(),i=n.ownerDocument,r=i.defaultView||window,o=Math.max(0,t.left),a=Math.min(r.innerWidth,t.right),u=Math.max(0,t.top),f=Math.min(r.innerHeight,t.bottom);for(let d=n.parentNode;d&&d!=i.body;)if(d.nodeType==1){let m=d,p=window.getComputedStyle(m);if((m.scrollHeight>m.clientHeight||m.scrollWidth>m.clientWidth)&&p.overflow!="visible"){let b=m.getBoundingClientRect();o=Math.max(o,b.left),a=Math.min(a,b.right),u=Math.max(u,b.top),f=Math.min(d==n.parentNode?r.innerHeight:f,b.bottom)}d=p.position=="absolute"||p.position=="fixed"?m.offsetParent:m.parentNode}else if(d.nodeType==11)d=d.host;else break;return{left:o-t.left,right:Math.max(o,a)-t.left,top:u-(t.top+e),bottom:Math.max(u,f)-(t.top+e)}}function vI(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function xI(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class j0{constructor(e,t,i,r){this.from=e,this.to=t,this.size=i,this.displaySize=r}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let r=e[i],o=t[i];if(r.from!=o.from||r.to!=o.to||r.size!=o.size)return!1}return!0}draw(e,t){return _t.replace({widget:new SI(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class SI extends Sf{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class Vk{constructor(e,t){this.view=e,this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scaleX=1,this.scaleY=1,this.scrollOffset=0,this.scrolledToBottom=!1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=qk,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=fn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let i=t.facet(Nv).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new fI(i),this.stateDeco=Fk(t),this.heightMap=ti.empty().applyChanges(this.stateDeco,wt.empty,this.heightOracle.setDoc(t.doc),[new Wi(0,0,0,t.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=_t.set(this.lineGaps.map(r=>r.draw(this,!1))),this.scrollParent=e.scrollDOM,this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:o,to:a})=>r>=o&&r<=a)){let{from:o,to:a}=this.lineBlockAt(r);e.push(new ud(o,a))}}return this.viewports=e.sort((i,r)=>i.from-r.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?qk:new Bv(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(ju(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Fk(this.state);let r=e.changedRanges,o=Wi.extendWithRanges(r,gI(i,this.stateDeco,e?e.changes:Cn.empty(this.state.doc.length))),a=this.heightMap.height,u=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);_k(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),o),(this.heightMap.height!=a||dc)&&(e.flags|=2),u?(this.scrollAnchorPos=e.changes.mapPos(u.from,-1),this.scrollAnchorHeight=u.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=a);let f=o.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<f.from||t.range.head>f.to)||!this.viewportIsAppropriate(f))&&(f=this.getViewport(0,t));let d=f.from!=this.viewport.from||f.to!=this.viewport.to;this.viewport=f,e.flags|=this.updateForViewport(),(d||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(fP)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,o=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?fn.RTL:fn.LTR;let a=this.heightOracle.mustRefreshForWrapping(o)||this.mustMeasureContent==="refresh",u=t.getBoundingClientRect(),f=a||this.mustMeasureContent||this.contentDOMHeight!=u.height;this.contentDOMHeight=u.height,this.mustMeasureContent=!1;let d=0,m=0;if(u.width&&u.height){let{scaleX:O,scaleY:z}=oR(t,u);(O>.005&&Math.abs(this.scaleX-O)>.005||z>.005&&Math.abs(this.scaleY-z)>.005)&&(this.scaleX=O,this.scaleY=z,d|=16,a=f=!0)}let p=(parseInt(i.paddingTop)||0)*this.scaleY,b=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=p||this.paddingBottom!=b)&&(this.paddingTop=p,this.paddingBottom=b,d|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(f=!0),this.editorWidth=e.scrollDOM.clientWidth,d|=16);let v=aR(this.view.contentDOM,!1).y;v!=this.scrollParent&&(this.scrollParent=v,this.scrollAnchorHeight=-1,this.scrollOffset=0);let S=this.getScrollOffset();this.scrollOffset!=S&&(this.scrollAnchorHeight=-1,this.scrollOffset=S),this.scrolledToBottom=uR(this.scrollParent||e.win);let w=(this.printing?xI:bI)(t,this.paddingTop),A=w.top-this.pixelViewport.top,C=w.bottom-this.pixelViewport.bottom;this.pixelViewport=w;let T=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(T!=this.inView&&(this.inView=T,T&&(f=!0)),!this.inView&&!this.scrollTarget&&!vI(e.dom))return 0;let R=u.width;if((this.contentDOMWidth!=R||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=u.width,this.editorHeight=e.scrollDOM.clientHeight,d|=16),f){let O=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(O)&&(a=!0),a||r.lineWrapping&&Math.abs(R-this.contentDOMWidth)>r.charWidth){let{lineHeight:z,charWidth:D,textHeight:j}=e.docView.measureTextSize();a=z>0&&r.refresh(o,z,D,j,Math.max(5,R/D),O),a&&(e.docView.minWidth=0,d|=16)}A>0&&C>0?m=Math.max(A,C):A<0&&C<0&&(m=Math.min(A,C)),_k();for(let z of this.viewports){let D=z.from==this.viewport.from?O:e.docView.measureVisibleLineHeights(z);this.heightMap=(a?ti.empty().applyChanges(this.stateDeco,wt.empty,this.heightOracle,[new Wi(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,a,new hI(z.from,D))}dc&&(d|=2)}let N=!this.viewportIsAppropriate(this.viewport,m)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return N&&(d&2&&(d|=this.updateScaler()),this.viewport=this.getViewport(m,this.scrollTarget),d|=this.updateForViewport()),(d&2||N)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(a?[]:this.lineGaps,e)),d|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),d}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,o=this.heightOracle,{visibleTop:a,visibleBottom:u}=this,f=new ud(r.lineAt(a-i*1e3,Ut.ByHeight,o,0,0).from,r.lineAt(u+(1-i)*1e3,Ut.ByHeight,o,0,0).to);if(t){let{head:d}=t.range;if(d<f.from||d>f.to){let m=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),p=r.lineAt(d,Ut.ByPos,o,0,0),b;t.y=="center"?b=(p.top+p.bottom)/2-m/2:t.y=="start"||t.y=="nearest"&&d<f.from?b=p.top:b=p.bottom-m,f=new ud(r.lineAt(b-1e3/2,Ut.ByHeight,o,0,0).from,r.lineAt(b+m+1e3/2,Ut.ByHeight,o,0,0).to)}}return f}mapViewport(e,t){let i=t.mapPos(e.from,-1),r=t.mapPos(e.to,1);return new ud(this.heightMap.lineAt(i,Ut.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(r,Ut.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},i=0){if(!this.inView)return!0;let{top:r}=this.heightMap.lineAt(e,Ut.ByPos,this.heightOracle,0,0),{bottom:o}=this.heightMap.lineAt(t,Ut.ByPos,this.heightOracle,0,0),{visibleTop:a,visibleBottom:u}=this;return(e==0||r<=a-Math.max(10,Math.min(-i,250)))&&(t==this.state.doc.length||o>=u+Math.max(10,Math.min(i,250)))&&r>a-2*1e3&&o<u+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let i=[];for(let r of e)t.touchesRange(r.from,r.to)||i.push(new j0(t.mapPos(r.from),t.mapPos(r.to),r.size,r.displaySize));return i}ensureLineGaps(e,t){let i=this.heightOracle.lineWrapping,r=i?1e4:2e3,o=r>>1,a=r<<1;if(this.defaultTextDirection!=fn.LTR&&!i)return[];let u=[],f=(m,p,b,v)=>{if(p-m<o)return;let S=this.state.selection.main,w=[S.from];S.empty||w.push(S.to);for(let C of w)if(C>m&&C<p){f(m,C-10,b,v),f(C+10,p,b,v);return}let A=kI(e,C=>C.from>=b.from&&C.to<=b.to&&Math.abs(C.from-m)<o&&Math.abs(C.to-p)<o&&!w.some(T=>C.from<T&&C.to>T));if(!A){if(p<b.to&&t&&i&&t.visibleRanges.some(R=>R.from<=p&&R.to>=p)){let R=t.moveToLineBoundary(ge.cursor(p),!1,!0).head;R>m&&(p=R)}let C=this.gapSize(b,m,p,v),T=i||C<2e6?C:2e6;A=new j0(m,p,C,T)}u.push(A)},d=m=>{if(m.length<a||m.type!=mi.Text)return;let p=wI(m.from,m.to,this.stateDeco);if(p.total<a)return;let b=this.scrollTarget?this.scrollTarget.range.head:null,v,S;if(i){let w=r/this.heightOracle.lineLength*this.heightOracle.lineHeight,A,C;if(b!=null){let T=hd(p,b),R=((this.visibleBottom-this.visibleTop)/2+w)/m.height;A=T-R,C=T+R}else A=(this.visibleTop-m.top-w)/m.height,C=(this.visibleBottom-m.top+w)/m.height;v=fd(p,A),S=fd(p,C)}else{let w=p.total*this.heightOracle.charWidth,A=r*this.heightOracle.charWidth,C=0;if(w>2e6)for(let z of e)z.from>=m.from&&z.from<m.to&&z.size!=z.displaySize&&z.from*this.heightOracle.charWidth+C<this.pixelViewport.left&&(C=z.size-z.displaySize);let T=this.pixelViewport.left+C,R=this.pixelViewport.right+C,N,O;if(b!=null){let z=hd(p,b),D=((R-T)/2+A)/w;N=z-D,O=z+D}else N=(T-A)/w,O=(R+A)/w;v=fd(p,N),S=fd(p,O)}v>m.from&&f(m.from,v,m,p),S<m.to&&f(S,m.to,m,p)};for(let m of this.viewportLines)Array.isArray(m.type)?m.type.forEach(d):d(m);return u}gapSize(e,t,i,r){let o=hd(r,i)-hd(r,t);return this.heightOracle.lineWrapping?e.height*o:r.total*this.heightOracle.charWidth*o}updateLineGaps(e){j0.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=_t.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];St.spans(t,this.viewport.from,this.viewport.to,{span(o,a){i.push({from:o,to:a})},point(){}},20);let r=0;if(i.length!=this.visibleRanges.length)r=12;else for(let o=0;o<i.length&&!(r&8);o++){let a=this.visibleRanges[o],u=i[o];(a.from!=u.from||a.to!=u.to)&&(r|=4,e&&e.mapPos(a.from,-1)==u.from&&e.mapPos(a.to,1)==u.to||(r|=8))}return this.visibleRanges=i,r}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||ju(this.heightMap.lineAt(e,Ut.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||ju(this.heightMap.lineAt(this.scaler.fromDOM(e),Ut.ByHeight,this.heightOracle,0,0),this.scaler)}getScrollOffset(){return(this.scrollParent==this.view.scrollDOM?this.scrollParent.scrollTop:(this.scrollParent?this.scrollParent.getBoundingClientRect().top:0)-this.view.contentDOM.getBoundingClientRect().top)*this.scaleY}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return ju(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class ud{constructor(e,t){this.from=e,this.to=t}}function wI(n,e,t){let i=[],r=n,o=0;return St.spans(t,n,e,{span(){},point(a,u){a>r&&(i.push({from:r,to:a}),o+=a-r),r=u}},20),r<e&&(i.push({from:r,to:e}),o+=e-r),{total:o,ranges:i}}function fd({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:o,to:a}=e[r],u=a-o;if(i<=u)return o+i;i-=u}}function hd(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function kI(n,e){for(let t of n)if(e(t))return t}const qk={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function Fk(n){let e=n.facet(Dm).filter(i=>typeof i!="function"),t=n.facet(Dv).filter(i=>typeof i!="function");return t.length&&e.push(St.join(t)),e}class Bv{constructor(e,t,i){let r=0,o=0,a=0;this.viewports=i.map(({from:u,to:f})=>{let d=t.lineAt(u,Ut.ByPos,e,0,0).top,m=t.lineAt(f,Ut.ByPos,e,0,0).bottom;return r+=m-d,{from:u,to:f,top:d,bottom:m,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let u of this.viewports)u.domTop=a+(u.top-o)*this.scale,a=u.domBottom=u.domTop+(u.bottom-u.top),o=u.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.top)return r+(e-i)*this.scale;if(e<=o.bottom)return o.domTop+(e-o.top);i=o.bottom,r=o.domBottom}}fromDOM(e){for(let t=0,i=0,r=0;;t++){let o=t<this.viewports.length?this.viewports[t]:null;if(!o||e<o.domTop)return i+(e-r)/this.scale;if(e<=o.domBottom)return o.top+(e-o.domTop);i=o.bottom,r=o.domBottom}}eq(e){return e instanceof Bv?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,i)=>t.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function ju(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),i=e.toDOM(n.bottom);return new ls(n.from,n.length,t,i-t,Array.isArray(n._content)?n._content.map(r=>ju(r,e)):n._content)}const dd=Ve.define({combine:n=>n.join(" ")}),rb=Ve.define({combine:n=>n.indexOf(!0)>-1}),lb=wl.newName(),YR=wl.newName(),QR=wl.newName(),WR={"&light":"."+YR,"&dark":"."+QR};function ob(n,e,t){return new wl(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const CI=ob("."+lb,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{userSelect:"none",position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-selectionHandle":{backgroundColor:"currentColor",width:"1.5px"},".cm-selectionHandle-start::before, .cm-selectionHandle-end::before":{content:'""',backgroundColor:"inherit",borderRadius:"50%",width:"8px",height:"8px",position:"absolute",left:"-3.25px"},".cm-selectionHandle-start::before":{top:"-8px"},".cm-selectionHandle-end::before":{bottom:"-8px"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},WR),EI={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},L0=Oe.ie&&Oe.ie_version<=11;class AI{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new J6,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(Oe.ie&&Oe.ie_version<=11||Oe.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Oe.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Oe.chrome&&Oe.chrome_version<126)&&(this.editContext=new RI(e),e.state.facet(yr)&&(e.contentDOM.editContext=this.editContext.editContext)),L0&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,i)=>t!=e[i]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,r=this.selectionRange;if(i.state.facet(yr)?i.root.activeElement!=this.dom:!Iu(this.dom,r))return;let o=r.anchorNode&&i.docView.tile.nearest(r.anchorNode);if(o&&o.isWidget()&&o.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Oe.ie&&Oe.ie_version<=11||Oe.android&&Oe.chrome)&&!i.state.selection.main.empty&&r.focusNode&&_u(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=Ju(e.root);if(!t)return!1;let i=Oe.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&TI(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let r=Iu(this.dom,i);return r&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&tP(this.dom,i)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(i),r&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let i=this.dom;i;)if(i.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==i?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=t)i.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,EI),L0&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),L0&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var i;if(!this.delayedAndroidKey){let r=()=>{let o=this.delayedAndroidKey;o&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=o.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&o.force&&Va(this.dom,o.key,o.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,i=-1,r=!1;for(let o of e){let a=this.readMutation(o);a&&(a.typeOver&&(r=!0),t==-1?{from:t,to:i}=a:(t=Math.min(a.from,t),i=Math.max(a.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&Iu(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let o=new FP(this.view,e,t,i);return this.view.docView.domChanged={newSel:o.newSel?o.newSel.main:null},o}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let i=this.view.state,r=zR(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!sm(this.view.state.selection,t.newSel.main))&&this.view.update([]),r}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let i=Gk(t,e.previousSibling||e.target.previousSibling,-1),r=Gk(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(yr)!=e.state.facet(yr)&&(e.view.contentDOM.editContext=e.state.facet(yr)?this.editContext.editContext:null))}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function Gk(n,e,t){for(;e;){let i=nn.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function Kk(n,e){let t=e.startContainer,i=e.startOffset,r=e.endContainer,o=e.endOffset,a=n.docView.domAtPos(n.state.selection.main.anchor,1);return _u(a.node,a.offset,r,o)&&([t,i,r,o]=[r,o,t,i]),{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:o}}function TI(n,e){if(e.getComposedRanges){let r=e.getComposedRanges(n.root)[0];if(r)return Kk(n,r)}let t=null;function i(r){r.preventDefault(),r.stopImmediatePropagation(),t=r.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",i,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",i,!0),t?Kk(n,t):null}class RI{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=i=>{let r=e.state.selection.main,{anchor:o,head:a}=r,u=this.toEditorPos(i.updateRangeStart),f=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:u,drifted:!1});let d=f-u>i.text.length;u==this.from&&o<this.from?u=o:f==this.to&&o>this.to&&(f=o);let m=PR(e.state.sliceDoc(u,f),i.text,(d?r.from:r.to)-u,d?"end":null);if(!m){let b=ge.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));sm(b,r)||e.dispatch({selection:b,userEvent:"select"});return}let p={from:m.from+u,to:m.toA+u,insert:wt.of(i.text.slice(m.from,m.toB).split(`
|
|
243
|
+
`))};if((Oe.mac||Oe.android)&&p.from==a-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(p={from:u,to:f,insert:wt.of([i.text.replace("."," ")])}),this.pendingContextChange=p,!e.state.readOnly){let b=this.to-this.from+(p.to-p.from+p.insert.length);jv(e,p,ge.single(this.toEditorPos(i.selectionStart,b),this.toEditorPos(i.selectionEnd,b)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),p.from<p.to&&!p.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,i.updateRangeStart-1),Math.min(t.text.length,i.updateRangeStart+1)))&&this.handlers.compositionend(i)},this.handlers.characterboundsupdate=i=>{let r=[],o=null;for(let a=this.toEditorPos(i.rangeStart),u=this.toEditorPos(i.rangeEnd);a<u;a++){let f=e.coordsForChar(a);o=f&&new DOMRect(f.left,f.top,f.right-f.left,f.bottom-f.top)||o||new DOMRect,r.push(o)}t.updateCharacterBounds(i.rangeStart,r)},this.handlers.textformatupdate=i=>{let r=[];for(let o of i.getTextFormats()){let a=o.underlineStyle,u=o.underlineThickness;if(!/none/i.test(a)&&!/none/i.test(u)){let f=this.toEditorPos(o.rangeStart),d=this.toEditorPos(o.rangeEnd);if(f<d){let m=`text-decoration: underline ${/^[a-z]/.test(a)?a+" ":a=="Dashed"?"dashed ":a=="Squiggle"?"wavy ":""}${/thin/i.test(u)?1:2}px`;r.push(_t.mark({attributes:{style:m}}).range(f,d))}}}e.dispatch({effects:AR.of(_t.set(r))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{let r=Ju(i.root);r&&r.rangeCount&&this.editContext.updateSelectionBounds(r.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,r=this.pendingContextChange;return e.changes.iterChanges((o,a,u,f,d)=>{if(i)return;let m=d.length-(a-o);if(r&&a>=r.to)if(r.from==o&&r.to==a&&r.insert.eq(d)){r=this.pendingContextChange=null,t+=m,this.to+=m;return}else r=null,this.revertPending(e.state);if(o+=t,a+=t,a<=this.from)this.from+=m,this.to+=m;else if(o<this.to){if(o<this.from||a>this.to||this.to-this.from+d.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(o),this.toContextPos(a),d.toString()),this.to+=m}t+=m}),r&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange,i=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(i.from,i.to)&&e.transactions.some(r=>!r.isUserEvent("input.type")&&r.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),r=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=r)&&this.editContext.updateSelection(i,r)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Ye{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:i}=e;this.dispatchTransactions=e.dispatchTransactions||i&&(r=>r.forEach(o=>i(o,this)))||(r=>this.update(r)),this.dispatch=this.dispatch.bind(this),this._root=e.root||eP(e.parent)||document,this.viewState=new Vk(this,e.state||xt.create(e)),e.scrollTo&&e.scrollTo.is(od)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Oa).map(r=>new R0(r));for(let r of this.plugins)r.update(this);this.observer=new AI(this),this.inputState=new QP(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Mk(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent="refresh",this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof Tn?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,i=!1,r,o=this.state;for(let b of e){if(b.startState!=o)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");o=b.state}if(this.destroyed){this.viewState.state=o;return}let a=this.hasFocus,u=0,f=null;e.some(b=>b.annotation(qR))?(this.inputState.notifiedFocused=a,u=1):a!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=a,f=FR(o,a),f||(u=1));let d=this.observer.delayedAndroidKey,m=null;if(d?(this.observer.clearDelayedAndroidKey(),m=this.observer.readChange(),(m&&!this.state.doc.eq(o.doc)||!this.state.selection.eq(o.selection))&&(m=null)):this.observer.clear(),o.facet(xt.phrases)!=this.state.facet(xt.phrases))return this.setState(o);r=tm.create(this,o,e),r.flags|=u;let p=this.viewState.scrollTarget;try{this.updateState=2;for(let b of e){if(p&&(p=p.map(b.changes)),b.scrollIntoView){let{main:v}=b.state.selection,{x:S,y:w}=this.state.facet(Ye.cursorScrollMargin);p=new qa(v.empty?v:ge.cursor(v.head,v.head>v.anchor?-1:1),"nearest","nearest",w,S)}for(let v of b.effects)v.is(od)&&(p=v.value.clip(this.state))}this.viewState.update(r,p),this.bidiCache=lm.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Du)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(b=>b.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(dd)!=r.state.facet(dd)&&(this.viewState.mustMeasureContent=!0),(t||i||p||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!r.empty)for(let b of this.state.facet(tb))try{b(r)}catch(v){Ls(this.state,v,"update listener")}(f||m)&&Promise.resolve().then(()=>{f&&this.state==f.startState&&this.dispatch(f),m&&!zR(this,m)&&d.force&&Va(this.contentDOM,d.key,d.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new Vk(this,e),this.plugins=e.facet(Oa).map(i=>new R0(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Mk(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Oa),i=e.state.facet(Oa);if(t!=i){let r=[];for(let o of i){let a=t.indexOf(o);if(a<0)r.push(new R0(o));else{let u=this.plugins[a];u.mustUpdate=e,r.push(u)}}for(let o of this.plugins)o.mustUpdate!=e&&o.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r<this.plugins.length;r++)this.plugins[r].update(this);t!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(i){Ls(this.state,i,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,i=this.viewState.scrollParent,r=this.viewState.getScrollOffset(),{scrollAnchorPos:o,scrollAnchorHeight:a}=this.viewState;Math.abs(r-this.viewState.scrollOffset)>1&&(a=-1),this.viewState.scrollAnchorHeight=-1;try{for(let u=0;;u++){if(a<0)if(uR(i||this.win))o=-1,a=this.viewState.heightMap.height;else{let v=this.viewState.scrollAnchorAt(r);o=v.from,a=v.top}this.updateState=1;let f=this.viewState.measure();if(!f&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(u>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let d=[];f&4||([this.measureRequests,d]=[d,this.measureRequests]);let m=d.map(v=>{try{return v.read(this)}catch(S){return Ls(this.state,S),Yk}}),p=tm.create(this,this.state,[]),b=!1;p.flags|=f,t?t.flags|=f:t=p,this.updateState=2,p.empty||(this.updatePlugins(p),this.inputState.update(p),this.updateAttrs(),b=this.docView.update(p),b&&this.docViewUpdate());for(let v=0;v<d.length;v++)if(m[v]!=Yk)try{let S=d[v];S.write&&S.write(m[v],this)}catch(S){Ls(this.state,S)}if(b&&this.docView.updateSelection(!0),!p.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,a=-1;continue}else{let S=((o<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(o).top)-a)/this.scaleY;if((S>1||S<-1)&&!(Oe.ios&&this.inputState.lastIOSMomentumScroll>Date.now()-100)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){r=r+S,i?i.scrollTop+=S:this.win.scrollBy(0,S),a=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let u of this.state.facet(tb))u(t)}get themeClasses(){return lb+" "+(this.state.facet(rb)?QR:YR)+" "+this.state.facet(dd)}updateAttrs(){let e=Qk(this,TR,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(yr)?"true":"false",class:"cm-content",style:`${Oe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Qk(this,Nv,t);let i=this.observer.ignore(()=>{let r=kk(this.contentDOM,this.contentAttrs,t),o=kk(this.dom,this.editorAttrs,e);return r||o});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(Ye.announce)){t&&(this.announceDOM.textContent=""),t=!1;let o=this.announceDOM.appendChild(document.createElement("div"));o.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Du);let e=this.state.facet(Ye.cspNonce);wl.mount(this.root,this.styleModules.concat(CI).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(i=>i.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,i){return D0(this,e,Ok(this,e,t,i))}moveByGroup(e,t){return D0(this,e,Ok(this,e,t,i=>IP(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),r=this.textDirectionAt(e.from),o=i[t?i.length-1:0];return ge.cursor(o.side(t,r)+e.from,o.forward(!t,r)?1:-1)}moveToLineBoundary(e,t,i=!0){return PP(this,e,t,i)}moveVertically(e,t,i){return D0(this,e,HP(this,e,t,i))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let i=ib(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),ib(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.state.doc.lineAt(e),r=this.bidiSpans(i),o=r[js.find(r,e-i.from,-1,t)];return this.docView.coordsAt(e,t,o.dir==fn.RTL)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(CR)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>MI)return gR(e.length);let t=this.textDirectionAt(e.from),i;for(let o of this.bidiCache)if(o.from==e.from&&o.dir==t&&(o.fresh||pR(o.isolates,i=Ak(this,e))))return o.order;i||(i=Ak(this,e));let r=aP(e.text,t,i);return this.bidiCache.push(new lm(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Oe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{cR(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){var i,r,o,a;return od.of(new qa(typeof e=="number"?ge.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(r=t.x)!==null&&r!==void 0?r:"nearest",(o=t.yMargin)!==null&&o!==void 0?o:5,(a=t.xMargin)!==null&&a!==void 0?a:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return od.of(new qa(ge.cursor(i.from),"start","start",i.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return fs.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return fs.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=wl.newName(),r=[dd.of(i),Du.of(ob(`.${i}`,e))];return t&&t.dark&&r.push(rb.of(!0)),r}static baseTheme(e){return wv.lowest(Du.of(ob("."+lb,e,WR)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&nn.get(i)||nn.get(e);return((t=r==null?void 0:r.root)===null||t===void 0?void 0:t.view)||null}}Ye.styleModule=Du;Ye.inputHandler=wR;Ye.clipboardInputFilter=Mv;Ye.clipboardOutputFilter=Ov;Ye.scrollHandler=ER;Ye.focusChangeEffect=kR;Ye.perLineTextDirection=CR;Ye.exceptionSink=SR;Ye.updateListener=tb;Ye.editable=yr;Ye.mouseSelectionStyle=xR;Ye.dragMovesSelection=vR;Ye.clickAddsSelectionRange=bR;Ye.decorations=Dm;Ye.blockWrappers=RR;Ye.outerDecorations=Dv;Ye.atomicRanges=Cf;Ye.bidiIsolatedRanges=MR;Ye.cursorScrollMargin=Ve.define({combine:n=>{let e=5,t=5;for(let i of n)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});Ye.scrollMargins=OR;Ye.darkTheme=rb;Ye.cspNonce=Ve.define({combine:n=>n.length?n[0]:""});Ye.contentAttributes=Nv;Ye.editorAttributes=TR;Ye.lineWrapping=Ye.contentAttributes.of({class:"cm-lineWrapping"});Ye.announce=un.define();const MI=4096,Yk={};class lm{constructor(e,t,i,r,o,a){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=o,this.order=a}static update(e,t){if(t.empty&&!e.some(o=>o.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:fn.LTR;for(let o=Math.max(0,e.length-10);o<e.length;o++){let a=e[o];a.dir==r&&!t.touchesRange(a.from,a.to)&&i.push(new lm(t.mapPos(a.from,1),t.mapPos(a.to,-1),a.dir,a.isolates,!1,a.order))}return i}}function Qk(n,e,t){for(let i=n.state.facet(e),r=i.length-1;r>=0;r--){let o=i[r],a=typeof o=="function"?o(n):o;a&&Av(a,t)}return t}const OI=Oe.mac?"mac":Oe.windows?"win":Oe.linux?"linux":"key";function NI(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,o,a,u;for(let f=0;f<t.length-1;++f){const d=t[f];if(/^(cmd|meta|m)$/i.test(d))u=!0;else if(/^a(lt)?$/i.test(d))r=!0;else if(/^(c|ctrl|control)$/i.test(d))o=!0;else if(/^s(hift)?$/i.test(d))a=!0;else if(/^mod$/i.test(d))e=="mac"?u=!0:o=!0;else throw new Error("Unrecognized modifier name: "+d)}return r&&(i="Alt-"+i),o&&(i="Ctrl-"+i),u&&(i="Meta-"+i),a&&(i="Shift-"+i),i}function md(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const DI=wv.default(Ye.domEventHandlers({keydown(n,e){return zI(jI(e.state),n,e,"editor")}})),XR=Ve.define({enables:DI}),Wk=new WeakMap;function jI(n){let e=n.facet(XR),t=Wk.get(e);return t||Wk.set(e,t=BI(e.reduce((i,r)=>i.concat(r),[]))),t}let tl=null;const LI=4e3;function BI(n,e=OI){let t=Object.create(null),i=Object.create(null),r=(a,u)=>{let f=i[a];if(f==null)i[a]=u;else if(f!=u)throw new Error("Key binding "+a+" is used both as a regular binding and as a multi-stroke prefix")},o=(a,u,f,d,m)=>{var p,b;let v=t[a]||(t[a]=Object.create(null)),S=u.split(/ (?!$)/).map(C=>NI(C,e));for(let C=1;C<S.length;C++){let T=S.slice(0,C).join(" ");r(T,!0),v[T]||(v[T]={preventDefault:!0,stopPropagation:!1,run:[R=>{let N=tl={view:R,prefix:T,scope:a};return setTimeout(()=>{tl==N&&(tl=null)},LI),!0}]})}let w=S.join(" ");r(w,!1);let A=v[w]||(v[w]={preventDefault:!1,stopPropagation:!1,run:((b=(p=v._any)===null||p===void 0?void 0:p.run)===null||b===void 0?void 0:b.slice())||[]});f&&A.run.push(f),d&&(A.preventDefault=!0),m&&(A.stopPropagation=!0)};for(let a of n){let u=a.scope?a.scope.split(" "):["editor"];if(a.any)for(let d of u){let m=t[d]||(t[d]=Object.create(null));m._any||(m._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:p}=a;for(let b in m)m[b].run.push(v=>p(v,ab))}let f=a[e]||a.key;if(f)for(let d of u)o(d,f,a.run,a.preventDefault,a.stopPropagation),a.shift&&o(d,"Shift-"+f,a.shift,a.preventDefault,a.stopPropagation)}return t}let ab=null;function zI(n,e,t,i){ab=e;let r=Y6(e),o=M6(r,0),a=O6(o)==r.length&&r!=" ",u="",f=!1,d=!1,m=!1;tl&&tl.view==t&&tl.scope==i&&(u=tl.prefix+" ",HR.indexOf(e.keyCode)<0&&(d=!0,tl=null));let p=new Set,b=A=>{if(A){for(let C of A.run)if(!p.has(C)&&(p.add(C),C(t)))return A.stopPropagation&&(m=!0),!0;A.preventDefault&&(A.stopPropagation&&(m=!0),d=!0)}return!1},v=n[i],S,w;return v&&(b(v[u+md(r,e,!a)])?f=!0:a&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Oe.windows&&e.ctrlKey&&e.altKey)&&!(Oe.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(S=kl[e.keyCode])&&S!=r?(b(v[u+md(S,e,!0)])||e.shiftKey&&(w=$u[e.keyCode])!=r&&w!=S&&b(v[u+md(w,e,!1)]))&&(f=!0):a&&e.shiftKey&&b(v[u+md(r,e,!0)])&&(f=!0),!f&&b(v._any)&&(f=!0)),d&&(f=!0),f&&m&&e.stopPropagation(),ab=null,f}function PI(){return HI}const II=_t.line({class:"cm-activeLine"}),HI=fs.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(II.range(r.from)),e=r.from)}return _t.set(t)}},{decorations:n=>n.decorations});class _I extends Sf{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Hu(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),r=ef(t[0],i.direction!="rtl"),o=parseInt(i.lineHeight);return r.bottom-r.top>o*1.5?{left:r.left,right:r.right,top:r.top,bottom:r.top+o}:r}ignoreEvent(){return!1}}function UI(n){let e=fs.fromClass(class{constructor(t){this.view=t,this.placeholder=n?_t.set([_t.widget({widget:new _I(n),side:1}).range(0)]):_t.none}get decorations(){return this.view.state.doc.length?_t.none:this.placeholder}},{decorations:t=>t.decorations});return typeof n=="string"?[e,Ye.contentAttributes.of({"aria-placeholder":n})]:e}class jo extends Mo{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}jo.prototype.elementClass="";jo.prototype.toDOM=void 0;jo.prototype.mapMode=Di.TrackBefore;jo.prototype.startSide=jo.prototype.endSide=-1;jo.prototype.point=!0;const B0=Ve.define(),VI=Ve.define(),Od=Ve.define(),Xk=Ve.define({combine:n=>n.some(e=>e)});function qI(n){return[FI]}const FI=fs.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(Od).map(e=>new Zk(n,e)),this.fixed=!n.state.facet(Xk);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Xk)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=St.iter(this.view.state.facet(B0),this.view.viewport.from),i=[],r=this.gutters.map(o=>new GI(o,this.view.viewport,-this.view.documentPadding.top));for(let o of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(o.type)){let a=!0;for(let u of o.type)if(u.type==mi.Text&&a){cb(t,i,u.from);for(let f of r)f.line(this.view,u,i);a=!1}else if(u.widget)for(let f of r)f.widget(this.view,u)}else if(o.type==mi.Text){cb(t,i,o.from);for(let a of r)a.line(this.view,o,i)}else if(o.widget)for(let a of r)a.widget(this.view,o);for(let o of r)o.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(Od),t=n.state.facet(Od),i=n.docChanged||n.heightChanged||n.viewportChanged||!St.eq(n.startState.facet(B0),n.state.facet(B0),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let o of t){let a=e.indexOf(o);a<0?r.push(new Zk(this.view,o)):(this.gutters[a].update(n),r.push(this.gutters[a]))}for(let o of this.gutters)o.dom.remove(),r.indexOf(o)<0&&o.destroy();for(let o of r)o.config.side=="after"?this.getDOMAfter().appendChild(o.dom):this.dom.appendChild(o.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>Ye.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,r=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==fn.LTR?{left:i,right:r}:{right:i,left:r}})});function $k(n){return Array.isArray(n)?n:[n]}function cb(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class GI{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=St.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,o=(t.top-this.height)/e.scaleY,a=t.height/e.scaleY;if(this.i==r.elements.length){let u=new $R(e,a,o,i);r.elements.push(u),r.dom.appendChild(u.dom)}else r.elements[this.i].update(e,a,o,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];cb(this.cursor,r,t.from),i.length&&(r=r.concat(i));let o=this.gutter.config.lineMarker(e,t,r);o&&r.unshift(o);let a=this.gutter;r.length==0&&!a.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),r=i?[i]:null;for(let o of e.state.facet(VI)){let a=o(e,t.widget,t);a&&(r||(r=[])).push(a)}r&&this.addElement(e,t,r)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Zk{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let o=r.target,a;if(o!=this.dom&&this.dom.contains(o)){for(;o.parentNode!=this.dom;)o=o.parentNode;let f=o.getBoundingClientRect();a=(f.top+f.bottom)/2}else a=r.clientY;let u=e.lineBlockAtHeight(a-e.documentTop);t.domEventHandlers[i](e,u,r)&&r.preventDefault()});this.markers=$k(t.markers(e)),t.initialSpacer&&(this.spacer=new $R(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=$k(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!St.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class $R{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),KI(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let o=0,a=0;;){let u=a,f=o<t.length?t[o++]:null,d=!1;if(f){let m=f.elementClass;m&&(i+=" "+m);for(let p=a;p<this.markers.length;p++)if(this.markers[p].compare(f)){u=p,d=!0;break}}else u=this.markers.length;for(;a<u;){let m=this.markers[a++];if(m.toDOM){m.destroy(r);let p=r.nextSibling;r.remove(),r=p}}if(!f)break;f.toDOM&&(d?r=r.nextSibling:this.dom.insertBefore(f.toDOM(e),r)),d&&a++}this.dom.className=i,this.markers=t}destroy(){this.setMarkers(null,[])}}function KI(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const YI=Ve.define(),QI=Ve.define(),Na=Ve.define({combine(n){return kv(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let i=Object.assign({},e);for(let r in t){let o=i[r],a=t[r];i[r]=o?(u,f,d)=>o(u,f,d)||a(u,f,d):a}return i}})}});class z0 extends jo{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function P0(n,e){return n.state.facet(Na).formatNumber(e,n.state)}const WI=Od.compute([Na],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(YI)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new z0(P0(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let r of e.state.facet(QI)){let o=r(e,t,i);if(o)return o}return null},lineMarkerChange:e=>e.startState.facet(Na)!=e.state.facet(Na),initialSpacer(e){return new z0(P0(e,Jk(e.state.doc.lines)))},updateSpacer(e,t){let i=P0(t.view,Jk(t.view.state.doc.lines));return i==e.number?e:new z0(i)},domEventHandlers:n.facet(Na).domEventHandlers,side:"before"}));function XI(n={}){return[Na.of(n),qI(),WI]}function Jk(n){let e=9;for(;e<n;)e=e*10+9;return e}const ZR=1024;let $I=0;class I0{constructor(e,t){this.from=e,this.to=t}}class at{constructor(e={}){this.id=$I++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=gi.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}at.closedBy=new at({deserialize:n=>n.split(" ")});at.openedBy=new at({deserialize:n=>n.split(" ")});at.group=new at({deserialize:n=>n.split(" ")});at.isolate=new at({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});at.contextHash=new at({perNode:!0});at.lookAhead=new at({perNode:!0});at.mounted=new at({perNode:!0});class Vu{constructor(e,t,i,r=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=r}static get(e){return e&&e.props&&e.props[at.mounted.id]}}const ZI=Object.create(null);class gi{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):ZI,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new gi(e.name||"",t,e.id,i);if(e.props){for(let o of e.props)if(Array.isArray(o)||(o=o(r)),o){if(o[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[o[0].id]=o[1]}}return r}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(at.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(at.group),o=-1;o<(r?r.length:0);o++){let a=t[o<0?i.name:r[o]];if(a)return a}}}}gi.none=new gi("",Object.create(null),0,8);class zv{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let i of this.types){let r=null;for(let o of e){let a=o(i);if(a){r||(r=Object.assign({},i.props));let u=a[1],f=a[0];f.combine&&f.id in r&&(u=f.combine(r[f.id],u)),r[f.id]=u}}t.push(r?new gi(i.name,r,i.id,i.flags):i)}return new zv(t)}}const pd=new WeakMap,eC=new WeakMap;var tn;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(tn||(tn={}));class hn{constructor(e,t,i,r,o){if(this.type=e,this.children=t,this.positions=i,this.length=r,this.props=null,o&&o.length){this.props=Object.create(null);for(let[a,u]of o)this.props[typeof a=="number"?a:a.id]=u}}toString(){let e=Vu.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let i of this.children){let r=i.toString();r&&(t&&(t+=","),t+=r)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new fb(this.topNode,e)}cursorAt(e,t=0,i=0){let r=pd.get(this)||this.topNode,o=new fb(r);return o.moveTo(e,t),pd.set(this,o._tree),o}get topNode(){return new $i(this,0,0,null)}resolve(e,t=0){let i=nf(pd.get(this)||this.topNode,e,t,!1);return pd.set(this,i),i}resolveInner(e,t=0){let i=nf(eC.get(this)||this.topNode,e,t,!0);return eC.set(this,i),i}resolveStack(e,t=0){return tH(this,e,t)}iterate(e){let{enter:t,leave:i,from:r=0,to:o=this.length}=e,a=e.mode||0,u=(a&tn.IncludeAnonymous)>0;for(let f=this.cursor(a|tn.IncludeAnonymous);;){let d=!1;if(f.from<=o&&f.to>=r&&(!u&&f.type.isAnonymous||t(f)!==!1)){if(f.firstChild())continue;d=!0}for(;d&&i&&(u||!f.type.isAnonymous)&&i(f),!f.nextSibling();){if(!f.parent())return;d=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Hv(gi.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new hn(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new hn(gi.none,t,i,r)))}static build(e){return nH(e)}}hn.empty=new hn(gi.none,[],[],0);class Pv{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Pv(this.buffer,this.index)}}class El{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return gi.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],i=this.buffer[e+3],r=this.set.types[t],o=r.name;if(/\W/.test(o)&&!r.isError&&(o=JSON.stringify(o)),e+=4,i==e)return o;let a=[];for(;e<i;)a.push(this.childString(e)),e=this.buffer[e+3];return o+"("+a.join(",")+")"}findChild(e,t,i,r,o){let{buffer:a}=this,u=-1;for(let f=e;f!=t&&!(JR(o,r,a[f+1],a[f+2])&&(u=f,i>0));f=a[f+3]);return u}slice(e,t,i){let r=this.buffer,o=new Uint16Array(t-e),a=0;for(let u=e,f=0;u<t;){o[f++]=r[u++],o[f++]=r[u++]-i;let d=o[f++]=r[u++]-i;o[f++]=r[u++]-e,a=Math.max(a,d)}return new El(o,a,this.set)}}function JR(n,e,t,i){switch(n){case-2:return t<e;case-1:return i>=e&&t<e;case 0:return t<e&&i>e;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function nf(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let a=!i&&n instanceof $i&&n.index<0?null:n.parent;if(!a)return n;n=a}let o=i?0:tn.IgnoreOverlays;if(i)for(let a=n,u=a.parent;u;a=u,u=a.parent)a instanceof $i&&a.index<0&&((r=u.enter(e,t,o))===null||r===void 0?void 0:r.from)!=a.from&&(n=u);for(;;){let a=n.enter(e,t,o);if(!a)return n;n=a}}class eM{cursor(e=0){return new fb(this,e)}getChild(e,t=null,i=null){let r=tC(this,e,t,i);return r.length?r[0]:null}getChildren(e,t=null,i=null){return tC(this,e,t,i)}resolve(e,t=0){return nf(this,e,t,!1)}resolveInner(e,t=0){return nf(this,e,t,!0)}matchContext(e){return ub(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),i=this;for(;t;){let r=t.lastChild;if(!r||r.to!=t.to)break;r.type.isError&&r.from==r.to?(i=t,t=r.prevSibling):t=r}return i}get node(){return this}get next(){return this.parent}}class $i extends eM{constructor(e,t,i,r){super(),this._tree=e,this.from=t,this.index=i,this._parent=r}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,i,r,o=0){for(let a=this;;){for(let{children:u,positions:f}=a._tree,d=t>0?u.length:-1;e!=d;e+=t){let m=u[e],p=f[e]+a.from,b;if(!(!(o&tn.EnterBracketed&&m instanceof hn&&(b=Vu.get(m))&&!b.overlay&&b.bracketed&&i>=p&&i<=p+m.length)&&!JR(r,i,p,p+m.length))){if(m instanceof El){if(o&tn.ExcludeBuffers)continue;let v=m.findChild(0,m.buffer.length,t,i-p,r);if(v>-1)return new dl(new JI(a,m,e,p),null,v)}else if(o&tn.IncludeAnonymous||!m.type.isAnonymous||Iv(m)){let v;if(!(o&tn.IgnoreMounts)&&(v=Vu.get(m))&&!v.overlay)return new $i(v.tree,p,e,a);let S=new $i(m,p,e,a);return o&tn.IncludeAnonymous||!S.type.isAnonymous?S:S.nextChild(t<0?m.children.length-1:0,t,i,r,o)}}}if(o&tn.IncludeAnonymous||!a.type.isAnonymous||(a.index>=0?e=a.index+t:e=t<0?-1:a._parent._tree.children.length,a=a._parent,!a))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,i=0){let r;if(!(i&tn.IgnoreOverlays)&&(r=Vu.get(this._tree))&&r.overlay){let o=e-this.from,a=i&tn.EnterBracketed&&r.bracketed;for(let{from:u,to:f}of r.overlay)if((t>0||a?u<=o:u<o)&&(t<0||a?f>=o:f>o))return new $i(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function tC(n,e,t,i){let r=n.cursor(),o=[];if(!r.firstChild())return o;if(t!=null){for(let a=!1;!a;)if(a=r.type.is(t),!r.nextSibling())return o}for(;;){if(i!=null&&r.type.is(i))return o;if(r.type.is(e)&&o.push(r.node),!r.nextSibling())return i==null?o:[]}}function ub(n,e,t=e.length-1){for(let i=n;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class JI{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class dl extends eM{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return o<0?null:new dl(this.context,this,o)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,i=0){if(i&tn.ExcludeBuffers)return null;let{buffer:r}=this.context,o=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return o<0?null:new dl(this.context,this,o)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new dl(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new dl(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,o=i.buffer[this.index+3];if(o>r){let a=i.buffer[this.index+1];e.push(i.slice(r,o,a)),t.push(0)}return new hn(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function tM(n){if(!n.length)return null;let e=0,t=n[0];for(let o=1;o<n.length;o++){let a=n[o];(a.from>t.from||a.to<t.to)&&(t=a,e=o)}let i=t instanceof $i&&t.index<0?null:t.parent,r=n.slice();return i?r[e]=i:r.splice(e,1),new eH(r,t)}class eH{constructor(e,t){this.heads=e,this.node=t}get next(){return tM(this.heads)}}function tH(n,e,t){let i=n.resolveInner(e,t),r=null;for(let o=i instanceof $i?i:i.context.parent;o;o=o.parent)if(o.index<0){let a=o.parent;(r||(r=[i])).push(a.resolve(e,t)),o=a}else{let a=Vu.get(o.tree);if(a&&a.overlay&&a.overlay[0].from<=e&&a.overlay[a.overlay.length-1].to>=e){let u=new $i(a.tree,a.overlay[0].from+o.from,-1,o);(r||(r=[i])).push(nf(u,e,t,!1))}}return r?tM(r):i}class fb{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~tn.EnterBracketed,e instanceof $i)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof $i?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,o=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);return o<0?!1:(this.stack.push(this.index),this.yieldBuf(o))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,i=this.mode){return this.buffer?i&tn.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&tn.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&tn.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,i,{buffer:r}=this;if(r){if(e>0){if(this.index<r.buffer.buffer.length)return!1}else for(let o=0;o<this.index;o++)if(r.buffer.buffer[o+3]<this.index)return!1;({index:t,parent:i}=r)}else({index:t,_parent:i}=this._tree);for(;i;{index:t,_parent:i}=i)if(t>-1)for(let o=t+e,a=e<0?-1:i._tree.children.length;o!=a;o+=e){let u=i._tree.children[o];if(this.mode&tn.IncludeAnonymous||u instanceof El||!u.type.isAnonymous||Iv(u))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,i=0;if(e&&e.context==this.buffer)e:for(let r=this.index,o=this.stack.length;o>=0;){for(let a=e;a;a=a._parent)if(a.index==r){if(r==this.index)return a;t=a,i=o+1;break e}r=this.stack[--o]}for(let r=i;r<this.stack.length;r++)t=new dl(this.buffer,t,this.stack[r]);return this.bufferNode=new dl(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let i=0;;){let r=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(r=!0)}for(;;){if(r&&t&&t(this),r=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,r=!0}}}matchContext(e){if(!this.buffer)return ub(this.node.parent,e);let{buffer:t}=this.buffer,{types:i}=t.set;for(let r=e.length-1,o=this.stack.length-1;r>=0;o--){if(o<0)return ub(this._tree,e,r);let a=i[t.buffer[this.stack[o]]];if(!a.isAnonymous){if(e[r]&&e[r]!=a.name)return!1;r--}}return!0}}function Iv(n){return n.children.some(e=>e instanceof El||!e.type.isAnonymous||Iv(e))}function nH(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=ZR,reused:o=[],minRepeatType:a=i.types.length}=n,u=Array.isArray(t)?new Pv(t,t.length):t,f=i.types,d=0,m=0;function p(O,z,D,j,B,K){let{id:F,start:Y,end:V,size:Z}=u,q=m,P=d;if(Z<0)if(u.next(),Z==-1){let L=o[F];D.push(L),j.push(Y-O);return}else if(Z==-3){d=F;return}else if(Z==-4){m=F;return}else throw new RangeError(`Unrecognized record size: ${Z}`);let W=f[F],U,$,Q=Y-O;if(V-Y<=r&&($=A(u.pos-z,B))){let L=new Uint16Array($.size-$.skip),_=u.pos-$.size,J=L.length;for(;u.pos>_;)J=C($.start,L,J);U=new El(L,V-$.start,i),Q=$.start-O}else{let L=u.pos-Z;u.next();let _=[],J=[],le=F>=a?F:-1,ae=0,ee=V;for(;u.pos>L;)le>=0&&u.id==le&&u.size>=0?(u.end<=ee-r&&(S(_,J,Y,ae,u.end,ee,le,q,P),ae=_.length,ee=u.end),u.next()):K>2500?b(Y,L,_,J):p(Y,L,_,J,le,K+1);if(le>=0&&ae>0&&ae<_.length&&S(_,J,Y,ae,Y,ee,le,q,P),_.reverse(),J.reverse(),le>-1&&ae>0){let se=v(W,P);U=Hv(W,_,J,0,_.length,0,V-Y,se,se)}else U=w(W,_,J,V-Y,q-V,P)}D.push(U),j.push(Q)}function b(O,z,D,j){let B=[],K=0,F=-1;for(;u.pos>z;){let{id:Y,start:V,end:Z,size:q}=u;if(q>4)u.next();else{if(F>-1&&V<F)break;F<0&&(F=Z-r),B.push(Y,V,Z),K++,u.next()}}if(K){let Y=new Uint16Array(K*4),V=B[B.length-2];for(let Z=B.length-3,q=0;Z>=0;Z-=3)Y[q++]=B[Z],Y[q++]=B[Z+1]-V,Y[q++]=B[Z+2]-V,Y[q++]=q;D.push(new El(Y,B[2]-V,i)),j.push(V-O)}}function v(O,z){return(D,j,B)=>{let K=0,F=D.length-1,Y,V;if(F>=0&&(Y=D[F])instanceof hn){if(!F&&Y.type==O&&Y.length==B)return Y;(V=Y.prop(at.lookAhead))&&(K=j[F]+Y.length+V)}return w(O,D,j,B,K,z)}}function S(O,z,D,j,B,K,F,Y,V){let Z=[],q=[];for(;O.length>j;)Z.push(O.pop()),q.push(z.pop()+D-B);O.push(w(i.types[F],Z,q,K-B,Y-K,V)),z.push(B-D)}function w(O,z,D,j,B,K,F){if(K){let Y=[at.contextHash,K];F=F?[Y].concat(F):[Y]}if(B>25){let Y=[at.lookAhead,B];F=F?[Y].concat(F):[Y]}return new hn(O,z,D,j,F)}function A(O,z){let D=u.fork(),j=0,B=0,K=0,F=D.end-r,Y={size:0,start:0,skip:0};e:for(let V=D.pos-O;D.pos>V;){let Z=D.size;if(D.id==z&&Z>=0){Y.size=j,Y.start=B,Y.skip=K,K+=4,j+=4,D.next();continue}let q=D.pos-Z;if(Z<0||q<V||D.start<F)break;let P=D.id>=a?4:0,W=D.start;for(D.next();D.pos>q;){if(D.size<0)if(D.size==-3||D.size==-4)P+=4;else break e;else D.id>=a&&(P+=4);D.next()}B=W,j+=Z,K+=P}return(z<0||j==O)&&(Y.size=j,Y.start=B,Y.skip=K),Y.size>4?Y:void 0}function C(O,z,D){let{id:j,start:B,end:K,size:F}=u;if(u.next(),F>=0&&j<a){let Y=D;if(F>4){let V=u.pos-(F-4);for(;u.pos>V;)D=C(O,z,D)}z[--D]=Y,z[--D]=K-O,z[--D]=B-O,z[--D]=j}else F==-3?d=j:F==-4&&(m=j);return D}let T=[],R=[];for(;u.pos>0;)p(n.start||0,n.bufferStart||0,T,R,-1,0);let N=(e=n.length)!==null&&e!==void 0?e:T.length?R[0]+T[0].length:0;return new hn(f[n.topID],T.reverse(),R.reverse(),N)}const nC=new WeakMap;function Nd(n,e){if(!n.isAnonymous||e instanceof El||e.type!=n)return 1;let t=nC.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof hn)){t=1;break}t+=Nd(n,i)}nC.set(e,t)}return t}function Hv(n,e,t,i,r,o,a,u,f){let d=0;for(let S=i;S<r;S++)d+=Nd(n,e[S]);let m=Math.ceil(d*1.5/8),p=[],b=[];function v(S,w,A,C,T){for(let R=A;R<C;){let N=R,O=w[R],z=Nd(n,S[R]);for(R++;R<C;R++){let D=Nd(n,S[R]);if(z+D>=m)break;z+=D}if(R==N+1){if(z>m){let D=S[N];v(D.children,D.positions,0,D.children.length,w[N]+T);continue}p.push(S[N])}else{let D=w[R-1]+S[R-1].length-O;p.push(Hv(n,S,w,N,R,O,D,null,f))}b.push(O+T-o)}}return v(e,t,i,r,0),(u||f)(p,b,a)}class ko{constructor(e,t,i,r,o=!1,a=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(o?1:0)|(a?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new ko(0,e.length,e,0,!1,i)];for(let o of t)o.to>e.length&&r.push(o);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],o=1,a=e.length?e[0]:null;for(let u=0,f=0,d=0;;u++){let m=u<t.length?t[u]:null,p=m?m.fromA:1e9;if(p-f>=i)for(;a&&a.from<p;){let b=a;if(f>=b.from||p<=b.to||d){let v=Math.max(b.from,f)-d,S=Math.min(b.to,p)-d;b=v>=S?null:new ko(v,S,b.tree,b.offset+d,u>0,!!m)}if(b&&r.push(b),a.to>p)break;a=o<e.length?e[o++]:null}if(!m)break;f=m.toA,d=m.toA-m.toB}return r}}class nM{startParse(e,t,i){return typeof e=="string"&&(e=new iH(e)),i=i?i.length?i.map(r=>new I0(r.from,r.to)):[new I0(0,0)]:[new I0(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let o=r.advance();if(o)return o}}}class iH{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}new at({perNode:!0});let sH=0;class Yi{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=sH++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Yi&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Yi(i,[],null,[]);if(r.set.push(r),t)for(let o of t.set)r.set.push(o);return r}static defineModifier(e){let t=new om(e);return i=>i.modified.indexOf(t)>-1?i:om.get(i.base||i,i.modified.concat(t).sort((r,o)=>r.id-o.id))}}let rH=0;class om{constructor(e){this.name=e,this.instances=[],this.id=rH++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(u=>u.base==e&&lH(t,u.modified));if(i)return i;let r=[],o=new Yi(e.name,r,e,t);for(let u of t)u.instances.push(o);let a=oH(t);for(let u of e.set)if(!u.modified.length)for(let f of a)r.push(om.get(u,f));return o}}function lH(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function oH(n){let e=[[]];for(let t=0;t<n.length;t++)for(let i=0,r=e.length;i<r;i++)e.push(e[i].concat(n[t]));return e.sort((t,i)=>i.length-t.length)}function iM(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let o=[],a=2,u=r;for(let p=0;;){if(u=="..."&&p>0&&p+3==r.length){a=1;break}let b=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(u);if(!b)throw new RangeError("Invalid path: "+r);if(o.push(b[0]=="*"?"":b[0][0]=='"'?JSON.parse(b[0]):b[0]),p+=b[0].length,p==r.length)break;let v=r[p++];if(p==r.length&&v=="!"){a=0;break}if(v!="/")throw new RangeError("Invalid path: "+r);u=r.slice(p)}let f=o.length-1,d=o[f];if(!d)throw new RangeError("Invalid path: "+r);let m=new sf(i,a,f>0?o.slice(0,f):null);e[d]=m.sort(e[d])}}return sM.add(e)}const sM=new at({combine(n,e){let t,i,r;for(;n||e;){if(!n||e&&n.depth>=e.depth?(r=e,e=e.next):(r=n,n=n.next),t&&t.mode==r.mode&&!r.context&&!t.context)continue;let o=new sf(r.tags,r.mode,r.context);t?t.next=o:i=o,t=o}return i}});class sf{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}sf.empty=new sf([],2,null);function rM(n,e){let t=Object.create(null);for(let o of n)if(!Array.isArray(o.tag))t[o.tag.id]=o.class;else for(let a of o.tag)t[a.id]=o.class;let{scope:i,all:r=null}=e||{};return{style:o=>{let a=r;for(let u of o)for(let f of u.set){let d=t[f.id];if(d){a=a?a+" "+d:d;break}}return a},scope:i}}function aH(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function cH(n,e,t,i=0,r=n.length){let o=new uH(i,Array.isArray(e)?e:[e],t);o.highlightRange(n.cursor(),i,r,"",o.highlighters),o.flush(r)}class uH{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,i,r,o){let{type:a,from:u,to:f}=e;if(u>=i||f<=t)return;a.isTop&&(o=this.highlighters.filter(v=>!v.scope||v.scope(a)));let d=r,m=fH(e)||sf.empty,p=aH(o,m.tags);if(p&&(d&&(d+=" "),d+=p,m.mode==1&&(r+=(r?" ":"")+p)),this.startSpan(Math.max(t,u),d),m.opaque)return;let b=e.tree&&e.tree.prop(at.mounted);if(b&&b.overlay){let v=e.node.enter(b.overlay[0].from+u,1),S=this.highlighters.filter(A=>!A.scope||A.scope(b.tree.type)),w=e.firstChild();for(let A=0,C=u;;A++){let T=A<b.overlay.length?b.overlay[A]:null,R=T?T.from+u:f,N=Math.max(t,C),O=Math.min(i,R);if(N<O&&w)for(;e.from<O&&(this.highlightRange(e,N,O,r,o),this.startSpan(Math.min(O,e.to),d),!(e.to>=R||!e.nextSibling())););if(!T||R>i)break;C=T.to+u,C>t&&(this.highlightRange(v.cursor(),Math.max(t,T.from+u),Math.min(i,C),"",S),this.startSpan(Math.min(i,C),d))}w&&e.parent()}else if(e.firstChild()){b&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,o),this.startSpan(Math.min(i,e.to),d)}while(e.nextSibling());e.parent()}}}function fH(n){let e=n.type.prop(sM);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const ke=Yi.define,gd=ke(),Zr=ke(),iC=ke(Zr),sC=ke(Zr),Jr=ke(),yd=ke(Jr),H0=ke(Jr),Cs=ke(),to=ke(Cs),ws=ke(),ks=ke(),hb=ke(),ku=ke(hb),bd=ke(),qe={comment:gd,lineComment:ke(gd),blockComment:ke(gd),docComment:ke(gd),name:Zr,variableName:ke(Zr),typeName:iC,tagName:ke(iC),propertyName:sC,attributeName:ke(sC),className:ke(Zr),labelName:ke(Zr),namespace:ke(Zr),macroName:ke(Zr),literal:Jr,string:yd,docString:ke(yd),character:ke(yd),attributeValue:ke(yd),number:H0,integer:ke(H0),float:ke(H0),bool:ke(Jr),regexp:ke(Jr),escape:ke(Jr),color:ke(Jr),url:ke(Jr),keyword:ws,self:ke(ws),null:ke(ws),atom:ke(ws),unit:ke(ws),modifier:ke(ws),operatorKeyword:ke(ws),controlKeyword:ke(ws),definitionKeyword:ke(ws),moduleKeyword:ke(ws),operator:ks,derefOperator:ke(ks),arithmeticOperator:ke(ks),logicOperator:ke(ks),bitwiseOperator:ke(ks),compareOperator:ke(ks),updateOperator:ke(ks),definitionOperator:ke(ks),typeOperator:ke(ks),controlOperator:ke(ks),punctuation:hb,separator:ke(hb),bracket:ku,angleBracket:ke(ku),squareBracket:ke(ku),paren:ke(ku),brace:ke(ku),content:Cs,heading:to,heading1:ke(to),heading2:ke(to),heading3:ke(to),heading4:ke(to),heading5:ke(to),heading6:ke(to),contentSeparator:ke(Cs),list:ke(Cs),quote:ke(Cs),emphasis:ke(Cs),strong:ke(Cs),link:ke(Cs),monospace:ke(Cs),strikethrough:ke(Cs),inserted:ke(),deleted:ke(),changed:ke(),invalid:ke(),meta:bd,documentMeta:ke(bd),annotation:ke(bd),processingInstruction:ke(bd),definition:Yi.defineModifier("definition"),constant:Yi.defineModifier("constant"),function:Yi.defineModifier("function"),standard:Yi.defineModifier("standard"),local:Yi.defineModifier("local"),special:Yi.defineModifier("special")};for(let n in qe){let e=qe[n];e instanceof Yi&&(e.name=n)}rM([{tag:qe.link,class:"tok-link"},{tag:qe.heading,class:"tok-heading"},{tag:qe.emphasis,class:"tok-emphasis"},{tag:qe.strong,class:"tok-strong"},{tag:qe.keyword,class:"tok-keyword"},{tag:qe.atom,class:"tok-atom"},{tag:qe.bool,class:"tok-bool"},{tag:qe.url,class:"tok-url"},{tag:qe.labelName,class:"tok-labelName"},{tag:qe.inserted,class:"tok-inserted"},{tag:qe.deleted,class:"tok-deleted"},{tag:qe.literal,class:"tok-literal"},{tag:qe.string,class:"tok-string"},{tag:qe.number,class:"tok-number"},{tag:[qe.regexp,qe.escape,qe.special(qe.string)],class:"tok-string2"},{tag:qe.variableName,class:"tok-variableName"},{tag:qe.local(qe.variableName),class:"tok-variableName tok-local"},{tag:qe.definition(qe.variableName),class:"tok-variableName tok-definition"},{tag:qe.special(qe.variableName),class:"tok-variableName2"},{tag:qe.definition(qe.propertyName),class:"tok-propertyName tok-definition"},{tag:qe.typeName,class:"tok-typeName"},{tag:qe.namespace,class:"tok-namespace"},{tag:qe.className,class:"tok-className"},{tag:qe.macroName,class:"tok-macroName"},{tag:qe.propertyName,class:"tok-propertyName"},{tag:qe.operator,class:"tok-operator"},{tag:qe.comment,class:"tok-comment"},{tag:qe.meta,class:"tok-meta"},{tag:qe.invalid,class:"tok-invalid"},{tag:qe.punctuation,class:"tok-punctuation"}]);var _0;const Da=new at;function hH(n){return Ve.define({combine:n?e=>e.concat(n):void 0})}const dH=new at;class as{constructor(e,t,i=[],r=""){this.data=e,this.name=r,xt.prototype.hasOwnProperty("tree")||Object.defineProperty(xt.prototype,"tree",{get(){return Vs(this)}}),this.parser=t,this.extension=[pc.of(this),xt.languageData.of((o,a,u)=>{let f=rC(o,a,u),d=f.type.prop(Da);if(!d)return[];let m=o.facet(d),p=f.type.prop(dH);if(p){let b=f.resolve(a-f.from,u);for(let v of p)if(v.test(b,o)){let S=o.facet(v.facet);return v.type=="replace"?S:S.concat(m)}}return m})].concat(i)}isActiveAt(e,t,i=-1){return rC(e,t,i).type.prop(Da)==this.data}findRegions(e){let t=e.facet(pc);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(o,a)=>{if(o.prop(Da)==this.data){i.push({from:a,to:a+o.length});return}let u=o.prop(at.mounted);if(u){if(u.tree.prop(Da)==this.data){if(u.overlay)for(let f of u.overlay)i.push({from:f.from+a,to:f.to+a});else i.push({from:a,to:a+o.length});return}else if(u.overlay){let f=i.length;if(r(u.tree,u.overlay[0].from+a),i.length>f)return}}for(let f=0;f<o.children.length;f++){let d=o.children[f];d instanceof hn&&r(d,o.positions[f]+a)}};return r(Vs(e),0),i}get allowsNesting(){return!0}}as.setState=un.define();function rC(n,e,t){let i=n.facet(pc),r=Vs(n).topNode;if(!i||i.allowsNesting)for(let o=r;o;o=o.enter(e,t,tn.ExcludeBuffers|tn.EnterBracketed))o.type.isTop&&(r=o);return r}class am extends as{constructor(e,t,i){super(e,t,[],i),this.parser=t}static define(e){let t=hH(e.languageData);return new am(t,e.parser.configure({props:[Da.add(i=>i.isTop?t:void 0)]}),e.name)}configure(e,t){return new am(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Vs(n){let e=n.field(as.state,!1);return e?e.tree:hn.empty}class mH{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let i=this.cursorPos-this.string.length;return e<i||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Cu=null;class cm{constructor(e,t,i=[],r,o,a,u,f){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=o,this.viewport=a,this.skipped=u,this.scheduleOn=f,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new cm(e,t,[],hn.empty,0,i,[],null)}startParse(){return this.parser.startParse(new mH(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=hn.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let r=this.parse.advance();if(r)if(this.fragments=this.withoutTempSkipped(ko.addTree(r,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=r,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(ko.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Cu;Cu=this;try{return e()}finally{Cu=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=lC(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:o,viewport:a,skipped:u}=this;if(this.takeTree(),!e.empty){let f=[];if(e.iterChangedRanges((d,m,p,b)=>f.push({fromA:d,toA:m,fromB:p,toB:b})),i=ko.applyChanges(i,f),r=hn.empty,o=0,a={from:e.mapPos(a.from,-1),to:e.mapPos(a.to,1)},this.skipped.length){u=[];for(let d of this.skipped){let m=e.mapPos(d.from,1),p=e.mapPos(d.to,-1);m<p&&u.push({from:m,to:p})}}}return new cm(this.parser,t,i,r,o,a,u,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:r,to:o}=this.skipped[i];r<e.to&&o>e.from&&(this.fragments=lC(this.fragments,r,o),this.skipped.splice(i--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends nM{createParse(t,i,r){let o=r[0].from,a=r[r.length-1].to;return{parsedPos:o,advance(){let f=Cu;if(f){for(let d of r)f.tempSkipped.push(d);e&&(f.scheduleOn=f.scheduleOn?Promise.all([f.scheduleOn,e]):e)}return this.parsedPos=a,new hn(gi.none,[],[],a-o)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Cu}}function lC(n,e,t){return ko.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class mc{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new mc(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=cm.create(e.facet(pc).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new mc(i)}}as.state=jl.define({create:mc.init,update(n,e){for(let t of e.effects)if(t.is(as.setState))return t.value;return e.startState.facet(pc)!=e.state.facet(pc)?mc.init(e.state):n.apply(e)}});let lM=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(lM=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const U0=typeof navigator<"u"&&(!((_0=navigator.scheduling)===null||_0===void 0)&&_0.isInputPending)?()=>navigator.scheduling.isInputPending():null,pH=fs.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(as.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(as.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=lM(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:r}}=this.view,o=i.field(as.state);if(o.tree==o.context.tree&&o.context.isDone(r+1e5))return;let a=Date.now()+Math.min(this.chunkBudget,100,e&&!U0?Math.max(25,e.timeRemaining()-5):1e9),u=o.context.treeLen<r&&i.doc.length>r+1e3,f=o.context.work(()=>U0&&U0()||Date.now()>a,r+(u?0:1e5));this.chunkBudget-=Date.now()-t,(f||this.chunkBudget<=0)&&(o.context.takeTree(),this.view.dispatch({effects:as.setState.of(new mc(o.context))})),this.chunkBudget>0&&!(f&&!u)&&this.scheduleWork(),this.checkAsyncSchedule(o.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ls(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),pc=Ve.define({combine(n){return n.length?n[0]:null},enables:n=>[as.state,pH,Ye.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class gH{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const yH=Ve.define(),_v=Ve.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function um(n){let e=n.facet(_v);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function rf(n,e){let t="",i=n.tabSize,r=n.facet(_v)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let o=0;o<e;o++)t+=r;return t}function Uv(n,e){n instanceof xt&&(n=new zm(n));for(let i of n.state.facet(yH)){let r=i(n,e);if(r!==void 0)return r}let t=Vs(n.state);return t.length>=e?bH(n,t,e):null}class zm{constructor(e,t={}){this.state=e,this.options=t,this.unit=um(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:o}=this.options;return r!=null&&r>=i.from&&r<=i.to?o&&r==e?{text:"",from:e}:(t<0?r<e:r<=e)?{text:i.text.slice(r-i.from),from:r}:{text:i.text.slice(0,r-i.from),from:i.from}:i}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:i,from:r}=this.lineAt(e,t);return i.slice(e-r,Math.min(i.length,e+100-r))}column(e,t=1){let{text:i,from:r}=this.lineAt(e,t),o=this.countColumn(i,e-r),a=this.options.overrideIndentation?this.options.overrideIndentation(r):-1;return a>-1&&(o+=a-this.countColumn(i,i.search(/\S|$/))),o}countColumn(e,t=e.length){return Om(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),o=this.options.overrideIndentation;if(o){let a=o(r);if(a>-1)return a}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const oM=new at;function bH(n,e,t){let i=e.resolveStack(t),r=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(r!=i.node){let o=[];for(let a=r;a&&!(a.from<i.node.from||a.to>i.node.to||a.from==i.node.from&&a.type==i.node.type);a=a.parent)o.push(a);for(let a=o.length-1;a>=0;a--)i={node:o[a],next:i}}return aM(i,n,t)}function aM(n,e,t){for(let i=n;i;i=i.next){let r=xH(i.node);if(r)return r(Vv.create(e,t,i))}return 0}function vH(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function xH(n){let e=n.type.prop(oM);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(at.closedBy))){let r=n.lastChild,o=r&&i.indexOf(r.name)>-1;return a=>CH(a,!0,1,void 0,o&&!vH(a)?r.from:void 0)}return n.parent==null?SH:null}function SH(){return 0}class Vv extends zm{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new Vv(e,t,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(wH(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return aM(this.context.next,this.base,this.pos)}}function wH(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function kH(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,o=n.state.doc.lineAt(t.from),a=r==null||r<=o.from?o.to:Math.min(o.to,r);for(let u=t.to;;){let f=e.childAfter(u);if(!f||f==i)return null;if(!f.type.isSkipped){if(f.from>=a)return null;let d=/^ */.exec(o.text.slice(t.to-o.from))[0].length;return{from:t.from,to:t.to+d}}u=f.to}}function CH(n,e,t,i,r){let o=n.textAfter,a=o.match(/^\s*/)[0].length,u=i&&o.slice(a,a+i.length)==i||r==n.pos+a,f=kH(n);return f?u?n.column(f.from):n.column(f.to):n.baseIndent+(u?0:n.unit*t)}function oC({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const EH=200;function AH(){return xt.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+EH)return n;let o=t.sliceString(r.from,i);if(!e.some(d=>d.test(o)))return n;let{state:a}=n,u=-1,f=[];for(let{head:d}of a.selection.ranges){let m=a.doc.lineAt(d);if(m.from==u)continue;u=m.from;let p=Uv(a,m.from);if(p==null)continue;let b=/^\s*/.exec(m.text)[0],v=rf(a,p);b!=v&&f.push({from:m.from,to:m.from+b.length,insert:v})}return f.length?[n,{changes:f,sequential:!0}]:n})}const TH=new at;function RH(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}class Pm{constructor(e,t){this.specs=e;let i;function r(u){let f=wl.newName();return(i||(i=Object.create(null)))["."+f]=u,f}const o=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,a=t.scope;this.scope=a instanceof as?u=>u.prop(Da)==a.data:a?u=>u==a:void 0,this.style=rM(e.map(u=>({tag:u.tag,class:u.class||r(Object.assign({},u,{tag:null}))})),{all:o}).style,this.module=i?new wl(i):null,this.themeType=t.themeType}static define(e,t){return new Pm(e,t||{})}}const db=Ve.define(),MH=Ve.define({combine(n){return n.length?[n[0]]:null}});function V0(n){let e=n.facet(db);return e.length?e:n.facet(MH)}function OH(n,e){let t=[DH],i;return n instanceof Pm&&(n.module&&t.push(Ye.styleModule.of(n.module)),i=n.themeType),i?t.push(db.computeN([Ye.darkTheme],r=>r.facet(Ye.darkTheme)==(i=="dark")?[n]:[])):t.push(db.of(n)),t}class NH{constructor(e){this.markCache=Object.create(null),this.tree=Vs(e.state),this.decorations=this.buildDeco(e,V0(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=Vs(e.state),i=V0(e.state),r=i!=V0(e.startState),{viewport:o}=e.view,a=e.changes.mapPos(this.decoratedTo,1);t.length<o.to&&!r&&t.type==this.tree.type&&a>=o.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=a):(t!=this.tree||e.viewportChanged||r)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=o.to)}buildDeco(e,t){if(!t||!this.tree.length)return _t.none;let i=new Wu;for(let{from:r,to:o}of e.visibleRanges)cH(this.tree,t,(a,u,f)=>{i.add(a,u,this.markCache[f]||(this.markCache[f]=_t.mark({class:f})))},r,o);return i.finish()}}const DH=wv.high(fs.fromClass(NH,{decorations:n=>n.decorations})),jH=Ye.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),cM=1e4,uM="()[]{}",fM=Ve.define({combine(n){return kv(n,{afterCursor:!0,brackets:uM,maxScanDistance:cM,renderMatch:zH})}}),LH=_t.mark({class:"cm-matchingBracket"}),BH=_t.mark({class:"cm-nonmatchingBracket"});function zH(n){let e=[],t=n.matched?LH:BH;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}function aC(n){let e=[],t=n.facet(fM);for(let i of n.selection.ranges){if(!i.empty)continue;let r=Bs(n,i.head,-1,t)||i.head>0&&Bs(n,i.head-1,1,t)||t.afterCursor&&(Bs(n,i.head,1,t)||i.head<n.doc.length&&Bs(n,i.head+1,-1,t));r&&(e=e.concat(t.renderMatch(r,n)))}return _t.set(e,!0)}const PH=fs.fromClass(class{constructor(n){this.paused=!1,this.decorations=aC(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=aC(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),IH=[PH,jH];function HH(n={}){return[fM.of(n),IH]}const _H=new at;function mb(n,e,t){let i=n.prop(e<0?at.openedBy:at.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function pb(n){let e=n.type.prop(_H);return e?e(n.node):n}function Bs(n,e,t,i={}){let r=i.maxScanDistance||cM,o=i.brackets||uM,a=Vs(n),u=a.resolveInner(e,t);for(let f=u;f;f=f.parent){let d=mb(f.type,t,o);if(d&&f.from<f.to){let m=pb(f);if(m&&(t>0?e>=m.from&&e<m.to:e>m.from&&e<=m.to))return UH(n,e,t,f,m,d,o)}}return VH(n,e,t,a,u.type,r,o)}function UH(n,e,t,i,r,o,a){let u=i.parent,f={from:r.from,to:r.to},d=0,m=u==null?void 0:u.cursor();if(m&&(t<0?m.childBefore(i.from):m.childAfter(i.to)))do if(t<0?m.to<=i.from:m.from>=i.to){if(d==0&&o.indexOf(m.type.name)>-1&&m.from<m.to){let p=pb(m);return{start:f,end:p?{from:p.from,to:p.to}:void 0,matched:!0}}else if(mb(m.type,t,a))d++;else if(mb(m.type,-t,a)){if(d==0){let p=pb(m);return{start:f,end:p&&p.from<p.to?{from:p.from,to:p.to}:void 0,matched:!1}}d--}}while(t<0?m.prevSibling():m.nextSibling());return{start:f,matched:!1}}function VH(n,e,t,i,r,o,a){if(t<0?!e:e==n.doc.length)return null;let u=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),f=a.indexOf(u);if(f<0||f%2==0!=t>0)return null;let d={from:t<0?e-1:e,to:t>0?e+1:e},m=n.doc.iterRange(e,t>0?n.doc.length:0),p=0;for(let b=0;!m.next().done&&b<=o;){let v=m.value;t<0&&(b+=v.length);let S=e+b*t;for(let w=t>0?0:v.length-1,A=t>0?v.length:-1;w!=A;w+=t){let C=a.indexOf(v[w]);if(!(C<0||i.resolveInner(S+w,1).type!=r))if(C%2==0==t>0)p++;else{if(p==1)return{start:d,end:{from:S+w,to:S+w+1},matched:C>>1==f>>1};p--}}t>0&&(b+=v.length)}return m.done?{start:d,matched:!1}:null}const qH=Object.create(null),cC=[gi.none],uC=[],fC=Object.create(null),FH=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])FH[n]=GH(qH,e);function q0(n,e){uC.indexOf(n)>-1||(uC.push(n),console.warn(e))}function GH(n,e){let t=[];for(let u of e.split(" ")){let f=[];for(let d of u.split(".")){let m=n[d]||qe[d];m?typeof m=="function"?f.length?f=f.map(m):q0(d,`Modifier ${d} used at start of tag`):f.length?q0(d,`Tag ${d} used as modifier`):f=Array.isArray(m)?m:[m]:q0(d,`Unknown highlighting tag ${d}`)}for(let d of f)t.push(d)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=i+" "+t.map(u=>u.id),o=fC[r];if(o)return o.id;let a=fC[r]=gi.define({id:cC.length,name:i,props:[iM({[i]:t})]});return cC.push(a),a.id}fn.RTL,fn.LTR;const KH=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Fv(n.state,t.from);return i.line?YH(n):i.block?WH(n):!1};function qv(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const YH=qv(ZH,0),QH=qv(hM,0),WH=qv((n,e)=>hM(n,e,$H(e)),0);function Fv(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Eu=50;function XH(n,{open:e,close:t},i,r){let o=n.sliceDoc(i-Eu,i),a=n.sliceDoc(r,r+Eu),u=/\s*$/.exec(o)[0].length,f=/^\s*/.exec(a)[0].length,d=o.length-u;if(o.slice(d-e.length,d)==e&&a.slice(f,f+t.length)==t)return{open:{pos:i-u,margin:u&&1},close:{pos:r+f,margin:f&&1}};let m,p;r-i<=2*Eu?m=p=n.sliceDoc(i,r):(m=n.sliceDoc(i,i+Eu),p=n.sliceDoc(r-Eu,r));let b=/^\s*/.exec(m)[0].length,v=/\s*$/.exec(p)[0].length,S=p.length-v-t.length;return m.slice(b,b+e.length)==e&&p.slice(S,S+t.length)==t?{open:{pos:i+b+e.length,margin:/\s/.test(m.charAt(b+e.length))?1:0},close:{pos:r-v-t.length,margin:/\s/.test(p.charAt(S-1))?1:0}}:null}function $H(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to);r.from>i.from&&r.from==t.to&&(r=t.to==i.to+1?i:n.doc.lineAt(t.to-1));let o=e.length-1;o>=0&&e[o].to>i.from?e[o].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function hM(n,e,t=e.selection.ranges){let i=t.map(o=>Fv(e,o.from).block);if(!i.every(o=>o))return null;let r=t.map((o,a)=>XH(e,i[a],o.from,o.to));if(n!=2&&!r.every(o=>o))return{changes:e.changes(t.map((o,a)=>r[a]?[]:[{from:o.from,insert:i[a].open+" "},{from:o.to,insert:" "+i[a].close}]))};if(n!=1&&r.some(o=>o)){let o=[];for(let a=0,u;a<r.length;a++)if(u=r[a]){let f=i[a],{open:d,close:m}=u;o.push({from:d.pos-f.open.length,to:d.pos+d.margin},{from:m.pos-m.margin,to:m.pos+f.close.length})}return{changes:o}}return null}function ZH(n,e,t=e.selection.ranges){let i=[],r=-1;e:for(let{from:o,to:a}of t){let u=i.length,f=1e9,d;for(let m=o;m<=a;){let p=e.doc.lineAt(m);if(d==null&&(d=Fv(e,p.from).line,!d))continue e;if(p.from>r&&(o==a||a>p.from)){r=p.from;let b=/^\s*/.exec(p.text)[0].length,v=b==p.length,S=p.text.slice(b,b+d.length)==d?b:-1;b<p.text.length&&b<f&&(f=b),i.push({line:p,comment:S,token:d,indent:b,empty:v,single:!1})}m=p.to+1}if(f<1e9)for(let m=u;m<i.length;m++)i[m].indent<i[m].line.text.length&&(i[m].indent=f);i.length==u+1&&(i[u].single=!0)}if(n!=2&&i.some(o=>o.comment<0&&(!o.empty||o.single))){let o=[];for(let{line:u,token:f,indent:d,empty:m,single:p}of i)(p||!m)&&o.push({from:u.from+d,insert:f+" "});let a=e.changes(o);return{changes:a,selection:e.selection.map(a,1)}}else if(n!=1&&i.some(o=>o.comment>=0)){let o=[];for(let{line:a,comment:u,token:f}of i)if(u>=0){let d=a.from+u,m=d+f.length;a.text[m-a.from]==" "&&m++,o.push({from:d,to:m})}return{changes:o}}return null}const gb=Ll.define(),JH=Ll.define(),e_=Ve.define(),dM=Ve.define({combine(n){return kv(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}}),mM=jl.define({create(){return zs.empty},update(n,e){let t=e.state.facet(dM),i=e.annotation(gb);if(i){let f=di.fromTransaction(e,i.selection),d=i.side,m=d==0?n.undone:n.done;return f?m=fm(m,m.length,t.minDepth,f):m=yM(m,e.startState.selection),new zs(d==0?i.rest:m,d==0?m:i.rest)}let r=e.annotation(JH);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(Tn.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let o=di.fromTransaction(e),a=e.annotation(Tn.time),u=e.annotation(Tn.userEvent);return o?n=n.addChanges(o,a,u,t,e):e.selection&&(n=n.addSelection(e.startState.selection,a,u,t.newGroupDelay)),(r=="full"||r=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new zs(n.done.map(di.fromJSON),n.undone.map(di.fromJSON))}});function t_(n={}){return[mM,dM.of(n),Ye.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?pM:e.inputType=="historyRedo"?yb:null;return i?(e.preventDefault(),i(t)):!1}})]}function Im(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(mM,!1);if(!r)return!1;let o=r.pop(n,t,e);return o?(i(o),!0):!1}}const pM=Im(0,!1),yb=Im(1,!1),n_=Im(0,!0),i_=Im(1,!0);class di{constructor(e,t,i,r,o){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=o}setSelAfter(e){return new di(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new di(e.changes&&Cn.fromJSON(e.changes),[],e.mapped&&_s.fromJSON(e.mapped),e.startSelection&&ge.fromJSON(e.startSelection),e.selectionsAfter.map(ge.fromJSON))}static fromTransaction(e,t){let i=Xi;for(let r of e.startState.facet(e_)){let o=r(e);o.length&&(i=i.concat(o))}return!i.length&&e.changes.empty?null:new di(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xi)}static selection(e){return new di(void 0,Xi,void 0,void 0,e)}}function fm(n,e,t,i){let r=e+1>t+20?e-t-1:0,o=n.slice(r,e);return o.push(i),o}function s_(n,e){let t=[],i=!1;return n.iterChangedRanges((r,o)=>t.push(r,o)),e.iterChangedRanges((r,o,a,u)=>{for(let f=0;f<t.length;){let d=t[f++],m=t[f++];u>=d&&a<=m&&(i=!0)}}),i}function r_(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function gM(n,e){return n.length?e.length?n.concat(e):n:e}const Xi=[],l_=200;function yM(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-l_));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),fm(n,n.length-1,1e9,t.setSelAfter(i)))}else return[di.selection([e])]}function o_(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function F0(n,e){if(!n.length)return n;let t=n.length,i=Xi;for(;t;){let r=a_(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let o=n.slice(0,t);return o[t-1]=r,o}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[di.selection(i)]:Xi}function a_(n,e,t){let i=gM(n.selectionsAfter.length?n.selectionsAfter.map(u=>u.map(e)):Xi,t);if(!n.changes)return di.selection(i);let r=n.changes.map(e),o=e.mapDesc(n.changes,!0),a=n.mapped?n.mapped.composeDesc(o):o;return new di(r,un.mapEffects(n.effects,e),a,n.startSelection.map(o),i)}const c_=/^(input\.type|delete)($|\.)/;class zs{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new zs(this.done,this.undone):this}addChanges(e,t,i,r,o){let a=this.done,u=a[a.length-1];return u&&u.changes&&!u.changes.empty&&e.changes&&(!i||c_.test(i))&&(!u.selectionsAfter.length&&t-this.prevTime<r.newGroupDelay&&r.joinToEvent(o,s_(u.changes,e.changes))||i=="input.type.compose")?a=fm(a,a.length-1,r.minDepth,new di(e.changes.compose(u.changes),gM(un.mapEffects(e.effects,u.changes),u.effects),u.mapped,u.startSelection,Xi)):a=fm(a,a.length,r.minDepth,e),new zs(a,Xi,t,i)}addSelection(e,t,i,r){let o=this.done.length?this.done[this.done.length-1].selectionsAfter:Xi;return o.length>0&&t-this.prevTime<r&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&r_(o[o.length-1],e)?this:new zs(yM(this.done,e),this.undone,t,i)}addMapping(e){return new zs(F0(this.done,e),F0(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,i){let r=e==0?this.done:this.undone;if(r.length==0)return null;let o=r[r.length-1],a=o.selectionsAfter[0]||(o.startSelection?o.startSelection.map(o.changes.invertedDesc,1):t.selection);if(i&&o.selectionsAfter.length)return t.update({selection:o.selectionsAfter[o.selectionsAfter.length-1],annotations:gb.of({side:e,rest:o_(r),selection:a}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(o.changes){let u=r.length==1?Xi:r.slice(0,r.length-1);return o.mapped&&(u=F0(u,o.mapped)),t.update({changes:o.changes,selection:o.startSelection,effects:o.effects,annotations:gb.of({side:e,rest:u,selection:a}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}zs.empty=new zs(Xi,Xi);const u_=[{key:"Mod-z",run:pM,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:yb,preventDefault:!0},{linux:"Ctrl-Shift-z",run:yb,preventDefault:!0},{key:"Mod-u",run:n_,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:i_,preventDefault:!0}];function Cc(n,e){return ge.create(n.ranges.map(e),n.mainIndex)}function ds(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function ms({state:n,dispatch:e},t){let i=Cc(n.selection,t);return i.eq(n.selection,!0)?!1:(e(ds(n,i)),!0)}function Hm(n,e){return ge.cursor(e?n.to:n.from)}function bM(n,e){return ms(n,t=>t.empty?n.moveByChar(t,e):Hm(t,e))}function Wn(n){return n.textDirectionAt(n.state.selection.main.head)==fn.LTR}const vM=n=>bM(n,!Wn(n)),xM=n=>bM(n,Wn(n));function SM(n,e){return ms(n,t=>t.empty?n.moveByGroup(t,e):Hm(t,e))}const f_=n=>SM(n,!Wn(n)),h_=n=>SM(n,Wn(n));function d_(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function _m(n,e,t){let i=Vs(n).resolveInner(e.head),r=t?at.closedBy:at.openedBy;for(let f=e.head;;){let d=t?i.childAfter(f):i.childBefore(f);if(!d)break;d_(n,d,r)?i=d:f=t?d.to:d.from}let o=i.type.prop(r),a,u;return o&&(a=t?Bs(n,i.from,1):Bs(n,i.to,-1))&&a.matched?u=t?a.end.to:a.end.from:u=t?i.to:i.from,ge.cursor(u,t?-1:1)}const m_=n=>ms(n,e=>_m(n.state,e,!Wn(n))),p_=n=>ms(n,e=>_m(n.state,e,Wn(n)));function wM(n,e){return ms(n,t=>{if(!t.empty)return Hm(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const kM=n=>wM(n,!1),CM=n=>wM(n,!0);function EM(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,i=0,r;if(e){for(let o of n.state.facet(Ye.scrollMargins)){let a=o(n);a!=null&&a.top&&(t=Math.max(a==null?void 0:a.top,t)),a!=null&&a.bottom&&(i=Math.max(a==null?void 0:a.bottom,i))}r=n.scrollDOM.clientHeight-t-i}else r=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:i,selfScroll:e,height:Math.max(n.defaultLineHeight,r-5)}}function AM(n,e){let t=EM(n),{state:i}=n,r=Cc(i.selection,a=>a.empty?n.moveVertically(a,e,t.height):Hm(a,e));if(r.eq(i.selection))return!1;let o;if(t.selfScroll){let a=n.coordsAtPos(i.selection.main.head),u=n.scrollDOM.getBoundingClientRect(),f=u.top+t.marginTop,d=u.bottom-t.marginBottom;a&&a.top>f&&a.bottom<d&&(o=Ye.scrollIntoView(r.main.head,{y:"start",yMargin:a.top-f}))}return n.dispatch(ds(i,r),{effects:o}),!0}const hC=n=>AM(n,!1),bb=n=>AM(n,!0);function Bl(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let o=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;o&&e.head!=i.from+o&&(r=ge.cursor(i.from+o))}return r}const g_=n=>ms(n,e=>Bl(n,e,!0)),y_=n=>ms(n,e=>Bl(n,e,!1)),b_=n=>ms(n,e=>Bl(n,e,!Wn(n))),v_=n=>ms(n,e=>Bl(n,e,Wn(n))),x_=n=>ms(n,e=>ge.cursor(n.lineBlockAt(e.head).from,1)),S_=n=>ms(n,e=>ge.cursor(n.lineBlockAt(e.head).to,-1));function w_(n,e,t){let i=!1,r=Cc(n.selection,o=>{let a=Bs(n,o.head,-1)||Bs(n,o.head,1)||o.head>0&&Bs(n,o.head-1,1)||o.head<n.doc.length&&Bs(n,o.head+1,-1);if(!a||!a.end)return o;i=!0;let u=a.start.from==o.head?a.end.to:a.end.from;return ge.cursor(u)});return i?(e(ds(n,r)),!0):!1}const k_=({state:n,dispatch:e})=>w_(n,e);function es(n,e,t){let i=Cc(n.state.selection,r=>{r.undirectional&&r.head>=r.anchor!=e&&(r=ge.range(r.head,r.anchor));let o=t(r);return ge.range(r.anchor,o.head,o.goalColumn,o.bidiLevel||void 0,o.assoc)});return i.eq(n.state.selection)?!1:(n.dispatch(ds(n.state,i)),!0)}function TM(n,e){return es(n,e,t=>n.moveByChar(t,e))}const RM=n=>TM(n,!Wn(n)),MM=n=>TM(n,Wn(n));function OM(n,e){return es(n,e,t=>n.moveByGroup(t,e))}const C_=n=>OM(n,!Wn(n)),E_=n=>OM(n,Wn(n)),A_=n=>{let e=!Wn(n);return es(n,e,t=>_m(n.state,t,e))},T_=n=>{let e=Wn(n);return es(n,e,t=>_m(n.state,t,e))};function NM(n,e){return es(n,e,t=>n.moveVertically(t,e))}const DM=n=>NM(n,!1),jM=n=>NM(n,!0);function LM(n,e){return es(n,e,t=>n.moveVertically(t,e,EM(n).height))}const dC=n=>LM(n,!1),mC=n=>LM(n,!0),R_=n=>es(n,!0,e=>Bl(n,e,!0)),M_=n=>es(n,!1,e=>Bl(n,e,!1)),O_=n=>{let e=!Wn(n);return es(n,e,t=>Bl(n,t,e))},N_=n=>{let e=Wn(n);return es(n,e,t=>Bl(n,t,e))},D_=n=>es(n,!1,e=>ge.cursor(n.lineBlockAt(e.head).from)),j_=n=>es(n,!0,e=>ge.cursor(n.lineBlockAt(e.head).to)),pC=({state:n,dispatch:e})=>(e(ds(n,{anchor:0})),!0),gC=({state:n,dispatch:e})=>(e(ds(n,{anchor:n.doc.length})),!0),yC=({state:n,dispatch:e})=>(e(ds(n,{anchor:n.selection.main.anchor,head:0})),!0),bC=({state:n,dispatch:e})=>(e(ds(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),L_=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),B_=({state:n,dispatch:e})=>{let t=Um(n).map(({from:i,to:r})=>ge.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:ge.create(t),userEvent:"select"})),!0},z_=({state:n,dispatch:e})=>{let t=Cc(n.selection,i=>{let r=Vs(n),o=r.resolveStack(i.from,1);if(i.empty){let a=r.resolveStack(i.from,-1);a.node.from>=o.node.from&&a.node.to<=o.node.to&&(o=a)}for(let a=o;a;a=a.next){let{node:u}=a;if((u.from<i.from&&u.to>=i.to||u.to>i.to&&u.from<=i.from)&&a.next)return ge.range(u.to,u.from)}return i});return t.eq(n.selection)?!1:(e(ds(n,t)),!0)};function BM(n,e){let{state:t}=n,i=t.selection,r=t.selection.ranges.slice();for(let o of t.selection.ranges){let a=t.doc.lineAt(o.head);if(e?a.to<n.state.doc.length:a.from>0)for(let u=o;;){let f=n.moveVertically(u,e);if(f.head<a.from||f.head>a.to){r.some(d=>d.head==f.head)||r.push(f);break}else{if(f.head==u.head)break;u=f}}}return r.length==i.ranges.length?!1:(n.dispatch(ds(t,ge.create(r,r.length-1))),!0)}const P_=n=>BM(n,!1),I_=n=>BM(n,!0),H_=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=ge.create([t.main]):t.main.empty||(i=ge.create([ge.cursor(t.main.head)])),i?(e(ds(n,i)),!0):!1};function Ef(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(o=>{let{from:a,to:u}=o;if(a==u){let f=e(o);f<a?(t="delete.backward",f=vd(n,f,!1)):f>a&&(t="delete.forward",f=vd(n,f,!0)),a=Math.min(a,f),u=Math.max(u,f)}else a=vd(n,a,!1),u=vd(n,u,!0);return a==u?{range:o}:{changes:{from:a,to:u},range:ge.cursor(a,a<o.head?-1:1)}});return r.changes.empty?!1:(n.dispatch(i.update(r,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Ye.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function vd(n,e,t){if(n instanceof Ye)for(let i of n.state.facet(Ye.atomicRanges).map(r=>r(n)))i.between(e,e,(r,o)=>{r<e&&o>e&&(e=t?o:r)});return e}const zM=(n,e,t)=>Ef(n,i=>{let r=i.from,{state:o}=n,a=o.doc.lineAt(r),u,f;if(t&&!e&&r>a.from&&r<a.from+200&&!/[^ \t]/.test(u=a.text.slice(0,r-a.from))){if(u[u.length-1]==" ")return r-1;let d=Om(u,o.tabSize),m=d%um(o)||um(o);for(let p=0;p<m&&u[u.length-1-p]==" ";p++)r--;f=r}else f=Yn(a.text,r-a.from,e,e)+a.from,f==r&&a.number!=(e?o.doc.lines:1)?f+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(a.text.slice(f-a.from,r-a.from))&&(f=Yn(a.text,f-a.from,!1,!1)+a.from);return f}),vb=n=>zM(n,!1,!0),PM=n=>zM(n,!0,!1),IM=(n,e)=>Ef(n,t=>{let i=t.head,{state:r}=n,o=r.doc.lineAt(i),a=r.charCategorizer(i);for(let u=null;;){if(i==(e?o.to:o.from)){i==t.head&&o.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let f=Yn(o.text,i-o.from,e)+o.from,d=o.text.slice(Math.min(i,f)-o.from,Math.max(i,f)-o.from),m=a(d);if(u!=null&&m!=u)break;(d!=" "||i!=t.head)&&(u=m),i=f}return i}),HM=n=>IM(n,!1),__=n=>IM(n,!0),U_=n=>Ef(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),V_=n=>Ef(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),q_=n=>Ef(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),F_=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:wt.of(["",""])},range:ge.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},G_=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,o=n.doc.lineAt(r),a=r==o.from?r-1:Yn(o.text,r-o.from,!1)+o.from,u=r==o.to?r+1:Yn(o.text,r-o.from,!0)+o.from;return{changes:{from:a,to:u,insert:n.doc.slice(r,u).append(n.doc.slice(a,r))},range:ge.cursor(u)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Um(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),o=n.doc.lineAt(i.to);if(!i.empty&&i.to==o.from&&(o=n.doc.lineAt(i.to-1)),t>=r.number){let a=e[e.length-1];a.to=o.to,a.ranges.push(i)}else e.push({from:r.from,to:o.to,ranges:[i]});t=o.number+1}return e}function _M(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let o of Um(n)){if(t?o.to==n.doc.length:o.from==0)continue;let a=n.doc.lineAt(t?o.to+1:o.from-1),u=a.length+1;if(t){i.push({from:o.to,to:a.to},{from:o.from,insert:a.text+n.lineBreak});for(let f of o.ranges)r.push(ge.range(Math.min(n.doc.length,f.anchor+u),Math.min(n.doc.length,f.head+u)))}else{i.push({from:a.from,to:o.from},{from:o.to,insert:n.lineBreak+a.text});for(let f of o.ranges)r.push(ge.range(f.anchor-u,f.head-u))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:ge.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const K_=({state:n,dispatch:e})=>_M(n,e,!1),Y_=({state:n,dispatch:e})=>_M(n,e,!0);function UM(n,e,t){if(n.readOnly)return!1;let i=[];for(let o of Um(n))t?i.push({from:o.from,insert:n.doc.slice(o.from,o.to)+n.lineBreak}):i.push({from:o.to,insert:n.lineBreak+n.doc.slice(o.from,o.to)});let r=n.changes(i);return e(n.update({changes:r,selection:n.selection.map(r,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Q_=({state:n,dispatch:e})=>UM(n,e,!1),W_=({state:n,dispatch:e})=>UM(n,e,!0),X_=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(Um(e).map(({from:r,to:o})=>(r>0?r--:o<e.doc.length&&o++,{from:r,to:o}))),i=Cc(e.selection,r=>{let o;if(n.lineWrapping){let a=n.lineBlockAt(r.head),u=n.coordsAtPos(r.head,r.assoc||1);u&&(o=a.bottom+n.documentTop-u.bottom+n.defaultLineHeight/2)}return n.moveVertically(r,!0,o)}).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function $_(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=Vs(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),o;return i&&r&&i.to<=e&&r.from>=e&&(o=i.type.prop(at.closedBy))&&o.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const vC=VM(!1),Z_=VM(!0);function VM(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:o,to:a}=r,u=e.doc.lineAt(o),f=!n&&o==a&&$_(e,o);n&&(o=a=(a<=u.to?u:e.doc.lineAt(a)).to);let d=new zm(e,{simulateBreak:o,simulateDoubleBreak:!!f}),m=Uv(d,o);for(m==null&&(m=Om(/^\s*/.exec(e.doc.lineAt(o).text)[0],e.tabSize));a<u.to&&/\s/.test(u.text[a-u.from]);)a++;f?{from:o,to:a}=f:o>u.from&&o<u.from+100&&!/\S/.test(u.text.slice(0,o))&&(o=u.from);let p=["",rf(e,m)];return f&&p.push(rf(e,d.lineIndent(u.from,-1))),{changes:{from:o,to:a,insert:wt.of(p)},range:ge.cursor(o+1+p[1].length)}});return t(e.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Gv(n,e){let t=-1;return n.changeByRange(i=>{let r=[];for(let a=i.from;a<=i.to;){let u=n.doc.lineAt(a);u.number>t&&(i.empty||i.to>u.from)&&(e(u,r,i),t=u.number),a=u.to+1}let o=n.changes(r);return{changes:r,range:ge.range(o.mapPos(i.anchor,1),o.mapPos(i.head,1))}})}const J_=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new zm(n,{overrideIndentation:o=>{let a=t[o];return a??-1}}),r=Gv(n,(o,a,u)=>{let f=Uv(i,o.from);if(f==null)return;/\S/.test(o.text)||(f=0);let d=/^\s*/.exec(o.text)[0],m=rf(n,f);(d!=m||u.from<o.from+d.length)&&(t[o.from]=f,a.push({from:o.from,to:o.from+d.length,insert:m}))});return r.changes.empty||e(n.update(r,{userEvent:"indent"})),!0},e9=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Gv(n,(t,i)=>{i.push({from:t.from,insert:n.facet(_v)})}),{userEvent:"input.indent"})),!0),t9=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Gv(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let o=Om(r,n.tabSize),a=0,u=rf(n,Math.max(0,o-um(n)));for(;a<r.length&&a<u.length&&r.charCodeAt(a)==u.charCodeAt(a);)a++;i.push({from:t.from+a,to:t.from+r.length,insert:u.slice(a)})}),{userEvent:"delete.dedent"})),!0),n9=n=>(n.setTabFocusMode(),!0),i9=[{key:"Ctrl-b",run:vM,shift:RM,preventDefault:!0},{key:"Ctrl-f",run:xM,shift:MM},{key:"Ctrl-p",run:kM,shift:DM},{key:"Ctrl-n",run:CM,shift:jM},{key:"Ctrl-a",run:x_,shift:D_},{key:"Ctrl-e",run:S_,shift:j_},{key:"Ctrl-d",run:PM},{key:"Ctrl-h",run:vb},{key:"Ctrl-k",run:U_},{key:"Ctrl-Alt-h",run:HM},{key:"Ctrl-o",run:F_},{key:"Ctrl-t",run:G_},{key:"Ctrl-v",run:bb}],s9=[{key:"ArrowLeft",run:vM,shift:RM,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:f_,shift:C_,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:b_,shift:O_,preventDefault:!0},{key:"ArrowRight",run:xM,shift:MM,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:h_,shift:E_,preventDefault:!0},{mac:"Cmd-ArrowRight",run:v_,shift:N_,preventDefault:!0},{key:"ArrowUp",run:kM,shift:DM,preventDefault:!0},{mac:"Cmd-ArrowUp",run:pC,shift:yC},{mac:"Ctrl-ArrowUp",run:hC,shift:dC},{key:"ArrowDown",run:CM,shift:jM,preventDefault:!0},{mac:"Cmd-ArrowDown",run:gC,shift:bC},{mac:"Ctrl-ArrowDown",run:bb,shift:mC},{key:"PageUp",run:hC,shift:dC},{key:"PageDown",run:bb,shift:mC},{key:"Home",run:y_,shift:M_,preventDefault:!0},{key:"Mod-Home",run:pC,shift:yC},{key:"End",run:g_,shift:R_,preventDefault:!0},{key:"Mod-End",run:gC,shift:bC},{key:"Enter",run:vC,shift:vC},{key:"Mod-a",run:L_},{key:"Backspace",run:vb,shift:vb,preventDefault:!0},{key:"Delete",run:PM,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:HM,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:__,preventDefault:!0},{mac:"Mod-Backspace",run:V_,preventDefault:!0},{mac:"Mod-Delete",run:q_,preventDefault:!0}].concat(i9.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),r9=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:m_,shift:A_},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:p_,shift:T_},{key:"Alt-ArrowUp",run:K_},{key:"Shift-Alt-ArrowUp",run:Q_},{key:"Alt-ArrowDown",run:Y_},{key:"Shift-Alt-ArrowDown",run:W_},{key:"Mod-Alt-ArrowUp",run:P_},{key:"Mod-Alt-ArrowDown",run:I_},{key:"Escape",run:H_},{key:"Mod-Enter",run:Z_},{key:"Alt-l",mac:"Ctrl-l",run:B_},{key:"Mod-i",run:z_,preventDefault:!0},{key:"Mod-[",run:t9},{key:"Mod-]",run:e9},{key:"Mod-Alt-\\",run:J_},{key:"Shift-Mod-k",run:X_},{key:"Shift-Mod-\\",run:k_},{key:"Mod-/",run:KH},{key:"Alt-A",run:QH},{key:"Ctrl-m",mac:"Shift-Alt-m",run:n9}].concat(s9);var xC={};class hm{constructor(e,t,i,r,o,a,u,f,d,m=0,p){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=o,this.score=a,this.buffer=u,this.bufferBase=f,this.curContext=d,this.lookAhead=m,this.parent=p}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new hm(e,[],t,i,i,0,[],0,r?new SC(r,r.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let i=e>>19,r=e&65535,{parser:o}=this.p,a=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),u=o.dynamicPrecedence(r);if(u&&(this.score+=u),i==0){r<o.minRepeatTerm&&this.reducePos<this.pos&&(this.reducePos=this.pos),this.pushState(o.getGoto(this.state,r,!0),this.reducePos),r<o.minRepeatTerm&&this.storeNode(r,this.reducePos,this.reducePos,a?8:4,!0),this.reduceContext(r,this.reducePos);return}let f=this.stack.length-(i-1)*3-(e&262144?6:0),d=f?this.stack[f-2]:this.p.ranges[0].from;r<o.minRepeatTerm&&d==this.reducePos&&this.reducePos<this.pos&&(this.reducePos=this.pos);let m=this.reducePos-d;m>=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(d==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=m):this.p.lastBigReductionSize<m&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=d,this.p.lastBigReductionSize=m));let p=f?this.stack[f-1]:0,b=this.bufferBase+this.buffer.length-p;if(r<o.minRepeatTerm||e&131072){let v=o.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(r,d,v,b+4,!0)}if(e&262144)this.state=this.stack[f];else{let v=this.stack[f-3];this.state=o.getGoto(v,r,!0)}for(;this.stack.length>f;)this.stack.pop();this.reduceContext(r,d)}storeNode(e,t,i,r=4,o=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let a=this.buffer.length;if(a>0&&this.buffer[a-4]==0&&this.buffer[a-1]>-1){if(t==i)return;if(this.buffer[a-2]>=t){this.buffer[a-2]=i;return}}}if(!o||this.pos==i)this.buffer.push(e,t,i,r);else{let a=this.buffer.length;if(a>0&&(this.buffer[a-4]!=0||this.buffer[a-1]<0)){let u=!1;for(let f=a;f>0&&this.buffer[f-2]>i;f-=4)if(this.buffer[f-1]>=0){u=!0;break}if(u)for(;a>0&&this.buffer[a-2]>i;)this.buffer[a]=this.buffer[a-4],this.buffer[a+1]=this.buffer[a-3],this.buffer[a+2]=this.buffer[a-2],this.buffer[a+3]=this.buffer[a-1],a-=4,r>4&&(r-=4)}this.buffer[a]=e,this.buffer[a+1]=t,this.buffer[a+2]=i,this.buffer[a+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let o=e,{parser:a}=this.p;this.pos=r;let u=a.stateFlag(o,1);!u&&(r>i||t<=a.maxNode)&&(this.reducePos=r),this.pushState(o,u?i:Math.min(i,this.reducePos)),this.shiftContext(t,i),t<=a.maxNode&&this.buffer.push(t,i,r,4)}else this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4)}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(t&&e.buffer[t-4]==0&&(t-=4);t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new hm(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new l9(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if((i&65536)==0)return!0;t.reduce(i)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let r=[];for(let o=0,a;o<t.length;o+=2)(a=t[o+1])!=this.state&&this.p.parser.hasAction(a,e)&&r.push(t[o],a);if(this.stack.length<120)for(let o=0;r.length<8&&o<t.length;o+=2){let a=t[o+1];r.some((u,f)=>f&1&&u==a)||r.push(t[o],a)}t=r}let i=[];for(let r=0;r<t.length&&i.length<4;r+=2){let o=t[r+1];if(o==this.state)continue;let a=this.split();a.pushState(o,this.pos),a.storeNode(0,a.pos,a.pos,4,!0),a.shiftContext(t[r],this.pos),a.reducePos=this.pos,a.score-=200,i.push(a)}return i}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let i=t>>19,r=t&65535,o=this.stack.length-i*3;if(o<0||e.getGoto(this.stack[o],r,!1)<0){let a=this.findForcedReduction();if(a==null)return!1;t=a}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],i=(r,o)=>{if(!t.includes(r))return t.push(r),e.allActions(r,a=>{if(!(a&393216))if(a&65536){let u=(a>>19)-o;if(u>1){let f=a&65535,d=this.stack.length-u*3;if(d>=0&&e.getGoto(this.stack[d],f,!1)>=0)return u<<19|65536|f}}else{let u=i(a,o+1);if(u!=null)return u}})};return i(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new SC(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class SC{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class l9{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class dm{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new dm(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new dm(this.stack,this.pos,this.index)}}function xd(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i<n.length;){let o=0;for(;;){let a=n.charCodeAt(i++),u=!1;if(a==126){o=65535;break}a>=92&&a--,a>=34&&a--;let f=a-32;if(f>=46&&(f-=46,u=!0),o+=f,u)break;o*=46}t?t[r++]=o:t=new e(o)}return t}class Dd{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const wC=new Dd;class o9{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=wC,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let i=this.range,r=this.rangeIndex,o=this.pos+e;for(;o<i.from;){if(!r)return null;let a=this.ranges[--r];o-=i.from-a.to,i=a}for(;t<0?o>i.to:o>=i.to;){if(r==this.ranges.length-1)return null;let a=this.ranges[++r];o+=a.from-i.to,i=a}return o}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t<this.chunk.length)i=this.pos+e,r=this.chunk.charCodeAt(t);else{let o=this.resolveOffset(e,1);if(o==null)return-1;if(i=o,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)r=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let a=this.rangeIndex,u=this.range;for(;u.to<=i;)u=this.ranges[++a];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>u.to&&(this.chunk2=this.chunk2.slice(0,u.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=i}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=wC,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class Fa{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;a9(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Fa.prototype.contextual=Fa.prototype.fallback=Fa.prototype.extend=!1;Fa.prototype.fallback=Fa.prototype.extend=!1;function a9(n,e,t,i,r,o){let a=0,u=1<<i,{dialect:f}=t.p.parser;e:for(;(u&n[a])!=0;){let d=n[a+1];for(let v=a+3;v<d;v+=2)if((n[v+1]&u)>0){let S=n[v];if(f.allows(S)&&(e.token.value==-1||e.token.value==S||c9(S,e.token.value,r,o))){e.acceptToken(S);break}}let m=e.next,p=0,b=n[a+2];if(e.next<0&&b>p&&n[d+b*3-3]==65535){a=n[d+b*3-1];continue e}for(;p<b;){let v=p+b>>1,S=d+v+(v<<1),w=n[S],A=n[S+1]||65536;if(m<w)b=v;else if(m>=A)p=v+1;else{a=n[S+2],e.advance();continue e}}break}}function kC(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function c9(n,e,t,i){let r=kC(t,i,e);return r<0||kC(t,i,n)<r}const Ei=typeof process<"u"&&xC&&/\bparse\b/.test(xC.LOG);let G0=null;function CC(n,e,t){let i=n.cursor(tn.IncludeAnonymous);for(i.moveTo(e);;)if(!(t<0?i.childBefore(e):i.childAfter(e)))for(;;){if((t<0?i.to<e:i.from>e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class u9{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?CC(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?CC(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let i=this.trees[t],r=this.index[t];if(r==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let o=i.children[r],a=this.start[t]+i.positions[r];if(a>e)return this.nextStart=a,null;if(o instanceof hn){if(a==e){if(a<this.safeFrom)return null;let u=a+o.length;if(u<=this.safeTo){let f=o.prop(at.lookAhead);if(!f||u+f<this.fragment.to)return o}}this.index[t]++,a+o.length>=Math.max(this.safeFrom,e)&&(this.trees.push(o),this.start.push(a),this.index.push(0))}else this.index[t]++,this.nextStart=a+o.length}}}class f9{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new Dd)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:o}=r,a=r.stateSlot(e.state,3),u=e.curContext?e.curContext.hash:0,f=0;for(let d=0;d<o.length;d++){if((1<<d&a)==0)continue;let m=o[d],p=this.tokens[d];if(!(i&&!m.fallback)&&((m.contextual||p.start!=e.pos||p.mask!=a||p.context!=u)&&(this.updateCachedToken(p,m,e),p.mask=a,p.context=u),p.lookAhead>p.end+25&&(f=Math.max(p.lookAhead,f)),p.value!=0)){let b=t;if(p.extended>-1&&(t=this.addActions(e,p.extended,p.end,t)),t=this.addActions(e,p.value,p.end,t),!m.extend&&(i=p,t>b))break}}for(;this.actions.length>t;)this.actions.pop();return f&&e.setLookAhead(f),!i&&e.pos==this.stream.end&&(i=new Dd,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Dd,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:o}=i.p;for(let a=0;a<o.specialized.length;a++)if(o.specialized[a]==e.value){let u=o.specializers[a](this.stream.read(e.start,e.end),i);if(u>=0&&i.p.parser.dialect.allows(u>>1)){(u&1)==0?e.value=u>>1:e.extended=u>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let o=0;o<r;o+=3)if(this.actions[o]==e)return r;return this.actions[r++]=e,this.actions[r++]=t,this.actions[r++]=i,r}addActions(e,t,i,r){let{state:o}=e,{parser:a}=e.p,{data:u}=a;for(let f=0;f<2;f++)for(let d=a.stateSlot(o,f?2:1);;d+=3){if(u[d]==65535)if(u[d+1]==1)d=hr(u,d+2);else{r==0&&u[d+1]==2&&(r=this.putAction(hr(u,d+2),t,i,r));break}u[d]==t&&(r=this.putAction(hr(u,d+1),t,i,r))}return r}}class h9{constructor(e,t,i,r){this.parser=e,this.input=t,this.ranges=r,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new o9(t,r),this.tokens=new f9(e,this.stream),this.topTerm=e.top[1];let{from:o}=r[0];this.stacks=[hm.start(this,e.top[0],o)],this.fragments=i.length&&this.stream.end-o>e.bufferLength*4?new u9(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,o;if(this.bigReductionCount>300&&e.length==1){let[a]=e;for(;a.forceReduce()&&a.stack.length&&a.stack[a.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let a=0;a<e.length;a++){let u=e[a];for(;;){if(this.tokens.mainToken=null,u.pos>t)i.push(u);else{if(this.advanceStack(u,i,e))continue;{r||(r=[],o=[]),r.push(u);let f=this.tokens.getMainToken(u);o.push(f.value,f.end)}}break}}if(!i.length){let a=r&&m9(r);if(a)return Ei&&console.log("Finish with "+this.stackID(a)),this.stackToTree(a);if(this.parser.strict)throw Ei&&r&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&r){let a=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,o,i);if(a)return Ei&&console.log("Force-finish "+this.stackID(a)),this.stackToTree(a.forceAll())}if(this.recovering){let a=this.recovering==1?1:this.recovering*3;if(i.length>a)for(i.sort((u,f)=>f.score-u.score);i.length>a;)i.pop();i.some(u=>u.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let a=0;a<i.length-1;a++){let u=i[a];for(let f=a+1;f<i.length;f++){let d=i[f];if(u.sameState(d)||u.buffer.length>500&&d.buffer.length>500)if((u.score-d.score||u.buffer.length-d.buffer.length)>0)i.splice(f--,1);else{i.splice(a--,1);continue e}}}i.length>12&&(i.sort((a,u)=>u.score-a.score),i.splice(12,i.length-12))}this.minStackPos=i[0].pos;for(let a=1;a<i.length;a++)i[a].pos<this.minStackPos&&(this.minStackPos=i[a].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,i){let r=e.pos,{parser:o}=this,a=Ei?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let d=e.curContext&&e.curContext.tracker.strict,m=d?e.curContext.hash:0;for(let p=this.fragments.nodeAt(r);p;){let b=this.parser.nodeSet.types[p.type.id]==p.type?o.getGoto(e.state,p.type.id):-1;if(b>-1&&p.length&&(!d||(p.prop(at.contextHash)||0)==m))return e.useNode(p,b),Ei&&console.log(a+this.stackID(e)+` (via reuse of ${o.getName(p.type.id)})`),!0;if(!(p instanceof hn)||p.children.length==0||p.positions[0]>0)break;let v=p.children[0];if(v instanceof hn&&p.positions[0]==0)p=v;else break}}let u=o.stateSlot(e.state,4);if(u>0)return e.reduce(u),Ei&&console.log(a+this.stackID(e)+` (via always-reduce ${o.getName(u&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let f=this.tokens.getActions(e);for(let d=0;d<f.length;){let m=f[d++],p=f[d++],b=f[d++],v=d==f.length||!i,S=v?e:e.split(),w=this.tokens.mainToken;if(S.apply(m,p,w?w.start:S.pos,b),Ei&&console.log(a+this.stackID(S)+` (via ${(m&65536)==0?"shift":`reduce of ${o.getName(m&65535)}`} for ${o.getName(p)} @ ${r}${S==e?"":", split"})`),v)return!0;S.pos>r?t.push(S):i.push(S)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return EC(e,t),!0}}runRecovery(e,t,i){let r=null,o=!1;for(let a=0;a<e.length;a++){let u=e[a],f=t[a<<1],d=t[(a<<1)+1],m=Ei?this.stackID(u)+" -> ":"";if(u.deadEnd&&(o||(o=!0,u.restart(),Ei&&console.log(m+this.stackID(u)+" (restarted)"),this.advanceFully(u,i))))continue;let p=u.split(),b=m;for(let v=0;v<10&&p.forceReduce()&&(Ei&&console.log(b+this.stackID(p)+" (via force-reduce)"),!this.advanceFully(p,i));v++)Ei&&(b=this.stackID(p)+" -> ");for(let v of u.recoverByInsert(f))Ei&&console.log(m+this.stackID(v)+" (via recover-insert)"),this.advanceFully(v,i);this.stream.end>u.pos?(d==u.pos&&(d++,f=0),u.recoverByDelete(f,d),Ei&&console.log(m+this.stackID(u)+` (via recover-delete ${this.parser.getName(f)})`),EC(u,i)):(!r||r.score<p.score)&&(r=p)}return r}stackToTree(e){return e.close(),hn.build({buffer:dm.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(G0||(G0=new WeakMap)).get(e);return t||G0.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function EC(n,e){for(let t=0;t<e.length;t++){let i=e[t];if(i.pos==n.pos&&i.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class d9{constructor(e,t,i){this.source=e,this.flags=t,this.disabled=i}allows(e){return!this.disabled||this.disabled[e]==0}}class mm extends nM{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let u=0;u<e.repeatNodeCount;u++)t.push("");let i=Object.keys(e.topRules).map(u=>e.topRules[u][1]),r=[];for(let u=0;u<t.length;u++)r.push([]);function o(u,f,d){r[u].push([f,f.deserialize(String(d))])}if(e.nodeProps)for(let u of e.nodeProps){let f=u[0];typeof f=="string"&&(f=at[f]);for(let d=1;d<u.length;){let m=u[d++];if(m>=0)o(m,f,u[d++]);else{let p=u[d+-m];for(let b=-m;b>0;b--)o(u[d++],f,p);d++}}}this.nodeSet=new zv(t.map((u,f)=>gi.define({name:f>=this.minRepeatTerm?void 0:u,id:f,props:r[f],top:i.indexOf(f)>-1,error:f==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(f)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=ZR;let a=xd(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let u=0;u<this.specializerSpecs.length;u++)this.specialized[u]=this.specializerSpecs[u].term;this.specializers=this.specializerSpecs.map(AC),this.states=xd(e.states,Uint32Array),this.data=xd(e.stateData),this.goto=xd(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(u=>typeof u=="number"?new Fa(a,u):u),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,i){let r=new h9(this,e,t,i);for(let o of this.wrappers)r=o(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let o=r[t+1];;){let a=r[o++],u=a&1,f=r[o++];if(u&&i)return f;for(let d=o+(a>>1);o<d;o++)if(r[o]==e)return f;if(u)return-1}}hasAction(e,t){let i=this.data;for(let r=0;r<2;r++)for(let o=this.stateSlot(e,r?2:1),a;;o+=3){if((a=i[o])==65535)if(i[o+1]==1)a=i[o=hr(i,o+2)];else{if(i[o+1]==2)return hr(i,o+2);break}if(a==t||a==0)return hr(i,o+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let o=this.stateSlot(e,1);r==null;o+=3){if(this.data[o]==65535)if(this.data[o+1]==1)o=hr(this.data,o+2);else break;r=t(hr(this.data,o+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=hr(this.data,i+2);else break;if((this.data[i+2]&1)==0){let r=this.data[i+1];t.some((o,a)=>a&1&&o==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(mm.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(o=>o.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let o=e.specializers.find(u=>u.from==i.external);if(!o)return i;let a=Object.assign(Object.assign({},i),{external:o.to});return t.specializers[r]=AC(a),a})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),i=t.map(()=>!1);if(e)for(let o of e.split(" ")){let a=t.indexOf(o);a>=0&&(i[a]=!0)}let r=null;for(let o=0;o<t.length;o++)if(!i[o])for(let a=this.dialects[t[o]],u;(u=this.data[a++])!=65535;)(r||(r=new Uint8Array(this.maxTerm+1)))[u]=1;return new d9(e,i,r)}static deserialize(e){return new mm(e)}}function hr(n,e){return n[e]|n[e+1]<<16}function m9(n){let e=null;for(let t of n){let i=t.p.stoppedAt;(t.pos==t.p.stream.end||i!=null&&t.pos>i)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function AC(n){if(n.external){let e=n.extend?1:0;return(t,i)=>n.external(t,i)<<1|e}return n.get}const p9=iM({String:qe.string,Number:qe.number,"True False":qe.bool,PropertyName:qe.propertyName,Null:qe.null,", :":qe.separator,"[ ]":qe.squareBracket,"{ }":qe.brace}),g9=mm.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[p9],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),y9=am.define({name:"json",parser:g9.configure({props:[oM.add({Object:oC({except:/^\s*\}/}),Array:oC({except:/^\s*\]/})}),TH.add({"Object Array":RH})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function b9(){return new gH(y9)}const v9=Pm.define([{tag:qe.propertyName,color:"var(--accent)"},{tag:qe.string,color:"var(--success)"},{tag:[qe.number,qe.bool,qe.null],color:"var(--warning)"},{tag:[qe.brace,qe.squareBracket,qe.separator],color:"var(--muted-foreground)"}]),x9=Ye.theme({"&":{fontSize:"12px",color:"var(--foreground)",backgroundColor:"transparent"},"&.cm-focused":{outline:"none"},".cm-content":{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace",caretColor:"var(--foreground)"},".cm-cursor, .cm-dropCursor":{borderLeftColor:"var(--foreground)"},".cm-gutters":{backgroundColor:"transparent",color:"var(--muted-foreground)",border:"none"},".cm-activeLine":{backgroundColor:"color-mix(in oklab, var(--foreground) 4%, transparent)"},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, ::selection":{backgroundColor:"color-mix(in oklab, var(--accent) 25%, transparent)"},".cm-matchingBracket, &.cm-focused .cm-matchingBracket":{backgroundColor:"color-mix(in oklab, var(--accent) 18%, transparent)",outline:"none"},".cm-placeholder":{color:"var(--muted-foreground)"}});function TC({value:n,onChange:e,readOnly:t=!1,placeholderText:i="{ }"}){const r=E.useRef(null),o=E.useRef(null),a=E.useRef(e);a.current=e;const u=E.useRef(new xf);return E.useEffect(()=>{if(!r.current)return;const f=[Ye.editable.of(!t),xt.readOnly.of(t)],d=xt.create({doc:n,extensions:[XI(),t_(),AH(),HH(),PI(),OH(v9),b9(),UI(i),XR.of([...r9,...u_]),u.current.of(f),Ye.updateListener.of(p=>{p.docChanged&&a.current(p.state.doc.toString())}),x9]}),m=new Ye({state:d,parent:r.current});return o.current=m,()=>{m.destroy(),o.current=null}},[]),E.useEffect(()=>{const f=o.current;f&&n!==f.state.doc.toString()&&f.dispatch({changes:{from:0,to:f.state.doc.length,insert:n}})},[n]),E.useEffect(()=>{var f;(f=o.current)==null||f.dispatch({effects:u.current.reconfigure([Ye.editable.of(!t),xt.readOnly.of(t)])})},[t]),x.jsx("div",{ref:r,className:"w-full overflow-hidden rounded-md border border-input bg-background py-1 text-left"})}const so=n=>JSON.stringify(n,null,2);function Ta({title:n,erased:e,copy:t,children:i}){return x.jsxs("section",{className:"border-t border-border py-4 first:border-t-0 first:pt-0",children:[x.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[x.jsx("h3",{className:"text-[12px] font-semibold uppercase tracking-wider text-muted-foreground",children:n}),e&&x.jsx(Ds,{tone:"warning",children:"erased"}),t!==void 0&&!e?x.jsx(vf,{value:t,label:`Copy ${n.toLowerCase()} JSON`,className:"ml-auto"}):null]}),e?x.jsx("p",{className:"m-0 text-[13px] italic text-muted-foreground",children:"This section was erased. Its digest is kept, so the chain still verifies."}):i]})}function S9({event:n}){var o,a,u,f,d,m;const e=new Set(pv(n)),t=(p,b)=>e.has(p)||ET(b),i=Object.entries(n.context??{}).filter(([p,b])=>b!==void 0&&p!=="$erased"),r=n.metadata&&Object.keys(n.metadata).length>0;return x.jsxs("div",{className:"flex flex-col",children:[x.jsx(Ta,{title:"Summary",children:x.jsxs("dl",{className:"m-0",children:[x.jsx(zt,{label:"Event id",copy:n.id,children:x.jsx(en,{children:n.id})}),x.jsx(zt,{label:"Tenant",copy:n.tenant,children:x.jsx(en,{children:n.tenant})}),x.jsxs(zt,{label:"Occurred",children:[us(n.occurredAt)," ",x.jsxs("span",{className:"text-muted-foreground",children:["(",Hs(n.occurredAt),")"]})]}),x.jsx(zt,{label:"Recorded",children:us(n.recordedAt)}),x.jsx(zt,{label:"Outcome",children:x.jsx(bv,{outcome:n.outcome})}),(n.description!==void 0||e.has("description"))&&x.jsx(zt,{label:"Description",children:t("description",n.description)?x.jsx("span",{className:"italic text-muted-foreground",children:"erased"}):n.description})]})}),x.jsxs(Ta,{title:"Actor",erased:t("actor",n.actor),copy:so(n.actor),children:[x.jsxs("dl",{className:"m-0",children:[x.jsx(zt,{label:"Id",copy:(o=n.actor)==null?void 0:o.id,children:x.jsx(en,{children:(a=n.actor)==null?void 0:a.id})}),((u=n.actor)==null?void 0:u.type)&&x.jsx(zt,{label:"Type",children:n.actor.type}),((f=n.actor)==null?void 0:f.name)&&x.jsx(zt,{label:"Name",children:n.actor.name}),((d=n.actor)==null?void 0:d.email)&&x.jsx(zt,{label:"Email",children:n.actor.email})]}),((m=n.actor)==null?void 0:m.metadata)&&Object.keys(n.actor.metadata).length>0&&x.jsx("div",{className:"mt-2",children:x.jsx(TC,{value:so(n.actor.metadata),onChange:()=>{},readOnly:!0})})]}),x.jsx(Ta,{title:`Targets (${Array.isArray(n.targets)?n.targets.length:0})`,erased:t("targets",n.targets),copy:so(n.targets),children:Array.isArray(n.targets)&&n.targets.length>0?x.jsx("ul",{className:"m-0 flex list-none flex-col gap-1.5 p-0",children:n.targets.map((p,b)=>x.jsxs("li",{className:"flex flex-wrap items-center gap-2 rounded-md border border-border px-2.5 py-1.5",children:[x.jsx(Ds,{tone:"muted",children:p.type}),x.jsx(en,{className:"min-w-0 truncate",children:p.id}),p.name&&x.jsx("span",{className:"text-[13px] text-muted-foreground",children:p.name}),x.jsx(vf,{value:p.id,label:`Copy target id ${p.id}`,className:"ml-auto"})]},`${p.type}:${p.id}:${b}`))}):x.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"No targets."})}),x.jsx(Ta,{title:"Context",erased:t("context",n.context),copy:so(n.context),children:i.length>0?x.jsx("dl",{className:"m-0",children:i.map(([p,b])=>x.jsx(zt,{label:p,children:typeof b=="string"?b:x.jsx(en,{children:JSON.stringify(b)})},p))}):x.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"No context captured."})}),x.jsx(Ta,{title:"Metadata",erased:t("metadata",n.metadata),copy:so(n.metadata),children:r?x.jsx(TC,{value:so(n.metadata),onChange:()=>{},readOnly:!0}):x.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"No metadata."})}),x.jsx(Ta,{title:"Integrity",children:x.jsxs("dl",{className:"m-0",children:[x.jsx(zt,{label:"Sequence",children:x.jsxs("span",{className:"tabular-nums",children:["#",n.seq]})}),x.jsx(zt,{label:"Hash",copy:n.integrity.hash,children:x.jsx(en,{className:"text-[11px]",children:n.integrity.hash})}),x.jsx(zt,{label:"Prev hash",copy:n.integrity.prevHash,children:x.jsx(en,{className:"text-[11px]",children:n.integrity.prevHash})}),Object.entries(n.integrity.digests??{}).map(([p,b])=>x.jsx(zt,{label:`Digest · ${p}`,copy:b,children:x.jsx(en,{className:bt("text-[11px]",e.has(p)&&"text-warning"),children:b})},p)),x.jsx(zt,{label:"Erased",children:e.size===0?x.jsx("span",{className:"text-muted-foreground",children:"none"}):x.jsx("span",{className:"flex flex-wrap gap-1",children:[...e].map(p=>x.jsx(Ds,{tone:"warning",children:p},p))})})]})})]})}function w9({event:n,open:e,onClose:t}){const i=Ho(),r=Lo(),o=new Set(pv(n)),[a,u]=Yt.useState(()=>Dy.filter(b=>!o.has(b))),[f,d]=Yt.useState(""),m=Eo({mutationFn:()=>Tj(n.tenant,n.id,{sections:a,...f.trim()?{reason:f.trim()}:{}}),onSuccess:b=>{r.setQueryData(["event",b.tenant,b.id],b),r.invalidateQueries({queryKey:["events"]}),r.invalidateQueries({queryKey:["overview"]}),i.add("success","Event erased",`${a.join(", ")} removed from ${b.id}`),t()},onError:b=>i.add("error",b instanceof Bo?b.body.error:"Failed to erase event")}),p=b=>u(v=>v.includes(b)?v.filter(S=>S!==b):[...v,b]);return x.jsxs(MT,{open:e,onClose:t,onConfirm:()=>m.mutate(),title:"Erase event data",confirmLabel:"Erase",danger:!0,loading:m.isPending,confirmDisabled:a.length===0,children:[x.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"Erasure removes the content of the selected sections permanently (e.g. for a GDPR request). The event, its sequence number and its digests stay, so the hash chain still verifies and the erasure itself is recorded in the log."}),x.jsxs("fieldset",{className:"m-0 flex flex-col gap-1.5 border-0 p-0",children:[x.jsx("legend",{className:"mb-1.5 text-xs font-medium text-foreground",children:"Sections"}),Dy.map(b=>x.jsxs("label",{className:bt("flex items-center gap-2 text-[13px]",o.has(b)?"text-muted-foreground":"cursor-pointer text-foreground"),children:[x.jsx("input",{type:"checkbox",className:"size-3.5 accent-[var(--destructive)]",checked:o.has(b)||a.includes(b),disabled:o.has(b),onChange:()=>p(b)}),x.jsx("span",{className:"font-mono text-[12px]",children:b}),o.has(b)&&x.jsx("span",{className:"text-xs",children:"(already erased)"})]},b))]}),x.jsxs("label",{className:"flex flex-col gap-1.5",children:[x.jsx("span",{className:"text-xs font-medium text-foreground",children:"Reason"}),x.jsx(gT,{rows:2,value:f,onChange:b=>d(b.target.value),placeholder:"e.g. GDPR erasure request #1234"})]})]})}function k9({tenant:n,id:e,initial:t,canErase:i,onClose:r}){const[o,a]=Yt.useState(!1),u=Li({queryKey:["event",n,e],queryFn:()=>Aj(n,e),placeholderData:t}),f=u.data;return x.jsx(H8,{open:!0,onClose:r,title:(f==null?void 0:f.action)??e,subtitle:f?x.jsxs(x.Fragment,{children:[x.jsxs("span",{className:"font-mono",children:["#",f.seq]})," · ",us(f.occurredAt)]}):void 0,actions:f?x.jsxs("div",{className:"flex items-center gap-1",children:[x.jsx(vf,{value:so(f),label:"Copy event JSON",className:"size-8"}),i&&pv(f).length<Dy.length&&x.jsx(vn,{variant:"danger",size:"sm",icon:x.jsx(q3,{className:"size-3.5"}),onClick:()=>a(!0),children:"Erase"})]}):void 0,children:u.isLoading&&!f?x.jsx(Dl,{label:"Loading event…"}):f?x.jsxs(x.Fragment,{children:[x.jsx(S9,{event:f}),o&&x.jsx(w9,{event:f,open:!0,onClose:()=>a(!1)})]}):x.jsx("p",{className:"text-[13px] text-muted-foreground",children:"Event not found."})})}const C9=50;function Au({value:n,onCommit:e,label:t,placeholder:i,icon:r,className:o}){const[a,u]=Yt.useState(n),f=Yt.useRef(e);return f.current=e,Yt.useEffect(()=>u(n),[n]),Yt.useEffect(()=>{if(a===n)return;const d=setTimeout(()=>f.current(a),400);return()=>clearTimeout(d)},[a]),x.jsxs("div",{className:bt("relative",o),children:[r?x.jsx("span",{className:"pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-muted-foreground",children:r}):null,x.jsx(Yu,{"aria-label":t,placeholder:i,value:a,onChange:d=>u(d.target.value),onBlur:()=>a!==n&&e(a),onKeyDown:d=>{d.key==="Enter"&&a!==n&&e(a)},className:r?"pl-8":void 0})]})}function E9({filters:n,onChange:e,actionNames:t}){const i=NT(n);return x.jsxs("div",{className:"mt-6 flex flex-col gap-2.5",role:"search","aria-label":"Event filters",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[x.jsx(Au,{label:"Search events",placeholder:"Search actions, actors, targets, metadata…",value:n.search,onCommit:r=>e({search:r}),icon:x.jsx(aj,{className:"size-3.5"}),className:"min-w-[14rem] flex-1"}),x.jsx(pT,{"aria-label":"Time range",value:n.range,onValueChange:r=>e({range:r}),options:OT,className:"w-44"}),x.jsx(f8,{value:n.outcome||"all",onValueChange:r=>e({outcome:r==="all"?"":r}),options:[{value:"all",label:"All"},{value:"success",label:"Success"},{value:"failure",label:"Failure"}]})]}),n.range==="custom"&&x.jsxs("div",{className:"flex flex-wrap items-center gap-2.5 text-[13px]",children:[x.jsxs("label",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"From"}),x.jsx(Yu,{type:"datetime-local","aria-label":"From",value:rk(n.from),onChange:r=>e({from:lk(r.target.value)}),className:"w-56"})]}),x.jsxs("label",{className:"flex items-center gap-2",children:[x.jsx("span",{className:"text-xs text-muted-foreground",children:"To"}),x.jsx(Yu,{type:"datetime-local","aria-label":"To",value:rk(n.to),onChange:r=>e({to:lk(r.target.value)}),className:"w-56"})]})]}),x.jsxs("div",{className:"grid grid-cols-1 gap-2.5 sm:grid-cols-2 lg:grid-cols-[2fr_1fr_1fr_1fr_1fr]",children:[x.jsx($8,{value:n.actions,onChange:r=>e({actions:r}),names:t}),x.jsx(Au,{label:"Actor id",placeholder:"Actor id",value:n.actorId,onCommit:r=>e({actorId:r})}),x.jsx(Au,{label:"Actor type",placeholder:"Actor type",value:n.actorType,onCommit:r=>e({actorType:r})}),x.jsx(Au,{label:"Target type",placeholder:"Target type",value:n.targetType,onCommit:r=>e({targetType:r})}),x.jsx(Au,{label:"Target id",placeholder:"Target id",value:n.targetId,onCommit:r=>e({targetId:r})})]}),i>0&&x.jsx("div",{children:x.jsxs(vn,{variant:"ghost",size:"sm",icon:x.jsx(gm,{className:"size-3.5"}),onClick:()=>e(q8),children:["Clear filters (",i,")"]})})]})}const qM="grid grid-cols-[minmax(0,1fr)_auto] items-center gap-x-4 gap-y-0.5 md:grid-cols-[7rem_minmax(0,1.3fr)_minmax(0,1fr)_minmax(0,1fr)_5.5rem]";function A9({event:n,showTenant:e,onOpen:t}){var i;return x.jsx("li",{children:x.jsxs("button",{onClick:t,className:bt(qM,"group w-full px-4 py-2.5 text-left transition-colors hover:bg-secondary/30"),"data-testid":"event-row",children:[x.jsx("span",{className:"order-2 whitespace-nowrap text-xs tabular-nums text-muted-foreground md:order-none",title:us(n.occurredAt),children:Hs(n.occurredAt)}),x.jsxs("span",{className:"order-1 min-w-0 md:order-none",children:[x.jsx("span",{className:"block truncate font-mono text-[13px] font-medium text-foreground",children:n.action}),x.jsxs("span",{className:"block truncate text-[11px] text-muted-foreground",children:[x.jsxs("span",{className:"font-mono",children:["#",n.seq]}),e?x.jsxs(x.Fragment,{children:[" · ",x.jsx("span",{className:"font-mono",children:n.tenant})]}):null]})]}),x.jsxs("span",{className:"order-3 min-w-0 truncate text-[13px] text-foreground md:order-none",children:[CT(n.actor),(i=n.actor)!=null&&i.type&&n.actor.type!=="user"?x.jsxs("span",{className:"ml-1 text-xs text-muted-foreground",children:["(",n.actor.type,")"]}):null]}),x.jsx("span",{className:"order-4 hidden min-w-0 truncate text-[13px] text-muted-foreground md:order-none md:block",children:C8(n.targets)}),x.jsxs("span",{className:"order-5 hidden items-center justify-end gap-1 md:order-none md:flex",children:[x.jsx(bv,{outcome:n.outcome}),x.jsx(Nb,{className:"size-4 shrink-0 text-muted-foreground/50 transition-transform group-hover:translate-x-0.5 group-hover:text-muted-foreground"})]})]})})}function RC({ctx:n}){const{tenant:e,portal:t}=n,[i,r]=gE(),o=Yt.useMemo(()=>Y8(i),[i]),a=sk(o).toString(),[u,f]=Yt.useState(0),d=Yt.useMemo(()=>Q8(o),[a,u]),m=B=>{r(K=>sk({...o,...B},new URLSearchParams(K)),{replace:!0})},p=Li({queryKey:["actions"],queryFn:kE,staleTime:6e4,enabled:n.can("action:read")}),b=h3({queryKey:["events",e,d],queryFn:({pageParam:B})=>Ej(e||void 0,d,{limit:C9,...B?{cursor:B}:{}}),initialPageParam:"",placeholderData:BD,getNextPageParam:B=>B.pageInfo.hasNextPage?B.pageInfo.endCursor??void 0:void 0}),v=Yt.useMemo(()=>{var B;return((B=b.data)==null?void 0:B.pages.flatMap(K=>K.items))??[]},[b.data]),S=Yt.useMemo(()=>{const B=new Set((p.data??[]).map(K=>K.name));for(const K of v)B.add(K.action);return[...B]},[p.data,v]),w=Yt.useRef(null),{hasNextPage:A,isFetchingNextPage:C,fetchNextPage:T}=b;Yt.useEffect(()=>{const B=w.current;if(!B||!A||typeof IntersectionObserver>"u")return;const K=new IntersectionObserver(F=>{F.some(Y=>Y.isIntersecting)&&!C&&T()});return K.observe(B),()=>K.disconnect()},[A,C,T]);const R=i.get("event"),N=i.get("eventTenant")||e,O=B=>r(K=>{const F=new URLSearchParams(K);return F.set("event",B.id),F.set("eventTenant",B.tenant),F}),z=()=>r(B=>{const K=new URLSearchParams(B);return K.delete("event"),K.delete("eventTenant"),K},{replace:!0}),D=NT(o)>0,j=Yt.useMemo(()=>({...d}),[d]);return x.jsxs(xl,{children:[x.jsx(vl,{title:"Events",description:t?"Everything that happened in your organization, newest first.":e?x.jsxs(x.Fragment,{children:["The audit log of ",x.jsx("span",{className:"font-mono",children:e}),", newest first."]}):"Every tenant's audit log, newest first.",actions:x.jsxs("div",{className:"flex items-center gap-2",children:[x.jsx(vn,{variant:"ghost",size:"icon","aria-label":"Refresh",title:"Refresh",onClick:()=>f(B=>B+1),children:x.jsx(rj,{className:bt("size-3.5",b.isFetching&&"animate-spin")})}),n.can("event:export")&&x.jsx(v6,{tenant:e,query:j,disabledReason:e?void 0:"Select a tenant to export its log"})]})}),t&&e&&n.can("integrity:read")&&x.jsx("div",{className:"mt-6",children:x.jsx(S6,{tenant:e})}),x.jsx(E9,{filters:o,onChange:m,actionNames:S}),b.isLoading?x.jsx(Dl,{label:"Loading events…"}):b.isError?x.jsx(Ji,{children:"Failed to load events."}):v.length===0?x.jsx(Ji,{children:D?"No events match these filters.":"No events recorded yet."}):x.jsxs(x.Fragment,{children:[x.jsxs("div",{className:"mt-4 overflow-hidden rounded-xl border border-border bg-card",children:[x.jsxs("div",{className:bt(qM,"hidden border-b border-border px-4 py-2 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground md:grid"),"aria-hidden":!0,children:[x.jsx("span",{children:"When"}),x.jsx("span",{children:"Action"}),x.jsx("span",{children:"Actor"}),x.jsx("span",{children:"Target"}),x.jsx("span",{className:"pr-5 text-right",children:"Outcome"})]}),x.jsx("ul",{className:"divide-y divide-border","aria-label":"Events",children:v.map(B=>x.jsx(A9,{event:B,showTenant:!e,onOpen:()=>O(B)},`${B.tenant}/${B.id}`))})]}),x.jsxs("div",{ref:w,className:"mt-4 flex items-center justify-center gap-3",children:[x.jsxs("span",{className:"text-xs text-muted-foreground",children:[v.length," event",v.length===1?"":"s",A?" loaded":""]}),A&&x.jsx(vn,{variant:"secondary",size:"sm",loading:C,onClick:()=>T(),children:"Load more"})]})]}),R&&N&&x.jsx(k9,{tenant:N,id:R,initial:v.find(B=>B.id===R&&B.tenant===N),canErase:!t&&!n.readonly&&n.can("event:erase"),onClose:z},`${N}/${R}`)]})}function T9({tenant:n}){const e=Li({queryKey:["checkpoints",n],queryFn:()=>jb(n),staleTime:3e4});if(e.isLoading)return x.jsx("span",{className:"text-muted-foreground",children:"…"});const t=[...e.data??[]].sort((i,r)=>r.at.localeCompare(i.at))[0];return t?x.jsxs("span",{title:`${t.kind} · ${t.keyId} · ${us(t.at)}`,children:[x.jsxs("span",{className:"tabular-nums",children:["#",t.seq]})," ",x.jsx("span",{className:"text-muted-foreground",children:Hs(t.at)})]}):x.jsx("span",{className:"text-muted-foreground",children:"none"})}function R9({t:n,ctx:e}){const t=n.head.baseSeq??1;return x.jsxs("tr",{children:[x.jsxs("td",{className:"px-4 py-3",children:[x.jsx(en,{className:"font-medium",children:n.key}),n.createdAt?x.jsxs("span",{className:"block text-xs text-muted-foreground",children:["since ",us(n.createdAt)]}):null]}),x.jsx("td",{className:"px-4 py-3 text-right text-[13px] tabular-nums",children:co(n.count)}),x.jsxs("td",{className:"px-4 py-3 text-[13px]",children:[x.jsxs("span",{className:"tabular-nums",children:["#",n.head.seq]})," ",x.jsx(en,{className:"text-muted-foreground",children:Xd(n.head.hash,8)}),n.head.updatedAt?x.jsx("span",{className:"block text-xs text-muted-foreground",children:Hs(n.head.updatedAt)}):null]}),x.jsx("td",{className:"px-4 py-3 text-[13px] tabular-nums",children:t>1?`#${t}`:x.jsx("span",{className:"text-muted-foreground",children:"#1"})}),x.jsx("td",{className:"px-4 py-3 text-[13px]",children:e.can("integrity:read")?x.jsx(T9,{tenant:n.key}):"—"}),x.jsx("td",{className:"px-4 py-3",children:x.jsxs("div",{className:"flex justify-end gap-1.5",children:[e.can("event:read")&&x.jsx(vn,{size:"sm",variant:"ghost",onClick:()=>e.go("/events",{tenant:n.key}),children:"Events"}),e.can("integrity:read")&&x.jsx(vn,{size:"sm",variant:"ghost",onClick:()=>e.go("/integrity",{tenant:n.key}),children:"Integrity"})]})})]})}function M9({ctx:n}){const e=Li({queryKey:["tenants"],queryFn:Db,staleTime:1e4}),t=e.data??[];return x.jsxs(xl,{children:[x.jsx(vl,{title:"Tenants",description:"Each tenant (customer organization) has its own hash chain. Tenants appear on their first event."}),e.isLoading?x.jsx(Dl,{label:"Loading tenants…"}):e.isError?x.jsx(Ji,{children:"Failed to load tenants."}):t.length===0?x.jsx(Ji,{children:"No tenants yet. Record an event to create one."}):x.jsx("div",{className:"mt-6 overflow-hidden rounded-xl border border-border bg-card",children:x.jsx("div",{className:"overflow-x-auto",children:x.jsxs("table",{className:"w-full border-collapse",children:[x.jsx("thead",{children:x.jsx("tr",{className:"border-b border-border",children:["Tenant","Events","Head","Base","Last checkpoint",""].map((i,r)=>x.jsx("th",{className:"whitespace-nowrap px-4 py-2.5 text-left text-[11px] font-semibold uppercase tracking-wider text-muted-foreground"+(i==="Events"?" text-right":""),children:i},i||r))})}),x.jsx("tbody",{className:"divide-y divide-border",children:t.map(i=>x.jsx(R9,{t:i,ctx:n},i.key))})]})})})]})}const FM=(n,e)=>n instanceof Bo?n.body.error:e,O9=/^[a-zA-Z0-9._:-]+$/;function N9({action:n,onClose:e}){const t=Ho(),i=Lo(),[r,o]=Yt.useState((n==null?void 0:n.name)??""),[a,u]=Yt.useState((n==null?void 0:n.description)??""),[f,d]=Yt.useState((n==null?void 0:n.group)??""),m=!n,p=O9.test(r.trim()),b=Eo({mutationFn:()=>{const{name:v,source:S,createdAt:w,updatedAt:A,...C}=n??{name:""};return Nj(r.trim(),{...C,description:a.trim()||void 0,group:f.trim()||void 0})},onSuccess:v=>{i.invalidateQueries({queryKey:["actions"]}),t.add("success",m?`Action "${v.name}" created`:"Action saved"),e()},onError:v=>t.add("error",FM(v,"Failed to save action"))});return x.jsxs(RT,{open:!0,onClose:e,title:m?"New action":n.name,footer:x.jsxs(x.Fragment,{children:[x.jsx(vn,{variant:"secondary",onClick:e,disabled:b.isPending,children:"Cancel"}),x.jsx(vn,{variant:"primary",loading:b.isPending,disabled:!p,onClick:()=>b.mutate(),children:m?"Create action":"Save changes"})]}),children:[m&&x.jsxs("label",{className:"flex flex-col gap-1.5",children:[x.jsx("span",{className:"text-xs font-medium text-foreground",children:"Name"}),x.jsx(Yu,{autoFocus:!0,value:r,onChange:v=>o(v.target.value),placeholder:"invoice.paid",className:"font-mono"}),x.jsxs("span",{className:"text-xs text-muted-foreground",children:["Dot-delimited; letters, digits and ",x.jsx("code",{className:"font-mono",children:". _ - :"}),"."]})]}),x.jsxs("label",{className:"flex flex-col gap-1.5",children:[x.jsx("span",{className:"text-xs font-medium text-foreground",children:"Description"}),x.jsx(gT,{rows:3,value:a,onChange:v=>u(v.target.value),placeholder:"What does this action mean?"})]}),x.jsxs("label",{className:"flex flex-col gap-1.5",children:[x.jsx("span",{className:"text-xs font-medium text-foreground",children:"Group"}),x.jsx(Yu,{value:f,onChange:v=>d(v.target.value),placeholder:"Billing"})]})]})}function D9({ctx:n}){const e=Ho(),t=Lo(),i=Li({queryKey:["actions"],queryFn:kE}),[r,o]=Yt.useState(null),[a,u]=Yt.useState(null),f=!n.readonly&&!n.portal&&n.can("action:update"),d=!n.readonly&&!n.portal&&n.can("action:delete"),m=Eo({mutationFn:b=>Dj(b),onSuccess:(b,v)=>{t.invalidateQueries({queryKey:["actions"]}),e.add("success",`Action "${v}" deleted`),u(null)},onError:b=>e.add("error",FM(b,"Failed to delete action"))}),p=A8(i.data??[]);return x.jsxs(xl,{children:[x.jsx(vl,{title:"Actions",description:n.portal?"The kinds of events this log records.":"The action catalog. Entries defined in code are read-only here; entries added in the panel can be edited.",actions:f?x.jsx(vn,{variant:"primary",icon:x.jsx(ij,{className:"size-3.5"}),onClick:()=>o("new"),children:"New action"}):void 0}),i.isLoading?x.jsx(Dl,{label:"Loading actions…"}):i.isError?x.jsx(Ji,{children:"Failed to load the action catalog."}):p.length===0?x.jsxs(Ji,{children:["No actions in the catalog. Define them in code with"," ",x.jsx("code",{className:"font-mono",children:"defineActions"}),f?" or add one here":"","."]}):x.jsx("div",{className:"mt-6 flex flex-col gap-6",children:p.map(({group:b,actions:v})=>x.jsxs("section",{children:[x.jsx("h2",{className:"text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:b}),x.jsx("div",{className:"mt-2 overflow-hidden rounded-xl border border-border bg-card",children:x.jsx("ul",{className:"divide-y divide-border",children:v.map(S=>{const w=T8(S);return x.jsxs("li",{className:"flex items-start gap-3 px-4 py-3",children:[x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[x.jsx("span",{className:"font-mono text-[13px] font-medium text-foreground",children:S.name}),S.source==="code"&&x.jsx(Ds,{tone:"muted",children:"code"}),S.deprecated&&x.jsx(Ds,{tone:"warning",children:"deprecated"})]}),S.description?x.jsx("p",{className:"m-0 mt-0.5 text-[13px] text-muted-foreground",children:S.description}):null,S.targets&&S.targets.length>0?x.jsxs("p",{className:"m-0 mt-1 text-xs text-muted-foreground",children:["Targets: ",x.jsx("span",{className:"font-mono",children:S.targets.join(", ")})]}):null]}),n.can("event:read")&&x.jsx(vn,{size:"sm",variant:"ghost",onClick:()=>n.go("/events",{actions:S.name}),children:"Events"}),f&&w&&x.jsx(vn,{size:"icon",variant:"ghost","aria-label":`Edit ${S.name}`,title:"Edit",onClick:()=>o(S),children:x.jsx(tj,{className:"size-3.5"})}),d&&w&&x.jsx(vn,{size:"icon",variant:"ghost","aria-label":`Delete ${S.name}`,title:"Delete",onClick:()=>u(S),children:x.jsx(yj,{className:"size-3.5"})})]},S.name)})})})]},b))}),r&&x.jsx(N9,{action:r==="new"?void 0:r,onClose:()=>o(null)}),x.jsx(MT,{open:a!==null,onClose:()=>u(null),onConfirm:()=>a&&m.mutate(a.name),title:"Delete action",confirmLabel:"Delete",danger:!0,loading:m.isPending,children:x.jsxs("p",{className:"m-0 text-[13px] text-muted-foreground",children:["Remove ",x.jsx("span",{className:"font-mono text-foreground",children:a==null?void 0:a.name})," from the catalog? Recorded events keep their action; only the documentation goes."]})})]})}const MC=(n,e)=>n instanceof Bo?n.body.error:e;function j9({ctx:n}){const e=Li({queryKey:["tenants"],queryFn:Db,staleTime:3e4}),t=e.data??[];return e.isLoading?x.jsx(Dl,{label:"Loading tenants…"}):t.length===0?x.jsx(Ji,{children:"No tenants yet."}):x.jsxs("div",{className:"mt-6",children:[x.jsx("p",{className:"text-[13px] text-muted-foreground",children:"Each tenant has its own chain. Choose one to verify:"}),x.jsx("div",{className:"mt-3 overflow-hidden rounded-xl border border-border bg-card",children:x.jsx("ul",{className:"divide-y divide-border",children:t.map(i=>x.jsx("li",{children:x.jsxs("button",{onClick:()=>n.setTenant(i.key),className:"group flex w-full items-center gap-3 px-4 py-3 text-left transition-colors hover:bg-secondary/30",children:[x.jsx(en,{className:"min-w-0 flex-1 truncate font-medium",children:i.key}),x.jsxs("span",{className:"text-xs tabular-nums text-muted-foreground",children:["head #",i.head.seq]}),x.jsx(Nb,{className:"size-4 text-muted-foreground/50 group-hover:text-muted-foreground"})]})},i.key))})})]})}function L9({ctx:n}){var S,w,A;const{tenant:e,portal:t}=n,i=Ho(),r=Lo(),o=Li({queryKey:["tenant",e],queryFn:()=>Cj(e),enabled:e!==""&&!t&&n.can("tenant:read")}),a=Li({queryKey:["checkpoints",e],queryFn:()=>jb(e),enabled:e!==""}),u=Eo({mutationKey:["verify",e],mutationFn:()=>wE(e),onError:C=>i.add("error",MC(C,"Verification failed to run"))}),f=Eo({mutationFn:()=>Mj(e),onSuccess:C=>{r.invalidateQueries({queryKey:["checkpoints",e]}),i.add("success","Checkpoint created",`Signed #${C.seq} with key ${C.keyId}`)},onError:C=>i.add("error",MC(C,"Failed to create checkpoint"))}),{reset:d}=u;Yt.useEffect(()=>d(),[e,d]);const m=((S=n.config.features)==null?void 0:S.signer)!==!1,p=!t&&!n.readonly&&m&&n.can("integrity:checkpoint")&&e!=="",b=[...a.data??[]].sort((C,T)=>T.at.localeCompare(C.at)),v=(w=o.data)==null?void 0:w.head;return x.jsxs(xl,{children:[x.jsx(vl,{title:"Integrity",description:e?x.jsxs(x.Fragment,{children:["Hash chain and signed checkpoints for ",x.jsx("span",{className:"font-mono",children:e}),"."]}):"Every tenant's log is a hash chain, periodically signed.",actions:x.jsxs("a",{href:Oj(),target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-[13px] font-medium text-muted-foreground hover:text-foreground",children:["Public keys (JWKS) ",x.jsx(G3,{className:"size-3.5"})]})}),e?x.jsxs("div",{className:"mt-6 flex flex-col gap-5",children:[v&&x.jsx(k0,{title:"Chain head",children:x.jsxs("dl",{className:"m-0 grid grid-cols-1 gap-x-6 sm:grid-cols-2",children:[x.jsx(zt,{label:"Head seq",children:x.jsxs("span",{className:"tabular-nums",children:["#",v.seq]})}),x.jsx(zt,{label:"Retained events",children:co((A=o.data)==null?void 0:A.count)}),x.jsx(zt,{label:"Head hash",copy:v.hash,children:x.jsx(en,{children:Xd(v.hash,16)})}),x.jsxs(zt,{label:"Base seq",children:[x.jsxs("span",{className:"tabular-nums",children:["#",v.baseSeq??1]}),(v.baseSeq??1)>1?x.jsx("span",{className:"text-muted-foreground",children:" (older events pruned)"}):null]}),x.jsx(zt,{label:"Last append",children:v.updatedAt?x.jsx("span",{title:us(v.updatedAt),children:Hs(v.updatedAt)}):"—"})]})}),x.jsx(k0,{title:"Verification",description:"Recomputes every digest and hash, checks the links between events, and verifies checkpoint signatures.",actions:x.jsx(vn,{variant:"primary",size:"sm",icon:x.jsx(Bd,{className:"size-3.5"}),loading:u.isPending,onClick:()=>u.mutate(),children:u.data?"Verify again":"Verify chain"}),children:u.data?x.jsx(HT,{report:u.data,checkpoints:a.data}):x.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"Not verified in this session yet."})}),x.jsx(k0,{title:"Checkpoints",description:m?"Signed chain heads. Events up to a checkpoint cannot be altered without breaking its signature.":"No signer is configured, so checkpoints cannot be created.",actions:p?x.jsx(vn,{variant:"secondary",size:"sm",icon:x.jsx(J3,{className:"size-3.5"}),loading:f.isPending,onClick:()=>f.mutate(),children:"Create checkpoint"}):void 0,children:a.isLoading?x.jsx(Dl,{label:"Loading checkpoints…"}):b.length===0?x.jsx("p",{className:"m-0 text-[13px] text-muted-foreground",children:"No checkpoints yet."}):x.jsx("div",{className:"-mx-4 -my-4 overflow-x-auto",children:x.jsxs("table",{className:"w-full border-collapse","aria-label":"Checkpoints",children:[x.jsx("thead",{children:x.jsx("tr",{className:"border-b border-border",children:["Seq","Kind","Hash","Key","Signed"].map(C=>x.jsx("th",{className:"whitespace-nowrap px-4 py-2.5 text-left text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:C},C))})}),x.jsx("tbody",{className:"divide-y divide-border",children:b.map(C=>x.jsxs("tr",{children:[x.jsxs("td",{className:"px-4 py-2.5 text-[13px] tabular-nums",children:["#",C.seq]}),x.jsx("td",{className:"px-4 py-2.5",children:x.jsx(Ds,{tone:C.kind==="base"?"warning":"accent",children:C.kind})}),x.jsx("td",{className:"px-4 py-2.5",children:x.jsxs("span",{className:"flex items-center gap-1",children:[x.jsx(en,{className:"text-muted-foreground",children:Xd(C.hash,10)}),x.jsx(vf,{value:C.hash,label:`Copy checkpoint hash #${C.seq}`})]})}),x.jsxs("td",{className:"px-4 py-2.5",children:[x.jsx(en,{children:C.keyId})," ",x.jsx("span",{className:"text-xs text-muted-foreground",children:C.alg})]}),x.jsx("td",{className:"whitespace-nowrap px-4 py-2.5 text-xs tabular-nums text-muted-foreground",title:us(C.at),children:Hs(C.at)})]},C.id))})]})})})]}):t?x.jsx(Ji,{children:"No tenant in scope."}):x.jsx(j9,{ctx:n})]})}function B9({ctx:n}){const e=Ho(),t=Lo(),i=Li({queryKey:["streams"],queryFn:jj,refetchInterval:5e3}),r=!n.readonly&&n.can("stream:retry"),o=Eo({mutationFn:({name:u,tenant:f})=>Lj(u,f),onSuccess:(u,{name:f,tenant:d})=>{t.invalidateQueries({queryKey:["streams"]}),e.add("success","Retry scheduled",d?`${f} · ${d}`:f)},onError:u=>e.add("error",u instanceof Bo?u.body.error:"Retry failed")}),a=(i.data??[]).map(u=>({...u,tenants:n.tenant?u.tenants.filter(f=>f.tenant===n.tenant):u.tenants}));return x.jsxs(xl,{children:[x.jsx(vl,{title:"Streams",description:"Sinks pull from each tenant's chain with their own cursor; a failing sink backs off without blocking the others."}),i.isLoading?x.jsx(Dl,{label:"Loading streams…"}):i.isError?x.jsx(Ji,{children:"Failed to load streams."}):a.length===0?x.jsx(Ji,{children:"No streams configured."}):x.jsx("div",{className:"mt-6 flex flex-col gap-5",children:a.map(u=>x.jsxs("section",{"aria-label":`Stream ${u.name}`,className:"overflow-hidden rounded-xl border border-border bg-card",children:[x.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-border px-4 py-3",children:[x.jsx(Ny,{health:Oy([u])}),x.jsxs("div",{className:"min-w-0 flex-1",children:[x.jsx(en,{className:"text-[13px] font-semibold",children:u.name}),x.jsx("span",{className:"ml-2 text-xs text-muted-foreground",children:u.kind})]}),r&&u.tenants.some(f=>f.failures>0)&&x.jsx(vn,{size:"sm",variant:"secondary",icon:x.jsx(f2,{className:"size-3.5"}),onClick:()=>o.mutate({name:u.name}),children:"Retry all"})]}),u.tenants.length===0?x.jsx("p",{className:"m-0 px-4 py-4 text-[13px] text-muted-foreground",children:"No tenant cursors yet."}):x.jsx("div",{className:"overflow-x-auto",children:x.jsxs("table",{className:"w-full border-collapse",children:[x.jsx("thead",{children:x.jsx("tr",{className:"border-b border-border",children:["Tenant","Status","Cursor","Lag","Failures","Last error","Delivered",""].map((f,d)=>x.jsx("th",{className:"whitespace-nowrap px-4 py-2 text-left text-[11px] font-semibold uppercase tracking-wider text-muted-foreground",children:f},f||d))})}),x.jsx("tbody",{className:"divide-y divide-border",children:u.tenants.map(f=>{var d,m;return x.jsxs("tr",{children:[x.jsx("td",{className:"px-4 py-2.5",children:x.jsx(en,{children:f.tenant})}),x.jsx("td",{className:"px-4 py-2.5",children:x.jsx(Ny,{health:gv(f)})}),x.jsxs("td",{className:"px-4 py-2.5 text-[13px] tabular-nums",children:["#",f.cursor,x.jsxs("span",{className:"text-muted-foreground",children:[" / #",f.headSeq]})]}),x.jsx("td",{className:"px-4 py-2.5 text-[13px] tabular-nums",children:co(f.lag)}),x.jsxs("td",{className:"px-4 py-2.5 text-[13px] tabular-nums",children:[f.failures>0?x.jsx("span",{className:"text-destructive",children:f.failures}):x.jsx("span",{className:"text-muted-foreground",children:"0"}),f.nextAttemptAt?x.jsxs("span",{className:"block text-xs text-muted-foreground",children:["next ",Hs(f.nextAttemptAt)]}):null]}),x.jsx("td",{className:"max-w-[260px] px-4 py-2.5 text-xs text-muted-foreground",children:f.lastError?x.jsxs("span",{title:`${f.lastError}
|
|
244
|
+
${us(f.lastErrorAt)}`,children:[x.jsx("span",{className:"block truncate text-destructive",children:w8(f.lastError,120)}),Hs(f.lastErrorAt)]}):"—"}),x.jsx("td",{className:"whitespace-nowrap px-4 py-2.5 text-xs tabular-nums text-muted-foreground",title:us(f.lastDeliveredAt),children:Hs(f.lastDeliveredAt)}),x.jsx("td",{className:"px-4 py-2.5 text-right",children:r&&f.failures>0&&x.jsx(vn,{size:"sm",variant:"secondary",icon:x.jsx(f2,{className:"size-3.5"}),loading:o.isPending&&((d=o.variables)==null?void 0:d.name)===u.name&&((m=o.variables)==null?void 0:m.tenant)===f.tenant,onClick:()=>o.mutate({name:u.name,tenant:f.tenant}),"aria-label":`Retry ${u.name} for ${f.tenant}`,children:"Retry"})})]},f.tenant)})})]})})]},u.name))})]})}const z9="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20326%20332'%20width='326'%20height='332'%20role='img'%20aria-label='xtandard-audit'%3e%3ctitle%3extandard-audit%3c/title%3e%3cdefs%3e%3clinearGradient%20id='lime'%20x1='0'%20y1='-72'%20x2='326'%20y2='260'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23C8F150'/%3e%3cstop%20offset='1'%20stop-color='%2397CC1B'/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20transform='translate(0%200)%20scale(1.00000)%20translate(0%2072)'%20fill='url(%23lime)'%3e%3cpath%20fill-rule='evenodd'%20d='M21.03%2023.37A14%2014%200%200%201%2031.44%200L87.55%200A10%2010%200%200%201%2094.98%203.31L198.16%20117.96A18%2018%200%200%201%20198.16%20142.04L94.98%20256.69A10%2010%200%200%201%2087.55%20260L31.44%20260A14%2014%200%200%201%2021.03%20236.63L113.39%20134.01A6%206%200%200%200%20113.39%20125.99Z'/%3e%3cpath%20fill-rule='evenodd'%20d='M180.82%20200.91A8%208%200%200%201%20180.82%20190.2L216.05%20151.05A8%208%200%200%201%20227.95%20151.05L310.98%20243.31A10%2010%200%200%201%20303.55%20260L238.45%20260A10%2010%200%200%201%20231.02%20256.69Z'/%3e%3cpath%20fill-rule='evenodd'%20d='M180.82%2069.8A8%208%200%200%201%20180.82%2059.09L191.42%2047.31A10%2010%200%200%201%20198.85%2044L263.95%2044A10%2010%200%200%201%20271.38%2060.69L227.95%20108.95A8%208%200%200%201%20216.05%20108.95Z'/%3e%3cpath%20fill-rule='evenodd'%20d='M197.4%20-72H291.4Q301.4%20-72%20301.4%20-62V-22.4C301.4%2014.8%20274.04%2037.12%20244.4%2052C214.76%2037.12%20187.4%2014.8%20187.4%20-22.4V-62Q187.4%20-72%20197.4%20-72ZM221.79%20-22.85A4%204%200%200%201%20227.44%20-22.62L234.68%20-14.74A3%203%200%200%200%20239.22%20-14.87L262.22%20-43.02A4%204%200%200%201%20267.85%20-43.58L280.23%20-33.46A4%204%200%200%201%20280.8%20-27.83L240.28%2021.75A3%203%200%200%201%20235.75%2021.88L209.77%20-6.37A4%204%200%200%201%20210.01%20-12.03Z'/%3e%3c/g%3e%3c/svg%3e",P9="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20326%20332'%20width='326'%20height='332'%20role='img'%20aria-label='xtandard-audit'%3e%3ctitle%3extandard-audit%3c/title%3e%3cdefs%3e%3clinearGradient%20id='lime'%20x1='0'%20y1='-72'%20x2='326'%20y2='260'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%239FD12A'/%3e%3cstop%20offset='1'%20stop-color='%235E900C'/%3e%3c/linearGradient%3e%3c/defs%3e%3cg%20transform='translate(0%200)%20scale(1.00000)%20translate(0%2072)'%20fill='url(%23lime)'%3e%3cpath%20fill-rule='evenodd'%20d='M21.03%2023.37A14%2014%200%200%201%2031.44%200L87.55%200A10%2010%200%200%201%2094.98%203.31L198.16%20117.96A18%2018%200%200%201%20198.16%20142.04L94.98%20256.69A10%2010%200%200%201%2087.55%20260L31.44%20260A14%2014%200%200%201%2021.03%20236.63L113.39%20134.01A6%206%200%200%200%20113.39%20125.99Z'/%3e%3cpath%20fill-rule='evenodd'%20d='M180.82%20200.91A8%208%200%200%201%20180.82%20190.2L216.05%20151.05A8%208%200%200%201%20227.95%20151.05L310.98%20243.31A10%2010%200%200%201%20303.55%20260L238.45%20260A10%2010%200%200%201%20231.02%20256.69Z'/%3e%3cpath%20fill-rule='evenodd'%20d='M180.82%2069.8A8%208%200%200%201%20180.82%2059.09L191.42%2047.31A10%2010%200%200%201%20198.85%2044L263.95%2044A10%2010%200%200%201%20271.38%2060.69L227.95%20108.95A8%208%200%200%201%20216.05%20108.95Z'/%3e%3cpath%20fill-rule='evenodd'%20d='M197.4%20-72H291.4Q301.4%20-72%20301.4%20-62V-22.4C301.4%2014.8%20274.04%2037.12%20244.4%2052C214.76%2037.12%20187.4%2014.8%20187.4%20-22.4V-62Q187.4%20-72%20197.4%20-72ZM221.79%20-22.85A4%204%200%200%201%20227.44%20-22.62L234.68%20-14.74A3%203%200%200%200%20239.22%20-14.87L262.22%20-43.02A4%204%200%200%201%20267.85%20-43.58L280.23%20-33.46A4%204%200%200%201%20280.8%20-27.83L240.28%2021.75A3%203%200%200%201%20235.75%2021.88L209.77%20-6.37A4%204%200%200%201%20210.01%20-12.03Z'/%3e%3c/g%3e%3c/svg%3e",I9=[{path:"/",label:"Overview",match:n=>n==="/",requires:"tenant:read",adminOnly:!0},{path:"/events",label:"Events",match:n=>n.startsWith("/events"),requires:"event:read"},{path:"/tenants",label:"Tenants",match:n=>n.startsWith("/tenants"),requires:"tenant:read",adminOnly:!0},{path:"/actions",label:"Actions",match:n=>n.startsWith("/actions"),requires:"action:read"},{path:"/integrity",label:"Integrity",match:n=>n.startsWith("/integrity"),requires:"integrity:read"},{path:"/streams",label:"Streams",match:n=>n.startsWith("/streams"),requires:"stream:read",adminOnly:!0,streams:!0}],H9=["tenant","token"];function _9(){return typeof window<"u"&&window.__AUDIT_CONFIG__||{}}function U9({locationHook:n,base:e="",logoUrl:t,initialTenant:i,showThemeToggle:r=!0}){return x.jsx(pE,{hook:n??bE,base:e,children:x.jsx(V9,{logoUrl:t,initialTenant:i,showThemeToggle:r})})}function V9({logoUrl:n,initialTenant:e,showThemeToggle:t}){var j;const i=_9(),[r,o]=dE(),[a,u]=gE(),f=Li({queryKey:["config"],queryFn:wj,staleTime:6e4}),d=f.data??{...i},m=d.readonly??!1,p=d.portal??!1,b=B=>k8(d,B),v=d.title||"@xtandard/audit",S=n??d.logoUrl,A=Li({queryKey:["tenants"],queryFn:Db,staleTime:3e4,enabled:f.isSuccess&&!p&&b("tenant:read")}).data??[],C=p?d.tenant??"":a.get("tenant")??e??"",T=(B,K={})=>{const F=new URLSearchParams;for(const V of H9){const Z=a.get(V);Z&&F.set(V,Z)}for(const[V,Z]of Object.entries(K))Z?F.set(V,Z):F.delete(V);const Y=F.toString();o(Y?`${B}?${Y}`:B)},R=B=>{u(K=>{const F=new URLSearchParams(K);return B?F.set("tenant",B):F.delete("tenant"),F.delete("event"),F.delete("eventTenant"),F},{replace:!1})},N=((j=d.features)==null?void 0:j.streams)!==!1,O=I9.filter(B=>(!p||!B.adminOnly)&&b(B.requires)&&(!B.streams||N)),z={config:d,readonly:m,portal:p,tenant:C,setTenant:R,go:T,can:b},D=!p&&b("tenant:read");return f.isError&&!i.title?x.jsx("div",{className:"flex h-screen items-center justify-center bg-background px-4 text-center",children:x.jsx("p",{className:"text-[13px] text-muted-foreground",children:"Could not load the panel configuration. Check that the API is reachable and that you are signed in."})}):x.jsxs("div",{className:"flex flex-col h-screen overflow-hidden bg-background",children:[x.jsxs("header",{className:"sticky top-0 z-40 border-b border-border bg-background/80 backdrop-blur",children:[x.jsxs("div",{className:"mx-auto flex h-14 max-w-6xl items-center gap-3 px-4 sm:px-6",children:[x.jsx("div",{className:"flex items-center gap-2 shrink-0",children:S?x.jsx("img",{src:S,alt:v,className:"h-7 max-w-[320px] object-contain"}):x.jsxs(x.Fragment,{children:[x.jsx("img",{src:P9,alt:"","aria-hidden":!0,className:"h-6 w-auto dark:hidden"}),x.jsx("img",{src:z9,alt:"","aria-hidden":!0,className:"hidden h-6 w-auto dark:block"}),x.jsx("span",{className:"text-sm font-semibold tracking-tight",children:v})]})}),p?C?x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-border select-none",children:"/"}),x.jsx("span",{className:"font-mono text-[13px] text-muted-foreground",children:C})]}):null:b("tenant:read")?x.jsxs(x.Fragment,{children:[x.jsx("span",{className:"text-border select-none",children:"/"}),x.jsx(pT,{"aria-label":"Tenant",value:C,onValueChange:R,options:[{value:"",label:"All tenants"},...A.map(B=>({value:B.key,label:B.key})),...C&&!A.some(B=>B.key===C)?[{value:C,label:C}]:[]],className:"w-48 font-mono"})]}):null,x.jsxs("div",{className:"ml-auto flex items-center gap-2",children:[m&&x.jsxs("span",{className:"flex items-center gap-1 rounded-md border border-warning/30 bg-warning/10 px-2 py-0.5 text-xs font-medium text-warning",children:[x.jsx(Y3,{className:"size-3"}),"Read-only"]}),p&&x.jsx("span",{className:"rounded-md border border-accent/30 bg-accent/10 px-2 py-0.5 text-xs font-medium text-accent",children:"Portal"}),t&&x.jsx(L4,{})]})]}),O.length>1&&x.jsx("nav",{className:"mx-auto flex max-w-6xl items-center gap-1 overflow-x-auto px-2 sm:px-4","aria-label":"Main navigation",children:O.map(({path:B,label:K,match:F})=>{const Y=F(r)||!D&&r==="/"&&B==="/events";return x.jsx("button",{onClick:()=>T(B),"aria-current":Y?"page":void 0,className:bt("whitespace-nowrap px-3 py-2.5 text-[13px] font-medium transition-colors",Y?"relative text-foreground after:absolute after:inset-x-3 after:-bottom-px after:h-0.5 after:rounded-full after:bg-foreground":"text-muted-foreground hover:text-foreground"),children:K},B)})})]}),x.jsx("main",{className:"flex-1 overflow-y-auto overflow-x-hidden",children:f.isLoading&&!i.title?null:x.jsxs(w3,{children:[x.jsx(Aa,{path:"/events",children:x.jsx(RC,{ctx:z})}),!p&&x.jsx(Aa,{path:"/tenants",children:x.jsx(M9,{ctx:z})}),x.jsx(Aa,{path:"/actions",children:x.jsx(D9,{ctx:z})}),x.jsx(Aa,{path:"/integrity",children:x.jsx(L9,{ctx:z})}),!p&&x.jsx(Aa,{path:"/streams",children:x.jsx(B9,{ctx:z})}),x.jsx(Aa,{children:f.isSuccess?D?x.jsx(U8,{ctx:z}):x.jsx(RC,{ctx:z}):null})]})})]})}_j();const OC=new URLSearchParams(window.location.search).get("token");OC&&Sj(OC);const q9=new e3({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1}}}),GM=document.getElementById("root");if(!GM)throw new Error("Root element not found");var VC;const F9=(((VC=window.__AUDIT_CONFIG__)==null?void 0:VC.basePath)??"").replace(/\/$/,"");pD.createRoot(GM).render(x.jsx(Yt.StrictMode,{children:x.jsx(t3,{client:q9,children:x.jsx(I8,{children:x.jsx(U9,{locationHook:KC,base:F9})})})}));
|