From 366a0af4772fbe5553ddd05005f38ca8258111d3 Mon Sep 17 00:00:00 2001 From: liuzaisen Date: Mon, 21 Sep 2026 18:31:14 +0800 Subject: [PATCH] feat(traffic): redesign admin traffic analytics --- .../src/components/AdminPanel.test.ts | 9 + .../frontend/src/components/AdminPanel.vue | 26 +- .../src/components/admin/Traffic.test.ts | 193 +- .../frontend/src/components/admin/Traffic.vue | 725 +++++- .../src/components/admin/trafficModel.test.ts | 40 + .../src/components/admin/trafficModel.ts | 245 ++ internal/relay/admin_traffic.go | 54 +- internal/relay/admin_traffic_test.go | 58 + internal/relay/health_http.go | 33 +- internal/relay/health_http_test.go | 3 + ...r-BGCt84ef.js => FileExplorer-DTHAXsem.js} | 47 +- ...{Switch-CpxGRRqY.js => Switch-DguIL3dU.js} | 18 +- .../{auth-Dhl8fEWW.js => auth-B3RxKR1W.js} | 2 +- ...{client-2UEf7AK8.js => client-DMh7GjbV.js} | 2 +- ...strun-BkBSjRTR.js => firstrun-BX3Qt0kf.js} | 2 +- .../{index-Ak5-vsum.js => index-7QWmdym1.js} | 2 +- .../{index-q_Op_mkr.js => index-B2EmydOR.js} | 2 +- .../relay/web-dist/assets/index-BH9vIdLD.js | 2096 ---------------- .../{index-BSlQSXjR.js => index-BHEGRR_x.js} | 2 +- .../{index-vv_fn0WP.js => index-BTPAbX_e.js} | 2 +- .../{index-LsOWRKMa.js => index-CC5g0Nm4.js} | 2 +- .../{index-Y0PF_oBA.js => index-CL_O9F0b.js} | 2 +- .../{index-hbreRbwz.js => index-CWU_7NNG.js} | 2 +- .../{index-BfmBkV0O.js => index-Ccyjkum6.js} | 2 +- .../{index-CZ0p1U99.js => index-ChhOm7oD.js} | 2 +- .../{index-sMVa0oql.js => index-Cnryh6X_.js} | 2 +- .../relay/web-dist/assets/index-DBbnF2NZ.css | 32 + .../{index-CrP2n_El.js => index-DDrs-wZn.js} | 2 +- .../{index-CsH7OxDu.js => index-DI-4cHpq.js} | 2 +- .../{index-DW5ZYIIZ.js => index-DKJlFFIC.js} | 2 +- .../{index-BEPhTiWa.js => index-DL67eyEa.js} | 2 +- .../{index-CH6joGJR.js => index-DO3lkMm1.js} | 2 +- .../relay/web-dist/assets/index-OVPV9rln.js | 2110 +++++++++++++++++ .../{index-Bc7PlSwi.js => index-X9DIw5ut.js} | 2 +- .../{index-D9YFpvOI.js => index-Z6WUIGxm.js} | 2 +- .../relay/web-dist/assets/index-arVCiUK9.css | 32 - .../{index-hP5cCp4S.js => index-wpy5ZEXj.js} | 2 +- .../{login-6vnLvdhD.js => login-B-BiQRGX.js} | 2 +- .../web-dist/assets/mobile-guard-Cco5WjS8.js | 1 + .../web-dist/assets/mobile-guard-DNP_n6iV.js | 1 - ...Sync-D8z1rJ8H.js => prefsSync-C5tz9Q-s.js} | 2 +- .../{pwa-C6kIEQJT.js => pwa-BO-YW0rH.js} | 2 +- ...sions-Uw5ok8wO.js => sessions-RpM2fLHY.js} | 2 +- .../relay/web-dist/assets/setup-DC9JOQlN.js | 1 - .../relay/web-dist/assets/setup-WUaGlTjO.js | 1 + .../relay/web-dist/assets/signup-AhbkM-pD.js | 1 - .../relay/web-dist/assets/signup-BXhwDxUo.js | 1 + ...seI18n-CnvN0FfF.js => useI18n-lwZlSdSx.js} | 76 +- ...ersion-DPtnfoOB.js => version-Dm8mqW3q.js} | 2 +- internal/relay/web-dist/firstrun.html | 14 +- internal/relay/web-dist/index.html | 14 +- internal/relay/web-dist/login.html | 14 +- internal/relay/web-dist/setup.html | 8 +- internal/relay/web-dist/signup.html | 14 +- internal/relay/web-dist/sw.js | 2 +- web/src/shared/api/admin.ts | 9 + web/src/shared/api/types.ts | 15 + web/src/shared/i18n/messages/en.ts | 91 +- web/src/shared/i18n/messages/zh-CN.ts | 91 +- web/tests/unit/shared/api/admin.test.ts | 29 + 60 files changed, 3701 insertions(+), 2455 deletions(-) create mode 100644 desktop/frontend/src/components/admin/trafficModel.test.ts create mode 100644 desktop/frontend/src/components/admin/trafficModel.ts rename internal/relay/web-dist/assets/{FileExplorer-BGCt84ef.js => FileExplorer-DTHAXsem.js} (96%) rename internal/relay/web-dist/assets/{Switch-CpxGRRqY.js => Switch-DguIL3dU.js} (76%) rename internal/relay/web-dist/assets/{auth-Dhl8fEWW.js => auth-B3RxKR1W.js} (95%) rename internal/relay/web-dist/assets/{client-2UEf7AK8.js => client-DMh7GjbV.js} (87%) rename internal/relay/web-dist/assets/{firstrun-BkBSjRTR.js => firstrun-BX3Qt0kf.js} (59%) rename internal/relay/web-dist/assets/{index-Ak5-vsum.js => index-7QWmdym1.js} (98%) rename internal/relay/web-dist/assets/{index-q_Op_mkr.js => index-B2EmydOR.js} (99%) delete mode 100644 internal/relay/web-dist/assets/index-BH9vIdLD.js rename internal/relay/web-dist/assets/{index-BSlQSXjR.js => index-BHEGRR_x.js} (98%) rename internal/relay/web-dist/assets/{index-vv_fn0WP.js => index-BTPAbX_e.js} (99%) rename internal/relay/web-dist/assets/{index-LsOWRKMa.js => index-CC5g0Nm4.js} (98%) rename internal/relay/web-dist/assets/{index-Y0PF_oBA.js => index-CL_O9F0b.js} (99%) rename internal/relay/web-dist/assets/{index-hbreRbwz.js => index-CWU_7NNG.js} (97%) rename internal/relay/web-dist/assets/{index-BfmBkV0O.js => index-Ccyjkum6.js} (98%) rename internal/relay/web-dist/assets/{index-CZ0p1U99.js => index-ChhOm7oD.js} (99%) rename internal/relay/web-dist/assets/{index-sMVa0oql.js => index-Cnryh6X_.js} (85%) create mode 100644 internal/relay/web-dist/assets/index-DBbnF2NZ.css rename internal/relay/web-dist/assets/{index-CrP2n_El.js => index-DDrs-wZn.js} (97%) rename internal/relay/web-dist/assets/{index-CsH7OxDu.js => index-DI-4cHpq.js} (98%) rename internal/relay/web-dist/assets/{index-DW5ZYIIZ.js => index-DKJlFFIC.js} (99%) rename internal/relay/web-dist/assets/{index-BEPhTiWa.js => index-DL67eyEa.js} (99%) rename internal/relay/web-dist/assets/{index-CH6joGJR.js => index-DO3lkMm1.js} (99%) create mode 100644 internal/relay/web-dist/assets/index-OVPV9rln.js rename internal/relay/web-dist/assets/{index-Bc7PlSwi.js => index-X9DIw5ut.js} (99%) rename internal/relay/web-dist/assets/{index-D9YFpvOI.js => index-Z6WUIGxm.js} (87%) delete mode 100644 internal/relay/web-dist/assets/index-arVCiUK9.css rename internal/relay/web-dist/assets/{index-hP5cCp4S.js => index-wpy5ZEXj.js} (97%) rename internal/relay/web-dist/assets/{login-6vnLvdhD.js => login-B-BiQRGX.js} (67%) create mode 100644 internal/relay/web-dist/assets/mobile-guard-Cco5WjS8.js delete mode 100644 internal/relay/web-dist/assets/mobile-guard-DNP_n6iV.js rename internal/relay/web-dist/assets/{prefsSync-D8z1rJ8H.js => prefsSync-C5tz9Q-s.js} (93%) rename internal/relay/web-dist/assets/{pwa-C6kIEQJT.js => pwa-BO-YW0rH.js} (92%) rename internal/relay/web-dist/assets/{sessions-Uw5ok8wO.js => sessions-RpM2fLHY.js} (82%) delete mode 100644 internal/relay/web-dist/assets/setup-DC9JOQlN.js create mode 100644 internal/relay/web-dist/assets/setup-WUaGlTjO.js delete mode 100644 internal/relay/web-dist/assets/signup-AhbkM-pD.js create mode 100644 internal/relay/web-dist/assets/signup-BXhwDxUo.js rename internal/relay/web-dist/assets/{useI18n-CnvN0FfF.js => useI18n-lwZlSdSx.js} (73%) rename internal/relay/web-dist/assets/{version-DPtnfoOB.js => version-Dm8mqW3q.js} (62%) diff --git a/desktop/frontend/src/components/AdminPanel.test.ts b/desktop/frontend/src/components/AdminPanel.test.ts index 2dbd0999..f457f0cb 100644 --- a/desktop/frontend/src/components/AdminPanel.test.ts +++ b/desktop/frontend/src/components/AdminPanel.test.ts @@ -19,6 +19,15 @@ const stubs = { }; describe("AdminPanel", () => { + test("keeps the constrained panel and scroll body in the same layout tree", () => { + const w = mount(AdminPanel, { global: { stubs } }); + const body = w.get(".admin-body").element; + + expect(w.element.classList.contains("admin-panel")).toBe(true); + expect(body.parentElement).toBe(w.element); + expect(w.find(".n-config-provider").exists()).toBe(false); + }); + test("defaults to the invitations tab", () => { const w = mount(AdminPanel, { global: { stubs } }); expect(w.findComponent(Invitations).exists()).toBe(true); diff --git a/desktop/frontend/src/components/AdminPanel.vue b/desktop/frontend/src/components/AdminPanel.vue index e19e5ea7..e92e392d 100644 --- a/desktop/frontend/src/components/AdminPanel.vue +++ b/desktop/frontend/src/components/AdminPanel.vue @@ -45,14 +45,15 @@ const overrides = getNaiveOverrides(); diff --git a/desktop/frontend/src/components/admin/trafficModel.test.ts b/desktop/frontend/src/components/admin/trafficModel.test.ts new file mode 100644 index 00000000..46a09d40 --- /dev/null +++ b/desktop/frontend/src/components/admin/trafficModel.test.ts @@ -0,0 +1,40 @@ +import { describe, expect, test } from 'vitest' +import type { AdminTrafficRow } from '@shared/api/types' +import { categorySummaries, directionSeries, timelineSeries, trafficRange, userSummaries } from './trafficModel' + +const rows: AdminTrafficRow[] = [ + { user_id: 'u1', email: 'a@example.com', day: '2026-09-20', frame_type: 3, frame_type_name: 'OUT', category: 'terminal', direction: 1, bytes: 100, frames: 10 }, + { user_id: 'u1', email: 'a@example.com', day: '2026-09-21', frame_type: 2, frame_type_name: 'IN', category: 'terminal', direction: 0, bytes: 50, frames: 5 }, + { user_id: 'u1', email: 'a@example.com', day: '2026-09-19', frame_type: 3, frame_type_name: 'OUT', category: 'terminal', direction: 1, bytes: 75, frames: 7 }, + { user_id: 'u2', email: 'b@example.com', day: '2026-09-21', frame_type: 5, frame_type_name: 'META', category: 'state', direction: 1, bytes: 50, frames: 20 }, +] + +describe('trafficModel', () => { + test('builds equal current and previous UTC ranges', () => { + const range = trafficRange(2, new Date('2026-09-21T12:00:00Z')) + expect(range).toEqual({ + from: '2026-09-18', + currentFrom: '2026-09-20', + to: '2026-09-21', + days: ['2026-09-20', '2026-09-21'], + previousDays: ['2026-09-18', '2026-09-19'], + }) + }) + + test('derives user share and real period-over-period trend', () => { + const range = trafficRange(2, new Date('2026-09-21T12:00:00Z')) + const users = userSummaries(rows, new Set(['u1', 'u2']), range) + expect(users[0]).toMatchObject({ id: 'u1', bytes: 150, previousBytes: 75, trend: 100, share: 75 }) + expect(users[1]).toMatchObject({ id: 'u2', bytes: 50, trend: null, share: 25 }) + }) + + test('aggregates category, timeline and direction from the same rows', () => { + const current = rows.filter((row) => row.day !== '2026-09-19') + expect(categorySummaries(current).map((item) => [item.key, item.bytes])).toEqual([ + ['terminal', 150], + ['state', 50], + ]) + expect(timelineSeries(current, ['2026-09-20', '2026-09-21'], 'group', 'all', 'bytes', false)[0].values).toEqual([100, 50]) + expect(directionSeries(current, ['2026-09-20', '2026-09-21'], 'bytes')).toEqual({ inbound: [0, 50], outbound: [100, 50] }) + }) +}) diff --git a/desktop/frontend/src/components/admin/trafficModel.ts b/desktop/frontend/src/components/admin/trafficModel.ts new file mode 100644 index 00000000..fbd47872 --- /dev/null +++ b/desktop/frontend/src/components/admin/trafficModel.ts @@ -0,0 +1,245 @@ +import type { AdminTrafficRow } from '@shared/api/types' + +export type TrafficMetric = 'bytes' | 'frames' +export type TimelineDimension = 'group' | 'frame' | 'direction' +export type DirectionFilter = 'all' | 'out' | 'in' + +export interface TrafficRange { + from: string + currentFrom: string + to: string + days: string[] + previousDays: string[] +} + +export interface TrafficUserSummary { + id: string + email: string + bytes: number + frames: number + outbound: number + inbound: number + previousBytes: number + trend: number | null + share: number + activeDays: number +} + +export interface TrafficSeries { + key: string + label: string + userID?: string + userLabel?: string + category?: string + color: string + values: number[] + total: number +} + +export interface CategorySummary { + key: string + label: string + color: string + bytes: number + frames: number + outbound: number + inbound: number + share: number +} + +const CATEGORY_COLORS: Record = { + terminal: '#58a6ff', + state: '#39c5cf', + filesystem: '#bc8cff', + service: '#db6d28', + control: '#d29922', + other: '#8b949e', +} + +const SERIES_COLORS = ['#58a6ff', '#39c5cf', '#bc8cff', '#db6d28', '#d29922', '#3fb950', '#f85149', '#79c0ff'] + +function dateAtUTC(day: string): Date { + return new Date(`${day}T00:00:00Z`) +} + +function dayString(date: Date): string { + return date.toISOString().slice(0, 10) +} + +function addDays(day: string, amount: number): string { + const date = dateAtUTC(day) + date.setUTCDate(date.getUTCDate() + amount) + return dayString(date) +} + +export function inclusiveDays(from: string, to: string): string[] { + const result: string[] = [] + for (let day = from; day <= to; day = addDays(day, 1)) result.push(day) + return result +} + +export function trafficRange(days: number, now = new Date()): TrafficRange { + const to = dayString(now) + const currentFrom = addDays(to, -(days - 1)) + const from = addDays(currentFrom, -days) + return { + from, + currentFrom, + to, + days: inclusiveDays(currentFrom, to), + previousDays: inclusiveDays(from, addDays(currentFrom, -1)), + } +} + +export function userIdentity(rows: AdminTrafficRow[]): { id: string; email: string }[] { + const users = new Map() + for (const row of rows) users.set(row.user_id, row.email || row.user_id) + return [...users].map(([id, email]) => ({ id, email })).sort((a, b) => a.email.localeCompare(b.email)) +} + +export function selectedRows(rows: AdminTrafficRow[], userIDs: Set, days: Set): AdminTrafficRow[] { + return rows.filter((row) => userIDs.has(row.user_id) && !!row.day && days.has(row.day)) +} + +function metricValue(row: AdminTrafficRow, metric: TrafficMetric): number { + return metric === 'bytes' ? row.bytes : row.frames +} + +export function totalMetric(rows: AdminTrafficRow[], metric: TrafficMetric): number { + return rows.reduce((sum, row) => sum + metricValue(row, metric), 0) +} + +export function trendPercent(current: number, previous: number): number | null { + if (previous === 0) return current === 0 ? 0 : null + return ((current - previous) / previous) * 100 +} + +export function userSummaries( + rows: AdminTrafficRow[], + userIDs: Set, + range: TrafficRange, +): TrafficUserSummary[] { + const currentDays = new Set(range.days) + const previousDays = new Set(range.previousDays) + const users = userIdentity(rows).filter((user) => userIDs.has(user.id)) + const totals = users.map((user) => { + const own = rows.filter((row) => row.user_id === user.id) + const current = own.filter((row) => !!row.day && currentDays.has(row.day)) + const previous = own.filter((row) => !!row.day && previousDays.has(row.day)) + const bytes = totalMetric(current, 'bytes') + const previousBytes = totalMetric(previous, 'bytes') + return { + id: user.id, + email: user.email, + bytes, + frames: totalMetric(current, 'frames'), + outbound: totalMetric(current.filter((row) => row.direction === 1), 'bytes'), + inbound: totalMetric(current.filter((row) => row.direction === 0), 'bytes'), + previousBytes, + trend: trendPercent(bytes, previousBytes), + share: 0, + activeDays: new Set(current.map((row) => row.day)).size, + } + }) + const total = totals.reduce((sum, user) => sum + user.bytes, 0) + for (const user of totals) user.share = total ? (user.bytes / total) * 100 : 0 + return totals.sort((a, b) => b.bytes - a.bytes || a.email.localeCompare(b.email)) +} + +export function categorySummaries(rows: AdminTrafficRow[]): CategorySummary[] { + const groups = new Map>() + for (const row of rows) { + const key = row.category || 'other' + const cell = groups.get(key) || { + key, + label: key, + color: CATEGORY_COLORS[key] || CATEGORY_COLORS.other, + bytes: 0, + frames: 0, + outbound: 0, + inbound: 0, + } + cell.bytes += row.bytes + cell.frames += row.frames + if (row.direction === 1) cell.outbound += row.bytes + else cell.inbound += row.bytes + groups.set(key, cell) + } + const total = [...groups.values()].reduce((sum, group) => sum + group.bytes, 0) + return [...groups.values()] + .map((group) => ({ ...group, share: total ? (group.bytes / total) * 100 : 0 })) + .sort((a, b) => b.bytes - a.bytes) +} + +function rowDimension(row: AdminTrafficRow, dimension: Exclude): { key: string; label: string; category: string } { + if (dimension === 'group') { + const category = row.category || 'other' + return { key: category, label: category, category } + } + const label = row.frame_type_name || String(row.frame_type ?? '?') + return { key: String(row.frame_type ?? label), label, category: row.category || 'other' } +} + +export function timelineSeries( + rows: AdminTrafficRow[], + dates: string[], + dimension: Exclude, + direction: DirectionFilter, + metric: TrafficMetric, + separateUsers: boolean, +): TrafficSeries[] { + const dateIndex = new Map(dates.map((day, index) => [day, index])) + const series = new Map() + for (const row of rows) { + const index = row.day ? dateIndex.get(row.day) : undefined + if (index === undefined) continue + if (direction === 'out' && row.direction !== 1) continue + if (direction === 'in' && row.direction !== 0) continue + const dim = rowDimension(row, dimension) + const key = separateUsers ? `${row.user_id}:${dim.key}` : dim.key + let cell = series.get(key) + if (!cell) { + cell = { + key, + label: dim.label, + userID: separateUsers ? row.user_id : undefined, + userLabel: separateUsers ? row.email || row.user_id : undefined, + category: dim.category, + color: dimension === 'group' ? (CATEGORY_COLORS[dim.category] || CATEGORY_COLORS.other) : SERIES_COLORS[series.size % SERIES_COLORS.length], + values: Array(dates.length).fill(0), + total: 0, + } + series.set(key, cell) + } + const value = metricValue(row, metric) + cell.values[index] += value + cell.total += value + } + return [...series.values()].sort((a, b) => b.total - a.total) +} + +export function directionSeries(rows: AdminTrafficRow[], dates: string[], metric: TrafficMetric): { inbound: number[]; outbound: number[] } { + const index = new Map(dates.map((day, i) => [day, i])) + const inbound = Array(dates.length).fill(0) as number[] + const outbound = Array(dates.length).fill(0) as number[] + for (const row of rows) { + const i = row.day ? index.get(row.day) : undefined + if (i === undefined) continue + ;(row.direction === 1 ? outbound : inbound)[i] += metricValue(row, metric) + } + return { inbound, outbound } +} + +export function dailyTotals(rows: AdminTrafficRow[], dates: string[], metric: TrafficMetric): number[] { + const result = Array(dates.length).fill(0) as number[] + const index = new Map(dates.map((day, i) => [day, i])) + for (const row of rows) { + const i = row.day ? index.get(row.day) : undefined + if (i !== undefined) result[i] += metricValue(row, metric) + } + return result +} + +export function categoryLabel(key: string): string { + return key +} diff --git a/internal/relay/admin_traffic.go b/internal/relay/admin_traffic.go index f00d082a..40c9acc4 100644 --- a/internal/relay/admin_traffic.go +++ b/internal/relay/admin_traffic.go @@ -2,6 +2,7 @@ package relay import ( "net/http" + "sort" "time" "github.com/attson/atterm/internal/proto" @@ -10,6 +11,7 @@ import ( type trafficRow struct { UserID string `json:"user_id"` Email string `json:"email,omitempty"` + Day string `json:"day,omitempty"` FrameType int `json:"frame_type,omitempty"` FrameTypeName string `json:"frame_type_name,omitempty"` Category string `json:"category,omitempty"` @@ -19,16 +21,18 @@ type trafficRow struct { } type trafficResponse struct { - View string `json:"view"` - From string `json:"from"` - To string `json:"to"` - Rows []trafficRow `json:"rows"` + View string `json:"view"` + Bucket string `json:"bucket"` + From string `json:"from"` + To string `json:"to"` + Rows []trafficRow `json:"rows"` } // handleAdminTrafficHTTP implements GET /admin/api/traffic. Query params: // // view = detail | group | summary (default: group) -// from, to = YYYY-MM-DD (default: last 7 days ending today UTC) +// bucket = range | day (default: range) +// from, to = YYYY-MM-DD (default: last 7 days ending today UTC) // // It reads the daily rollup rows for [from, to] and aggregates them by the // requested view: detail keeps per-frame-type granularity, group folds frame @@ -44,6 +48,15 @@ func (s *Server) handleAdminTrafficHTTP(w http.ResponseWriter, r *http.Request) http.Error(w, "invalid view", http.StatusBadRequest) return } + bucket := r.URL.Query().Get("bucket") + switch bucket { + case "range", "day": + case "": + bucket = "range" + default: + http.Error(w, "invalid bucket", http.StatusBadRequest) + return + } today := time.Now().UTC() to := r.URL.Query().Get("to") @@ -58,6 +71,10 @@ func (s *Server) handleAdminTrafficHTTP(w http.ResponseWriter, r *http.Request) http.Error(w, "invalid date, use YYYY-MM-DD", http.StatusBadRequest) return } + if from > to { + http.Error(w, "invalid date range", http.StatusBadRequest) + return + } rows, err := s.cfg.Store.QueryTraffic(r.Context(), from, to) if err != nil { @@ -70,6 +87,7 @@ func (s *Server) handleAdminTrafficHTTP(w http.ResponseWriter, r *http.Request) // summary both stay zero-valued, so only user+direction distinguish rows. type aggKey struct { user string + day string disc int cat string dir int @@ -77,6 +95,9 @@ func (s *Server) handleAdminTrafficHTTP(w http.ResponseWriter, r *http.Request) agg := map[aggKey]*trafficRow{} for _, rr := range rows { k := aggKey{user: rr.UserID, dir: rr.Direction} + if bucket == "day" { + k.day = rr.Day + } switch view { case "detail": k.disc = rr.FrameType @@ -85,11 +106,12 @@ func (s *Server) handleAdminTrafficHTTP(w http.ResponseWriter, r *http.Request) } cell := agg[k] if cell == nil { - cell = &trafficRow{UserID: rr.UserID, Email: emails[rr.UserID], Direction: rr.Direction} + cell = &trafficRow{UserID: rr.UserID, Email: emails[rr.UserID], Day: k.day, Direction: rr.Direction} switch view { case "detail": cell.FrameType = rr.FrameType cell.FrameTypeName = frameTypeName(proto.Type(rr.FrameType)) + cell.Category = frameCategory(proto.Type(rr.FrameType)) case "group": cell.Category = k.cat } @@ -102,7 +124,25 @@ func (s *Server) handleAdminTrafficHTTP(w http.ResponseWriter, r *http.Request) for _, c := range agg { out = append(out, *c) } - writeJSONStatus(w, http.StatusOK, trafficResponse{View: view, From: from, To: to, Rows: out}) + sort.Slice(out, func(i, j int) bool { + if out[i].Day != out[j].Day { + return out[i].Day < out[j].Day + } + if out[i].Email != out[j].Email { + return out[i].Email < out[j].Email + } + if out[i].UserID != out[j].UserID { + return out[i].UserID < out[j].UserID + } + if out[i].Category != out[j].Category { + return out[i].Category < out[j].Category + } + if out[i].FrameType != out[j].FrameType { + return out[i].FrameType < out[j].FrameType + } + return out[i].Direction < out[j].Direction + }) + writeJSONStatus(w, http.StatusOK, trafficResponse{View: view, Bucket: bucket, From: from, To: to, Rows: out}) } func validDay(s string) bool { diff --git a/internal/relay/admin_traffic_test.go b/internal/relay/admin_traffic_test.go index cf43d11f..099fdfe6 100644 --- a/internal/relay/admin_traffic_test.go +++ b/internal/relay/admin_traffic_test.go @@ -78,6 +78,7 @@ func TestAdminTraffic_DetailView(t *testing.T) { Rows []struct { FrameType int `json:"frame_type"` FrameTypeName string `json:"frame_type_name"` + Category string `json:"category"` Direction int `json:"direction"` Bytes int64 `json:"bytes"` } `json:"rows"` @@ -92,6 +93,9 @@ func TestAdminTraffic_DetailView(t *testing.T) { if r.FrameTypeName == "" { t.Error("detail row missing frame_type_name") } + if r.Category != "terminal" { + t.Errorf("detail row category = %q, want terminal", r.Category) + } } } if outBytes != 1000 { @@ -99,6 +103,44 @@ func TestAdminTraffic_DetailView(t *testing.T) { } } +func TestAdminTraffic_DayBucketKeepsDaysSeparate(t *testing.T) { + srv, store, adminID, tok := newAdminTestServer(t) + today := time.Now().UTC() + from := today.AddDate(0, 0, -1).Format("2006-01-02") + to := today.Format("2006-01-02") + for _, day := range []string{from, to} { + if err := store.AddTrafficDeltas(context.Background(), day, []userstore.TrafficDelta{ + {UserID: adminID, FrameType: int(proto.TypeOut), Direction: trafficOut, Bytes: 100, Frames: 1}, + }); err != nil { + t.Fatalf("seed traffic for %s: %v", day, err) + } + } + + rec := adminGetBearer(srv, "/admin/api/traffic?view=detail&bucket=day&from="+from+"&to="+to, tok) + if rec.Code != http.StatusOK { + t.Fatalf("status = %d, want 200; body=%s", rec.Code, rec.Body.String()) + } + var resp struct { + Bucket string `json:"bucket"` + Rows []struct { + Day string `json:"day"` + Bytes int64 `json:"bytes"` + } `json:"rows"` + } + if err := json.Unmarshal(rec.Body.Bytes(), &resp); err != nil { + t.Fatalf("decode: %v", err) + } + if resp.Bucket != "day" { + t.Errorf("bucket = %q, want day", resp.Bucket) + } + if len(resp.Rows) != 2 { + t.Fatalf("len(rows) = %d, want 2", len(resp.Rows)) + } + if resp.Rows[0].Day != from || resp.Rows[1].Day != to { + t.Errorf("days = [%q, %q], want [%q, %q]", resp.Rows[0].Day, resp.Rows[1].Day, from, to) + } +} + func TestAdminTraffic_SummaryView(t *testing.T) { srv, store, adminID, tok := newAdminTestServer(t) day := seedTraffic(t, store, adminID) @@ -144,6 +186,22 @@ func TestAdminTraffic_InvalidView(t *testing.T) { } } +func TestAdminTraffic_InvalidBucket(t *testing.T) { + srv, _, _, tok := newAdminTestServer(t) + rec := adminGetBearer(srv, "/admin/api/traffic?bucket=hour", tok) + if rec.Code != http.StatusBadRequest { + t.Errorf("status = %d, want 400", rec.Code) + } +} + +func TestAdminTraffic_ReversedDateRange(t *testing.T) { + srv, _, _, tok := newAdminTestServer(t) + rec := adminGetBearer(srv, "/admin/api/traffic?from=2026-09-21&to=2026-09-20", tok) + if rec.Code != http.StatusBadRequest { + t.Errorf("status = %d, want 400", rec.Code) + } +} + func TestAdminTraffic_RejectsNonAdmin(t *testing.T) { srv, store, _, _ := newAdminTestServer(t) // Create a second, non-admin user with its own session on the same store. diff --git a/internal/relay/health_http.go b/internal/relay/health_http.go index 0e693a95..6a9c81f1 100644 --- a/internal/relay/health_http.go +++ b/internal/relay/health_http.go @@ -32,6 +32,9 @@ type HealthPayload struct { RateLimitPerMinute int `json:"rate_limit_per_minute"` MaxConnectionsPerKey int `json:"max_connections_per_key"` ActiveUplinks int64 `json:"active_uplinks"` + ActiveSessions int `json:"active_sessions"` + RelayInstances int `json:"relay_instances"` + TrafficFlushIntervalSec int `json:"traffic_flush_interval_seconds"` MobileOriginCompatible bool `json:"mobile_origin_compatible"` GeneratedAt string `json:"generated_at"` Warnings []string `json:"health_check_warnings,omitempty"` @@ -90,19 +93,29 @@ func collectHealth(ctx context.Context, s *Server, r *http.Request) HealthPayloa originsCopy := append([]string(nil), s.currentAllowedOrigins()...) payload := HealthPayload{ - Version: cfg.Version, - UptimeSeconds: int64(time.Since(s.startTime).Seconds()), - HTTPS: httpsFromRequest(r), - ConfiguredOrigins: originsCopy, - OriginsOpen: len(originsCopy) == 0, - RateLimitPerMinute: rateLimit, - MaxConnectionsPerKey: connLimit, - ActiveUplinks: s.UplinkCount(), - MobileOriginCompatible: isMobileOriginCompatible(originsCopy), - GeneratedAt: time.Now().UTC().Format(time.RFC3339), + Version: cfg.Version, + UptimeSeconds: int64(time.Since(s.startTime).Seconds()), + HTTPS: httpsFromRequest(r), + ConfiguredOrigins: originsCopy, + OriginsOpen: len(originsCopy) == 0, + RateLimitPerMinute: rateLimit, + MaxConnectionsPerKey: connLimit, + ActiveUplinks: s.UplinkCount(), + ActiveSessions: len(s.registry.List()), + RelayInstances: 1, + TrafficFlushIntervalSec: int(trafficFlushInterval / time.Second), + MobileOriginCompatible: isMobileOriginCompatible(originsCopy), + GeneratedAt: time.Now().UTC().Format(time.RFC3339), } if cfg.Store != nil { + live, err := cfg.Store.ListLiveInstances(ctx, time.Now().Add(-InstanceLivenessWindow).Unix()) + if err != nil { + payload.Warnings = append(payload.Warnings, "relay_instances_lookup_failed") + } else if len(live) > payload.RelayInstances { + payload.RelayInstances = len(live) + } + users, err := cfg.Store.ListUsers(ctx) if err != nil { payload.Warnings = append(payload.Warnings, "bootstrap_admin_lookup_failed") diff --git a/internal/relay/health_http_test.go b/internal/relay/health_http_test.go index d9b75273..e99d832a 100644 --- a/internal/relay/health_http_test.go +++ b/internal/relay/health_http_test.go @@ -349,6 +349,9 @@ func TestHealthPayload_JSONFieldsStable(t *testing.T) { "rate_limit_per_minute", "max_connections_per_key", "active_uplinks", + "active_sessions", + "relay_instances", + "traffic_flush_interval_seconds", "mobile_origin_compatible", "generated_at", } diff --git a/internal/relay/web-dist/assets/FileExplorer-BGCt84ef.js b/internal/relay/web-dist/assets/FileExplorer-DTHAXsem.js similarity index 96% rename from internal/relay/web-dist/assets/FileExplorer-BGCt84ef.js rename to internal/relay/web-dist/assets/FileExplorer-DTHAXsem.js index dc3196db..7024c207 100644 --- a/internal/relay/web-dist/assets/FileExplorer-BGCt84ef.js +++ b/internal/relay/web-dist/assets/FileExplorer-DTHAXsem.js @@ -1,69 +1,64 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CZ0p1U99.js","assets/index-q_Op_mkr.js","assets/index-Bc7PlSwi.js","assets/useI18n-CnvN0FfF.js","assets/index-BH9vIdLD.js","assets/prefsSync-D8z1rJ8H.js","assets/client-2UEf7AK8.js","assets/Switch-CpxGRRqY.js","assets/auth-Dhl8fEWW.js","assets/index-arVCiUK9.css","assets/index-sMVa0oql.js","assets/index-Ak5-vsum.js","assets/index-CsH7OxDu.js","assets/index-BSlQSXjR.js","assets/index-DW5ZYIIZ.js","assets/index-LsOWRKMa.js","assets/index-vv_fn0WP.js","assets/index-CH6joGJR.js","assets/index-Y0PF_oBA.js","assets/index-BEPhTiWa.js","assets/index-hbreRbwz.js","assets/index-hP5cCp4S.js","assets/index-CrP2n_El.js","assets/index-D9YFpvOI.js","assets/index-BfmBkV0O.js"])))=>i.map(i=>d[i]); -import{aq as Qe,bI as j,bu as En,bk as us,bx as O,ae as V,bm as mn,ab as J,ac as ke,bQ as hn,cb as q,cz as ds,cs as Oa,v as rt,a8 as me,bP as Pf,bl as Gi,ad as Ie,c4 as Q,al as vi,F as Xt,bK as mi,bs as qt,cB as Bi,cw as ft,aj as ps,_ as le,ct as If,bZ as Nf,cr as _f}from"./useI18n-CnvN0FfF.js";import{c as vt,a as it,e as Se,o as Ji,f as Ff,X as Wf,p as La,b as Hf,k as Vf,m as $f,h as zf,s as qf,n as Uf,j as Kf,d as jf,g as Gf,t as _s,q as Jf,u as Yf,i as Xf,U as Qf,r as Zf,l as eu}from"./index-BH9vIdLD.js";/** +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-ChhOm7oD.js","assets/index-B2EmydOR.js","assets/index-X9DIw5ut.js","assets/useI18n-lwZlSdSx.js","assets/index-OVPV9rln.js","assets/prefsSync-C5tz9Q-s.js","assets/client-DMh7GjbV.js","assets/Switch-DguIL3dU.js","assets/auth-B3RxKR1W.js","assets/index-DBbnF2NZ.css","assets/index-Cnryh6X_.js","assets/index-7QWmdym1.js","assets/index-DI-4cHpq.js","assets/index-BHEGRR_x.js","assets/index-DKJlFFIC.js","assets/index-CC5g0Nm4.js","assets/index-BTPAbX_e.js","assets/index-DO3lkMm1.js","assets/index-CL_O9F0b.js","assets/index-DL67eyEa.js","assets/index-CWU_7NNG.js","assets/index-wpy5ZEXj.js","assets/index-DDrs-wZn.js","assets/index-Z6WUIGxm.js","assets/index-Ccyjkum6.js"])))=>i.map(i=>d[i]); +import{ap as Qe,bH as j,bt as En,bj as us,bw as O,ad as V,bl as mn,aa as J,ab as ke,bP as hn,ca as q,cy as ds,cr as Oa,v as rt,a7 as me,bO as Pf,bk as Gi,ac as Ie,c3 as Q,ak as vi,F as Xt,bJ as mi,br as qt,cA as Bi,cv as ft,ai as ps,_ as le,cs as If,bY as Nf,cq as _f}from"./useI18n-lwZlSdSx.js";import{c as Pt,C as Ff,a as it,e as Se,o as Ji,f as Wf,X as Hf,p as La,b as Vf,k as $f,m as zf,h as qf,s as Uf,n as Kf,j as jf,d as Gf,g as Jf,t as _s,q as Yf,u as Xf,i as Qf,U as Zf,r as eu,l as tu}from"./index-OVPV9rln.js";/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const tu=vt("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/** + */const iu=Pt("braces",[["path",{d:"M8 3H7a2 2 0 0 0-2 2v5a2 2 0 0 1-2 2 2 2 0 0 1 2 2v5c0 1.1.9 2 2 2h1",key:"ezmyqa"}],["path",{d:"M16 21h1a2 2 0 0 0 2-2v-5c0-1.1.9-2 2-2a2 2 0 0 1-2-2V5a2 2 0 0 0-2-2h-1",key:"e1hn23"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const iu=vt("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + */const nu=Pt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const nu=vt("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** + */const Be=Pt("file-code-corner",[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Be=vt("file-code-corner",[["path",{d:"M4 12.15V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2h-3.35",key:"1wthlu"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m5 16-3 3 3 3",key:"331omg"}],["path",{d:"m9 22 3-3-3-3",key:"lsp7cz"}]]);/** + */const Qs=Pt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Qs=vt("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** + */const Ba=Pt("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ba=vt("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]);/** + */const su=Pt("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const su=vt("folder-open",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);/** + */const Ra=Pt("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Ra=vt("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);/** + */const Di=Pt("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const Di=vt("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** + */const ru=Pt("pin-off",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);/** * @license lucide-vue-next v1.0.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. - */const ru=vt("pin-off",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89",key:"znwnzq"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11",key:"c9qhm2"}]]);/** - * @license lucide-vue-next v1.0.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ou=vt("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),lu={class:"icon"},au=["placeholder"],hu=Qe({__name:"InlineEditRow",props:{level:{},initialValue:{},placeholder:{},icon:{}},emits:["submit","cancel"],setup(s,{emit:e}){const t=s,i=e,n=j(t.initialValue??""),r=j(null);En(async()=>{var l,a;await us(),(l=r.value)==null||l.focus(),(a=r.value)==null||a.select()});function o(l){l.key==="Enter"?n.value.trim()===""?i("cancel"):i("submit",n.value.trim()):l.key==="Escape"&&i("cancel")}return(l,a)=>(O(),V("div",{class:"row",style:mn({paddingLeft:`${l.level*8}px`}),"data-test":"inline-edit-row"},[J("span",lu,[(O(),ke(hn(l.icon==="folder"?q(Ra):q(Ba)),{size:16,"stroke-width":1.5}))]),ds(J("input",{ref_key:"inputRef",ref:r,"onUpdate:modelValue":a[0]||(a[0]=h=>n.value=h),class:"input",placeholder:l.placeholder,"data-test":"inline-edit-input",onKeydown:o,onBlur:a[1]||(a[1]=h=>i("cancel"))},null,40,au),[[Oa,n.value]])],4))}}),Zo=rt(hu,[["__scopeId","data-v-ee0e2fb2"]]),cu={class:"node-wrap"},fu=["data-type","title"],uu={class:"twisty"},du={class:"icon"},pu={class:"node-name"},gu={key:0},mu=Qe({name:"FileTreeNode"}),yu=Qe({...mu,props:{node:{},level:{},selectedPath:{},inlineIntent:{}},emits:["toggle","click-file","dblclick-file","context","inline-submit","inline-cancel"],setup(s,{emit:e}){const t=s,i=e,n=me(()=>{var D;return((D=t.inlineIntent)==null?void 0:D.kind)==="rename"&&t.inlineIntent.node.path===t.node.path}),r=me(()=>{const D=t.inlineIntent;return!D||D.kind!=="newFile"&&D.kind!=="newFolder"?null:D.parentPath===t.node.path?D:null}),o=8,l=22,a={ts:{comp:Be,color:"#3178c6"},tsx:{comp:Be,color:"#3178c6"},js:{comp:Be,color:"#f7df1e"},jsx:{comp:Be,color:"#f7df1e"},go:{comp:Be,color:"#00add8"},py:{comp:Be,color:"#3776ab"},rs:{comp:Be,color:"#dea584"},sh:{comp:Be,color:"#89e051"},vue:{comp:Be,color:"#41b883"},json:{comp:tu,color:"#cbcb41"},md:{comp:Qs,color:"#519aba"},markdown:{comp:Qs,color:"#519aba"},txt:{comp:Qs,color:"#cccccc"},yaml:{comp:Be,color:"#cb171e"},yml:{comp:Be,color:"#cb171e"},toml:{comp:Be,color:"#9c4221"},html:{comp:Be,color:"#e44d26"},htm:{comp:Be,color:"#e44d26"},css:{comp:Be,color:"#264de4"},scss:{comp:Be,color:"#c6538c"},sass:{comp:Be,color:"#c6538c"},png:{comp:Di,color:"#a074c4"},jpg:{comp:Di,color:"#a074c4"},jpeg:{comp:Di,color:"#a074c4"},gif:{comp:Di,color:"#a074c4"},svg:{comp:Di,color:"#ffb13b"},ico:{comp:Di,color:"#a074c4"}};function h(D){const A=/\.([A-Za-z0-9]+)$/.exec(D);if(A){const P=a[A[1].toLowerCase()];if(P)return P}return{comp:Ba,color:"currentColor"}}function c(D,A){return typeof window>"u"?A:getComputedStyle(document.documentElement).getPropertyValue(D).trim()||A}const f=me(()=>c("--ed-folder","#d4a14a")),u=me(()=>c("--ed-chevron","rgba(173,186,199,0.7)")),d=me(()=>t.selectedPath===t.node.path),p=me(()=>t.node.expanded?iu:nu),g=me(()=>t.node.expanded?su:Ra),y=me(()=>h(t.node.name));function b(){t.node.isDir?i("toggle",t.node):i("click-file",t.node)}function x(){t.node.isDir||i("dblclick-file",t.node)}function T(D){i("context",D,t.node,t.level)}return(D,A)=>{const P=Pf("FileTreeNode",!0);return O(),V("div",cu,[n.value?(O(),ke(Zo,{key:0,level:D.level,icon:D.node.isDir?"folder":"file","initial-value":D.node.name,onSubmit:A[0]||(A[0]=C=>i("inline-submit",C)),onCancel:A[1]||(A[1]=C=>i("inline-cancel"))},null,8,["level","icon","initial-value"])):(O(),V("div",{key:1,class:Gi(["node",{selected:d.value,"is-dir":D.node.isDir,"is-file":!D.node.isDir}]),"data-type":D.node.isDir?"dir":"file",style:mn({paddingLeft:`${D.level*o}px`,height:`${l}px`,lineHeight:`${l}px`}),title:D.node.path,onClick:b,onDblclick:x,onContextmenu:T},[J("span",uu,[D.node.isDir?(O(),ke(hn(p.value),{key:0,size:14,color:u.value,"stroke-width":2},null,8,["color"])):Ie("",!0)]),J("span",du,[D.node.isDir?(O(),ke(hn(g.value),{key:0,size:16,color:f.value,"stroke-width":1.5},null,8,["color"])):(O(),ke(hn(y.value.comp),{key:1,size:16,color:y.value.color,"stroke-width":1.5},null,8,["color"]))]),J("span",pu,Q(D.node.name),1)],46,fu)),D.node.isDir&&D.node.expanded&&D.node.children?(O(),V("ul",{key:2,class:"tree-list",style:mn({"--indent-base":`${D.level*o+12}px`})},[r.value?(O(),V("li",gu,[vi(Zo,{level:D.level+1,icon:r.value.kind==="newFolder"?"folder":"file",onSubmit:A[2]||(A[2]=C=>i("inline-submit",C)),onCancel:A[3]||(A[3]=C=>i("inline-cancel"))},null,8,["level","icon"])])):Ie("",!0),(O(!0),V(Xt,null,mi(D.node.children,C=>(O(),V("li",{key:C.path},[vi(P,{node:C,level:D.level+1,"selected-path":D.selectedPath,"inline-intent":D.inlineIntent,onToggle:A[4]||(A[4]=U=>i("toggle",U)),onClickFile:A[5]||(A[5]=U=>i("click-file",U)),onDblclickFile:A[6]||(A[6]=U=>i("dblclick-file",U)),onContext:A[7]||(A[7]=(U,M,$)=>i("context",U,M,$)),onInlineSubmit:A[8]||(A[8]=U=>i("inline-submit",U)),onInlineCancel:A[9]||(A[9]=()=>i("inline-cancel"))},null,8,["node","level","selected-path","inline-intent"])]))),128))],4)):Ie("",!0)])}}}),vu=rt(yu,[["__scopeId","data-v-e70abcab"]]),bu=["aria-label"],wu={class:"dlg-title"},xu={key:0,class:"dlg-msg"},ku={class:"dlg-buttons"},Su=["data-test","onClick"],Cu=Qe({__name:"ConfirmDialog",props:{title:{},message:{},buttons:{}},emits:["resolve"],setup(s,{emit:e}){const t=s,i=e,n=j(null);function r(o){if(o.key==="Escape"){const l=t.buttons.find(a=>a.id==="cancel");l&&i("resolve",l.id)}}return En(()=>{var o;window.addEventListener("keydown",r),(o=n.value)==null||o.focus()}),qt(()=>window.removeEventListener("keydown",r)),(o,l)=>(O(),V("div",{class:"dlg-scrim","data-test":"confirm-dialog",onClick:l[0]||(l[0]=Bi(()=>{const a=t.buttons.find(h=>h.id==="cancel");a&&i("resolve",a.id)},["self"]))},[J("div",{ref_key:"rootRef",ref:n,class:"dlg",tabindex:"-1",role:"dialog","aria-label":o.title},[J("div",wu,Q(o.title),1),o.message?(O(),V("div",xu,Q(o.message),1)):Ie("",!0),J("div",ku,[(O(!0),V(Xt,null,mi(o.buttons,a=>(O(),V("button",{key:a.id,class:Gi(["dlg-btn",a.kind??"secondary"]),"data-test":`btn-${a.id}`,onClick:h=>i("resolve",a.id)},Q(a.label),11,Su))),128))])],8,bu)]))}}),Pa=rt(Cu,[["__scopeId","data-v-177a9baf"]]),Au=200,Mu=2e3,Tu=new Set([".git","node_modules","dist","build",".next",".turbo","vendor"]),Du=new Set(["proc","sys","dev","run"]);function Eu(s,e){return s.endsWith("/")?s+e:s+"/"+e}function Ou(s){return s.startsWith(".")}async function Lu(s,e,t,i){const n=t.trim().toLowerCase();if(!n)return{results:[],truncated:!1};const r=i.maxResults??Au,o=i.maxDirs??Mu,l=i.isCancelled??(()=>!1),a=[],h=[e];let c=0,f=!1;for(;h.length>0;){if(l())return{results:[],truncated:!1};if(c>=o||a.length>=r){f=!0;break}const u=h.shift();c++;let d;try{d=await s.listDir(u)}catch{continue}for(const p of d){if(!i.showHidden&&Ou(p.name))continue;const g=Eu(u,p.name);if(p.isDir){if(Tu.has(p.name)||u==="/"&&Du.has(p.name))continue;h.push(g);continue}if(p.name.toLowerCase().includes(n)&&(a.push({path:g,name:p.name}),a.length>=r)){f=!0;break}}}return{results:a,truncated:f}}const Bu=/^[A-Za-z0-9_./@:+,%=-]+$/;function Ru(s){return s===""?"''":Bu.test(s)?s:"'"+s.replace(/'/g,"'\\''")+"'"}const Pu={key:0,class:"tree-error","data-test":"tree-error"},Iu={class:"tree-error-text"},Nu={key:1,class:"search-results","data-test":"file-search-results"},_u={key:0,class:"search-status"},Fu={key:1,class:"search-status"},Wu=["title","onClick","onDblclick"],Hu={class:"search-name"},Vu={class:"search-path"},$u={key:2,class:"search-status"},zu={class:"tree-root"},qu=["title"],Uu=["aria-checked"],Ku={class:"ctx-check"},ju=["aria-checked"],Gu={class:"ctx-check"},Ju=Qe({__name:"FileTree",props:{fs:{},root:{},showHidden:{type:Boolean},showLineNumbers:{type:Boolean},searchQuery:{},context:{}},emits:["file-clicked","file-double-clicked","dir-toggled","toggle-show-hidden","toggle-show-line-numbers"],setup(s,{expose:e,emit:t}){const{t:i}=Ji(),n=s,r=t,o=j(null),l=j(null),a=j(null);function h(m){const w=m.lastIndexOf("/");return w<=0?"/":m.slice(0,w)}function c(m){const w=m.lastIndexOf("/");return w===-1?m:m.slice(w+1)}function f(m,w,k){m.preventDefault(),o.value={x:m.clientX,y:m.clientY,node:w,level:k,shift:m.shiftKey}}function u(){o.value=null}function d(){o.value=null,r("toggle-show-hidden",!n.showHidden)}function p(){o.value=null,r("toggle-show-line-numbers",!n.showLineNumbers)}async function g(m){var w,k,W;try{if((w=navigator.clipboard)!=null&&w.writeText)await navigator.clipboard.writeText(m);else if(!Ff(m))return;(W=(k=n.context)==null?void 0:k.showToast)==null||W.call(k,i("plugins.fileExplorer.pathCopied"))}catch(z){it("file-explorer","copy path failed",{error:Se(z)})}}function y(m){!(m.key==="c"||m.key==="C")||m.altKey||m.shiftKey||!(m.metaKey||m.ctrlKey)||C.value&&(m.preventDefault(),g(C.value))}async function b(m){var W,z,Y,xe,be,Ut;const w=o.value;if(o.value=null,!w)return;const k=w.node;if(m==="copyPath"){await g(k.path);return}if(m==="sendToTerminal"){(z=(W=n.context)==null?void 0:W.send)==null||z.call(W,Ru(k.path));return}if(m==="newFile"||m==="newFolder"){const Kt=k.isDir?k.path:h(k.path),Xs=k.isDir?w.level+1:w.level;l.value={kind:m,parentPath:Kt,parentLevel:Xs};return}if(m==="rename"){l.value={kind:"rename",node:k,level:w.level};return}if(m==="delete"){const Kt=k.isDir?(xe=(Y=n.fs).dirRemovalRefusal)==null?void 0:xe.call(Y,k.path):void 0;if(Kt){(Ut=(be=n.context)==null?void 0:be.showToast)==null||Ut.call(be,Kt);return}a.value={node:k,mode:w.shift?"hard":"trash"}}}async function x(m){var k,W;const w=l.value;if(l.value=null,!!w)try{w.kind==="newFile"?await n.fs.createFile(je(w.parentPath,m)):w.kind==="newFolder"?await n.fs.mkdir(je(w.parentPath,m)):w.kind==="rename"&&await n.fs.rename(w.node.path,je(h(w.node.path),m))}catch(z){it("file-explorer","inline action failed",{error:Se(z)}),(W=(k=n.context)==null?void 0:k.showToast)==null||W.call(k,Se(z))}}function T(){l.value=null}async function D(m){var k,W;const w=a.value;if(a.value=null,!(!w||m==="cancel"))try{if(m==="hard")await n.fs.remove(w.node.path,w.node.isDir);else try{await n.fs.trash(w.node.path)}catch(z){if((z.message??"").includes("no platform trash command available"))a.value={node:w.node,mode:"hard"};else throw z}}catch(z){it("file-explorer","delete failed",{error:Se(z)}),(W=(k=n.context)==null?void 0:k.showToast)==null||W.call(k,Se(z))}}function A(m){return[m==="hard"?{id:"hard",label:i("plugins.fileExplorer.delete"),kind:"danger"}:{id:"trash",label:i("plugins.fileExplorer.moveToTrash"),kind:"primary"},{id:"cancel",label:i("plugins.fileExplorer.cancel"),kind:"secondary"}]}const P=j([]),C=j(""),U=j([]),M=j(!1),$=j(!1),N=new Map,I=new Map,G=new Map,L=new Map;let R=!1,Z=0,X=0,ue=()=>{};const Me=me(()=>(n.searchQuery??"").trim());function ot(m,w,k,W){return!R&&Z===W&&n.fs===m&&n.root===w&&n.showHidden===k}const de=j({}),Te=me(()=>Object.entries(de.value).map(([m,w])=>({path:m,...w})));function De(m,w,k,W){const z=m in de.value;if(!w){if(z){const Y={...de.value};delete Y[m],de.value=Y}return}de.value={...de.value,[m]:{shown:k,total:W}}}function Fe(m,w){const k={...de.value};let W=!1;for(const z of Object.keys(k))(z===m?!w:!ci(z,m))||(delete k[z],W=!0);W&&(de.value=k)}async function Le(m,w,k){const W=m.listDirDetailed?await m.listDirDetailed(w):{entries:await m.listDir(w),truncated:!1,total:0},z=W.entries;return De(w,W.truncated,z.length,W.total),z.filter(Y=>k||!Y.name.startsWith(".")).map(Y=>({path:je(w,Y.name),name:Y.name,isDir:Y.isDir,expanded:!1,children:null})).sort((Y,xe)=>Y.isDir===xe.isDir?Y.name.localeCompare(xe.name):Y.isDir?-1:1)}function je(m,w){return m.endsWith("/")?m+w:m+"/"+w}async function $e(m,w){try{await m.unwatchDir(w)}catch{}}function Fn(){const m=Array.from(N.values());N.clear();for(const{fs:w,id:k}of m)$e(w,k)}function ci(m,w){return m.startsWith(w.endsWith("/")?w:`${w}/`)}function B(m){Fe(m,!1);for(const[w,k]of Array.from(N))ci(w,m)&&(N.delete(w),$e(k.fs,k.id));for(const w of Array.from(I.keys()))ci(w,m)&&I.delete(w);for(const w of Array.from(G.keys()))ci(w,m)&&te(w);for(const w of Array.from(L.keys()))ci(w,m)&&ge(w)}function K(m){for(const w of m.children??[])w.expanded=!1,K(w)}function te(m){const w=(G.get(m)??0)+1;return G.set(m,w),w}function ge(m){const w=(L.get(m)??0)+1;return L.set(m,w),w}function ve(){Z++,ue(),ue=()=>{},de.value={},kt.value="",I.clear(),G.clear(),L.clear(),Fn()}const kt=j("");async function St(m,w,k,W){const z=ge(w);let Y;try{Y=await Le(m,w,k)}catch(xe){ot(m,w,k,W)&&L.get(w)===z&&(kt.value=i("plugins.fileExplorer.treeLoadFailed",{path:w,message:Se(xe)}),P.value=[]);return}!ot(m,w,k,W)||L.get(w)!==z||(kt.value="",B(w),P.value=Y)}async function en(m,w,k,W,z){if(!ot(m,w,k,W))return;if(z===w){await St(m,w,k,W);return}const Y=fi(P.value,z);if(!Y||!Y.expanded)return;const xe=ge(Y.path),be=await Le(m,Y.path,k);!ot(m,w,k,W)||!Y.expanded||fi(P.value,z)!==Y||L.get(Y.path)!==xe||(B(Y.path),Y.children=be)}function It(){ve();const m=n.fs,w=n.root,k=n.showHidden,W=Z;P.value=[],ue=m.onDirChanged(z=>{en(m,w,k,W,z).catch(()=>{})}),St(m,w,k,W).catch(()=>{})}ft(()=>[n.root,n.fs,n.showHidden],It),ft(()=>[n.root,n.fs,n.showHidden,Me.value],async([m,w,k,W])=>{const z=++X;if(U.value=[],$.value=!1,!W){M.value=!1;return}M.value=!0;try{const Y=await Lu(w,m,W,{showHidden:k,maxDirs:w.searchMaxDirs,isCancelled:()=>R||X!==z});if(R||X!==z)return;U.value=Y.results,$.value=Y.truncated}catch(Y){if(R||X!==z)return;it("file-explorer","filename search failed",{error:Se(Y)}),U.value=[],$.value=!1}finally{!R&&X===z&&(M.value=!1)}},{immediate:!0}),En(()=>{It()});async function Wn(m){var Y,xe;if(!m.isDir)return;const w=n.fs,k=n.root,W=n.showHidden,z=Z;if(Nt(w,k,W,z,m)){if(C.value=m.path,m.expanded){te(m.path),I.delete(m.path),B(m.path),Fe(m.path,!0),K(m),m.expanded=!1;const be=N.get(m.path);if(be&&(N.delete(m.path),await $e(be.fs,be.id),!Nt(w,k,W,z,m)))return}else{if(I.has(m.path)){te(m.path),ge(m.path),I.delete(m.path);return}const be=te(m.path);I.set(m.path,be);try{if(m.children===null){const Xs=ge(m.path);let Xo;try{Xo=await Le(w,m.path,W)}catch(Qo){Nt(w,k,W,z,m)&&(it("file-explorer","listing a directory failed",{path:m.path,error:Se(Qo)}),(xe=(Y=n.context)==null?void 0:Y.showToast)==null||xe.call(Y,i("plugins.fileExplorer.treeLoadFailed",{path:m.path,message:Se(Qo)})));return}if(!Nt(w,k,W,z,m)||G.get(m.path)!==be||L.get(m.path)!==Xs)return;m.children=Xo}if(!Nt(w,k,W,z,m)||G.get(m.path)!==be)return;m.expanded=!0;const Ut=await w.watchDir(m.path);if(!Nt(w,k,W,z,m)||!m.expanded||G.get(m.path)!==be){await $e(w,Ut);return}const Kt=N.get(m.path);if(Kt&&(N.delete(m.path),await $e(Kt.fs,Kt.id),!Nt(w,k,W,z,m)||G.get(m.path)!==be)){await $e(w,Ut);return}N.set(m.path,{fs:w,id:Ut})}catch(Ut){Nt(w,k,W,z,m)&&it("file-explorer","watcher unavailable or cap reached",{path:m.path,error:Se(Ut)})}finally{I.get(m.path)===be&&I.delete(m.path)}}Nt(w,k,W,z,m)&&r("dir-toggled",m.path,m.expanded)}}function fi(m,w){for(const k of m){if(k.path===w)return k;if(k.children){const W=fi(k.children,w);if(W)return W}}return null}function Nt(m,w,k,W,z){return ot(m,w,k,W)&&fi(P.value,z.path)===z}qt(()=>{R=!0,X++,ve()});function Af(m){m.isDir||(C.value=m.path,r("file-clicked",m.path))}function Mf(m){m.isDir||(C.value=m.path,r("file-double-clicked",m.path))}function Tf(m){C.value=m.path,r("file-clicked",m.path)}function Df(m){C.value=m.path,r("file-double-clicked",m.path)}function Ef(m){return m.replace(/["\\]/g,"\\$&")}function Of(m,w){const k=m.endsWith("/")?m.slice(0,-1):m;if(w===k||!w.startsWith(k+"/"))return[];const z=w.slice(k.length+1).split("/"),Y=[];let xe=k;for(let be=0;be{const m=C.value;if(!m)return n.root;const w=fi(P.value,m);return w?w.isDir?m:h(m):n.root});async function Rf(m){try{await en(n.fs,n.root,n.showHidden,Z,m)}catch(w){it("file-explorer","refreshing a directory failed",{path:m,error:Se(w)})}}return e({refresh:It,refreshDir:Rf,revealPath:Lf,selectedDir:Bf}),(m,w)=>(O(),V("div",{class:"tree-wrap",tabindex:"0",onClick:u,onKeydown:y},[kt.value?(O(),V("div",Pu,[J("span",Iu,Q(kt.value),1),J("button",{class:"tree-error-retry","data-test":"tree-error-retry",onClick:Bi(It,["stop"])},Q(q(i)("plugins.fileExplorer.retry")),1)])):Ie("",!0),Me.value?(O(),V("div",Nu,[M.value?(O(),V("div",_u,Q(q(i)("common.loading")),1)):U.value.length===0?(O(),V("div",Fu,Q(q(i)("plugins.fileExplorer.noSearchResults")),1)):Ie("",!0),(O(!0),V(Xt,null,mi(U.value,k=>(O(),V("button",{key:k.path,class:"search-result","data-test":"file-search-result",title:k.path,onClick:Bi(W=>Tf(k),["stop"]),onDblclick:Bi(W=>Df(k),["stop"])},[J("span",Hu,Q(k.name),1),J("span",Vu,Q(k.path),1)],40,Wu))),128)),$.value?(O(),V("div",$u,Q(q(i)("plugins.fileExplorer.searchTruncated")),1)):Ie("",!0)])):(O(),V(Xt,{key:2},[J("ul",zu,[(O(!0),V(Xt,null,mi(P.value,k=>(O(),V("li",{key:k.path},[vi(vu,{node:k,level:0,"selected-path":C.value,"inline-intent":l.value,onToggle:Wn,onClickFile:Af,onDblclickFile:Mf,onContext:f,onInlineSubmit:x,onInlineCancel:T},null,8,["node","selected-path","inline-intent"])]))),128))]),(O(!0),V(Xt,null,mi(Te.value,k=>(O(),V("div",{key:k.path,class:"search-status","data-test":"listing-truncated",title:k.path},Q(q(i)("plugins.fileExplorer.listingTruncated",{path:k.path,shown:k.shown,total:k.total})),9,qu))),128))],64)),o.value?(O(),V("div",{key:3,class:"ctx-menu","data-test":"file-tree-menu",style:mn({top:o.value.y+"px",left:o.value.x+"px"}),onClick:w[6]||(w[6]=Bi(()=>{},["stop"]))},[J("button",{"data-test":"menu-new-file",onClick:w[0]||(w[0]=k=>b("newFile"))},Q(q(i)("plugins.fileExplorer.newFile")),1),J("button",{"data-test":"menu-new-folder",onClick:w[1]||(w[1]=k=>b("newFolder"))},Q(q(i)("plugins.fileExplorer.newFolder")),1),J("button",{"data-test":"menu-rename",onClick:w[2]||(w[2]=k=>b("rename"))},Q(q(i)("plugins.fileExplorer.rename")),1),J("button",{"data-test":"menu-copy-path",onClick:w[3]||(w[3]=k=>b("copyPath"))},Q(q(i)("plugins.fileExplorer.copyPath")),1),J("button",{"data-test":"menu-send-to-terminal",onClick:w[4]||(w[4]=k=>b("sendToTerminal"))},Q(q(i)("plugins.fileExplorer.sendToTerminal")),1),J("button",{"data-test":"menu-delete",onClick:w[5]||(w[5]=k=>b("delete"))},Q(q(i)("plugins.fileExplorer.delete")),1),w[7]||(w[7]=J("hr",{class:"ctx-sep"},null,-1)),J("button",{class:"ctx-toggle","data-test":"menu-toggle-hidden",role:"menuitemcheckbox","aria-checked":m.showHidden?"true":"false",onClick:d},[J("span",Ku,Q(m.showHidden?"✓":""),1),ps(" "+Q(q(i)("plugins.fileExplorer.showHidden")),1)],8,Uu),J("button",{class:"ctx-toggle","data-test":"menu-toggle-line-numbers",role:"menuitemcheckbox","aria-checked":m.showLineNumbers?"true":"false",onClick:p},[J("span",Gu,Q(m.showLineNumbers?"✓":""),1),ps(" "+Q(q(i)("plugins.fileExplorer.showLineNumbers")),1)],8,ju)],4)):Ie("",!0),a.value?(O(),ke(Pa,{key:4,title:a.value.mode==="hard"?q(i)("plugins.fileExplorer.confirmHardDelete",{name:c(a.value.node.path)}):q(i)("plugins.fileExplorer.confirmTrash",{name:c(a.value.node.path)}),buttons:A(a.value.mode),onResolve:D},null,8,["title","buttons"])):Ie("",!0)],32))}}),Yu=rt(Ju,[["__scopeId","data-v-43e269b7"]]),Xu={class:"file-tabs"},Qu=["title","onClick"],Zu={class:"name"},ed={key:0,class:"dot","data-test":"dirty-dot"},td=["onClick"],id=["title"],nd=Qe({__name:"FileTabs",props:{tabs:{},activeIdx:{},viewMode:{}},emits:["select","close-request","toggle-view-mode"],setup(s,{emit:e}){const t=s,i=e,{t:n}=Ji();function r(l){const a=l.lastIndexOf("/");return a===-1?l:l.slice(a+1)}const o=me(()=>{const l=t.activeIdx;return l<0||l>=t.tabs.length?!1:/\.(svg|md|markdown)$/i.test(t.tabs[l].path)});return(l,a)=>(O(),V("div",Xu,[(O(!0),V(Xt,null,mi(t.tabs,(h,c)=>(O(),V("div",{key:h.path,class:Gi(["tab",{active:c===t.activeIdx,preview:!h.persistent}]),title:h.path,onClick:f=>i("select",c)},[J("span",Zu,[ps(Q(r(h.path)),1),h.dirty?(O(),V("span",ed,"•")):Ie("",!0)]),J("span",{class:"close",onClick:Bi(f=>i("close-request",c),["stop"])},[vi(q(Wf),{size:12,"stroke-width":2})],8,td)],10,Qu))),128)),o.value?(O(),V("button",{key:0,class:"view-toggle",title:l.viewMode==="code"?q(n)("plugins.fileExplorer.showAsRender"):q(n)("plugins.fileExplorer.showAsCode"),onClick:a[0]||(a[0]=h=>i("toggle-view-mode"))},Q(l.viewMode==="code"?q(n)("plugins.fileExplorer.showAsRender"):q(n)("plugins.fileExplorer.showAsCode")),9,id)):Ie("",!0)]))}}),sd=rt(nd,[["__scopeId","data-v-116ada8b"]]),rd=new Set(["png","jpg","jpeg","gif","webp","bmp","ico"]),od=new Set(["mp4","webm","mkv","mov"]),ld=new Set(["mp3","wav","ogg","flac","m4a"]);function ad(s){const e=s.lastIndexOf("/");return e>=0?s.slice(e+1):s}function hd(s){const e=s.lastIndexOf(".");return e<=0?null:s.slice(e+1).toLowerCase()}function cd(s,e){const t=ad(s),i=hd(t);return i==="svg"?"svg":i==="md"||i==="markdown"?"markdown":i&&rd.has(i)?"image":i&&od.has(i)?"video":i&&ld.has(i)?"audio":i==="pdf"?"pdf":e?"binary-unknown":"code"}let Sr=[],Ia=[];(()=>{let s="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>1;if(s=Ia[i])e=i+1;else return!0;if(e==t)return!1}}function el(s){return s>=127462&&s<=127487}const tl=8205;function ud(s,e,t=!0,i=!0){return(t?Na:dd)(s,e,i)}function Na(s,e,t){if(e==s.length)return e;e&&_a(s.charCodeAt(e))&&Fa(s.charCodeAt(e-1))&&e--;let i=Zs(s,e);for(e+=il(i);e=0&&el(Zs(s,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function dd(s,e,t){for(;e>0;){let i=Na(s,e-2,t);if(i=56320&&s<57344}function Fa(s){return s>=55296&&s<56320}function il(s){return s<65536?1:2}class ne{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]=Vi(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),Dt.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let i=[];return this.decompose(e,t,i,0),Dt.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),n=new cn(this),r=new cn(e);for(let o=t,l=t;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(e=1){return new cn(this,e)}iterRange(e,t=this.length){return new Wa(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ha(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]?ne.empty:e.length<=32?new we(e):Dt.from(we.split(e,[]))}}class we extends ne{constructor(e,t=pd(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((t?i:l)>=e)return new gd(n,l,i,o);n=l+1,i++}}decompose(e,t,i,n){let r=e<=0&&t>=this.length?this:new we(nl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let o=i.pop(),l=os(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new we(l,o.length+r.length));else{let a=l.length>>1;i.push(new we(l.slice(0,a)),new we(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof we))return super.replace(e,t,i);[e,t]=Vi(this,e,t);let n=os(this.text,os(i.text,nl(this.text,0,e)),t),r=this.length+i.length-(t-e);return n.length<=32?new we(n,r):Dt.from(we.split(n,[]),r)}sliceString(e,t=this.length,i=` -`){[e,t]=Vi(this,e,t);let n="";for(let r=0,o=0;r<=t&&oe&&o&&(n+=i),er&&(n+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let r of e)i.push(r),n+=r.length+1,i.length==32&&(t.push(new we(i,n)),i=[],n=-1);return n>-1&&t.push(new we(i,n)),t}}class Dt extends ne{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,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,n);n=l+1,i=a+1}}decompose(e,t,i,n){for(let r=0,o=0;o<=t&&r=o){let h=n&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=Vi(this,e,t),i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[n]=a,new Dt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` -`){[e,t]=Vi(this,e,t);let n="";for(let r=0,o=0;re&&r&&(n+=i),eo&&(n+=l.sliceString(e-o,t-o,i)),o=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Dt))return 0;let i=0,[n,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,r+=t){if(n==o||r==l)return i;let a=this.children[n],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new we(d,t)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Dt)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof we&&a&&(p=c[c.length-1])instanceof we&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new we(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Dt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Dt(l,t)}}ne.empty=new we([""],0);function pd(s){let e=-1;for(let t of s)e+=t.length+1;return e}function os(s,e,t=0,i=1e9){for(let n=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-n)),n0?1:(e instanceof we?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof we?n.text.length:n.children.length;if(o==(t>0?l: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((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(n instanceof we){let a=n.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=n.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof we?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Wa{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new cn(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:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.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 Ha{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=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=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ne.prototype[Symbol.iterator]=function(){return this.iter()},cn.prototype[Symbol.iterator]=Wa.prototype[Symbol.iterator]=Ha.prototype[Symbol.iterator]=function(){return this});class gd{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}function Vi(s,e,t){return e=Math.max(0,Math.min(s.length,e)),[e,Math.max(e,Math.min(s.length,t))]}function Oe(s,e,t=!0,i=!0){return ud(s,e,t,i)}function md(s){return s>=56320&&s<57344}function yd(s){return s>=55296&&s<56320}function Va(s,e){let t=s.charCodeAt(e);if(!yd(t)||e+1==s.length)return t;let i=s.charCodeAt(e+1);return md(i)?(t-55296<<10)+(i-56320)+65536:t}function vd(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function $a(s){return s<65536?1:2}const Cr=/\r\n?|\n/;var nt=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(nt||(nt={}));class Pt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-n);r+=l}else{if(i!=nt.Simple&&h>=e&&(i==nt.TrackDel&&ne||i==nt.TrackBefore&&ne))return null;if(h>e||h==e&&t<0&&!l)return e==n||t<0?r:r+a;r+=a}n=h}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return r}touchesRange(e,t=e){for(let i=0,n=0;i=0&&n<=t&&l>=e)return nt?"cover":!0;n=l}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}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 Pt(e)}static create(e){return new Pt(e)}}class Ce extends Pt{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 Ar(this,(t,i,n,r,o)=>e=e.replace(n,n+(i-t),o),!1),e}mapDesc(e,t=!1){return Mr(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,r=0;n=0){t[n]=l,t[n+1]=o;let a=n>>1;for(;i.length0&&Qt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let n=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!n.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?ne.of(d.split(i||Cr)):d:ne.empty,g=p.length;if(f==u&&g==0)return;fo&&We(n,f-o,-1),We(n,u-f,g),Qt(r,n,p),o=u}}return h(e),a(!l),l}static empty(e){return new Ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;nl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==s[n+1]?s[n]+=e:n>=0&&e==0&&s[n]==0?s[n+1]+=t:i?(s[n]+=e,s[n+1]+=t):s.push(e,t)}function Qt(s,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];e(n,h,r,c,f),n=h,r=c}}}function Mr(s,e,t,i=!1){let n=[],r=i?[]:null,o=new yn(s),l=new yn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);We(n,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class yn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?ne.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?ne.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 Jt{constructor(e,t,i,n){this.from=e,this.to=t,this.flags=i,this.goalColumn=n}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,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new Jt(i,n,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t,void 0,void 0,i);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n,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 S.range(e.anchor,e.head)}static create(e,t,i,n){return new Jt(e,t,i,n)}}class S{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:S.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;ie.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 S(e.ranges.map(t=>Jt.fromJSON(t)),e.main)}static single(e,t=e){return new S([S.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,n=0;nn.from-r.from),t=e.indexOf(i);for(let n=1;nr.head?S.range(a,l):S.range(l,a))}}return new S(e,t)}}function qa(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let go=0;class F{constructor(e,t,i,n,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=go++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new F(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:mo),!!e.static,e.enables)}of(e){return new ls([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ls(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ls(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function mo(s,e){return s==e||s.length==e.length&&s.every((t,i)=>t===e[i])}class ls{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=go++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Tr(f,c)){let d=i(f);if(l?!sl(d,f.values[o],n):!n(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=ms(u,p);if(this.dependencies.every(y=>y instanceof F?u.facet(y)===f.facet(y):y instanceof bt?u.field(y,!1)==f.field(y,!1):!0)||(l?sl(d=i(f),g,n):n(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}}function sl(s,e,t){if(s.length!=e.length)return!1;for(let i=0;is[a.id]),n=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[e.id]>>1;function l(a){let h=[];for(let c=0;ci===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Hn).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,n)=>{let r=i.values[t],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,n)=>{let r=i.facet(Hn),o=n.facet(Hn),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):n.config.address[this.id]!=null?(i.values[t]=n.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Hn.of({field:this,create:e})]}get extension(){return this}}const pi={lowest:4,low:3,default:2,high:1,highest:0};function tn(s){return e=>new Ua(e,s)}const On={highest:tn(pi.highest),high:tn(pi.high),default:tn(pi.default),low:tn(pi.low),lowest:tn(pi.lowest)};class Ua{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class Fs{of(e){return new Dr(this,e)}reconfigure(e){return Fs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Dr{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class gs{constructor(e,t,i,n,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let n=[],r=Object.create(null),o=new Map;for(let u of wd(e,t,o))u instanceof bt?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of n)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(y=>y.type==0))if(l[p.id]=a.length<<1|1,mo(g,d))a.push(i.facet(p));else{let y=p.combine(d.map(b=>b.value));a.push(i&&p.compare(y,i.facet(p))?i.facet(p):y)}else{for(let y of d)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=h.length<<1,h.push(b=>y.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(y=>bd(y,p,d))}}let f=h.map(u=>u(l));return new gs(e,o,f,l,a,r)}}function wd(s,e,t){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Dr&&t.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Dr){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof Ua)r(o.inner,o.prec);else if(o instanceof bt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ls)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,pi.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(s,pi.default),i.reduce((o,l)=>o.concat(l))}function fn(s,e){if(e&1)return 2;let t=e>>1,i=s.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[t]=4;let n=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|n}function ms(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}const Ka=F.define(),Er=F.define({combine:s=>s.some(e=>e),static:!0}),ja=F.define({combine:s=>s.length?s[0]:void 0,static:!0}),Ga=F.define(),Ja=F.define(),Ya=F.define(),Xa=F.define({combine:s=>s.length?s[0]:!1});class ai{constructor(e,t){this.type=e,this.value=t}static define(){return new xd}}class xd{of(e){return new ai(this,e)}}class kd{constructor(e){this.map=e}of(e){return new oe(this,e)}}class oe{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 oe(this.type,t)}is(e){return this.type==e}static define(e={}){return new kd(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let r=n.map(t);r&&i.push(r)}return i}}oe.reconfigure=oe.define();oe.appendConfig=oe.define();class Ae{constructor(e,t,i,n,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&qa(i,t.newLength),r.some(l=>l.type==Ae.time)||(this.annotations=r.concat(Ae.time.of(Date.now())))}static create(e,t,i,n,r,o){return new Ae(e,t,i,n,r,o)}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(Ae.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Ae.time=ai.define();Ae.userEvent=ai.define();Ae.addToHistory=ai.define();Ae.remote=ai.define();function Sd(s,e){let t=[];for(let i=0,n=0;;){let r,o;if(i=s[i]))r=s[i++],o=s[i++];else if(n=0;n--){let r=i[n](s);r instanceof Ae?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Ae?s=r[0]:s=Za(e,Ii(r),!1)}return s}function Ad(s){let e=s.startState,t=e.facet(Ya),i=s;for(let n=t.length-1;n>=0;n--){let r=t[n](s);r&&Object.keys(r).length&&(i=Qa(i,Or(e,r,s.changes.newLength),!0))}return i==s?s:Ae.create(e,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const Md=[];function Ii(s){return s==null?Md:Array.isArray(s)?s:[s]}var Ne=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(Ne||(Ne={}));const Td=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Lr;try{Lr=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Dd(s){if(Lr)return Lr.test(s);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Td.test(t)))return!0}return!1}function Ed(s){return e=>{if(!/\S/.test(e))return Ne.Space;if(Dd(e))return Ne.Word;for(let t=0;t-1)return Ne.Word;return Ne.Other}}class se{constructor(e,t,i,n,r,o){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ln.set(h,a)),t=null),n.set(l.value.compartment,l.value.extension)):l.is(oe.reconfigure)?(t=null,i=l.value):l.is(oe.appendConfig)&&(t=null,i=Ii(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=gs.resolve(i,n,this),r=new se(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(Er)?e.newSelection:e.newSelection.asSingle();new se(t,e.newDoc,o,r,(l,a)=>a.update(l,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:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),r=[i.range],o=Ii(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return se.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=gs.resolve(e.extensions||[],new Map),i=e.doc instanceof ne?e.doc:ne.of((e.doc||"").split(t.staticFacet(se.lineSeparator)||Cr)),n=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return qa(n,i.length),t.staticFacet(Er)||(n=n.asSingle()),new se(t,i,n,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(se.tabSize)}get lineBreak(){return this.facet(se.lineSeparator)||` + */const ou=Pt("pin",[["path",{d:"M12 17v5",key:"bb1du9"}],["path",{d:"M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z",key:"1nkz8b"}]]),lu={class:"icon"},au=["placeholder"],hu=Qe({__name:"InlineEditRow",props:{level:{},initialValue:{},placeholder:{},icon:{}},emits:["submit","cancel"],setup(s,{emit:e}){const t=s,i=e,n=j(t.initialValue??""),r=j(null);En(async()=>{var l,a;await us(),(l=r.value)==null||l.focus(),(a=r.value)==null||a.select()});function o(l){l.key==="Enter"?n.value.trim()===""?i("cancel"):i("submit",n.value.trim()):l.key==="Escape"&&i("cancel")}return(l,a)=>(O(),V("div",{class:"row",style:mn({paddingLeft:`${l.level*8}px`}),"data-test":"inline-edit-row"},[J("span",lu,[(O(),ke(hn(l.icon==="folder"?q(Ra):q(Ba)),{size:16,"stroke-width":1.5}))]),ds(J("input",{ref_key:"inputRef",ref:r,"onUpdate:modelValue":a[0]||(a[0]=h=>n.value=h),class:"input",placeholder:l.placeholder,"data-test":"inline-edit-input",onKeydown:o,onBlur:a[1]||(a[1]=h=>i("cancel"))},null,40,au),[[Oa,n.value]])],4))}}),Zo=rt(hu,[["__scopeId","data-v-ee0e2fb2"]]),cu={class:"node-wrap"},fu=["data-type","title"],uu={class:"twisty"},du={class:"icon"},pu={class:"node-name"},gu={key:0},mu=Qe({name:"FileTreeNode"}),yu=Qe({...mu,props:{node:{},level:{},selectedPath:{},inlineIntent:{}},emits:["toggle","click-file","dblclick-file","context","inline-submit","inline-cancel"],setup(s,{emit:e}){const t=s,i=e,n=me(()=>{var D;return((D=t.inlineIntent)==null?void 0:D.kind)==="rename"&&t.inlineIntent.node.path===t.node.path}),r=me(()=>{const D=t.inlineIntent;return!D||D.kind!=="newFile"&&D.kind!=="newFolder"?null:D.parentPath===t.node.path?D:null}),o=8,l=22,a={ts:{comp:Be,color:"#3178c6"},tsx:{comp:Be,color:"#3178c6"},js:{comp:Be,color:"#f7df1e"},jsx:{comp:Be,color:"#f7df1e"},go:{comp:Be,color:"#00add8"},py:{comp:Be,color:"#3776ab"},rs:{comp:Be,color:"#dea584"},sh:{comp:Be,color:"#89e051"},vue:{comp:Be,color:"#41b883"},json:{comp:iu,color:"#cbcb41"},md:{comp:Qs,color:"#519aba"},markdown:{comp:Qs,color:"#519aba"},txt:{comp:Qs,color:"#cccccc"},yaml:{comp:Be,color:"#cb171e"},yml:{comp:Be,color:"#cb171e"},toml:{comp:Be,color:"#9c4221"},html:{comp:Be,color:"#e44d26"},htm:{comp:Be,color:"#e44d26"},css:{comp:Be,color:"#264de4"},scss:{comp:Be,color:"#c6538c"},sass:{comp:Be,color:"#c6538c"},png:{comp:Di,color:"#a074c4"},jpg:{comp:Di,color:"#a074c4"},jpeg:{comp:Di,color:"#a074c4"},gif:{comp:Di,color:"#a074c4"},svg:{comp:Di,color:"#ffb13b"},ico:{comp:Di,color:"#a074c4"}};function h(D){const A=/\.([A-Za-z0-9]+)$/.exec(D);if(A){const P=a[A[1].toLowerCase()];if(P)return P}return{comp:Ba,color:"currentColor"}}function c(D,A){return typeof window>"u"?A:getComputedStyle(document.documentElement).getPropertyValue(D).trim()||A}const f=me(()=>c("--ed-folder","#d4a14a")),u=me(()=>c("--ed-chevron","rgba(173,186,199,0.7)")),d=me(()=>t.selectedPath===t.node.path),p=me(()=>t.node.expanded?Ff:nu),g=me(()=>t.node.expanded?su:Ra),y=me(()=>h(t.node.name));function b(){t.node.isDir?i("toggle",t.node):i("click-file",t.node)}function x(){t.node.isDir||i("dblclick-file",t.node)}function T(D){i("context",D,t.node,t.level)}return(D,A)=>{const P=Pf("FileTreeNode",!0);return O(),V("div",cu,[n.value?(O(),ke(Zo,{key:0,level:D.level,icon:D.node.isDir?"folder":"file","initial-value":D.node.name,onSubmit:A[0]||(A[0]=C=>i("inline-submit",C)),onCancel:A[1]||(A[1]=C=>i("inline-cancel"))},null,8,["level","icon","initial-value"])):(O(),V("div",{key:1,class:Gi(["node",{selected:d.value,"is-dir":D.node.isDir,"is-file":!D.node.isDir}]),"data-type":D.node.isDir?"dir":"file",style:mn({paddingLeft:`${D.level*o}px`,height:`${l}px`,lineHeight:`${l}px`}),title:D.node.path,onClick:b,onDblclick:x,onContextmenu:T},[J("span",uu,[D.node.isDir?(O(),ke(hn(p.value),{key:0,size:14,color:u.value,"stroke-width":2},null,8,["color"])):Ie("",!0)]),J("span",du,[D.node.isDir?(O(),ke(hn(g.value),{key:0,size:16,color:f.value,"stroke-width":1.5},null,8,["color"])):(O(),ke(hn(y.value.comp),{key:1,size:16,color:y.value.color,"stroke-width":1.5},null,8,["color"]))]),J("span",pu,Q(D.node.name),1)],46,fu)),D.node.isDir&&D.node.expanded&&D.node.children?(O(),V("ul",{key:2,class:"tree-list",style:mn({"--indent-base":`${D.level*o+12}px`})},[r.value?(O(),V("li",gu,[vi(Zo,{level:D.level+1,icon:r.value.kind==="newFolder"?"folder":"file",onSubmit:A[2]||(A[2]=C=>i("inline-submit",C)),onCancel:A[3]||(A[3]=C=>i("inline-cancel"))},null,8,["level","icon"])])):Ie("",!0),(O(!0),V(Xt,null,mi(D.node.children,C=>(O(),V("li",{key:C.path},[vi(P,{node:C,level:D.level+1,"selected-path":D.selectedPath,"inline-intent":D.inlineIntent,onToggle:A[4]||(A[4]=U=>i("toggle",U)),onClickFile:A[5]||(A[5]=U=>i("click-file",U)),onDblclickFile:A[6]||(A[6]=U=>i("dblclick-file",U)),onContext:A[7]||(A[7]=(U,M,$)=>i("context",U,M,$)),onInlineSubmit:A[8]||(A[8]=U=>i("inline-submit",U)),onInlineCancel:A[9]||(A[9]=()=>i("inline-cancel"))},null,8,["node","level","selected-path","inline-intent"])]))),128))],4)):Ie("",!0)])}}}),vu=rt(yu,[["__scopeId","data-v-e70abcab"]]),bu=["aria-label"],wu={class:"dlg-title"},xu={key:0,class:"dlg-msg"},ku={class:"dlg-buttons"},Su=["data-test","onClick"],Cu=Qe({__name:"ConfirmDialog",props:{title:{},message:{},buttons:{}},emits:["resolve"],setup(s,{emit:e}){const t=s,i=e,n=j(null);function r(o){if(o.key==="Escape"){const l=t.buttons.find(a=>a.id==="cancel");l&&i("resolve",l.id)}}return En(()=>{var o;window.addEventListener("keydown",r),(o=n.value)==null||o.focus()}),qt(()=>window.removeEventListener("keydown",r)),(o,l)=>(O(),V("div",{class:"dlg-scrim","data-test":"confirm-dialog",onClick:l[0]||(l[0]=Bi(()=>{const a=t.buttons.find(h=>h.id==="cancel");a&&i("resolve",a.id)},["self"]))},[J("div",{ref_key:"rootRef",ref:n,class:"dlg",tabindex:"-1",role:"dialog","aria-label":o.title},[J("div",wu,Q(o.title),1),o.message?(O(),V("div",xu,Q(o.message),1)):Ie("",!0),J("div",ku,[(O(!0),V(Xt,null,mi(o.buttons,a=>(O(),V("button",{key:a.id,class:Gi(["dlg-btn",a.kind??"secondary"]),"data-test":`btn-${a.id}`,onClick:h=>i("resolve",a.id)},Q(a.label),11,Su))),128))])],8,bu)]))}}),Pa=rt(Cu,[["__scopeId","data-v-177a9baf"]]),Au=200,Mu=2e3,Tu=new Set([".git","node_modules","dist","build",".next",".turbo","vendor"]),Du=new Set(["proc","sys","dev","run"]);function Eu(s,e){return s.endsWith("/")?s+e:s+"/"+e}function Ou(s){return s.startsWith(".")}async function Lu(s,e,t,i){const n=t.trim().toLowerCase();if(!n)return{results:[],truncated:!1};const r=i.maxResults??Au,o=i.maxDirs??Mu,l=i.isCancelled??(()=>!1),a=[],h=[e];let c=0,f=!1;for(;h.length>0;){if(l())return{results:[],truncated:!1};if(c>=o||a.length>=r){f=!0;break}const u=h.shift();c++;let d;try{d=await s.listDir(u)}catch{continue}for(const p of d){if(!i.showHidden&&Ou(p.name))continue;const g=Eu(u,p.name);if(p.isDir){if(Tu.has(p.name)||u==="/"&&Du.has(p.name))continue;h.push(g);continue}if(p.name.toLowerCase().includes(n)&&(a.push({path:g,name:p.name}),a.length>=r)){f=!0;break}}}return{results:a,truncated:f}}const Bu=/^[A-Za-z0-9_./@:+,%=-]+$/;function Ru(s){return s===""?"''":Bu.test(s)?s:"'"+s.replace(/'/g,"'\\''")+"'"}const Pu={key:0,class:"tree-error","data-test":"tree-error"},Iu={class:"tree-error-text"},Nu={key:1,class:"search-results","data-test":"file-search-results"},_u={key:0,class:"search-status"},Fu={key:1,class:"search-status"},Wu=["title","onClick","onDblclick"],Hu={class:"search-name"},Vu={class:"search-path"},$u={key:2,class:"search-status"},zu={class:"tree-root"},qu=["title"],Uu=["aria-checked"],Ku={class:"ctx-check"},ju=["aria-checked"],Gu={class:"ctx-check"},Ju=Qe({__name:"FileTree",props:{fs:{},root:{},showHidden:{type:Boolean},showLineNumbers:{type:Boolean},searchQuery:{},context:{}},emits:["file-clicked","file-double-clicked","dir-toggled","toggle-show-hidden","toggle-show-line-numbers"],setup(s,{expose:e,emit:t}){const{t:i}=Ji(),n=s,r=t,o=j(null),l=j(null),a=j(null);function h(m){const w=m.lastIndexOf("/");return w<=0?"/":m.slice(0,w)}function c(m){const w=m.lastIndexOf("/");return w===-1?m:m.slice(w+1)}function f(m,w,k){m.preventDefault(),o.value={x:m.clientX,y:m.clientY,node:w,level:k,shift:m.shiftKey}}function u(){o.value=null}function d(){o.value=null,r("toggle-show-hidden",!n.showHidden)}function p(){o.value=null,r("toggle-show-line-numbers",!n.showLineNumbers)}async function g(m){var w,k,W;try{if((w=navigator.clipboard)!=null&&w.writeText)await navigator.clipboard.writeText(m);else if(!Wf(m))return;(W=(k=n.context)==null?void 0:k.showToast)==null||W.call(k,i("plugins.fileExplorer.pathCopied"))}catch(z){it("file-explorer","copy path failed",{error:Se(z)})}}function y(m){!(m.key==="c"||m.key==="C")||m.altKey||m.shiftKey||!(m.metaKey||m.ctrlKey)||C.value&&(m.preventDefault(),g(C.value))}async function b(m){var W,z,Y,xe,be,Ut;const w=o.value;if(o.value=null,!w)return;const k=w.node;if(m==="copyPath"){await g(k.path);return}if(m==="sendToTerminal"){(z=(W=n.context)==null?void 0:W.send)==null||z.call(W,Ru(k.path));return}if(m==="newFile"||m==="newFolder"){const Kt=k.isDir?k.path:h(k.path),Xs=k.isDir?w.level+1:w.level;l.value={kind:m,parentPath:Kt,parentLevel:Xs};return}if(m==="rename"){l.value={kind:"rename",node:k,level:w.level};return}if(m==="delete"){const Kt=k.isDir?(xe=(Y=n.fs).dirRemovalRefusal)==null?void 0:xe.call(Y,k.path):void 0;if(Kt){(Ut=(be=n.context)==null?void 0:be.showToast)==null||Ut.call(be,Kt);return}a.value={node:k,mode:w.shift?"hard":"trash"}}}async function x(m){var k,W;const w=l.value;if(l.value=null,!!w)try{w.kind==="newFile"?await n.fs.createFile(je(w.parentPath,m)):w.kind==="newFolder"?await n.fs.mkdir(je(w.parentPath,m)):w.kind==="rename"&&await n.fs.rename(w.node.path,je(h(w.node.path),m))}catch(z){it("file-explorer","inline action failed",{error:Se(z)}),(W=(k=n.context)==null?void 0:k.showToast)==null||W.call(k,Se(z))}}function T(){l.value=null}async function D(m){var k,W;const w=a.value;if(a.value=null,!(!w||m==="cancel"))try{if(m==="hard")await n.fs.remove(w.node.path,w.node.isDir);else try{await n.fs.trash(w.node.path)}catch(z){if((z.message??"").includes("no platform trash command available"))a.value={node:w.node,mode:"hard"};else throw z}}catch(z){it("file-explorer","delete failed",{error:Se(z)}),(W=(k=n.context)==null?void 0:k.showToast)==null||W.call(k,Se(z))}}function A(m){return[m==="hard"?{id:"hard",label:i("plugins.fileExplorer.delete"),kind:"danger"}:{id:"trash",label:i("plugins.fileExplorer.moveToTrash"),kind:"primary"},{id:"cancel",label:i("plugins.fileExplorer.cancel"),kind:"secondary"}]}const P=j([]),C=j(""),U=j([]),M=j(!1),$=j(!1),N=new Map,I=new Map,G=new Map,L=new Map;let R=!1,Z=0,X=0,ue=()=>{};const Me=me(()=>(n.searchQuery??"").trim());function ot(m,w,k,W){return!R&&Z===W&&n.fs===m&&n.root===w&&n.showHidden===k}const de=j({}),Te=me(()=>Object.entries(de.value).map(([m,w])=>({path:m,...w})));function De(m,w,k,W){const z=m in de.value;if(!w){if(z){const Y={...de.value};delete Y[m],de.value=Y}return}de.value={...de.value,[m]:{shown:k,total:W}}}function Fe(m,w){const k={...de.value};let W=!1;for(const z of Object.keys(k))(z===m?!w:!ci(z,m))||(delete k[z],W=!0);W&&(de.value=k)}async function Le(m,w,k){const W=m.listDirDetailed?await m.listDirDetailed(w):{entries:await m.listDir(w),truncated:!1,total:0},z=W.entries;return De(w,W.truncated,z.length,W.total),z.filter(Y=>k||!Y.name.startsWith(".")).map(Y=>({path:je(w,Y.name),name:Y.name,isDir:Y.isDir,expanded:!1,children:null})).sort((Y,xe)=>Y.isDir===xe.isDir?Y.name.localeCompare(xe.name):Y.isDir?-1:1)}function je(m,w){return m.endsWith("/")?m+w:m+"/"+w}async function $e(m,w){try{await m.unwatchDir(w)}catch{}}function Fn(){const m=Array.from(N.values());N.clear();for(const{fs:w,id:k}of m)$e(w,k)}function ci(m,w){return m.startsWith(w.endsWith("/")?w:`${w}/`)}function B(m){Fe(m,!1);for(const[w,k]of Array.from(N))ci(w,m)&&(N.delete(w),$e(k.fs,k.id));for(const w of Array.from(I.keys()))ci(w,m)&&I.delete(w);for(const w of Array.from(G.keys()))ci(w,m)&&te(w);for(const w of Array.from(L.keys()))ci(w,m)&&ge(w)}function K(m){for(const w of m.children??[])w.expanded=!1,K(w)}function te(m){const w=(G.get(m)??0)+1;return G.set(m,w),w}function ge(m){const w=(L.get(m)??0)+1;return L.set(m,w),w}function ve(){Z++,ue(),ue=()=>{},de.value={},xt.value="",I.clear(),G.clear(),L.clear(),Fn()}const xt=j("");async function kt(m,w,k,W){const z=ge(w);let Y;try{Y=await Le(m,w,k)}catch(xe){ot(m,w,k,W)&&L.get(w)===z&&(xt.value=i("plugins.fileExplorer.treeLoadFailed",{path:w,message:Se(xe)}),P.value=[]);return}!ot(m,w,k,W)||L.get(w)!==z||(xt.value="",B(w),P.value=Y)}async function en(m,w,k,W,z){if(!ot(m,w,k,W))return;if(z===w){await kt(m,w,k,W);return}const Y=fi(P.value,z);if(!Y||!Y.expanded)return;const xe=ge(Y.path),be=await Le(m,Y.path,k);!ot(m,w,k,W)||!Y.expanded||fi(P.value,z)!==Y||L.get(Y.path)!==xe||(B(Y.path),Y.children=be)}function It(){ve();const m=n.fs,w=n.root,k=n.showHidden,W=Z;P.value=[],ue=m.onDirChanged(z=>{en(m,w,k,W,z).catch(()=>{})}),kt(m,w,k,W).catch(()=>{})}ft(()=>[n.root,n.fs,n.showHidden],It),ft(()=>[n.root,n.fs,n.showHidden,Me.value],async([m,w,k,W])=>{const z=++X;if(U.value=[],$.value=!1,!W){M.value=!1;return}M.value=!0;try{const Y=await Lu(w,m,W,{showHidden:k,maxDirs:w.searchMaxDirs,isCancelled:()=>R||X!==z});if(R||X!==z)return;U.value=Y.results,$.value=Y.truncated}catch(Y){if(R||X!==z)return;it("file-explorer","filename search failed",{error:Se(Y)}),U.value=[],$.value=!1}finally{!R&&X===z&&(M.value=!1)}},{immediate:!0}),En(()=>{It()});async function Wn(m){var Y,xe;if(!m.isDir)return;const w=n.fs,k=n.root,W=n.showHidden,z=Z;if(Nt(w,k,W,z,m)){if(C.value=m.path,m.expanded){te(m.path),I.delete(m.path),B(m.path),Fe(m.path,!0),K(m),m.expanded=!1;const be=N.get(m.path);if(be&&(N.delete(m.path),await $e(be.fs,be.id),!Nt(w,k,W,z,m)))return}else{if(I.has(m.path)){te(m.path),ge(m.path),I.delete(m.path);return}const be=te(m.path);I.set(m.path,be);try{if(m.children===null){const Xs=ge(m.path);let Xo;try{Xo=await Le(w,m.path,W)}catch(Qo){Nt(w,k,W,z,m)&&(it("file-explorer","listing a directory failed",{path:m.path,error:Se(Qo)}),(xe=(Y=n.context)==null?void 0:Y.showToast)==null||xe.call(Y,i("plugins.fileExplorer.treeLoadFailed",{path:m.path,message:Se(Qo)})));return}if(!Nt(w,k,W,z,m)||G.get(m.path)!==be||L.get(m.path)!==Xs)return;m.children=Xo}if(!Nt(w,k,W,z,m)||G.get(m.path)!==be)return;m.expanded=!0;const Ut=await w.watchDir(m.path);if(!Nt(w,k,W,z,m)||!m.expanded||G.get(m.path)!==be){await $e(w,Ut);return}const Kt=N.get(m.path);if(Kt&&(N.delete(m.path),await $e(Kt.fs,Kt.id),!Nt(w,k,W,z,m)||G.get(m.path)!==be)){await $e(w,Ut);return}N.set(m.path,{fs:w,id:Ut})}catch(Ut){Nt(w,k,W,z,m)&&it("file-explorer","watcher unavailable or cap reached",{path:m.path,error:Se(Ut)})}finally{I.get(m.path)===be&&I.delete(m.path)}}Nt(w,k,W,z,m)&&r("dir-toggled",m.path,m.expanded)}}function fi(m,w){for(const k of m){if(k.path===w)return k;if(k.children){const W=fi(k.children,w);if(W)return W}}return null}function Nt(m,w,k,W,z){return ot(m,w,k,W)&&fi(P.value,z.path)===z}qt(()=>{R=!0,X++,ve()});function Af(m){m.isDir||(C.value=m.path,r("file-clicked",m.path))}function Mf(m){m.isDir||(C.value=m.path,r("file-double-clicked",m.path))}function Tf(m){C.value=m.path,r("file-clicked",m.path)}function Df(m){C.value=m.path,r("file-double-clicked",m.path)}function Ef(m){return m.replace(/["\\]/g,"\\$&")}function Of(m,w){const k=m.endsWith("/")?m.slice(0,-1):m;if(w===k||!w.startsWith(k+"/"))return[];const z=w.slice(k.length+1).split("/"),Y=[];let xe=k;for(let be=0;be{const m=C.value;if(!m)return n.root;const w=fi(P.value,m);return w?w.isDir?m:h(m):n.root});async function Rf(m){try{await en(n.fs,n.root,n.showHidden,Z,m)}catch(w){it("file-explorer","refreshing a directory failed",{path:m,error:Se(w)})}}return e({refresh:It,refreshDir:Rf,revealPath:Lf,selectedDir:Bf}),(m,w)=>(O(),V("div",{class:"tree-wrap",tabindex:"0",onClick:u,onKeydown:y},[xt.value?(O(),V("div",Pu,[J("span",Iu,Q(xt.value),1),J("button",{class:"tree-error-retry","data-test":"tree-error-retry",onClick:Bi(It,["stop"])},Q(q(i)("plugins.fileExplorer.retry")),1)])):Ie("",!0),Me.value?(O(),V("div",Nu,[M.value?(O(),V("div",_u,Q(q(i)("common.loading")),1)):U.value.length===0?(O(),V("div",Fu,Q(q(i)("plugins.fileExplorer.noSearchResults")),1)):Ie("",!0),(O(!0),V(Xt,null,mi(U.value,k=>(O(),V("button",{key:k.path,class:"search-result","data-test":"file-search-result",title:k.path,onClick:Bi(W=>Tf(k),["stop"]),onDblclick:Bi(W=>Df(k),["stop"])},[J("span",Hu,Q(k.name),1),J("span",Vu,Q(k.path),1)],40,Wu))),128)),$.value?(O(),V("div",$u,Q(q(i)("plugins.fileExplorer.searchTruncated")),1)):Ie("",!0)])):(O(),V(Xt,{key:2},[J("ul",zu,[(O(!0),V(Xt,null,mi(P.value,k=>(O(),V("li",{key:k.path},[vi(vu,{node:k,level:0,"selected-path":C.value,"inline-intent":l.value,onToggle:Wn,onClickFile:Af,onDblclickFile:Mf,onContext:f,onInlineSubmit:x,onInlineCancel:T},null,8,["node","selected-path","inline-intent"])]))),128))]),(O(!0),V(Xt,null,mi(Te.value,k=>(O(),V("div",{key:k.path,class:"search-status","data-test":"listing-truncated",title:k.path},Q(q(i)("plugins.fileExplorer.listingTruncated",{path:k.path,shown:k.shown,total:k.total})),9,qu))),128))],64)),o.value?(O(),V("div",{key:3,class:"ctx-menu","data-test":"file-tree-menu",style:mn({top:o.value.y+"px",left:o.value.x+"px"}),onClick:w[6]||(w[6]=Bi(()=>{},["stop"]))},[J("button",{"data-test":"menu-new-file",onClick:w[0]||(w[0]=k=>b("newFile"))},Q(q(i)("plugins.fileExplorer.newFile")),1),J("button",{"data-test":"menu-new-folder",onClick:w[1]||(w[1]=k=>b("newFolder"))},Q(q(i)("plugins.fileExplorer.newFolder")),1),J("button",{"data-test":"menu-rename",onClick:w[2]||(w[2]=k=>b("rename"))},Q(q(i)("plugins.fileExplorer.rename")),1),J("button",{"data-test":"menu-copy-path",onClick:w[3]||(w[3]=k=>b("copyPath"))},Q(q(i)("plugins.fileExplorer.copyPath")),1),J("button",{"data-test":"menu-send-to-terminal",onClick:w[4]||(w[4]=k=>b("sendToTerminal"))},Q(q(i)("plugins.fileExplorer.sendToTerminal")),1),J("button",{"data-test":"menu-delete",onClick:w[5]||(w[5]=k=>b("delete"))},Q(q(i)("plugins.fileExplorer.delete")),1),w[7]||(w[7]=J("hr",{class:"ctx-sep"},null,-1)),J("button",{class:"ctx-toggle","data-test":"menu-toggle-hidden",role:"menuitemcheckbox","aria-checked":m.showHidden?"true":"false",onClick:d},[J("span",Ku,Q(m.showHidden?"✓":""),1),ps(" "+Q(q(i)("plugins.fileExplorer.showHidden")),1)],8,Uu),J("button",{class:"ctx-toggle","data-test":"menu-toggle-line-numbers",role:"menuitemcheckbox","aria-checked":m.showLineNumbers?"true":"false",onClick:p},[J("span",Gu,Q(m.showLineNumbers?"✓":""),1),ps(" "+Q(q(i)("plugins.fileExplorer.showLineNumbers")),1)],8,ju)],4)):Ie("",!0),a.value?(O(),ke(Pa,{key:4,title:a.value.mode==="hard"?q(i)("plugins.fileExplorer.confirmHardDelete",{name:c(a.value.node.path)}):q(i)("plugins.fileExplorer.confirmTrash",{name:c(a.value.node.path)}),buttons:A(a.value.mode),onResolve:D},null,8,["title","buttons"])):Ie("",!0)],32))}}),Yu=rt(Ju,[["__scopeId","data-v-43e269b7"]]),Xu={class:"file-tabs"},Qu=["title","onClick"],Zu={class:"name"},ed={key:0,class:"dot","data-test":"dirty-dot"},td=["onClick"],id=["title"],nd=Qe({__name:"FileTabs",props:{tabs:{},activeIdx:{},viewMode:{}},emits:["select","close-request","toggle-view-mode"],setup(s,{emit:e}){const t=s,i=e,{t:n}=Ji();function r(l){const a=l.lastIndexOf("/");return a===-1?l:l.slice(a+1)}const o=me(()=>{const l=t.activeIdx;return l<0||l>=t.tabs.length?!1:/\.(svg|md|markdown)$/i.test(t.tabs[l].path)});return(l,a)=>(O(),V("div",Xu,[(O(!0),V(Xt,null,mi(t.tabs,(h,c)=>(O(),V("div",{key:h.path,class:Gi(["tab",{active:c===t.activeIdx,preview:!h.persistent}]),title:h.path,onClick:f=>i("select",c)},[J("span",Zu,[ps(Q(r(h.path)),1),h.dirty?(O(),V("span",ed,"•")):Ie("",!0)]),J("span",{class:"close",onClick:Bi(f=>i("close-request",c),["stop"])},[vi(q(Hf),{size:12,"stroke-width":2})],8,td)],10,Qu))),128)),o.value?(O(),V("button",{key:0,class:"view-toggle",title:l.viewMode==="code"?q(n)("plugins.fileExplorer.showAsRender"):q(n)("plugins.fileExplorer.showAsCode"),onClick:a[0]||(a[0]=h=>i("toggle-view-mode"))},Q(l.viewMode==="code"?q(n)("plugins.fileExplorer.showAsRender"):q(n)("plugins.fileExplorer.showAsCode")),9,id)):Ie("",!0)]))}}),sd=rt(nd,[["__scopeId","data-v-116ada8b"]]),rd=new Set(["png","jpg","jpeg","gif","webp","bmp","ico"]),od=new Set(["mp4","webm","mkv","mov"]),ld=new Set(["mp3","wav","ogg","flac","m4a"]);function ad(s){const e=s.lastIndexOf("/");return e>=0?s.slice(e+1):s}function hd(s){const e=s.lastIndexOf(".");return e<=0?null:s.slice(e+1).toLowerCase()}function cd(s,e){const t=ad(s),i=hd(t);return i==="svg"?"svg":i==="md"||i==="markdown"?"markdown":i&&rd.has(i)?"image":i&&od.has(i)?"video":i&&ld.has(i)?"audio":i==="pdf"?"pdf":e?"binary-unknown":"code"}let Sr=[],Ia=[];(()=>{let s="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>1;if(s=Ia[i])e=i+1;else return!0;if(e==t)return!1}}function el(s){return s>=127462&&s<=127487}const tl=8205;function ud(s,e,t=!0,i=!0){return(t?Na:dd)(s,e,i)}function Na(s,e,t){if(e==s.length)return e;e&&_a(s.charCodeAt(e))&&Fa(s.charCodeAt(e-1))&&e--;let i=Zs(s,e);for(e+=il(i);e=0&&el(Zs(s,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function dd(s,e,t){for(;e>0;){let i=Na(s,e-2,t);if(i=56320&&s<57344}function Fa(s){return s>=55296&&s<56320}function il(s){return s<65536?1:2}class ne{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]=Vi(this,e,t);let n=[];return this.decompose(0,e,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(t,this.length,n,1),Tt.from(n,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Vi(this,e,t);let i=[];return this.decompose(e,t,i,0),Tt.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),n=new cn(this),r=new cn(e);for(let o=t,l=t;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(e=1){return new cn(this,e)}iterRange(e,t=this.length){return new Wa(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;i=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Ha(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]?ne.empty:e.length<=32?new we(e):Tt.from(we.split(e,[]))}}class we extends ne{constructor(e,t=pd(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((t?i:l)>=e)return new gd(n,l,i,o);n=l+1,i++}}decompose(e,t,i,n){let r=e<=0&&t>=this.length?this:new we(nl(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let o=i.pop(),l=os(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new we(l,o.length+r.length));else{let a=l.length>>1;i.push(new we(l.slice(0,a)),new we(l.slice(a)))}}else i.push(r)}replace(e,t,i){if(!(i instanceof we))return super.replace(e,t,i);[e,t]=Vi(this,e,t);let n=os(this.text,os(i.text,nl(this.text,0,e)),t),r=this.length+i.length-(t-e);return n.length<=32?new we(n,r):Tt.from(we.split(n,[]),r)}sliceString(e,t=this.length,i=` +`){[e,t]=Vi(this,e,t);let n="";for(let r=0,o=0;r<=t&&oe&&o&&(n+=i),er&&(n+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],n=-1;for(let r of e)i.push(r),n+=r.length+1,i.length==32&&(t.push(new we(i,n)),i=[],n=-1);return n>-1&&t.push(new we(i,n)),t}}class Tt extends ne{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,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,n);n=l+1,i=a+1}}decompose(e,t,i,n){for(let r=0,o=0;o<=t&&r=o){let h=n&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!h?i.push(l):l.decompose(e-o,t-o,i,h)}o=a+1}}replace(e,t,i){if([e,t]=Vi(this,e,t),i.lines=r&&t<=l){let a=o.replace(e-r,t-r,i),h=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>h>>6){let c=this.children.slice();return c[n]=a,new Tt(c,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` +`){[e,t]=Vi(this,e,t);let n="";for(let r=0,o=0;re&&r&&(n+=i),eo&&(n+=l.sliceString(e-o,t-o,i)),o=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Tt))return 0;let i=0,[n,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,r+=t){if(n==o||r==l)return i;let a=this.children[n],h=e.children[r];if(a!=h)return i+a.scanIdentical(h,t);i+=a.length+1}}static from(e,t=e.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new we(d,t)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Tt)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof we&&a&&(p=c[c.length-1])instanceof we&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new we(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Tt.from(c,h)),h=-1,a=c.length=0)}for(let d of e)f(d);return u(),l.length==1?l[0]:new Tt(l,t)}}ne.empty=new we([""],0);function pd(s){let e=-1;for(let t of s)e+=t.length+1;return e}function os(s,e,t=0,i=1e9){for(let n=0,r=0,o=!0;r=t&&(a>i&&(l=l.slice(0,i-n)),n0?1:(e instanceof we?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof we?n.text.length:n.children.length;if(o==(t>0?l: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((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(n instanceof we){let a=n.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=n.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof we?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Wa{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new cn(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:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=i?n:t<0?n.slice(n.length-i):n.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 Ha{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:n}=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=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(ne.prototype[Symbol.iterator]=function(){return this.iter()},cn.prototype[Symbol.iterator]=Wa.prototype[Symbol.iterator]=Ha.prototype[Symbol.iterator]=function(){return this});class gd{constructor(e,t,i,n){this.from=e,this.to=t,this.number=i,this.text=n}get length(){return this.to-this.from}}function Vi(s,e,t){return e=Math.max(0,Math.min(s.length,e)),[e,Math.max(e,Math.min(s.length,t))]}function Oe(s,e,t=!0,i=!0){return ud(s,e,t,i)}function md(s){return s>=56320&&s<57344}function yd(s){return s>=55296&&s<56320}function Va(s,e){let t=s.charCodeAt(e);if(!yd(t)||e+1==s.length)return t;let i=s.charCodeAt(e+1);return md(i)?(t-55296<<10)+(i-56320)+65536:t}function vd(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function $a(s){return s<65536?1:2}const Cr=/\r\n?|\n/;var nt=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(nt||(nt={}));class Rt{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-n);r+=l}else{if(i!=nt.Simple&&h>=e&&(i==nt.TrackDel&&ne||i==nt.TrackBefore&&ne))return null;if(h>e||h==e&&t<0&&!l)return e==n||t<0?r:r+a;r+=a}n=h}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return r}touchesRange(e,t=e){for(let i=0,n=0;i=0&&n<=t&&l>=e)return nt?"cover":!0;n=l}return!1}toString(){let e="";for(let t=0;t=0?":"+n:"")}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 Rt(e)}static create(e){return new Rt(e)}}class Ce extends Rt{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 Ar(this,(t,i,n,r,o)=>e=e.replace(n,n+(i-t),o),!1),e}mapDesc(e,t=!1){return Mr(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let n=0,r=0;n=0){t[n]=l,t[n+1]=o;let a=n>>1;for(;i.length0&&Qt(i,t,r.text),r.forward(c),l+=c}let h=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,i){let n=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!n.length)return;ou||f<0||u>t)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${t})`);let p=d?typeof d=="string"?ne.of(d.split(i||Cr)):d:ne.empty,g=p.length;if(f==u&&g==0)return;fo&&We(n,f-o,-1),We(n,u-f,g),Qt(r,n,p),o=u}}return h(e),a(!l),l}static empty(e){return new Ce(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let n=0;nl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;i.length=0&&t<=0&&t==s[n+1]?s[n]+=e:n>=0&&e==0&&s[n]==0?s[n+1]+=t:i?(s[n]+=e,s[n+1]+=t):s.push(e,t)}function Qt(s,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];e(n,h,r,c,f),n=h,r=c}}}function Mr(s,e,t,i=!1){let n=[],r=i?[]:null,o=new yn(s),l=new yn(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);We(n,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class yn{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?ne.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?ne.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 Jt{constructor(e,t,i,n){this.from=e,this.to=t,this.flags=i,this.goalColumn=n}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,n;return this.empty?i=n=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new Jt(i,n,this.flags,this.goalColumn)}extend(e,t=e,i=0){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t,void 0,void 0,i);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n,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 S.range(e.anchor,e.head)}static create(e,t,i,n){return new Jt(e,t,i,n)}}class S{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:S.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;ie.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 S(e.ranges.map(t=>Jt.fromJSON(t)),e.main)}static single(e,t=e){return new S([S.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,n=0;nn.from-r.from),t=e.indexOf(i);for(let n=1;nr.head?S.range(a,l):S.range(l,a))}}return new S(e,t)}}function qa(s,e){for(let t of s.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let go=0;class F{constructor(e,t,i,n,r){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=n,this.id=go++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new F(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:mo),!!e.static,e.enables)}of(e){return new ls([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ls(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ls(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function mo(s,e){return s==e||s.length==e.length&&s.every((t,i)=>t===e[i])}class ls{constructor(e,t,i,n){this.dependencies=e,this.facet=t,this.type=i,this.value=n,this.id=go++}dynamicSlot(e){var t;let i=this.value,n=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((t=e[f.id])!==null&&t!==void 0?t:1)&1||c.push(e[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||Tr(f,c)){let d=i(f);if(l?!sl(d,f.values[o],n):!n(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=ms(u,p);if(this.dependencies.every(y=>y instanceof F?u.facet(y)===f.facet(y):y instanceof vt?u.field(y,!1)==f.field(y,!1):!0)||(l?sl(d=i(f),g,n):n(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}get extension(){return this}}function sl(s,e,t){if(s.length!=e.length)return!1;for(let i=0;is[a.id]),n=t.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[e.id]>>1;function l(a){let h=[];for(let c=0;ci===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Hn).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,n)=>{let r=i.values[t],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[t]=o,1)},reconfigure:(i,n)=>{let r=i.facet(Hn),o=n.facet(Hn),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(i.values[t]=l.create(i),1):n.config.address[this.id]!=null?(i.values[t]=n.field(this),0):(i.values[t]=this.create(i),1)}}}init(e){return[this,Hn.of({field:this,create:e})]}get extension(){return this}}const pi={lowest:4,low:3,default:2,high:1,highest:0};function tn(s){return e=>new Ua(e,s)}const On={highest:tn(pi.highest),high:tn(pi.high),default:tn(pi.default),low:tn(pi.low),lowest:tn(pi.lowest)};class Ua{constructor(e,t){this.inner=e,this.prec=t}get extension(){return this}}class Fs{of(e){return new Dr(this,e)}reconfigure(e){return Fs.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Dr{constructor(e,t){this.compartment=e,this.inner=t}get extension(){return this}}class gs{constructor(e,t,i,n,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let n=[],r=Object.create(null),o=new Map;for(let u of wd(e,t,o))u instanceof vt?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of n)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(y=>y.type==0))if(l[p.id]=a.length<<1|1,mo(g,d))a.push(i.facet(p));else{let y=p.combine(d.map(b=>b.value));a.push(i&&p.compare(y,i.facet(p))?i.facet(p):y)}else{for(let y of d)y.type==0?(l[y.id]=a.length<<1|1,a.push(y.value)):(l[y.id]=h.length<<1,h.push(b=>y.dynamicSlot(b)));l[p.id]=h.length<<1,h.push(y=>bd(y,p,d))}}let f=h.map(u=>u(l));return new gs(e,o,f,l,a,r)}}function wd(s,e,t){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof Dr&&t.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof Dr){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=e.get(o.compartment)||o.inner;t.set(o.compartment,h),r(h,l)}else if(o instanceof Ua)r(o.inner,o.prec);else if(o instanceof vt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ls)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,pi.default);else{let h=o.extension;if(!h)throw new Error(`Unrecognized extension value in extension set (${o}).`);if(h==o)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(h,l)}}return r(s,pi.default),i.reduce((o,l)=>o.concat(l))}function fn(s,e){if(e&1)return 2;let t=e>>1,i=s.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[t]=4;let n=s.computeSlot(s,s.config.dynamicSlots[t]);return s.status[t]=2|n}function ms(s,e){return e&1?s.config.staticValues[e>>1]:s.values[e>>1]}const Ka=F.define(),Er=F.define({combine:s=>s.some(e=>e),static:!0}),ja=F.define({combine:s=>s.length?s[0]:void 0,static:!0}),Ga=F.define(),Ja=F.define(),Ya=F.define(),Xa=F.define({combine:s=>s.length?s[0]:!1});class ai{constructor(e,t){this.type=e,this.value=t}static define(){return new xd}}class xd{of(e){return new ai(this,e)}}class kd{constructor(e){this.map=e}of(e){return new oe(this,e)}}class oe{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 oe(this.type,t)}is(e){return this.type==e}static define(e={}){return new kd(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let n of e){let r=n.map(t);r&&i.push(r)}return i}}oe.reconfigure=oe.define();oe.appendConfig=oe.define();class Ae{constructor(e,t,i,n,r,o){this.startState=e,this.changes=t,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&qa(i,t.newLength),r.some(l=>l.type==Ae.time)||(this.annotations=r.concat(Ae.time.of(Date.now())))}static create(e,t,i,n,r,o){return new Ae(e,t,i,n,r,o)}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(Ae.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}Ae.time=ai.define();Ae.userEvent=ai.define();Ae.addToHistory=ai.define();Ae.remote=ai.define();function Sd(s,e){let t=[];for(let i=0,n=0;;){let r,o;if(i=s[i]))r=s[i++],o=s[i++];else if(n=0;n--){let r=i[n](s);r instanceof Ae?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof Ae?s=r[0]:s=Za(e,Ii(r),!1)}return s}function Ad(s){let e=s.startState,t=e.facet(Ya),i=s;for(let n=t.length-1;n>=0;n--){let r=t[n](s);r&&Object.keys(r).length&&(i=Qa(i,Or(e,r,s.changes.newLength),!0))}return i==s?s:Ae.create(e,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const Md=[];function Ii(s){return s==null?Md:Array.isArray(s)?s:[s]}var Ne=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(Ne||(Ne={}));const Td=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let Lr;try{Lr=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function Dd(s){if(Lr)return Lr.test(s);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||Td.test(t)))return!0}return!1}function Ed(s){return e=>{if(!/\S/.test(e))return Ne.Space;if(Dd(e))return Ne.Word;for(let t=0;t-1)return Ne.Word;return Ne.Other}}class se{constructor(e,t,i,n,r,o){this.config=e,this.doc=t,this.selection=i,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ln.set(h,a)),t=null),n.set(l.value.compartment,l.value.extension)):l.is(oe.reconfigure)?(t=null,i=l.value):l.is(oe.appendConfig)&&(t=null,i=Ii(i).concat(l.value));let r;t?r=e.startState.values.slice():(t=gs.resolve(i,n,this),r=new se(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=e.startState.facet(Er)?e.newSelection:e.newSelection.asSingle();new se(t,e.newDoc,o,r,(l,a)=>a.update(l,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:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),n=this.changes(i.changes),r=[i.range],o=Ii(i.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return se.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=gs.resolve(e.extensions||[],new Map),i=e.doc instanceof ne?e.doc:ne.of((e.doc||"").split(t.staticFacet(se.lineSeparator)||Cr)),n=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return qa(n,i.length),t.staticFacet(Er)||(n=n.asSingle()),new se(t,i,n,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(se.tabSize)}get lineBreak(){return this.facet(se.lineSeparator)||` `}get readOnly(){return this.facet(Xa)}phrase(e,...t){for(let i of this.facet(se.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let r=+(n||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let n=[];for(let r of this.facet(Ka))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&n.push(o[e]);return n}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return Ed(t.length?t[0]:"")}wordAt(e){let{text:t,from:i,length:n}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=Oe(t,o,!1);if(r(t.slice(a,o))!=Ne.Word)break;o=a}for(;ls.length?s[0]:4});se.lineSeparator=ja;se.readOnly=Xa;se.phrases=F.define({compare(s,e){let t=Object.keys(s),i=Object.keys(e);return t.length==i.length&&t.every(n=>s[n]==e[n])}});se.languageData=Ka;se.changeFilter=Ga;se.transactionFilter=Ja;se.transactionExtender=Ya;Fs.reconfigure=oe.define();function Ln(s,e,t={}){let i={};for(let n of s)for(let r of Object.keys(n)){let o=n[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let n in e)i[n]===void 0&&(i[n]=e[n]);return i}class bi{eq(e){return this==e}range(e,t=e){return Br.create(e,t,this)}}bi.prototype.startSide=bi.prototype.endSide=0;bi.prototype.point=!1;bi.prototype.mapMode=nt.TrackDel;function yo(s,e){return s==e||s.constructor==e.constructor&&s.eq(e)}let Br=class eh{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new eh(e,t,i)}};function Rr(s,e){return s.from-e.from||s.value.startSide-e.value.startSide}class vo{constructor(e,t,i,n){this.from=e,this.to=t,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,n=0){let r=i?this.to:this.from;for(let o=n,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(e,t,i,n){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);rd||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),n.push(u-o),r.push(d-o))}return{mapped:i.length?new vo(n,r,i,l):null,pos:o}}}class ie{constructor(e,t,i,n){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=n}static create(e,t,i,n){return new ie(e,t,i,n)}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:n=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Rr)),this.isEmpty)return t.length?ie.of(t):this;let l=new th(this,null,-1).goto(0),a=0,h=[],c=new ti;for(;l.value||a=0){let f=t[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return vn.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return vn.from(e).goto(t)}static compare(e,t,i,n,r=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=rl(o,l,i),h=new nn(o,a,r),c=new nn(l,a,r);i.iterGaps((f,u,d)=>ol(h,f,c,u,d,n)),i.empty&&i.length==0&&ol(h,0,c,0,0,n)}static eq(e,t,i=0,n){n==null&&(n=999999999);let r=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0),o=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=rl(r,o),a=new nn(r,l,0).goto(i),h=new nn(o,l,0).goto(i);for(;;){if(a.to!=h.to||!Pr(a.active,h.active)||a.point&&(!h.point||!yo(a.point,h.point)))return!1;if(a.to>n)return!0;a.next(),h.next()}}static spans(e,t,i,n,r=-1){let o=new nn(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFroml&&(n.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(e,t=!1){let i=new ti;for(let n of e instanceof Br?[e]:t?Od(e):e)i.add(n.from,n.to,n.value);return i.finish()}static join(e){if(!e.length)return ie.empty;let t=e[e.length-1];for(let i=e.length-2;i>=0;i--)for(let n=e[i];n!=ie.empty;n=n.nextLayer)t=new ie(n.chunkPos,n.chunk,t,Math.max(n.maxPoint,t.maxPoint));return t}}ie.empty=new ie([],[],null,-1);function Od(s){if(s.length>1)for(let e=s[0],t=1;t0)return s.slice().sort(Rr);e=i}return s}ie.empty.nextLayer=ie.empty;class ti{finishChunk(e){this.chunks.push(new vo(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 ti)).add(e,t,i)}addInner(e,t,i){let n=e-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<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(ie.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=ie.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function rl(s,e,t){let i=new Map;for(let r of s)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&n.push(new th(o,t,i,r));return n.length==1?n[0]:new vn(n)}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--)er(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--)er(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(),er(this.heap,0)}}}function er(s,e){for(let t=s[e];;){let i=(e<<1)+1;if(i>=s.length)break;let n=s[i];if(i+1=0&&(n=s[i+1],i++),t.compare(n)<0)break;s[i]=t,s[e]=n,e=i}}class nn{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=vn.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){Vn(this.active,e),Vn(this.activeTo,e),Vn(this.activeRank,e),this.minActive=ll(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:n,rank:r}=this.cursor;for(;t0;)t++;$n(this.active,t,i),$n(this.activeTo,t,n),$n(this.activeRank,t,r),e&&$n(e,t,this.cursor.from),this.minActive=ll(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>e){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&Vn(i,n)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[n]=0&&!(this.activeRank[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 ol(s,e,t,i,n,r){s.goto(e),t.goto(i);let o=i+n,l=i,a=i-e,h=!!r.boundChange;for(let c=!1;;){let f=s.to+a-t.to,u=f||s.endSide-t.endSide,d=u<0?s.to+a:t.to,p=Math.min(d,o);if(s.point||t.point?(s.point&&t.point&&yo(s.point,t.point)&&Pr(s.activeForPoint(s.to),t.activeForPoint(t.to))||r.comparePoint(l,p,s.point,t.point),c=!1):(c&&r.boundChange(l),p>l&&!Pr(s.active,t.active)&&r.compareRange(l,p,s.active,t.active),h&&po)break;l=d,u<=0&&s.next(),u>=0&&t.next()}}function Pr(s,e){if(s.length!=e.length)return!1;for(let t=0;t=e;i--)s[i+1]=s[i];s[e]=t}function ll(s,e){let t=-1,i=1e9;for(let n=0;n=e)return n;if(n==s.length)break;r+=s.charCodeAt(n)==9?t-r%t:1,n=Oe(s,n)}return s.length}const Ir="ͼ",al=typeof Symbol>"u"?"__"+Ir:Symbol.for(Ir),Nr=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),hl=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class ii{constructor(e,t){this.rules=[];let{finish:i}=t||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(y=>g.replace(/&/,y))).reduce((g,y)=>g.concat(y)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(n(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in e)r(n(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=hl[al]||1;return hl[al]=e+1,Ir+e.toString(36)}static mount(e,t,i){let n=e[Nr],r=i&&i.nonce;n?r&&n.setNonce(r):n=new Bd(e,r),n.mount(Array.isArray(t)?t:[t],e)}}let cl=new Map;class Bd{constructor(e,t){let i=e.ownerDocument||e,n=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&n.CSSStyleSheet){let r=cl.get(i);if(r)return e[Nr]=r;this.sheet=new n.CSSStyleSheet,cl.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Nr]=this}mount(e,t){let i=this.sheet,n=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let h=0;h",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Rd=typeof navigator<"u"&&/Mac/.test(navigator.platform),Pd=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Pe=0;Pe<10;Pe++)ni[48+Pe]=ni[96+Pe]=String(Pe);for(var Pe=1;Pe<=24;Pe++)ni[Pe+111]="F"+Pe;for(var Pe=65;Pe<=90;Pe++)ni[Pe]=String.fromCharCode(Pe+32),bn[Pe]=String.fromCharCode(Pe);for(var tr in ni)bn.hasOwnProperty(tr)||(bn[tr]=ni[tr]);function Id(s){var e=Rd&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||Pd&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?bn:ni)[s.keyCode]||s.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}function Ee(){var s=arguments[0];typeof s=="string"&&(s=document.createElement(s));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];typeof n=="string"?s.setAttribute(i,n):n!=null&&(s[i]=n)}e++}for(;e2);var _={mac:ul||/Mac/.test(ze.platform),windows:/Win/.test(ze.platform),linux:/Linux|X11/.test(ze.platform),ie:Hs,ie_version:nh?_r.documentMode||6:Wr?+Wr[1]:Fr?+Fr[1]:0,gecko:fl,gecko_version:fl?+(/Firefox\/(\d+)/.exec(ze.userAgent)||[0,0])[1]:0,chrome:!!ir,chrome_version:ir?+ir[1]:0,ios:ul,android:/Android\b/.test(ze.userAgent),webkit_version:Nd?+(/\bAppleWebKit\/(\d+)/.exec(ze.userAgent)||[0,0])[1]:0,safari:Hr,safari_version:Hr?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ze.userAgent)||[0,0])[1]:0,tabSize:_r.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function bo(s,e){for(let t in s)t=="class"&&e.class?e.class+=" "+s.class:t=="style"&&e.style?e.style+=";"+s.style:e[t]=s[t];return e}const ys=Object.create(null);function wo(s,e,t){if(s==e)return!0;s||(s=ys),e||(e=ys);let i=Object.keys(s),n=Object.keys(e);if(i.length-0!=n.length-0)return!1;for(let r of i)if(r!=t&&(n.indexOf(r)==-1||s[r]!==e[r]))return!1;return!0}function _d(s,e){for(let t=s.attributes.length-1;t>=0;t--){let i=s.attributes[t].name;e[i]==null&&s.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?s.style.cssText=i:s.getAttribute(t)!=i&&s.setAttribute(t,i)}}function dl(s,e,t){let i=!1;if(e)for(let n in e)t&&n in t||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(i=!0,n=="style"?s.style.cssText=t[n]:s.setAttribute(n,t[n]));return i}function Fd(s){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new wi(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,n;if(e.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=sh(e,t);i=(r?t?-3e8:-1:5e8)-1,n=(o?t?2e8:1:-6e8)+1}return new wi(e,i,n,t,e.widget||null,!0)}static line(e){return new Rn(e)}static set(e,t=!1){return ie.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}re.none=ie.empty;class Bn extends re{constructor(e){let{start:t,end:i}=sh(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?bo(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||ys}eq(e){return this==e||e instanceof Bn&&this.tagName==e.tagName&&wo(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)}}Bn.prototype.point=!1;class Rn extends re{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Rn&&this.spec.class==e.spec.class&&wo(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)}}Rn.prototype.mapMode=nt.TrackBefore;Rn.prototype.point=!0;class wi extends re{constructor(e,t,i,n,r,o){super(t,i,r,e),this.block=n,this.isReplace=o,this.mapMode=n?t<=0?nt.TrackBefore:nt.TrackAfter:nt.TrackDel}get type(){return this.startSide!=this.endSide?Ye.WidgetRange:this.startSide<=0?Ye.WidgetBefore:Ye.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof wi&&Wd(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)}}wi.prototype.point=!0;function sh(s,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=s;return t==null&&(t=s.inclusive),i==null&&(i=s.inclusive),{start:t??e,end:i??e}}function Wd(s,e){return s==e||!!(s&&e&&s.compare(e))}function Ni(s,e,t,i=0){let n=t.length-1;n>=0&&t[n]+i>=s?t[n]=Math.max(t[n],e):t.push(s,e)}class wn extends bi{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof wn&&this.tagName==e.tagName&&wo(this.attributes,e.attributes)}static create(e){return new wn(e.tagName,e.attributes||ys,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return ie.of(e,t)}}wn.prototype.startSide=wn.prototype.endSide=-1;function xn(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function Vr(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function un(s,e){if(!e.anchorNode)return!1;try{return Vr(s,e.anchorNode)}catch{return!1}}function as(s){return s.nodeType==3?kn(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function dn(s,e,t,i){return t?pl(s,e,t,i,-1)||pl(s,e,t,i,1):!1}function si(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function vs(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}function pl(s,e,t,i,n){for(;;){if(s==t&&e==i)return!0;if(e==(n<0?0:Vt(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;e=si(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[e+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=n<0?Vt(s):0}else return!1}}function Vt(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function bs(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function Hd(s){let e=s.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function rh(s,e){let t=e.width/s.offsetWidth,i=e.height/s.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-s.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-s.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Vd(s,e,t,i,n,r,o,l){let a=s.ownerDocument,h=a.defaultView||window;for(let c=s,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,g=1;if(d)u=Hd(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let x=c.getBoundingClientRect();({scaleX:p,scaleY:g}=rh(c,x)),u={left:x.left,right:x.left+c.clientWidth*p,top:x.top,bottom:x.top+c.clientHeight*g}}let y=0,b=0;if(n=="nearest")e.top0&&e.bottom>u.bottom+b&&(b=e.bottom-u.bottom+o)):e.bottom>u.bottom-o&&(b=e.bottom-u.bottom+o,t<0&&e.top-b0&&e.right>u.right+y&&(y=e.right-u.right+r)):e.right>u.right-r&&(y=e.right-u.right+r,t<0&&e.leftu.bottom||e.leftu.right)&&(e={left:Math.max(e.left,u.left),right:Math.min(e.right,u.right),top:Math.max(e.top,u.top),bottom:Math.min(e.bottom,u.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function oh(s,e=!0){let t=s.ownerDocument,i=null,n=null;for(let r=s.parentNode;r&&!(r==t.body||(!e||i)&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),e&&!i&&r.scrollWidth>r.clientWidth&&(i=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:i,y:n}}class $d{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?Vt(t):0),i,Math.min(e.focusOffset,i?Vt(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let di=null;_.safari&&_.safari_version>=26&&(di=!1);function lh(s){if(s.setActive)return s.setActive();if(di)return s.focus(di);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(di==null?{get preventScroll(){return di={preventScroll:!0},!0}}:void 0),!di){di=!1;for(let t=0;tMath.max(0,s.document.documentElement.scrollHeight-s.innerHeight-4):s.scrollTop>Math.max(1,s.scrollHeight-s.clientHeight-4)}function hh(s,e){for(let t=s,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=Vt(t)}else if(t.parentNode&&!vs(t))i=si(t),t=t.parentNode;else return null}}function ch(s,e){for(let t=s,i=e;;){if(t.nodeType==3&&i=t){if(l.level==i)return o;(r<0||(n!=0?n<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function dh(s,e){if(s.length!=e.length)return!1;for(let t=0;t=0;g-=3)if(Ct[g+1]==-d){let y=Ct[g+2],b=y&2?n:y&4?y&1?r:n:0;b&&(ae[f]=ae[Ct[g]]=b),l=g;break}}else{if(Ct.length==189)break;Ct[l++]=f,Ct[l++]=u,Ct[l++]=a}else if((p=ae[f])==2||p==1){let g=p==n;a=g?0:1;for(let y=l-3;y>=0;y-=3){let b=Ct[y+2];if(b&2)break;if(g)Ct[y+2]|=2;else{if(b&4)break;Ct[y+2]|=4}}}}}function Yd(s,e,t,i){for(let n=0,r=i;n<=t.length;n++){let o=n?t[n-1].to:s,l=na;)p==y&&(p=t[--g].from,y=g?t[g-1].to:s),ae[--p]=d;a=c}else r=h,a++}}}function zr(s,e,t,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=e,h=0;aa&&o.push(new Ot(a,g.from,d));let y=g.direction==xi!=!(d%2);qr(s,y?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(c?ae[p]!=l:ae[p]==l))break;p++}u?zr(s,a,p,i+1,n,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let g=ae[a-1];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let g=r[--h];if(!c)for(let y=g.from,b=h;;){if(y==e)break e;if(b&&r[b-1].to==y)y=r[--b].from;else{if(ae[y-1]==l)break e;break}}if(u)u.push(g);else{g.toae.length;)ae[ae.length]=256;let i=[],n=e==xi?0:1;return qr(s,n,n,t,0,s.length,i),i}function ph(s){return[new Ot(0,s,0)]}let gh="";function Qd(s,e,t,i,n){var r;let o=i.head-s.from,l=Ot.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],h=a.side(n,t);if(o==h){let u=l+=n?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!n,t),h=a.side(n,t)}let c=Oe(s.text,o,a.forward(n,t));(ca.to)&&(c=h),gh=s.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(n?e.length-1:0)?null:e[l+(n?1:-1)];return f&&c==h&&f.level+(n?0:1)s.some(e=>e)}),ep=F.define({combine:s=>s.some(e=>e)}),Sh=F.define();class Fi{constructor(e,t,i,n,r,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Fi(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 Fi(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const zn=oe.define({map:(s,e)=>s.map(e)}),Ch=oe.define();function Lt(s,e,t){let i=s.facet(bh);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 Ft=F.define({combine:s=>s.length?s[0]:!0});let tp=0;const Ri=F.define({combine(s){return s.filter((e,t)=>{for(let i=0;i{let a=[];return o&&a.push(Vs.of(h=>{let c=h.plugin(l);return c?o(c):re.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return st.define((i,n)=>new e(i,n),t)}}class nr{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(Lt(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){Lt(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){Lt(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ah=F.define(),Co=F.define(),Vs=F.define(),Mh=F.define(),Ao=F.define(),Pn=F.define(),Th=F.define();function ml(s,e){let t=s.state.facet(Th);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(s):r),n=[];return ie.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let h=r-e.from,c=o-e.from,f=n;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=Zd(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let g={from:h,to:c,direction:d,inner:[]};f.push(g),f=g.inner}}}}),n}const Dh=F.define();function Eh(s){let e=0,t=0,i=0,n=0;for(let r of s.state.facet(Dh)){let o=r(s);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:e,right:t,top:i,bottom:n}}const ln=F.define();class at{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new at(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 n=e[t-1];if(!(n.fromA>i.toA)){if(n.toAn.push(new at(r,o,l,a))),this.changedRanges=n}static create(e,t,i){return new ws(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 ip=[];class ye{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 ip}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&&_d(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 n of this.children){if(n==e)return i;i+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=si(this.dom),n=this.length?e>0:t>0;return new gt(this.parent.dom,i+(n?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 zs)return e;return null}static get(e){return e.cmTile}}class $s extends ye{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,n,r=(e==null?void 0:e.node)==t?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,n=i?i.nextSibling:t.firstChild,r&&n!=l.dom&&(r.written=!0),l.dom.parentNode==t)for(;n&&n!=l.dom;)n=yl(n);else t.insertBefore(l.dom,n);i=l.dom}for(n=i?i.nextSibling:t.firstChild,r&&n&&(r.written=!0);n;)n=yl(n);this.length=o}}function yl(s){let e=s.nextSibling;return s.parentNode.removeChild(s),e}class zs extends $s{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=ye.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,n=0,r=0;;)if(n==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&r++,n=t.pop()}else{let o=i.children[n++];if(o instanceof Wt)t.push(n),i=o,n=0;else{let l=r+o.length,a=e(o,r);if(a!==void 0)return a;r=l+o.breakAfter}}}resolveBlock(e,t){let i,n=-1,r,o=-1;if(this.blockTiles((l,a)=>{let h=a+l.length;if(e>=a&&e<=h){if(l.isWidget()&&t>=-1&&t<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ae||e==a&&(t>1?l.length:l.covers(-1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,o=e-a)}}),!i&&!r)throw new Error("No tile at position "+e);return i&&t<0||!r?{tile:i,offset:n}:{tile:r,offset:o}}}class Wt extends $s{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 Wt(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class $i extends $s{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let n=new $i(t||document.createElement("div"),e);return(!t||!i)&&(n.flags|=4),n}get domAttrs(){return this.attrs}resolveInline(e,t,i){let n=null,r=-1,o=null,l=-1;function a(c,f){for(let u=0,d=0;u=f&&(p.isComposite()?a(p,f-d):(!o||o.isHidden&&(t>0||i&&sp(o,p)))&&(g>f||p.flags&32)?(o=p,l=f-d):(di&&(e=i);let n=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?_.chrome||_.gecko||(e?(n--,o=1):r=0)?0:l.length-1];return _.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?bs(a,o<0):a||null}static of(e,t){let i=new gi(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class ki extends ye{constructor(e,t,i,n){super(e,t,n),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 n=this.widget.coordsAt(this.dom,e,t);if(n)return n;if(i)return bs(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let r=this.dom.getClientRects(),o=null;if(!r.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?r.length-1:0;o=r[a],!(e>0?a==0:a==r.length-1||o.top0;)if(n.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(r==n.children.length){if(!e&&!l.length)break;i&&i.leave(n),o=!!n.breakAfter,{tile:n,index:r}=l.pop(),r++}else{let a=n.children[r],h=a.breakAfter;(t>0?a.length<=e:a.length=0;l--){let a=t.marks[l],h=n.lastChild;if(h instanceof Ge&&h.mark.eq(a.mark))h.dom!=a.dom&&h.setDOM(sr(a.dom)),n=h;else{if(this.cache.reused.get(a)){let f=ye.get(a.dom);f&&f.setDOM(sr(a.dom))}let c=Ge.of(a.mark,a.dom);n.append(c),n=c}this.cache.reused.set(a,2)}let r=ye.get(e.text);r&&this.cache.reused.set(r,2);let o=new gi(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,n.append(o)}addInlineWidget(e,t,i){let n=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);n||this.flushBuffer();let r=this.ensureMarks(t,i);!n&&!(e.flags&16)&&r.append(this.getBuffer(1)),r.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=Oh);let n=$i.start(e,t||((i=this.cache.find($i))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}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 n=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],l;if(t>0&&(l=n.lastChild)&&l instanceof Ge&&l.mark.eq(o))n=l,t--;else{let a=Ge.of(o,(i=this.cache.find(Ge,h=>h.mark.eq(o)))===null||i===void 0?void 0:i.dom);n.append(a),n=a,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!vl(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(_.ios&&vl(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(rr,0,32)||new ki(rr.toDOM(),0,rr,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){let t=e.rank*102+e.value.rank,i=new op(e.from,e.to,e.value,t),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let n=t.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(r),t=r}}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(xs,void 0,1);return i&&(i.flags=t),i||new xs(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class ap{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:n,lineBreak:r,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=n;let l=this.textOff=Math.min(e,n.length);return r?null:n.slice(0,l)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const ks=[ki,$i,gi,Ge,xs,Wt,zs];for(let s=0;s[]),this.index=ks.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 n=e.bucket,r=this.buckets[n],o=this.index[n];for(let l=r.length-1;l>=0;l--){let a=(l+o)%r.length,h=r[a];if((!t||t(h))&&!this.reused.has(h))return r.splice(a,1),a{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let n=0,r=0,o=0;;){let l=on){let h=a-n;this.preserve(h,!o,!l),n=a,r+=h}if(!l)break;t&&l.fromA<=t.range.fromA&&l.toA>=t.range.toA?(this.forward(l.fromA,t.range.fromA,t.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let h=a>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ge&&n.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?n.length&&(n.length=r=0):o instanceof Ge&&(n.shift(),r=Math.min(r,n.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,n=this.builder,r=0,o=ie.spans(this.decorations,e,t,{point:(l,a,h,c,f,u)=>{if(h instanceof wi){if(this.disallowBlockEffectsFor[u]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=c.length,f>c.length)n.continueWidget(a-l);else{let d=h.widget||(h.block?zi.block:zi.inline),p=fp(h),g=this.cache.findWidget(d,a-l,p)||ki.of(d,this.view,a-l,p);h.block?(h.startSide>0&&n.addLineStartIfNotCovered(i),n.addBlockWidget(g)):(n.ensureLine(i),n.addInlineWidget(g,c,f))}i=null}else i=up(i,h);a>l&&this.text.skip(a-l)},span:(l,a,h,c)=>{for(let f=l;fr,this.openMarks=o}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 n=e.parentNode;;n=n.parentNode){let r=ye.get(n);if(n==this.view.contentDOM)break;r instanceof Ge?t.push(r):r!=null&&r.isLine()?i=r:r instanceof Wt||(n.nodeName=="DIV"&&!i&&n!=this.view.contentDOM?i=new $i(n,Oh):i||t.push(Ge.of(new Bn({tagName:n.nodeName.toLowerCase(),attributes:Fd(n)}),n)))}return{line:i,marks:t}}}function vl(s,e){let t=i=>{for(let n of i.children)if((e?n.isText():n.length)||t(n))return!0;return!1};return t(s)}function fp(s){let e=s.isReplace?(s.startSide<0?64:0)|(s.endSide>0?128:0):s.startSide>0?32:16;return s.block&&(e|=256),e}const Oh={class:"cm-line"};function up(s,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(s||(s={class:"cm-line"}),t&&bo(t,s),i&&(s.class+=" "+i)),s}function dp(s){let e=[];for(let t=s.parents.length;t>1;t--){let i=t==s.parents.length?s.tile:s.parents[t].tile;i instanceof Ge&&e.push(i.mark)}return e}function sr(s){let e=ye.get(s);return e&&e.setDOM(s.cloneNode()),s}class zi extends Yi{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}}zi.inline=new zi("span");zi.block=new zi("div");const rr=new class extends Yi{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class bl{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=re.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 zs(e,e.contentDOM),this.updateInner([new at(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:f})=>fthis.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 n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?n=this.domChanged.newSel.head:!kp(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?gp(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:f}=this.hasComposition;i=new at(c,f,e.changes.mapPos(c,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(_.ie||_.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=vp(o,this.decorations,e.changes);a.length&&(i=at.extendWithRanges(i,a));let h=wp(l,this.blockWrappers,e.changes);return h.length&&(i=at.extendWithRanges(i,h)),r&&!i.some(c=>c.fromA<=r.range.fromA&&c.toA>=r.range.toA)&&(i=r.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,r),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 o=this.tile,l=new cp(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&ye.get(t.text)&&l.cache.reused.set(ye.get(t.text),2),this.tile=l.run(e,t),Kr(o,l.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 r=_.chrome||_.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||i.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let n=[];if(this.view.viewport.from||this.view.viewport.to-1)&&un(i,this.view.observer.selectionRange)&&!(n&&i.contains(n));if(!(r||t||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,h,c;if(a.empty?c=h=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),h=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),_.gecko&&a.empty&&!this.hasComposition&&pp(h)){let u=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(u,h.node.childNodes[h.offset]||null)),h=c=new gt(u,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!dn(h.node,h.offset,f.anchorNode,f.anchorOffset)||!dn(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{_.android&&_.chrome&&i.contains(f.focusNode)&&xp(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let u=xn(this.view.root);if(u)if(a.empty){if(_.gecko){let d=mp(h.node,h.offset);if(d&&d!=3){let p=(d==1?hh:ch)(h.node,h.offset);p&&(h=new gt(p.node,p.offset))}}u.collapse(h.node,h.offset),a.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=a.bidiLevel)}else if(u.extend){u.collapse(h.node,h.offset);try{u.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([h,c]=[c,h]),d.setEnd(c.node,c.offset),d.setStart(h.node,h.offset),u.removeAllRanges(),u.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(h,c)),this.impreciseAnchor=h.precise?null:new gt(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new gt(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&dn(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=xn(e.root),{anchorNode:n,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(n,r)}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 n=i.posAtStart;if(i.isComposite()){let r;if(e==i.dom)r=i.dom.childNodes[t];else{let o=Vt(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?r=e:r=e.nextSibling}if(r==i.dom.firstChild)return n;for(;r&&!ye.get(r);)r=r.nextSibling;if(!r)return n+i.length;for(let o=0,l=n;;o++){let a=i.children[o];if(a.dom==r)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?n+t:n+(t?i.length:0):n}domAtPos(e,t){let{tile:i,offset:n}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(n,t)}inlineDOMNearPos(e,t){let i,n=-1,r=!1,o,l=-1,a=!1;return this.tile.blockTiles((h,c)=>{if(h.isWidget()){if(h.flags&32&&c>=e)return!0;h.flags&16&&(r=!0)}else{let f=c+h.length;if(c<=e&&(i=h,n=e-c,r=f=e&&!o&&(o=h,l=e-c,a=c>e),c>e&&o)return!0}}),!i&&!o?this.domAtPos(e,t):(r&&o?i=null:a&&i&&(o=null),i&&t<0||!o?i.domIn(n,t):o.domIn(l,t))}coordsAt(e,t){let{tile:i,offset:n}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof or?null:i.coordsInWidget(n,t,!0):i.coordsIn(n,t)}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 n(r,o){if(r.isComposite())for(let l of r.children){if(l.length>=o){let a=n(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(r.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==pe.LTR,h=0,c=(f,u,d)=>{for(let p=0;pn);p++){let g=f.children[p],y=u+g.length,b=g.dom.getBoundingClientRect(),{height:x}=b;if(d&&!p&&(h+=b.top-d.top),g instanceof Wt)y>i&&c(g,u,b);else if(u>=i&&(h>0&&t.push(-h),t.push(x+h),h=0,o)){let T=g.dom.lastChild,D=T?as(T):[];if(D.length){let A=D[D.length-1],P=a?A.right-b.left:b.right-A.left;P>l&&(l=P,this.minWidth=r,this.minWidthFrom=u,this.minWidthTo=y)}}d&&p==f.children.length-1&&(h+=d.bottom-b.bottom),u=y+g.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?pe.RTL:pe.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let c=as(h.dom);if(c.length!=1)return;l+=c[0].width,a=c[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let t=document.createElement("div"),i,n,r;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 o=as(t.firstChild)[0];i=t.getBoundingClientRect().height,n=o&&o.width?o.width/27:7,r=o&&o.height?o.height:i,t.remove()}),{lineHeight:i,charWidth:n,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let r=n==t.viewports.length?null:t.viewports[n],o=r?r.from-1:this.view.state.doc.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(re.replace({widget:new or(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return re.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Vs).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,n=this.view.state.facet(Ao).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(n.length&&(this.dynamicDecorationMap[e++]=i,t.push(ie.join(n))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof r=="function"?r(this.view):r)}scrollIntoView(e){var t;if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(Sh))try{if(c(this.view,e.range,e))return!0}catch(f){Lt(this.view.state,f,"scroll handler")}let{range:i}=e,n=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),r;if(!n)return;!i.empty&&(r=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let o=Eh(this.view),l={left:n.left-o.left,top:n.top-o.top,right:n.right+o.right,bottom:n.bottom+o.bottom},{offsetWidth:a,offsetHeight:h}=this.view.scrollDOM;if(Vd(this.view.scrollDOM,l,i.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomi.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Kr(this.tile)}}function Kr(s,e){let t=e==null?void 0:e.get(s);if(t!=1){t==null&&s.destroy();for(let i of s.children)Kr(i,e)}}function pp(s){return s.node.nodeType==1&&s.node.firstChild&&(s.offset==0||s.node.childNodes[s.offset-1].contentEditable=="false")&&(s.offset==s.node.childNodes.length||s.node.childNodes[s.offset].contentEditable=="false")}function Lh(s,e){let t=s.observer.selectionRange;if(!t.focusNode)return null;let i=hh(t.focusNode,t.focusOffset),n=ch(t.focusNode,t.focusOffset),r=i||n;if(n&&i&&n.node!=i.node){let l=ye.get(n.node);if(!l||l.isText()&&l.text!=n.node.nodeValue)r=n;else if(s.docView.lastCompositionAfterCursor){let a=ye.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(r=n)}}if(s.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function gp(s,e,t){let i=Lh(s,t);if(!i)return null;let{node:n,from:r,to:o}=i,l=n.nodeValue;if(/[\n\r]/.test(l)||s.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new at(a.mapPos(r),a.mapPos(o),r,o),text:n}}function mp(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}class or extends Yi{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 Sp(s,e,t=1){let i=s.charCategorizer(e),n=s.doc.lineAt(e),r=e-n.from;if(n.length==0)return S.cursor(e);r==0?t=1:r==n.length&&(t=-1);let o=r,l=r;t<0?o=Oe(n.text,r,!1):l=Oe(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let h=Oe(n.text,o,!1);if(i(n.text.slice(h,o))!=a)break;o=h}for(;ls.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-t.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(t.from,t.to);return t.from+Ld(o,r,s.state.tabSize)}function Ap(s,e,t){let i=s.lineBlockAt(e);if(Array.isArray(i.type)){let n;for(let r of i.type){if(r.from>e)break;if(!(r.toe)return r;(!n||r.type==Ye.Text&&(n.type!=r.type||(t<0?r.frome)))&&(n=r)}}return n||i}return i}function Mp(s,e,t,i){let n=Ap(s,e.head,e.assoc||-1),r=!i||n.type!=Ye.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:t==(l==pe.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return S.cursor(a,t?-1:1)}return S.cursor(t?n.to:n.from,t?-1:1)}function wl(s,e,t,i){let n=s.state.doc.lineAt(e.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=e,a=null;;){let h=Qd(n,r,o,l,t),c=gh;if(!h){if(n.number==(t?s.state.doc.lines:1))return l;c=` -`,n=s.state.doc.line(n.number+(t?1:-1)),r=s.bidiSpans(n),h=s.visualLineSide(n,!t)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Tp(s,e,t){let i=s.state.charCategorizer(e),n=i(t);return r=>{let o=i(r);return n==Ne.Space&&(n=o),n==o}}function Dp(s,e,t,i){let n=e.head,r=t?1:-1;if(n==(t?s.state.doc.length:0))return S.cursor(n,e.assoc);let o=e.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),h=s.coordsAtPos(n,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=s.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let p=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-p.from))),l=(r<0?p.top:p.bottom)+c}let f=a.left+o,u=s.viewState.heightOracle.textHeight>>1,d=i??u;for(let p=0;;p+=u){let g=l+(d+p)*r,y=jr(s,{x:f,y:g},!1,r);if(t?g>a.bottom:gl:x{if(e>r&&en(s)),t.from,e.head>t.from?-1:1);return i==t.from?t:S.cursor(i,is.viewState.docHeight)return new Et(s.state.doc.length,-1);if(h=s.elementAtHeight(a),i==null)break;if(h.type==Ye.Text){if(i<0?h.tos.viewport.to)break;let u=s.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(u&&(i<0?u.top<=a+r:u.bottom>=a+r))break}let f=s.viewState.heightOracle.textHeight/2;a=i>0?h.bottom+f:h.top-f}if(s.viewport.from>=h.to||s.viewport.to<=h.from){if(t)return null;if(h.type==Ye.Text){let f=Cp(s,n,h,o,l);return new Et(f,f==h.from?1:-1)}}if(h.type!=Ye.Text)return a<(h.top+h.bottom)/2?new Et(h.from,1):new Et(h.to,-1);let c=s.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=s.docView.lineAt(h.from,-2)),new Ep(s,o,l,s.textDirectionAt(h.from)).scanTile(c,h.from)}class Ep{constructor(e,t,i,n){this.view=e,this.x=t,this.y=i,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+n.from>1;t:if(o.has(g)){let b=n+Math.floor(Math.random()*p);for(let x=0;x1)){if(x.bottomthis.y)(!h||h.top>x.top)&&(h=x),T=-1;else{let D=x.left>this.x?this.x-x.left:x.right(p+p+g)/3)return this.y=a.bottom-1,this.scan(e,t,!0);if(h&&h.top<(p+g+g)/3)return this.y=h.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[c],1):this.baseDir)==pe.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let i=[];for(let r=0;r{let o=i[r]-t,l=i[r+1]-t;return kn(e.dom,o,l).getClientRects()});return n.after?new Et(i[n.i+1],-1):new Et(i[n.i],1)}scanTile(e,t){if(!e.length)return new Et(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let i=[t];for(let l=0,a=t;l{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:kn(a.dom,0,a.length)).getClientRects()}),r=e.children[n.i],o=i[n.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):n.after?new Et(i[n.i+1],-1):new Et(o,1)}}const Ei="￿";class Op{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(se.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ei}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let n=e;;){this.findPointBefore(i,n);let r=this.text.length;this.readNode(n);let o=ye.get(n),l=n.nextSibling;if(l==t){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=ye.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:vs(n))||vs(l)&&(n.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>r)&&!Bp(l,t)&&this.lineBreak(),n=l}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,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){let t=ye.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.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+(Lp(e,i.node,i.offset)?t:0))}}function Lp(s,e,t){for(;;){if(!e||t-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Rh(e.docView.tile,t,i,0))){let a=r||o?[]:Ip(e),h=new Op(a,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=Np(a,this.bounds.from)}else{let a=e.observer.selectionRange,h=r&&r.node==a.focusNode&&r.offset==a.focusOffset||!Vr(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Vr(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((_.ios||_.chrome)&&l.main.empty&&h!=c&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(S.range(c,h));else if(e.lineWrapping&&c==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let u=e.coordsAtPos(h,-1),d=0;u&&(d=e.inputState.lastTouchY<=u.bottom?-1:1),this.newSel=S.create([S.cursor(h,d)])}else this.newSel=S.single(c,h)}}}function Rh(s,e,t,i){if(s.isComposite()){let n=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return Rh(f,e,t,h);if(u>=e&&n==-1&&(n=a,r=h),h>t&&f.dom.parentNode==s.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+s.length:l,startDOM:(n?s.children[n-1].dom.nextSibling:null)||s.dom.firstChild,endDOM:o=0?s.children[o].dom:null}}else return s.isText()?{from:i,to:i+s.length,startDOM:s.dom,endDOM:s.dom.nextSibling}:null}function Ph(s,e){let t,{newSel:i}=e,{state:n}=s,r=n.selection.main,o=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,h=r.from,c=null;(o===8||_.android&&e.text.length=l&&r.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,r.from-l)==e.text.slice(0,r.from-l)&&f.slice(r.to-l)==e.text.slice(u=e.text.length-(f.length-(r.to-l)))?t={from:r.from,to:r.to,insert:ne.of(e.text.slice(r.from-l,u).split(Ei))}:(d=Ih(f,e.text,h-l,c))&&(_.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Ei+Ei&&d.toB--,t={from:l+d.from,to:l+d.toA,insert:ne.of(e.text.slice(d.from,d.toB).split(Ei))})}else i&&(!s.hasFocus&&n.facet(Ft)||Ss(i,r))&&(i=null);if(!t&&!i)return!1;if((_.mac||_.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:ne.of([t.insert.toString().replace("."," ")])}):n.doc.lineAt(r.from).toDate.now()-50?t={from:r.from,to:r.to,insert:n.toText(s.inputState.insertingText)}:_.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` - `&&s.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:ne.of([" "])}),t)return Mo(s,t,i,o);if(i&&!Ss(i,r)){let l=!1,a="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(l=!0),a=s.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=Bh(n.facet(Pn).map(h=>h(s)),i))),s.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function Mo(s,e,t,i=-1){if(_.ios&&s.inputState.flushIOSKey(e))return!0;let n=s.state.selection.main;if(_.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&s.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&_i(s.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||i==8&&e.insert.lengthn.head)&&_i(s.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&_i(s.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,l=()=>o||(o=Pp(s,e,t));return s.state.facet(wh).some(a=>a(s,e.from,e.to,r,l))||s.dispatch(l()),!0}function Pp(s,e,t){let i,n=s.state,r=n.selection.main,o=-1;if(e.from==e.to&&e.fromr.to){let a=e.fromf(s)),h,a);e.from==c&&(o=c)}if(o>-1)i={changes:e,selection:S.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let a=r.frome.to?n.sliceDoc(e.to,r.to):"";i=n.replaceSelection(s.state.toText(a+e.insert.sliceString(0,void 0,s.state.lineBreak)+h))}else{let a=n.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(s.inputState.composing>=0||s.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let c=s.state.sliceDoc(e.from,e.to),f,u=t&&Lh(s,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=s.state.doc.lineAt(r.head);let d=r.to-e.to;i=n.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:a,range:h||p.map(a)};let g=p.to-d,y=g-c.length;if(s.state.sliceDoc(y,g)!=c||g>=f.from&&y<=f.to)return{range:p};let b=n.changes({from:y,to:g,insert:e.insert}),x=p.to-r.to;return{changes:b,range:h?S.range(Math.max(0,h.anchor+x),Math.max(0,h.head+x)):p.map(b)}})}else i={changes:a,selection:h&&n.selection.replaceRange(h)}}let l="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,l+=".compose",s.inputState.compositionFirstChange&&(l+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:l,scrollIntoView:!0})}function Ih(s,e,t,i){let n=Math.min(s.length,e.length),r=0;for(;r0&&l>0&&s.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Ip(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return t&&(e.push(new xl(t,i)),(n!=t||r!=i)&&e.push(new xl(n,r))),e}function Np(s,e){if(s.length==0)return null;let t=s[0].pos,i=s.length==2?s[1].pos:t;return t>-1&&i>-1?S.single(t+e,i+e):null}function Ss(s,e){return e.head==s.main.head&&e.anchor==s.main.anchor}class _p{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,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.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,_.safari&&e.contentDOM.addEventListener("input",()=>null),_.gecko&&Qp(e.contentDOM.ownerDocument)}handleEvent(e){!Up(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 n of i.observers)n(this.view,t);for(let n of i.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Fp(e),i=this.handlers,n=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&n.removeEventListener(r,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&&_h.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),_.android&&_.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return _.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=Nh.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||Wp.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:_.safari&&!_.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 kl(s,e){return(t,i)=>{try{return e.call(s,i,t)}catch(n){Lt(t.state,n)}}}function Fp(s){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec,r=n&&n.plugin.domEventHandlers,o=n&&n.plugin.domEventObservers;if(r)for(let l in r){let a=r[l];a&&t(l).handlers.push(kl(i.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(kl(i.value,a))}}for(let i in yt)t(i).handlers.push(yt[i]);for(let i in Xe)t(i).observers.push(Xe[i]);return e}const Nh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Wp="dthko",_h=[16,17,18,20,91,92,224,225],qn=6;function Un(s){return Math.max(0,s)*.7+8}function Hp(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class Vp{constructor(e,t,i,n){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=oh(e.contentDOM),this.atoms=e.state.facet(Pn).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(se.allowMultipleSelections)&&$p(e,t),this.dragging=qp(e,t)&&Hh(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&&Hp(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,n=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Eh(this.view);e.clientX-a.left<=n+qn?t=-Un(n-e.clientX):e.clientX+a.right>=o-qn&&(t=Un(e.clientX-o)),e.clientY-a.top<=r+qn?i=-Un(r-e.clientY):e.clientY+a.bottom>=l-qn&&(i=Un(e.clientY-l)),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=Bh(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 $p(s,e){let t=s.state.facet(mh);return t.length?t[0](e):_.mac?e.metaKey:e.ctrlKey}function zp(s,e){let t=s.state.facet(yh);return t.length?t[0](e):_.mac?!e.altKey:!e.ctrlKey}function qp(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let i=xn(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Up(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=ye.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const yt=Object.create(null),Xe=Object.create(null),Fh=_.ie&&_.ie_version<15||_.ios&&_.webkit_version<604;function Kp(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),Wh(s,t.value)},50)}function qs(s,e,t){for(let i of s.facet(e))t=i(t,s);return t}function Wh(s,e){e=qs(s.state,ko,e);let{state:t}=s,i,n=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Gr!=null&&t.selection.ranges.every(a=>a.empty)&&Gr==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(n++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:S.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(n++);return{changes:{from:a.from,to:a.to,insert:h.text},range:S.cursor(a.from+h.length)}}):i=t.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Xe.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};Xe.wheel=Xe.mousewheel=s=>{s.inputState.lastWheelEvent=Date.now()};yt.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),e.keyCode==27&&s.inputState.tabFocusMode!=0&&(s.inputState.tabFocusMode=Date.now()+2e3),!1);Xe.touchstart=(s,e)=>{let t=s.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};Xe.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};yt.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of s.state.facet(vh))if(t=i(s,e),t)break;if(!t&&e.button==0&&(t=Gp(s,e)),t){let i=!s.hasFocus;s.inputState.startMouseSelection(new Vp(s,e,t,i)),i&&s.observer.ignore(()=>{lh(s.contentDOM);let r=s.root.activeElement;r&&!r.contains(s.contentDOM)&&r.blur()});let n=s.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}else s.inputState.setSelectionOrigin("select.pointer");return!1};function Sl(s,e,t,i){if(i==1)return S.cursor(e,t);if(i==2)return Sp(s.state,e,t);{let n=s.docView.lineAt(e,t),r=s.state.doc.lineAt(n?n.posAtEnd:e),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return lDate.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(Al+1)%3:1}function Gp(s,e){let t=s.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=Hh(e),n=s.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),n=n.map(r.changes))},get(r,o,l){let a=s.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),h,c=Sl(s,a.pos,a.assoc,i);if(t.pos!=a.pos&&!o){let f=Sl(s,t.pos,t.assoc,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=Jp(n,a.pos))?h:l?n.addRange(c):S.create([c])}}}function Jp(s,e){for(let t=0;t=e)return S.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}yt.dragstart=(s,e)=>{let{selection:{main:t}}=s.state;if(e.target.draggable){let n=s.docView.tile.nearest(e.target);if(n&&n.isWidget()){let r=n.posAtStart,o=r+n.length;(r>=t.to||o<=t.from)&&(t=S.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",qs(s.state,So,s.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};yt.dragend=s=>(s.inputState.draggedContent=null,!1);function Tl(s,e,t,i){if(t=qs(s.state,ko,t),!t)return;let n=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&zp(s,e)?{from:r.from,to:r.to}:null,l={from:n,insert:t},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}yt.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),n=0,r=()=>{++n==t.length&&Tl(s,e,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Tl(s,e,i,!0),!0}return!1};yt.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=Fh?null:e.clipboardData;return t?(Wh(s,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Kp(s),!1)};function Yp(s,e){let t=s.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(),s.focus()},50)}function Xp(s){let e=[],t=[],i=!1;for(let n of s.selection.ranges)n.empty||(e.push(s.sliceDoc(n.from,n.to)),t.push(n));if(!e.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(e.push(o.text),t.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:qs(s,So,e.join(s.lineBreak)),ranges:t,linewise:i}}let Gr=null;yt.copy=yt.cut=(s,e)=>{if(!un(s.contentDOM,s.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:n}=Xp(s.state);if(!t&&!n)return!1;Gr=n?t:null,e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Fh?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Yp(s,t),!1)};const Vh=ai.define();function $h(s,e){let t=[];for(let i of s.facet(xh)){let n=i(s,e);n&&t.push(n)}return t.length?s.update({effects:t,annotations:Vh.of(!0)}):null}function zh(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=$h(s.state,e);t?s.dispatch(t):s.update([])}},10)}Xe.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),zh(s)};Xe.blur=s=>{s.observer.clearSelectionRange(),zh(s)};Xe.compositionstart=Xe.compositionupdate=s=>{s.observer.editContext||(s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0))};Xe.compositionend=s=>{s.observer.editContext||(s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,_.chrome&&_.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50))};Xe.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};yt.beforeinput=(s,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(s.inputState.insertingText=e.data,s.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&s.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],a=s.posAtDOM(l.startContainer,l.startOffset),h=s.posAtDOM(l.endContainer,l.endOffset);return Mo(s,{from:a,to:h,insert:s.state.toText(r)},null),!0}}let n;if(_.chrome&&_.android&&(n=Nh.find(r=>r.inputType==e.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return _.ios&&e.inputType=="deleteContentForward"&&s.observer.flushSoon(),_.safari&&e.inputType=="insertText"&&s.inputState.composing>=0&&setTimeout(()=>Xe.compositionend(s,e),20),!1};const Dl=new Set;function Qp(s){Dl.has(s)||(Dl.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const El=["pre-wrap","normal","pre-line","break-spaces"];let qi=!1;function Ol(){qi=!1}class Zp{constructor(e){this.lineWrapping=e,this.doc=ne.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 El.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>hs&&(qi=!0),this.height=e)}replace(e,t,i){return Ue.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=n[l],u=r.lineAt(a,fe.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,fe.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,c=n[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n=r&&o(this.lineAt(0,fe.ByPos,i,n,r))}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,n){return n&&n.from<=t&&n.more&&this.setMeasuredHeight(n),this.outdated=!1,this}toString(){return`block(${this.length})`}}class tt extends qh{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 pt(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let n=i[0];return i.length==1&&(n instanceof tt||n instanceof Re&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof Re?n=new tt(n.length,this.height,this.spaceAbove):n.height=this.height,this.outdated||(n.outdated=!1),n):Ue.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setMeasuredHeight(n):(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 Re extends Ue{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,n=e.doc.lineAt(t+this.length).number,r=n-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(e,t,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,n);if(t.lineWrapping){let h=n+(e0){let r=i[i.length-1];r instanceof Re?i[i.length-1]=new Re(r.length+n):i.push(null,new Re(n-1))}if(e>0){let r=i[0];r instanceof Re?i[0]=new Re(e+r.length):i.unshift(new Re(e-1),null)}return Ue.of(i)}decomposeLeft(e,t){t.push(new Re(e-1),null)}decomposeRight(e,t){t.push(null,new Re(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let r=t+this.length;if(n&&n.from<=t+this.length&&n.more){let o=[],l=Math.max(t,n.from),a=-1;for(n.from>t&&o.push(new Re(n.from-t-1).updateHeight(e,t));l<=r&&n.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=n.heights[n.index++],u=0;f<0&&(u=-f,f=n.heights[n.index++]),a==-1?a=f:Math.abs(f-a)>=hs&&(a=-2);let d=new tt(c,f,u);d.outdated=!1,o.push(d),l+=c+1}l<=r&&o.push(null,new Re(r-l).updateHeight(e,l));let h=Ue.of(o);return(a<0||Math.abs(h.height-this.height)>=hs||Math.abs(a-this.heightMetrics(e,t).perLine)>=hs)&&(qi=!0),Cs(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ig extends Ue{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,n){let r=i+this.left.height;return el))return h;let c=t==fe.ByPosNoHeight?fe.ByPosNoHeight:fe.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,n,r).join(h)}forEachLine(e,t,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,fe.ByPos,i,n,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&Ll(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?Ue.of(this.break?[e,null,t]:[e,t]):(this.left=Cs(this.left,e),this.right=Cs(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,n){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return n&&n.from<=t+r.length&&n.more?a=r=r.updateHeight(e,t,i,n):r.updateHeight(e,t,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(e,l,i,n):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ll(s,e){let t,i;s[e]==null&&(t=s[e-1])instanceof Re&&(i=s[e+1])instanceof Re&&s.splice(e-1,3,new Re(t.length+1+i.length))}const ng=5;class To{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),n=this.nodes[this.nodes.length-1];n instanceof tt?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new tt(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=ng)&&this.addLineDeco(n,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new tt(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new Re(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 tt)return e;let t=new tt(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 n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.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 tt)&&!this.isCovered?this.nodes.push(new tt(0,-1,0)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(h==s.parentNode?n.innerHeight:a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function lg(s){let e=s.getBoundingClientRect(),t=s.ownerDocument.defaultView||window;return e.left0&&e.top0}function ag(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class ar{constructor(e,t,i,n){this.from=e,this.to=t,this.size=i,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Zp(i),this.stateDeco=Pl(t),this.heightMap=Ue.empty().applyChanges(this.stateDeco,ne.empty,this.heightOracle.setDoc(t.doc),[new at(0,0,0,t.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=re.set(this.lineGaps.map(n=>n.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 n=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);e.push(new Kn(r,o))}}return this.viewports=e.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Rl:new Do(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(an(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Pl(this.state);let n=e.changedRanges,r=at.extendWithRanges(n,sg(i,this.stateDeco,e?e.changes:Ce.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Ol(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||qi)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!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(ep)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?pe.RTL:pe.LTR;let o=this.heightOracle.mustRefreshForWrapping(r)||this.mustMeasureContent==="refresh",l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:A,scaleY:P}=rh(t,l);(A>.005&&Math.abs(this.scaleX-A)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=A,this.scaleY=P,h|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let d=oh(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=ah(this.scrollParent||e.win);let g=(this.printing?ag:og)(t,this.paddingTop),y=g.top-this.pixelViewport.top,b=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(a=!0)),!this.inView&&!this.scrollTarget&&!lg(e.dom))return 0;let T=l.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(A)&&(o=!0),o||n.lineWrapping&&Math.abs(T-this.contentDOMWidth)>n.charWidth){let{lineHeight:P,charWidth:C,textHeight:U}=e.docView.measureTextSize();o=P>0&&n.refresh(r,P,C,U,Math.max(5,T/C),A),o&&(e.docView.minWidth=0,h|=16)}y>0&&b>0?c=Math.max(y,b):y<0&&b<0&&(c=Math.min(y,b)),Ol();for(let P of this.viewports){let C=P.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?Ue.empty().applyChanges(this.stateDeco,ne.empty,this.heightOracle,[new at(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new eg(P.from,C))}qi&&(h|=2)}let D=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return D&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||D)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}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)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Kn(n.lineAt(o-i*1e3,fe.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,fe.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=n.lineAt(h,fe.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r>1,o=n<<1;if(this.defaultTextDirection!=pe.LTR&&!i)return[];let l=[],a=(c,f,u,d)=>{if(f-cc&&bb.from>=u.from&&b.to<=u.to&&Math.abs(b.from-c)b.fromx));if(!y){if(fT.from<=f&&T.to>=f)){let T=t.moveToLineBoundary(S.cursor(f),!1,!0).head;T>c&&(f=T)}let b=this.gapSize(u,c,f,d),x=i||b<2e6?b:2e6;y=new ar(c,f,b,x)}l.push(y)},h=c=>{if(c.length2e6)for(let P of e)P.from>=c.from&&P.fromc.from&&a(c.from,d,c,f),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];ie.spans(t,this.viewport.from,this.viewport.to,{span(r,o){i.push({from:r,to:o})},point(){}},20);let n=0;if(i.length!=this.visibleRanges.length)n=12;else for(let r=0;r=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||an(this.heightMap.lineAt(e,fe.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)||an(this.heightMap.lineAt(this.scaler.fromDOM(e),fe.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 an(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 Kn{constructor(e,t){this.from=e,this.to=t}}function cg(s,e,t){let i=[],n=s,r=0;return ie.spans(t,s,e,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n=1)return e[e.length-1].to;let i=Math.floor(s*t);for(let n=0;;n++){let{from:r,to:o}=e[n],l=o-r;if(i<=l)return r+i;i-=l}}function Gn(s,e){let t=0;for(let{from:i,to:n}of s.ranges){if(e<=n){t+=e-i;break}t+=n-i}return t/s.total}function fg(s,e){for(let t of s)if(e(t))return t}const Rl={toDOM(s){return s},fromDOM(s){return s},scale:1,eq(s){return s==this}};function Pl(s){let e=s.facet(Vs).filter(i=>typeof i!="function"),t=s.facet(Ao).filter(i=>typeof i!="function");return t.length&&e.push(ie.join(t)),e}class Do{constructor(e,t,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,fe.ByPos,e,0,0).top,c=t.lineAt(a,fe.ByPos,e,0,0).bottom;return n+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(t.height-n);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let r=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function an(s,e){if(e.scale==1)return s;let t=e.toDOM(s.top),i=e.toDOM(s.bottom);return new pt(s.from,s.length,t,i-t,Array.isArray(s._content)?s._content.map(n=>an(n,e)):s._content)}const Jn=F.define({combine:s=>s.join(" ")}),Jr=F.define({combine:s=>s.indexOf(!0)>-1}),Yr=ii.newName(),Uh=ii.newName(),Kh=ii.newName(),jh={"&light":"."+Uh,"&dark":"."+Kh};function Xr(s,e,t){return new ii(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!t||!t[n])throw new RangeError(`Unsupported selector: ${n}`);return t[n]}):s+" "+i}})}const ug=Xr("."+Yr,{"&":{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":{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,')`,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"}},jh),dg={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},hr=_.ie&&_.ie_version<=11;class pg{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new $d,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);(_.ie&&_.ie_version<=11||_.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&&_.android&&e.constructor.EDIT_CONTEXT!==!1&&!(_.chrome&&_.chrome_version<126)&&(this.editContext=new mg(e),e.state.facet(Ft)&&(e.contentDOM.editContext=this.editContext.editContext)),hr&&(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){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,n=this.selectionRange;if(i.state.facet(Ft)?i.root.activeElement!=this.dom:!un(this.dom,n))return;let r=n.anchorNode&&i.docView.tile.nearest(n.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(_.ie&&_.ie_version<=11||_.android&&_.chrome)&&!i.state.selection.main.empty&&n.focusNode&&dn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=xn(e.root);if(!t)return!1;let i=_.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&gg(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let n=un(this.dom,i);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&_i(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{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,n=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&un(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Rp(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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,n=Ph(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Ss(this.view.state.selection,t.newSel.main))&&this.view.update([]),n}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=Il(t,e.previousSibling||e.target.previousSibling,-1),n=Il(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):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(Ft)!=e.state.facet(Ft)&&(e.view.contentDOM.editContext=e.state.facet(Ft)?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 n of this.scrollTargets)n.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 Il(s,e,t){for(;e;){let i=ye.get(e);if(i&&i.parent==s)return i;let n=e.parentNode;e=n!=s.dom?n:t>0?e.nextSibling:e.previousSibling}return null}function Nl(s,e){let t=e.startContainer,i=e.startOffset,n=e.endContainer,r=e.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor,1);return dn(o.node,o.offset,n,r)&&([t,i,n,r]=[n,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:r}}function gg(s,e){if(e.getComposedRanges){let n=e.getComposedRanges(s.root)[0];if(n)return Nl(s,n)}let t=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),t=n.getTargetRanges()[0]}return s.contentDOM.addEventListener("beforeinput",i,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",i,!0),t?Nl(s,t):null}class mg{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 n=e.state.selection.main,{anchor:r,head:o}=n,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let h=a-l>i.text.length;l==this.from&&rthis.to&&(a=r);let c=Ih(e.state.sliceDoc(l,a),i.text,(h?n.from:n.to)-l,h?"end":null);if(!c){let u=S.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Ss(u,n)||e.dispatch({selection:u,userEvent:"select"});return}let f={from:c.from+l,to:c.toA+l,insert:ne.of(i.text.slice(c.from,c.toB).split(` -`))};if((_.mac||_.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ne.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Mo(e,f,S.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=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 n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a{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=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=xn(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(h)){n=this.pendingContextChange=null,t+=c,this.to+=c;return}else n=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(rthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),n&&!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(n=>!n.isUserEvent("input.type")&&n.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))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*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 H{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&&(n=>n.forEach(r=>i(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||zd(e.parent)||document,this.viewState=new Bl(this,e.state||se.create(e)),e.scrollTo&&e.scrollTo.is(zn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ri).map(n=>new nr(n));for(let n of this.plugins)n.update(this);this.observer=new pg(this),this.inputState=new _p(this),this.inputState.ensureHandlers(this.plugins),this.docView=new bl(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 Ae?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,n,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Vh))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=$h(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(se.phrases)!=this.state.facet(se.phrases))return this.setState(r);n=ws.create(this,r,e),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection,{x:p,y:g}=this.state.facet(H.cursorScrollMargin);f=new Fi(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,p)}for(let d of u.effects)d.is(zn)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=As.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(ln)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(Jn)!=n.state.facet(Jn)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(Ur))try{u(n)}catch(d){Lt(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Ph(this,c)&&h.force&&_i(this.contentDOM,h.key,h.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 Bl(this,e),this.plugins=e.facet(Ri).map(i=>new nr(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new bl(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(Ri),i=e.state.facet(Ri);if(t!=i){let n=[];for(let r of i){let o=t.indexOf(r);if(o<0)n.push(new nr(r));else{let l=this.plugins[o];l.mustUpdate=e,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n-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,n=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(ah(i||this.win))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Lt(this.state,p),_l}}),f=ws.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n=n+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ur))l(t)}get themeClasses(){return Yr+" "+(this.state.facet(Jr)?Kh:Uh)+" "+this.state.facet(Jn)}updateAttrs(){let e=Fl(this,Ah,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ft)?"true":"false",class:"cm-content",style:`${_.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Fl(this,Co,t);let i=this.observer.ignore(()=>{let n=dl(this.contentDOM,this.contentAttrs,t),r=dl(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let n of i.effects)if(n.is(H.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(ln);let e=this.state.facet(H.cspNonce);ii.mount(this.root,this.styleModules.concat(ug).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;ti.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 lr(this,e,wl(this,e,t,i))}moveByGroup(e,t){return lr(this,e,wl(this,e,t,i=>Tp(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),n=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return S.cursor(r.side(t,n)+e.from,r.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,i=!0){return Mp(this,e,t,i)}moveVertically(e,t,i){return lr(this,e,Dp(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=jr(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),jr(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),o=r[Ot.find(r,e-n.from,-1,t)];return bs(i,o.dir==pe.LTR==t>0)}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(kh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yg)return ph(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||dh(r.isolates,i=ml(this,e))))return r.order;i||(i=ml(this,e));let n=Xd(e.text,t,i);return this.bidiCache.push(new As(e.from,e.to,t,i,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||_.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{lh(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,n,r,o;return zn.of(new Fi(typeof e=="number"?S.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(n=t.x)!==null&&n!==void 0?n:"nearest",(r=t.yMargin)!==null&&r!==void 0?r:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return zn.of(new Fi(S.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 st.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return st.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ii.newName(),n=[Jn.of(i),ln.of(Xr(`.${i}`,e))];return t&&t.dark&&n.push(Jr.of(!0)),n}static baseTheme(e){return On.lowest(ln.of(Xr("."+Yr,e,jh)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&ye.get(i)||ye.get(e);return((t=n==null?void 0:n.root)===null||t===void 0?void 0:t.view)||null}}H.styleModule=ln;H.inputHandler=wh;H.clipboardInputFilter=ko;H.clipboardOutputFilter=So;H.scrollHandler=Sh;H.focusChangeEffect=xh;H.perLineTextDirection=kh;H.exceptionSink=bh;H.updateListener=Ur;H.editable=Ft;H.mouseSelectionStyle=vh;H.dragMovesSelection=yh;H.clickAddsSelectionRange=mh;H.decorations=Vs;H.blockWrappers=Mh;H.outerDecorations=Ao;H.atomicRanges=Pn;H.bidiIsolatedRanges=Th;H.cursorScrollMargin=F.define({combine:s=>{let e=5,t=5;for(let i of s)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});H.scrollMargins=Dh;H.darkTheme=Jr;H.cspNonce=F.define({combine:s=>s.length?s[0]:""});H.contentAttributes=Co;H.editorAttributes=Ah;H.lineWrapping=H.contentAttributes.of({class:"cm-lineWrapping"});H.announce=oe.define();const yg=4096,_l={};class As{constructor(e,t,i,n,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],n=e.length?e[e.length-1].dir:pe.LTR;for(let r=Math.max(0,e.length-10);r=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&bo(o,t)}return t}const vg=_.mac?"mac":_.windows?"win":_.linux?"linux":"key";function bg(s,e){const t=s.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;ai.concat(n),[]))),t}function xg(s,e,t){return Jh(Gh(s.state),e,s,t)}let Yt=null;const kg=4e3;function Sg(s,e=vg){let t=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(b=>bg(b,e));for(let b=1;b{let D=Yt={view:T,prefix:x,scope:o};return setTimeout(()=>{Yt==D&&(Yt=null)},kg),!0}]})}let g=p.join(" ");n(g,!1);let y=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&y.run.push(a),h&&(y.preventDefault=!0),c&&(y.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,Zr))}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let Zr=null;function Jh(s,e,t,i){Zr=e;let n=Id(e),r=Va(n,0),o=$a(r)==n.length&&n!=" ",l="",a=!1,h=!1,c=!1;Yt&&Yt.view==t&&Yt.scope==i&&(l=Yt.prefix+" ",_h.indexOf(e.keyCode)<0&&(h=!0,Yt=null));let f=new Set,u=y=>{if(y){for(let b of y.run)if(!f.has(b)&&(f.add(b),b(t)))return y.stopPropagation&&(c=!0),!0;y.preventDefault&&(y.stopPropagation&&(c=!0),h=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Yn(n,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(_.windows&&e.ctrlKey&&e.altKey)&&!(_.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=ni[e.keyCode])&&p!=n?(u(d[l+Yn(p,e,!0)])||e.shiftKey&&(g=bn[e.keyCode])!=n&&g!=p&&u(d[l+Yn(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Yn(n,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Zr=null,a}const Hl=F.define({combine(s){let e,t;for(let i of s)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Yh(s,e){let t=s.plugin(Xh),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Xh=st.fromClass(class{constructor(s){this.input=s.state.facet(Ms),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Hl);this.top=new Xn(s,!0,e.topContainer),this.bottom=new Xn(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(Hl);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Xn(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Xn(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(Ms);if(t!=this.input){let i=t.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),l.push(c)):(c=this.panels[h],c.update&&c.update(s)),n.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>H.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Xn{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Vl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Vl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Vl(s){let e=s.nextSibling;return s.remove(),e}const Ms=F.define({enables:Xh});function Cg(s,e){let t,i=new Promise(o=>t=o),n=o=>Ag(o,e,t);s.state.field(cr,!1)?s.dispatch({effects:Qh.of(n)}):s.dispatch({effects:oe.appendConfig.of(cr.init(()=>[n]))});let r=Zh.of(n);return{close:r,result:i.then(o=>((s.win.queueMicrotask||(a=>s.win.setTimeout(a,10)))(()=>{s.state.field(cr).indexOf(n)>-1&&s.dispatch({effects:r})}),o))}}const cr=bt.define({create(){return[]},update(s,e){for(let t of e.effects)t.is(Qh)?s=[t.value].concat(s):t.is(Zh)&&(s=s.filter(i=>i!=t.value));return s},provide:s=>Ms.computeN([s],e=>e.field(s))}),Qh=oe.define(),Zh=oe.define();function Ag(s,e,t){let i=e.content?e.content(s,()=>o(null)):null;if(!i){if(i=Ee("form"),e.input){let l=Ee("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Ee("label",(e.label||"")+": ",l))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Ee("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let n=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(a))}),a.addEventListener("submit",h=>{h.preventDefault(),o(a)})}let r=Ee("div",i,Ee("button",{onclick:()=>o(null),"aria-label":s.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class),r.classList.add("cm-dialog");function o(l){r.contains(r.ownerDocument.activeElement)&&s.focus(),t(l)}return{dom:r,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=i.querySelector(e.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class ri extends bi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ri.prototype.elementClass="";ri.prototype.toDOM=void 0;ri.prototype.mapMode=nt.TrackBefore;ri.prototype.startSide=ri.prototype.endSide=-1;ri.prototype.point=!0;const fr=F.define(),Mg=F.define(),Tg={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ie.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},gn=F.define();function Dg(s){return[ec(),gn.of({...Tg,...s})]}const $l=F.define({combine:s=>s.some(e=>e)});function ec(s){return[Eg]}const Eg=st.fromClass(class{constructor(s){this.view=s,this.domAfter=null,this.prevViewport=s.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=s.state.facet(gn).map(e=>new ql(s,e)),this.fixed=!s.state.facet($l);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),s.scrollDOM.insertBefore(this.dom,s.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(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(s.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($l)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=ie.iter(this.view.state.facet(fr),this.view.viewport.from),i=[],n=this.gutters.map(r=>new Og(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Ye.Text&&o){eo(t,i,l.from);for(let a of n)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of n)a.widget(this.view,l)}else if(r.type==Ye.Text){eo(t,i,r.from);for(let o of n)o.line(this.view,r,i)}else if(r.widget)for(let o of n)o.widget(this.view,r);for(let r of n)r.finish();s&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(s){let e=s.startState.facet(gn),t=s.state.facet(gn),i=s.docChanged||s.heightChanged||s.viewportChanged||!ie.eq(s.startState.facet(fr),s.state.facet(fr),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let n of this.gutters)n.update(s)&&(i=!0);else{i=!0;let n=[];for(let r of t){let o=e.indexOf(r);o<0?n.push(new ql(this.view,r)):(this.gutters[o].update(s),n.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),n.indexOf(r)<0&&r.destroy();for(let r of n)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=n}return i}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:s=>H.scrollMargins.of(e=>{let t=e.plugin(s);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,n=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==pe.LTR?{left:i,right:n}:{right:i,left:n}})});function zl(s){return Array.isArray(s)?s:[s]}function eo(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class Og{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=ie.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:n}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==n.elements.length){let l=new tc(e,o,r,i);n.elements.push(l),n.dom.appendChild(l.dom)}else n.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let n=[];eo(this.cursor,n,t.from),i.length&&(n=n.concat(i));let r=this.gutter.config.lineMarker(e,t,n);r&&n.unshift(r);let o=this.gutter;n.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,n)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),n=i?[i]:null;for(let r of e.state.facet(Mg)){let o=r(e,t.widget,t);o&&(n||(n=[])).push(o)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class ql{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,n=>{let r=n.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=n.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,n)&&n.preventDefault()});this.markers=zl(t.markers(e)),t.initialSpacer&&(this.spacer=new tc(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=zl(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}let i=e.view.viewport;return!ie.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 tc{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Lg(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let i="cm-gutterElement",n=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,h)||o(l,a,h):o}return i}})}});class ur extends ri{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function dr(s,e){return s.state.facet(Pi).formatNumber(e,s.state)}const Pg=gn.compute([Pi],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Bg)},lineMarker(e,t,i){return i.some(n=>n.toDOM)?null:new ur(dr(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let n of e.state.facet(Rg)){let r=n(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Pi)!=e.state.facet(Pi),initialSpacer(e){return new ur(dr(e,Ul(e.state.doc.lines)))},updateSpacer(e,t){let i=dr(t.view,Ul(t.view.state.doc.lines));return i==e.number?e:new ur(i)},domEventHandlers:s.facet(Pi).domEventHandlers,side:"before"}));function Ig(s={}){return[Pi.of(s),ec(),Pg]}function Ul(s){let e=9;for(;e{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=Ke.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}ee.closedBy=new ee({deserialize:s=>s.split(" ")});ee.openedBy=new ee({deserialize:s=>s.split(" ")});ee.group=new ee({deserialize:s=>s.split(" ")});ee.isolate=new ee({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});ee.contextHash=new ee({perNode:!0});ee.lookAhead=new ee({perNode:!0});ee.mounted=new ee({perNode:!0});class Wi{constructor(e,t,i,n=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=n}static get(e){return e&&e.props&&e.props[ee.mounted.id]}}const Fg=Object.create(null);class Ke{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):Fg,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new Ke(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return n}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(ee.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 n of i.split(" "))t[n]=e[i];return i=>{for(let n=i.prop(ee.group),r=-1;r<(n?n.length:0);r++){let o=t[r<0?i.name:n[r]];if(o)return o}}}}Ke.none=new Ke("",Object.create(null),0,8);class Eo{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|he.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!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:Bo(Ke.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,n)=>new ce(this.type,t,i,n,this.propValues),e.makeTree||((t,i,n)=>new ce(Ke.none,t,i,n)))}static build(e){return $g(e)}}ce.empty=new ce(Ke.none,[],[],0);class Oo{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 Oo(this.buffer,this.index)}}class oi{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Ke.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let n=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Sn(s,e,t,i){for(var n;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(r&he.EnterBracketed&&c instanceof ce&&(u=Wi.get(c))&&!u.overlay&&u.bracketed&&i>=f&&i<=f+c.length)&&!ic(n,i,f,f+c.length))){if(c instanceof oi){if(r&he.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,i-f,n);if(d>-1)return new Bt(new Wg(o,c,e,f),null,d)}else if(r&he.IncludeAnonymous||!c.type.isAnonymous||Lo(c)){let d;if(!(r&he.IgnoreMounts)&&(d=Wi.get(c))&&!d.overlay)return new He(d.tree,f,e,o);let p=new He(c,f,e,o);return r&he.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,i,n,r)}}}if(r&he.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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 n;if(!(i&he.IgnoreOverlays)&&(n=Wi.get(this._tree))&&n.overlay){let r=e-this.from,o=i&he.EnterBracketed&&n.bracketed;for(let{from:l,to:a}of n.overlay)if((t>0||o?l<=r:l=r:a>r))return new He(n.tree,n.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 jl(s,e,t,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=n.type.is(t),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(e)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function to(s,e,t=e.length-1){for(let i=s;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 Wg{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class Bt extends nc{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:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Bt(this.context,this,r)}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&he.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Bt(this.context,this,r)}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 Bt(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 Bt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];e.push(i.slice(n,r,o)),t.push(0)}return new ce(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function sc(s){if(!s.length)return null;let e=0,t=s[0];for(let r=1;rt.from||o.to=e){let l=new He(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Sn(l,e,t,!1))}}return n?sc(n):i}class Ts{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&~he.EnterBracketed,e instanceof He)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:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return e?e instanceof He?(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:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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&he.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&he.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&he.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 n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(n)}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:n}=this;if(n){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&he.IncludeAnonymous||l instanceof oi||!l.type.isAnonymous||Lo(l))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=0;){for(let o=e;o;o=o._parent)if(o.index==n){if(n==this.index)return o;t=o,i=r+1;break e}n=this.stack[--r]}for(let n=i;n=0;r--){if(r<0)return to(this._tree,e,n);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}}function Lo(s){return s.children.some(e=>e instanceof oi||!e.type.isAnonymous||Lo(e))}function $g(s){var e;let{buffer:t,nodeSet:i,maxBufferLength:n=Ng,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(t)?new Oo(t,t.length):t,a=i.types,h=0,c=0;function f(A,P,C,U,M,$){let{id:N,start:I,end:G,size:L}=l,R=c,Z=h;if(L<0)if(l.next(),L==-1){let de=r[N];C.push(de),U.push(I-A);return}else if(L==-3){h=N;return}else if(L==-4){c=N;return}else throw new RangeError(`Unrecognized record size: ${L}`);let X=a[N],ue,Me,ot=I-A;if(G-I<=n&&(Me=y(l.pos-P,M))){let de=new Uint16Array(Me.size-Me.skip),Te=l.pos-Me.size,De=de.length;for(;l.pos>Te;)De=b(Me.start,de,De);ue=new oi(de,G-Me.start,i),ot=Me.start-A}else{let de=l.pos-L;l.next();let Te=[],De=[],Fe=N>=o?N:-1,Le=0,je=G;for(;l.pos>de;)Fe>=0&&l.id==Fe&&l.size>=0?(l.end<=je-n&&(p(Te,De,I,Le,l.end,je,Fe,R,Z),Le=Te.length,je=l.end),l.next()):$>2500?u(I,de,Te,De):f(I,de,Te,De,Fe,$+1);if(Fe>=0&&Le>0&&Le-1&&Le>0){let $e=d(X,Z);ue=Bo(X,Te,De,0,Te.length,0,G-I,$e,$e)}else ue=g(X,Te,De,G-I,R-G,Z)}C.push(ue),U.push(ot)}function u(A,P,C,U){let M=[],$=0,N=-1;for(;l.pos>P;){let{id:I,start:G,end:L,size:R}=l;if(R>4)l.next();else{if(N>-1&&G=0;L-=3)I[R++]=M[L],I[R++]=M[L+1]-G,I[R++]=M[L+2]-G,I[R++]=R;C.push(new oi(I,M[2]-G,i)),U.push(G-A)}}function d(A,P){return(C,U,M)=>{let $=0,N=C.length-1,I,G;if(N>=0&&(I=C[N])instanceof ce){if(!N&&I.type==A&&I.length==M)return I;(G=I.prop(ee.lookAhead))&&($=U[N]+I.length+G)}return g(A,C,U,M,$,P)}}function p(A,P,C,U,M,$,N,I,G){let L=[],R=[];for(;A.length>U;)L.push(A.pop()),R.push(P.pop()+C-M);A.push(g(i.types[N],L,R,$-M,I-$,G)),P.push(M-C)}function g(A,P,C,U,M,$,N){if($){let I=[ee.contextHash,$];N=N?[I].concat(N):[I]}if(M>25){let I=[ee.lookAhead,M];N=N?[I].concat(N):[I]}return new ce(A,P,C,U,N)}function y(A,P){let C=l.fork(),U=0,M=0,$=0,N=C.end-n,I={size:0,start:0,skip:0};e:for(let G=C.pos-A;C.pos>G;){let L=C.size;if(C.id==P&&L>=0){I.size=U,I.start=M,I.skip=$,$+=4,U+=4,C.next();continue}let R=C.pos-L;if(L<0||R=o?4:0,X=C.start;for(C.next();C.pos>R;){if(C.size<0)if(C.size==-3||C.size==-4)Z+=4;else break e;else C.id>=o&&(Z+=4);C.next()}M=X,U+=L,$+=Z}return(P<0||U==A)&&(I.size=U,I.start=M,I.skip=$),I.size>4?I:void 0}function b(A,P,C){let{id:U,start:M,end:$,size:N}=l;if(l.next(),N>=0&&U4){let G=l.pos-(N-4);for(;l.pos>G;)C=b(A,P,C)}P[--C]=I,P[--C]=$-A,P[--C]=M-A,P[--C]=U}else N==-3?h=U:N==-4&&(c=U);return C}let x=[],T=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,x,T,-1,0);let D=(e=s.length)!==null&&e!==void 0?e:x.length?T[0]+x[0].length:0;return new ce(a[s.topID],x.reverse(),T.reverse(),D)}const Gl=new WeakMap;function cs(s,e){if(!s.isAnonymous||e instanceof oi||e.type!=s)return 1;let t=Gl.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=s||!(i instanceof ce)){t=1;break}t+=cs(s,i)}Gl.set(e,t)}return t}function Bo(s,e,t,i,n,r,o,l,a){let h=0;for(let p=i;p=c)break;P+=C}if(T==D+1){if(P>c){let C=p[D];d(C.children,C.positions,0,C.children.length,g[D]+x);continue}f.push(p[D])}else{let C=g[T-1]+p[T-1].length-A;f.push(Bo(s,p,g,D,T,A,C,null,a))}u.push(A+x-r)}}return d(e,t,i,n,0),(l||a)(f,u,o)}class uv{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Bt?this.setBuffer(e.context.buffer,e.index,t):e instanceof He&&this.map.set(e.tree,t)}get(e){return e instanceof Bt?this.getBuffer(e.context.buffer,e.index):e instanceof He?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ht{constructor(e,t,i,n,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let n=[new Ht(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&n.push(r);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ht(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&n.push(u),o.to>f)break;o=rnew ht(n.from,n.to)):[new ht(0,0)]:[new ht(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let r=n.advance();if(r)return r}}}class zg{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)}}function dv(s){return(e,t,i,n)=>new Ug(e,s,t,i,n)}class Jl{constructor(e,t,i,n,r,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=n,this.target=r,this.from=o}}function Yl(s){if(!s.length||s.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class qg{constructor(e,t,i,n,r,o,l,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=n,this.start=r,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const io=new ee({perNode:!0});class Ug{constructor(e,t,i,n,r){this.nest=t,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new ce(i.type,i.children,i.positions,i.length,i.propValues.concat([[io,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[ee.mounted.id]=new Wi(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(n)){if(t){let h=t.mounts.find(c=>c.frag.from<=n.from&&c.frag.to>=n.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=n.from&&u<=n.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Kg(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.fromnew ht(f.from-n.from,f.to-n.from)):null,!!r.bracketed,n.tree,c.length?c[0].from:n.from)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(n))&&(a===!0&&(a=new ht(n.from,n.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&n.firstChild())t&&t.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(t&&!--t.depth){let h=Zl(this.ranges,t.ranges);h.length&&(Yl(h),this.inner.splice(t.index,0,new Jl(t.parser,t.parser.startParse(this.input,ea(t.mounts,h),h),t.ranges.map(c=>new ht(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Kg(s,e,t){for(let i of s){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Xl(s,e,t,i,n,r){if(e=e&&t.enter(i,1,he.IgnoreOverlays|he.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ce)t=t.children[0];else break}return!1}}class Gg{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(io))!==null&&t!==void 0?t:i.to,this.inner=new Ql(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(io))!==null&&e!==void 0?e:t.to,this.inner=new Ql(t.tree,-t.offset)}}findMounts(e,t){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(ee.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function Zl(s,e){let t=null,i=e;for(let n=1,r=0;n=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new ht(l,a.to))):a.to>l?t[r--]=new ht(l,a.to):t.splice(r--,1))}}return i}function Jg(s,e,t,i){let n=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=n==s.length?1e9:o?s[n].to:s[n].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew ht(u.from+i,u.to+i)),f=Jg(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new Ht(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else t.push(new Ht(a,h,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let Yg=0;class lt{constructor(e,t,i,n){this.name=e,this.set=t,this.base=i,this.modified=n,this.id=Yg++}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 lt&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let n=new lt(i,[],null,[]);if(n.set.push(n),t)for(let r of t.set)n.set.push(r);return n}static defineModifier(e){let t=new Ds(e);return i=>i.modified.indexOf(t)>-1?i:Ds.get(i.base||i,i.modified.concat(t).sort((n,r)=>n.id-r.id))}}let Xg=0;class Ds{constructor(e){this.name=e,this.instances=[],this.id=Xg++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Qg(t,l.modified));if(i)return i;let n=[],r=new lt(e.name,n,e,t);for(let l of t)l.instances.push(r);let o=Zg(t);for(let l of e.set)if(!l.modified.length)for(let a of o)n.push(Ds.get(l,a));return r}}function Qg(s,e){return s.length==e.length&&s.every((t,i)=>t==e[i])}function Zg(s){let e=[[]];for(let t=0;ti.length-t.length)}function em(s){let e=Object.create(null);for(let t in s){let i=s[t];Array.isArray(i)||(i=[i]);for(let n of t.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+n);let c=new Cn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return oc.add(e)}const oc=new ee({combine(s,e){let t,i,n;for(;s||e;){if(!s||e&&s.depth>=e.depth?(n=e,e=e.next):(n=s,s=s.next),t&&t.mode==n.mode&&!n.context&&!t.context)continue;let r=new Cn(n.tags,n.mode,n.context);t?t.next=r:i=r,t=r}return i}});class Cn{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=n;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function tm(s,e){let t=null;for(let i of s){let n=i.style(e);n&&(t=t?t+" "+n:n)}return t}function im(s,e,t,i=0,n=s.length){let r=new nm(i,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}class nm{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,n,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=n,c=sm(e)||Cn.empty,f=tm(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(ee.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(u.tree.type)),g=e.firstChild();for(let y=0,b=l;;y++){let x=y=T||!e.nextSibling())););if(!x||T>i)break;b=x.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,x.from+l),Math.min(i,b),"",p),this.startSpan(Math.min(i,b),h))}g&&e.parent()}else if(e.firstChild()){u&&(n="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,n,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function sm(s){let e=s.type.prop(oc);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const E=lt.define,Zn=E(),jt=E(),ta=E(jt),ia=E(jt),Gt=E(),es=E(Gt),pr=E(Gt),Tt=E(),ui=E(Tt),At=E(),Mt=E(),no=E(),sn=E(no),ts=E(),v={comment:Zn,lineComment:E(Zn),blockComment:E(Zn),docComment:E(Zn),name:jt,variableName:E(jt),typeName:ta,tagName:E(ta),propertyName:ia,attributeName:E(ia),className:E(jt),labelName:E(jt),namespace:E(jt),macroName:E(jt),literal:Gt,string:es,docString:E(es),character:E(es),attributeValue:E(es),number:pr,integer:E(pr),float:E(pr),bool:E(Gt),regexp:E(Gt),escape:E(Gt),color:E(Gt),url:E(Gt),keyword:At,self:E(At),null:E(At),atom:E(At),unit:E(At),modifier:E(At),operatorKeyword:E(At),controlKeyword:E(At),definitionKeyword:E(At),moduleKeyword:E(At),operator:Mt,derefOperator:E(Mt),arithmeticOperator:E(Mt),logicOperator:E(Mt),bitwiseOperator:E(Mt),compareOperator:E(Mt),updateOperator:E(Mt),definitionOperator:E(Mt),typeOperator:E(Mt),controlOperator:E(Mt),punctuation:no,separator:E(no),bracket:sn,angleBracket:E(sn),squareBracket:E(sn),paren:E(sn),brace:E(sn),content:Tt,heading:ui,heading1:E(ui),heading2:E(ui),heading3:E(ui),heading4:E(ui),heading5:E(ui),heading6:E(ui),contentSeparator:E(Tt),list:E(Tt),quote:E(Tt),emphasis:E(Tt),strong:E(Tt),link:E(Tt),monospace:E(Tt),strikethrough:E(Tt),inserted:E(),deleted:E(),changed:E(),invalid:E(),meta:ts,documentMeta:E(ts),annotation:E(ts),processingInstruction:E(ts),definition:lt.defineModifier("definition"),constant:lt.defineModifier("constant"),function:lt.defineModifier("function"),standard:lt.defineModifier("standard"),local:lt.defineModifier("local"),special:lt.defineModifier("special")};for(let s in v){let e=v[s];e instanceof lt&&(e.name=s)}lc([{tag:v.link,class:"tok-link"},{tag:v.heading,class:"tok-heading"},{tag:v.emphasis,class:"tok-emphasis"},{tag:v.strong,class:"tok-strong"},{tag:v.keyword,class:"tok-keyword"},{tag:v.atom,class:"tok-atom"},{tag:v.bool,class:"tok-bool"},{tag:v.url,class:"tok-url"},{tag:v.labelName,class:"tok-labelName"},{tag:v.inserted,class:"tok-inserted"},{tag:v.deleted,class:"tok-deleted"},{tag:v.literal,class:"tok-literal"},{tag:v.string,class:"tok-string"},{tag:v.number,class:"tok-number"},{tag:[v.regexp,v.escape,v.special(v.string)],class:"tok-string2"},{tag:v.variableName,class:"tok-variableName"},{tag:v.local(v.variableName),class:"tok-variableName tok-local"},{tag:v.definition(v.variableName),class:"tok-variableName tok-definition"},{tag:v.special(v.variableName),class:"tok-variableName2"},{tag:v.definition(v.propertyName),class:"tok-propertyName tok-definition"},{tag:v.typeName,class:"tok-typeName"},{tag:v.namespace,class:"tok-namespace"},{tag:v.className,class:"tok-className"},{tag:v.macroName,class:"tok-macroName"},{tag:v.propertyName,class:"tok-propertyName"},{tag:v.operator,class:"tok-operator"},{tag:v.comment,class:"tok-comment"},{tag:v.meta,class:"tok-meta"},{tag:v.invalid,class:"tok-invalid"},{tag:v.punctuation,class:"tok-punctuation"}]);var gr;const Zt=new ee;function Ro(s){return F.define({combine:s?e=>e.concat(s):void 0})}const ac=new ee;class qe{constructor(e,t,i=[],n=""){this.data=e,this.name=n,se.prototype.hasOwnProperty("tree")||Object.defineProperty(se.prototype,"tree",{get(){return _e(this)}}),this.parser=t,this.extension=[$t.of(this),se.languageData.of((r,o,l)=>{let a=na(r,o,l),h=a.type.prop(Zt);if(!h)return[];let c=r.facet(h),f=a.type.prop(ac);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return na(e,t,i).type.prop(Zt)==this.data}findRegions(e){let t=e.facet($t);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Zt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(ee.mounted);if(l){if(l.tree.prop(Zt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Es(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _e(s){let e=s.field(qe.state,!1);return e?e.tree:ce.empty}function hc(s,e,t=50){var i;let n=(i=s.field(qe.state,!1))===null||i===void 0?void 0:i.context;if(!n)return null;let r=n.viewport;n.updateViewport({from:0,to:e});let o=n.isDone(e)||n.work(t,e)?n.tree:null;return n.updateViewport(r),o}function rm(s,e=s.doc.length){var t;return((t=s.field(qe.state,!1))===null||t===void 0?void 0:t.context.isDone(e))||!1}function om(s,e=s.viewport.to,t=100){let i=hc(s.state,e,t);return i!=_e(s.state)&&s.dispatch({}),!!i}function lm(s){var e;return((e=s.plugin(uc))===null||e===void 0?void 0:e.isWorking())||!1}class cc{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=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let rn=null;class Si{constructor(e,t,i=[],n,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Si(e,t,[],ce.empty,0,i,[],null)}startParse(){return this.parser.startParse(new cc(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ce.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=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(Ht.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rn;rn=this;try{return e()}finally{rn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sa(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ht.applyChanges(i,a),n=ce.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=sa(this.fragments,n,r),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 rc{createParse(t,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=rn;if(a){for(let h of n)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new ce(Ke.none,[],[],o-r)},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 rn}}function sa(s,e,t){return Ht.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ui{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 Ui(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Si.create(e.facet($t).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ui(i)}}qe.state=bt.define({create:Ui.init,update(s,e){for(let t of e.effects)if(t.is(qe.setState))return t.value;return e.startState.facet($t)!=e.state.facet($t)?Ui.init(e.state):s.apply(e)}});let fc=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(fc=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const mr=typeof navigator<"u"&&(!((gr=navigator.scheduling)===null||gr===void 0)&&gr.isInputPending)?()=>navigator.scheduling.isInputPending():null,uc=st.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(qe.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(qe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=fc(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,a=r.context.work(()=>mr&&mr()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:qe.setState.of(new Ui(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Lt(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()}}}),$t=F.define({combine(s){return s.length?s[0]:null},enables:s=>[qe.state,uc,H.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class am{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Po{constructor(e,t,i,n,r,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new Po(e.name,(e.alias||[]).concat(e.name).map(n=>n.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let i=/\.([^.]+)$/.exec(t);if(i){for(let n of e)if(n.extensions.indexOf(i[1])>-1)return n}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(r=>r==t))return n;if(i)for(let n of e)for(let r of n.alias){let o=t.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+r.length])))return n}return null}}const dc=F.define(),Us=F.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function li(s){let e=s.facet(Us);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function Ci(s,e){let t="",i=s.tabSize,n=s.facet(Us)[0];if(n==" "){for(;e>=i;)t+=" ",e-=i;n=" "}for(let r=0;r=e?cm(s,t,e):null}function hm(s,e,t){let i=Object.create(null),n=new Xi(s,{overrideIndentation:o=>{var l;return(l=i[o])!==null&&l!==void 0?l:-1}}),r=[];for(let o=e;o<=t;){let l=s.doc.lineAt(o);o=l.to+1;let a=In(n,l.from);if(a==null)continue;/\S/.test(l.text)||(a=0);let h=/^\s*/.exec(l.text)[0],c=Ci(s,a);h!=c&&(i[l.from]=a,r.push({from:l.from,to:l.from+h.length,insert:c}))}return s.changes(r)}class Xi{constructor(e,t={}){this.state=e,this.options=t,this.unit=li(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==e?{text:"",from:e}:(t<0?n-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Ws(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Io=new ee;function cm(s,e,t){let i=e.resolveStack(t),n=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(n!=i.node){let r=[];for(let o=n;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return pc(i,s,t)}function pc(s,e,t){for(let i=s;i;i=i.next){let n=um(i.node);if(n)return n(Ks.create(e,t,i))}return 0}function fm(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function um(s){let e=s.type.prop(Io);if(e)return e;let t=s.firstChild,i;if(t&&(i=t.type.prop(ee.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>gc(o,!0,1,void 0,r&&!fm(o)?n.from:void 0)}return s.parent==null?dm:null}function dm(){return 0}class Ks extends Xi{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 Ks(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(pm(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return pc(this.context.next,this.base,this.pos)}}function pm(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function gm(s){let e=s.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function mm({closing:s,align:e=!0,units:t=1}){return i=>gc(i,e,t,s)}function gc(s,e,t,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=e?gm(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*t)}const ym=s=>s.baseIndent;function vm({except:s,units:e=1}={}){return t=>{let i=s&&s.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const bm=200;function wm(){return se.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:i}=s.newSelection.main,n=t.lineAt(i);if(i>n.from+bm)return s;let r=t.sliceString(n.from,i);if(!e.some(h=>h.test(r)))return s;let{state:o}=s,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=In(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=Ci(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const mc=F.define(),yc=new ee;function xm(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&h.to>t&&(r=h)}}return r}function Sm(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function Ki(s,e,t){for(let i of s.facet(mc)){let n=i(s,e,t);if(n)return n}return km(s,e,t)}function vc(s,e){let t=e.mapPos(s.from,1),i=e.mapPos(s.to,-1);return t>=i?void 0:{from:t,to:i}}const Qi=oe.define({map:vc}),Ai=oe.define({map:vc});function No(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(s.lineBlockAt(t));return e}const zt=bt.define({create(){return re.none},update(s,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>s=ra(s,t,i)),s=s.map(e.changes);for(let t of e.effects)if(t.is(Qi)&&!Am(s,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(Fo),n=i?re.replace({widget:new Om(i(e.state,t.value))}):oa;s=s.update({add:[n.range(t.value.from,t.value.to)]})}else t.is(Ai)&&(s=s.update({filter:(i,n)=>t.value.from!=i||t.value.to!=n,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(s=ra(s,e.selection.main.head)),s},provide:s=>H.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(i,n)=>{t.push(i,n)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{ne&&(i=!0)}),i?s.update({filterFrom:e,filterTo:t,filter:(n,r)=>n>=t||r<=e}):s}function Cm(s){return s.field(zt,!1)||ie.empty}function An(s,e,t){var i;let n=null;return(i=s.field(zt,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!n||n.from>r)&&(n={from:r,to:o})}),n}function Am(s,e,t){let i=!1;return s.between(e,e,(n,r)=>{n==e&&r==t&&(i=!0)}),i}function _o(s,e){return s.field(zt,!1)?e:e.concat(oe.appendConfig.of(Wo()))}const bc=s=>{for(let e of No(s)){let t=Ki(s.state,e.from,e.to);if(t)return s.dispatch({effects:_o(s.state,[Qi.of(t),Os(s,t)])}),!0}return!1},wc=s=>{if(!s.state.field(zt,!1))return!1;let e=[];for(let t of No(s)){let i=An(s.state,t.from,t.to);i&&e.push(Ai.of(i),Os(s,i,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function Os(s,e,t=!0){let i=s.state.doc.lineAt(e.from).number,n=s.state.doc.lineAt(e.to).number;return H.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${s.state.phrase("to")} ${n}.`)}const xc=s=>{let{state:e}=s,t=[];for(let i=0;i{let e=s.state.field(zt,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(i,n)=>{t.push(Ai.of({from:i,to:n}))}),s.dispatch({effects:t}),!0};function Mm(s,e){for(let t=e;;){let i=Ki(s.state,t.from,t.to);if(i&&i.to>e.from)return i;if(!t.from)return null;t=s.lineBlockAt(t.from-1)}}const Tm=s=>{let e=[];for(let t of No(s)){let i=An(s.state,t.from,t.to);if(i)e.push(Ai.of(i),Os(s,i,!1));else{let n=Mm(s,t);n&&e.push(Qi.of(n),Os(s,n))}}return e.length>0&&s.dispatch({effects:_o(s.state,e)}),!!e.length},Dm=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:bc},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:wc},{key:"Ctrl-Alt-[",run:xc},{key:"Ctrl-Alt-]",run:kc}],Em={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Fo=F.define({combine(s){return Ln(s,Em)}});function Wo(s){let e=[zt,Rm];return s&&e.push(Fo.of(s)),e}function Sc(s,e){let{state:t}=s,i=t.facet(Fo),n=o=>{let l=s.lineBlockAt(s.posAtDOM(o.target)),a=An(s.state,l.from,l.to);a&&s.dispatch({effects:Ai.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(s,n,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}const oa=re.replace({widget:new class extends Yi{toDOM(s){return Sc(s,null)}}});class Om extends Yi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Sc(e,this.value)}}const Lm={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class yr extends ri{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Bm(s={}){let e={...Lm,...s},t=new yr(e,!0),i=new yr(e,!1),n=st.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet($t)!=o.state.facet($t)||o.startState.field(zt,!1)!=o.state.field(zt,!1)||_e(o.startState)!=_e(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new ti;for(let a of o.viewportLineBlocks){let h=An(o.state,a.from,a.to)?i:Ki(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[n,Dg({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(n))===null||l===void 0?void 0:l.markers)||ie.empty},initialSpacer(){return new yr(e,!1)},domEventHandlers:{...r,click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=An(o.state,l.from,l.to);if(h)return o.dispatch({effects:Ai.of(h)}),!0;let c=Ki(o.state,l.from,l.to);return c?(o.dispatch({effects:Qi.of(c)}),!0):!1}}}),Wo()]}const Rm=H.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Mi{constructor(e,t){this.specs=e;let i;function n(l){let a=ii.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?n(t.all):void 0,o=t.scope;this.scope=o instanceof qe?l=>l.prop(Zt)==o.data:o?l=>l==o:void 0,this.style=lc(e.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ii(i):null,this.themeType=t.themeType}static define(e,t){return new Mi(e,t||{})}}const so=F.define(),Cc=F.define({combine(s){return s.length?[s[0]]:null}});function fs(s){let e=s.facet(so);return e.length?e:s.facet(Cc)}function Ac(s,e){let t=[Nm],i;return s instanceof Mi&&(s.module&&t.push(H.styleModule.of(s.module)),i=s.themeType),e!=null&&e.fallback?t.push(Cc.of(s)):i?t.push(so.computeN([H.darkTheme],n=>n.facet(H.darkTheme)==(i=="dark")?[s]:[])):t.push(so.of(s)),t}function Pm(s,e,t){let i=fs(s),n=null;if(i){for(let r of i)if(!r.scope||t&&r.scope(t)){let o=r.style(e);o&&(n=n?n+" "+o:o)}}return n}class Im{constructor(e){this.markCache=Object.create(null),this.tree=_e(e.state),this.decorations=this.buildDeco(e,fs(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=_e(e.state),i=fs(e.state),n=i!=fs(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return re.none;let i=new ti;for(let{from:n,to:r}of e.visibleRanges)im(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=re.mark({class:a})))},n,r);return i.finish()}}const Nm=On.high(st.fromClass(Im,{decorations:s=>s.decorations})),_m=Mi.define([{tag:v.meta,color:"#404740"},{tag:v.link,textDecoration:"underline"},{tag:v.heading,textDecoration:"underline",fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.strong,fontWeight:"bold"},{tag:v.strikethrough,textDecoration:"line-through"},{tag:v.keyword,color:"#708"},{tag:[v.atom,v.bool,v.url,v.contentSeparator,v.labelName],color:"#219"},{tag:[v.literal,v.inserted],color:"#164"},{tag:[v.string,v.deleted],color:"#a11"},{tag:[v.regexp,v.escape,v.special(v.string)],color:"#e40"},{tag:v.definition(v.variableName),color:"#00f"},{tag:v.local(v.variableName),color:"#30a"},{tag:[v.typeName,v.namespace],color:"#085"},{tag:v.className,color:"#167"},{tag:[v.special(v.variableName),v.macroName],color:"#256"},{tag:v.definition(v.propertyName),color:"#00c"},{tag:v.comment,color:"#940"},{tag:v.invalid,color:"#f00"}]),Fm=H.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Mc=1e4,Tc="()[]{}",Dc=F.define({combine(s){return Ln(s,{afterCursor:!0,brackets:Tc,maxScanDistance:Mc,renderMatch:Vm})}}),Wm=re.mark({class:"cm-matchingBracket"}),Hm=re.mark({class:"cm-nonmatchingBracket"});function Vm(s){let e=[],t=s.matched?Wm:Hm;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}function la(s){let e=[],t=s.facet(Dc);for(let i of s.selection.ranges){if(!i.empty)continue;let n=mt(s,i.head,-1,t)||i.head>0&&mt(s,i.head-1,1,t)||t.afterCursor&&(mt(s,i.head,1,t)||i.heads.decorations}),zm=[$m,Fm];function qm(s={}){return[Dc.of(s),zm]}const Ec=new ee;function ro(s,e,t){let i=s.prop(e<0?ee.openedBy:ee.closedBy);if(i)return i;if(s.name.length==1){let n=t.indexOf(s.name);if(n>-1&&n%2==(e<0?1:0))return[t[n+e]]}return null}function oo(s){let e=s.type.prop(Ec);return e?e(s.node):s}function mt(s,e,t,i={}){let n=i.maxScanDistance||Mc,r=i.brackets||Tc,o=_e(s),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=ro(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Um(s,e,t,a,c,h,r)}}return Km(s,e,t,o,l.type,n,r)}function Um(s,e,t,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,y=t>0?d.length:-1;g!=y;g+=t){let b=o.indexOf(d[g]);if(!(b<0||i.resolveInner(p+g,1).type!=n))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function aa(s,e,t,i=0,n=0){e==null&&(e=s.search(/[^\s\u00a0]/),e==-1&&(e=s.length));let r=n;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return n(r)==n(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function jm(s){return{name:s.name||"",token:s.token,blankLine:s.blankLine||(()=>{}),startState:s.startState||(()=>!0),copyState:s.copyState||Gm,indent:s.indent||(()=>null),languageData:s.languageData||{},tokenTable:s.tokenTable||zo,mergeTokens:s.mergeTokens!==!1}}function Gm(s){if(typeof s!="object")return s;let e={};for(let t in s){let i=s[t];e[t]=i instanceof Array?i.slice():i}return e}const ha=new WeakMap;class Vo extends qe{constructor(e){let t=Ro(e.languageData),i=jm(e),n,r=new class extends rc{createParse(o,l,a){return new Ym(n,o,l,a)}};super(t,r,[],e.name),this.topNode=Zm(t,this),n=this,this.streamParser=i,this.stateAfter=new ee({perNode:!0}),this.tokenTable=e.tokenTable?new Rc(i.tokenTable):Qm}static define(e){return new Vo(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=ha.get(e.state),t!=null&&t1e4)return null;for(;r=i&&t+e.length<=n&&e.prop(s.stateAfter);if(r)return{state:s.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof ce&&a=e.length)return e;!n&&t==0&&e.type==s.topNode&&(n=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&$o(s,r.tree,0-r.offset,t,l),h;if(a&&a.pos<=i&&(h=Oc(s,r.tree,t+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:s.streamParser.startState(n?li(n):4),tree:ce.empty}}class Ym{constructor(e,t,i,n){this.lang=e,this.input=t,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=Si.get(),o=n[0].from,{state:l,tree:a}=Jm(e,i,o,this.to,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;hh.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(li(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=Si.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` +`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var ni={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:"'"},bn={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Rd=typeof navigator<"u"&&/Mac/.test(navigator.platform),Pd=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Pe=0;Pe<10;Pe++)ni[48+Pe]=ni[96+Pe]=String(Pe);for(var Pe=1;Pe<=24;Pe++)ni[Pe+111]="F"+Pe;for(var Pe=65;Pe<=90;Pe++)ni[Pe]=String.fromCharCode(Pe+32),bn[Pe]=String.fromCharCode(Pe);for(var tr in ni)bn.hasOwnProperty(tr)||(bn[tr]=ni[tr]);function Id(s){var e=Rd&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||Pd&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",t=!e&&s.key||(s.shiftKey?bn:ni)[s.keyCode]||s.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}function Ee(){var s=arguments[0];typeof s=="string"&&(s=document.createElement(s));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var n=t[i];typeof n=="string"?s.setAttribute(i,n):n!=null&&(s[i]=n)}e++}for(;e2);var _={mac:ul||/Mac/.test(ze.platform),windows:/Win/.test(ze.platform),linux:/Linux|X11/.test(ze.platform),ie:Hs,ie_version:nh?_r.documentMode||6:Wr?+Wr[1]:Fr?+Fr[1]:0,gecko:fl,gecko_version:fl?+(/Firefox\/(\d+)/.exec(ze.userAgent)||[0,0])[1]:0,chrome:!!ir,chrome_version:ir?+ir[1]:0,ios:ul,android:/Android\b/.test(ze.userAgent),webkit_version:Nd?+(/\bAppleWebKit\/(\d+)/.exec(ze.userAgent)||[0,0])[1]:0,safari:Hr,safari_version:Hr?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ze.userAgent)||[0,0])[1]:0,tabSize:_r.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function bo(s,e){for(let t in s)t=="class"&&e.class?e.class+=" "+s.class:t=="style"&&e.style?e.style+=";"+s.style:e[t]=s[t];return e}const ys=Object.create(null);function wo(s,e,t){if(s==e)return!0;s||(s=ys),e||(e=ys);let i=Object.keys(s),n=Object.keys(e);if(i.length-0!=n.length-0)return!1;for(let r of i)if(r!=t&&(n.indexOf(r)==-1||s[r]!==e[r]))return!1;return!0}function _d(s,e){for(let t=s.attributes.length-1;t>=0;t--){let i=s.attributes[t].name;e[i]==null&&s.removeAttribute(i)}for(let t in e){let i=e[t];t=="style"?s.style.cssText=i:s.getAttribute(t)!=i&&s.setAttribute(t,i)}}function dl(s,e,t){let i=!1;if(e)for(let n in e)t&&n in t||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(t)for(let n in t)e&&e[n]==t[n]||(i=!0,n=="style"?s.style.cssText=t[n]:s.setAttribute(n,t[n]));return i}function Fd(s){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new wi(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,n;if(e.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=sh(e,t);i=(r?t?-3e8:-1:5e8)-1,n=(o?t?2e8:1:-6e8)+1}return new wi(e,i,n,t,e.widget||null,!0)}static line(e){return new Rn(e)}static set(e,t=!1){return ie.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}re.none=ie.empty;class Bn extends re{constructor(e){let{start:t,end:i}=sh(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?bo(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||ys}eq(e){return this==e||e instanceof Bn&&this.tagName==e.tagName&&wo(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)}}Bn.prototype.point=!1;class Rn extends re{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof Rn&&this.spec.class==e.spec.class&&wo(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)}}Rn.prototype.mapMode=nt.TrackBefore;Rn.prototype.point=!0;class wi extends re{constructor(e,t,i,n,r,o){super(t,i,r,e),this.block=n,this.isReplace=o,this.mapMode=n?t<=0?nt.TrackBefore:nt.TrackAfter:nt.TrackDel}get type(){return this.startSide!=this.endSide?Ye.WidgetRange:this.startSide<=0?Ye.WidgetBefore:Ye.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof wi&&Wd(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)}}wi.prototype.point=!0;function sh(s,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=s;return t==null&&(t=s.inclusive),i==null&&(i=s.inclusive),{start:t??e,end:i??e}}function Wd(s,e){return s==e||!!(s&&e&&s.compare(e))}function Ni(s,e,t,i=0){let n=t.length-1;n>=0&&t[n]+i>=s?t[n]=Math.max(t[n],e):t.push(s,e)}class wn extends bi{constructor(e,t,i){super(),this.tagName=e,this.attributes=t,this.rank=i}eq(e){return e==this||e instanceof wn&&this.tagName==e.tagName&&wo(this.attributes,e.attributes)}static create(e){return new wn(e.tagName,e.attributes||ys,e.rank==null?50:Math.max(0,Math.min(e.rank,100)))}static set(e,t=!1){return ie.of(e,t)}}wn.prototype.startSide=wn.prototype.endSide=-1;function xn(s){let e;return s.nodeType==11?e=s.getSelection?s:s.ownerDocument:e=s,e.getSelection()}function Vr(s,e){return e?s==e||s.contains(e.nodeType!=1?e.parentNode:e):!1}function un(s,e){if(!e.anchorNode)return!1;try{return Vr(s,e.anchorNode)}catch{return!1}}function as(s){return s.nodeType==3?kn(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function dn(s,e,t,i){return t?pl(s,e,t,i,-1)||pl(s,e,t,i,1):!1}function si(s){for(var e=0;;e++)if(s=s.previousSibling,!s)return e}function vs(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}function pl(s,e,t,i,n){for(;;){if(s==t&&e==i)return!0;if(e==(n<0?0:Vt(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;e=si(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[e+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;e=n<0?Vt(s):0}else return!1}}function Vt(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function bs(s,e){let t=e?s.left:s.right;return{left:t,right:t,top:s.top,bottom:s.bottom}}function Hd(s){let e=s.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function rh(s,e){let t=e.width/s.offsetWidth,i=e.height/s.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-s.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-s.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Vd(s,e,t,i,n,r,o,l){let a=s.ownerDocument,h=a.defaultView||window;for(let c=s,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,g=1;if(d)u=Hd(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let x=c.getBoundingClientRect();({scaleX:p,scaleY:g}=rh(c,x)),u={left:x.left,right:x.left+c.clientWidth*p,top:x.top,bottom:x.top+c.clientHeight*g}}let y=0,b=0;if(n=="nearest")e.top0&&e.bottom>u.bottom+b&&(b=e.bottom-u.bottom+o)):e.bottom>u.bottom-o&&(b=e.bottom-u.bottom+o,t<0&&e.top-b0&&e.right>u.right+y&&(y=e.right-u.right+r)):e.right>u.right-r&&(y=e.right-u.right+r,t<0&&e.leftu.bottom||e.leftu.right)&&(e={left:Math.max(e.left,u.left),right:Math.min(e.right,u.right),top:Math.max(e.top,u.top),bottom:Math.min(e.bottom,u.bottom)}),c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function oh(s,e=!0){let t=s.ownerDocument,i=null,n=null;for(let r=s.parentNode;r&&!(r==t.body||(!e||i)&&n);)if(r.nodeType==1)!n&&r.scrollHeight>r.clientHeight&&(n=r),e&&!i&&r.scrollWidth>r.clientWidth&&(i=r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;return{x:i,y:n}}class $d{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?Vt(t):0),i,Math.min(e.focusOffset,i?Vt(i):0))}set(e,t,i,n){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=n}}let di=null;_.safari&&_.safari_version>=26&&(di=!1);function lh(s){if(s.setActive)return s.setActive();if(di)return s.focus(di);let e=[];for(let t=s;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(s.focus(di==null?{get preventScroll(){return di={preventScroll:!0},!0}}:void 0),!di){di=!1;for(let t=0;tMath.max(0,s.document.documentElement.scrollHeight-s.innerHeight-4):s.scrollTop>Math.max(1,s.scrollHeight-s.clientHeight-4)}function hh(s,e){for(let t=s,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=Vt(t)}else if(t.parentNode&&!vs(t))i=si(t),t=t.parentNode;else return null}}function ch(s,e){for(let t=s,i=e;;){if(t.nodeType==3&&i=t){if(l.level==i)return o;(r<0||(n!=0?n<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function dh(s,e){if(s.length!=e.length)return!1;for(let t=0;t=0;g-=3)if(St[g+1]==-d){let y=St[g+2],b=y&2?n:y&4?y&1?r:n:0;b&&(ae[f]=ae[St[g]]=b),l=g;break}}else{if(St.length==189)break;St[l++]=f,St[l++]=u,St[l++]=a}else if((p=ae[f])==2||p==1){let g=p==n;a=g?0:1;for(let y=l-3;y>=0;y-=3){let b=St[y+2];if(b&2)break;if(g)St[y+2]|=2;else{if(b&4)break;St[y+2]|=4}}}}}function Yd(s,e,t,i){for(let n=0,r=i;n<=t.length;n++){let o=n?t[n-1].to:s,l=na;)p==y&&(p=t[--g].from,y=g?t[g-1].to:s),ae[--p]=d;a=c}else r=h,a++}}}function zr(s,e,t,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=e,h=0;aa&&o.push(new Et(a,g.from,d));let y=g.direction==xi!=!(d%2);qr(s,y?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==t||(c?ae[p]!=l:ae[p]==l))break;p++}u?zr(s,a,p,i+1,n,u,o):ae;){let c=!0,f=!1;if(!h||a>r[h-1].to){let g=ae[a-1];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;e:for(;;)if(h&&p==r[h-1].to){if(f)break e;let g=r[--h];if(!c)for(let y=g.from,b=h;;){if(y==e)break e;if(b&&r[b-1].to==y)y=r[--b].from;else{if(ae[y-1]==l)break e;break}}if(u)u.push(g);else{g.toae.length;)ae[ae.length]=256;let i=[],n=e==xi?0:1;return qr(s,n,n,t,0,s.length,i),i}function ph(s){return[new Et(0,s,0)]}let gh="";function Qd(s,e,t,i,n){var r;let o=i.head-s.from,l=Et.find(e,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=e[l],h=a.side(n,t);if(o==h){let u=l+=n?1:-1;if(u<0||u>=e.length)return null;a=e[l=u],o=a.side(!n,t),h=a.side(n,t)}let c=Oe(s.text,o,a.forward(n,t));(ca.to)&&(c=h),gh=s.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(n?e.length-1:0)?null:e[l+(n?1:-1)];return f&&c==h&&f.level+(n?0:1)s.some(e=>e)}),ep=F.define({combine:s=>s.some(e=>e)}),Sh=F.define();class Fi{constructor(e,t,i,n,r,o=!1){this.range=e,this.y=t,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new Fi(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 Fi(S.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const zn=oe.define({map:(s,e)=>s.map(e)}),Ch=oe.define();function Ot(s,e,t){let i=s.facet(bh);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 Ft=F.define({combine:s=>s.length?s[0]:!0});let tp=0;const Ri=F.define({combine(s){return s.filter((e,t)=>{for(let i=0;i{let a=[];return o&&a.push(Vs.of(h=>{let c=h.plugin(l);return c?o(c):re.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return st.define((i,n)=>new e(i,n),t)}}class nr{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(Ot(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){Ot(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){Ot(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const Ah=F.define(),Co=F.define(),Vs=F.define(),Mh=F.define(),Ao=F.define(),Pn=F.define(),Th=F.define();function ml(s,e){let t=s.state.facet(Th);if(!t.length)return t;let i=t.map(r=>r instanceof Function?r(s):r),n=[];return ie.spans(i,e.from,e.to,{point(){},span(r,o,l,a){let h=r-e.from,c=o-e.from,f=n;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=Zd(e.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let g={from:h,to:c,direction:d,inner:[]};f.push(g),f=g.inner}}}}),n}const Dh=F.define();function Eh(s){let e=0,t=0,i=0,n=0;for(let r of s.state.facet(Dh)){let o=r(s);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:e,right:t,top:i,bottom:n}}const ln=F.define();class at{constructor(e,t,i,n){this.fromA=e,this.toA=t,this.fromB=i,this.toB=n}join(e){return new at(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 n=e[t-1];if(!(n.fromA>i.toA)){if(n.toAn.push(new at(r,o,l,a))),this.changedRanges=n}static create(e,t,i){return new ws(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 ip=[];class ye{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 ip}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&&_d(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 n of this.children){if(n==e)return i;i+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let i=si(this.dom),n=this.length?e>0:t>0;return new gt(this.parent.dom,i+(n?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 zs)return e;return null}static get(e){return e.cmTile}}class $s extends ye{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,n,r=(e==null?void 0:e.node)==t?e:null,o=0;for(let l of this.children){if(l.sync(e),o+=l.length+l.breakAfter,n=i?i.nextSibling:t.firstChild,r&&n!=l.dom&&(r.written=!0),l.dom.parentNode==t)for(;n&&n!=l.dom;)n=yl(n);else t.insertBefore(l.dom,n);i=l.dom}for(n=i?i.nextSibling:t.firstChild,r&&n&&(r.written=!0);n;)n=yl(n);this.length=o}}function yl(s){let e=s.nextSibling;return s.parentNode.removeChild(s),e}class zs extends $s{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=ye.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],i=this,n=0,r=0;;)if(n==i.children.length){if(!t.length)return;i=i.parent,i.breakAfter&&r++,n=t.pop()}else{let o=i.children[n++];if(o instanceof Wt)t.push(n),i=o,n=0;else{let l=r+o.length,a=e(o,r);if(a!==void 0)return a;r=l+o.breakAfter}}}resolveBlock(e,t){let i,n=-1,r,o=-1;if(this.blockTiles((l,a)=>{let h=a+l.length;if(e>=a&&e<=h){if(l.isWidget()&&t>=-1&&t<=1){if(l.flags&32)return!0;l.flags&16&&(i=void 0)}(ae||e==a&&(t>1?l.length:l.covers(-1)))&&(!r||!l.isWidget()&&r.isWidget())&&(r=l,o=e-a)}}),!i&&!r)throw new Error("No tile at position "+e);return i&&t<0||!r?{tile:i,offset:n}:{tile:r,offset:o}}}class Wt extends $s{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 Wt(t||document.createElement(e.tagName),e);return t||(i.flags|=4),i}}class $i extends $s{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,i){let n=new $i(t||document.createElement("div"),e);return(!t||!i)&&(n.flags|=4),n}get domAttrs(){return this.attrs}resolveInline(e,t,i){let n=null,r=-1,o=null,l=-1;function a(c,f){for(let u=0,d=0;u=f&&(p.isComposite()?a(p,f-d):(!o||o.isHidden&&(t>0||i&&sp(o,p)))&&(g>f||p.flags&32)?(o=p,l=f-d):(di&&(e=i);let n=e,r=e,o=0;e==0&&t<0||e==i&&t>=0?_.chrome||_.gecko||(e?(n--,o=1):r=0)?0:l.length-1];return _.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?bs(a,o<0):a||null}static of(e,t){let i=new gi(t||document.createTextNode(e),e);return t||(i.flags|=2),i}}class ki extends ye{constructor(e,t,i,n){super(e,t,n),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 n=this.widget.coordsAt(this.dom,e,t);if(n)return n;if(i)return bs(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let r=this.dom.getClientRects(),o=null;if(!r.length)return null;let l=this.flags&16?!0:this.flags&32?!1:e>0;for(let a=l?r.length-1:0;o=r[a],!(e>0?a==0:a==r.length-1||o.top0;)if(n.isComposite())if(o){if(!e)break;i&&i.break(),e--,o=!1}else if(r==n.children.length){if(!e&&!l.length)break;i&&i.leave(n),o=!!n.breakAfter,{tile:n,index:r}=l.pop(),r++}else{let a=n.children[r],h=a.breakAfter;(t>0?a.length<=e:a.length=0;l--){let a=t.marks[l],h=n.lastChild;if(h instanceof Ge&&h.mark.eq(a.mark))h.dom!=a.dom&&h.setDOM(sr(a.dom)),n=h;else{if(this.cache.reused.get(a)){let f=ye.get(a.dom);f&&f.setDOM(sr(a.dom))}let c=Ge.of(a.mark,a.dom);n.append(c),n=c}this.cache.reused.set(a,2)}let r=ye.get(e.text);r&&this.cache.reused.set(r,2);let o=new gi(e.text,e.text.nodeValue);o.flags|=8,this.pos=e.range.toB,n.append(o)}addInlineWidget(e,t,i){let n=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);n||this.flushBuffer();let r=this.ensureMarks(t,i);!n&&!(e.flags&16)&&r.append(this.getBuffer(1)),r.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=Oh);let n=$i.start(e,t||((i=this.cache.find($i))===null||i===void 0?void 0:i.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=n)}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 n=this.curLine;for(let r=e.length-1;r>=0;r--){let o=e[r],l;if(t>0&&(l=n.lastChild)&&l instanceof Ge&&l.mark.eq(o))n=l,t--;else{let a=Ge.of(o,(i=this.cache.find(Ge,h=>h.mark.eq(o)))===null||i===void 0?void 0:i.dom);n.append(a),n=a,t=0}}return n}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!vl(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(_.ios&&vl(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(rr,0,32)||new ki(rr.toDOM(),0,rr,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){let t=e.rank*102+e.value.rank,i=new op(e.from,e.to,e.value,t),n=this.wrappers.length;for(;n>0&&(this.wrappers[n-1].rank-i.rank||this.wrappers[n-1].to-i.to)<0;)n--;this.wrappers.splice(n,0,i)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let i of this.wrappers){let n=t.lastChild;if(i.fromo.wrapper.eq(i.wrapper)))===null||e===void 0?void 0:e.dom);t.append(r),t=r}}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(xs,void 0,1);return i&&(i.flags=t),i||new xs(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class ap{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:n,lineBreak:r,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=n;let l=this.textOff=Math.min(e,n.length);return r?null:n.slice(0,l)}let t=Math.min(this.text.length,this.textOff+e),i=this.text.slice(this.textOff,t);return this.textOff=t,i}}const ks=[ki,$i,gi,Ge,xs,Wt,zs];for(let s=0;s[]),this.index=ks.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 n=e.bucket,r=this.buckets[n],o=this.index[n];for(let l=r.length-1;l>=0;l--){let a=(l+o)%r.length,h=r[a];if((!t||t(h))&&!this.reused.has(h))return r.splice(a,1),a{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let i=t&&this.getCompositionContext(t.text);for(let n=0,r=0,o=0;;){let l=on){let h=a-n;this.preserve(h,!o,!l),n=a,r+=h}if(!l)break;t&&l.fromA<=t.range.fromA&&l.toA>=t.range.toA?(this.forward(l.fromA,t.range.fromA,t.range.fromA{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(a-l);else{let h=a>0||l{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ge&&n.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?n.length&&(n.length=r=0):o instanceof Ge&&(n.shift(),r=Math.min(r,n.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let i=null,n=this.builder,r=0,o=ie.spans(this.decorations,e,t,{point:(l,a,h,c,f,u)=>{if(h instanceof wi){if(this.disallowBlockEffectsFor[u]){if(h.block)throw new RangeError("Block decorations may not be specified via plugins");if(a>this.view.state.doc.lineAt(l).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(r=c.length,f>c.length)n.continueWidget(a-l);else{let d=h.widget||(h.block?zi.block:zi.inline),p=fp(h),g=this.cache.findWidget(d,a-l,p)||ki.of(d,this.view,a-l,p);h.block?(h.startSide>0&&n.addLineStartIfNotCovered(i),n.addBlockWidget(g)):(n.ensureLine(i),n.addInlineWidget(g,c,f))}i=null}else i=up(i,h);a>l&&this.text.skip(a-l)},span:(l,a,h,c)=>{for(let f=l;fr,this.openMarks=o}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 n=e.parentNode;;n=n.parentNode){let r=ye.get(n);if(n==this.view.contentDOM)break;r instanceof Ge?t.push(r):r!=null&&r.isLine()?i=r:r instanceof Wt||(n.nodeName=="DIV"&&!i&&n!=this.view.contentDOM?i=new $i(n,Oh):i||t.push(Ge.of(new Bn({tagName:n.nodeName.toLowerCase(),attributes:Fd(n)}),n)))}return{line:i,marks:t}}}function vl(s,e){let t=i=>{for(let n of i.children)if((e?n.isText():n.length)||t(n))return!0;return!1};return t(s)}function fp(s){let e=s.isReplace?(s.startSide<0?64:0)|(s.endSide>0?128:0):s.startSide>0?32:16;return s.block&&(e|=256),e}const Oh={class:"cm-line"};function up(s,e){let t=e.spec.attributes,i=e.spec.class;return!t&&!i||(s||(s={class:"cm-line"}),t&&bo(t,s),i&&(s.class+=" "+i)),s}function dp(s){let e=[];for(let t=s.parents.length;t>1;t--){let i=t==s.parents.length?s.tile:s.parents[t].tile;i instanceof Ge&&e.push(i.mark)}return e}function sr(s){let e=ye.get(s);return e&&e.setDOM(s.cloneNode()),s}class zi extends Yi{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}}zi.inline=new zi("span");zi.block=new zi("div");const rr=new class extends Yi{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class bl{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=re.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 zs(e,e.contentDOM),this.updateInner([new at(0,0,0,e.state.doc.length)],null)}update(e){var t;let i=e.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:c,toA:f})=>fthis.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 n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?n=this.domChanged.newSel.head:!kp(e.changes,this.hasComposition)&&!e.selectionSet&&(n=e.state.selection.main.head));let r=n>-1?gp(this.view,e.changes,n):null;if(this.domChanged=null,this.hasComposition){let{from:c,to:f}=this.hasComposition;i=new at(c,f,e.changes.mapPos(c,-1),e.changes.mapPos(f,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(_.ie||_.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.blockWrappers;this.updateDeco();let a=vp(o,this.decorations,e.changes);a.length&&(i=at.extendWithRanges(i,a));let h=wp(l,this.blockWrappers,e.changes);return h.length&&(i=at.extendWithRanges(i,h)),r&&!i.some(c=>c.fromA<=r.range.fromA&&c.toA>=r.range.toA)&&(i=r.range.addToSet(i.slice())),this.tile.flags&2&&i.length==0?!1:(this.updateInner(i,r),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 o=this.tile,l=new cp(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);t&&ye.get(t.text)&&l.cache.reused.set(ye.get(t.text),2),this.tile=l.run(e,t),Kr(o,l.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 r=_.chrome||_.ios?{node:i.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(r),r&&(r.written||i.selectionRange.focusNode!=r.node||!this.tile.dom.contains(r.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let n=[];if(this.view.viewport.from||this.view.viewport.to-1)&&un(i,this.view.observer.selectionRange)&&!(n&&i.contains(n));if(!(r||t||o))return;let l=this.forceSelection;this.forceSelection=!1;let a=this.view.state.selection.main,h,c;if(a.empty?c=h=this.inlineDOMNearPos(a.anchor,a.assoc||1):(c=this.inlineDOMNearPos(a.head,a.head==a.from?1:-1),h=this.inlineDOMNearPos(a.anchor,a.anchor==a.from?1:-1)),_.gecko&&a.empty&&!this.hasComposition&&pp(h)){let u=document.createTextNode("");this.view.observer.ignore(()=>h.node.insertBefore(u,h.node.childNodes[h.offset]||null)),h=c=new gt(u,0),l=!0}let f=this.view.observer.selectionRange;(l||!f.focusNode||(!dn(h.node,h.offset,f.anchorNode,f.anchorOffset)||!dn(c.node,c.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,a))&&(this.view.observer.ignore(()=>{_.android&&_.chrome&&i.contains(f.focusNode)&&xp(f.focusNode,i)&&(i.blur(),i.focus({preventScroll:!0}));let u=xn(this.view.root);if(u)if(a.empty){if(_.gecko){let d=mp(h.node,h.offset);if(d&&d!=3){let p=(d==1?hh:ch)(h.node,h.offset);p&&(h=new gt(p.node,p.offset))}}u.collapse(h.node,h.offset),a.bidiLevel!=null&&u.caretBidiLevel!==void 0&&(u.caretBidiLevel=a.bidiLevel)}else if(u.extend){u.collapse(h.node,h.offset);try{u.extend(c.node,c.offset)}catch{}}else{let d=document.createRange();a.anchor>a.head&&([h,c]=[c,h]),d.setEnd(c.node,c.offset),d.setStart(h.node,h.offset),u.removeAllRanges(),u.addRange(d)}o&&this.view.root.activeElement==i&&(i.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(h,c)),this.impreciseAnchor=h.precise?null:new gt(f.anchorNode,f.anchorOffset),this.impreciseHead=c.precise?null:new gt(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&dn(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=xn(e.root),{anchorNode:n,anchorOffset:r}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),h=this.coordsAt(t.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(t.head+t.assoc,t.assoc);i.collapse(c.node,c.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&i.collapse(n,r)}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 n=i.posAtStart;if(i.isComposite()){let r;if(e==i.dom)r=i.dom.childNodes[t];else{let o=Vt(e)==0?0:t==0?-1:1;for(;;){let l=e.parentNode;if(l==i.dom)break;o==0&&l.firstChild!=l.lastChild&&(e==l.firstChild?o=-1:o=1),e=l}o<0?r=e:r=e.nextSibling}if(r==i.dom.firstChild)return n;for(;r&&!ye.get(r);)r=r.nextSibling;if(!r)return n+i.length;for(let o=0,l=n;;o++){let a=i.children[o];if(a.dom==r)return l;l+=a.length+a.breakAfter}}else return i.isText()?e==i.dom?n+t:n+(t?i.length:0):n}domAtPos(e,t){let{tile:i,offset:n}=this.tile.resolveBlock(e,t);return i.isWidget()?i.domPosFor(e,t):i.domIn(n,t)}inlineDOMNearPos(e,t){let i,n=-1,r=!1,o,l=-1,a=!1;return this.tile.blockTiles((h,c)=>{if(h.isWidget()){if(h.flags&32&&c>=e)return!0;h.flags&16&&(r=!0)}else{let f=c+h.length;if(c<=e&&(i=h,n=e-c,r=f=e&&!o&&(o=h,l=e-c,a=c>e),c>e&&o)return!0}}),!i&&!o?this.domAtPos(e,t):(r&&o?i=null:a&&i&&(o=null),i&&t<0||!o?i.domIn(n,t):o.domIn(l,t))}coordsAt(e,t){let{tile:i,offset:n}=this.tile.resolveBlock(e,t);return i.isWidget()?i.widget instanceof or?null:i.coordsInWidget(n,t,!0):i.coordsIn(n,t)}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 n(r,o){if(r.isComposite())for(let l of r.children){if(l.length>=o){let a=n(l,o);if(a)return a}if(o-=l.length,o<0)break}else if(r.isText()&&oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==pe.LTR,h=0,c=(f,u,d)=>{for(let p=0;pn);p++){let g=f.children[p],y=u+g.length,b=g.dom.getBoundingClientRect(),{height:x}=b;if(d&&!p&&(h+=b.top-d.top),g instanceof Wt)y>i&&c(g,u,b);else if(u>=i&&(h>0&&t.push(-h),t.push(x+h),h=0,o)){let T=g.dom.lastChild,D=T?as(T):[];if(D.length){let A=D[D.length-1],P=a?A.right-b.left:b.right-A.left;P>l&&(l=P,this.minWidth=r,this.minWidthFrom=u,this.minWidthTo=y)}}d&&p==f.children.length-1&&(h+=d.bottom-b.bottom),u=y+g.breakAfter}};return c(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?pe.RTL:pe.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let l=0,a;for(let h of o.children){if(!h.isText()||/[^ -~]/.test(h.text))return;let c=as(h.dom);if(c.length!=1)return;l+=c[0].width,a=c[0].height}if(l)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:l/o.length,textHeight:a}}});if(e)return e;let t=document.createElement("div"),i,n,r;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 o=as(t.firstChild)[0];i=t.getBoundingClientRect().height,n=o&&o.width?o.width/27:7,r=o&&o.height?o.height:i,t.remove()}),{lineHeight:i,charWidth:n,textHeight:r}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,n=0;;n++){let r=n==t.viewports.length?null:t.viewports[n],o=r?r.from-1:this.view.state.doc.length;if(o>i){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(re.replace({widget:new or(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return re.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Vs).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),i=!1,n=this.view.state.facet(Ao).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(n.length&&(this.dynamicDecorationMap[e++]=i,t.push(ie.join(n))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];etypeof r=="function"?r(this.view):r)}scrollIntoView(e){var t;if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(Sh))try{if(c(this.view,e.range,e))return!0}catch(f){Ot(this.view.state,f,"scroll handler")}let{range:i}=e,n=this.coordsAt(i.head,(t=i.assoc)!==null&&t!==void 0?t:i.empty?0:i.head>i.anchor?-1:1),r;if(!n)return;!i.empty&&(r=this.coordsAt(i.anchor,i.anchor>i.head?-1:1))&&(n={left:Math.min(n.left,r.left),top:Math.min(n.top,r.top),right:Math.max(n.right,r.right),bottom:Math.max(n.bottom,r.bottom)});let o=Eh(this.view),l={left:n.left-o.left,top:n.top-o.top,right:n.right+o.right,bottom:n.bottom+o.bottom},{offsetWidth:a,offsetHeight:h}=this.view.scrollDOM;if(Vd(this.view.scrollDOM,l,i.head1&&(n.top>window.pageYOffset+window.visualViewport.offsetTop+window.visualViewport.height||n.bottomi.isWidget()||i.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Kr(this.tile)}}function Kr(s,e){let t=e==null?void 0:e.get(s);if(t!=1){t==null&&s.destroy();for(let i of s.children)Kr(i,e)}}function pp(s){return s.node.nodeType==1&&s.node.firstChild&&(s.offset==0||s.node.childNodes[s.offset-1].contentEditable=="false")&&(s.offset==s.node.childNodes.length||s.node.childNodes[s.offset].contentEditable=="false")}function Lh(s,e){let t=s.observer.selectionRange;if(!t.focusNode)return null;let i=hh(t.focusNode,t.focusOffset),n=ch(t.focusNode,t.focusOffset),r=i||n;if(n&&i&&n.node!=i.node){let l=ye.get(n.node);if(!l||l.isText()&&l.text!=n.node.nodeValue)r=n;else if(s.docView.lastCompositionAfterCursor){let a=ye.get(i.node);!a||a.isText()&&a.text!=i.node.nodeValue||(r=n)}}if(s.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=e-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function gp(s,e,t){let i=Lh(s,t);if(!i)return null;let{node:n,from:r,to:o}=i,l=n.nodeValue;if(/[\n\r]/.test(l)||s.state.doc.sliceString(i.from,i.to)!=l)return null;let a=e.invertedDesc;return{range:new at(a.mapPos(r),a.mapPos(o),r,o),text:n}}function mp(s,e){return s.nodeType!=1?0:(e&&s.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}class or extends Yi{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 Sp(s,e,t=1){let i=s.charCategorizer(e),n=s.doc.lineAt(e),r=e-n.from;if(n.length==0)return S.cursor(e);r==0?t=1:r==n.length&&(t=-1);let o=r,l=r;t<0?o=Oe(n.text,r,!1):l=Oe(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let h=Oe(n.text,o,!1);if(i(n.text.slice(h,o))!=a)break;o=h}for(;ls.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-t.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(t.from,t.to);return t.from+Ld(o,r,s.state.tabSize)}function Ap(s,e,t){let i=s.lineBlockAt(e);if(Array.isArray(i.type)){let n;for(let r of i.type){if(r.from>e)break;if(!(r.toe)return r;(!n||r.type==Ye.Text&&(n.type!=r.type||(t<0?r.frome)))&&(n=r)}}return n||i}return i}function Mp(s,e,t,i){let n=Ap(s,e.head,e.assoc||-1),r=!i||n.type!=Ye.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(e.assoc<0&&e.head>n.from?e.head-1:e.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:t==(l==pe.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return S.cursor(a,t?-1:1)}return S.cursor(t?n.to:n.from,t?-1:1)}function wl(s,e,t,i){let n=s.state.doc.lineAt(e.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=e,a=null;;){let h=Qd(n,r,o,l,t),c=gh;if(!h){if(n.number==(t?s.state.doc.lines:1))return l;c=` +`,n=s.state.doc.line(n.number+(t?1:-1)),r=s.bidiSpans(n),h=s.visualLineSide(n,!t)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Tp(s,e,t){let i=s.state.charCategorizer(e),n=i(t);return r=>{let o=i(r);return n==Ne.Space&&(n=o),n==o}}function Dp(s,e,t,i){let n=e.head,r=t?1:-1;if(n==(t?s.state.doc.length:0))return S.cursor(n,e.assoc);let o=e.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),h=s.coordsAtPos(n,e.assoc||((e.empty?t:e.head==e.from)?1:-1)),c=s.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let p=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-p.from))),l=(r<0?p.top:p.bottom)+c}let f=a.left+o,u=s.viewState.heightOracle.textHeight>>1,d=i??u;for(let p=0;;p+=u){let g=l+(d+p)*r,y=jr(s,{x:f,y:g},!1,r);if(t?g>a.bottom:gl:x{if(e>r&&en(s)),t.from,e.head>t.from?-1:1);return i==t.from?t:S.cursor(i,is.viewState.docHeight)return new Dt(s.state.doc.length,-1);if(h=s.elementAtHeight(a),i==null)break;if(h.type==Ye.Text){if(i<0?h.tos.viewport.to)break;let u=s.docView.coordsAt(i<0?h.from:h.to,i>0?-1:1);if(u&&(i<0?u.top<=a+r:u.bottom>=a+r))break}let f=s.viewState.heightOracle.textHeight/2;a=i>0?h.bottom+f:h.top-f}if(s.viewport.from>=h.to||s.viewport.to<=h.from){if(t)return null;if(h.type==Ye.Text){let f=Cp(s,n,h,o,l);return new Dt(f,f==h.from?1:-1)}}if(h.type!=Ye.Text)return a<(h.top+h.bottom)/2?new Dt(h.from,1):new Dt(h.to,-1);let c=s.docView.lineAt(h.from,2);return(!c||c.length!=h.length)&&(c=s.docView.lineAt(h.from,-2)),new Ep(s,o,l,s.textDirectionAt(h.from)).scanTile(c,h.from)}class Ep{constructor(e,t,i,n){this.view=e,this.x=t,this.y=i,this.baseDir=n,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to1||i.length&&(i[0].level!=this.baseDir||i[0].to+n.from>1;t:if(o.has(g)){let b=n+Math.floor(Math.random()*p);for(let x=0;x1)){if(x.bottomthis.y)(!h||h.top>x.top)&&(h=x),T=-1;else{let D=x.left>this.x?this.x-x.left:x.right(p+p+g)/3)return this.y=a.bottom-1,this.scan(e,t,!0);if(h&&h.top<(p+g+g)/3)return this.y=h.top+1,this.scan(e,t,!0)}let d=(l?this.dirAt(e[c],1):this.baseDir)==pe.LTR;return{i:c,after:this.x>(u.left+u.right)/2==d}}scanText(e,t){let i=[];for(let r=0;r{let o=i[r]-t,l=i[r+1]-t;return kn(e.dom,o,l).getClientRects()});return n.after?new Dt(i[n.i+1],-1):new Dt(i[n.i],1)}scanTile(e,t){if(!e.length)return new Dt(t,1);if(e.children.length==1){let l=e.children[0];if(l.isText())return this.scanText(l,t);if(l.isComposite())return this.scanTile(l,t)}let i=[t];for(let l=0,a=t;l{let a=e.children[l];return a.flags&48?null:(a.dom.nodeType==1?a.dom:kn(a.dom,0,a.length)).getClientRects()}),r=e.children[n.i],o=i[n.i];return r.isText()?this.scanText(r,o):r.isComposite()?this.scanTile(r,o):n.after?new Dt(i[n.i+1],-1):new Dt(o,1)}}const Ei="￿";class Op{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(se.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Ei}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let n=e;;){this.findPointBefore(i,n);let r=this.text.length;this.readNode(n);let o=ye.get(n),l=n.nextSibling;if(l==t){o!=null&&o.breakAfter&&!l&&i!=this.view.contentDOM&&this.lineBreak();break}let a=ye.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:vs(n))||vs(l)&&(n.nodeName!="BR"||o!=null&&o.isWidget())&&this.text.length>r)&&!Bp(l,t)&&this.lineBreak(),n=l}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,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){let t=ye.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.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+(Lp(e,i.node,i.offset)?t:0))}}function Lp(s,e,t){for(;;){if(!e||t-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView,l=e.state.selection;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Rh(e.docView.tile,t,i,0))){let a=r||o?[]:Ip(e),h=new Op(a,e);h.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=h.text,this.newSel=Np(a,this.bounds.from)}else{let a=e.observer.selectionRange,h=r&&r.node==a.focusNode&&r.offset==a.focusOffset||!Vr(e.contentDOM,a.focusNode)?l.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Vr(e.contentDOM,a.anchorNode)?l.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),f=e.viewport;if((_.ios||_.chrome)&&l.main.empty&&h!=c&&(f.from>0||f.to-1&&l.ranges.length>1)this.newSel=l.replaceRange(S.range(c,h));else if(e.lineWrapping&&c==h&&!(l.main.empty&&l.main.head==h)&&e.inputState.lastTouchTime>Date.now()-100){let u=e.coordsAtPos(h,-1),d=0;u&&(d=e.inputState.lastTouchY<=u.bottom?-1:1),this.newSel=S.create([S.cursor(h,d)])}else this.newSel=S.single(c,h)}}}function Rh(s,e,t,i){if(s.isComposite()){let n=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;at)return Rh(f,e,t,h);if(u>=e&&n==-1&&(n=a,r=h),h>t&&f.dom.parentNode==s.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+s.length:l,startDOM:(n?s.children[n-1].dom.nextSibling:null)||s.dom.firstChild,endDOM:o=0?s.children[o].dom:null}}else return s.isText()?{from:i,to:i+s.length,startDOM:s.dom,endDOM:s.dom.nextSibling}:null}function Ph(s,e){let t,{newSel:i}=e,{state:n}=s,r=n.selection.main,o=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:a}=e.bounds,h=r.from,c=null;(o===8||_.android&&e.text.length=l&&r.to<=a&&(e.typeOver||f!=e.text)&&f.slice(0,r.from-l)==e.text.slice(0,r.from-l)&&f.slice(r.to-l)==e.text.slice(u=e.text.length-(f.length-(r.to-l)))?t={from:r.from,to:r.to,insert:ne.of(e.text.slice(r.from-l,u).split(Ei))}:(d=Ih(f,e.text,h-l,c))&&(_.chrome&&o==13&&d.toB==d.from+2&&e.text.slice(d.from,d.toB)==Ei+Ei&&d.toB--,t={from:l+d.from,to:l+d.toA,insert:ne.of(e.text.slice(d.from,d.toB).split(Ei))})}else i&&(!s.hasFocus&&n.facet(Ft)||Ss(i,r))&&(i=null);if(!t&&!i)return!1;if((_.mac||_.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:t.from,to:t.to,insert:ne.of([t.insert.toString().replace("."," ")])}):n.doc.lineAt(r.from).toDate.now()-50?t={from:r.from,to:r.to,insert:n.toText(s.inputState.insertingText)}:_.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` + `&&s.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:ne.of([" "])}),t)return Mo(s,t,i,o);if(i&&!Ss(i,r)){let l=!1,a="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(l=!0),a=s.inputState.lastSelectionOrigin,a=="select.pointer"&&(i=Bh(n.facet(Pn).map(h=>h(s)),i))),s.dispatch({selection:i,scrollIntoView:l,userEvent:a}),!0}else return!1}function Mo(s,e,t,i=-1){if(_.ios&&s.inputState.flushIOSKey(e))return!0;let n=s.state.selection.main;if(_.android&&(e.to==n.to&&(e.from==n.from||e.from==n.from-1&&s.state.sliceDoc(e.from,n.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&_i(s.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||i==8&&e.insert.lengthn.head)&&_i(s.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&_i(s.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,l=()=>o||(o=Pp(s,e,t));return s.state.facet(wh).some(a=>a(s,e.from,e.to,r,l))||s.dispatch(l()),!0}function Pp(s,e,t){let i,n=s.state,r=n.selection.main,o=-1;if(e.from==e.to&&e.fromr.to){let a=e.fromf(s)),h,a);e.from==c&&(o=c)}if(o>-1)i={changes:e,selection:S.cursor(e.from+e.insert.length,-1)};else if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&s.inputState.composing<0){let a=r.frome.to?n.sliceDoc(e.to,r.to):"";i=n.replaceSelection(s.state.toText(a+e.insert.sliceString(0,void 0,s.state.lineBreak)+h))}else{let a=n.changes(e),h=t&&t.main.to<=a.newLength?t.main:void 0;if(n.selection.ranges.length>1&&(s.inputState.composing>=0||s.inputState.compositionPendingChange)&&e.to<=r.to+10&&e.to>=r.to-10){let c=s.state.sliceDoc(e.from,e.to),f,u=t&&Lh(s,t.main.head);if(u){let p=e.insert.length-(e.to-e.from);f={from:u.from,to:u.to-p}}else f=s.state.doc.lineAt(r.head);let d=r.to-e.to;i=n.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:a,range:h||p.map(a)};let g=p.to-d,y=g-c.length;if(s.state.sliceDoc(y,g)!=c||g>=f.from&&y<=f.to)return{range:p};let b=n.changes({from:y,to:g,insert:e.insert}),x=p.to-r.to;return{changes:b,range:h?S.range(Math.max(0,h.anchor+x),Math.max(0,h.head+x)):p.map(b)}})}else i={changes:a,selection:h&&n.selection.replaceRange(h)}}let l="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,l+=".compose",s.inputState.compositionFirstChange&&(l+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:l,scrollIntoView:!0})}function Ih(s,e,t,i){let n=Math.min(s.length,e.length),r=0;for(;r0&&l>0&&s.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Ip(s){let e=[];if(s.root.activeElement!=s.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return t&&(e.push(new xl(t,i)),(n!=t||r!=i)&&e.push(new xl(n,r))),e}function Np(s,e){if(s.length==0)return null;let t=s[0].pos,i=s.length==2?s[1].pos:t;return t>-1&&i>-1?S.single(t+e,i+e):null}function Ss(s,e){return e.head==s.main.head&&e.anchor==s.main.anchor}class _p{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,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.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,_.safari&&e.contentDOM.addEventListener("input",()=>null),_.gecko&&Qp(e.contentDOM.ownerDocument)}handleEvent(e){!Up(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 n of i.observers)n(this.view,t);for(let n of i.handlers){if(t.defaultPrevented)break;if(n(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Fp(e),i=this.handlers,n=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!t[r]&&n.removeEventListener(r,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&&_h.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),_.android&&_.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return _.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&!e.shiftKey&&((t=Nh.find(i=>i.keyCode==e.keyCode))&&!e.ctrlKey||Wp.indexOf(e.key)>-1&&e.ctrlKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:_.safari&&!_.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 kl(s,e){return(t,i)=>{try{return e.call(s,i,t)}catch(n){Ot(t.state,n)}}}function Fp(s){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec,r=n&&n.plugin.domEventHandlers,o=n&&n.plugin.domEventObservers;if(r)for(let l in r){let a=r[l];a&&t(l).handlers.push(kl(i.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(kl(i.value,a))}}for(let i in yt)t(i).handlers.push(yt[i]);for(let i in Xe)t(i).observers.push(Xe[i]);return e}const Nh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],Wp="dthko",_h=[16,17,18,20,91,92,224,225],qn=6;function Un(s){return Math.max(0,s)*.7+8}function Hp(s,e){return Math.max(Math.abs(s.clientX-e.clientX),Math.abs(s.clientY-e.clientY))}class Vp{constructor(e,t,i,n){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=oh(e.contentDOM),this.atoms=e.state.facet(Pn).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(se.allowMultipleSelections)&&$p(e,t),this.dragging=qp(e,t)&&Hh(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&&Hp(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,i=0,n=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Eh(this.view);e.clientX-a.left<=n+qn?t=-Un(n-e.clientX):e.clientX+a.right>=o-qn&&(t=Un(e.clientX-o)),e.clientY-a.top<=r+qn?i=-Un(r-e.clientY):e.clientY+a.bottom>=l-qn&&(i=Un(e.clientY-l)),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=Bh(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 $p(s,e){let t=s.state.facet(mh);return t.length?t[0](e):_.mac?e.metaKey:e.ctrlKey}function zp(s,e){let t=s.state.facet(yh);return t.length?t[0](e):_.mac?!e.altKey:!e.ctrlKey}function qp(s,e){let{main:t}=s.state.selection;if(t.empty)return!1;let i=xn(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function Up(s,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=s.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=ye.get(t))&&i.isWidget()&&!i.isHidden&&i.widget.ignoreEvent(e))return!1;return!0}const yt=Object.create(null),Xe=Object.create(null),Fh=_.ie&&_.ie_version<15||_.ios&&_.webkit_version<604;function Kp(s){let e=s.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{s.focus(),t.remove(),Wh(s,t.value)},50)}function qs(s,e,t){for(let i of s.facet(e))t=i(t,s);return t}function Wh(s,e){e=qs(s.state,ko,e);let{state:t}=s,i,n=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(Gr!=null&&t.selection.ranges.every(a=>a.empty)&&Gr==r.toString()){let a=-1;i=t.changeByRange(h=>{let c=t.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=t.toText((o?r.line(n++).text:e)+t.lineBreak);return{changes:{from:c.from,insert:f},range:S.cursor(h.from+f.length)}})}else o?i=t.changeByRange(a=>{let h=r.line(n++);return{changes:{from:a.from,to:a.to,insert:h.text},range:S.cursor(a.from+h.length)}}):i=t.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Xe.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};Xe.wheel=Xe.mousewheel=s=>{s.inputState.lastWheelEvent=Date.now()};yt.keydown=(s,e)=>(s.inputState.setSelectionOrigin("select"),e.keyCode==27&&s.inputState.tabFocusMode!=0&&(s.inputState.tabFocusMode=Date.now()+2e3),!1);Xe.touchstart=(s,e)=>{let t=s.inputState,i=e.targetTouches[0];t.lastTouchTime=Date.now(),i&&(t.lastTouchX=i.clientX,t.lastTouchY=i.clientY),t.setSelectionOrigin("select.pointer")};Xe.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};yt.mousedown=(s,e)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of s.state.facet(vh))if(t=i(s,e),t)break;if(!t&&e.button==0&&(t=Gp(s,e)),t){let i=!s.hasFocus;s.inputState.startMouseSelection(new Vp(s,e,t,i)),i&&s.observer.ignore(()=>{lh(s.contentDOM);let r=s.root.activeElement;r&&!r.contains(s.contentDOM)&&r.blur()});let n=s.inputState.mouseSelection;if(n)return n.start(e),n.dragging===!1}else s.inputState.setSelectionOrigin("select.pointer");return!1};function Sl(s,e,t,i){if(i==1)return S.cursor(e,t);if(i==2)return Sp(s.state,e,t);{let n=s.docView.lineAt(e,t),r=s.state.doc.lineAt(n?n.posAtEnd:e),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return lDate.now()-400&&Math.abs(e.clientX-s.clientX)<2&&Math.abs(e.clientY-s.clientY)<2?(Al+1)%3:1}function Gp(s,e){let t=s.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),i=Hh(e),n=s.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),n=n.map(r.changes))},get(r,o,l){let a=s.posAndSideAtCoords({x:r.clientX,y:r.clientY},!1),h,c=Sl(s,a.pos,a.assoc,i);if(t.pos!=a.pos&&!o){let f=Sl(s,t.pos,t.assoc,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u1&&(h=Jp(n,a.pos))?h:l?n.addRange(c):S.create([c])}}}function Jp(s,e){for(let t=0;t=e)return S.create(s.ranges.slice(0,t).concat(s.ranges.slice(t+1)),s.mainIndex==t?0:s.mainIndex-(s.mainIndex>t?1:0))}return null}yt.dragstart=(s,e)=>{let{selection:{main:t}}=s.state;if(e.target.draggable){let n=s.docView.tile.nearest(e.target);if(n&&n.isWidget()){let r=n.posAtStart,o=r+n.length;(r>=t.to||o<=t.from)&&(t=S.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",qs(s.state,So,s.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};yt.dragend=s=>(s.inputState.draggedContent=null,!1);function Tl(s,e,t,i){if(t=qs(s.state,ko,t),!t)return;let n=s.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&zp(s,e)?{from:r.from,to:r.to}:null,l={from:n,insert:t},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}yt.drop=(s,e)=>{if(!e.dataTransfer)return!1;if(s.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),n=0,r=()=>{++n==t.length&&Tl(s,e,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return Tl(s,e,i,!0),!0}return!1};yt.paste=(s,e)=>{if(s.state.readOnly)return!0;s.observer.flush();let t=Fh?null:e.clipboardData;return t?(Wh(s,t.getData("text/plain")||t.getData("text/uri-list")),!0):(Kp(s),!1)};function Yp(s,e){let t=s.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(),s.focus()},50)}function Xp(s){let e=[],t=[],i=!1;for(let n of s.selection.ranges)n.empty||(e.push(s.sliceDoc(n.from,n.to)),t.push(n));if(!e.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(e.push(o.text),t.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:qs(s,So,e.join(s.lineBreak)),ranges:t,linewise:i}}let Gr=null;yt.copy=yt.cut=(s,e)=>{if(!un(s.contentDOM,s.observer.selectionRange))return!1;let{text:t,ranges:i,linewise:n}=Xp(s.state);if(!t&&!n)return!1;Gr=n?t:null,e.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=Fh?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Yp(s,t),!1)};const Vh=ai.define();function $h(s,e){let t=[];for(let i of s.facet(xh)){let n=i(s,e);n&&t.push(n)}return t.length?s.update({effects:t,annotations:Vh.of(!0)}):null}function zh(s){setTimeout(()=>{let e=s.hasFocus;if(e!=s.inputState.notifiedFocused){let t=$h(s.state,e);t?s.dispatch(t):s.update([])}},10)}Xe.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),zh(s)};Xe.blur=s=>{s.observer.clearSelectionRange(),zh(s)};Xe.compositionstart=Xe.compositionupdate=s=>{s.observer.editContext||(s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0))};Xe.compositionend=s=>{s.observer.editContext||(s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,_.chrome&&_.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50))};Xe.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};yt.beforeinput=(s,e)=>{var t,i;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(s.inputState.insertingText=e.data,s.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&s.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],a=s.posAtDOM(l.startContainer,l.startOffset),h=s.posAtDOM(l.endContainer,l.endOffset);return Mo(s,{from:a,to:h,insert:s.state.toText(r)},null),!0}}let n;if(_.chrome&&_.android&&(n=Nh.find(r=>r.inputType==e.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return _.ios&&e.inputType=="deleteContentForward"&&s.observer.flushSoon(),_.safari&&e.inputType=="insertText"&&s.inputState.composing>=0&&setTimeout(()=>Xe.compositionend(s,e),20),!1};const Dl=new Set;function Qp(s){Dl.has(s)||(Dl.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const El=["pre-wrap","normal","pre-line","break-spaces"];let qi=!1;function Ol(){qi=!1}class Zp{constructor(e){this.lineWrapping=e,this.doc=ne.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 El.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let h=0;h0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>hs&&(qi=!0),this.height=e)}replace(e,t,i){return Ue.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=n[l],u=r.lineAt(a,fe.ByPosNoHeight,i.setDoc(t),0,0),d=u.to>=h?u:r.lineAt(h,fe.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,c=n[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=e[i];l.break?e.splice(i,1,l.left,null,l.right):e.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n=r&&o(this.lineAt(0,fe.ByPos,i,n,r))}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,n){return n&&n.from<=t&&n.more&&this.setMeasuredHeight(n),this.outdated=!1,this}toString(){return`block(${this.length})`}}class tt extends qh{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 pt(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,i){let n=i[0];return i.length==1&&(n instanceof tt||n instanceof Re&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof Re?n=new tt(n.length,this.height,this.spaceAbove):n.height=this.height,this.outdated||(n.outdated=!1),n):Ue.of(i)}updateHeight(e,t=0,i=!1,n){return n&&n.from<=t&&n.more?this.setMeasuredHeight(n):(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 Re extends Ue{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,n=e.doc.lineAt(t+this.length).number,r=n-i+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(e,t,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,n);if(t.lineWrapping){let h=n+(e0){let r=i[i.length-1];r instanceof Re?i[i.length-1]=new Re(r.length+n):i.push(null,new Re(n-1))}if(e>0){let r=i[0];r instanceof Re?i[0]=new Re(e+r.length):i.unshift(new Re(e-1),null)}return Ue.of(i)}decomposeLeft(e,t){t.push(new Re(e-1),null)}decomposeRight(e,t){t.push(null,new Re(this.length-e-1))}updateHeight(e,t=0,i=!1,n){let r=t+this.length;if(n&&n.from<=t+this.length&&n.more){let o=[],l=Math.max(t,n.from),a=-1;for(n.from>t&&o.push(new Re(n.from-t-1).updateHeight(e,t));l<=r&&n.more;){let c=e.doc.lineAt(l).length;o.length&&o.push(null);let f=n.heights[n.index++],u=0;f<0&&(u=-f,f=n.heights[n.index++]),a==-1?a=f:Math.abs(f-a)>=hs&&(a=-2);let d=new tt(c,f,u);d.outdated=!1,o.push(d),l+=c+1}l<=r&&o.push(null,new Re(r-l).updateHeight(e,l));let h=Ue.of(o);return(a<0||Math.abs(h.height-this.height)>=hs||Math.abs(a-this.heightMetrics(e,t).perLine)>=hs)&&(qi=!0),Cs(this,h)}else(i||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class ig extends Ue{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,n){let r=i+this.left.height;return el))return h;let c=t==fe.ByPosNoHeight?fe.ByPosNoHeight:fe.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,n,r).join(h)}forEachLine(e,t,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,l,a,o);else{let h=this.lineAt(a,fe.ByPos,i,n,r);e=e&&h.from<=t&&o(h),t>h.to&&this.right.forEachLine(h.to+1,t,i,l,a,o)}}replace(e,t,i){let n=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-n,t-n,i));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of i)r.push(l);if(e>0&&Ll(r,o-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,n=i+this.break;if(e>=n)return this.right.decomposeRight(e-n,t);e2*t.size||t.size>2*e.size?Ue.of(this.break?[e,null,t]:[e,t]):(this.left=Cs(this.left,e),this.right=Cs(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,n){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return n&&n.from<=t+r.length&&n.more?a=r=r.updateHeight(e,t,i,n):r.updateHeight(e,t,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(e,l,i,n):o.updateHeight(e,l,i),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ll(s,e){let t,i;s[e]==null&&(t=s[e-1])instanceof Re&&(i=s[e+1])instanceof Re&&s.splice(e-1,3,new Re(t.length+1+i.length))}const ng=5;class To{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),n=this.nodes[this.nodes.length-1];n instanceof tt?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new tt(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=ng)&&this.addLineDeco(n,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new tt(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let i=new Re(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 tt)return e;let t=new tt(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 n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,e),n.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 tt)&&!this.isCovered?this.nodes.push(new tt(0,-1,0)):(this.writtenToc.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(h==s.parentNode?n.innerHeight:a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function lg(s){let e=s.getBoundingClientRect(),t=s.ownerDocument.defaultView||window;return e.left0&&e.top0}function ag(s,e){let t=s.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class ar{constructor(e,t,i,n){this.from=e,this.to=t,this.size=i,this.displaySize=n}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new Zp(i),this.stateDeco=Pl(t),this.heightMap=Ue.empty().applyChanges(this.stateDeco,ne.empty,this.heightOracle.setDoc(t.doc),[new at(0,0,0,t.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=re.set(this.lineGaps.map(n=>n.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 n=i?t.head:t.anchor;if(!e.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);e.push(new Kn(r,o))}}return this.viewports=e.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Rl:new Do(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(an(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=Pl(this.state);let n=e.changedRanges,r=at.extendWithRanges(n,sg(i,this.stateDeco,e?e.changes:Ce.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollOffset);Ol(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||qi)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(h||!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(ep)&&(this.mustEnforceCursorAssoc=!0)}measure(){let{view:e}=this,t=e.contentDOM,i=window.getComputedStyle(t),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?pe.RTL:pe.LTR;let o=this.heightOracle.mustRefreshForWrapping(r)||this.mustMeasureContent==="refresh",l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:A,scaleY:P}=rh(t,l);(A>.005&&Math.abs(this.scaleX-A)>.005||P>.005&&Math.abs(this.scaleY-P)>.005)&&(this.scaleX=A,this.scaleY=P,h|=16,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,h|=16);let d=oh(this.view.contentDOM,!1).y;d!=this.scrollParent&&(this.scrollParent=d,this.scrollAnchorHeight=-1,this.scrollOffset=0);let p=this.getScrollOffset();this.scrollOffset!=p&&(this.scrollAnchorHeight=-1,this.scrollOffset=p),this.scrolledToBottom=ah(this.scrollParent||e.win);let g=(this.printing?ag:og)(t,this.paddingTop),y=g.top-this.pixelViewport.top,b=g.bottom-this.pixelViewport.bottom;this.pixelViewport=g;let x=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(x!=this.inView&&(this.inView=x,x&&(a=!0)),!this.inView&&!this.scrollTarget&&!lg(e.dom))return 0;let T=l.width;if((this.contentDOMWidth!=T||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,h|=16),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(A)&&(o=!0),o||n.lineWrapping&&Math.abs(T-this.contentDOMWidth)>n.charWidth){let{lineHeight:P,charWidth:C,textHeight:U}=e.docView.measureTextSize();o=P>0&&n.refresh(r,P,C,U,Math.max(5,T/C),A),o&&(e.docView.minWidth=0,h|=16)}y>0&&b>0?c=Math.max(y,b):y<0&&b<0&&(c=Math.min(y,b)),Ol();for(let P of this.viewports){let C=P.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(P);this.heightMap=(o?Ue.empty().applyChanges(this.stateDeco,ne.empty,this.heightOracle,[new at(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new eg(P.from,C))}qi&&(h|=2)}let D=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return D&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||D)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),h}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)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Kn(n.lineAt(o-i*1e3,fe.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,fe.ByHeight,r,0,0).to);if(t){let{head:h}=t.range;if(ha.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=n.lineAt(h,fe.ByPos,r,0,0),u;t.y=="center"?u=(f.top+f.bottom)/2-c/2:t.y=="start"||t.y=="nearest"&&h=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r>1,o=n<<1;if(this.defaultTextDirection!=pe.LTR&&!i)return[];let l=[],a=(c,f,u,d)=>{if(f-cc&&bb.from>=u.from&&b.to<=u.to&&Math.abs(b.from-c)b.fromx));if(!y){if(fT.from<=f&&T.to>=f)){let T=t.moveToLineBoundary(S.cursor(f),!1,!0).head;T>c&&(f=T)}let b=this.gapSize(u,c,f,d),x=i||b<2e6?b:2e6;y=new ar(c,f,b,x)}l.push(y)},h=c=>{if(c.length2e6)for(let P of e)P.from>=c.from&&P.fromc.from&&a(c.from,d,c,f),pt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];ie.spans(t,this.viewport.from,this.viewport.to,{span(r,o){i.push({from:r,to:o})},point(){}},20);let n=0;if(i.length!=this.visibleRanges.length)n=12;else for(let r=0;r=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||an(this.heightMap.lineAt(e,fe.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)||an(this.heightMap.lineAt(this.scaler.fromDOM(e),fe.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 an(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 Kn{constructor(e,t){this.from=e,this.to=t}}function cg(s,e,t){let i=[],n=s,r=0;return ie.spans(t,s,e,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n=1)return e[e.length-1].to;let i=Math.floor(s*t);for(let n=0;;n++){let{from:r,to:o}=e[n],l=o-r;if(i<=l)return r+i;i-=l}}function Gn(s,e){let t=0;for(let{from:i,to:n}of s.ranges){if(e<=n){t+=e-i;break}t+=n-i}return t/s.total}function fg(s,e){for(let t of s)if(e(t))return t}const Rl={toDOM(s){return s},fromDOM(s){return s},scale:1,eq(s){return s==this}};function Pl(s){let e=s.facet(Vs).filter(i=>typeof i!="function"),t=s.facet(Ao).filter(i=>typeof i!="function");return t.length&&e.push(ie.join(t)),e}class Do{constructor(e,t,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=t.lineAt(l,fe.ByPos,e,0,0).top,c=t.lineAt(a,fe.ByPos,e,0,0).bottom;return n+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(t.height-n);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,i=0,n=0;;t++){let r=tt.from==e.viewports[i].from&&t.to==e.viewports[i].to):!1}}function an(s,e){if(e.scale==1)return s;let t=e.toDOM(s.top),i=e.toDOM(s.bottom);return new pt(s.from,s.length,t,i-t,Array.isArray(s._content)?s._content.map(n=>an(n,e)):s._content)}const Jn=F.define({combine:s=>s.join(" ")}),Jr=F.define({combine:s=>s.indexOf(!0)>-1}),Yr=ii.newName(),Uh=ii.newName(),Kh=ii.newName(),jh={"&light":"."+Uh,"&dark":"."+Kh};function Xr(s,e,t){return new ii(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!t||!t[n])throw new RangeError(`Unsupported selector: ${n}`);return t[n]}):s+" "+i}})}const ug=Xr("."+Yr,{"&":{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":{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,')`,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"}},jh),dg={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},hr=_.ie&&_.ie_version<=11;class pg{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new $d,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);(_.ie&&_.ie_version<=11||_.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&&_.android&&e.constructor.EDIT_CONTEXT!==!1&&!(_.chrome&&_.chrome_version<126)&&(this.editContext=new mg(e),e.state.facet(Ft)&&(e.contentDOM.editContext=this.editContext.editContext)),hr&&(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){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,n=this.selectionRange;if(i.state.facet(Ft)?i.root.activeElement!=this.dom:!un(this.dom,n))return;let r=n.anchorNode&&i.docView.tile.nearest(n.anchorNode);if(r&&r.isWidget()&&r.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(_.ie&&_.ie_version<=11||_.android&&_.chrome)&&!i.state.selection.main.empty&&n.focusNode&&dn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=xn(e.root);if(!t)return!1;let i=_.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&gg(this.view,t)||t;if(!i||this.selectionRange.eq(i))return!1;let n=un(this.dom,i);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&_i(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{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,n=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),t==-1?{from:t,to:i}=o:(t=Math.min(o.from,t),i=Math.max(o.to,i)))}return{from:t,to:i,typeOver:n}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),n=this.selectionChanged&&un(this.dom,this.selectionRange);if(e<0&&!n)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new Rp(this.view,e,t,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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,n=Ph(this.view,t);return this.view.state==i&&(t.domChanged||t.newSel&&!Ss(this.view.state.selection,t.newSel.main))&&this.view.update([]),n}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=Il(t,e.previousSibling||e.target.previousSibling,-1),n=Il(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:n?t.posBefore(n):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(Ft)!=e.state.facet(Ft)&&(e.view.contentDOM.editContext=e.state.facet(Ft)?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 n of this.scrollTargets)n.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 Il(s,e,t){for(;e;){let i=ye.get(e);if(i&&i.parent==s)return i;let n=e.parentNode;e=n!=s.dom?n:t>0?e.nextSibling:e.previousSibling}return null}function Nl(s,e){let t=e.startContainer,i=e.startOffset,n=e.endContainer,r=e.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor,1);return dn(o.node,o.offset,n,r)&&([t,i,n,r]=[n,r,t,i]),{anchorNode:t,anchorOffset:i,focusNode:n,focusOffset:r}}function gg(s,e){if(e.getComposedRanges){let n=e.getComposedRanges(s.root)[0];if(n)return Nl(s,n)}let t=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),t=n.getTargetRanges()[0]}return s.contentDOM.addEventListener("beforeinput",i,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",i,!0),t?Nl(s,t):null}class mg{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 n=e.state.selection.main,{anchor:r,head:o}=n,l=this.toEditorPos(i.updateRangeStart),a=this.toEditorPos(i.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:i.updateRangeStart,editorBase:l,drifted:!1});let h=a-l>i.text.length;l==this.from&&rthis.to&&(a=r);let c=Ih(e.state.sliceDoc(l,a),i.text,(h?n.from:n.to)-l,h?"end":null);if(!c){let u=S.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));Ss(u,n)||e.dispatch({selection:u,userEvent:"select"});return}let f={from:c.from+l,to:c.toA+l,insert:ne.of(i.text.slice(c.from,c.toB).split(` +`))};if((_.mac||_.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:ne.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let u=this.to-this.from+(f.to-f.from+f.insert.length);Mo(e,f,S.single(this.toEditorPos(i.selectionStart,u),this.toEditorPos(i.selectionEnd,u)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from=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 n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(l)){let a=this.toEditorPos(r.rangeStart),h=this.toEditorPos(r.rangeEnd);if(a{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=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=xn(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,n=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(h)){n=this.pendingContextChange=null,t+=c,this.to+=c;return}else n=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=c,this.to+=c;else if(rthis.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}t+=c}),n&&!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(n=>!n.isUserEvent("input.type")&&n.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))),n=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*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 H{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&&(n=>n.forEach(r=>i(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=e.root||zd(e.parent)||document,this.viewState=new Bl(this,e.state||se.create(e)),e.scrollTo&&e.scrollTo.is(zn)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ri).map(n=>new nr(n));for(let n of this.plugins)n.update(this);this.observer=new pg(this),this.inputState=new _p(this),this.inputState.ensureHandlers(this.plugins),this.docView=new bl(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 Ae?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,n,r=this.state;for(let u of e){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(u=>u.annotation(Vh))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=$h(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(se.phrases)!=this.state.facet(se.phrases))return this.setState(r);n=ws.create(this,r,e),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of e){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection,{x:p,y:g}=this.state.facet(H.cursorScrollMargin);f=new Fi(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1),"nearest","nearest",g,p)}for(let d of u.effects)d.is(zn)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=As.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),t=this.docView.update(n),this.state.facet(ln)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(Jn)!=n.state.facet(Jn)&&(this.viewState.mustMeasureContent=!0),(t||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(Ur))try{u(n)}catch(d){Ot(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Ph(this,c)&&h.force&&_i(this.contentDOM,h.key,h.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 Bl(this,e),this.plugins=e.facet(Ri).map(i=>new nr(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new bl(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(Ri),i=e.state.facet(Ri);if(t!=i){let n=[];for(let r of i){let o=t.indexOf(r);if(o<0)n.push(new nr(r));else{let l=this.plugins[o];l.mustUpdate=e,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=e;for(let n=0;n-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,n=this.viewState.getScrollOffset(),{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollOffset)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(ah(i||this.win))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.top}this.updateState=1;let a=this.viewState.measure();if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ot(this.state,p),_l}}),f=ws.create(this,this.state,[]),u=!1;f.flags|=a,t?t.flags|=a:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d1||p<-1)&&(i==this.scrollDOM||this.hasFocus||Math.max(this.inputState.lastWheelEvent,this.inputState.lastTouchTime)>Date.now()-100)){n=n+p,i?i.scrollTop+=p:this.win.scrollBy(0,p),o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(Ur))l(t)}get themeClasses(){return Yr+" "+(this.state.facet(Jr)?Kh:Uh)+" "+this.state.facet(Jn)}updateAttrs(){let e=Fl(this,Ah,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(Ft)?"true":"false",class:"cm-content",style:`${_.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Fl(this,Co,t);let i=this.observer.ignore(()=>{let n=dl(this.contentDOM,this.contentAttrs,t),r=dl(this.dom,this.editorAttrs,e);return n||r});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let n of i.effects)if(n.is(H.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(ln);let e=this.state.facet(H.cspNonce);ii.mount(this.root,this.styleModules.concat(ug).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;ti.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 lr(this,e,wl(this,e,t,i))}moveByGroup(e,t){return lr(this,e,wl(this,e,t,i=>Tp(this,e.head,i)))}visualLineSide(e,t){let i=this.bidiSpans(e),n=this.textDirectionAt(e.from),r=i[t?i.length-1:0];return S.cursor(r.side(t,n)+e.from,r.forward(!t,n)?1:-1)}moveToLineBoundary(e,t,i=!0){return Mp(this,e,t,i)}moveVertically(e,t,i){return lr(this,e,Dp(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=jr(this,e,t);return i&&i.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),jr(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(e),r=this.bidiSpans(n),o=r[Et.find(r,e-n.from,-1,t)];return bs(i,o.dir==pe.LTR==t>0)}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(kh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>yg)return ph(e.length);let t=this.textDirectionAt(e.from),i;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||dh(r.isolates,i=ml(this,e))))return r.order;i||(i=ml(this,e));let n=Xd(e.text,t,i);return this.bidiCache.push(new As(e.from,e.to,t,i,!0,n)),n}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||_.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{lh(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,n,r,o;return zn.of(new Fi(typeof e=="number"?S.cursor(e):e,(i=t.y)!==null&&i!==void 0?i:"nearest",(n=t.x)!==null&&n!==void 0?n:"nearest",(r=t.yMargin)!==null&&r!==void 0?r:5,(o=t.xMargin)!==null&&o!==void 0?o:5))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return zn.of(new Fi(S.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 st.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return st.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=ii.newName(),n=[Jn.of(i),ln.of(Xr(`.${i}`,e))];return t&&t.dark&&n.push(Jr.of(!0)),n}static baseTheme(e){return On.lowest(ln.of(Xr("."+Yr,e,jh)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),n=i&&ye.get(i)||ye.get(e);return((t=n==null?void 0:n.root)===null||t===void 0?void 0:t.view)||null}}H.styleModule=ln;H.inputHandler=wh;H.clipboardInputFilter=ko;H.clipboardOutputFilter=So;H.scrollHandler=Sh;H.focusChangeEffect=xh;H.perLineTextDirection=kh;H.exceptionSink=bh;H.updateListener=Ur;H.editable=Ft;H.mouseSelectionStyle=vh;H.dragMovesSelection=yh;H.clickAddsSelectionRange=mh;H.decorations=Vs;H.blockWrappers=Mh;H.outerDecorations=Ao;H.atomicRanges=Pn;H.bidiIsolatedRanges=Th;H.cursorScrollMargin=F.define({combine:s=>{let e=5,t=5;for(let i of s)typeof i=="number"?e=t=i:{x:e,y:t}=i;return{x:e,y:t}}});H.scrollMargins=Dh;H.darkTheme=Jr;H.cspNonce=F.define({combine:s=>s.length?s[0]:""});H.contentAttributes=Co;H.editorAttributes=Ah;H.lineWrapping=H.contentAttributes.of({class:"cm-lineWrapping"});H.announce=oe.define();const yg=4096,_l={};class As{constructor(e,t,i,n,r,o){this.from=e,this.to=t,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let i=[],n=e.length?e[e.length-1].dir:pe.LTR;for(let r=Math.max(0,e.length-10);r=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&bo(o,t)}return t}const vg=_.mac?"mac":_.windows?"win":_.linux?"linux":"key";function bg(s,e){const t=s.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;ai.concat(n),[]))),t}function xg(s,e,t){return Jh(Gh(s.state),e,s,t)}let Yt=null;const kg=4e3;function Sg(s,e=vg){let t=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,h,c)=>{var f,u;let d=t[o]||(t[o]=Object.create(null)),p=l.split(/ (?!$)/).map(b=>bg(b,e));for(let b=1;b{let D=Yt={view:T,prefix:x,scope:o};return setTimeout(()=>{Yt==D&&(Yt=null)},kg),!0}]})}let g=p.join(" ");n(g,!1);let y=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&y.run.push(a),h&&(y.preventDefault=!0),c&&(y.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=t[h]||(t[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,Zr))}let a=o[e]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}let Zr=null;function Jh(s,e,t,i){Zr=e;let n=Id(e),r=Va(n,0),o=$a(r)==n.length&&n!=" ",l="",a=!1,h=!1,c=!1;Yt&&Yt.view==t&&Yt.scope==i&&(l=Yt.prefix+" ",_h.indexOf(e.keyCode)<0&&(h=!0,Yt=null));let f=new Set,u=y=>{if(y){for(let b of y.run)if(!f.has(b)&&(f.add(b),b(t)))return y.stopPropagation&&(c=!0),!0;y.preventDefault&&(y.stopPropagation&&(c=!0),h=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Yn(n,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(_.windows&&e.ctrlKey&&e.altKey)&&!(_.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(p=ni[e.keyCode])&&p!=n?(u(d[l+Yn(p,e,!0)])||e.shiftKey&&(g=bn[e.keyCode])!=n&&g!=p&&u(d[l+Yn(g,e,!1)]))&&(a=!0):o&&e.shiftKey&&u(d[l+Yn(n,e,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&e.stopPropagation(),Zr=null,a}const Hl=F.define({combine(s){let e,t;for(let i of s)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function Yh(s,e){let t=s.plugin(Xh),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Xh=st.fromClass(class{constructor(s){this.input=s.state.facet(Ms),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(s));let e=s.state.facet(Hl);this.top=new Xn(s,!0,e.topContainer),this.bottom=new Xn(s,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(s){let e=s.state.facet(Hl);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Xn(s.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Xn(s.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=s.state.facet(Ms);if(t!=this.input){let i=t.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),l.push(c)):(c=this.panels[h],c.update&&c.update(s)),n.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=n,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>H.scrollMargins.of(e=>{let t=e.plugin(s);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Xn{constructor(e,t,i){this.view=e,this.top=t,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=Vl(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=Vl(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function Vl(s){let e=s.nextSibling;return s.remove(),e}const Ms=F.define({enables:Xh});function Cg(s,e){let t,i=new Promise(o=>t=o),n=o=>Ag(o,e,t);s.state.field(cr,!1)?s.dispatch({effects:Qh.of(n)}):s.dispatch({effects:oe.appendConfig.of(cr.init(()=>[n]))});let r=Zh.of(n);return{close:r,result:i.then(o=>((s.win.queueMicrotask||(a=>s.win.setTimeout(a,10)))(()=>{s.state.field(cr).indexOf(n)>-1&&s.dispatch({effects:r})}),o))}}const cr=vt.define({create(){return[]},update(s,e){for(let t of e.effects)t.is(Qh)?s=[t.value].concat(s):t.is(Zh)&&(s=s.filter(i=>i!=t.value));return s},provide:s=>Ms.computeN([s],e=>e.field(s))}),Qh=oe.define(),Zh=oe.define();function Ag(s,e,t){let i=e.content?e.content(s,()=>o(null)):null;if(!i){if(i=Ee("form"),e.input){let l=Ee("input",e.input);/^(text|password|number|email|tel|url)$/.test(l.type)&&l.classList.add("cm-textfield"),l.name||(l.name="input"),i.appendChild(Ee("label",(e.label||"")+": ",l))}else i.appendChild(document.createTextNode(e.label||""));i.appendChild(document.createTextNode(" ")),i.appendChild(Ee("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let n=i.nodeName=="FORM"?[i]:i.querySelectorAll("form");for(let l=0;l{h.keyCode==27?(h.preventDefault(),o(null)):h.keyCode==13&&(h.preventDefault(),o(a))}),a.addEventListener("submit",h=>{h.preventDefault(),o(a)})}let r=Ee("div",i,Ee("button",{onclick:()=>o(null),"aria-label":s.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(r.className=e.class),r.classList.add("cm-dialog");function o(l){r.contains(r.ownerDocument.activeElement)&&s.focus(),t(l)}return{dom:r,top:e.top,mount:()=>{if(e.focus){let l;typeof e.focus=="string"?l=i.querySelector(e.focus):l=i.querySelector("input")||i.querySelector("button"),l&&"select"in l?l.select():l&&"focus"in l&&l.focus()}}}}class ri extends bi{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}ri.prototype.elementClass="";ri.prototype.toDOM=void 0;ri.prototype.mapMode=nt.TrackBefore;ri.prototype.startSide=ri.prototype.endSide=-1;ri.prototype.point=!0;const fr=F.define(),Mg=F.define(),Tg={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>ie.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{},side:"before"},gn=F.define();function Dg(s){return[ec(),gn.of({...Tg,...s})]}const $l=F.define({combine:s=>s.some(e=>e)});function ec(s){return[Eg]}const Eg=st.fromClass(class{constructor(s){this.view=s,this.domAfter=null,this.prevViewport=s.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=s.state.facet(gn).map(e=>new ql(s,e)),this.fixed=!s.state.facet($l);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),s.scrollDOM.insertBefore(this.dom,s.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(s){if(this.updateGutters(s)){let e=this.prevViewport,t=s.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}if(s.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($l)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=s.view.viewport}syncGutters(s){let e=this.dom.nextSibling;s&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=ie.iter(this.view.state.facet(fr),this.view.viewport.from),i=[],n=this.gutters.map(r=>new Og(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Ye.Text&&o){eo(t,i,l.from);for(let a of n)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of n)a.widget(this.view,l)}else if(r.type==Ye.Text){eo(t,i,r.from);for(let o of n)o.line(this.view,r,i)}else if(r.widget)for(let o of n)o.widget(this.view,r);for(let r of n)r.finish();s&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(s){let e=s.startState.facet(gn),t=s.state.facet(gn),i=s.docChanged||s.heightChanged||s.viewportChanged||!ie.eq(s.startState.facet(fr),s.state.facet(fr),s.view.viewport.from,s.view.viewport.to);if(e==t)for(let n of this.gutters)n.update(s)&&(i=!0);else{i=!0;let n=[];for(let r of t){let o=e.indexOf(r);o<0?n.push(new ql(this.view,r)):(this.gutters[o].update(s),n.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),n.indexOf(r)<0&&r.destroy();for(let r of n)r.config.side=="after"?this.getDOMAfter().appendChild(r.dom):this.dom.appendChild(r.dom);this.gutters=n}return i}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:s=>H.scrollMargins.of(e=>{let t=e.plugin(s);if(!t||t.gutters.length==0||!t.fixed)return null;let i=t.dom.offsetWidth*e.scaleX,n=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==pe.LTR?{left:i,right:n}:{right:i,left:n}})});function zl(s){return Array.isArray(s)?s:[s]}function eo(s,e,t){for(;s.value&&s.from<=t;)s.from==t&&e.push(s.value),s.next()}class Og{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=ie.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:n}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==n.elements.length){let l=new tc(e,o,r,i);n.elements.push(l),n.dom.appendChild(l.dom)}else n.elements[this.i].update(e,o,r,i);this.height=t.bottom,this.i++}line(e,t,i){let n=[];eo(this.cursor,n,t.from),i.length&&(n=n.concat(i));let r=this.gutter.config.lineMarker(e,t,n);r&&n.unshift(r);let o=this.gutter;n.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,n)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t),n=i?[i]:null;for(let r of e.state.facet(Mg)){let o=r(e,t.widget,t);o&&(n||(n=[])).push(o)}n&&this.addElement(e,t,n)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class ql{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,n=>{let r=n.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=n.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[i](e,l,n)&&n.preventDefault()});this.markers=zl(t.markers(e)),t.initialSpacer&&(this.spacer=new tc(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=zl(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],e);n!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[n])}let i=e.view.viewport;return!ie.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 tc{constructor(e,t,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,n)}update(e,t,i,n){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),Lg(this.markers,n)||this.setMarkers(e,n)}setMarkers(e,t){let i="cm-gutterElement",n=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,h)||o(l,a,h):o}return i}})}});class ur extends ri{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function dr(s,e){return s.state.facet(Pi).formatNumber(e,s.state)}const Pg=gn.compute([Pi],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(Bg)},lineMarker(e,t,i){return i.some(n=>n.toDOM)?null:new ur(dr(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,i)=>{for(let n of e.state.facet(Rg)){let r=n(e,t,i);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Pi)!=e.state.facet(Pi),initialSpacer(e){return new ur(dr(e,Ul(e.state.doc.lines)))},updateSpacer(e,t){let i=dr(t.view,Ul(t.view.state.doc.lines));return i==e.number?e:new ur(i)},domEventHandlers:s.facet(Pi).domEventHandlers,side:"before"}));function Ig(s={}){return[Pi.of(s),ec(),Pg]}function Ul(s){let e=9;for(;e{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=Ke.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}ee.closedBy=new ee({deserialize:s=>s.split(" ")});ee.openedBy=new ee({deserialize:s=>s.split(" ")});ee.group=new ee({deserialize:s=>s.split(" ")});ee.isolate=new ee({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});ee.contextHash=new ee({perNode:!0});ee.lookAhead=new ee({perNode:!0});ee.mounted=new ee({perNode:!0});class Wi{constructor(e,t,i,n=!1){this.tree=e,this.overlay=t,this.parser=i,this.bracketed=n}static get(e){return e&&e.props&&e.props[ee.mounted.id]}}const Fg=Object.create(null);class Ke{constructor(e,t,i,n=0){this.name=e,this.props=t,this.id=i,this.flags=n}static define(e){let t=e.props&&e.props.length?Object.create(null):Fg,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),n=new Ke(e.name||"",t,e.id,i);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return n}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(ee.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 n of i.split(" "))t[n]=e[i];return i=>{for(let n=i.prop(ee.group),r=-1;r<(n?n.length:0);r++){let o=t[r<0?i.name:n[r]];if(o)return o}}}}Ke.none=new Ke("",Object.create(null),0,8);class Eo{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|he.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!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:Bo(Ke.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,n)=>new ce(this.type,t,i,n,this.propValues),e.makeTree||((t,i,n)=>new ce(Ke.none,t,i,n)))}static build(e){return $g(e)}}ce.empty=new ce(Ke.none,[],[],0);class Oo{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 Oo(this.buffer,this.index)}}class oi{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Ke.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,i){let n=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function Sn(s,e,t,i){for(var n;s.from==s.to||(t<1?s.from>=e:s.from>e)||(t>-1?s.to<=e:s.to0?l.length:-1;e!=h;e+=t){let c=l[e],f=a[e]+o.from,u;if(!(!(r&he.EnterBracketed&&c instanceof ce&&(u=Wi.get(c))&&!u.overlay&&u.bracketed&&i>=f&&i<=f+c.length)&&!ic(n,i,f,f+c.length))){if(c instanceof oi){if(r&he.ExcludeBuffers)continue;let d=c.findChild(0,c.buffer.length,t,i-f,n);if(d>-1)return new Lt(new Wg(o,c,e,f),null,d)}else if(r&he.IncludeAnonymous||!c.type.isAnonymous||Lo(c)){let d;if(!(r&he.IgnoreMounts)&&(d=Wi.get(c))&&!d.overlay)return new He(d.tree,f,e,o);let p=new He(c,f,e,o);return r&he.IncludeAnonymous||!p.type.isAnonymous?p:p.nextChild(t<0?c.children.length-1:0,t,i,n,r)}}}if(r&he.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))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 n;if(!(i&he.IgnoreOverlays)&&(n=Wi.get(this._tree))&&n.overlay){let r=e-this.from,o=i&he.EnterBracketed&&n.bracketed;for(let{from:l,to:a}of n.overlay)if((t>0||o?l<=r:l=r:a>r))return new He(n.tree,n.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 jl(s,e,t,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=n.type.is(t),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(e)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function to(s,e,t=e.length-1){for(let i=s;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 Wg{constructor(e,t,i,n){this.parent=e,this.buffer=t,this.index=i,this.start=n}}class Lt extends nc{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:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.context.start,i);return r<0?null:new Lt(this.context,this,r)}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&he.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new Lt(this.context,this,r)}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 Lt(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 Lt(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];e.push(i.slice(n,r,o)),t.push(0)}return new ce(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function sc(s){if(!s.length)return null;let e=0,t=s[0];for(let r=1;rt.from||o.to=e){let l=new He(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Sn(l,e,t,!1))}}return n?sc(n):i}class Ts{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&~he.EnterBracketed,e instanceof He)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:n}=this.buffer;return this.type=t||n.set.types[n.buffer[e]],this.from=i+n.buffer[e+1],this.to=i+n.buffer[e+2],!0}yield(e){return e?e instanceof He?(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:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],e,t-this.buffer.start,i);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}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&he.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&he.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&he.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 n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(t.findChild(n,this.index,-1,0,4))}else{let n=t.buffer[this.index+3];if(n<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(n)}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:n}=this;if(n){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:i._tree.children.length;r!=o;r+=e){let l=i._tree.children[r];if(this.mode&he.IncludeAnonymous||l instanceof oi||!l.type.isAnonymous||Lo(l))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=0;){for(let o=e;o;o=o._parent)if(o.index==n){if(n==this.index)return o;t=o,i=r+1;break e}n=this.stack[--r]}for(let n=i;n=0;r--){if(r<0)return to(this._tree,e,n);let o=i[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[n]&&e[n]!=o.name)return!1;n--}}return!0}}function Lo(s){return s.children.some(e=>e instanceof oi||!e.type.isAnonymous||Lo(e))}function $g(s){var e;let{buffer:t,nodeSet:i,maxBufferLength:n=Ng,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(t)?new Oo(t,t.length):t,a=i.types,h=0,c=0;function f(A,P,C,U,M,$){let{id:N,start:I,end:G,size:L}=l,R=c,Z=h;if(L<0)if(l.next(),L==-1){let de=r[N];C.push(de),U.push(I-A);return}else if(L==-3){h=N;return}else if(L==-4){c=N;return}else throw new RangeError(`Unrecognized record size: ${L}`);let X=a[N],ue,Me,ot=I-A;if(G-I<=n&&(Me=y(l.pos-P,M))){let de=new Uint16Array(Me.size-Me.skip),Te=l.pos-Me.size,De=de.length;for(;l.pos>Te;)De=b(Me.start,de,De);ue=new oi(de,G-Me.start,i),ot=Me.start-A}else{let de=l.pos-L;l.next();let Te=[],De=[],Fe=N>=o?N:-1,Le=0,je=G;for(;l.pos>de;)Fe>=0&&l.id==Fe&&l.size>=0?(l.end<=je-n&&(p(Te,De,I,Le,l.end,je,Fe,R,Z),Le=Te.length,je=l.end),l.next()):$>2500?u(I,de,Te,De):f(I,de,Te,De,Fe,$+1);if(Fe>=0&&Le>0&&Le-1&&Le>0){let $e=d(X,Z);ue=Bo(X,Te,De,0,Te.length,0,G-I,$e,$e)}else ue=g(X,Te,De,G-I,R-G,Z)}C.push(ue),U.push(ot)}function u(A,P,C,U){let M=[],$=0,N=-1;for(;l.pos>P;){let{id:I,start:G,end:L,size:R}=l;if(R>4)l.next();else{if(N>-1&&G=0;L-=3)I[R++]=M[L],I[R++]=M[L+1]-G,I[R++]=M[L+2]-G,I[R++]=R;C.push(new oi(I,M[2]-G,i)),U.push(G-A)}}function d(A,P){return(C,U,M)=>{let $=0,N=C.length-1,I,G;if(N>=0&&(I=C[N])instanceof ce){if(!N&&I.type==A&&I.length==M)return I;(G=I.prop(ee.lookAhead))&&($=U[N]+I.length+G)}return g(A,C,U,M,$,P)}}function p(A,P,C,U,M,$,N,I,G){let L=[],R=[];for(;A.length>U;)L.push(A.pop()),R.push(P.pop()+C-M);A.push(g(i.types[N],L,R,$-M,I-$,G)),P.push(M-C)}function g(A,P,C,U,M,$,N){if($){let I=[ee.contextHash,$];N=N?[I].concat(N):[I]}if(M>25){let I=[ee.lookAhead,M];N=N?[I].concat(N):[I]}return new ce(A,P,C,U,N)}function y(A,P){let C=l.fork(),U=0,M=0,$=0,N=C.end-n,I={size:0,start:0,skip:0};e:for(let G=C.pos-A;C.pos>G;){let L=C.size;if(C.id==P&&L>=0){I.size=U,I.start=M,I.skip=$,$+=4,U+=4,C.next();continue}let R=C.pos-L;if(L<0||R=o?4:0,X=C.start;for(C.next();C.pos>R;){if(C.size<0)if(C.size==-3||C.size==-4)Z+=4;else break e;else C.id>=o&&(Z+=4);C.next()}M=X,U+=L,$+=Z}return(P<0||U==A)&&(I.size=U,I.start=M,I.skip=$),I.size>4?I:void 0}function b(A,P,C){let{id:U,start:M,end:$,size:N}=l;if(l.next(),N>=0&&U4){let G=l.pos-(N-4);for(;l.pos>G;)C=b(A,P,C)}P[--C]=I,P[--C]=$-A,P[--C]=M-A,P[--C]=U}else N==-3?h=U:N==-4&&(c=U);return C}let x=[],T=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,x,T,-1,0);let D=(e=s.length)!==null&&e!==void 0?e:x.length?T[0]+x[0].length:0;return new ce(a[s.topID],x.reverse(),T.reverse(),D)}const Gl=new WeakMap;function cs(s,e){if(!s.isAnonymous||e instanceof oi||e.type!=s)return 1;let t=Gl.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=s||!(i instanceof ce)){t=1;break}t+=cs(s,i)}Gl.set(e,t)}return t}function Bo(s,e,t,i,n,r,o,l,a){let h=0;for(let p=i;p=c)break;P+=C}if(T==D+1){if(P>c){let C=p[D];d(C.children,C.positions,0,C.children.length,g[D]+x);continue}f.push(p[D])}else{let C=g[T-1]+p[T-1].length-A;f.push(Bo(s,p,g,D,T,A,C,null,a))}u.push(A+x-r)}}return d(e,t,i,n,0),(l||a)(f,u,o)}class uv{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let n=this.map.get(e);n||this.map.set(e,n=new Map),n.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof Lt?this.setBuffer(e.context.buffer,e.index,t):e instanceof He&&this.map.set(e.tree,t)}get(e){return e instanceof Lt?this.getBuffer(e.context.buffer,e.index):e instanceof He?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class Ht{constructor(e,t,i,n,r=!1,o=!1){this.from=e,this.to=t,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let n=[new Ht(0,e.length,e,0,!1,i)];for(let r of t)r.to>e.length&&n.push(r);return n}static applyChanges(e,t,i=128){if(!t.length)return e;let n=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,h=0;;l++){let c=l=i)for(;o&&o.from=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new Ht(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&n.push(u),o.to>f)break;o=rnew ht(n.from,n.to)):[new ht(0,0)]:[new ht(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let n=this.startParse(e,t,i);for(;;){let r=n.advance();if(r)return r}}}class zg{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)}}function dv(s){return(e,t,i,n)=>new Ug(e,s,t,i,n)}class Jl{constructor(e,t,i,n,r,o){this.parser=e,this.parse=t,this.overlay=i,this.bracketed=n,this.target=r,this.from=o}}function Yl(s){if(!s.length||s.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(s))}class qg{constructor(e,t,i,n,r,o,l,a){this.parser=e,this.predicate=t,this.mounts=i,this.index=n,this.start=r,this.bracketed=o,this.target=l,this.prev=a,this.depth=0,this.ranges=[]}}const io=new ee({perNode:!0});class Ug{constructor(e,t,i,n,r){this.nest=t,this.input=i,this.fragments=n,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let n of this.inner)n.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new ce(i.type,i.children,i.positions,i.length,i.propValues.concat([[io,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[ee.mounted.id]=new Wi(t,e.overlay,e.parser,e.bracketed),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(n)){if(t){let h=t.mounts.find(c=>c.frag.from<=n.from&&c.frag.to>=n.to&&c.mount.overlay);if(h)for(let c of h.mount.overlay){let f=c.from+h.pos,u=c.to+h.pos;f>=n.from&&u<=n.to&&!t.ranges.some(d=>d.fromf)&&t.ranges.push({from:f,to:u})}}l=!1}else if(i&&(o=Kg(i.ranges,n.from,n.to)))l=o!=2;else if(!n.type.isAnonymous&&(r=this.nest(n,this.input))&&(n.fromnew ht(f.from-n.from,f.to-n.from)):null,!!r.bracketed,n.tree,c.length?c[0].from:n.from)),r.overlay?c.length&&(i={ranges:c,depth:0,prev:i}):l=!1}}else if(t&&(a=t.predicate(n))&&(a===!0&&(a=new ht(n.from,n.to)),a.from=0&&t.ranges[h].to==a.from?t.ranges[h]={from:t.ranges[h].from,to:a.to}:t.ranges.push(a)}if(l&&n.firstChild())t&&t.depth++,i&&i.depth++;else for(;!n.nextSibling();){if(!n.parent())break e;if(t&&!--t.depth){let h=Zl(this.ranges,t.ranges);h.length&&(Yl(h),this.inner.splice(t.index,0,new Jl(t.parser,t.parser.startParse(this.input,ea(t.mounts,h),h),t.ranges.map(c=>new ht(c.from-t.start,c.to-t.start)),t.bracketed,t.target,h[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function Kg(s,e,t){for(let i of s){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function Xl(s,e,t,i,n,r){if(e=e&&t.enter(i,1,he.IgnoreOverlays|he.ExcludeBuffers)))if(t.to<=e)t.next(!1)||(this.done=!0);else break}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ce)t=t.children[0];else break}return!1}}class Gg{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(io))!==null&&t!==void 0?t:i.to,this.inner=new Ql(i.tree,-i.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(io))!==null&&e!==void 0?e:t.to,this.inner=new Ql(t.tree,-t.offset)}}findMounts(e,t){var i;let n=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(i=r.tree)===null||i===void 0?void 0:i.prop(ee.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&n.push({frag:a,pos:r.from-a.offset,mount:o})}}}return n}}function Zl(s,e){let t=null,i=e;for(let n=1,r=0;n=l)break;a.to<=o||(t||(i=t=e.slice()),a.froml&&t.splice(r+1,0,new ht(l,a.to))):a.to>l?t[r--]=new ht(l,a.to):t.splice(r--,1))}}return i}function Jg(s,e,t,i){let n=0,r=0,o=!1,l=!1,a=-1e9,h=[];for(;;){let c=n==s.length?1e9:o?s[n].to:s[n].from,f=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let u=Math.max(a,t),d=Math.min(c,f,i);unew ht(u.from+i,u.to+i)),f=Jg(e,c,a,h);for(let u=0,d=a;;u++){let p=u==f.length,g=p?h:f[u].from;if(g>d&&t.push(new Ht(d,g,n.tree,-o,r.from>=d||r.openStart,r.to<=g||r.openEnd)),p)break;d=f[u].to}}else t.push(new Ht(a,h,n.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}let Yg=0;class lt{constructor(e,t,i,n){this.name=e,this.set=t,this.base=i,this.modified=n,this.id=Yg++}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 lt&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let n=new lt(i,[],null,[]);if(n.set.push(n),t)for(let r of t.set)n.set.push(r);return n}static defineModifier(e){let t=new Ds(e);return i=>i.modified.indexOf(t)>-1?i:Ds.get(i.base||i,i.modified.concat(t).sort((n,r)=>n.id-r.id))}}let Xg=0;class Ds{constructor(e){this.name=e,this.instances=[],this.id=Xg++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(l=>l.base==e&&Qg(t,l.modified));if(i)return i;let n=[],r=new lt(e.name,n,e,t);for(let l of t)l.instances.push(r);let o=Zg(t);for(let l of e.set)if(!l.modified.length)for(let a of o)n.push(Ds.get(l,a));return r}}function Qg(s,e){return s.length==e.length&&s.every((t,i)=>t==e[i])}function Zg(s){let e=[[]];for(let t=0;ti.length-t.length)}function em(s){let e=Object.create(null);for(let t in s){let i=s[t];Array.isArray(i)||(i=[i]);for(let n of t.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+n);let c=new Cn(i,o,a>0?r.slice(0,a):null);e[h]=c.sort(e[h])}}return oc.add(e)}const oc=new ee({combine(s,e){let t,i,n;for(;s||e;){if(!s||e&&s.depth>=e.depth?(n=e,e=e.next):(n=s,s=s.next),t&&t.mode==n.mode&&!n.context&&!t.context)continue;let r=new Cn(n.tags,n.mode,n.context);t?t.next=r:i=r,t=r}return i}});class Cn{constructor(e,t,i,n){this.tags=e,this.mode=t,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=n;for(let l of r)for(let a of l.set){let h=t[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function tm(s,e){let t=null;for(let i of s){let n=i.style(e);n&&(t=t?t+" "+n:n)}return t}function im(s,e,t,i=0,n=s.length){let r=new nm(i,Array.isArray(e)?e:[e],t);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}class nm{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,n,r){let{type:o,from:l,to:a}=e;if(l>=i||a<=t)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=n,c=sm(e)||Cn.empty,f=tm(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(t,l),h),c.opaque)return;let u=e.tree&&e.tree.prop(ee.mounted);if(u&&u.overlay){let d=e.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(y=>!y.scope||y.scope(u.tree.type)),g=e.firstChild();for(let y=0,b=l;;y++){let x=y=T||!e.nextSibling())););if(!x||T>i)break;b=x.to+l,b>t&&(this.highlightRange(d.cursor(),Math.max(t,x.from+l),Math.min(i,b),"",p),this.startSpan(Math.min(i,b),h))}g&&e.parent()}else if(e.firstChild()){u&&(n="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,n,r),this.startSpan(Math.min(i,e.to),h)}while(e.nextSibling());e.parent()}}}function sm(s){let e=s.type.prop(oc);for(;e&&e.context&&!s.matchContext(e.context);)e=e.next;return e||null}const E=lt.define,Zn=E(),jt=E(),ta=E(jt),ia=E(jt),Gt=E(),es=E(Gt),pr=E(Gt),Mt=E(),ui=E(Mt),Ct=E(),At=E(),no=E(),sn=E(no),ts=E(),v={comment:Zn,lineComment:E(Zn),blockComment:E(Zn),docComment:E(Zn),name:jt,variableName:E(jt),typeName:ta,tagName:E(ta),propertyName:ia,attributeName:E(ia),className:E(jt),labelName:E(jt),namespace:E(jt),macroName:E(jt),literal:Gt,string:es,docString:E(es),character:E(es),attributeValue:E(es),number:pr,integer:E(pr),float:E(pr),bool:E(Gt),regexp:E(Gt),escape:E(Gt),color:E(Gt),url:E(Gt),keyword:Ct,self:E(Ct),null:E(Ct),atom:E(Ct),unit:E(Ct),modifier:E(Ct),operatorKeyword:E(Ct),controlKeyword:E(Ct),definitionKeyword:E(Ct),moduleKeyword:E(Ct),operator:At,derefOperator:E(At),arithmeticOperator:E(At),logicOperator:E(At),bitwiseOperator:E(At),compareOperator:E(At),updateOperator:E(At),definitionOperator:E(At),typeOperator:E(At),controlOperator:E(At),punctuation:no,separator:E(no),bracket:sn,angleBracket:E(sn),squareBracket:E(sn),paren:E(sn),brace:E(sn),content:Mt,heading:ui,heading1:E(ui),heading2:E(ui),heading3:E(ui),heading4:E(ui),heading5:E(ui),heading6:E(ui),contentSeparator:E(Mt),list:E(Mt),quote:E(Mt),emphasis:E(Mt),strong:E(Mt),link:E(Mt),monospace:E(Mt),strikethrough:E(Mt),inserted:E(),deleted:E(),changed:E(),invalid:E(),meta:ts,documentMeta:E(ts),annotation:E(ts),processingInstruction:E(ts),definition:lt.defineModifier("definition"),constant:lt.defineModifier("constant"),function:lt.defineModifier("function"),standard:lt.defineModifier("standard"),local:lt.defineModifier("local"),special:lt.defineModifier("special")};for(let s in v){let e=v[s];e instanceof lt&&(e.name=s)}lc([{tag:v.link,class:"tok-link"},{tag:v.heading,class:"tok-heading"},{tag:v.emphasis,class:"tok-emphasis"},{tag:v.strong,class:"tok-strong"},{tag:v.keyword,class:"tok-keyword"},{tag:v.atom,class:"tok-atom"},{tag:v.bool,class:"tok-bool"},{tag:v.url,class:"tok-url"},{tag:v.labelName,class:"tok-labelName"},{tag:v.inserted,class:"tok-inserted"},{tag:v.deleted,class:"tok-deleted"},{tag:v.literal,class:"tok-literal"},{tag:v.string,class:"tok-string"},{tag:v.number,class:"tok-number"},{tag:[v.regexp,v.escape,v.special(v.string)],class:"tok-string2"},{tag:v.variableName,class:"tok-variableName"},{tag:v.local(v.variableName),class:"tok-variableName tok-local"},{tag:v.definition(v.variableName),class:"tok-variableName tok-definition"},{tag:v.special(v.variableName),class:"tok-variableName2"},{tag:v.definition(v.propertyName),class:"tok-propertyName tok-definition"},{tag:v.typeName,class:"tok-typeName"},{tag:v.namespace,class:"tok-namespace"},{tag:v.className,class:"tok-className"},{tag:v.macroName,class:"tok-macroName"},{tag:v.propertyName,class:"tok-propertyName"},{tag:v.operator,class:"tok-operator"},{tag:v.comment,class:"tok-comment"},{tag:v.meta,class:"tok-meta"},{tag:v.invalid,class:"tok-invalid"},{tag:v.punctuation,class:"tok-punctuation"}]);var gr;const Zt=new ee;function Ro(s){return F.define({combine:s?e=>e.concat(s):void 0})}const ac=new ee;class qe{constructor(e,t,i=[],n=""){this.data=e,this.name=n,se.prototype.hasOwnProperty("tree")||Object.defineProperty(se.prototype,"tree",{get(){return _e(this)}}),this.parser=t,this.extension=[$t.of(this),se.languageData.of((r,o,l)=>{let a=na(r,o,l),h=a.type.prop(Zt);if(!h)return[];let c=r.facet(h),f=a.type.prop(ac);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(e,t,i=-1){return na(e,t,i).type.prop(Zt)==this.data}findRegions(e){let t=e.facet($t);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Zt)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(ee.mounted);if(l){if(l.tree.prop(Zt)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Es(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function _e(s){let e=s.field(qe.state,!1);return e?e.tree:ce.empty}function hc(s,e,t=50){var i;let n=(i=s.field(qe.state,!1))===null||i===void 0?void 0:i.context;if(!n)return null;let r=n.viewport;n.updateViewport({from:0,to:e});let o=n.isDone(e)||n.work(t,e)?n.tree:null;return n.updateViewport(r),o}function rm(s,e=s.doc.length){var t;return((t=s.field(qe.state,!1))===null||t===void 0?void 0:t.context.isDone(e))||!1}function om(s,e=s.viewport.to,t=100){let i=hc(s.state,e,t);return i!=_e(s.state)&&s.dispatch({}),!!i}function lm(s){var e;return((e=s.plugin(uc))===null||e===void 0?void 0:e.isWorking())||!1}class cc{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=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let rn=null;class Si{constructor(e,t,i=[],n,r,o,l,a){this.parser=e,this.state=t,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Si(e,t,[],ce.empty,0,i,[],null)}startParse(){return this.parser.startParse(new cc(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ce.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let n=Date.now()+e;e=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=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(Ht.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=rn;rn=this;try{return e()}finally{rn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sa(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=Ht.applyChanges(i,a),n=ce.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=e.mapPos(h.from,1),f=e.mapPos(h.to,-1);ce.from&&(this.fragments=sa(this.fragments,n,r),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 rc{createParse(t,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=rn;if(a){for(let h of n)a.tempSkipped.push(h);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new ce(Ke.none,[],[],o-r)},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 rn}}function sa(s,e,t){return Ht.applyChanges(s,[{fromA:e,toA:t,fromB:e,toB:t}])}class Ui{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 Ui(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Si.create(e.facet($t).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new Ui(i)}}qe.state=vt.define({create:Ui.init,update(s,e){for(let t of e.effects)if(t.is(qe.setState))return t.value;return e.startState.facet($t)!=e.state.facet($t)?Ui.init(e.state):s.apply(e)}});let fc=s=>{let e=setTimeout(()=>s(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(fc=s=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(s,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const mr=typeof navigator<"u"&&(!((gr=navigator.scheduling)===null||gr===void 0)&&gr.isInputPending)?()=>navigator.scheduling.isInputPending():null,uc=st.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(qe.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(qe.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=fc(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndn+1e3,a=r.context.work(()=>mr&&mr()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:qe.setState.of(new Ui(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>Ot(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()}}}),$t=F.define({combine(s){return s.length?s[0]:null},enables:s=>[qe.state,uc,H.contentAttributes.compute([s],e=>{let t=e.facet(s);return t&&t.name?{"data-language":t.name}:{}})]});class am{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class Po{constructor(e,t,i,n,r,o=void 0){this.name=e,this.alias=t,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:i}=e;if(!t){if(!i)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(i)}return new Po(e.name,(e.alias||[]).concat(e.name).map(n=>n.toLowerCase()),e.extensions||[],e.filename,t,i)}static matchFilename(e,t){for(let n of e)if(n.filename&&n.filename.test(t))return n;let i=/\.([^.]+)$/.exec(t);if(i){for(let n of e)if(n.extensions.indexOf(i[1])>-1)return n}return null}static matchLanguageName(e,t,i=!0){t=t.toLowerCase();for(let n of e)if(n.alias.some(r=>r==t))return n;if(i)for(let n of e)for(let r of n.alias){let o=t.indexOf(r);if(o>-1&&(r.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+r.length])))return n}return null}}const dc=F.define(),Us=F.define({combine:s=>{if(!s.length)return" ";let e=s[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return e}});function li(s){let e=s.facet(Us);return e.charCodeAt(0)==9?s.tabSize*e.length:e.length}function Ci(s,e){let t="",i=s.tabSize,n=s.facet(Us)[0];if(n==" "){for(;e>=i;)t+=" ",e-=i;n=" "}for(let r=0;r=e?cm(s,t,e):null}function hm(s,e,t){let i=Object.create(null),n=new Xi(s,{overrideIndentation:o=>{var l;return(l=i[o])!==null&&l!==void 0?l:-1}}),r=[];for(let o=e;o<=t;){let l=s.doc.lineAt(o);o=l.to+1;let a=In(n,l.from);if(a==null)continue;/\S/.test(l.text)||(a=0);let h=/^\s*/.exec(l.text)[0],c=Ci(s,a);h!=c&&(i[l.from]=a,r.push({from:l.from,to:l.from+h.length,insert:c}))}return s.changes(r)}class Xi{constructor(e,t={}){this.state=e,this.options=t,this.unit=li(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==e?{text:"",from:e}:(t<0?n-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(e,t=e.length){return Ws(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:n}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Io=new ee;function cm(s,e,t){let i=e.resolveStack(t),n=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(n!=i.node){let r=[];for(let o=n;o&&!(o.fromi.node.to||o.from==i.node.from&&o.type==i.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return pc(i,s,t)}function pc(s,e,t){for(let i=s;i;i=i.next){let n=um(i.node);if(n)return n(Ks.create(e,t,i))}return 0}function fm(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function um(s){let e=s.type.prop(Io);if(e)return e;let t=s.firstChild,i;if(t&&(i=t.type.prop(ee.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>gc(o,!0,1,void 0,r&&!fm(o)?n.from:void 0)}return s.parent==null?dm:null}function dm(){return 0}class Ks extends Xi{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 Ks(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(pm(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return pc(this.context.next,this.base,this.pos)}}function pm(s,e){for(let t=e;t;t=t.parent)if(s==t)return!0;return!1}function gm(s){let e=s.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(t.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+h}}l=a.to}}function mm({closing:s,align:e=!0,units:t=1}){return i=>gc(i,e,t,s)}function gc(s,e,t,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=e?gm(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*t)}const ym=s=>s.baseIndent;function vm({except:s,units:e=1}={}){return t=>{let i=s&&s.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const bm=200;function wm(){return se.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let e=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!e.length)return s;let t=s.newDoc,{head:i}=s.newSelection.main,n=t.lineAt(i);if(i>n.from+bm)return s;let r=t.sliceString(n.from,i);if(!e.some(h=>h.test(r)))return s;let{state:o}=s,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=In(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=Ci(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const mc=F.define(),yc=new ee;function xm(s){let e=s.firstChild,t=s.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&h.to>t&&(r=h)}}return r}function Sm(s){let e=s.lastChild;return e&&e.to==s.to&&e.type.isError}function Ki(s,e,t){for(let i of s.facet(mc)){let n=i(s,e,t);if(n)return n}return km(s,e,t)}function vc(s,e){let t=e.mapPos(s.from,1),i=e.mapPos(s.to,-1);return t>=i?void 0:{from:t,to:i}}const Qi=oe.define({map:vc}),Ai=oe.define({map:vc});function No(s){let e=[];for(let{head:t}of s.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(s.lineBlockAt(t));return e}const zt=vt.define({create(){return re.none},update(s,e){e.isUserEvent("delete")&&e.changes.iterChangedRanges((t,i)=>s=ra(s,t,i)),s=s.map(e.changes);for(let t of e.effects)if(t.is(Qi)&&!Am(s,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(Fo),n=i?re.replace({widget:new Om(i(e.state,t.value))}):oa;s=s.update({add:[n.range(t.value.from,t.value.to)]})}else t.is(Ai)&&(s=s.update({filter:(i,n)=>t.value.from!=i||t.value.to!=n,filterFrom:t.value.from,filterTo:t.value.to}));return e.selection&&(s=ra(s,e.selection.main.head)),s},provide:s=>H.decorations.from(s),toJSON(s,e){let t=[];return s.between(0,e.doc.length,(i,n)=>{t.push(i,n)}),t},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{ne&&(i=!0)}),i?s.update({filterFrom:e,filterTo:t,filter:(n,r)=>n>=t||r<=e}):s}function Cm(s){return s.field(zt,!1)||ie.empty}function An(s,e,t){var i;let n=null;return(i=s.field(zt,!1))===null||i===void 0||i.between(e,t,(r,o)=>{(!n||n.from>r)&&(n={from:r,to:o})}),n}function Am(s,e,t){let i=!1;return s.between(e,e,(n,r)=>{n==e&&r==t&&(i=!0)}),i}function _o(s,e){return s.field(zt,!1)?e:e.concat(oe.appendConfig.of(Wo()))}const bc=s=>{for(let e of No(s)){let t=Ki(s.state,e.from,e.to);if(t)return s.dispatch({effects:_o(s.state,[Qi.of(t),Os(s,t)])}),!0}return!1},wc=s=>{if(!s.state.field(zt,!1))return!1;let e=[];for(let t of No(s)){let i=An(s.state,t.from,t.to);i&&e.push(Ai.of(i),Os(s,i,!1))}return e.length&&s.dispatch({effects:e}),e.length>0};function Os(s,e,t=!0){let i=s.state.doc.lineAt(e.from).number,n=s.state.doc.lineAt(e.to).number;return H.announce.of(`${s.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${s.state.phrase("to")} ${n}.`)}const xc=s=>{let{state:e}=s,t=[];for(let i=0;i{let e=s.state.field(zt,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,s.state.doc.length,(i,n)=>{t.push(Ai.of({from:i,to:n}))}),s.dispatch({effects:t}),!0};function Mm(s,e){for(let t=e;;){let i=Ki(s.state,t.from,t.to);if(i&&i.to>e.from)return i;if(!t.from)return null;t=s.lineBlockAt(t.from-1)}}const Tm=s=>{let e=[];for(let t of No(s)){let i=An(s.state,t.from,t.to);if(i)e.push(Ai.of(i),Os(s,i,!1));else{let n=Mm(s,t);n&&e.push(Qi.of(n),Os(s,n))}}return e.length>0&&s.dispatch({effects:_o(s.state,e)}),!!e.length},Dm=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:bc},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:wc},{key:"Ctrl-Alt-[",run:xc},{key:"Ctrl-Alt-]",run:kc}],Em={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Fo=F.define({combine(s){return Ln(s,Em)}});function Wo(s){let e=[zt,Rm];return s&&e.push(Fo.of(s)),e}function Sc(s,e){let{state:t}=s,i=t.facet(Fo),n=o=>{let l=s.lineBlockAt(s.posAtDOM(o.target)),a=An(s.state,l.from,l.to);a&&s.dispatch({effects:Ai.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(s,n,e);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}const oa=re.replace({widget:new class extends Yi{toDOM(s){return Sc(s,null)}}});class Om extends Yi{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Sc(e,this.value)}}const Lm={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class yr extends ri{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function Bm(s={}){let e={...Lm,...s},t=new yr(e,!0),i=new yr(e,!1),n=st.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet($t)!=o.state.facet($t)||o.startState.field(zt,!1)!=o.state.field(zt,!1)||_e(o.startState)!=_e(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new ti;for(let a of o.viewportLineBlocks){let h=An(o.state,a.from,a.to)?i:Ki(o.state,a.from,a.to)?t:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=e;return[n,Dg({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(n))===null||l===void 0?void 0:l.markers)||ie.empty},initialSpacer(){return new yr(e,!1)},domEventHandlers:{...r,click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=An(o.state,l.from,l.to);if(h)return o.dispatch({effects:Ai.of(h)}),!0;let c=Ki(o.state,l.from,l.to);return c?(o.dispatch({effects:Qi.of(c)}),!0):!1}}}),Wo()]}const Rm=H.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class Mi{constructor(e,t){this.specs=e;let i;function n(l){let a=ii.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof t.all=="string"?t.all:t.all?n(t.all):void 0,o=t.scope;this.scope=o instanceof qe?l=>l.prop(Zt)==o.data:o?l=>l==o:void 0,this.style=lc(e.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new ii(i):null,this.themeType=t.themeType}static define(e,t){return new Mi(e,t||{})}}const so=F.define(),Cc=F.define({combine(s){return s.length?[s[0]]:null}});function fs(s){let e=s.facet(so);return e.length?e:s.facet(Cc)}function Ac(s,e){let t=[Nm],i;return s instanceof Mi&&(s.module&&t.push(H.styleModule.of(s.module)),i=s.themeType),e!=null&&e.fallback?t.push(Cc.of(s)):i?t.push(so.computeN([H.darkTheme],n=>n.facet(H.darkTheme)==(i=="dark")?[s]:[])):t.push(so.of(s)),t}function Pm(s,e,t){let i=fs(s),n=null;if(i){for(let r of i)if(!r.scope||t&&r.scope(t)){let o=r.style(e);o&&(n=n?n+" "+o:o)}}return n}class Im{constructor(e){this.markCache=Object.create(null),this.tree=_e(e.state),this.decorations=this.buildDeco(e,fs(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=_e(e.state),i=fs(e.state),n=i!=fs(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||n)&&(this.tree=t,this.decorations=this.buildDeco(e.view,i),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return re.none;let i=new ti;for(let{from:n,to:r}of e.visibleRanges)im(this.tree,t,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=re.mark({class:a})))},n,r);return i.finish()}}const Nm=On.high(st.fromClass(Im,{decorations:s=>s.decorations})),_m=Mi.define([{tag:v.meta,color:"#404740"},{tag:v.link,textDecoration:"underline"},{tag:v.heading,textDecoration:"underline",fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.strong,fontWeight:"bold"},{tag:v.strikethrough,textDecoration:"line-through"},{tag:v.keyword,color:"#708"},{tag:[v.atom,v.bool,v.url,v.contentSeparator,v.labelName],color:"#219"},{tag:[v.literal,v.inserted],color:"#164"},{tag:[v.string,v.deleted],color:"#a11"},{tag:[v.regexp,v.escape,v.special(v.string)],color:"#e40"},{tag:v.definition(v.variableName),color:"#00f"},{tag:v.local(v.variableName),color:"#30a"},{tag:[v.typeName,v.namespace],color:"#085"},{tag:v.className,color:"#167"},{tag:[v.special(v.variableName),v.macroName],color:"#256"},{tag:v.definition(v.propertyName),color:"#00c"},{tag:v.comment,color:"#940"},{tag:v.invalid,color:"#f00"}]),Fm=H.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Mc=1e4,Tc="()[]{}",Dc=F.define({combine(s){return Ln(s,{afterCursor:!0,brackets:Tc,maxScanDistance:Mc,renderMatch:Vm})}}),Wm=re.mark({class:"cm-matchingBracket"}),Hm=re.mark({class:"cm-nonmatchingBracket"});function Vm(s){let e=[],t=s.matched?Wm:Hm;return e.push(t.range(s.start.from,s.start.to)),s.end&&e.push(t.range(s.end.from,s.end.to)),e}function la(s){let e=[],t=s.facet(Dc);for(let i of s.selection.ranges){if(!i.empty)continue;let n=mt(s,i.head,-1,t)||i.head>0&&mt(s,i.head-1,1,t)||t.afterCursor&&(mt(s,i.head,1,t)||i.heads.decorations}),zm=[$m,Fm];function qm(s={}){return[Dc.of(s),zm]}const Ec=new ee;function ro(s,e,t){let i=s.prop(e<0?ee.openedBy:ee.closedBy);if(i)return i;if(s.name.length==1){let n=t.indexOf(s.name);if(n>-1&&n%2==(e<0?1:0))return[t[n+e]]}return null}function oo(s){let e=s.type.prop(Ec);return e?e(s.node):s}function mt(s,e,t,i={}){let n=i.maxScanDistance||Mc,r=i.brackets||Tc,o=_e(s),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let h=ro(a.type,t,r);if(h&&a.from0?e>=c.from&&ec.from&&e<=c.to))return Um(s,e,t,a,c,h,r)}}return Km(s,e,t,o,l.type,n,r)}function Um(s,e,t,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},h=0,c=l==null?void 0:l.cursor();if(c&&(t<0?c.childBefore(i.from):c.childAfter(i.to)))do if(t<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from0)return null;let h={from:t<0?e-1:e,to:t>0?e+1:e},c=s.doc.iterRange(e,t>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;t<0&&(u+=d.length);let p=e+u*t;for(let g=t>0?0:d.length-1,y=t>0?d.length:-1;g!=y;g+=t){let b=o.indexOf(d[g]);if(!(b<0||i.resolveInner(p+g,1).type!=n))if(b%2==0==t>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:b>>1==a>>1};f--}}t>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}function aa(s,e,t,i=0,n=0){e==null&&(e=s.search(/[^\s\u00a0]/),e==-1&&(e=s.length));let r=n;for(let o=i;o=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.post}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPosi?o.toLowerCase():o,r=this.string.substr(this.pos,e.length);return n(r)==n(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let n=this.string.slice(this.pos).match(e);return n&&n.index>0?null:(n&&t!==!1&&(this.pos+=n[0].length),n)}}current(){return this.string.slice(this.start,this.pos)}}function jm(s){return{name:s.name||"",token:s.token,blankLine:s.blankLine||(()=>{}),startState:s.startState||(()=>!0),copyState:s.copyState||Gm,indent:s.indent||(()=>null),languageData:s.languageData||{},tokenTable:s.tokenTable||zo,mergeTokens:s.mergeTokens!==!1}}function Gm(s){if(typeof s!="object")return s;let e={};for(let t in s){let i=s[t];e[t]=i instanceof Array?i.slice():i}return e}const ha=new WeakMap;class Vo extends qe{constructor(e){let t=Ro(e.languageData),i=jm(e),n,r=new class extends rc{createParse(o,l,a){return new Ym(n,o,l,a)}};super(t,r,[],e.name),this.topNode=Zm(t,this),n=this,this.streamParser=i,this.stateAfter=new ee({perNode:!0}),this.tokenTable=e.tokenTable?new Rc(i.tokenTable):Qm}static define(e){return new Vo(e)}getIndent(e){let t,{overrideIndentation:i}=e.options;i&&(t=ha.get(e.state),t!=null&&t1e4)return null;for(;r=i&&t+e.length<=n&&e.prop(s.stateAfter);if(r)return{state:s.streamParser.copyState(r),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let l=e.children[o],a=t+e.positions[o],h=l instanceof ce&&a=e.length)return e;!n&&t==0&&e.type==s.topNode&&(n=!0);for(let r=e.children.length-1;r>=0;r--){let o=e.positions[r],l=e.children[r],a;if(ot&&$o(s,r.tree,0-r.offset,t,l),h;if(a&&a.pos<=i&&(h=Oc(s,r.tree,t+r.offset,a.pos+r.offset,!1)))return{state:a.state,tree:h}}return{state:s.streamParser.startState(n?li(n):4),tree:ce.empty}}class Ym{constructor(e,t,i,n){this.lang=e,this.input=t,this.fragments=i,this.ranges=n,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=n[n.length-1].to;let r=Si.get(),o=n[0].from,{state:l,tree:a}=Jm(e,i,o,this.to,r==null?void 0:r.state);this.state=l,this.parsedPos=this.chunkStart=o+a.length;for(let h=0;hh.from<=r.viewport.from&&h.to>=r.viewport.from)&&(this.state=this.lang.streamParser.startState(li(r.state)),r.skipUntilInView(this.parsedPos,r.viewport.from),this.parsedPos=r.viewport.from),this.moveRangeIndex()}advance(){let e=Si.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),i=Math.min(t,this.chunkStart+512);for(e&&(i=Math.min(i,e.viewport.to));this.parsedPos=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==` `&&(t="");else{let i=t.indexOf(` -`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){n=this.skipGapsTo(t,n,1),t+=n;let l=this.chunk.length;n=this.skipGapsTo(i,n,-1),i+=n,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),n}parseLine(e){let{line:t,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new Ho(t,e?e.state.tabSize:4,e?li(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Lc(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return n}throw new Error("Stream parser failed to advance stream.")}const zo=Object.create(null),Mn=[Ke.none],Xm=new Eo(Mn),ca=[],fa=Object.create(null),Bc=Object.create(null);for(let[s,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"]])Bc[s]=Pc(zo,e);class Rc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Bc)}resolve(e){return e?this.table[e]||(this.table[e]=Pc(this.extra,e)):0}}const Qm=new Rc(zo);function vr(s,e){ca.indexOf(s)>-1||(ca.push(s),console.warn(e))}function Pc(s,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=s[h]||v[h];c?typeof c=="function"?a.length?a=a.map(c):vr(h,`Modifier ${h} used at start of tag`):a.length?vr(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:vr(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),n=i+" "+t.map(l=>l.id),r=fa[n];if(r)return r.id;let o=fa[n]=Ke.define({id:Mn.length,name:i,props:[em({[i]:t})]});return Mn.push(o),o.id}function Zm(s,e){let t=Ke.define({id:Mn.length,name:"Document",props:[Zt.add(()=>s),Io.add(()=>i=>e.getIndent(i))],top:!0});return Mn.push(t),t}function Ic(s){return s.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(s)}function Nc(s){for(let e=s.iter();!e.next().done;)if(Ic(e.value))return!0;return!1}function e0(s){let e=!1;return s.iterChanges((t,i,n,r,o)=>{!e&&Nc(o)&&(e=!0)}),e}const lo=F.define({combine:s=>s.some(e=>e)});function t0(s={}){let e=[i0];return s.alwaysIsolate&&e.push(lo.of(!0)),e}const i0=st.fromClass(class{constructor(s){this.always=s.state.facet(lo)||s.textDirection!=pe.LTR||s.state.facet(H.perLineTextDirection),this.hasRTL=!this.always&&Nc(s.state.doc),this.tree=_e(s.state),this.decorations=this.always||this.hasRTL?ua(s,this.tree,this.always):re.none}update(s){let e=s.state.facet(lo)||s.view.textDirection!=pe.LTR||s.state.facet(H.perLineTextDirection);if(!e&&!this.hasRTL&&e0(s.changes)&&(this.hasRTL=!0),!e&&!this.hasRTL)return;let t=_e(s.state);(e!=this.always||t!=this.tree||s.docChanged||s.viewportChanged)&&(this.tree=t,this.always=e,this.decorations=ua(s.view,t,e))}},{provide:s=>{function e(t){var i,n;return(n=(i=t.plugin(s))===null||i===void 0?void 0:i.decorations)!==null&&n!==void 0?n:re.none}return[H.outerDecorations.of(e),On.lowest(H.bidiIsolatedRanges.of(e))]}});function ua(s,e,t){let i=new ti,n=s.visibleRanges;t||(n=n0(n,s.state.doc));for(let{from:r,to:o}of n)e.iterate({enter:l=>{let a=l.type.prop(ee.isolate);a&&i.add(l.from,l.to,s0[a])},from:r,to:o});return i.finish()}function n0(s,e){let t=e.iter(),i=0,n=[],r=null;for(let{from:o,to:l}of s)if(!(r&&r.to>o&&(o=r.to,o>=l)))for(i+t.value.lengtha-10?r.to=Math.min(l,h):n.push(r={from:a,to:Math.min(l,h)})),h>=l)break;i=h,t.next()}return n}const s0={rtl:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:pe.RTL}),ltr:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:pe.LTR}),auto:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})},r0=Object.freeze(Object.defineProperty({__proto__:null,DocInput:cc,HighlightStyle:Mi,IndentContext:Xi,LRLanguage:Es,Language:qe,LanguageDescription:Po,LanguageSupport:am,ParseContext:Si,StreamLanguage:Vo,StringStream:Ho,TreeIndentContext:Ks,bidiIsolates:t0,bracketMatching:qm,bracketMatchingHandle:Ec,codeFolding:Wo,continuedIndent:vm,defaultHighlightStyle:_m,defineLanguageFacet:Ro,delimitedIndent:mm,ensureSyntaxTree:hc,flatIndent:ym,foldAll:xc,foldCode:bc,foldEffect:Qi,foldGutter:Bm,foldInside:xm,foldKeymap:Dm,foldNodeProp:yc,foldService:mc,foldState:zt,foldable:Ki,foldedRanges:Cm,forceParsing:om,getIndentUnit:li,getIndentation:In,highlightingFor:Pm,indentNodeProp:Io,indentOnInput:wm,indentRange:hm,indentService:dc,indentString:Ci,indentUnit:Us,language:$t,languageDataProp:Zt,matchBrackets:mt,sublanguageProp:ac,syntaxHighlighting:Ac,syntaxParserRunning:lm,syntaxTree:_e,syntaxTreeAvailable:rm,toggleFold:Tm,unfoldAll:kc,unfoldCode:wc,unfoldEffect:Ai},Symbol.toStringTag,{value:"Module"})),o0=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),i=Uo(s.state,t.from);return i.line?l0(s):i.block?h0(s):!1};function qo(s,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=s(e,t);return n?(i(t.update(n)),!0):!1}}const l0=qo(u0,0),a0=qo(_c,0),h0=qo((s,e)=>_c(s,e,f0(e)),0);function Uo(s,e){let t=s.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const on=50;function c0(s,{open:e,close:t},i,n){let r=s.sliceDoc(i-on,i),o=s.sliceDoc(n,n+on),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let c,f;n-i<=2*on?c=f=s.sliceDoc(i,n):(c=s.sliceDoc(i,i+on),f=s.sliceDoc(n-on,n));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:n-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function f0(s){let e=[];for(let t of s.selection.ranges){let i=s.doc.lineAt(t.from),n=t.to<=i.to?i:s.doc.lineAt(t.to);n.from>i.from&&n.from==t.to&&(n=t.to==i.to+1?i:s.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=n.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return e}function _c(s,e,t=e.selection.ranges){let i=t.map(r=>Uo(e,r.from).block);if(!i.every(r=>r))return null;let n=t.map((r,o)=>c0(e,i[o],r.from,r.to));if(s!=2&&!n.every(r=>r))return{changes:e.changes(t.map((r,o)=>n[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(s!=1&&n.some(r=>r)){let r=[];for(let o=0,l;on&&(r==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(s!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const ao=ai.define(),d0=ai.define(),p0=F.define(),Fc=F.define({combine(s){return Ln(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),Wc=bt.define({create(){return Rt.empty},update(s,e){let t=e.state.facet(Fc),i=e.annotation(ao);if(i){let a=Je.fromTransaction(e,i.selection),h=i.side,c=h==0?s.undone:s.done;return a?c=Ls(c,c.length,t.minDepth,a):c=$c(c,e.startState.selection),new Rt(h==0?i.rest:c,h==0?c:i.rest)}let n=e.annotation(d0);if((n=="full"||n=="before")&&(s=s.isolate()),e.annotation(Ae.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=Je.fromTransaction(e),o=e.annotation(Ae.time),l=e.annotation(Ae.userEvent);return r?s=s.addChanges(r,o,l,t,e):e.selection&&(s=s.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(n=="full"||n=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new Rt(s.done.map(Je.fromJSON),s.undone.map(Je.fromJSON))}});function g0(s={}){return[Wc,Fc.of(s),H.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Hc:e.inputType=="historyRedo"?ho:null;return i?(e.preventDefault(),i(t)):!1}})]}function js(s,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let n=t.field(Wc,!1);if(!n)return!1;let r=n.pop(s,t,e);return r?(i(r),!0):!1}}const Hc=js(0,!1),ho=js(1,!1),m0=js(0,!0),y0=js(1,!0);class Je{constructor(e,t,i,n,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(e){return new Je(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(n=>n.toJSON())}}static fromJSON(e){return new Je(e.changes&&Ce.fromJSON(e.changes),[],e.mapped&&Pt.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let i=ct;for(let n of e.startState.facet(p0)){let r=n(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Je(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,ct)}static selection(e){return new Je(void 0,ct,void 0,void 0,e)}}function Ls(s,e,t,i){let n=e+1>t+20?e-t-1:0,r=s.slice(n,e);return r.push(i),r}function v0(s,e){let t=[],i=!1;return s.iterChangedRanges((n,r)=>t.push(n,r)),e.iterChangedRanges((n,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function b0(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Vc(s,e){return s.length?e.length?s.concat(e):s:e}const ct=[],w0=200;function $c(s,e){if(s.length){let t=s[s.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-w0));return i.length&&i[i.length-1].eq(e)?s:(i.push(e),Ls(s,s.length-1,1e9,t.setSelAfter(i)))}else return[Je.selection([e])]}function x0(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function br(s,e){if(!s.length)return s;let t=s.length,i=ct;for(;t;){let n=k0(s[t-1],e,i);if(n.changes&&!n.changes.empty||n.effects.length){let r=s.slice(0,t);return r[t-1]=n,r}else e=n.mapped,t--,i=n.selectionsAfter}return i.length?[Je.selection(i)]:ct}function k0(s,e,t){let i=Vc(s.selectionsAfter.length?s.selectionsAfter.map(l=>l.map(e)):ct,t);if(!s.changes)return Je.selection(i);let n=s.changes.map(e),r=e.mapDesc(s.changes,!0),o=s.mapped?s.mapped.composeDesc(r):r;return new Je(n,oe.mapEffects(s.effects,e),o,s.startSelection.map(r),i)}const S0=/^(input\.type|delete)($|\.)/;class Rt{constructor(e,t,i=0,n=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Rt(this.done,this.undone):this}addChanges(e,t,i,n,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||S0.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Gs(t,e))}function Ve(s){return s.textDirectionAt(s.state.selection.main.head)==pe.LTR}const qc=s=>zc(s,!Ve(s)),Uc=s=>zc(s,Ve(s));function Kc(s,e){return xt(s,t=>t.empty?s.moveByGroup(t,e):Gs(t,e))}const A0=s=>Kc(s,!Ve(s)),M0=s=>Kc(s,Ve(s));function T0(s,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Js(s,e,t){let i=_e(s).resolveInner(e.head),n=t?ee.closedBy:ee.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;T0(s,h,n)?i=h:a=t?h.to:h.from}let r=i.type.prop(n),o,l;return r&&(o=t?mt(s,i.from,1):mt(s,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,S.cursor(l,t?-1:1)}const D0=s=>xt(s,e=>Js(s.state,e,!Ve(s))),E0=s=>xt(s,e=>Js(s.state,e,Ve(s)));function jc(s,e){return xt(s,t=>{if(!t.empty)return Gs(t,e);let i=s.moveVertically(t,e);return i.head!=t.head?i:s.moveToLineBoundary(t,e)})}const Gc=s=>jc(s,!1),Jc=s=>jc(s,!0);function Yc(s){let e=s.scrollDOM.clientHeighto.empty?s.moveVertically(o,e,t.height):Gs(o,e));if(n.eq(i.selection))return!1;let r;if(t.selfScroll){let o=s.coordsAtPos(i.selection.main.head),l=s.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomXc(s,!1),co=s=>Xc(s,!0);function hi(s,e,t){let i=s.lineBlockAt(e.head),n=s.moveToLineBoundary(e,t);if(n.head==e.head&&n.head!=(t?i.to:i.from)&&(n=s.moveToLineBoundary(e,t,!1)),!t&&n.head==i.from&&i.length){let r=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(n=S.cursor(i.from+r))}return n}const O0=s=>xt(s,e=>hi(s,e,!0)),L0=s=>xt(s,e=>hi(s,e,!1)),B0=s=>xt(s,e=>hi(s,e,!Ve(s))),R0=s=>xt(s,e=>hi(s,e,Ve(s))),P0=s=>xt(s,e=>S.cursor(s.lineBlockAt(e.head).from,1)),I0=s=>xt(s,e=>S.cursor(s.lineBlockAt(e.head).to,-1));function N0(s,e,t){let i=!1,n=Zi(s.selection,r=>{let o=mt(s,r.head,-1)||mt(s,r.head,1)||r.head>0&&mt(s,r.head-1,1)||r.headN0(s,e);function ut(s,e,t){let i=Zi(s.state.selection,n=>{n.undirectional&&n.head>=n.anchor!=e&&(n=S.range(n.head,n.anchor));let r=t(n);return S.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return i.eq(s.state.selection)?!1:(s.dispatch(wt(s.state,i)),!0)}function Qc(s,e){return ut(s,e,t=>s.moveByChar(t,e))}const Zc=s=>Qc(s,!Ve(s)),ef=s=>Qc(s,Ve(s));function tf(s,e){return ut(s,e,t=>s.moveByGroup(t,e))}const F0=s=>tf(s,!Ve(s)),W0=s=>tf(s,Ve(s)),H0=s=>{let e=!Ve(s);return ut(s,e,t=>Js(s.state,t,e))},V0=s=>{let e=Ve(s);return ut(s,e,t=>Js(s.state,t,e))};function nf(s,e){return ut(s,e,t=>s.moveVertically(t,e))}const sf=s=>nf(s,!1),rf=s=>nf(s,!0);function of(s,e){return ut(s,e,t=>s.moveVertically(t,e,Yc(s).height))}const pa=s=>of(s,!1),ga=s=>of(s,!0),$0=s=>ut(s,!0,e=>hi(s,e,!0)),z0=s=>ut(s,!1,e=>hi(s,e,!1)),q0=s=>{let e=!Ve(s);return ut(s,e,t=>hi(s,t,e))},U0=s=>{let e=Ve(s);return ut(s,e,t=>hi(s,t,e))},K0=s=>ut(s,!1,e=>S.cursor(s.lineBlockAt(e.head).from)),j0=s=>ut(s,!0,e=>S.cursor(s.lineBlockAt(e.head).to)),ma=({state:s,dispatch:e})=>(e(wt(s,{anchor:0})),!0),ya=({state:s,dispatch:e})=>(e(wt(s,{anchor:s.doc.length})),!0),va=({state:s,dispatch:e})=>(e(wt(s,{anchor:s.selection.main.anchor,head:0})),!0),ba=({state:s,dispatch:e})=>(e(wt(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),G0=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),J0=({state:s,dispatch:e})=>{let t=Ys(s).map(({from:i,to:n})=>S.range(i,Math.min(n+1,s.doc.length)));return e(s.update({selection:S.create(t),userEvent:"select"})),!0},Y0=({state:s,dispatch:e})=>{let t=Zi(s.selection,i=>{let n=_e(s),r=n.resolveStack(i.from,1);if(i.empty){let o=n.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return S.range(l.to,l.from)}return i});return t.eq(s.selection)?!1:(e(wt(s,t)),!0)};function lf(s,e){let{state:t}=s,i=t.selection,n=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to0)for(let l=r;;){let a=s.moveVertically(l,e);if(a.heado.to){n.some(h=>h.head==a.head)||n.push(a);break}else{if(a.head==l.head)break;l=a}}}return n.length==i.ranges.length?!1:(s.dispatch(wt(t,S.create(n,n.length-1))),!0)}const X0=s=>lf(s,!1),Q0=s=>lf(s,!0),Z0=({state:s,dispatch:e})=>{let t=s.selection,i=null;return t.ranges.length>1?i=S.create([t.main]):t.main.empty||(i=S.create([S.cursor(t.main.head)])),i?(e(wt(s,i)),!0):!1};function Nn(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:i}=s,n=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=is(s,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=is(s,o,!1),l=is(s,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:S.cursor(o,on(s)))i.between(e,e,(n,r)=>{ne&&(e=t?r:n)});return e}const af=(s,e,t)=>Nn(s,i=>{let n=i.from,{state:r}=s,o=r.doc.lineAt(n),l,a;if(t&&!e&&n>o.from&&naf(s,!1,!0),hf=s=>af(s,!0,!1),cf=(s,e)=>Nn(s,t=>{let i=t.head,{state:n}=s,r=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?n.doc.lines:1)&&(i+=e?1:-1);break}let a=Oe(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),ff=s=>cf(s,!1),ey=s=>cf(s,!0),ty=s=>Nn(s,e=>{let t=s.lineBlockAt(e.head).to;return e.headNn(s,e=>{let t=s.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),ny=s=>Nn(s,e=>{let t=s.moveToLineBoundary(e,!0).head;return e.head{if(s.readOnly)return!1;let t=s.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:ne.of(["",""])},range:S.cursor(i.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ry=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(i=>{if(!i.empty||i.from==0||i.from==s.doc.length)return{range:i};let n=i.from,r=s.doc.lineAt(n),o=n==r.from?n-1:Oe(r.text,n-r.from,!1)+r.from,l=n==r.to?n+1:Oe(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:s.doc.slice(n,l).append(s.doc.slice(o,n))},range:S.cursor(l)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Ys(s){let e=[],t=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.from),r=s.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=s.doc.lineAt(i.to-1)),t>=n.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:n.from,to:r.to,ranges:[i]});t=r.number+1}return e}function uf(s,e,t){if(s.readOnly)return!1;let i=[],n=[];for(let r of Ys(s)){if(t?r.to==s.doc.length:r.from==0)continue;let o=s.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+s.lineBreak});for(let a of r.ranges)n.push(S.range(Math.min(s.doc.length,a.anchor+l),Math.min(s.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:s.lineBreak+o.text});for(let a of r.ranges)n.push(S.range(a.anchor-l,a.head-l))}}return i.length?(e(s.update({changes:i,scrollIntoView:!0,selection:S.create(n,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const oy=({state:s,dispatch:e})=>uf(s,e,!1),ly=({state:s,dispatch:e})=>uf(s,e,!0);function df(s,e,t){if(s.readOnly)return!1;let i=[];for(let r of Ys(s))t?i.push({from:r.from,insert:s.doc.slice(r.from,r.to)+s.lineBreak}):i.push({from:r.to,insert:s.lineBreak+s.doc.slice(r.from,r.to)});let n=s.changes(i);return e(s.update({changes:n,selection:s.selection.map(n,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ay=({state:s,dispatch:e})=>df(s,e,!1),hy=({state:s,dispatch:e})=>df(s,e,!0),cy=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(Ys(e).map(({from:n,to:r})=>(n>0?n--:r{let r;if(s.lineWrapping){let o=s.lineBlockAt(n.head),l=s.coordsAtPos(n.head,n.assoc||1);l&&(r=o.bottom+s.documentTop-l.bottom+s.defaultLineHeight/2)}return s.moveVertically(n,!0,r)}).map(t);return s.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function fy(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=_e(s).resolveInner(e),i=t.childBefore(e),n=t.childAfter(e),r;return i&&n&&i.to<=e&&n.from>=e&&(r=i.type.prop(ee.closedBy))&&r.indexOf(n.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(n.from).from&&!/\S/.test(s.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const wa=pf(!1),uy=pf(!0);function pf(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(n=>{let{from:r,to:o}=n,l=e.doc.lineAt(r),a=!s&&r==o&&fy(e,r);s&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Xi(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=In(h,r);for(c==null&&(c=Ws(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let n=[];for(let o=i.from;o<=i.to;){let l=s.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,n,i),t=l.number),o=l.to+1}let r=s.changes(n);return{changes:n,range:S.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const dy=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),i=new Xi(s,{overrideIndentation:r=>{let o=t[r];return o??-1}}),n=Ko(s,(r,o,l)=>{let a=In(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=Ci(s,a);(h!=c||l.froms.readOnly?!1:(e(s.update(Ko(s,(t,i)=>{i.push({from:t.from,insert:s.facet(Us)})}),{userEvent:"input.indent"})),!0),gy=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Ko(s,(t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let r=Ws(n,s.tabSize),o=0,l=Ci(s,Math.max(0,r-li(s)));for(;o(s.setTabFocusMode(),!0),yy=[{key:"Ctrl-b",run:qc,shift:Zc,preventDefault:!0},{key:"Ctrl-f",run:Uc,shift:ef},{key:"Ctrl-p",run:Gc,shift:sf},{key:"Ctrl-n",run:Jc,shift:rf},{key:"Ctrl-a",run:P0,shift:K0},{key:"Ctrl-e",run:I0,shift:j0},{key:"Ctrl-d",run:hf},{key:"Ctrl-h",run:fo},{key:"Ctrl-k",run:ty},{key:"Ctrl-Alt-h",run:ff},{key:"Ctrl-o",run:sy},{key:"Ctrl-t",run:ry},{key:"Ctrl-v",run:co}],vy=[{key:"ArrowLeft",run:qc,shift:Zc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:A0,shift:F0,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:B0,shift:q0,preventDefault:!0},{key:"ArrowRight",run:Uc,shift:ef,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:M0,shift:W0,preventDefault:!0},{mac:"Cmd-ArrowRight",run:R0,shift:U0,preventDefault:!0},{key:"ArrowUp",run:Gc,shift:sf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ma,shift:va},{mac:"Ctrl-ArrowUp",run:da,shift:pa},{key:"ArrowDown",run:Jc,shift:rf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ya,shift:ba},{mac:"Ctrl-ArrowDown",run:co,shift:ga},{key:"PageUp",run:da,shift:pa},{key:"PageDown",run:co,shift:ga},{key:"Home",run:L0,shift:z0,preventDefault:!0},{key:"Mod-Home",run:ma,shift:va},{key:"End",run:O0,shift:$0,preventDefault:!0},{key:"Mod-End",run:ya,shift:ba},{key:"Enter",run:wa,shift:wa},{key:"Mod-a",run:G0},{key:"Backspace",run:fo,shift:fo,preventDefault:!0},{key:"Delete",run:hf,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ff,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ey,preventDefault:!0},{mac:"Mod-Backspace",run:iy,preventDefault:!0},{mac:"Mod-Delete",run:ny,preventDefault:!0}].concat(yy.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),by=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:D0,shift:H0},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:E0,shift:V0},{key:"Alt-ArrowUp",run:oy},{key:"Shift-Alt-ArrowUp",run:ay},{key:"Alt-ArrowDown",run:ly},{key:"Shift-Alt-ArrowDown",run:hy},{key:"Mod-Alt-ArrowUp",run:X0},{key:"Mod-Alt-ArrowDown",run:Q0},{key:"Escape",run:Z0},{key:"Mod-Enter",run:uy},{key:"Alt-l",mac:"Ctrl-l",run:J0},{key:"Mod-i",run:Y0,preventDefault:!0},{key:"Mod-[",run:gy},{key:"Mod-]",run:py},{key:"Mod-Alt-\\",run:dy},{key:"Shift-Mod-k",run:cy},{key:"Shift-Mod-\\",run:_0},{key:"Mod-/",run:o0},{key:"Alt-A",run:a0},{key:"Ctrl-m",mac:"Shift-Alt-m",run:my}].concat(vy),xa=typeof String.prototype.normalize=="function"?s=>s.normalize("NFKD"):s=>s;class Tn{constructor(e,t,i=0,n=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=r?l=>r(xa(l)):xa,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Va(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=vd(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=$a(e);let n=this.normalize(t);if(n.length)for(let r=0,o=i,l=!0;;r++){let a=n.charCodeAt(r),h=this.match(a,o,l,this.bufferPos+this.bufferStart,r==n.length-1);if(h)return this.value=h,this;if(r==n.length-1)break;l&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=Bs(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||n.to<=t){let l=new Hi(t,e.sliceString(t,i));return wr.set(e,l),l}if(n.from==t&&n.to==i)return n;let{text:r,from:o}=n;return o>t&&(r=e.sliceString(t,o)+r,o=t),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,n=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,precise:!0,match:t},this.matchPos=Bs(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Hi.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(mf.prototype[Symbol.iterator]=yf.prototype[Symbol.iterator]=function(){return this});function wy(s){try{return new RegExp(s,jo),!0}catch{return!1}}function Bs(s,e){if(e>=s.length)return e;let t=s.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}const xy=s=>{let{state:e}=s,t=String(e.doc.lineAt(s.state.selection.main.head).number),{close:i,result:n}=Cg(s,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return n.then(r=>{let o=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!o){s.dispatch({effects:i});return}let l=e.doc.lineAt(e.selection.main.head),[,a,h,c,f]=o,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let y=d/100;a&&(y=y*(a=="-"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*y)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),g=S.cursor(p.from+Math.max(0,Math.min(u,p.length)));s.dispatch({effects:[i,H.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},ky=({state:s,dispatch:e})=>{let{selection:t}=s,i=S.create(t.ranges.map(n=>s.wordAt(n.head)||S.cursor(n.head)),t.mainIndex);return i.eq(t)?!1:(e(s.update({selection:i})),!0)};function Sy(s,e){let{main:t,ranges:i}=s.selection,n=s.wordAt(t.head),r=n&&n.from==t.from&&n.to==t.to;for(let o=!1,l=new Tn(s.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Tn(s.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=s.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Cy=({state:s,dispatch:e})=>{let{ranges:t}=s.selection;if(t.some(r=>r.from===r.to))return ky({state:s,dispatch:e});let i=s.sliceDoc(t[0].from,t[0].to);if(s.selection.ranges.some(r=>s.sliceDoc(r.from,r.to)!=i))return!1;let n=Sy(s,i);return n?(e(s.update({selection:s.selection.addRange(S.range(n.from,n.to),!1),effects:H.scrollIntoView(n.to)})),!0):!1},Ti=F.define({combine(s){return Ln(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Wy(e),scrollToMatch:e=>H.scrollIntoView(e)})}});function Ay(s){return s?[Ti.of(s),po]:po}class vf{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||wy(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ly(this):new Dy(this)}getCursor(e,t=0,i){let n=e.doc?e:se.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?Li(this,n,t,i):Oi(this,n,t,i)}}class bf{constructor(e){this.spec=e}}function My(s,e,t){return(i,n,r,o)=>{if(t&&!t(i,n,r,o))return!1;let l=i>=o&&n<=o+r.length?r.slice(i-o,n-o):e.doc.sliceString(i,n);return s(l,e,i,n)}}function Oi(s,e,t,i){let n;return s.wholeWord&&(n=Ty(e.doc,e.charCategorizer(e.selection.main.head))),s.test&&(n=My(s.test,e,n)),new Tn(e.doc,s.unquoted,t,i,s.caseSensitive?void 0:r=>r.toLowerCase(),n)}function Ty(s,e){return(t,i,n,r)=>((r>t||r+n.length=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Oi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function Ey(s,e,t){return(i,n,r)=>(!t||t(i,n,r))&&s(r[0],e,i,n)}function Li(s,e,t,i){let n;return s.wholeWord&&(n=Oy(e.charCategorizer(e.selection.main.head))),s.test&&(n=Ey(s.test,e,n)),new mf(e.doc,s.search,{ignoreCase:!s.caseSensitive,test:n},t,i)}function Rs(s,e){return s.slice(Oe(s,e,!1),e)}function Ps(s,e){return s.slice(e,Oe(s,e))}function Oy(s){return(e,t,i)=>!i[0].length||(s(Rs(i.input,i.index))!=Ne.Word||s(Ps(i.input,i.index))!=Ne.Word)&&(s(Ps(i.input,i.index+i[0].length))!=Ne.Word||s(Rs(i.input,i.index+i[0].length))!=Ne.Word)}class Ly extends bf{nextMatch(e,t,i){let n=Li(this.spec,e,i,e.doc.length).next();return n.done&&(n=Li(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-n*1e4),o=Li(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let r=+i.slice(0,n);if(r>0&&r=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Li(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Dn=oe.define(),Go=oe.define(),ei=bt.define({create(s){return new xr(uo(s).create(),null)},update(s,e){for(let t of e.effects)t.is(Dn)?s=new xr(t.value.create(),s.panel):t.is(Go)&&(s=new xr(s.query,t.value?Jo:null));return s},provide:s=>Ms.from(s,e=>e.panel)});class xr{constructor(e,t){this.query=e,this.panel=t}}const By=re.mark({class:"cm-searchMatch"}),Ry=re.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Py=st.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(ei))}update(s){let e=s.state.field(ei);(e!=s.startState.field(ei)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:s,panel:e}){if(!e||!s.spec.valid)return re.none;let{view:t}=this,i=new ti;for(let n=0,r=t.visibleRanges,o=r.length;nr[n+1].from-2*250;)a=r[++n].to;s.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Ry:By)})}return i.finish()}},{decorations:s=>s.decorations});function _n(s){return e=>{let t=e.state.field(ei,!1);return t&&t.query.spec.valid?s(e,t):kf(e)}}const Is=_n((s,{query:e})=>{let{to:t}=s.state.selection.main,i=e.nextMatch(s.state,t,t);if(!i)return!1;let n=S.single(i.from,i.to),r=s.state.facet(Ti);return s.dispatch({selection:n,effects:[Yo(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),xf(s),!0}),Ns=_n((s,{query:e})=>{let{state:t}=s,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)return!1;let r=S.single(n.from,n.to),o=s.state.facet(Ti);return s.dispatch({selection:r,effects:[Yo(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),xf(s),!0}),Iy=_n((s,{query:e})=>{let t=e.matchAll(s.state,1e3);return!t||!t.length?!1:(s.dispatch({selection:S.create(t.map(i=>S.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ny=({state:s,dispatch:e})=>{let t=s.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:n}=t.main,r=[],o=0;for(let l=new Tn(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(S.range(l.value.from,l.value.to))}return e(s.update({selection:S.create(r,o),userEvent:"select.search.matches"})),!0},ka=_n((s,{query:e})=>{let{state:t}=s,{from:i,to:n}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.precise?o.from==i&&o.to==n&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(H.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):o=e.nextMatch(t,o.from,o.to);let f=s.state.changes(l);return o&&(a=S.single(o.from,o.to).map(f),c.push(Yo(s,o)),c.push(t.facet(Ti).scrollToMatch(a.main,s))),s.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),_y=_n((s,{query:e})=>{if(s.state.readOnly)return!1;let t=[];for(let n of e.matchAll(s.state,1e9)){let{from:r,to:o,precise:l}=n;l&&t.push({from:r,to:o,insert:e.getReplacement(n)})}if(!t.length)return!1;let i=s.state.phrase("replaced $ matches",t.length)+".";return s.dispatch({changes:t,effects:H.announce.of(i),userEvent:"input.replace.all"}),!0});function Jo(s){return s.state.facet(Ti).createPanel(s)}function uo(s,e){var t,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=s.facet(Ti);return new vf({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function wf(s){let e=Yh(s,Jo);return e&&e.dom.querySelector("[main-field]")}function xf(s){let e=wf(s);e&&e==s.root.activeElement&&e.select()}const kf=s=>{let e=s.state.field(ei,!1);if(e&&e.panel){let t=wf(s);if(t&&t!=s.root.activeElement){let i=uo(s.state,e.query.spec);i.valid&&s.dispatch({effects:Dn.of(i)}),t.focus(),t.select()}}else s.dispatch({effects:[Go.of(!0),e?Dn.of(uo(s.state,e.query.spec)):oe.appendConfig.of(po)]});return!0},Sf=s=>{let e=s.state.field(ei,!1);if(!e||!e.panel)return!1;let t=Yh(s,Jo);return t&&t.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:Go.of(!1)}),!0},Fy=[{key:"Mod-f",run:kf,scope:"editor search-panel"},{key:"F3",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Sf,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Ny},{key:"Mod-Alt-g",run:xy},{key:"Mod-d",run:Cy,preventDefault:!0}];class Wy{constructor(e){this.view=e;let t=this.query=e.state.field(ei).query.spec;this.commit=this.commit.bind(this),this.searchField=Ee("input",{value:t.search,placeholder:Ze(e,"Find"),"aria-label":Ze(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ee("input",{value:t.replace,placeholder:Ze(e,"Replace"),"aria-label":Ze(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ee("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ee("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ee("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(n,r,o){return Ee("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=Ee("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>Is(e),[Ze(e,"next")]),i("prev",()=>Ns(e),[Ze(e,"previous")]),i("select",()=>Iy(e),[Ze(e,"all")]),Ee("label",null,[this.caseField,Ze(e,"match case")]),Ee("label",null,[this.reField,Ze(e,"regexp")]),Ee("label",null,[this.wordField,Ze(e,"by word")]),...e.state.readOnly?[]:[Ee("br"),this.replaceField,i("replace",()=>ka(e),[Ze(e,"replace")]),i("replaceAll",()=>_y(e),[Ze(e,"replace all")])],Ee("button",{name:"close",onclick:()=>Sf(e),"aria-label":Ze(e,"close"),type:"button"},["×"])])}commit(){let e=new vf({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Dn.of(e)}))}keydown(e){xg(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ns:Is)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ka(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Dn)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ti).top}}function Ze(s,e){return s.state.phrase(e)}const ns=30,ss=/[\s\.,:;?!]/;function Yo(s,{from:e,to:t}){let i=s.state.doc.lineAt(e),n=s.state.doc.lineAt(t).to,r=Math.max(i.from,e-ns),o=Math.min(n,t+ns),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-ns;a--)if(!ss.test(l[a-1])&&ss.test(l[a])){l=l.slice(0,a);break}}return H.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const Hy=H.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),po=[ei,On.low(Py),Hy];function Vy(s){const e=s.lastIndexOf("/");return e>=0?s.slice(e+1):s}async function dt(s,e){const[{StreamLanguage:t},i]=await Promise.all([le(()=>Promise.resolve().then(()=>r0),void 0),s]),n=i[e];return t.define(n)}async function $y(s){const e=Vy(s);switch(e){case"Dockerfile":return dt(le(()=>import("./dockerfile-ZL4hHokT.js"),[]),"dockerFile");case"Gemfile":case"Rakefile":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"Makefile":case"GNUmakefile":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"c")}const t=/\.([A-Za-z0-9]+)$/.exec(e),i=t?t[1].toLowerCase():null;if(!i)return null;switch(i){case"js":case"jsx":case"ts":case"tsx":{const{javascript:n}=await le(async()=>{const{javascript:r}=await import("./index-CZ0p1U99.js");return{javascript:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return n({typescript:i==="ts"||i==="tsx",jsx:i==="jsx"||i==="tsx"})}case"json":{const{json:n}=await le(async()=>{const{json:r}=await import("./index-sMVa0oql.js");return{json:r}},__vite__mapDeps([10,1,3,4,5,6,7,8,9]));return n()}case"md":case"markdown":{const{markdown:n}=await le(async()=>{const{markdown:r}=await import("./index-Ak5-vsum.js");return{markdown:r}},__vite__mapDeps([11,2,12,1,13,3,4,5,6,7,8,9,0]));return n()}case"css":case"scss":{const{css:n}=await le(async()=>{const{css:r}=await import("./index-BSlQSXjR.js");return{css:r}},__vite__mapDeps([13,1,3,4,5,6,7,8,9]));return n()}case"html":case"htm":{const{html:n}=await le(async()=>{const{html:r}=await import("./index-CsH7OxDu.js");return{html:r}},__vite__mapDeps([12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"py":{const{python:n}=await le(async()=>{const{python:r}=await import("./index-DW5ZYIIZ.js");return{python:r}},__vite__mapDeps([14,1,2,3,4,5,6,7,8,9]));return n()}case"go":{const{go:n}=await le(async()=>{const{go:r}=await import("./index-LsOWRKMa.js");return{go:r}},__vite__mapDeps([15,1,2,3,4,5,6,7,8,9]));return n()}case"rs":{const{rust:n}=await le(async()=>{const{rust:r}=await import("./index-vv_fn0WP.js");return{rust:r}},__vite__mapDeps([16,1,3,4,5,6,7,8,9]));return n()}case"c":case"cc":case"cpp":case"cxx":case"h":case"hpp":case"hh":case"m":case"mm":{const{cpp:n}=await le(async()=>{const{cpp:r}=await import("./index-CH6joGJR.js");return{cpp:r}},__vite__mapDeps([17,1,3,4,5,6,7,8,9]));return n()}case"java":{const{java:n}=await le(async()=>{const{java:r}=await import("./index-Y0PF_oBA.js");return{java:r}},__vite__mapDeps([18,1,3,4,5,6,7,8,9]));return n()}case"php":{const{php:n}=await le(async()=>{const{php:r}=await import("./index-BEPhTiWa.js");return{php:r}},__vite__mapDeps([19,1,12,13,3,4,5,6,7,8,9,0,2]));return n()}case"sql":{const{sql:n}=await le(async()=>{const{sql:r}=await import("./index-hbreRbwz.js");return{sql:r}},__vite__mapDeps([20,1,2,3,4,5,6,7,8,9]));return n()}case"xml":case"xsd":case"xsl":case"plist":case"svg":{const{xml:n}=await le(async()=>{const{xml:r}=await import("./index-hP5cCp4S.js");return{xml:r}},__vite__mapDeps([21,1,3,4,5,6,7,8,9]));return n()}case"yml":case"yaml":{const{yaml:n}=await le(async()=>{const{yaml:r}=await import("./index-CrP2n_El.js");return{yaml:r}},__vite__mapDeps([22,1,3,4,5,6,7,8,9]));return n()}case"vue":{const{vue:n}=await le(async()=>{const{vue:r}=await import("./index-D9YFpvOI.js");return{vue:r}},__vite__mapDeps([23,12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"sass":{const{sass:n}=await le(async()=>{const{sass:r}=await import("./index-BfmBkV0O.js");return{sass:r}},__vite__mapDeps([24,1,13,3,4,5,6,7,8,9]));return n()}case"sh":case"bash":case"zsh":case"fish":case"ksh":return dt(le(()=>import("./shell-CjFT_Tl9.js"),[]),"shell");case"toml":return dt(le(()=>import("./toml-Bm5Em-hy.js"),[]),"toml");case"rb":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"lua":return dt(le(()=>import("./lua-VAEuO923.js"),[]),"lua");case"ini":case"properties":case"conf":return dt(le(()=>import("./properties-C78fOPTZ.js"),[]),"properties");case"diff":case"patch":return dt(le(()=>import("./diff-DbItnlRl.js"),[]),"diff");case"swift":return dt(le(()=>import("./swift-BzpIVaGY.js"),[]),"swift");case"kt":case"kts":case"scala":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"kotlin");default:return null}}const zy=Mi.define([{tag:v.keyword,color:"#f47067"},{tag:v.controlKeyword,color:"#f47067"},{tag:v.operatorKeyword,color:"#f47067"},{tag:v.definitionKeyword,color:"#f47067"},{tag:v.modifier,color:"#f47067"},{tag:v.string,color:"#96d0ff"},{tag:v.special(v.string),color:"#96d0ff"},{tag:v.regexp,color:"#96d0ff"},{tag:v.escape,color:"#96d0ff"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#768390",fontStyle:"italic"},{tag:v.number,color:"#6cb6ff"},{tag:v.bool,color:"#6cb6ff"},{tag:v.atom,color:"#6cb6ff"},{tag:v.function(v.variableName),color:"#dcbdfb"},{tag:v.function(v.propertyName),color:"#dcbdfb"},{tag:v.macroName,color:"#dcbdfb"},{tag:v.variableName,color:"#adbac7"},{tag:v.propertyName,color:"#adbac7"},{tag:v.typeName,color:"#ffaf6f"},{tag:v.className,color:"#ffaf6f"},{tag:v.namespace,color:"#ffaf6f"},{tag:v.operator,color:"#f47067"},{tag:v.punctuation,color:"#adbac7"},{tag:v.bracket,color:"#adbac7"},{tag:v.derefOperator,color:"#adbac7"},{tag:v.tagName,color:"#8ddb8c"},{tag:v.attributeName,color:"#dcbdfb"},{tag:v.attributeValue,color:"#96d0ff"},{tag:v.heading,color:"#6cb6ff",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#6cb6ff",textDecoration:"underline"},{tag:v.url,color:"#6cb6ff"},{tag:v.quote,color:"#768390"},{tag:v.monospace,color:"#96d0ff"},{tag:v.invalid,color:"#ff938a"},{tag:v.deleted,color:"#ff938a",backgroundColor:"rgba(244,112,103,0.15)"},{tag:v.inserted,color:"#8ddb8c",backgroundColor:"rgba(141,219,140,0.15)"}]),qy=Mi.define([{tag:v.keyword,color:"#cf222e"},{tag:v.controlKeyword,color:"#cf222e"},{tag:v.operatorKeyword,color:"#cf222e"},{tag:v.definitionKeyword,color:"#cf222e"},{tag:v.modifier,color:"#cf222e"},{tag:v.string,color:"#0a3069"},{tag:v.special(v.string),color:"#0a3069"},{tag:v.regexp,color:"#0a3069"},{tag:v.escape,color:"#0a3069"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#6e7781",fontStyle:"italic"},{tag:v.number,color:"#0550ae"},{tag:v.bool,color:"#0550ae"},{tag:v.atom,color:"#0550ae"},{tag:v.function(v.variableName),color:"#8250df"},{tag:v.function(v.propertyName),color:"#8250df"},{tag:v.macroName,color:"#8250df"},{tag:v.variableName,color:"#24292f"},{tag:v.propertyName,color:"#24292f"},{tag:v.typeName,color:"#953800"},{tag:v.className,color:"#953800"},{tag:v.namespace,color:"#953800"},{tag:v.operator,color:"#cf222e"},{tag:v.punctuation,color:"#24292f"},{tag:v.bracket,color:"#24292f"},{tag:v.derefOperator,color:"#24292f"},{tag:v.tagName,color:"#116329"},{tag:v.attributeName,color:"#8250df"},{tag:v.attributeValue,color:"#0a3069"},{tag:v.heading,color:"#0550ae",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#0969da",textDecoration:"underline"},{tag:v.url,color:"#0969da"},{tag:v.quote,color:"#6e7781"},{tag:v.monospace,color:"#0a3069"},{tag:v.invalid,color:"#82071e"},{tag:v.deleted,color:"#82071e",backgroundColor:"rgba(255,129,130,0.2)"},{tag:v.inserted,color:"#116329",backgroundColor:"rgba(74,194,107,0.2)"}]);function Uy(s){return Ac(s==="light"?qy:zy)}const Ky={class:"file-editor"},jy={key:0,class:"banner err conflict","data-test":"conflict-banner"},Gy={class:"msg"},Jy={key:1,class:"banner err","data-test":"save-error"},Yy={key:2,class:"reload-badge"},Xy={key:3,class:"banner muted"},Qy={key:4,class:"banner muted"},Zy={key:5,class:"banner err"},e1={key:6,class:"banner muted"},Sa=2*1024*1024,t1=Qe({__name:"CodeEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const{t:i}=Ji(),n=s,r=t,o=j(null),l=j("loading"),a=j(""),h=j(!1),c=j(null),f=j(!1),u=j(null),d=j("");let p=null,g=null,y=!1,b=0,x="";function T(L,R,Z,X,ue){return!y&&b===ue&&n.fs===L&&n.path===R&&n.showLineNumbers===Z&&n.theme===X}function D(L,R){return typeof window>"u"||!o.value?R:getComputedStyle(o.value).getPropertyValue(L).trim()||R}function A(L){let R;if(typeof L=="string"){const Z=atob(L);R=new Uint8Array(Z.length);for(let X=0;XSa){l.value="tooLarge",C(!1);return}const ot=await L.readFile(R,Sa);if(!T(L,R,Z,X,ue))return;const de=A(ot.data);x=de,C(!1),u.value=null,d.value="";const Te=H.updateListener.of($e=>{$e.docChanged&&C($e.state.doc.toString()!==x)}),De=Qr.of([{key:"Mod-s",preventDefault:!0,run:()=>(M(),!0)}]),Fe=[P(X),Uy(X),g0(),Ay({top:!0}),Qr.of([...by,...C0,...Fy]),De,Te];Z&&Fe.push(Ig());const Le=await $y(R);if(Le&&Fe.push(Le),!T(L,R,Z,X,ue)||!o.value)return;const je=new H({state:se.create({doc:de,extensions:Fe}),parent:o.value});if(!T(L,R,Z,X,ue)){je.destroy();return}p=je,l.value="ok"}catch(Me){if(!T(L,R,Z,X,ue))return;l.value="error",a.value=Me.message}}}async function M(){if(!p||l.value!=="ok")return!1;const L=p.state.doc.toString(),R=new TextEncoder().encode(L);d.value="";try{const Z=await n.fs.writeFile(n.path,R,c.value);return x=L,c.value=Z.modTime,h.value=!1,u.value=null,C(!1),!0}catch(Z){const X=Z.message??"",ue=/stale_modtime: current=(\d+)/.exec(X);return ue?u.value={currentModTime:Number(ue[1])}:d.value=X,!1}}async function $(){u.value&&(c.value=u.value.currentModTime,u.value=null,await M())}function N(){u.value=null,U()}async function I(L,R){const Z=n.path,X=b;if(!(!Z.startsWith(R+"/")&&Z!==R))try{const ue=await L.fileMeta(Z);if(y||n.fs!==L||n.path!==Z||b!==X)return;c.value&&ue.modTime>c.value&&(h.value=!0)}catch{}}function G(L){g==null||g(),g=L.onDirChanged(R=>{I(L,R)})}return En(()=>{y=!1,U(),G(n.fs)}),ft(()=>[n.path,n.fs,n.showLineNumbers,n.theme],()=>{U()}),ft(()=>n.fs,L=>G(L)),qt(()=>{y=!0,b++,p==null||p.destroy(),p=null,g&&g()}),e({save:M,testAppend:L=>{p&&p.dispatch({changes:{from:p.state.doc.length,insert:L}})}}),(L,R)=>(O(),V("div",Ky,[u.value?(O(),V("div",jy,[J("span",Gy,Q(q(i)("plugins.fileExplorer.staleModTime")),1),J("button",{"data-test":"conflict-overwrite",onClick:$},Q(q(i)("plugins.fileExplorer.overwrite")),1),J("button",{"data-test":"conflict-reload",onClick:N},Q(q(i)("plugins.fileExplorer.reloadDiscard")),1),J("button",{"data-test":"conflict-cancel",onClick:R[0]||(R[0]=Z=>u.value=null)},Q(q(i)("plugins.fileExplorer.cancel")),1)])):Ie("",!0),d.value?(O(),V("div",Jy,Q(q(i)("plugins.fileExplorer.saveFailed",{message:d.value})),1)):Ie("",!0),h.value?(O(),V("div",Yy,[ps(Q(q(i)("plugins.fileExplorer.fileChanged"))+" ",1),J("button",{onClick:U},Q(f.value?q(i)("plugins.fileExplorer.reloadDiscard"):q(i)("plugins.fileExplorer.reload")),1)])):Ie("",!0),l.value==="tooLarge"?(O(),V("div",Xy,Q(q(i)("plugins.fileExplorer.tooLarge")),1)):l.value==="binary"?(O(),V("div",Qy,Q(q(i)("plugins.fileExplorer.binary")),1)):l.value==="error"?(O(),V("div",Zy,Q(q(i)("plugins.fileExplorer.errorPrefix",{message:a.value})),1)):l.value==="loading"?(O(),V("div",e1,Q(q(i)("common.loading")),1)):Ie("",!0),ds(J("div",{ref_key:"host",ref:o,class:"cm-host"},null,512),[[If,l.value==="ok"]])]))}}),i1=rt(t1,[["__scopeId","data-v-25358a6a"]]),n1={class:"binary-banner"},s1={class:"msg"},r1=Qe({__name:"BinaryBanner",props:{fs:{},path:{},message:{}},setup(s){const e=s,{t}=Ji();async function i(){try{await e.fs.openExternal(e.path)}catch{}}return(n,r)=>(O(),V("div",n1,[J("span",s1,Q(n.message??q(t)("plugins.fileExplorer.unsupportedPreview")),1),J("button",{class:"open-btn",onClick:i},Q(q(t)("plugins.fileExplorer.openInSystem")),1)]))}}),ji=rt(r1,[["__scopeId","data-v-780ce2ee"]]),o1=["data-asset-request","src"],l1=Qe({__name:"ImagePreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=j(""),i=j(0),n=j("fit"),r=j(!1);let o=!0,l=0,a=null;function h(){var d,p;a&&((p=(d=a.fs).revokeAssetUrl)==null||p.call(d,a.path),a=null)}async function c(){var y;const d=e.fs,p=e.path,g=++l;i.value=g,h(),a={fs:d,path:p},t.value="",r.value=!1;try{const b=await d.assetUrlFor(p);if(!o||g!==l||e.fs!==d||e.path!==p){(y=d.revokeAssetUrl)==null||y.call(d,p);return}t.value=b}catch{o&&g===l&&e.fs===d&&e.path===p&&(r.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{c()},{immediate:!0}),qt(()=>{o=!1,l++,h()});function f(){n.value=n.value==="fit"?"native":"fit"}function u(d){const p=d.currentTarget;!t.value||!p||p.dataset.assetRequest!==String(i.value)||(h(),r.value=!0)}return(d,p)=>r.value?(O(),ke(ji,{key:0,fs:d.fs,path:d.path},null,8,["fs","path"])):(O(),V("div",{key:1,class:Gi(["img-host",n.value])},[(O(),V("img",{key:i.value,"data-asset-request":i.value,src:t.value,alt:"",onClick:f,onError:u},null,40,o1))],2))}}),a1=rt(l1,[["__scopeId","data-v-06adca93"]]),h1={key:1,class:"media-host"},c1=["data-asset-request","src"],f1=["data-asset-request","src"],u1=Qe({__name:"MediaPreview",props:{fs:{},path:{},kind:{}},setup(s){const e=s,t=j(""),i=j(0),n=j(!1);let r=!0,o=0,l=null;function a(){var f,u;l&&((u=(f=l.fs).revokeAssetUrl)==null||u.call(f,l.path),l=null)}async function h(){var p;const f=e.fs,u=e.path,d=++o;i.value=d,a(),l={fs:f,path:u},t.value="",n.value=!1;try{const g=await f.assetUrlFor(u);if(!r||d!==o||e.fs!==f||e.path!==u){(p=f.revokeAssetUrl)==null||p.call(f,u);return}t.value=g}catch{r&&d===o&&e.fs===f&&e.path===u&&(n.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{h()},{immediate:!0}),qt(()=>{r=!1,o++,a()});function c(f){const u=f.currentTarget;!t.value||!u||u.dataset.assetRequest!==String(i.value)||(a(),n.value=!0)}return(f,u)=>n.value?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):(O(),V("div",h1,[f.kind==="video"?(O(),V("video",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,c1)):(O(),V("audio",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,f1))]))}}),d1=rt(u1,[["__scopeId","data-v-71c6a6ef"]]),p1={key:1,class:"pdf-host"},g1=["data"],m1=Qe({__name:"PdfPreview",props:{fs:{},path:{}},setup(s){const e=s,t=j(""),i=j(!1);let n=!0,r=0,o=null;function l(){var h,c;o&&((c=(h=o.fs).revokeAssetUrl)==null||c.call(h,o.path),o=null)}async function a(){var u;const h=e.fs,c=e.path,f=++r;l(),o={fs:h,path:c},t.value="",i.value=!1;try{const d=await h.assetUrlFor(c);if(!n||f!==r||e.fs!==h||e.path!==c){(u=h.revokeAssetUrl)==null||u.call(h,c);return}t.value=d}catch{n&&f===r&&e.fs===h&&e.path===c&&(i.value=!0)}}return ft(()=>[e.path,e.fs.identity],()=>{a()},{immediate:!0}),qt(()=>{n=!1,r++,l()}),(h,c)=>i.value?(O(),ke(ji,{key:0,fs:h.fs,path:h.path},null,8,["fs","path"])):(O(),V("div",p1,[J("object",{data:t.value,type:"application/pdf"},[vi(ji,{fs:h.fs,path:h.path},null,8,["fs","path"])],8,g1)]))}}),y1=rt(m1,[["__scopeId","data-v-160ee5d7"]]),v1=["innerHTML"],b1={key:2,class:"md-host placeholder"},Ca=2*1024*1024,w1=Qe({__name:"MarkdownPreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=La(),i=j(""),n=j("loading");let r=!1,o=0;function l(f,u,d){return!r&&o===d&&e.fs===f&&e.path===u}function a(f){let u;if(typeof f=="string"){const d=atob(f);u=new Uint8Array(d.length);for(let p=0;pCa){n.value="error";return}const g=await f.readFile(u,Ca);if(!l(f,u,d))return;const y=a(g.data),b=(await le(async()=>{const{default:D}=await import("./index-D8AWWFft.js");return{default:D}},[])).default,T=new b({html:!1,linkify:!0,breaks:!1}).render(y);if(!l(f,u,d))return;i.value=T,n.value="ok"}catch{if(!l(f,u,d))return;n.value="error"}}}function c(f){const u=f.target;if(!u)return;const d=u.closest("a");if(!d)return;const p=d.getAttribute("href")??"";f.preventDefault(),/^(https?|mailto):/i.test(p)&&t.system.openExternalURL(p)}return En(()=>{r=!1,h()}),ft(()=>[e.path,e.fs],()=>{h()}),qt(()=>{r=!0,o++}),(f,u)=>n.value==="error"?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):n.value==="ok"?(O(),V("div",{key:1,class:Gi(["md-host",f.theme]),innerHTML:i.value,onClick:c},null,10,v1)):(O(),V("div",b1,"…"))}}),x1=rt(w1,[["__scopeId","data-v-b84f1c1b"]]),k1={class:"file-editor-host"},S1={key:0,class:"banner err"},C1={key:7,class:"banner muted","data-test":"kind-pending"},A1=Qe({__name:"FileEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{},viewMode:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const i=s,n=t,r=j(null);async function o(){var p,g;return((g=(p=r.value)==null?void 0:p.save)==null?void 0:g.call(p))??Promise.resolve(!1)}e({save:o});const{t:l}=Ji(),a=j(null),h=j("");let c=!1,f=0;function u(p,g,y){return!c&&f===y&&i.fs===p&&i.path===g}async function d(){const p=i.fs,g=i.path,y=++f;a.value=null,h.value="";try{const b=await p.fileMeta(g);if(!u(p,g,y))return;a.value=cd(g,b.isBinary)}catch(b){if(!u(p,g,y))return;h.value=(b==null?void 0:b.message)||String(b)||l("plugins.fileExplorer.unknownError")}}return ft(()=>[i.path,i.fs],()=>{d()},{immediate:!0}),qt(()=>{c=!0,f++}),(p,g)=>(O(),V("div",k1,[h.value?(O(),V("div",S1,Q(q(l)("plugins.fileExplorer.errorPrefix",{message:h.value})),1)):a.value==="code"||(a.value==="svg"||a.value==="markdown")&&p.viewMode==="code"?(O(),ke(i1,{key:1,ref_key:"codeEditorRef",ref:r,fs:p.fs,path:p.path,"show-line-numbers":p.showLineNumbers,theme:p.theme,onDirtyChange:g[0]||(g[0]=y=>n("dirty-change",y))},null,8,["fs","path","show-line-numbers","theme"])):a.value==="image"||a.value==="svg"&&p.viewMode==="render"?(O(),ke(a1,{key:2,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="markdown"&&p.viewMode==="render"?(O(),ke(x1,{key:3,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="video"||a.value==="audio"?(O(),ke(d1,{key:4,fs:p.fs,path:p.path,kind:a.value},null,8,["fs","path","kind"])):a.value==="pdf"?(O(),ke(y1,{key:5,fs:p.fs,path:p.path},null,8,["fs","path"])):a.value==="binary-unknown"?(O(),ke(ji,{key:6,fs:p.fs,path:p.path},null,8,["fs","path"])):(O(),V("div",C1,Q(q(l)("common.loading")),1))]))}}),M1=rt(A1,[["__scopeId","data-v-db7692c8"]]);function Aa(s){return/\.(md|markdown)$/i.test(s)?"render":"code"}const T1=8;function kr(s,e,t){const i=Date.now(),n=s.tabs.findIndex(o=>o.path===e);if(n>=0){const o=yi(s);return o.tabs[n].lastActiveAt=i,t==="persistent"&&(o.tabs[n].persistent=!0),o.activeIdx=n,o}if(t==="preview"){const o=s.tabs.findIndex(l=>!l.persistent);if(o>=0){const l=yi(s);return l.tabs[o]={path:e,persistent:!1,lastActiveAt:i,viewMode:Aa(e),dirty:!1},l.activeIdx=o,l}}let r=yi(s);return r.tabs.push({path:e,persistent:t==="persistent",lastActiveAt:i,viewMode:Aa(e),dirty:!1}),r.activeIdx=r.tabs.length-1,r.tabs.length>T1&&(r=E1(r)),r}function D1(s,e){if(e<0||e>=s.tabs.length)return s;const t=yi(s);return t.tabs.splice(e,1),t.tabs.length===0?(t.activeIdx=-1,t):(t.activeIdx=Math.min(e,t.tabs.length-1),t)}function E1(s){const e=s.activeIdx>=0?s.tabs[s.activeIdx].path:null,t=a=>!a.persistent&&a.path!==e,i=s.tabs.filter(t),n=i.length>0?i:s.tabs;let r=n[0];for(const a of n)a.lastActiveAtr.path===e);if(i<0||s.tabs[i].dirty===t)return s;const n=yi(s);return n.tabs[i].dirty=t,n}function yi(s){return{tabs:s.tabs.map(e=>({...e})),activeIdx:s.activeIdx}}function B1(s,e){return{identity:"local",listDir:t=>s.fs.listDir(t),watchDir:t=>s.fs.watchDir(t),unwatchDir:async t=>{if(typeof t!="number")throw new Error("local filesystem watch ID must be a number");await s.fs.unwatchDir(t)},readFile:(t,i)=>s.fs.readFile(t,i),fileMeta:t=>s.fs.fileMeta(t),openExternal:t=>s.fs.openExternal(t),assetUrlFor:t=>Promise.resolve(s.fs.assetUrlFor(t)),onDirChanged:t=>(e==null?void 0:e.on("plugin-fs:dir-changed",i=>{typeof i=="string"&&t(i)}))??(()=>{}),dispose:()=>{},writeFile:(t,i,n)=>s.fs.writeFile(t,Array.from(i),n??0,n===null),createFile:t=>s.fs.createFile(t),rename:(t,i)=>s.fs.rename(t,i),remove:(t,i)=>s.fs.remove(t,i),mkdir:t=>s.fs.mkdir(t),trash:t=>s.fs.trash(t)}}const R1=2*1024*1024,P1=256*1024,Ma=50*1024*1024,Ta="application/octet-stream";function et(s){if(!s.ok)throw new Error(s.error||"remote filesystem request failed");return s}function Cf(s){try{const e=atob(s),t=new Uint8Array(e.length);for(let i=0;iMa)throw new Error("remote asset exceeds the 50 MiB size limit");const X=_1(R);if(I+X.byteLength>Ma)throw new Error("remote asset exceeds the 50 MiB size limit");if(G&&(N=R.contentType||Ta,G=!1),$.push(F1(X)),I+=X.byteLength,R.eof)break;if(X.byteLength===0)throw new Error("remote filesystem response returned an empty non-final chunk")}return URL.createObjectURL(new Blob($,{type:N}))}function A(M){if(l)return Promise.reject(new Error("remote filesystem bridge is disposed"));const $=t.get(M);if($)return Promise.resolve($);const N=n.get(M)??0,I=i.get(M);if((I==null?void 0:I.generation)===N)return I.promise;const G=D(M).then(R=>{if(l)throw URL.revokeObjectURL(R),new Error("remote filesystem bridge is disposed");if((n.get(M)??0)!==N)throw URL.revokeObjectURL(R),new Error("remote filesystem asset request was invalidated");return t.set(M,R),R});i.set(M,{generation:N,promise:G});const L=()=>{var R;((R=i.get(M))==null?void 0:R.promise)===G&&i.delete(M)};return G.then(L,L),G}function P(M){n.set(M,(n.get(M)??0)+1);const $=t.get(M);$&&(URL.revokeObjectURL($),t.delete(M))}function C(M){if(l)return()=>{};const $={handler:M};return r.add($),o||(o=s.onFSEvent(N=>{if(!(l||N.event!=="changed"||!N.path))for(const{handler:I}of Array.from(r))try{I(N.path)}catch(G){it("file-explorer","dir-changed subscriber threw",{path:N.path,error:Se(G)})}})),()=>{r.delete($),r.size===0&&o&&(o(),o=null)}}function U(){if(!l){l=!0;for(const M of t.values())URL.revokeObjectURL(M);t.clear(),i.clear(),n.clear(),r.clear(),o&&(o(),o=null)}}return{identity:e,listDir:a,watchDir:h,unwatchDir:c,readFile:f,fileMeta:u,openExternal:d,assetUrlFor:A,onDirChanged:C,revokeAssetUrl:P,dispose:U,writeFile:p,createFile:g,rename:y,remove:b,mkdir:x,trash:T}}function _1(s){if(typeof s.data!="string")throw new Error("remote filesystem response chunk missing data");if(!Number.isSafeInteger(s.length)||s.length<0)throw new Error("remote filesystem response chunk has invalid length");const e=Cf(s.data);if(s.length!==e.byteLength)throw new Error("remote filesystem response chunk length does not match data");return e}function F1(s){const e=new Uint8Array(s.byteLength);return e.set(s),e.buffer}const W1=2*1024*1024,H1="/",V1="already_exists",$1="no platform trash command available",z1=200;function Da(s){return _s("plugins.fileExplorer.sshNoRecursiveDelete",{path:s})}function Ea(s){return Promise.reject(new Error(_s(`plugins.fileExplorer.${s}`)))}function rs(s,e){const t=Se(e);return t.includes(V1)?new Error(_s("plugins.fileExplorer.sshUploadExists",{path:s})):new Error(t)}function q1(s){let e=!1;function t(){if(e)throw new Error(_s("plugins.fileExplorer.sshBridgeDisposed"))}async function i(d){t();const p=await Gf(s,d);return{entries:p.entries??[],truncated:!!p.truncated,total:p.total??(p.entries??[]).length}}async function n(d){return(await i(d)).entries}async function r(d){return t(),await jf(s,d)}async function o(d,p=W1){return t(),await Kf(s,d,p)}async function l(d,p,g){t();try{return await Uf(s,d,p,g??0,g===null)}catch(y){throw rs(d,y)}}async function a(d){t();try{return await qf(s,d)}catch(p){throw rs(d,p)}}async function h(d){t();try{return await zf(s,d)}catch(p){throw rs(d,p)}}async function c(d,p){t();try{return await $f(s,d,p)}catch(g){throw rs(p,g)}}async function f(d,p){if(t(),p)throw new Error(Da(d));await Vf(s,d,!1)}function u(){if(!e){e=!0;try{Hf(s).catch(d=>{it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})})}catch(d){it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})}}}return{identity:`ssh:${s}`,searchMaxDirs:z1,dirRemovalRefusal:Da,listDir:n,listDirDetailed:i,fileMeta:r,readFile:o,writeFile:l,createFile:a,mkdir:h,rename:c,remove:f,watchDir:()=>Promise.resolve(`ssh:${s}`),unwatchDir:()=>Promise.resolve(),onDirChanged:()=>()=>{},openExternal:()=>Ea("sshNoOpenExternal"),assetUrlFor:()=>Ea("sshNoInlineAsset"),trash:()=>Promise.reject(new Error($1)),dispose:u}}const U1={class:"file-explorer"},K1={class:"fe-header"},j1=["title"],G1=["disabled","title"],J1=["title"],Y1={key:0,class:"source-picker"},X1=["aria-label"],Q1={value:""},Z1=["value"],ev={class:"tree-search"},tv=["placeholder","aria-label"],iv={class:"tree-scroll"},nv={key:1,class:"placeholder"},sv={class:"editor-pane"},rv={class:"editor-area"},ov={key:1,class:"placeholder"},lv=Qe({__name:"FileExplorer",props:{context:{}},setup(s){const e=s,t=La(),i=Jf(),{t:n}=Ji(),r=j(null),o=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.innerTreeRatio)??.3}),l=j(null),a=me(()=>l.value??o.value),h=j(null),{onMouseDown:c}=Zf({onDrag:B=>{if(!h.value)return;const K=h.value.clientWidth;if(K<=0)return;const te=l.value??o.value,ge=Math.max(.15,Math.min(te-B/K,.5));l.value=ge},onEnd:()=>{if(l.value===null||!i.cfg){l.value=null;return}const B=JSON.parse(JSON.stringify(i.cfg));B.fileExplorer.innerTreeRatio=l.value,i.save(B),l.value=null}}),f=j([]),u=j("");async function d(){if(t.pluginHost)try{f.value=await eu()??[]}catch(B){it("file-explorer","ssh sources unavailable",{error:Se(B)}),f.value=[]}}d();function p(B){return B.alias||`${B.user}@${B.host}`}const g=me(()=>{if(u.value)return{identity:`ssh:${u.value}`,connection:null,sshHostID:u.value};if(!e.context.activeIsRemote.value)return{identity:t.pluginHost?"local":null,connection:null,sshHostID:""};const B=e.context.activeSessionId.value,K=e.context.activeSessionConnection.value;return{identity:B&&K?`remote:${B}`:null,connection:K,sshHostID:""}}),y=j({});ft(()=>[e.context.activeCwd.value,g.value.identity,g.value.sshHostID],([B,K,te])=>{B&&K&&!te&&(y.value={...y.value,[K]:B})},{immediate:!0});const b=me(()=>{if(g.value.sshHostID)return H1;if(r.value)return r.value;const B=e.context.activeCwd.value;if(B)return B;const K=g.value.identity;return K?y.value[K]??null:null}),x=j({tabs:[],activeIdx:-1}),T=Nf(null),D=j(0),A=j("");ft(()=>[g.value.identity,g.value.connection,g.value.sshHostID],async([B,K,te])=>{var St;const ge=te?q1(te):B==="local"?t.pluginHost?B1(t.pluginHost,t.events):null:B&&K?N1(K,B):null,ve=T.value,kt=(ve==null?void 0:ve.identity)!==(ge==null?void 0:ge.identity);T.value=ge,D.value++,kt&&(r.value=null,x.value={tabs:[],activeIdx:-1},A.value=""),await us(),(St=ve==null?void 0:ve.dispose)==null||St.call(ve)},{immediate:!0}),qt(()=>{var B,K;(K=(B=T.value)==null?void 0:B.dispose)==null||K.call(B),T.value=null});const P=Yf(),C=j(null),U=j(null),M=j(!1),$=me(()=>{var B;return((B=C.value)==null?void 0:B.selectedDir)??b.value});function N(){var B;(B=U.value)==null||B.click()}async function I(B){var kt,St,en;const K=B.target,te=((kt=K.files)==null?void 0:kt[0])??null;K.value="";const ge=T.value,ve=$.value;if(!(!te||!ge||!ve)){M.value=!0;try{const It=new Uint8Array(await te.arrayBuffer()),Wn=ve.endsWith("/")?ve+te.name:`${ve}/${te.name}`;await ge.writeFile(Wn,It,null),e.context.showToast(n("plugins.fileExplorer.sshUploadDone",{name:te.name,dir:ve})),(en=(St=C.value)==null?void 0:St.refreshDir)==null||en.call(St,ve)}catch(It){e.context.showToast(Se(It)),it("file-explorer","ssh upload failed",{error:Se(It)})}finally{M.value=!1}}}ft(()=>P.pending,async B=>{var te;if(!B||!T.value)return;await us(),(await((te=C.value)==null?void 0:te.revealPath(B))??!1)&&(x.value=kr(x.value,B,"preview")),P.consume()},{immediate:!0});function G(B){x.value=kr(x.value,B,"preview")}function L(B){x.value=kr(x.value,B,"persistent")}function R(B){x.value={...x.value,activeIdx:B}}function Z(B){x.value=D1(x.value,B)}const X=j(null),ue=j(null);function Me(B){const K=Le.value;K&&(x.value=L1(x.value,K,B))}async function ot(B){const K=x.value.tabs[B];if(!(K!=null&&K.dirty)){Z(B);return}X.value={idx:B,name:K.path.split("/").pop()??K.path,buttons:[{id:"save",label:n("plugins.fileExplorer.save"),kind:"primary"},{id:"dontSave",label:n("plugins.fileExplorer.dontSave"),kind:"danger"},{id:"cancel",label:n("plugins.fileExplorer.cancel"),kind:"secondary"}]}}async function de(B){var ge,ve;const K=X.value;if(X.value=null,!K||B==="cancel")return;if(B==="dontSave"){Z(K.idx);return}(await((ve=(ge=ue.value)==null?void 0:ge.save)==null?void 0:ve.call(ge))??!1)&&Z(K.idx)}function Te(){r.value=r.value===null?e.context.activeCwd.value:null}const De=me(()=>{const B=x.value.activeIdx;return B>=0?x.value.tabs[B].viewMode:"code"});function Fe(){x.value=O1(x.value,De.value==="code"?"render":"code")}const Le=me(()=>x.value.activeIdx>=0?x.value.tabs[x.value.activeIdx].path:null),je=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showHidden)??!1}),$e=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showLineNumbers)??!1});async function Fn(B,K){if(!i.cfg)return;const te=JSON.parse(JSON.stringify(i.cfg));te.fileExplorer[B]=K;try{await i.save(te)}catch(ge){it("file-explorer","saving view option failed",{error:Se(ge)})}}const ci=me(()=>Xf(e.context.terminalThemeId.value)?"light":"dimmed");return(B,K)=>(O(),V("div",U1,[J("div",{class:"fe-body",ref_key:"bodyRef",ref:h},[J("div",{class:"tree-pane",style:mn({width:a.value*100+"%"})},[J("header",K1,[J("span",{class:"root-path",title:b.value??""},Q(b.value??q(n)("plugins.fileExplorer.noActivePaneShort")),9,j1),g.value.sshHostID?(O(),V("button",{key:0,class:"pin","data-test":"ssh-upload",disabled:M.value||!$.value,title:q(n)("plugins.fileExplorer.sshUpload",{dir:$.value??""}),onClick:N},[vi(q(Qf),{size:14,"stroke-width":1.5})],8,G1)):(O(),V("button",{key:1,class:Gi(["pin",{pinned:r.value!==null}]),title:r.value!==null?q(n)("plugins.fileExplorer.unpinFollow"):q(n)("plugins.fileExplorer.pinCurrentCwd"),onClick:Te},[(O(),ke(hn(r.value!==null?q(ou):q(ru)),{size:14,"stroke-width":1.5}))],10,J1))]),f.value.length>0?(O(),V("div",Y1,[ds(J("select",{"onUpdate:modelValue":K[0]||(K[0]=te=>u.value=te),"data-test":"fs-source","aria-label":q(n)("plugins.fileExplorer.sourceLabel")},[J("option",Q1,Q(q(n)("plugins.fileExplorer.sourceActivePane")),1),(O(!0),V(Xt,null,mi(f.value,te=>(O(),V("option",{key:te.id,value:te.id},Q(p(te)),9,Z1))),128))],8,X1),[[_f,u.value]])])):Ie("",!0),J("input",{ref_key:"uploadInput",ref:U,class:"upload-input","data-test":"ssh-upload-input",type:"file",onChange:I},null,544),J("div",ev,[ds(J("input",{"onUpdate:modelValue":K[1]||(K[1]=te=>A.value=te),"data-test":"file-name-search",type:"search",placeholder:q(n)("plugins.fileExplorer.searchFiles"),"aria-label":q(n)("plugins.fileExplorer.searchFiles")},null,8,tv),[[Oa,A.value]])]),J("div",iv,[b.value&&T.value?(O(),ke(Yu,{ref_key:"fileTreeRef",ref:C,key:D.value,fs:T.value,root:b.value,"show-hidden":je.value,"show-line-numbers":$e.value,"search-query":A.value,context:B.context,onFileClicked:G,onFileDoubleClicked:L,onToggleShowHidden:K[2]||(K[2]=te=>Fn("showHidden",te)),onToggleShowLineNumbers:K[3]||(K[3]=te=>Fn("showLineNumbers",te))},null,8,["fs","root","show-hidden","show-line-numbers","search-query","context"])):(O(),V("div",nv,Q(q(n)("plugins.fileExplorer.noActivePane")),1))])],4),J("div",{class:"divider",onMousedown:K[4]||(K[4]=(...te)=>q(c)&&q(c)(...te))},null,32),J("div",sv,[vi(sd,{tabs:x.value.tabs,"active-idx":x.value.activeIdx,"view-mode":De.value,onSelect:R,onCloseRequest:ot,onToggleViewMode:Fe},null,8,["tabs","active-idx","view-mode"]),J("div",rv,[Le.value&&T.value?(O(),ke(M1,{ref_key:"codeEditorRef",ref:ue,key:D.value,fs:T.value,path:Le.value,"show-line-numbers":$e.value,theme:ci.value,"view-mode":De.value,onDirtyChange:Me},null,8,["fs","path","show-line-numbers","theme","view-mode"])):(O(),V("div",ov,Q(q(n)("plugins.fileExplorer.selectFile")),1))])])],512),X.value?(O(),ke(Pa,{key:0,title:q(n)("plugins.fileExplorer.confirmCloseTitle",{name:X.value.name}),buttons:X.value.buttons,onResolve:de},null,8,["title","buttons"])):Ie("",!0)]))}}),av=rt(lv,[["__scopeId","data-v-098631c4"]]),gv=Object.freeze(Object.defineProperty({__proto__:null,default:av},Symbol.toStringTag,{value:"Module"}));export{ai as A,Us as B,Qr as C,re as D,S as E,F,Zt as G,dv as H,he as I,em as J,ac as K,Es as L,nt as M,ee as N,_e as O,Si as P,v as Q,bi as R,oe as S,lt as T,Yi as W,Ng as a,se as b,H as c,gv as d,qe as e,Po as f,am as g,Eo as h,Ke as i,uv as j,rc as k,On as l,bt as m,ne as n,Ae as o,ce as p,Ec as q,vm as r,Ws as s,Ro as t,mm as u,ym as v,xm as w,yc as x,mc as y,Io as z}; +`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let n=this.rangeIndex;;){let r=this.ranges[n].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),n++,n==this.ranges.length))break;let o=this.ranges[n].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let n=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?n>r:n>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-n}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to1){n=this.skipGapsTo(t,n,1),t+=n;let l=this.chunk.length;n=this.skipGapsTo(i,n,-1),i+=n,r+=this.chunk.length-l}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),n}parseLine(e){let{line:t,end:i}=this.nextLine(),n=0,{streamParser:r}=this.lang,o=new Ho(t,e?e.state.tabSize:4,e?li(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Lc(r.token,o,this.state);if(l&&(n=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,n)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPose.start)return n}throw new Error("Stream parser failed to advance stream.")}const zo=Object.create(null),Mn=[Ke.none],Xm=new Eo(Mn),ca=[],fa=Object.create(null),Bc=Object.create(null);for(let[s,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"]])Bc[s]=Pc(zo,e);class Rc{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Bc)}resolve(e){return e?this.table[e]||(this.table[e]=Pc(this.extra,e)):0}}const Qm=new Rc(zo);function vr(s,e){ca.indexOf(s)>-1||(ca.push(s),console.warn(e))}function Pc(s,e){let t=[];for(let l of e.split(" ")){let a=[];for(let h of l.split(".")){let c=s[h]||v[h];c?typeof c=="function"?a.length?a=a.map(c):vr(h,`Modifier ${h} used at start of tag`):a.length?vr(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:vr(h,`Unknown highlighting tag ${h}`)}for(let h of a)t.push(h)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),n=i+" "+t.map(l=>l.id),r=fa[n];if(r)return r.id;let o=fa[n]=Ke.define({id:Mn.length,name:i,props:[em({[i]:t})]});return Mn.push(o),o.id}function Zm(s,e){let t=Ke.define({id:Mn.length,name:"Document",props:[Zt.add(()=>s),Io.add(()=>i=>e.getIndent(i))],top:!0});return Mn.push(t),t}function Ic(s){return s.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(s)}function Nc(s){for(let e=s.iter();!e.next().done;)if(Ic(e.value))return!0;return!1}function e0(s){let e=!1;return s.iterChanges((t,i,n,r,o)=>{!e&&Nc(o)&&(e=!0)}),e}const lo=F.define({combine:s=>s.some(e=>e)});function t0(s={}){let e=[i0];return s.alwaysIsolate&&e.push(lo.of(!0)),e}const i0=st.fromClass(class{constructor(s){this.always=s.state.facet(lo)||s.textDirection!=pe.LTR||s.state.facet(H.perLineTextDirection),this.hasRTL=!this.always&&Nc(s.state.doc),this.tree=_e(s.state),this.decorations=this.always||this.hasRTL?ua(s,this.tree,this.always):re.none}update(s){let e=s.state.facet(lo)||s.view.textDirection!=pe.LTR||s.state.facet(H.perLineTextDirection);if(!e&&!this.hasRTL&&e0(s.changes)&&(this.hasRTL=!0),!e&&!this.hasRTL)return;let t=_e(s.state);(e!=this.always||t!=this.tree||s.docChanged||s.viewportChanged)&&(this.tree=t,this.always=e,this.decorations=ua(s.view,t,e))}},{provide:s=>{function e(t){var i,n;return(n=(i=t.plugin(s))===null||i===void 0?void 0:i.decorations)!==null&&n!==void 0?n:re.none}return[H.outerDecorations.of(e),On.lowest(H.bidiIsolatedRanges.of(e))]}});function ua(s,e,t){let i=new ti,n=s.visibleRanges;t||(n=n0(n,s.state.doc));for(let{from:r,to:o}of n)e.iterate({enter:l=>{let a=l.type.prop(ee.isolate);a&&i.add(l.from,l.to,s0[a])},from:r,to:o});return i.finish()}function n0(s,e){let t=e.iter(),i=0,n=[],r=null;for(let{from:o,to:l}of s)if(!(r&&r.to>o&&(o=r.to,o>=l)))for(i+t.value.lengtha-10?r.to=Math.min(l,h):n.push(r={from:a,to:Math.min(l,h)})),h>=l)break;i=h,t.next()}return n}const s0={rtl:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:pe.RTL}),ltr:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:pe.LTR}),auto:re.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})},r0=Object.freeze(Object.defineProperty({__proto__:null,DocInput:cc,HighlightStyle:Mi,IndentContext:Xi,LRLanguage:Es,Language:qe,LanguageDescription:Po,LanguageSupport:am,ParseContext:Si,StreamLanguage:Vo,StringStream:Ho,TreeIndentContext:Ks,bidiIsolates:t0,bracketMatching:qm,bracketMatchingHandle:Ec,codeFolding:Wo,continuedIndent:vm,defaultHighlightStyle:_m,defineLanguageFacet:Ro,delimitedIndent:mm,ensureSyntaxTree:hc,flatIndent:ym,foldAll:xc,foldCode:bc,foldEffect:Qi,foldGutter:Bm,foldInside:xm,foldKeymap:Dm,foldNodeProp:yc,foldService:mc,foldState:zt,foldable:Ki,foldedRanges:Cm,forceParsing:om,getIndentUnit:li,getIndentation:In,highlightingFor:Pm,indentNodeProp:Io,indentOnInput:wm,indentRange:hm,indentService:dc,indentString:Ci,indentUnit:Us,language:$t,languageDataProp:Zt,matchBrackets:mt,sublanguageProp:ac,syntaxHighlighting:Ac,syntaxParserRunning:lm,syntaxTree:_e,syntaxTreeAvailable:rm,toggleFold:Tm,unfoldAll:kc,unfoldCode:wc,unfoldEffect:Ai},Symbol.toStringTag,{value:"Module"})),o0=s=>{let{state:e}=s,t=e.doc.lineAt(e.selection.main.from),i=Uo(s.state,t.from);return i.line?l0(s):i.block?h0(s):!1};function qo(s,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let n=s(e,t);return n?(i(t.update(n)),!0):!1}}const l0=qo(u0,0),a0=qo(_c,0),h0=qo((s,e)=>_c(s,e,f0(e)),0);function Uo(s,e){let t=s.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const on=50;function c0(s,{open:e,close:t},i,n){let r=s.sliceDoc(i-on,i),o=s.sliceDoc(n,n+on),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-e.length,h)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let c,f;n-i<=2*on?c=f=s.sliceDoc(i,n):(c=s.sliceDoc(i,i+on),f=s.sliceDoc(n-on,n));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-t.length;return c.slice(u,u+e.length)==e&&f.slice(p,p+t.length)==t?{open:{pos:i+u+e.length,margin:/\s/.test(c.charAt(u+e.length))?1:0},close:{pos:n-d-t.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function f0(s){let e=[];for(let t of s.selection.ranges){let i=s.doc.lineAt(t.from),n=t.to<=i.to?i:s.doc.lineAt(t.to);n.from>i.from&&n.from==t.to&&(n=t.to==i.to+1?i:s.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>i.from?e[r].to=n.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return e}function _c(s,e,t=e.selection.ranges){let i=t.map(r=>Uo(e,r.from).block);if(!i.every(r=>r))return null;let n=t.map((r,o)=>c0(e,i[o],r.from,r.to));if(s!=2&&!n.every(r=>r))return{changes:e.changes(t.map((r,o)=>n[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(s!=1&&n.some(r=>r)){let r=[];for(let o=0,l;on&&(r==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;ur.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(s!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const ao=ai.define(),d0=ai.define(),p0=F.define(),Fc=F.define({combine(s){return Ln(s,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,n)=>e(i,n)||t(i,n)})}}),Wc=vt.define({create(){return Bt.empty},update(s,e){let t=e.state.facet(Fc),i=e.annotation(ao);if(i){let a=Je.fromTransaction(e,i.selection),h=i.side,c=h==0?s.undone:s.done;return a?c=Ls(c,c.length,t.minDepth,a):c=$c(c,e.startState.selection),new Bt(h==0?i.rest:c,h==0?c:i.rest)}let n=e.annotation(d0);if((n=="full"||n=="before")&&(s=s.isolate()),e.annotation(Ae.addToHistory)===!1)return e.changes.empty?s:s.addMapping(e.changes.desc);let r=Je.fromTransaction(e),o=e.annotation(Ae.time),l=e.annotation(Ae.userEvent);return r?s=s.addChanges(r,o,l,t,e):e.selection&&(s=s.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(n=="full"||n=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(e=>e.toJSON()),undone:s.undone.map(e=>e.toJSON())}},fromJSON(s){return new Bt(s.done.map(Je.fromJSON),s.undone.map(Je.fromJSON))}});function g0(s={}){return[Wc,Fc.of(s),H.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?Hc:e.inputType=="historyRedo"?ho:null;return i?(e.preventDefault(),i(t)):!1}})]}function js(s,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let n=t.field(Wc,!1);if(!n)return!1;let r=n.pop(s,t,e);return r?(i(r),!0):!1}}const Hc=js(0,!1),ho=js(1,!1),m0=js(0,!0),y0=js(1,!0);class Je{constructor(e,t,i,n,r){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(e){return new Je(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(n=>n.toJSON())}}static fromJSON(e){return new Je(e.changes&&Ce.fromJSON(e.changes),[],e.mapped&&Rt.fromJSON(e.mapped),e.startSelection&&S.fromJSON(e.startSelection),e.selectionsAfter.map(S.fromJSON))}static fromTransaction(e,t){let i=ct;for(let n of e.startState.facet(p0)){let r=n(e);r.length&&(i=i.concat(r))}return!i.length&&e.changes.empty?null:new Je(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,ct)}static selection(e){return new Je(void 0,ct,void 0,void 0,e)}}function Ls(s,e,t,i){let n=e+1>t+20?e-t-1:0,r=s.slice(n,e);return r.push(i),r}function v0(s,e){let t=[],i=!1;return s.iterChangedRanges((n,r)=>t.push(n,r)),e.iterChangedRanges((n,r,o,l)=>{for(let a=0;a=h&&o<=c&&(i=!0)}}),i}function b0(s,e){return s.ranges.length==e.ranges.length&&s.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function Vc(s,e){return s.length?e.length?s.concat(e):s:e}const ct=[],w0=200;function $c(s,e){if(s.length){let t=s[s.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-w0));return i.length&&i[i.length-1].eq(e)?s:(i.push(e),Ls(s,s.length-1,1e9,t.setSelAfter(i)))}else return[Je.selection([e])]}function x0(s){let e=s[s.length-1],t=s.slice();return t[s.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function br(s,e){if(!s.length)return s;let t=s.length,i=ct;for(;t;){let n=k0(s[t-1],e,i);if(n.changes&&!n.changes.empty||n.effects.length){let r=s.slice(0,t);return r[t-1]=n,r}else e=n.mapped,t--,i=n.selectionsAfter}return i.length?[Je.selection(i)]:ct}function k0(s,e,t){let i=Vc(s.selectionsAfter.length?s.selectionsAfter.map(l=>l.map(e)):ct,t);if(!s.changes)return Je.selection(i);let n=s.changes.map(e),r=e.mapDesc(s.changes,!0),o=s.mapped?s.mapped.composeDesc(r):r;return new Je(n,oe.mapEffects(s.effects,e),o,s.startSelection.map(r),i)}const S0=/^(input\.type|delete)($|\.)/;class Bt{constructor(e,t,i=0,n=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Bt(this.done,this.undone):this}addChanges(e,t,i,n,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!i||S0.test(i))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?s.moveByChar(t,e):Gs(t,e))}function Ve(s){return s.textDirectionAt(s.state.selection.main.head)==pe.LTR}const qc=s=>zc(s,!Ve(s)),Uc=s=>zc(s,Ve(s));function Kc(s,e){return wt(s,t=>t.empty?s.moveByGroup(t,e):Gs(t,e))}const A0=s=>Kc(s,!Ve(s)),M0=s=>Kc(s,Ve(s));function T0(s,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(e.from,e.to)))||e.firstChild}function Js(s,e,t){let i=_e(s).resolveInner(e.head),n=t?ee.closedBy:ee.openedBy;for(let a=e.head;;){let h=t?i.childAfter(a):i.childBefore(a);if(!h)break;T0(s,h,n)?i=h:a=t?h.to:h.from}let r=i.type.prop(n),o,l;return r&&(o=t?mt(s,i.from,1):mt(s,i.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?i.to:i.from,S.cursor(l,t?-1:1)}const D0=s=>wt(s,e=>Js(s.state,e,!Ve(s))),E0=s=>wt(s,e=>Js(s.state,e,Ve(s)));function jc(s,e){return wt(s,t=>{if(!t.empty)return Gs(t,e);let i=s.moveVertically(t,e);return i.head!=t.head?i:s.moveToLineBoundary(t,e)})}const Gc=s=>jc(s,!1),Jc=s=>jc(s,!0);function Yc(s){let e=s.scrollDOM.clientHeighto.empty?s.moveVertically(o,e,t.height):Gs(o,e));if(n.eq(i.selection))return!1;let r;if(t.selfScroll){let o=s.coordsAtPos(i.selection.main.head),l=s.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,h=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomXc(s,!1),co=s=>Xc(s,!0);function hi(s,e,t){let i=s.lineBlockAt(e.head),n=s.moveToLineBoundary(e,t);if(n.head==e.head&&n.head!=(t?i.to:i.from)&&(n=s.moveToLineBoundary(e,t,!1)),!t&&n.head==i.from&&i.length){let r=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&e.head!=i.from+r&&(n=S.cursor(i.from+r))}return n}const O0=s=>wt(s,e=>hi(s,e,!0)),L0=s=>wt(s,e=>hi(s,e,!1)),B0=s=>wt(s,e=>hi(s,e,!Ve(s))),R0=s=>wt(s,e=>hi(s,e,Ve(s))),P0=s=>wt(s,e=>S.cursor(s.lineBlockAt(e.head).from,1)),I0=s=>wt(s,e=>S.cursor(s.lineBlockAt(e.head).to,-1));function N0(s,e,t){let i=!1,n=Zi(s.selection,r=>{let o=mt(s,r.head,-1)||mt(s,r.head,1)||r.head>0&&mt(s,r.head-1,1)||r.headN0(s,e);function ut(s,e,t){let i=Zi(s.state.selection,n=>{n.undirectional&&n.head>=n.anchor!=e&&(n=S.range(n.head,n.anchor));let r=t(n);return S.range(n.anchor,r.head,r.goalColumn,r.bidiLevel||void 0,r.assoc)});return i.eq(s.state.selection)?!1:(s.dispatch(bt(s.state,i)),!0)}function Qc(s,e){return ut(s,e,t=>s.moveByChar(t,e))}const Zc=s=>Qc(s,!Ve(s)),ef=s=>Qc(s,Ve(s));function tf(s,e){return ut(s,e,t=>s.moveByGroup(t,e))}const F0=s=>tf(s,!Ve(s)),W0=s=>tf(s,Ve(s)),H0=s=>{let e=!Ve(s);return ut(s,e,t=>Js(s.state,t,e))},V0=s=>{let e=Ve(s);return ut(s,e,t=>Js(s.state,t,e))};function nf(s,e){return ut(s,e,t=>s.moveVertically(t,e))}const sf=s=>nf(s,!1),rf=s=>nf(s,!0);function of(s,e){return ut(s,e,t=>s.moveVertically(t,e,Yc(s).height))}const pa=s=>of(s,!1),ga=s=>of(s,!0),$0=s=>ut(s,!0,e=>hi(s,e,!0)),z0=s=>ut(s,!1,e=>hi(s,e,!1)),q0=s=>{let e=!Ve(s);return ut(s,e,t=>hi(s,t,e))},U0=s=>{let e=Ve(s);return ut(s,e,t=>hi(s,t,e))},K0=s=>ut(s,!1,e=>S.cursor(s.lineBlockAt(e.head).from)),j0=s=>ut(s,!0,e=>S.cursor(s.lineBlockAt(e.head).to)),ma=({state:s,dispatch:e})=>(e(bt(s,{anchor:0})),!0),ya=({state:s,dispatch:e})=>(e(bt(s,{anchor:s.doc.length})),!0),va=({state:s,dispatch:e})=>(e(bt(s,{anchor:s.selection.main.anchor,head:0})),!0),ba=({state:s,dispatch:e})=>(e(bt(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),G0=({state:s,dispatch:e})=>(e(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),J0=({state:s,dispatch:e})=>{let t=Ys(s).map(({from:i,to:n})=>S.range(i,Math.min(n+1,s.doc.length)));return e(s.update({selection:S.create(t),userEvent:"select"})),!0},Y0=({state:s,dispatch:e})=>{let t=Zi(s.selection,i=>{let n=_e(s),r=n.resolveStack(i.from,1);if(i.empty){let o=n.resolveStack(i.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return S.range(l.to,l.from)}return i});return t.eq(s.selection)?!1:(e(bt(s,t)),!0)};function lf(s,e){let{state:t}=s,i=t.selection,n=t.selection.ranges.slice();for(let r of t.selection.ranges){let o=t.doc.lineAt(r.head);if(e?o.to0)for(let l=r;;){let a=s.moveVertically(l,e);if(a.heado.to){n.some(h=>h.head==a.head)||n.push(a);break}else{if(a.head==l.head)break;l=a}}}return n.length==i.ranges.length?!1:(s.dispatch(bt(t,S.create(n,n.length-1))),!0)}const X0=s=>lf(s,!1),Q0=s=>lf(s,!0),Z0=({state:s,dispatch:e})=>{let t=s.selection,i=null;return t.ranges.length>1?i=S.create([t.main]):t.main.empty||(i=S.create([S.cursor(t.main.head)])),i?(e(bt(s,i)),!0):!1};function Nn(s,e){if(s.state.readOnly)return!1;let t="delete.selection",{state:i}=s,n=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=is(s,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=is(s,o,!1),l=is(s,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:S.cursor(o,on(s)))i.between(e,e,(n,r)=>{ne&&(e=t?r:n)});return e}const af=(s,e,t)=>Nn(s,i=>{let n=i.from,{state:r}=s,o=r.doc.lineAt(n),l,a;if(t&&!e&&n>o.from&&naf(s,!1,!0),hf=s=>af(s,!0,!1),cf=(s,e)=>Nn(s,t=>{let i=t.head,{state:n}=s,r=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(e?r.to:r.from)){i==t.head&&r.number!=(e?n.doc.lines:1)&&(i+=e?1:-1);break}let a=Oe(r.text,i-r.from,e)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=t.head)&&(l=c),i=a}return i}),ff=s=>cf(s,!1),ey=s=>cf(s,!0),ty=s=>Nn(s,e=>{let t=s.lineBlockAt(e.head).to;return e.headNn(s,e=>{let t=s.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),ny=s=>Nn(s,e=>{let t=s.moveToLineBoundary(e,!0).head;return e.head{if(s.readOnly)return!1;let t=s.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:ne.of(["",""])},range:S.cursor(i.from)}));return e(s.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},ry=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=s.changeByRange(i=>{if(!i.empty||i.from==0||i.from==s.doc.length)return{range:i};let n=i.from,r=s.doc.lineAt(n),o=n==r.from?n-1:Oe(r.text,n-r.from,!1)+r.from,l=n==r.to?n+1:Oe(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:s.doc.slice(n,l).append(s.doc.slice(o,n))},range:S.cursor(l)}});return t.changes.empty?!1:(e(s.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function Ys(s){let e=[],t=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.from),r=s.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=s.doc.lineAt(i.to-1)),t>=n.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(i)}else e.push({from:n.from,to:r.to,ranges:[i]});t=r.number+1}return e}function uf(s,e,t){if(s.readOnly)return!1;let i=[],n=[];for(let r of Ys(s)){if(t?r.to==s.doc.length:r.from==0)continue;let o=s.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+s.lineBreak});for(let a of r.ranges)n.push(S.range(Math.min(s.doc.length,a.anchor+l),Math.min(s.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:s.lineBreak+o.text});for(let a of r.ranges)n.push(S.range(a.anchor-l,a.head-l))}}return i.length?(e(s.update({changes:i,scrollIntoView:!0,selection:S.create(n,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const oy=({state:s,dispatch:e})=>uf(s,e,!1),ly=({state:s,dispatch:e})=>uf(s,e,!0);function df(s,e,t){if(s.readOnly)return!1;let i=[];for(let r of Ys(s))t?i.push({from:r.from,insert:s.doc.slice(r.from,r.to)+s.lineBreak}):i.push({from:r.to,insert:s.lineBreak+s.doc.slice(r.from,r.to)});let n=s.changes(i);return e(s.update({changes:n,selection:s.selection.map(n,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const ay=({state:s,dispatch:e})=>df(s,e,!1),hy=({state:s,dispatch:e})=>df(s,e,!0),cy=s=>{if(s.state.readOnly)return!1;let{state:e}=s,t=e.changes(Ys(e).map(({from:n,to:r})=>(n>0?n--:r{let r;if(s.lineWrapping){let o=s.lineBlockAt(n.head),l=s.coordsAtPos(n.head,n.assoc||1);l&&(r=o.bottom+s.documentTop-l.bottom+s.defaultLineHeight/2)}return s.moveVertically(n,!0,r)}).map(t);return s.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function fy(s,e){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=_e(s).resolveInner(e),i=t.childBefore(e),n=t.childAfter(e),r;return i&&n&&i.to<=e&&n.from>=e&&(r=i.type.prop(ee.closedBy))&&r.indexOf(n.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(n.from).from&&!/\S/.test(s.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const wa=pf(!1),uy=pf(!0);function pf(s){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(n=>{let{from:r,to:o}=n,l=e.doc.lineAt(r),a=!s&&r==o&&fy(e,r);s&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let h=new Xi(e,{simulateBreak:r,simulateDoubleBreak:!!a}),c=In(h,r);for(c==null&&(c=Ws(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let n=[];for(let o=i.from;o<=i.to;){let l=s.doc.lineAt(o);l.number>t&&(i.empty||i.to>l.from)&&(e(l,n,i),t=l.number),o=l.to+1}let r=s.changes(n);return{changes:n,range:S.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const dy=({state:s,dispatch:e})=>{if(s.readOnly)return!1;let t=Object.create(null),i=new Xi(s,{overrideIndentation:r=>{let o=t[r];return o??-1}}),n=Ko(s,(r,o,l)=>{let a=In(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=Ci(s,a);(h!=c||l.froms.readOnly?!1:(e(s.update(Ko(s,(t,i)=>{i.push({from:t.from,insert:s.facet(Us)})}),{userEvent:"input.indent"})),!0),gy=({state:s,dispatch:e})=>s.readOnly?!1:(e(s.update(Ko(s,(t,i)=>{let n=/^\s*/.exec(t.text)[0];if(!n)return;let r=Ws(n,s.tabSize),o=0,l=Ci(s,Math.max(0,r-li(s)));for(;o(s.setTabFocusMode(),!0),yy=[{key:"Ctrl-b",run:qc,shift:Zc,preventDefault:!0},{key:"Ctrl-f",run:Uc,shift:ef},{key:"Ctrl-p",run:Gc,shift:sf},{key:"Ctrl-n",run:Jc,shift:rf},{key:"Ctrl-a",run:P0,shift:K0},{key:"Ctrl-e",run:I0,shift:j0},{key:"Ctrl-d",run:hf},{key:"Ctrl-h",run:fo},{key:"Ctrl-k",run:ty},{key:"Ctrl-Alt-h",run:ff},{key:"Ctrl-o",run:sy},{key:"Ctrl-t",run:ry},{key:"Ctrl-v",run:co}],vy=[{key:"ArrowLeft",run:qc,shift:Zc,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:A0,shift:F0,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:B0,shift:q0,preventDefault:!0},{key:"ArrowRight",run:Uc,shift:ef,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:M0,shift:W0,preventDefault:!0},{mac:"Cmd-ArrowRight",run:R0,shift:U0,preventDefault:!0},{key:"ArrowUp",run:Gc,shift:sf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:ma,shift:va},{mac:"Ctrl-ArrowUp",run:da,shift:pa},{key:"ArrowDown",run:Jc,shift:rf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:ya,shift:ba},{mac:"Ctrl-ArrowDown",run:co,shift:ga},{key:"PageUp",run:da,shift:pa},{key:"PageDown",run:co,shift:ga},{key:"Home",run:L0,shift:z0,preventDefault:!0},{key:"Mod-Home",run:ma,shift:va},{key:"End",run:O0,shift:$0,preventDefault:!0},{key:"Mod-End",run:ya,shift:ba},{key:"Enter",run:wa,shift:wa},{key:"Mod-a",run:G0},{key:"Backspace",run:fo,shift:fo,preventDefault:!0},{key:"Delete",run:hf,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:ff,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:ey,preventDefault:!0},{mac:"Mod-Backspace",run:iy,preventDefault:!0},{mac:"Mod-Delete",run:ny,preventDefault:!0}].concat(yy.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),by=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:D0,shift:H0},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:E0,shift:V0},{key:"Alt-ArrowUp",run:oy},{key:"Shift-Alt-ArrowUp",run:ay},{key:"Alt-ArrowDown",run:ly},{key:"Shift-Alt-ArrowDown",run:hy},{key:"Mod-Alt-ArrowUp",run:X0},{key:"Mod-Alt-ArrowDown",run:Q0},{key:"Escape",run:Z0},{key:"Mod-Enter",run:uy},{key:"Alt-l",mac:"Ctrl-l",run:J0},{key:"Mod-i",run:Y0,preventDefault:!0},{key:"Mod-[",run:gy},{key:"Mod-]",run:py},{key:"Mod-Alt-\\",run:dy},{key:"Shift-Mod-k",run:cy},{key:"Shift-Mod-\\",run:_0},{key:"Mod-/",run:o0},{key:"Alt-A",run:a0},{key:"Ctrl-m",mac:"Shift-Alt-m",run:my}].concat(vy),xa=typeof String.prototype.normalize=="function"?s=>s.normalize("NFKD"):s=>s;class Tn{constructor(e,t,i=0,n=e.length,r,o){this.test=o,this.value={from:0,to:0,precise:!1},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,n),this.bufferStart=i,this.normalize=r?l=>r(xa(l)):xa,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Va(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=vd(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=$a(e);let n=this.normalize(t);if(n.length)for(let r=0,o=i,l=!0;;r++){let a=n.charCodeAt(r),h=this.match(a,o,l,this.bufferPos+this.bufferStart,r==n.length-1);if(h)return this.value=h,this;if(r==n.length-1)break;l&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let i=this.curLineStart+t.index,n=i+t[0].length;if(this.matchPos=Bs(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,precise:!0,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||n.to<=t){let l=new Hi(t,e.sliceString(t,i));return wr.set(e,l),l}if(n.from==t&&n.to==i)return n;let{text:r,from:o}=n;return o>t&&(r=e.sliceString(t,o)+r,o=t),n.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let i=this.flat.from+t.index,n=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,t)))return this.value={from:i,to:n,precise:!0,match:t},this.matchPos=Bs(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Hi.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(mf.prototype[Symbol.iterator]=yf.prototype[Symbol.iterator]=function(){return this});function wy(s){try{return new RegExp(s,jo),!0}catch{return!1}}function Bs(s,e){if(e>=s.length)return e;let t=s.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}const xy=s=>{let{state:e}=s,t=String(e.doc.lineAt(s.state.selection.main.head).number),{close:i,result:n}=Cg(s,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return n.then(r=>{let o=r&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(r.elements.line.value);if(!o){s.dispatch({effects:i});return}let l=e.doc.lineAt(e.selection.main.head),[,a,h,c,f]=o,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let y=d/100;a&&(y=y*(a=="-"?-1:1)+l.number/e.doc.lines),d=Math.round(e.doc.lines*y)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=e.doc.line(Math.max(1,Math.min(e.doc.lines,d))),g=S.cursor(p.from+Math.max(0,Math.min(u,p.length)));s.dispatch({effects:[i,H.scrollIntoView(g.from,{y:"center"})],selection:g})}),!0},ky=({state:s,dispatch:e})=>{let{selection:t}=s,i=S.create(t.ranges.map(n=>s.wordAt(n.head)||S.cursor(n.head)),t.mainIndex);return i.eq(t)?!1:(e(s.update({selection:i})),!0)};function Sy(s,e){let{main:t,ranges:i}=s.selection,n=s.wordAt(t.head),r=n&&n.from==t.from&&n.to==t.to;for(let o=!1,l=new Tn(s.doc,e,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Tn(s.doc,e,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=s.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const Cy=({state:s,dispatch:e})=>{let{ranges:t}=s.selection;if(t.some(r=>r.from===r.to))return ky({state:s,dispatch:e});let i=s.sliceDoc(t[0].from,t[0].to);if(s.selection.ranges.some(r=>s.sliceDoc(r.from,r.to)!=i))return!1;let n=Sy(s,i);return n?(e(s.update({selection:s.selection.addRange(S.range(n.from,n.to),!1),effects:H.scrollIntoView(n.to)})),!0):!1},Ti=F.define({combine(s){return Ln(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Wy(e),scrollToMatch:e=>H.scrollIntoView(e)})}});function Ay(s){return s?[Ti.of(s),po]:po}class vf{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||wy(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new Ly(this):new Dy(this)}getCursor(e,t=0,i){let n=e.doc?e:se.create({doc:e});return i==null&&(i=n.doc.length),this.regexp?Li(this,n,t,i):Oi(this,n,t,i)}}class bf{constructor(e){this.spec=e}}function My(s,e,t){return(i,n,r,o)=>{if(t&&!t(i,n,r,o))return!1;let l=i>=o&&n<=o+r.length?r.slice(i-o,n-o):e.doc.sliceString(i,n);return s(l,e,i,n)}}function Oi(s,e,t,i){let n;return s.wholeWord&&(n=Ty(e.doc,e.charCategorizer(e.selection.main.head))),s.test&&(n=My(s.test,e,n)),new Tn(e.doc,s.unquoted,t,i,s.caseSensitive?void 0:r=>r.toLowerCase(),n)}function Ty(s,e){return(t,i,n,r)=>((r>t||r+n.length=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Oi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function Ey(s,e,t){return(i,n,r)=>(!t||t(i,n,r))&&s(r[0],e,i,n)}function Li(s,e,t,i){let n;return s.wholeWord&&(n=Oy(e.charCategorizer(e.selection.main.head))),s.test&&(n=Ey(s.test,e,n)),new mf(e.doc,s.search,{ignoreCase:!s.caseSensitive,test:n},t,i)}function Rs(s,e){return s.slice(Oe(s,e,!1),e)}function Ps(s,e){return s.slice(e,Oe(s,e))}function Oy(s){return(e,t,i)=>!i[0].length||(s(Rs(i.input,i.index))!=Ne.Word||s(Ps(i.input,i.index))!=Ne.Word)&&(s(Ps(i.input,i.index+i[0].length))!=Ne.Word||s(Rs(i.input,i.index+i[0].length))!=Ne.Word)}class Ly extends bf{nextMatch(e,t,i){let n=Li(this.spec,e,i,e.doc.length).next();return n.done&&(n=Li(this.spec,e,0,t).next()),n.done?null:n.value}prevMatchInRange(e,t,i){for(let n=1;;n++){let r=Math.max(t,i-n*1e4),o=Li(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,i)=>{if(i=="&")return e.match[0];if(i=="$")return"$";for(let n=i.length;n>0;n--){let r=+i.slice(0,n);if(r>0&&r=t)return null;n.push(i.value)}return n}highlight(e,t,i,n){let r=Li(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Dn=oe.define(),Go=oe.define(),ei=vt.define({create(s){return new xr(uo(s).create(),null)},update(s,e){for(let t of e.effects)t.is(Dn)?s=new xr(t.value.create(),s.panel):t.is(Go)&&(s=new xr(s.query,t.value?Jo:null));return s},provide:s=>Ms.from(s,e=>e.panel)});class xr{constructor(e,t){this.query=e,this.panel=t}}const By=re.mark({class:"cm-searchMatch"}),Ry=re.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Py=st.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(ei))}update(s){let e=s.state.field(ei);(e!=s.startState.field(ei)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:s,panel:e}){if(!e||!s.spec.valid)return re.none;let{view:t}=this,i=new ti;for(let n=0,r=t.visibleRanges,o=r.length;nr[n+1].from-2*250;)a=r[++n].to;s.highlight(t.state,l,a,(h,c)=>{let f=t.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?Ry:By)})}return i.finish()}},{decorations:s=>s.decorations});function _n(s){return e=>{let t=e.state.field(ei,!1);return t&&t.query.spec.valid?s(e,t):kf(e)}}const Is=_n((s,{query:e})=>{let{to:t}=s.state.selection.main,i=e.nextMatch(s.state,t,t);if(!i)return!1;let n=S.single(i.from,i.to),r=s.state.facet(Ti);return s.dispatch({selection:n,effects:[Yo(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),xf(s),!0}),Ns=_n((s,{query:e})=>{let{state:t}=s,{from:i}=t.selection.main,n=e.prevMatch(t,i,i);if(!n)return!1;let r=S.single(n.from,n.to),o=s.state.facet(Ti);return s.dispatch({selection:r,effects:[Yo(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),xf(s),!0}),Iy=_n((s,{query:e})=>{let t=e.matchAll(s.state,1e3);return!t||!t.length?!1:(s.dispatch({selection:S.create(t.map(i=>S.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),Ny=({state:s,dispatch:e})=>{let t=s.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:n}=t.main,r=[],o=0;for(let l=new Tn(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(S.range(l.value.from,l.value.to))}return e(s.update({selection:S.create(r,o),userEvent:"select.search.matches"})),!0},ka=_n((s,{query:e})=>{let{state:t}=s,{from:i,to:n}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,i,i);if(!r)return!1;let o=r,l=[],a,h,c=[];o.precise?o.from==i&&o.to==n&&(h=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:h}),o=e.nextMatch(t,o.from,o.to),c.push(H.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))):o=e.nextMatch(t,o.from,o.to);let f=s.state.changes(l);return o&&(a=S.single(o.from,o.to).map(f),c.push(Yo(s,o)),c.push(t.facet(Ti).scrollToMatch(a.main,s))),s.dispatch({changes:f,selection:a,effects:c,userEvent:"input.replace"}),!0}),_y=_n((s,{query:e})=>{if(s.state.readOnly)return!1;let t=[];for(let n of e.matchAll(s.state,1e9)){let{from:r,to:o,precise:l}=n;l&&t.push({from:r,to:o,insert:e.getReplacement(n)})}if(!t.length)return!1;let i=s.state.phrase("replaced $ matches",t.length)+".";return s.dispatch({changes:t,effects:H.announce.of(i),userEvent:"input.replace.all"}),!0});function Jo(s){return s.state.facet(Ti).createPanel(s)}function uo(s,e){var t,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(e&&!a)return e;let h=s.facet(Ti);return new vf({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=e==null?void 0:e.literal)!==null&&n!==void 0?n:h.literal,regexp:(r=e==null?void 0:e.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=e==null?void 0:e.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function wf(s){let e=Yh(s,Jo);return e&&e.dom.querySelector("[main-field]")}function xf(s){let e=wf(s);e&&e==s.root.activeElement&&e.select()}const kf=s=>{let e=s.state.field(ei,!1);if(e&&e.panel){let t=wf(s);if(t&&t!=s.root.activeElement){let i=uo(s.state,e.query.spec);i.valid&&s.dispatch({effects:Dn.of(i)}),t.focus(),t.select()}}else s.dispatch({effects:[Go.of(!0),e?Dn.of(uo(s.state,e.query.spec)):oe.appendConfig.of(po)]});return!0},Sf=s=>{let e=s.state.field(ei,!1);if(!e||!e.panel)return!1;let t=Yh(s,Jo);return t&&t.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:Go.of(!1)}),!0},Fy=[{key:"Mod-f",run:kf,scope:"editor search-panel"},{key:"F3",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Is,shift:Ns,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Sf,scope:"editor search-panel"},{key:"Mod-Shift-l",run:Ny},{key:"Mod-Alt-g",run:xy},{key:"Mod-d",run:Cy,preventDefault:!0}];class Wy{constructor(e){this.view=e;let t=this.query=e.state.field(ei).query.spec;this.commit=this.commit.bind(this),this.searchField=Ee("input",{value:t.search,placeholder:Ze(e,"Find"),"aria-label":Ze(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Ee("input",{value:t.replace,placeholder:Ze(e,"Replace"),"aria-label":Ze(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Ee("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Ee("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Ee("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(n,r,o){return Ee("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=Ee("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>Is(e),[Ze(e,"next")]),i("prev",()=>Ns(e),[Ze(e,"previous")]),i("select",()=>Iy(e),[Ze(e,"all")]),Ee("label",null,[this.caseField,Ze(e,"match case")]),Ee("label",null,[this.reField,Ze(e,"regexp")]),Ee("label",null,[this.wordField,Ze(e,"by word")]),...e.state.readOnly?[]:[Ee("br"),this.replaceField,i("replace",()=>ka(e),[Ze(e,"replace")]),i("replaceAll",()=>_y(e),[Ze(e,"replace all")])],Ee("button",{name:"close",onclick:()=>Sf(e),"aria-label":Ze(e,"close"),type:"button"},["×"])])}commit(){let e=new vf({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Dn.of(e)}))}keydown(e){xg(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Ns:Is)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),ka(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(Dn)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Ti).top}}function Ze(s,e){return s.state.phrase(e)}const ns=30,ss=/[\s\.,:;?!]/;function Yo(s,{from:e,to:t}){let i=s.state.doc.lineAt(e),n=s.state.doc.lineAt(t).to,r=Math.max(i.from,e-ns),o=Math.min(n,t+ns),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;al.length-ns;a--)if(!ss.test(l[a-1])&&ss.test(l[a])){l=l.slice(0,a);break}}return H.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const Hy=H.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),po=[ei,On.low(Py),Hy];function Vy(s){const e=s.lastIndexOf("/");return e>=0?s.slice(e+1):s}async function dt(s,e){const[{StreamLanguage:t},i]=await Promise.all([le(()=>Promise.resolve().then(()=>r0),void 0),s]),n=i[e];return t.define(n)}async function $y(s){const e=Vy(s);switch(e){case"Dockerfile":return dt(le(()=>import("./dockerfile-ZL4hHokT.js"),[]),"dockerFile");case"Gemfile":case"Rakefile":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"Makefile":case"GNUmakefile":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"c")}const t=/\.([A-Za-z0-9]+)$/.exec(e),i=t?t[1].toLowerCase():null;if(!i)return null;switch(i){case"js":case"jsx":case"ts":case"tsx":{const{javascript:n}=await le(async()=>{const{javascript:r}=await import("./index-ChhOm7oD.js");return{javascript:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]));return n({typescript:i==="ts"||i==="tsx",jsx:i==="jsx"||i==="tsx"})}case"json":{const{json:n}=await le(async()=>{const{json:r}=await import("./index-Cnryh6X_.js");return{json:r}},__vite__mapDeps([10,1,3,4,5,6,7,8,9]));return n()}case"md":case"markdown":{const{markdown:n}=await le(async()=>{const{markdown:r}=await import("./index-7QWmdym1.js");return{markdown:r}},__vite__mapDeps([11,2,12,1,13,3,4,5,6,7,8,9,0]));return n()}case"css":case"scss":{const{css:n}=await le(async()=>{const{css:r}=await import("./index-BHEGRR_x.js");return{css:r}},__vite__mapDeps([13,1,3,4,5,6,7,8,9]));return n()}case"html":case"htm":{const{html:n}=await le(async()=>{const{html:r}=await import("./index-DI-4cHpq.js");return{html:r}},__vite__mapDeps([12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"py":{const{python:n}=await le(async()=>{const{python:r}=await import("./index-DKJlFFIC.js");return{python:r}},__vite__mapDeps([14,1,2,3,4,5,6,7,8,9]));return n()}case"go":{const{go:n}=await le(async()=>{const{go:r}=await import("./index-CC5g0Nm4.js");return{go:r}},__vite__mapDeps([15,1,2,3,4,5,6,7,8,9]));return n()}case"rs":{const{rust:n}=await le(async()=>{const{rust:r}=await import("./index-BTPAbX_e.js");return{rust:r}},__vite__mapDeps([16,1,3,4,5,6,7,8,9]));return n()}case"c":case"cc":case"cpp":case"cxx":case"h":case"hpp":case"hh":case"m":case"mm":{const{cpp:n}=await le(async()=>{const{cpp:r}=await import("./index-DO3lkMm1.js");return{cpp:r}},__vite__mapDeps([17,1,3,4,5,6,7,8,9]));return n()}case"java":{const{java:n}=await le(async()=>{const{java:r}=await import("./index-CL_O9F0b.js");return{java:r}},__vite__mapDeps([18,1,3,4,5,6,7,8,9]));return n()}case"php":{const{php:n}=await le(async()=>{const{php:r}=await import("./index-DL67eyEa.js");return{php:r}},__vite__mapDeps([19,1,12,13,3,4,5,6,7,8,9,0,2]));return n()}case"sql":{const{sql:n}=await le(async()=>{const{sql:r}=await import("./index-CWU_7NNG.js");return{sql:r}},__vite__mapDeps([20,1,2,3,4,5,6,7,8,9]));return n()}case"xml":case"xsd":case"xsl":case"plist":case"svg":{const{xml:n}=await le(async()=>{const{xml:r}=await import("./index-wpy5ZEXj.js");return{xml:r}},__vite__mapDeps([21,1,3,4,5,6,7,8,9]));return n()}case"yml":case"yaml":{const{yaml:n}=await le(async()=>{const{yaml:r}=await import("./index-DDrs-wZn.js");return{yaml:r}},__vite__mapDeps([22,1,3,4,5,6,7,8,9]));return n()}case"vue":{const{vue:n}=await le(async()=>{const{vue:r}=await import("./index-Z6WUIGxm.js");return{vue:r}},__vite__mapDeps([23,12,1,13,3,4,5,6,7,8,9,0,2]));return n()}case"sass":{const{sass:n}=await le(async()=>{const{sass:r}=await import("./index-Ccyjkum6.js");return{sass:r}},__vite__mapDeps([24,1,13,3,4,5,6,7,8,9]));return n()}case"sh":case"bash":case"zsh":case"fish":case"ksh":return dt(le(()=>import("./shell-CjFT_Tl9.js"),[]),"shell");case"toml":return dt(le(()=>import("./toml-Bm5Em-hy.js"),[]),"toml");case"rb":return dt(le(()=>import("./ruby-B2Rjki9n.js"),[]),"ruby");case"lua":return dt(le(()=>import("./lua-VAEuO923.js"),[]),"lua");case"ini":case"properties":case"conf":return dt(le(()=>import("./properties-C78fOPTZ.js"),[]),"properties");case"diff":case"patch":return dt(le(()=>import("./diff-DbItnlRl.js"),[]),"diff");case"swift":return dt(le(()=>import("./swift-BzpIVaGY.js"),[]),"swift");case"kt":case"kts":case"scala":return dt(le(()=>import("./clike-B9uivgTg.js"),[]),"kotlin");default:return null}}const zy=Mi.define([{tag:v.keyword,color:"#f47067"},{tag:v.controlKeyword,color:"#f47067"},{tag:v.operatorKeyword,color:"#f47067"},{tag:v.definitionKeyword,color:"#f47067"},{tag:v.modifier,color:"#f47067"},{tag:v.string,color:"#96d0ff"},{tag:v.special(v.string),color:"#96d0ff"},{tag:v.regexp,color:"#96d0ff"},{tag:v.escape,color:"#96d0ff"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#768390",fontStyle:"italic"},{tag:v.number,color:"#6cb6ff"},{tag:v.bool,color:"#6cb6ff"},{tag:v.atom,color:"#6cb6ff"},{tag:v.function(v.variableName),color:"#dcbdfb"},{tag:v.function(v.propertyName),color:"#dcbdfb"},{tag:v.macroName,color:"#dcbdfb"},{tag:v.variableName,color:"#adbac7"},{tag:v.propertyName,color:"#adbac7"},{tag:v.typeName,color:"#ffaf6f"},{tag:v.className,color:"#ffaf6f"},{tag:v.namespace,color:"#ffaf6f"},{tag:v.operator,color:"#f47067"},{tag:v.punctuation,color:"#adbac7"},{tag:v.bracket,color:"#adbac7"},{tag:v.derefOperator,color:"#adbac7"},{tag:v.tagName,color:"#8ddb8c"},{tag:v.attributeName,color:"#dcbdfb"},{tag:v.attributeValue,color:"#96d0ff"},{tag:v.heading,color:"#6cb6ff",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#6cb6ff",textDecoration:"underline"},{tag:v.url,color:"#6cb6ff"},{tag:v.quote,color:"#768390"},{tag:v.monospace,color:"#96d0ff"},{tag:v.invalid,color:"#ff938a"},{tag:v.deleted,color:"#ff938a",backgroundColor:"rgba(244,112,103,0.15)"},{tag:v.inserted,color:"#8ddb8c",backgroundColor:"rgba(141,219,140,0.15)"}]),qy=Mi.define([{tag:v.keyword,color:"#cf222e"},{tag:v.controlKeyword,color:"#cf222e"},{tag:v.operatorKeyword,color:"#cf222e"},{tag:v.definitionKeyword,color:"#cf222e"},{tag:v.modifier,color:"#cf222e"},{tag:v.string,color:"#0a3069"},{tag:v.special(v.string),color:"#0a3069"},{tag:v.regexp,color:"#0a3069"},{tag:v.escape,color:"#0a3069"},{tag:[v.comment,v.lineComment,v.blockComment,v.docComment],color:"#6e7781",fontStyle:"italic"},{tag:v.number,color:"#0550ae"},{tag:v.bool,color:"#0550ae"},{tag:v.atom,color:"#0550ae"},{tag:v.function(v.variableName),color:"#8250df"},{tag:v.function(v.propertyName),color:"#8250df"},{tag:v.macroName,color:"#8250df"},{tag:v.variableName,color:"#24292f"},{tag:v.propertyName,color:"#24292f"},{tag:v.typeName,color:"#953800"},{tag:v.className,color:"#953800"},{tag:v.namespace,color:"#953800"},{tag:v.operator,color:"#cf222e"},{tag:v.punctuation,color:"#24292f"},{tag:v.bracket,color:"#24292f"},{tag:v.derefOperator,color:"#24292f"},{tag:v.tagName,color:"#116329"},{tag:v.attributeName,color:"#8250df"},{tag:v.attributeValue,color:"#0a3069"},{tag:v.heading,color:"#0550ae",fontWeight:"bold"},{tag:v.strong,fontWeight:"bold"},{tag:v.emphasis,fontStyle:"italic"},{tag:v.link,color:"#0969da",textDecoration:"underline"},{tag:v.url,color:"#0969da"},{tag:v.quote,color:"#6e7781"},{tag:v.monospace,color:"#0a3069"},{tag:v.invalid,color:"#82071e"},{tag:v.deleted,color:"#82071e",backgroundColor:"rgba(255,129,130,0.2)"},{tag:v.inserted,color:"#116329",backgroundColor:"rgba(74,194,107,0.2)"}]);function Uy(s){return Ac(s==="light"?qy:zy)}const Ky={class:"file-editor"},jy={key:0,class:"banner err conflict","data-test":"conflict-banner"},Gy={class:"msg"},Jy={key:1,class:"banner err","data-test":"save-error"},Yy={key:2,class:"reload-badge"},Xy={key:3,class:"banner muted"},Qy={key:4,class:"banner muted"},Zy={key:5,class:"banner err"},e1={key:6,class:"banner muted"},Sa=2*1024*1024,t1=Qe({__name:"CodeEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const{t:i}=Ji(),n=s,r=t,o=j(null),l=j("loading"),a=j(""),h=j(!1),c=j(null),f=j(!1),u=j(null),d=j("");let p=null,g=null,y=!1,b=0,x="";function T(L,R,Z,X,ue){return!y&&b===ue&&n.fs===L&&n.path===R&&n.showLineNumbers===Z&&n.theme===X}function D(L,R){return typeof window>"u"||!o.value?R:getComputedStyle(o.value).getPropertyValue(L).trim()||R}function A(L){let R;if(typeof L=="string"){const Z=atob(L);R=new Uint8Array(Z.length);for(let X=0;XSa){l.value="tooLarge",C(!1);return}const ot=await L.readFile(R,Sa);if(!T(L,R,Z,X,ue))return;const de=A(ot.data);x=de,C(!1),u.value=null,d.value="";const Te=H.updateListener.of($e=>{$e.docChanged&&C($e.state.doc.toString()!==x)}),De=Qr.of([{key:"Mod-s",preventDefault:!0,run:()=>(M(),!0)}]),Fe=[P(X),Uy(X),g0(),Ay({top:!0}),Qr.of([...by,...C0,...Fy]),De,Te];Z&&Fe.push(Ig());const Le=await $y(R);if(Le&&Fe.push(Le),!T(L,R,Z,X,ue)||!o.value)return;const je=new H({state:se.create({doc:de,extensions:Fe}),parent:o.value});if(!T(L,R,Z,X,ue)){je.destroy();return}p=je,l.value="ok"}catch(Me){if(!T(L,R,Z,X,ue))return;l.value="error",a.value=Me.message}}}async function M(){if(!p||l.value!=="ok")return!1;const L=p.state.doc.toString(),R=new TextEncoder().encode(L);d.value="";try{const Z=await n.fs.writeFile(n.path,R,c.value);return x=L,c.value=Z.modTime,h.value=!1,u.value=null,C(!1),!0}catch(Z){const X=Z.message??"",ue=/stale_modtime: current=(\d+)/.exec(X);return ue?u.value={currentModTime:Number(ue[1])}:d.value=X,!1}}async function $(){u.value&&(c.value=u.value.currentModTime,u.value=null,await M())}function N(){u.value=null,U()}async function I(L,R){const Z=n.path,X=b;if(!(!Z.startsWith(R+"/")&&Z!==R))try{const ue=await L.fileMeta(Z);if(y||n.fs!==L||n.path!==Z||b!==X)return;c.value&&ue.modTime>c.value&&(h.value=!0)}catch{}}function G(L){g==null||g(),g=L.onDirChanged(R=>{I(L,R)})}return En(()=>{y=!1,U(),G(n.fs)}),ft(()=>[n.path,n.fs,n.showLineNumbers,n.theme],()=>{U()}),ft(()=>n.fs,L=>G(L)),qt(()=>{y=!0,b++,p==null||p.destroy(),p=null,g&&g()}),e({save:M,testAppend:L=>{p&&p.dispatch({changes:{from:p.state.doc.length,insert:L}})}}),(L,R)=>(O(),V("div",Ky,[u.value?(O(),V("div",jy,[J("span",Gy,Q(q(i)("plugins.fileExplorer.staleModTime")),1),J("button",{"data-test":"conflict-overwrite",onClick:$},Q(q(i)("plugins.fileExplorer.overwrite")),1),J("button",{"data-test":"conflict-reload",onClick:N},Q(q(i)("plugins.fileExplorer.reloadDiscard")),1),J("button",{"data-test":"conflict-cancel",onClick:R[0]||(R[0]=Z=>u.value=null)},Q(q(i)("plugins.fileExplorer.cancel")),1)])):Ie("",!0),d.value?(O(),V("div",Jy,Q(q(i)("plugins.fileExplorer.saveFailed",{message:d.value})),1)):Ie("",!0),h.value?(O(),V("div",Yy,[ps(Q(q(i)("plugins.fileExplorer.fileChanged"))+" ",1),J("button",{onClick:U},Q(f.value?q(i)("plugins.fileExplorer.reloadDiscard"):q(i)("plugins.fileExplorer.reload")),1)])):Ie("",!0),l.value==="tooLarge"?(O(),V("div",Xy,Q(q(i)("plugins.fileExplorer.tooLarge")),1)):l.value==="binary"?(O(),V("div",Qy,Q(q(i)("plugins.fileExplorer.binary")),1)):l.value==="error"?(O(),V("div",Zy,Q(q(i)("plugins.fileExplorer.errorPrefix",{message:a.value})),1)):l.value==="loading"?(O(),V("div",e1,Q(q(i)("common.loading")),1)):Ie("",!0),ds(J("div",{ref_key:"host",ref:o,class:"cm-host"},null,512),[[If,l.value==="ok"]])]))}}),i1=rt(t1,[["__scopeId","data-v-25358a6a"]]),n1={class:"binary-banner"},s1={class:"msg"},r1=Qe({__name:"BinaryBanner",props:{fs:{},path:{},message:{}},setup(s){const e=s,{t}=Ji();async function i(){try{await e.fs.openExternal(e.path)}catch{}}return(n,r)=>(O(),V("div",n1,[J("span",s1,Q(n.message??q(t)("plugins.fileExplorer.unsupportedPreview")),1),J("button",{class:"open-btn",onClick:i},Q(q(t)("plugins.fileExplorer.openInSystem")),1)]))}}),ji=rt(r1,[["__scopeId","data-v-780ce2ee"]]),o1=["data-asset-request","src"],l1=Qe({__name:"ImagePreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=j(""),i=j(0),n=j("fit"),r=j(!1);let o=!0,l=0,a=null;function h(){var d,p;a&&((p=(d=a.fs).revokeAssetUrl)==null||p.call(d,a.path),a=null)}async function c(){var y;const d=e.fs,p=e.path,g=++l;i.value=g,h(),a={fs:d,path:p},t.value="",r.value=!1;try{const b=await d.assetUrlFor(p);if(!o||g!==l||e.fs!==d||e.path!==p){(y=d.revokeAssetUrl)==null||y.call(d,p);return}t.value=b}catch{o&&g===l&&e.fs===d&&e.path===p&&(r.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{c()},{immediate:!0}),qt(()=>{o=!1,l++,h()});function f(){n.value=n.value==="fit"?"native":"fit"}function u(d){const p=d.currentTarget;!t.value||!p||p.dataset.assetRequest!==String(i.value)||(h(),r.value=!0)}return(d,p)=>r.value?(O(),ke(ji,{key:0,fs:d.fs,path:d.path},null,8,["fs","path"])):(O(),V("div",{key:1,class:Gi(["img-host",n.value])},[(O(),V("img",{key:i.value,"data-asset-request":i.value,src:t.value,alt:"",onClick:f,onError:u},null,40,o1))],2))}}),a1=rt(l1,[["__scopeId","data-v-06adca93"]]),h1={key:1,class:"media-host"},c1=["data-asset-request","src"],f1=["data-asset-request","src"],u1=Qe({__name:"MediaPreview",props:{fs:{},path:{},kind:{}},setup(s){const e=s,t=j(""),i=j(0),n=j(!1);let r=!0,o=0,l=null;function a(){var f,u;l&&((u=(f=l.fs).revokeAssetUrl)==null||u.call(f,l.path),l=null)}async function h(){var p;const f=e.fs,u=e.path,d=++o;i.value=d,a(),l={fs:f,path:u},t.value="",n.value=!1;try{const g=await f.assetUrlFor(u);if(!r||d!==o||e.fs!==f||e.path!==u){(p=f.revokeAssetUrl)==null||p.call(f,u);return}t.value=g}catch{r&&d===o&&e.fs===f&&e.path===u&&(n.value=!0)}}ft(()=>[e.path,e.fs.identity],()=>{h()},{immediate:!0}),qt(()=>{r=!1,o++,a()});function c(f){const u=f.currentTarget;!t.value||!u||u.dataset.assetRequest!==String(i.value)||(a(),n.value=!0)}return(f,u)=>n.value?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):(O(),V("div",h1,[f.kind==="video"?(O(),V("video",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,c1)):(O(),V("audio",{key:i.value,"data-asset-request":i.value,src:t.value,controls:"",preload:"metadata",onError:c},null,40,f1))]))}}),d1=rt(u1,[["__scopeId","data-v-71c6a6ef"]]),p1={key:1,class:"pdf-host"},g1=["data"],m1=Qe({__name:"PdfPreview",props:{fs:{},path:{}},setup(s){const e=s,t=j(""),i=j(!1);let n=!0,r=0,o=null;function l(){var h,c;o&&((c=(h=o.fs).revokeAssetUrl)==null||c.call(h,o.path),o=null)}async function a(){var u;const h=e.fs,c=e.path,f=++r;l(),o={fs:h,path:c},t.value="",i.value=!1;try{const d=await h.assetUrlFor(c);if(!n||f!==r||e.fs!==h||e.path!==c){(u=h.revokeAssetUrl)==null||u.call(h,c);return}t.value=d}catch{n&&f===r&&e.fs===h&&e.path===c&&(i.value=!0)}}return ft(()=>[e.path,e.fs.identity],()=>{a()},{immediate:!0}),qt(()=>{n=!1,r++,l()}),(h,c)=>i.value?(O(),ke(ji,{key:0,fs:h.fs,path:h.path},null,8,["fs","path"])):(O(),V("div",p1,[J("object",{data:t.value,type:"application/pdf"},[vi(ji,{fs:h.fs,path:h.path},null,8,["fs","path"])],8,g1)]))}}),y1=rt(m1,[["__scopeId","data-v-160ee5d7"]]),v1=["innerHTML"],b1={key:2,class:"md-host placeholder"},Ca=2*1024*1024,w1=Qe({__name:"MarkdownPreview",props:{fs:{},path:{},theme:{}},setup(s){const e=s,t=La(),i=j(""),n=j("loading");let r=!1,o=0;function l(f,u,d){return!r&&o===d&&e.fs===f&&e.path===u}function a(f){let u;if(typeof f=="string"){const d=atob(f);u=new Uint8Array(d.length);for(let p=0;pCa){n.value="error";return}const g=await f.readFile(u,Ca);if(!l(f,u,d))return;const y=a(g.data),b=(await le(async()=>{const{default:D}=await import("./index-D8AWWFft.js");return{default:D}},[])).default,T=new b({html:!1,linkify:!0,breaks:!1}).render(y);if(!l(f,u,d))return;i.value=T,n.value="ok"}catch{if(!l(f,u,d))return;n.value="error"}}}function c(f){const u=f.target;if(!u)return;const d=u.closest("a");if(!d)return;const p=d.getAttribute("href")??"";f.preventDefault(),/^(https?|mailto):/i.test(p)&&t.system.openExternalURL(p)}return En(()=>{r=!1,h()}),ft(()=>[e.path,e.fs],()=>{h()}),qt(()=>{r=!0,o++}),(f,u)=>n.value==="error"?(O(),ke(ji,{key:0,fs:f.fs,path:f.path},null,8,["fs","path"])):n.value==="ok"?(O(),V("div",{key:1,class:Gi(["md-host",f.theme]),innerHTML:i.value,onClick:c},null,10,v1)):(O(),V("div",b1,"…"))}}),x1=rt(w1,[["__scopeId","data-v-b84f1c1b"]]),k1={class:"file-editor-host"},S1={key:0,class:"banner err"},C1={key:7,class:"banner muted","data-test":"kind-pending"},A1=Qe({__name:"FileEditor",props:{fs:{},path:{},showLineNumbers:{type:Boolean},theme:{},viewMode:{}},emits:["dirty-change"],setup(s,{expose:e,emit:t}){const i=s,n=t,r=j(null);async function o(){var p,g;return((g=(p=r.value)==null?void 0:p.save)==null?void 0:g.call(p))??Promise.resolve(!1)}e({save:o});const{t:l}=Ji(),a=j(null),h=j("");let c=!1,f=0;function u(p,g,y){return!c&&f===y&&i.fs===p&&i.path===g}async function d(){const p=i.fs,g=i.path,y=++f;a.value=null,h.value="";try{const b=await p.fileMeta(g);if(!u(p,g,y))return;a.value=cd(g,b.isBinary)}catch(b){if(!u(p,g,y))return;h.value=(b==null?void 0:b.message)||String(b)||l("plugins.fileExplorer.unknownError")}}return ft(()=>[i.path,i.fs],()=>{d()},{immediate:!0}),qt(()=>{c=!0,f++}),(p,g)=>(O(),V("div",k1,[h.value?(O(),V("div",S1,Q(q(l)("plugins.fileExplorer.errorPrefix",{message:h.value})),1)):a.value==="code"||(a.value==="svg"||a.value==="markdown")&&p.viewMode==="code"?(O(),ke(i1,{key:1,ref_key:"codeEditorRef",ref:r,fs:p.fs,path:p.path,"show-line-numbers":p.showLineNumbers,theme:p.theme,onDirtyChange:g[0]||(g[0]=y=>n("dirty-change",y))},null,8,["fs","path","show-line-numbers","theme"])):a.value==="image"||a.value==="svg"&&p.viewMode==="render"?(O(),ke(a1,{key:2,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="markdown"&&p.viewMode==="render"?(O(),ke(x1,{key:3,fs:p.fs,path:p.path,theme:p.theme},null,8,["fs","path","theme"])):a.value==="video"||a.value==="audio"?(O(),ke(d1,{key:4,fs:p.fs,path:p.path,kind:a.value},null,8,["fs","path","kind"])):a.value==="pdf"?(O(),ke(y1,{key:5,fs:p.fs,path:p.path},null,8,["fs","path"])):a.value==="binary-unknown"?(O(),ke(ji,{key:6,fs:p.fs,path:p.path},null,8,["fs","path"])):(O(),V("div",C1,Q(q(l)("common.loading")),1))]))}}),M1=rt(A1,[["__scopeId","data-v-db7692c8"]]);function Aa(s){return/\.(md|markdown)$/i.test(s)?"render":"code"}const T1=8;function kr(s,e,t){const i=Date.now(),n=s.tabs.findIndex(o=>o.path===e);if(n>=0){const o=yi(s);return o.tabs[n].lastActiveAt=i,t==="persistent"&&(o.tabs[n].persistent=!0),o.activeIdx=n,o}if(t==="preview"){const o=s.tabs.findIndex(l=>!l.persistent);if(o>=0){const l=yi(s);return l.tabs[o]={path:e,persistent:!1,lastActiveAt:i,viewMode:Aa(e),dirty:!1},l.activeIdx=o,l}}let r=yi(s);return r.tabs.push({path:e,persistent:t==="persistent",lastActiveAt:i,viewMode:Aa(e),dirty:!1}),r.activeIdx=r.tabs.length-1,r.tabs.length>T1&&(r=E1(r)),r}function D1(s,e){if(e<0||e>=s.tabs.length)return s;const t=yi(s);return t.tabs.splice(e,1),t.tabs.length===0?(t.activeIdx=-1,t):(t.activeIdx=Math.min(e,t.tabs.length-1),t)}function E1(s){const e=s.activeIdx>=0?s.tabs[s.activeIdx].path:null,t=a=>!a.persistent&&a.path!==e,i=s.tabs.filter(t),n=i.length>0?i:s.tabs;let r=n[0];for(const a of n)a.lastActiveAtr.path===e);if(i<0||s.tabs[i].dirty===t)return s;const n=yi(s);return n.tabs[i].dirty=t,n}function yi(s){return{tabs:s.tabs.map(e=>({...e})),activeIdx:s.activeIdx}}function B1(s,e){return{identity:"local",listDir:t=>s.fs.listDir(t),watchDir:t=>s.fs.watchDir(t),unwatchDir:async t=>{if(typeof t!="number")throw new Error("local filesystem watch ID must be a number");await s.fs.unwatchDir(t)},readFile:(t,i)=>s.fs.readFile(t,i),fileMeta:t=>s.fs.fileMeta(t),openExternal:t=>s.fs.openExternal(t),assetUrlFor:t=>Promise.resolve(s.fs.assetUrlFor(t)),onDirChanged:t=>(e==null?void 0:e.on("plugin-fs:dir-changed",i=>{typeof i=="string"&&t(i)}))??(()=>{}),dispose:()=>{},writeFile:(t,i,n)=>s.fs.writeFile(t,Array.from(i),n??0,n===null),createFile:t=>s.fs.createFile(t),rename:(t,i)=>s.fs.rename(t,i),remove:(t,i)=>s.fs.remove(t,i),mkdir:t=>s.fs.mkdir(t),trash:t=>s.fs.trash(t)}}const R1=2*1024*1024,P1=256*1024,Ma=50*1024*1024,Ta="application/octet-stream";function et(s){if(!s.ok)throw new Error(s.error||"remote filesystem request failed");return s}function Cf(s){try{const e=atob(s),t=new Uint8Array(e.length);for(let i=0;iMa)throw new Error("remote asset exceeds the 50 MiB size limit");const X=_1(R);if(I+X.byteLength>Ma)throw new Error("remote asset exceeds the 50 MiB size limit");if(G&&(N=R.contentType||Ta,G=!1),$.push(F1(X)),I+=X.byteLength,R.eof)break;if(X.byteLength===0)throw new Error("remote filesystem response returned an empty non-final chunk")}return URL.createObjectURL(new Blob($,{type:N}))}function A(M){if(l)return Promise.reject(new Error("remote filesystem bridge is disposed"));const $=t.get(M);if($)return Promise.resolve($);const N=n.get(M)??0,I=i.get(M);if((I==null?void 0:I.generation)===N)return I.promise;const G=D(M).then(R=>{if(l)throw URL.revokeObjectURL(R),new Error("remote filesystem bridge is disposed");if((n.get(M)??0)!==N)throw URL.revokeObjectURL(R),new Error("remote filesystem asset request was invalidated");return t.set(M,R),R});i.set(M,{generation:N,promise:G});const L=()=>{var R;((R=i.get(M))==null?void 0:R.promise)===G&&i.delete(M)};return G.then(L,L),G}function P(M){n.set(M,(n.get(M)??0)+1);const $=t.get(M);$&&(URL.revokeObjectURL($),t.delete(M))}function C(M){if(l)return()=>{};const $={handler:M};return r.add($),o||(o=s.onFSEvent(N=>{if(!(l||N.event!=="changed"||!N.path))for(const{handler:I}of Array.from(r))try{I(N.path)}catch(G){it("file-explorer","dir-changed subscriber threw",{path:N.path,error:Se(G)})}})),()=>{r.delete($),r.size===0&&o&&(o(),o=null)}}function U(){if(!l){l=!0;for(const M of t.values())URL.revokeObjectURL(M);t.clear(),i.clear(),n.clear(),r.clear(),o&&(o(),o=null)}}return{identity:e,listDir:a,watchDir:h,unwatchDir:c,readFile:f,fileMeta:u,openExternal:d,assetUrlFor:A,onDirChanged:C,revokeAssetUrl:P,dispose:U,writeFile:p,createFile:g,rename:y,remove:b,mkdir:x,trash:T}}function _1(s){if(typeof s.data!="string")throw new Error("remote filesystem response chunk missing data");if(!Number.isSafeInteger(s.length)||s.length<0)throw new Error("remote filesystem response chunk has invalid length");const e=Cf(s.data);if(s.length!==e.byteLength)throw new Error("remote filesystem response chunk length does not match data");return e}function F1(s){const e=new Uint8Array(s.byteLength);return e.set(s),e.buffer}const W1=2*1024*1024,H1="/",V1="already_exists",$1="no platform trash command available",z1=200;function Da(s){return _s("plugins.fileExplorer.sshNoRecursiveDelete",{path:s})}function Ea(s){return Promise.reject(new Error(_s(`plugins.fileExplorer.${s}`)))}function rs(s,e){const t=Se(e);return t.includes(V1)?new Error(_s("plugins.fileExplorer.sshUploadExists",{path:s})):new Error(t)}function q1(s){let e=!1;function t(){if(e)throw new Error(_s("plugins.fileExplorer.sshBridgeDisposed"))}async function i(d){t();const p=await Jf(s,d);return{entries:p.entries??[],truncated:!!p.truncated,total:p.total??(p.entries??[]).length}}async function n(d){return(await i(d)).entries}async function r(d){return t(),await Gf(s,d)}async function o(d,p=W1){return t(),await jf(s,d,p)}async function l(d,p,g){t();try{return await Kf(s,d,p,g??0,g===null)}catch(y){throw rs(d,y)}}async function a(d){t();try{return await Uf(s,d)}catch(p){throw rs(d,p)}}async function h(d){t();try{return await qf(s,d)}catch(p){throw rs(d,p)}}async function c(d,p){t();try{return await zf(s,d,p)}catch(g){throw rs(p,g)}}async function f(d,p){if(t(),p)throw new Error(Da(d));await $f(s,d,!1)}function u(){if(!e){e=!0;try{Vf(s).catch(d=>{it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})})}catch(d){it("file-explorer","releasing the ssh file source failed",{hostID:s,error:Se(d)})}}}return{identity:`ssh:${s}`,searchMaxDirs:z1,dirRemovalRefusal:Da,listDir:n,listDirDetailed:i,fileMeta:r,readFile:o,writeFile:l,createFile:a,mkdir:h,rename:c,remove:f,watchDir:()=>Promise.resolve(`ssh:${s}`),unwatchDir:()=>Promise.resolve(),onDirChanged:()=>()=>{},openExternal:()=>Ea("sshNoOpenExternal"),assetUrlFor:()=>Ea("sshNoInlineAsset"),trash:()=>Promise.reject(new Error($1)),dispose:u}}const U1={class:"file-explorer"},K1={class:"fe-header"},j1=["title"],G1=["disabled","title"],J1=["title"],Y1={key:0,class:"source-picker"},X1=["aria-label"],Q1={value:""},Z1=["value"],ev={class:"tree-search"},tv=["placeholder","aria-label"],iv={class:"tree-scroll"},nv={key:1,class:"placeholder"},sv={class:"editor-pane"},rv={class:"editor-area"},ov={key:1,class:"placeholder"},lv=Qe({__name:"FileExplorer",props:{context:{}},setup(s){const e=s,t=La(),i=Yf(),{t:n}=Ji(),r=j(null),o=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.innerTreeRatio)??.3}),l=j(null),a=me(()=>l.value??o.value),h=j(null),{onMouseDown:c}=eu({onDrag:B=>{if(!h.value)return;const K=h.value.clientWidth;if(K<=0)return;const te=l.value??o.value,ge=Math.max(.15,Math.min(te-B/K,.5));l.value=ge},onEnd:()=>{if(l.value===null||!i.cfg){l.value=null;return}const B=JSON.parse(JSON.stringify(i.cfg));B.fileExplorer.innerTreeRatio=l.value,i.save(B),l.value=null}}),f=j([]),u=j("");async function d(){if(t.pluginHost)try{f.value=await tu()??[]}catch(B){it("file-explorer","ssh sources unavailable",{error:Se(B)}),f.value=[]}}d();function p(B){return B.alias||`${B.user}@${B.host}`}const g=me(()=>{if(u.value)return{identity:`ssh:${u.value}`,connection:null,sshHostID:u.value};if(!e.context.activeIsRemote.value)return{identity:t.pluginHost?"local":null,connection:null,sshHostID:""};const B=e.context.activeSessionId.value,K=e.context.activeSessionConnection.value;return{identity:B&&K?`remote:${B}`:null,connection:K,sshHostID:""}}),y=j({});ft(()=>[e.context.activeCwd.value,g.value.identity,g.value.sshHostID],([B,K,te])=>{B&&K&&!te&&(y.value={...y.value,[K]:B})},{immediate:!0});const b=me(()=>{if(g.value.sshHostID)return H1;if(r.value)return r.value;const B=e.context.activeCwd.value;if(B)return B;const K=g.value.identity;return K?y.value[K]??null:null}),x=j({tabs:[],activeIdx:-1}),T=Nf(null),D=j(0),A=j("");ft(()=>[g.value.identity,g.value.connection,g.value.sshHostID],async([B,K,te])=>{var kt;const ge=te?q1(te):B==="local"?t.pluginHost?B1(t.pluginHost,t.events):null:B&&K?N1(K,B):null,ve=T.value,xt=(ve==null?void 0:ve.identity)!==(ge==null?void 0:ge.identity);T.value=ge,D.value++,xt&&(r.value=null,x.value={tabs:[],activeIdx:-1},A.value=""),await us(),(kt=ve==null?void 0:ve.dispose)==null||kt.call(ve)},{immediate:!0}),qt(()=>{var B,K;(K=(B=T.value)==null?void 0:B.dispose)==null||K.call(B),T.value=null});const P=Xf(),C=j(null),U=j(null),M=j(!1),$=me(()=>{var B;return((B=C.value)==null?void 0:B.selectedDir)??b.value});function N(){var B;(B=U.value)==null||B.click()}async function I(B){var xt,kt,en;const K=B.target,te=((xt=K.files)==null?void 0:xt[0])??null;K.value="";const ge=T.value,ve=$.value;if(!(!te||!ge||!ve)){M.value=!0;try{const It=new Uint8Array(await te.arrayBuffer()),Wn=ve.endsWith("/")?ve+te.name:`${ve}/${te.name}`;await ge.writeFile(Wn,It,null),e.context.showToast(n("plugins.fileExplorer.sshUploadDone",{name:te.name,dir:ve})),(en=(kt=C.value)==null?void 0:kt.refreshDir)==null||en.call(kt,ve)}catch(It){e.context.showToast(Se(It)),it("file-explorer","ssh upload failed",{error:Se(It)})}finally{M.value=!1}}}ft(()=>P.pending,async B=>{var te;if(!B||!T.value)return;await us(),(await((te=C.value)==null?void 0:te.revealPath(B))??!1)&&(x.value=kr(x.value,B,"preview")),P.consume()},{immediate:!0});function G(B){x.value=kr(x.value,B,"preview")}function L(B){x.value=kr(x.value,B,"persistent")}function R(B){x.value={...x.value,activeIdx:B}}function Z(B){x.value=D1(x.value,B)}const X=j(null),ue=j(null);function Me(B){const K=Le.value;K&&(x.value=L1(x.value,K,B))}async function ot(B){const K=x.value.tabs[B];if(!(K!=null&&K.dirty)){Z(B);return}X.value={idx:B,name:K.path.split("/").pop()??K.path,buttons:[{id:"save",label:n("plugins.fileExplorer.save"),kind:"primary"},{id:"dontSave",label:n("plugins.fileExplorer.dontSave"),kind:"danger"},{id:"cancel",label:n("plugins.fileExplorer.cancel"),kind:"secondary"}]}}async function de(B){var ge,ve;const K=X.value;if(X.value=null,!K||B==="cancel")return;if(B==="dontSave"){Z(K.idx);return}(await((ve=(ge=ue.value)==null?void 0:ge.save)==null?void 0:ve.call(ge))??!1)&&Z(K.idx)}function Te(){r.value=r.value===null?e.context.activeCwd.value:null}const De=me(()=>{const B=x.value.activeIdx;return B>=0?x.value.tabs[B].viewMode:"code"});function Fe(){x.value=O1(x.value,De.value==="code"?"render":"code")}const Le=me(()=>x.value.activeIdx>=0?x.value.tabs[x.value.activeIdx].path:null),je=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showHidden)??!1}),$e=me(()=>{var B;return((B=i.cfg)==null?void 0:B.fileExplorer.showLineNumbers)??!1});async function Fn(B,K){if(!i.cfg)return;const te=JSON.parse(JSON.stringify(i.cfg));te.fileExplorer[B]=K;try{await i.save(te)}catch(ge){it("file-explorer","saving view option failed",{error:Se(ge)})}}const ci=me(()=>Qf(e.context.terminalThemeId.value)?"light":"dimmed");return(B,K)=>(O(),V("div",U1,[J("div",{class:"fe-body",ref_key:"bodyRef",ref:h},[J("div",{class:"tree-pane",style:mn({width:a.value*100+"%"})},[J("header",K1,[J("span",{class:"root-path",title:b.value??""},Q(b.value??q(n)("plugins.fileExplorer.noActivePaneShort")),9,j1),g.value.sshHostID?(O(),V("button",{key:0,class:"pin","data-test":"ssh-upload",disabled:M.value||!$.value,title:q(n)("plugins.fileExplorer.sshUpload",{dir:$.value??""}),onClick:N},[vi(q(Zf),{size:14,"stroke-width":1.5})],8,G1)):(O(),V("button",{key:1,class:Gi(["pin",{pinned:r.value!==null}]),title:r.value!==null?q(n)("plugins.fileExplorer.unpinFollow"):q(n)("plugins.fileExplorer.pinCurrentCwd"),onClick:Te},[(O(),ke(hn(r.value!==null?q(ou):q(ru)),{size:14,"stroke-width":1.5}))],10,J1))]),f.value.length>0?(O(),V("div",Y1,[ds(J("select",{"onUpdate:modelValue":K[0]||(K[0]=te=>u.value=te),"data-test":"fs-source","aria-label":q(n)("plugins.fileExplorer.sourceLabel")},[J("option",Q1,Q(q(n)("plugins.fileExplorer.sourceActivePane")),1),(O(!0),V(Xt,null,mi(f.value,te=>(O(),V("option",{key:te.id,value:te.id},Q(p(te)),9,Z1))),128))],8,X1),[[_f,u.value]])])):Ie("",!0),J("input",{ref_key:"uploadInput",ref:U,class:"upload-input","data-test":"ssh-upload-input",type:"file",onChange:I},null,544),J("div",ev,[ds(J("input",{"onUpdate:modelValue":K[1]||(K[1]=te=>A.value=te),"data-test":"file-name-search",type:"search",placeholder:q(n)("plugins.fileExplorer.searchFiles"),"aria-label":q(n)("plugins.fileExplorer.searchFiles")},null,8,tv),[[Oa,A.value]])]),J("div",iv,[b.value&&T.value?(O(),ke(Yu,{ref_key:"fileTreeRef",ref:C,key:D.value,fs:T.value,root:b.value,"show-hidden":je.value,"show-line-numbers":$e.value,"search-query":A.value,context:B.context,onFileClicked:G,onFileDoubleClicked:L,onToggleShowHidden:K[2]||(K[2]=te=>Fn("showHidden",te)),onToggleShowLineNumbers:K[3]||(K[3]=te=>Fn("showLineNumbers",te))},null,8,["fs","root","show-hidden","show-line-numbers","search-query","context"])):(O(),V("div",nv,Q(q(n)("plugins.fileExplorer.noActivePane")),1))])],4),J("div",{class:"divider",onMousedown:K[4]||(K[4]=(...te)=>q(c)&&q(c)(...te))},null,32),J("div",sv,[vi(sd,{tabs:x.value.tabs,"active-idx":x.value.activeIdx,"view-mode":De.value,onSelect:R,onCloseRequest:ot,onToggleViewMode:Fe},null,8,["tabs","active-idx","view-mode"]),J("div",rv,[Le.value&&T.value?(O(),ke(M1,{ref_key:"codeEditorRef",ref:ue,key:D.value,fs:T.value,path:Le.value,"show-line-numbers":$e.value,theme:ci.value,"view-mode":De.value,onDirtyChange:Me},null,8,["fs","path","show-line-numbers","theme","view-mode"])):(O(),V("div",ov,Q(q(n)("plugins.fileExplorer.selectFile")),1))])])],512),X.value?(O(),ke(Pa,{key:0,title:q(n)("plugins.fileExplorer.confirmCloseTitle",{name:X.value.name}),buttons:X.value.buttons,onResolve:de},null,8,["title","buttons"])):Ie("",!0)]))}}),av=rt(lv,[["__scopeId","data-v-098631c4"]]),gv=Object.freeze(Object.defineProperty({__proto__:null,default:av},Symbol.toStringTag,{value:"Module"}));export{ai as A,Us as B,Qr as C,re as D,S as E,F,Zt as G,dv as H,he as I,em as J,ac as K,Es as L,nt as M,ee as N,_e as O,Si as P,v as Q,bi as R,oe as S,lt as T,Yi as W,Ng as a,se as b,H as c,gv as d,qe as e,Po as f,am as g,Eo as h,Ke as i,uv as j,rc as k,On as l,vt as m,ne as n,Ae as o,ce as p,Ec as q,vm as r,Ws as s,Ro as t,mm as u,ym as v,xm as w,yc as x,mc as y,Io as z}; diff --git a/internal/relay/web-dist/assets/Switch-CpxGRRqY.js b/internal/relay/web-dist/assets/Switch-DguIL3dU.js similarity index 76% rename from internal/relay/web-dist/assets/Switch-CpxGRRqY.js rename to internal/relay/web-dist/assets/Switch-DguIL3dU.js index fb1daef2..02830bf8 100644 --- a/internal/relay/web-dist/assets/Switch-CpxGRRqY.js +++ b/internal/relay/web-dist/assets/Switch-DguIL3dU.js @@ -1,4 +1,4 @@ -import{aj as me,F as Ce,a as ae,as as le,a4 as ye,a7 as V,Y as I,J as F,L as n,O as S,az as we,H as U,aq as re,aM as l,bh as xe,N as Se,bR as $e,d as ze,E as Re,W as ke,I as Be,p as Ie,bT as E,i as Pe,cc as te,cm as M,cj as se,a8 as A,aI as Te,ah as v,cn as ce,bI as K,a5 as _e,a$ as Ve,aH as Ee,ar as $,a6 as Fe,aP as ne,P as ie,bc as q,l as He,e as Ae,cd as We,c7 as je,ci as Le,bE as Q,Q as Z}from"./useI18n-CnvN0FfF.js";function oe(e,o=!0,a=[]){return e.forEach(t=>{if(t!==null){if(typeof t!="object"){(typeof t=="string"||typeof t=="number")&&a.push(me(String(t)));return}if(Array.isArray(t)){oe(t,o,a);return}if(t.type===Ce){if(t.children===null)return;Array.isArray(t.children)&&oe(t.children,o,a)}else{if(t.type===ae&&o)return;a.push(t)}}}),a}function Me(e,o="default",a=[]){const r=e.$slots[o];return r===void 0?a:r()}function Oe(e){const{lineHeight:o,borderRadius:a,fontWeightStrong:t,baseColor:r,dividerColor:u,actionColor:m,textColor1:h,textColor2:f,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,infoColor:i,successColor:z,warningColor:y,errorColor:R,fontSize:w}=e;return Object.assign(Object.assign({},ye),{fontSize:w,lineHeight:o,titleFontWeight:t,borderRadius:a,border:`1px solid ${u}`,color:m,titleTextColor:h,iconColor:f,contentTextColor:f,closeBorderRadius:a,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,borderInfo:`1px solid ${V(r,I(i,{alpha:.25}))}`,colorInfo:V(r,I(i,{alpha:.08})),titleTextColorInfo:h,iconColorInfo:i,contentTextColorInfo:f,closeColorHoverInfo:g,closeColorPressedInfo:p,closeIconColorInfo:b,closeIconColorHoverInfo:s,closeIconColorPressedInfo:d,borderSuccess:`1px solid ${V(r,I(z,{alpha:.25}))}`,colorSuccess:V(r,I(z,{alpha:.08})),titleTextColorSuccess:h,iconColorSuccess:z,contentTextColorSuccess:f,closeColorHoverSuccess:g,closeColorPressedSuccess:p,closeIconColorSuccess:b,closeIconColorHoverSuccess:s,closeIconColorPressedSuccess:d,borderWarning:`1px solid ${V(r,I(y,{alpha:.33}))}`,colorWarning:V(r,I(y,{alpha:.08})),titleTextColorWarning:h,iconColorWarning:y,contentTextColorWarning:f,closeColorHoverWarning:g,closeColorPressedWarning:p,closeIconColorWarning:b,closeIconColorHoverWarning:s,closeIconColorPressedWarning:d,borderError:`1px solid ${V(r,I(R,{alpha:.25}))}`,colorError:V(r,I(R,{alpha:.08})),titleTextColorError:h,iconColorError:R,contentTextColorError:f,closeColorHoverError:g,closeColorPressedError:p,closeIconColorError:b,closeIconColorHoverError:s,closeIconColorPressedError:d})}const De={common:le,self:Oe},Ge=F("alert",` +import{ai as me,F as Ce,a as ae,ar as le,a3 as ye,a6 as V,R as I,H as E,K as n,L as S,ay as we,G as K,ap as re,aL as l,bg as xe,N as Se,bQ as $e,d as ze,E as Re,W as ke,I as Be,p as Ie,bS as F,i as _e,cb as te,cl as O,ci as se,a7 as A,aH as Pe,ag as v,cm as ce,bH as U,a4 as Te,a_ as Ve,aG as Fe,aq as $,a5 as Ee,aO as ne,O as ie,bb as J,l as He,e as Ae,cc as We,c6 as je,ch as Le,bD as Q,P as Z}from"./useI18n-lwZlSdSx.js";function oe(e,o=!0,a=[]){return e.forEach(t=>{if(t!==null){if(typeof t!="object"){(typeof t=="string"||typeof t=="number")&&a.push(me(String(t)));return}if(Array.isArray(t)){oe(t,o,a);return}if(t.type===Ce){if(t.children===null)return;Array.isArray(t.children)&&oe(t.children,o,a)}else{if(t.type===ae&&o)return;a.push(t)}}}),a}function Oe(e,o="default",a=[]){const r=e.$slots[o];return r===void 0?a:r()}function Me(e){const{lineHeight:o,borderRadius:a,fontWeightStrong:t,baseColor:r,dividerColor:u,actionColor:m,textColor1:h,textColor2:f,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,infoColor:i,successColor:z,warningColor:y,errorColor:R,fontSize:w}=e;return Object.assign(Object.assign({},ye),{fontSize:w,lineHeight:o,titleFontWeight:t,borderRadius:a,border:`1px solid ${u}`,color:m,titleTextColor:h,iconColor:f,contentTextColor:f,closeBorderRadius:a,closeColorHover:g,closeColorPressed:p,closeIconColor:b,closeIconColorHover:s,closeIconColorPressed:d,borderInfo:`1px solid ${V(r,I(i,{alpha:.25}))}`,colorInfo:V(r,I(i,{alpha:.08})),titleTextColorInfo:h,iconColorInfo:i,contentTextColorInfo:f,closeColorHoverInfo:g,closeColorPressedInfo:p,closeIconColorInfo:b,closeIconColorHoverInfo:s,closeIconColorPressedInfo:d,borderSuccess:`1px solid ${V(r,I(z,{alpha:.25}))}`,colorSuccess:V(r,I(z,{alpha:.08})),titleTextColorSuccess:h,iconColorSuccess:z,contentTextColorSuccess:f,closeColorHoverSuccess:g,closeColorPressedSuccess:p,closeIconColorSuccess:b,closeIconColorHoverSuccess:s,closeIconColorPressedSuccess:d,borderWarning:`1px solid ${V(r,I(y,{alpha:.33}))}`,colorWarning:V(r,I(y,{alpha:.08})),titleTextColorWarning:h,iconColorWarning:y,contentTextColorWarning:f,closeColorHoverWarning:g,closeColorPressedWarning:p,closeIconColorWarning:b,closeIconColorHoverWarning:s,closeIconColorPressedWarning:d,borderError:`1px solid ${V(r,I(R,{alpha:.25}))}`,colorError:V(r,I(R,{alpha:.08})),titleTextColorError:h,iconColorError:R,contentTextColorError:f,closeColorHoverError:g,closeColorPressedError:p,closeIconColorError:b,closeIconColorHoverError:s,closeIconColorPressedError:d})}const De={common:le,self:Me},Ge=E("alert",` line-height: var(--n-line-height); border-radius: var(--n-border-radius); position: relative; @@ -16,9 +16,9 @@ import{aj as me,F as Ce,a as ae,as as le,a4 as ye,a7 as V,Y as I,J as F,L as n,O transition: border-color .3s var(--n-bezier); border: var(--n-border); pointer-events: none; - `),S("closable",[F("alert-body",[n("title",` + `),S("closable",[E("alert-body",[n("title",` padding-right: 24px; - `)])]),n("icon",{color:"var(--n-icon-color)"}),F("alert-body",{padding:"var(--n-padding)"},[n("title",{color:"var(--n-title-text-color)"}),n("content",{color:"var(--n-content-text-color)"})]),we({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),n("icon",` + `)])]),n("icon",{color:"var(--n-icon-color)"}),E("alert-body",{padding:"var(--n-padding)"},[n("title",{color:"var(--n-title-text-color)"}),n("content",{color:"var(--n-content-text-color)"})]),we({originalTransition:"transform .3s var(--n-bezier)",enterToProps:{transform:"scale(1)"},leaveToProps:{transform:"scale(0.9)"}}),n("icon",` position: absolute; left: 0; top: 0; @@ -37,7 +37,7 @@ import{aj as me,F as Ce,a as ae,as as le,a4 as ye,a7 as V,Y as I,J as F,L as n,O right: 0; top: 0; margin: var(--n-close-margin); - `),S("show-icon",[F("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),S("right-adjust",[F("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),F("alert-body",` + `),S("show-icon",[E("alert-body",{paddingLeft:"calc(var(--n-icon-margin-left) + var(--n-icon-size) + var(--n-icon-margin-right))"})]),S("right-adjust",[E("alert-body",{paddingRight:"calc(var(--n-close-size) + var(--n-padding) + 2px)"})]),E("alert-body",` border-radius: var(--n-border-radius); transition: border-color .3s var(--n-bezier); `,[n("title",` @@ -45,7 +45,7 @@ import{aj as me,F as Ce,a as ae,as as le,a4 as ye,a7 as V,Y as I,J as F,L as n,O font-size: 16px; line-height: 19px; font-weight: var(--n-title-font-weight); - `,[U("& +",[n("content",{marginTop:"9px"})])]),n("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),n("icon",{transition:"color .3s var(--n-bezier)"})]),Ue=Object.assign(Object.assign({},M.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),oo=re({name:"Alert",inheritAttrs:!1,props:Ue,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:a,inlineThemeDisabled:t,mergedRtlRef:r}=te(e),u=M("Alert","-alert",Ge,De,e,o),m=se("Alert",r,o),h=A(()=>{const{common:{cubicBezierEaseInOut:d},self:i}=u.value,{fontSize:z,borderRadius:y,titleFontWeight:R,lineHeight:w,iconSize:k,iconMargin:B,iconMarginRtl:H,closeIconSize:x,closeBorderRadius:P,closeSize:c,closeMargin:W,closeMarginRtl:j,padding:L}=i,{type:C}=e,{left:O,right:N}=Te(B);return{"--n-bezier":d,"--n-color":i[v("color",C)],"--n-close-icon-size":x,"--n-close-border-radius":P,"--n-close-color-hover":i[v("closeColorHover",C)],"--n-close-color-pressed":i[v("closeColorPressed",C)],"--n-close-icon-color":i[v("closeIconColor",C)],"--n-close-icon-color-hover":i[v("closeIconColorHover",C)],"--n-close-icon-color-pressed":i[v("closeIconColorPressed",C)],"--n-icon-color":i[v("iconColor",C)],"--n-border":i[v("border",C)],"--n-title-text-color":i[v("titleTextColor",C)],"--n-content-text-color":i[v("contentTextColor",C)],"--n-line-height":w,"--n-border-radius":y,"--n-font-size":z,"--n-title-font-weight":R,"--n-icon-size":k,"--n-icon-margin":B,"--n-icon-margin-rtl":H,"--n-close-size":c,"--n-close-margin":W,"--n-close-margin-rtl":j,"--n-padding":L,"--n-icon-margin-left":O,"--n-icon-margin-right":N}}),f=t?ce("alert",A(()=>e.type[0]),h,e):void 0,g=K(!0),p=()=>{const{onAfterLeave:d,onAfterHide:i}=e;d&&d(),i&&i()};return{rtlEnabled:m,mergedClsPrefix:o,mergedBordered:a,visible:g,handleCloseClick:()=>{var d;Promise.resolve((d=e.onClose)===null||d===void 0?void 0:d.call(e)).then(i=>{i!==!1&&(g.value=!1)})},handleAfterLeave:()=>{p()},mergedTheme:u,cssVars:t?void 0:h,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),l(Pe,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:o,$slots:a}=this,t={class:[`${o}-alert`,this.themeClass,this.closable&&`${o}-alert--closable`,this.showIcon&&`${o}-alert--show-icon`,!this.title&&this.closable&&`${o}-alert--right-adjust`,this.rtlEnabled&&`${o}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?l("div",Object.assign({},xe(this.$attrs,t)),this.closable&&l(Se,{clsPrefix:o,class:`${o}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&l("div",{class:`${o}-alert__border`}),this.showIcon&&l("div",{class:`${o}-alert__icon`,"aria-hidden":"true"},$e(a.icon,()=>[l(ze,{clsPrefix:o},{default:()=>{switch(this.type){case"success":return l(Ie,null);case"info":return l(Be,null);case"warning":return l(ke,null);case"error":return l(Re,null);default:return null}}})])),l("div",{class:[`${o}-alert-body`,this.mergedBordered&&`${o}-alert-body--bordered`]},E(a.header,r=>{const u=r||this.title;return u?l("div",{class:`${o}-alert-body__title`},u):null}),a.default&&l("div",{class:`${o}-alert-body__content`},a))):null}})}});function Ke(){return _e}const Ne={self:Ke};let ee;function Ye(){if(!Ve)return!0;if(ee===void 0){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const o=e.scrollHeight===1;return document.body.removeChild(e),ee=o}return ee}const Je=Object.assign(Object.assign({},M.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),ro=re({name:"Space",props:Je,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:a}=te(e),t=M("Space","-space",void 0,Ne,e,o),r=se("Space",a,o);return{useGap:Ye(),rtlEnabled:r,mergedClsPrefix:o,margin:A(()=>{const{size:u}=e;if(Array.isArray(u))return{horizontal:u[0],vertical:u[1]};if(typeof u=="number")return{horizontal:u,vertical:u};const{self:{[v("gap",u)]:m}}=t.value,{row:h,col:f}=Ee(m);return{horizontal:$(f),vertical:$(h)}})}},render(){const{vertical:e,reverse:o,align:a,inline:t,justify:r,itemClass:u,itemStyle:m,margin:h,wrap:f,mergedClsPrefix:g,rtlEnabled:p,useGap:b,wrapItem:s,internalUseGap:d}=this,i=oe(Me(this),!1);if(!i.length)return null;const z=`${h.horizontal}px`,y=`${h.horizontal/2}px`,R=`${h.vertical}px`,w=`${h.vertical/2}px`,k=i.length-1,B=r.startsWith("space-");return l("div",{role:"none",class:[`${g}-space`,p&&`${g}-space--rtl`],style:{display:t?"inline-flex":"flex",flexDirection:e&&!o?"column":e&&o?"column-reverse":!e&&o?"row-reverse":"row",justifyContent:["start","end"].includes(r)?`flex-${r}`:r,flexWrap:!f||e?"nowrap":"wrap",marginTop:b||e?"":`-${w}`,marginBottom:b||e?"":`-${w}`,alignItems:a,gap:b?`${h.vertical}px ${h.horizontal}px`:""}},!s&&(b||d)?i:i.map((H,x)=>H.type===ae?H:l("div",{role:"none",class:u,style:[m,{maxWidth:"100%"},b?"":e?{marginBottom:x!==k?R:""}:p?{marginLeft:B?r==="space-between"&&x===k?"":y:x!==k?z:"",marginRight:B?r==="space-between"&&x===0?"":y:"",paddingTop:w,paddingBottom:w}:{marginRight:B?r==="space-between"&&x===k?"":y:x!==k?z:"",marginLeft:B?r==="space-between"&&x===0?"":y:"",paddingTop:w,paddingBottom:w}]},H)))}});function Xe(e){const{primaryColor:o,opacityDisabled:a,borderRadius:t,textColor3:r}=e;return Object.assign(Object.assign({},Fe),{iconColor:r,textColor:"white",loadingColor:o,opacityDisabled:a,railColor:"rgba(0, 0, 0, .14)",railColorActive:o,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:t,railBorderRadiusMedium:t,railBorderRadiusLarge:t,buttonBorderRadiusSmall:t,buttonBorderRadiusMedium:t,buttonBorderRadiusLarge:t,boxShadowFocus:`0 0 0 2px ${I(o,{alpha:.2})}`})}const qe={common:le,self:Xe},Qe=F("switch",` + `,[K("& +",[n("content",{marginTop:"9px"})])]),n("content",{transition:"color .3s var(--n-bezier)",fontSize:"var(--n-font-size)"})]),n("icon",{transition:"color .3s var(--n-bezier)"})]),Ke=Object.assign(Object.assign({},O.props),{title:String,showIcon:{type:Boolean,default:!0},type:{type:String,default:"default"},bordered:{type:Boolean,default:!0},closable:Boolean,onClose:Function,onAfterLeave:Function,onAfterHide:Function}),oo=re({name:"Alert",inheritAttrs:!1,props:Ke,setup(e){const{mergedClsPrefixRef:o,mergedBorderedRef:a,inlineThemeDisabled:t,mergedRtlRef:r}=te(e),u=O("Alert","-alert",Ge,De,e,o),m=se("Alert",r,o),h=A(()=>{const{common:{cubicBezierEaseInOut:d},self:i}=u.value,{fontSize:z,borderRadius:y,titleFontWeight:R,lineHeight:w,iconSize:k,iconMargin:B,iconMarginRtl:H,closeIconSize:x,closeBorderRadius:_,closeSize:c,closeMargin:W,closeMarginRtl:j,padding:L}=i,{type:C}=e,{left:M,right:N}=Pe(B);return{"--n-bezier":d,"--n-color":i[v("color",C)],"--n-close-icon-size":x,"--n-close-border-radius":_,"--n-close-color-hover":i[v("closeColorHover",C)],"--n-close-color-pressed":i[v("closeColorPressed",C)],"--n-close-icon-color":i[v("closeIconColor",C)],"--n-close-icon-color-hover":i[v("closeIconColorHover",C)],"--n-close-icon-color-pressed":i[v("closeIconColorPressed",C)],"--n-icon-color":i[v("iconColor",C)],"--n-border":i[v("border",C)],"--n-title-text-color":i[v("titleTextColor",C)],"--n-content-text-color":i[v("contentTextColor",C)],"--n-line-height":w,"--n-border-radius":y,"--n-font-size":z,"--n-title-font-weight":R,"--n-icon-size":k,"--n-icon-margin":B,"--n-icon-margin-rtl":H,"--n-close-size":c,"--n-close-margin":W,"--n-close-margin-rtl":j,"--n-padding":L,"--n-icon-margin-left":M,"--n-icon-margin-right":N}}),f=t?ce("alert",A(()=>e.type[0]),h,e):void 0,g=U(!0),p=()=>{const{onAfterLeave:d,onAfterHide:i}=e;d&&d(),i&&i()};return{rtlEnabled:m,mergedClsPrefix:o,mergedBordered:a,visible:g,handleCloseClick:()=>{var d;Promise.resolve((d=e.onClose)===null||d===void 0?void 0:d.call(e)).then(i=>{i!==!1&&(g.value=!1)})},handleAfterLeave:()=>{p()},mergedTheme:u,cssVars:t?void 0:h,themeClass:f==null?void 0:f.themeClass,onRender:f==null?void 0:f.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),l(_e,{onAfterLeave:this.handleAfterLeave},{default:()=>{const{mergedClsPrefix:o,$slots:a}=this,t={class:[`${o}-alert`,this.themeClass,this.closable&&`${o}-alert--closable`,this.showIcon&&`${o}-alert--show-icon`,!this.title&&this.closable&&`${o}-alert--right-adjust`,this.rtlEnabled&&`${o}-alert--rtl`],style:this.cssVars,role:"alert"};return this.visible?l("div",Object.assign({},xe(this.$attrs,t)),this.closable&&l(Se,{clsPrefix:o,class:`${o}-alert__close`,onClick:this.handleCloseClick}),this.bordered&&l("div",{class:`${o}-alert__border`}),this.showIcon&&l("div",{class:`${o}-alert__icon`,"aria-hidden":"true"},$e(a.icon,()=>[l(ze,{clsPrefix:o},{default:()=>{switch(this.type){case"success":return l(Ie,null);case"info":return l(Be,null);case"warning":return l(ke,null);case"error":return l(Re,null);default:return null}}})])),l("div",{class:[`${o}-alert-body`,this.mergedBordered&&`${o}-alert-body--bordered`]},F(a.header,r=>{const u=r||this.title;return u?l("div",{class:`${o}-alert-body__title`},u):null}),a.default&&l("div",{class:`${o}-alert-body__content`},a))):null}})}});function Ue(){return Te}const Ne={self:Ue};let ee;function Xe(){if(!Ve)return!0;if(ee===void 0){const e=document.createElement("div");e.style.display="flex",e.style.flexDirection="column",e.style.rowGap="1px",e.appendChild(document.createElement("div")),e.appendChild(document.createElement("div")),document.body.appendChild(e);const o=e.scrollHeight===1;return document.body.removeChild(e),ee=o}return ee}const Ye=Object.assign(Object.assign({},O.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),ro=re({name:"Space",props:Ye,setup(e){const{mergedClsPrefixRef:o,mergedRtlRef:a}=te(e),t=O("Space","-space",void 0,Ne,e,o),r=se("Space",a,o);return{useGap:Xe(),rtlEnabled:r,mergedClsPrefix:o,margin:A(()=>{const{size:u}=e;if(Array.isArray(u))return{horizontal:u[0],vertical:u[1]};if(typeof u=="number")return{horizontal:u,vertical:u};const{self:{[v("gap",u)]:m}}=t.value,{row:h,col:f}=Fe(m);return{horizontal:$(f),vertical:$(h)}})}},render(){const{vertical:e,reverse:o,align:a,inline:t,justify:r,itemClass:u,itemStyle:m,margin:h,wrap:f,mergedClsPrefix:g,rtlEnabled:p,useGap:b,wrapItem:s,internalUseGap:d}=this,i=oe(Oe(this),!1);if(!i.length)return null;const z=`${h.horizontal}px`,y=`${h.horizontal/2}px`,R=`${h.vertical}px`,w=`${h.vertical/2}px`,k=i.length-1,B=r.startsWith("space-");return l("div",{role:"none",class:[`${g}-space`,p&&`${g}-space--rtl`],style:{display:t?"inline-flex":"flex",flexDirection:e&&!o?"column":e&&o?"column-reverse":!e&&o?"row-reverse":"row",justifyContent:["start","end"].includes(r)?`flex-${r}`:r,flexWrap:!f||e?"nowrap":"wrap",marginTop:b||e?"":`-${w}`,marginBottom:b||e?"":`-${w}`,alignItems:a,gap:b?`${h.vertical}px ${h.horizontal}px`:""}},!s&&(b||d)?i:i.map((H,x)=>H.type===ae?H:l("div",{role:"none",class:u,style:[m,{maxWidth:"100%"},b?"":e?{marginBottom:x!==k?R:""}:p?{marginLeft:B?r==="space-between"&&x===k?"":y:x!==k?z:"",marginRight:B?r==="space-between"&&x===0?"":y:"",paddingTop:w,paddingBottom:w}:{marginRight:B?r==="space-between"&&x===k?"":y:x!==k?z:"",marginLeft:B?r==="space-between"&&x===0?"":y:"",paddingTop:w,paddingBottom:w}]},H)))}});function qe(e){const{primaryColor:o,opacityDisabled:a,borderRadius:t,textColor3:r}=e;return Object.assign(Object.assign({},Ee),{iconColor:r,textColor:"white",loadingColor:o,opacityDisabled:a,railColor:"rgba(0, 0, 0, .14)",railColorActive:o,buttonBoxShadow:"0 1px 4px 0 rgba(0, 0, 0, 0.3), inset 0 0 1px 0 rgba(0, 0, 0, 0.05)",buttonColor:"#FFF",railBorderRadiusSmall:t,railBorderRadiusMedium:t,railBorderRadiusLarge:t,buttonBorderRadiusSmall:t,buttonBorderRadiusMedium:t,buttonBorderRadiusLarge:t,boxShadowFocus:`0 0 0 2px ${I(o,{alpha:.2})}`})}const Je={common:le,self:qe},Qe=E("switch",` height: var(--n-height); min-width: var(--n-width); vertical-align: middle; @@ -68,7 +68,7 @@ import{aj as me,F as Ce,a as ae,as as le,a4 as ye,a7 as V,Y as I,J as F,L as n,O `),n("button-placeholder",` width: calc(1.75 * var(--n-rail-height)); height: var(--n-rail-height); - `),F("base-loading",` + `),E("base-loading",` position: absolute; top: 50%; left: 50%; @@ -94,9 +94,9 @@ import{aj as me,F as Ce,a as ae,as as le,a4 as ye,a7 as V,Y as I,J as F,L as n,O left: 0; justify-content: flex-end; padding-left: calc(1.25 * var(--n-rail-height) - var(--n-offset)); - `),U("&:focus",[n("rail",` + `),K("&:focus",[n("rail",` box-shadow: var(--n-box-shadow-focus); - `)]),S("round",[n("rail","border-radius: calc(var(--n-rail-height) / 2);",[n("button","border-radius: calc(var(--n-button-height) / 2);")])]),ie("disabled",[ie("icon",[S("rubber-band",[S("pressed",[n("rail",[n("button","max-width: var(--n-button-width-pressed);")])]),n("rail",[U("&:active",[n("button","max-width: var(--n-button-width-pressed);")])]),S("active",[S("pressed",[n("rail",[n("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),n("rail",[U("&:active",[n("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),S("active",[n("rail",[n("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),n("rail",` + `)]),S("round",[n("rail","border-radius: calc(var(--n-rail-height) / 2);",[n("button","border-radius: calc(var(--n-button-height) / 2);")])]),ie("disabled",[ie("icon",[S("rubber-band",[S("pressed",[n("rail",[n("button","max-width: var(--n-button-width-pressed);")])]),n("rail",[K("&:active",[n("button","max-width: var(--n-button-width-pressed);")])]),S("active",[S("pressed",[n("rail",[n("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])]),n("rail",[K("&:active",[n("button","left: calc(100% - var(--n-offset) - var(--n-button-width-pressed));")])])])])])]),S("active",[n("rail",[n("button","left: calc(100% - var(--n-button-width) - var(--n-offset))")])]),n("rail",` overflow: hidden; height: var(--n-rail-height); min-width: var(--n-rail-width); @@ -146,4 +146,4 @@ import{aj as me,F as Ce,a as ae,as as le,a4 as ye,a7 as V,Y as I,J as F,L as n,O `)]),S("disabled",[n("rail",` cursor: not-allowed; opacity: .5; - `)])]),Ze=Object.assign(Object.assign({},M.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let G;const to=re({name:"Switch",props:Ze,setup(e){G===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?G=CSS.supports("width","max(1px)"):G=!1:G=!0);const{mergedClsPrefixRef:o,inlineThemeDisabled:a}=te(e),t=M("Switch","-switch",Qe,qe,e,o),r=We(e),{mergedSizeRef:u,mergedDisabledRef:m}=r,h=K(e.defaultValue),f=je(e,"value"),g=Le(f,h),p=A(()=>g.value===e.checkedValue),b=K(!1),s=K(!1),d=A(()=>{const{railStyle:c}=e;if(c)return c({focused:s.value,checked:p.value})});function i(c){const{"onUpdate:value":W,onChange:j,onUpdateValue:L}=e,{nTriggerFormInput:C,nTriggerFormChange:O}=r;W&&Z(W,c),L&&Z(L,c),j&&Z(j,c),h.value=c,C(),O()}function z(){const{nTriggerFormFocus:c}=r;c()}function y(){const{nTriggerFormBlur:c}=r;c()}function R(){e.loading||m.value||(g.value!==e.checkedValue?i(e.checkedValue):i(e.uncheckedValue))}function w(){s.value=!0,z()}function k(){s.value=!1,y(),b.value=!1}function B(c){e.loading||m.value||c.key===" "&&(g.value!==e.checkedValue?i(e.checkedValue):i(e.uncheckedValue),b.value=!1)}function H(c){e.loading||m.value||c.key===" "&&(c.preventDefault(),b.value=!0)}const x=A(()=>{const{value:c}=u,{self:{opacityDisabled:W,railColor:j,railColorActive:L,buttonBoxShadow:C,buttonColor:O,boxShadowFocus:N,loadingColor:de,textColor:ue,iconColor:he,[v("buttonHeight",c)]:T,[v("buttonWidth",c)]:fe,[v("buttonWidthPressed",c)]:ge,[v("railHeight",c)]:_,[v("railWidth",c)]:D,[v("railBorderRadius",c)]:be,[v("buttonBorderRadius",c)]:ve},common:{cubicBezierEaseInOut:pe}}=t.value;let Y,J,X;return G?(Y=`calc((${_} - ${T}) / 2)`,J=`max(${_}, ${T})`,X=`max(${D}, calc(${D} + ${T} - ${_}))`):(Y=Q(($(_)-$(T))/2),J=Q(Math.max($(_),$(T))),X=$(_)>$(T)?D:Q($(D)+$(T)-$(_))),{"--n-bezier":pe,"--n-button-border-radius":ve,"--n-button-box-shadow":C,"--n-button-color":O,"--n-button-width":fe,"--n-button-width-pressed":ge,"--n-button-height":T,"--n-height":J,"--n-offset":Y,"--n-opacity-disabled":W,"--n-rail-border-radius":be,"--n-rail-color":j,"--n-rail-color-active":L,"--n-rail-height":_,"--n-rail-width":D,"--n-width":X,"--n-box-shadow-focus":N,"--n-loading-color":de,"--n-text-color":ue,"--n-icon-color":he}}),P=a?ce("switch",A(()=>u.value[0]),x,e):void 0;return{handleClick:R,handleBlur:k,handleFocus:w,handleKeyup:B,handleKeydown:H,mergedRailStyle:d,pressed:b,mergedClsPrefix:o,mergedValue:g,checked:p,mergedDisabled:m,cssVars:a?void 0:x,themeClass:P==null?void 0:P.themeClass,onRender:P==null?void 0:P.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:o,checked:a,mergedRailStyle:t,onRender:r,$slots:u}=this;r==null||r();const{checked:m,unchecked:h,icon:f,"checked-icon":g,"unchecked-icon":p}=u,b=!(q(f)&&q(g)&&q(p));return l("div",{role:"switch","aria-checked":a,class:[`${e}-switch`,this.themeClass,b&&`${e}-switch--icon`,a&&`${e}-switch--active`,o&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},l("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:t},E(m,s=>E(h,d=>s||d?l("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),s),l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),d)):null)),l("div",{class:`${e}-switch__button`},E(f,s=>E(g,d=>E(p,i=>l(He,null,{default:()=>this.loading?l(Ae,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(d||s)?l("div",{class:`${e}-switch__button-icon`,key:d?"checked-icon":"icon"},d||s):!this.checked&&(i||s)?l("div",{class:`${e}-switch__button-icon`,key:i?"unchecked-icon":"icon"},i||s):null})))),E(m,s=>s&&l("div",{key:"checked",class:`${e}-switch__checked`},s)),E(h,s=>s&&l("div",{key:"unchecked",class:`${e}-switch__unchecked`},s)))))}});export{oo as N,ro as a,to as b,oe as f,Me as g}; + `)])]),Ze=Object.assign(Object.assign({},O.props),{size:{type:String,default:"medium"},value:{type:[String,Number,Boolean],default:void 0},loading:Boolean,defaultValue:{type:[String,Number,Boolean],default:!1},disabled:{type:Boolean,default:void 0},round:{type:Boolean,default:!0},"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],checkedValue:{type:[String,Number,Boolean],default:!0},uncheckedValue:{type:[String,Number,Boolean],default:!1},railStyle:Function,rubberBand:{type:Boolean,default:!0},onChange:[Function,Array]});let G;const to=re({name:"Switch",props:Ze,setup(e){G===void 0&&(typeof CSS<"u"?typeof CSS.supports<"u"?G=CSS.supports("width","max(1px)"):G=!1:G=!0);const{mergedClsPrefixRef:o,inlineThemeDisabled:a}=te(e),t=O("Switch","-switch",Qe,Je,e,o),r=We(e),{mergedSizeRef:u,mergedDisabledRef:m}=r,h=U(e.defaultValue),f=je(e,"value"),g=Le(f,h),p=A(()=>g.value===e.checkedValue),b=U(!1),s=U(!1),d=A(()=>{const{railStyle:c}=e;if(c)return c({focused:s.value,checked:p.value})});function i(c){const{"onUpdate:value":W,onChange:j,onUpdateValue:L}=e,{nTriggerFormInput:C,nTriggerFormChange:M}=r;W&&Z(W,c),L&&Z(L,c),j&&Z(j,c),h.value=c,C(),M()}function z(){const{nTriggerFormFocus:c}=r;c()}function y(){const{nTriggerFormBlur:c}=r;c()}function R(){e.loading||m.value||(g.value!==e.checkedValue?i(e.checkedValue):i(e.uncheckedValue))}function w(){s.value=!0,z()}function k(){s.value=!1,y(),b.value=!1}function B(c){e.loading||m.value||c.key===" "&&(g.value!==e.checkedValue?i(e.checkedValue):i(e.uncheckedValue),b.value=!1)}function H(c){e.loading||m.value||c.key===" "&&(c.preventDefault(),b.value=!0)}const x=A(()=>{const{value:c}=u,{self:{opacityDisabled:W,railColor:j,railColorActive:L,buttonBoxShadow:C,buttonColor:M,boxShadowFocus:N,loadingColor:de,textColor:ue,iconColor:he,[v("buttonHeight",c)]:P,[v("buttonWidth",c)]:fe,[v("buttonWidthPressed",c)]:ge,[v("railHeight",c)]:T,[v("railWidth",c)]:D,[v("railBorderRadius",c)]:be,[v("buttonBorderRadius",c)]:ve},common:{cubicBezierEaseInOut:pe}}=t.value;let X,Y,q;return G?(X=`calc((${T} - ${P}) / 2)`,Y=`max(${T}, ${P})`,q=`max(${D}, calc(${D} + ${P} - ${T}))`):(X=Q(($(T)-$(P))/2),Y=Q(Math.max($(T),$(P))),q=$(T)>$(P)?D:Q($(D)+$(P)-$(T))),{"--n-bezier":pe,"--n-button-border-radius":ve,"--n-button-box-shadow":C,"--n-button-color":M,"--n-button-width":fe,"--n-button-width-pressed":ge,"--n-button-height":P,"--n-height":Y,"--n-offset":X,"--n-opacity-disabled":W,"--n-rail-border-radius":be,"--n-rail-color":j,"--n-rail-color-active":L,"--n-rail-height":T,"--n-rail-width":D,"--n-width":q,"--n-box-shadow-focus":N,"--n-loading-color":de,"--n-text-color":ue,"--n-icon-color":he}}),_=a?ce("switch",A(()=>u.value[0]),x,e):void 0;return{handleClick:R,handleBlur:k,handleFocus:w,handleKeyup:B,handleKeydown:H,mergedRailStyle:d,pressed:b,mergedClsPrefix:o,mergedValue:g,checked:p,mergedDisabled:m,cssVars:a?void 0:x,themeClass:_==null?void 0:_.themeClass,onRender:_==null?void 0:_.onRender}},render(){const{mergedClsPrefix:e,mergedDisabled:o,checked:a,mergedRailStyle:t,onRender:r,$slots:u}=this;r==null||r();const{checked:m,unchecked:h,icon:f,"checked-icon":g,"unchecked-icon":p}=u,b=!(J(f)&&J(g)&&J(p));return l("div",{role:"switch","aria-checked":a,class:[`${e}-switch`,this.themeClass,b&&`${e}-switch--icon`,a&&`${e}-switch--active`,o&&`${e}-switch--disabled`,this.round&&`${e}-switch--round`,this.loading&&`${e}-switch--loading`,this.pressed&&`${e}-switch--pressed`,this.rubberBand&&`${e}-switch--rubber-band`],tabindex:this.mergedDisabled?void 0:0,style:this.cssVars,onClick:this.handleClick,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},l("div",{class:`${e}-switch__rail`,"aria-hidden":"true",style:t},F(m,s=>F(h,d=>s||d?l("div",{"aria-hidden":!0,class:`${e}-switch__children-placeholder`},l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),s),l("div",{class:`${e}-switch__rail-placeholder`},l("div",{class:`${e}-switch__button-placeholder`}),d)):null)),l("div",{class:`${e}-switch__button`},F(f,s=>F(g,d=>F(p,i=>l(He,null,{default:()=>this.loading?l(Ae,{key:"loading",clsPrefix:e,strokeWidth:20}):this.checked&&(d||s)?l("div",{class:`${e}-switch__button-icon`,key:d?"checked-icon":"icon"},d||s):!this.checked&&(i||s)?l("div",{class:`${e}-switch__button-icon`,key:i?"unchecked-icon":"icon"},i||s):null})))),F(m,s=>s&&l("div",{key:"checked",class:`${e}-switch__checked`},s)),F(h,s=>s&&l("div",{key:"unchecked",class:`${e}-switch__unchecked`},s)))))}});export{oo as N,ro as a,to as b,oe as f,Oe as g}; diff --git a/internal/relay/web-dist/assets/auth-Dhl8fEWW.js b/internal/relay/web-dist/assets/auth-B3RxKR1W.js similarity index 95% rename from internal/relay/web-dist/assets/auth-Dhl8fEWW.js rename to internal/relay/web-dist/assets/auth-B3RxKR1W.js index 19bc19b3..69183340 100644 --- a/internal/relay/web-dist/assets/auth-Dhl8fEWW.js +++ b/internal/relay/web-dist/assets/auth-B3RxKR1W.js @@ -1 +1 @@ -var Se=Object.defineProperty;var Te=(e,t,n)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var m=(e,t,n)=>Te(e,typeof t!="symbol"?t+"":t,n);import{a as zt}from"./client-2UEf7AK8.js";import{_ as ae,bf as ke,bW as Ce,$ as Re}from"./useI18n-CnvN0FfF.js";const Ut=BigInt(2**32-1),Qt=BigInt(32);function Me(e,t=!1){return t?{h:Number(e&Ut),l:Number(e>>Qt&Ut)}:{h:Number(e>>Qt&Ut)|0,l:Number(e&Ut)|0}}const It=(e,t,n)=>e>>>n|t<<32-n,Ot=(e,t,n)=>e<<32-n|t>>>n,he=(e,t,n)=>e<<64-n|t>>>n-32,le=(e,t,n)=>e>>>n-32|t<<64-n,ue=(e,t)=>t,de=(e,t)=>e;function pe(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const Yt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Xt=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;function De(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ct(e,t=""){if(typeof e!="number"){const n=t&&`"${t}" `;throw new TypeError(`${n}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){const n=t&&`"${t}" `;throw new RangeError(`${n}expected integer >= 0, got ${e}`)}}function q(e,t,n=""){const r=De(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function qt(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ct(e.outputLen),ct(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function wt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wt(e,t){q(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length='+n)}function Ht(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function gt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function X(...e){for(let t=0;t>>t}const ye=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function we(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Y=ye?e=>e:e=>we(e)>>>0;function $e(e){for(let t=0;te:$e;function _t(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ft(e,t=""){return typeof e=="string"?_t(e):q(e,void 0,t)}function ge(e,t={}){const n=(s,o)=>e(o).update(s).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=s=>e(s),Object.assign(n,t),Object.freeze(n)}function te(e=32){ct(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const Ne=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),Fe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function Pe(e,t,n){return e&t^~e&n}function Ke(e,t,n){return e&t^e&n^t&n}class je{constructor(t,n,r,s){m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"padOffset");m(this,"isLE");m(this,"buffer");m(this,"view");m(this,"finished",!1);m(this,"length",0);m(this,"pos",0);m(this,"destroyed",!1);this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Rt(this.buffer)}update(t){wt(this),q(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let f=0;fs-f&&(this.process(r,0),f=0);for(let l=f;la.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;ln)throw new Error("outputLen bigger than keyLen");const{key:o,salt:f,personalization:i}=t;if(o!==void 0&&(o.length<1||o.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);f!==void 0&&q(f,r,"salt"),i!==void 0&&q(i,s,"personalization")}class Ve{constructor(t,n){m(this,"buffer");m(this,"buffer32");m(this,"finished",!1);m(this,"destroyed",!1);m(this,"length",0);m(this,"pos",0);m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);ct(t),ct(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=gt(this.buffer)}update(t){wt(this),q(t);const{blockLen:n,buffer:r,buffer32:s}=this,o=t.length,f=t.byteOffset,i=t.buffer;for(let c=0;c>>8*a}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:f,pos:i}=this;return t||(t=new this.constructor({dkLen:f})),t.set(...this.get()),t.buffer.set(n),t.destroyed=o,t.finished=s,t.length=r,t.pos=i,t.outputLen=f,t}clone(){return this._cloneInto()}}class ze extends Ve{constructor(n={}){const r=n.dkLen===void 0?64:n.dkLen;super(128,r);m(this,"v0l",j[0]|0);m(this,"v0h",j[1]|0);m(this,"v1l",j[2]|0);m(this,"v1h",j[3]|0);m(this,"v2l",j[4]|0);m(this,"v2h",j[5]|0);m(this,"v3l",j[6]|0);m(this,"v3h",j[7]|0);m(this,"v4l",j[8]|0);m(this,"v4h",j[9]|0);m(this,"v5l",j[10]|0);m(this,"v5h",j[11]|0);m(this,"v6l",j[12]|0);m(this,"v6h",j[13]|0);m(this,"v7l",j[14]|0);m(this,"v7h",j[15]|0);Ge(r,n,64,16,16);let{key:s,personalization:o,salt:f}=n,i=0;if(s!==void 0&&(q(s,void 0,"key"),i=s.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,f!==void 0){q(f,void 0,"salt");const c=gt(f);this.v4l^=Y(c[0]),this.v4h^=Y(c[1]),this.v5l^=Y(c[2]),this.v5h^=Y(c[3])}if(o!==void 0){q(o,void 0,"personalization");const c=gt(o);this.v6l^=Y(c[0]),this.v6h^=Y(c[1]),this.v7l^=Y(c[2]),this.v7h^=Y(c[3])}if(s!==void 0){const c=new Uint8Array(this.blockLen);c.set(s),this.update(c)}}get(){let{v0l:n,v0h:r,v1l:s,v1h:o,v2l:f,v2h:i,v3l:c,v3h:h,v4l:a,v4h:l,v5l:y,v5h:w,v6l:u,v6h:d,v7l:b,v7h:x}=this;return[n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x]}set(n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x){this.v0l=n|0,this.v0h=r|0,this.v1l=s|0,this.v1h=o|0,this.v2l=f|0,this.v2h=i|0,this.v3l=c|0,this.v3h=h|0,this.v4l=a|0,this.v4h=l|0,this.v5l=y|0,this.v5h=w|0,this.v6l=u|0,this.v6h=d|0,this.v7l=b|0,this.v7h=x|0}compress(n,r,s){this.get().forEach((h,a)=>p[a]=h),p.set(j,16);let{h:o,l:f}=Me(BigInt(this.length));p[24]=j[8]^f,p[25]=j[9]^o,s&&(p[28]=~p[28],p[29]=~p[29]);let i=0;const c=Fe;for(let h=0;h<12;h++)et(0,4,8,12,n,r+2*c[i++]),nt(0,4,8,12,n,r+2*c[i++]),et(1,5,9,13,n,r+2*c[i++]),nt(1,5,9,13,n,r+2*c[i++]),et(2,6,10,14,n,r+2*c[i++]),nt(2,6,10,14,n,r+2*c[i++]),et(3,7,11,15,n,r+2*c[i++]),nt(3,7,11,15,n,r+2*c[i++]),et(0,5,10,15,n,r+2*c[i++]),nt(0,5,10,15,n,r+2*c[i++]),et(1,6,11,12,n,r+2*c[i++]),nt(1,6,11,12,n,r+2*c[i++]),et(2,7,8,13,n,r+2*c[i++]),nt(2,7,8,13,n,r+2*c[i++]),et(3,4,9,14,n,r+2*c[i++]),nt(3,4,9,14,n,r+2*c[i++]);this.v0l^=p[0]^p[16],this.v0h^=p[1]^p[17],this.v1l^=p[2]^p[18],this.v1h^=p[3]^p[19],this.v2l^=p[4]^p[20],this.v2h^=p[5]^p[21],this.v3l^=p[6]^p[22],this.v3h^=p[7]^p[23],this.v4l^=p[8]^p[24],this.v4h^=p[9]^p[25],this.v5l^=p[10]^p[26],this.v5h^=p[11]^p[27],this.v6l^=p[12]^p[28],this.v6h^=p[13]^p[29],this.v7l^=p[14]^p[30],this.v7h^=p[15]^p[31],X(p)}destroy(){this.destroyed=!0,X(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const xt=ge(e=>new ze(e)),be={Argond2d:0,Argon2i:1,Argon2id:2},mt=4,ee=(e,t="")=>e===void 0?Uint8Array.of():Ft(e,t);function Pt(e,t){const n=e&65535,r=e>>>16,s=t&65535,o=t>>>16,f=Math.imul(n,s),i=Math.imul(r,s),c=Math.imul(n,o),h=Math.imul(r,o),a=(f>>>16)+(i&65535)+c,l=h+(i>>>16)+(a>>>16)|0,y=a<<16|f&65535;return{h:l,l:y}}function Ye(e,t){const{h:n,l:r}=Pt(e,t);return{h:(n<<1|r>>>31)&4294967295,l:r<<1&4294967295}}function vt(e,t,n,r){const{h:s,l:o}=Ye(t,r),f=Yt(t,r,o);return{h:Xt(f,e,n,s),l:f|0}}const K=new Uint32Array(256);function rt(e,t,n,r){let s=K[2*e],o=K[2*e+1],f=K[2*t],i=K[2*t+1],c=K[2*n],h=K[2*n+1],a=K[2*r],l=K[2*r+1];({h:o,l:s}=vt(o,s,i,f)),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:ue(l,a),Dl:de(l)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:It(i,f,24),Bl:Ot(i,f,24)},{h:o,l:s}=vt(o,s,i,f),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:It(l,a,16),Dl:Ot(l,a,16)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:he(i,f,63),Bl:le(i,f,63)},K[2*e]=s,K[2*e+1]=o,K[2*t]=f,K[2*t+1]=i,K[2*n]=c,K[2*n+1]=h,K[2*r]=a,K[2*r+1]=l}function ne(e,t,n,r,s,o,f,i,c,h,a,l,y,w,u,d){rt(e,s,c,y),rt(t,o,h,w),rt(n,f,a,u),rt(r,i,l,d),rt(e,o,a,d),rt(t,f,l,y),rt(n,i,c,w),rt(r,s,h,u)}function Et(e,t,n,r,s){for(let o=0;o<256;o++)K[o]=e[t+o]^e[n+o];for(let o=0;o<128;o+=16)ne(o,o+1,o+2,o+3,o+4,o+5,o+6,o+7,o+8,o+9,o+10,o+11,o+12,o+13,o+14,o+15);for(let o=0;o<16;o+=2)ne(o,o+1,o+16,o+17,o+32,o+33,o+48,o+49,o+64,o+65,o+80,o+81,o+96,o+97,o+112,o+113);if(s)for(let o=0;o<256;o++)e[r+o]^=K[o]^e[t+o]^e[n+o];else for(let o=0;o<256;o++)e[r+o]=K[o]^e[t+o]^e[n+o];X(K)}function Kt(e,t){const n=Ht(e),r=new Uint32Array(1),s=Ht(r);if(r[0]=Y(t),t<=64)return xt.create({dkLen:t}).update(s).update(n).digest();const o=new Uint8Array(t);let f=xt.create({}).update(s).update(n).digest(),i=0;for(o.set(f.subarray(0,32)),i+=32;t-i>64;i+=32){const c=xt.create({}).update(f);c.digestInto(f),c.destroy(),o.set(f.subarray(0,32),i)}return o.set(xt(f,{dkLen:t-i}),i),X(f,r),o}function Xe(e,t,n,r,s,o,f=!1){let i;e===0?t===0?i=s-1:f?i=t*r+s-1:i=t*r+(s==0?-1:0):f?i=n-r+s-1:i=n-r+(s==0?-1:0);const c=e!==0&&t!==mt-1?(t+1)*r:0,h=i-1-Pt(i,Pt(o,o).h).h;return(c+h)%n}const xe=Math.pow(2,32);function st(e){return Number.isSafeInteger(e)&&e>=0&&e=Math.pow(2,24))throw new Error('"p" must be 1..2^24');if(!st(s))throw new Error('"m" must be 0..2^32');if(!st(o)||o<1)throw new Error('"t" (iterations) must be 1..2^32');if(i!==void 0&&typeof i!="function")throw new Error('"progressCb" must be a function');if(ct(c,"asyncTick"),!st(s)||s<8*r)throw new Error('"m" (memory) must be at least 8*p bytes');if(f!==16&&f!==19)throw new Error('"version" must be 0x10 or 0x13, got '+f);return t}function We(e,t,n,r){if(e=Ft(e,"password"),t=Ft(t,"salt"),!st(e.length))throw new Error('"password" must be less of length 1..4Gb');if(!st(t.length)||t.length<8)throw new Error('"salt" must be of length 8..4Gb');if(!Object.values(be).includes(n))throw new Error('"type" was invalid');let{p:s,dkLen:o,m:f,t:i,version:c,key:h,personalization:a,maxmem:l,onProgress:y,asyncTick:w}=qe(r);h=ee(h,"key"),a=ee(a,"personalization");const u=xt.create(),d=new Uint32Array(1),b=Ht(d);for(let L of[s,o,f,i,c,n])d[0]=Y(L),u.update(b);for(let L of[e,t,h,a])d[0]=Y(L.length),u.update(b).update(L);const x=new Uint32Array(18),A=Ht(x);u.digestInto(A);const _=s,B=4*s*Math.floor(f/(mt*s)),D=Math.floor(B/s),$=Math.floor(D/mt),O=B*1024;if(!st(l))throw new Error('"maxmem" expected <2**32, got '+l);if(O>l)throw new Error('"maxmem" limit was hit: memUsed(mP*1024)='+O+", maxmem="+l);const P=new Uint32Array(O/4);for(let L=0;L{};if(y){const L=i*mt*s*$-2*s,U=Math.max(Math.floor(L/1e4),1);let v=0;I=()=>{v++,y&&(!(v%U)||v===L)&&y(v/L)}}return X(d,x),{type:n,mP:B,p:s,t:i,version:c,B:P,laneLen:D,lanes:_,segmentLen:$,dkLen:o,perBlock:I,asyncTick:w}}function Je(e,t,n,r){const s=new Uint32Array(256);for(let f=0;fQe(be.Argon2id,e,t,n);/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function en(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function jt(e){if(typeof e!="boolean")throw new TypeError(`boolean expected, not ${e}`)}function At(e){if(typeof e!="number")throw new TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError("positive integer expected, got "+e)}function z(e,t,n=""){const r=en(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function re(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function nn(e,t,n=!1){z(e,void 0,"output");const r=t.outputLen;if(e.lengthe<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,V=at?e=>e:e=>me(e)>>>0,on=e=>{for(let t=0;te:on;function sn(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function fn(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r[],o=(i,c)=>r(c,...s(i)).update(i).digest(),f=r(new Uint8Array(e),...s(new Uint8Array(0)));return o.outputLen=f.outputLen,o.blockLen=f.blockLen,o.create=(i,...c)=>r(i,...c),o}const an=(e,t)=>{function n(r,...s){if(z(r,void 0,"key"),e.nonceLength!==void 0){const a=s[0];z(a,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const o=e.tagLength;o&&s[1]!==void 0&&z(s[1],void 0,"AAD");const f=t(r,...s),i=(a,l)=>{if(l!==void 0){if(a!==2)throw new Error("cipher output not supported");z(l,void 0,"output")}};let c=!1;return{encrypt(a,l){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,z(a),i(f.encrypt.length,l),f.encrypt(a,l)},decrypt(a,l){if(z(a),o&&a.lengthUint8Array.from(e.split(""),t=>t.charCodeAt(0)),ln=it(Q(Ee("expand 16-byte k"))),un=it(Q(Ee("expand 32-byte k")));function g(e,t){return e<>>32-t}const bt=64,dn=16,Vt=2**32-1,oe=Uint32Array.of();function pn(e,t,n,r,s,o,f,i){const c=s.length,h=new Uint8Array(bt),a=Q(h),l=at&&Lt(s)&&Lt(o),y=l?Q(s):oe,w=l?Q(o):oe;if(!at){for(let u=0;u=Vt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);for(let b=0,x;b=Vt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);if(l&&d===bt){const b=u/4;if(u%4!==0)throw new Error("arx: invalid block position");for(let x=0,A;x{z(i,void 0,"key"),z(c,void 0,"nonce"),z(h,void 0,"data");const y=h.length;if(a=Gt(y,a,!1),At(l),l<0||l>=Vt)throw new Error("arx: counter overflow");const w=[];let u=i.length,d,b;if(u===32)w.push(d=St(i)),b=un;else if(u===16&&n)d=new Uint8Array(32),d.set(i),d.set(i,16),b=ln,w.push(d);else throw z(i,32,"arx key"),new Error("invalid key size");(!at||!Lt(c))&&w.push(c=St(c));let x=Q(d);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const B=c.subarray(0,16);if(at)r(b,x,Q(B),x);else{const D=it(Uint32Array.from(b));r(D,x,Q(B),x),ft(D),it(x)}c=c.subarray(16)}else at||it(x);const A=16-s;if(A!==c.length)throw new Error(`arx: nonce must be ${A} or 16 bytes`);if(A!==12){const B=new Uint8Array(12);B.set(c,o?0:12-c.length),c=B,w.push(c)}const _=it(Q(c));try{return pn(e,b,x,_,h,a,l,f),a}finally{ft(...w)}}}function G(e,t){return e[t++]&255|(e[t++]&255)<<8}class wn{constructor(t){m(this,"blockLen",16);m(this,"outputLen",16);m(this,"buffer",new Uint8Array(16));m(this,"r",new Uint16Array(10));m(this,"h",new Uint16Array(10));m(this,"pad",new Uint16Array(8));m(this,"pos",0);m(this,"finished",!1);m(this,"destroyed",!1);t=St(z(t,32,"key"));const n=G(t,0),r=G(t,2),s=G(t,4),o=G(t,6),f=G(t,8),i=G(t,10),c=G(t,12),h=G(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|s<<6)&7939,this.r[3]=(s>>>7|o<<9)&8191,this.r[4]=(o>>>4|f<<12)&255,this.r[5]=f>>>1&8190,this.r[6]=(f>>>14|i<<2)&8191,this.r[7]=(i>>>11|c<<5)&8065,this.r[8]=(c>>>8|h<<8)&8191,this.r[9]=h>>>5&127;for(let a=0;a<8;a++)this.pad[a]=G(t,16+2*a)}process(t,n,r=!1){const s=r?0:2048,{h:o,r:f}=this,i=f[0],c=f[1],h=f[2],a=f[3],l=f[4],y=f[5],w=f[6],u=f[7],d=f[8],b=f[9],x=G(t,n+0),A=G(t,n+2),_=G(t,n+4),B=G(t,n+6),D=G(t,n+8),$=G(t,n+10),O=G(t,n+12),P=G(t,n+14);let I=o[0]+(x&8191),L=o[1]+((x>>>13|A<<3)&8191),U=o[2]+((A>>>10|_<<6)&8191),v=o[3]+((_>>>7|B<<9)&8191),H=o[4]+((B>>>4|D<<12)&8191),S=o[5]+(D>>>1&8191),T=o[6]+((D>>>14|$<<2)&8191),k=o[7]+(($>>>11|O<<5)&8191),C=o[8]+((O>>>8|P<<8)&8191),R=o[9]+(P>>>5|s),E=0,N=E+I*i+L*(5*b)+U*(5*d)+v*(5*u)+H*(5*w);E=N>>>13,N&=8191,N+=S*(5*y)+T*(5*l)+k*(5*a)+C*(5*h)+R*(5*c),E+=N>>>13,N&=8191;let F=E+I*c+L*i+U*(5*b)+v*(5*d)+H*(5*u);E=F>>>13,F&=8191,F+=S*(5*w)+T*(5*y)+k*(5*l)+C*(5*a)+R*(5*h),E+=F>>>13,F&=8191;let M=E+I*h+L*c+U*i+v*(5*b)+H*(5*d);E=M>>>13,M&=8191,M+=S*(5*u)+T*(5*w)+k*(5*y)+C*(5*l)+R*(5*a),E+=M>>>13,M&=8191;let J=E+I*a+L*h+U*c+v*i+H*(5*b);E=J>>>13,J&=8191,J+=S*(5*d)+T*(5*u)+k*(5*w)+C*(5*y)+R*(5*l),E+=J>>>13,J&=8191;let ht=E+I*l+L*a+U*h+v*c+H*i;E=ht>>>13,ht&=8191,ht+=S*(5*b)+T*(5*d)+k*(5*u)+C*(5*w)+R*(5*y),E+=ht>>>13,ht&=8191;let lt=E+I*y+L*l+U*a+v*h+H*c;E=lt>>>13,lt&=8191,lt+=S*i+T*(5*b)+k*(5*d)+C*(5*u)+R*(5*w),E+=lt>>>13,lt&=8191;let ut=E+I*w+L*y+U*l+v*a+H*h;E=ut>>>13,ut&=8191,ut+=S*c+T*i+k*(5*b)+C*(5*d)+R*(5*u),E+=ut>>>13,ut&=8191;let dt=E+I*u+L*w+U*y+v*l+H*a;E=dt>>>13,dt&=8191,dt+=S*h+T*c+k*i+C*(5*b)+R*(5*d),E+=dt>>>13,dt&=8191;let pt=E+I*d+L*u+U*w+v*y+H*l;E=pt>>>13,pt&=8191,pt+=S*a+T*h+k*c+C*i+R*(5*b),E+=pt>>>13,pt&=8191;let yt=E+I*b+L*d+U*u+v*w+H*y;E=yt>>>13,yt&=8191,yt+=S*l+T*a+k*h+C*c+R*i,E+=yt>>>13,yt&=8191,E=(E<<2)+E|0,E=E+N|0,N=E&8191,E=E>>>13,F+=E,o[0]=N,o[1]=F,o[2]=M,o[3]=J,o[4]=ht,o[5]=lt,o[6]=ut,o[7]=dt,o[8]=pt,o[9]=yt}finalize(){const{h:t,pad:n}=this,r=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let i=2;i<10;i++)t[i]+=s,s=t[i]>>>13,t[i]&=8191;t[0]+=s*5,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,r[0]=t[0]+5,s=r[0]>>>13,r[0]&=8191;for(let i=1;i<10;i++)r[i]=t[i]+s,s=r[i]>>>13,r[i]&=8191;r[9]-=8192;let o=(s^1)-1;for(let i=0;i<10;i++)r[i]&=o;o=~o;for(let i=0;i<10;i++)t[i]=t[i]&o|r[i];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let f=t[0]+n[0];t[0]=f&65535;for(let i=1;i<8;i++)f=(t[i]+n[i]|0)+(f>>>16)|0,t[i]=f&65535;ft(r)}update(t){re(this),z(t),t=St(t);const{buffer:n,blockLen:r}=this,s=t.length;for(let o=0;o>>0,t[o++]=r[f]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}}const gn=cn(32,e=>new wn(e));function bn(e,t,n,r,s,o=20){let f=e[0],i=e[1],c=e[2],h=e[3],a=t[0],l=t[1],y=t[2],w=t[3],u=t[4],d=t[5],b=t[6],x=t[7],A=s,_=n[0],B=n[1],D=n[2],$=f,O=i,P=c,I=h,L=a,U=l,v=y,H=w,S=u,T=d,k=b,C=x,R=A,E=_,N=B,F=D;for(let J=0;J{e.update(t);const n=t.length%16;n&&e.update(En.subarray(n))},An=new Uint8Array(32);function ie(e,t,n,r,s){s!==void 0&&z(s,void 0,"AAD");const o=e(t,n,An),f=hn(r.length,s?s.length:0,!0),i=gn.create(o);s&&se(i,s),se(i,r),i.update(f);const c=i.digest();return ft(o,f),c}const Ln=e=>(t,n,r)=>({encrypt(o,f){const i=o.length;f=Gt(i+16,f,!1),f.set(o);const c=f.subarray(0,-16);e(t,n,c,c,1);const h=ie(e,t,n,c,r);return f.set(h,i),ft(h),f},decrypt(o,f){f=Gt(o.length-16,f,!1);const i=o.subarray(0,-16),c=o.subarray(-16),h=ie(e,t,n,i,r);if(!fn(c,h))throw ft(h),new Error("invalid tag");return f.set(o.subarray(0,-16)),e(t,n,f,f,1),ft(h),f}}),Jt=an({blockSize:64,nonceLength:24,tagLength:16},Ln(mn));class fe{constructor(t,n){m(this,"oHash");m(this,"iHash");m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"finished",!1);m(this,"destroyed",!1);if(qt(t),q(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?t.create().update(n).digest():n);for(let o=0;o{const e=(t,n,r)=>new fe(t,n).update(r).digest();return e.create=(t,n)=>new fe(t,n),e})();function _n(e,t,n){return qt(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Ae(e,n,t)}const Mt=Uint8Array.of(0),ce=Uint8Array.of();function Un(e,t,n,r=32){qt(e),ct(r,"length"),q(t,void 0,"prk");const s=e.outputLen;if(t.length255*s)throw new Error("Length must be <= 255*HashLen");const o=Math.ceil(r/s);n===void 0?n=ce:q(n,void 0,"info");const f=new Uint8Array(o*s),i=Ae.create(e,t),c=i._cloneInto(),h=new Uint8Array(i.outputLen);for(let a=0;aUn(e,_n(e,t,n),r,s),Bn=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ot=new Uint32Array(64);class In extends je{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:n,C:r,D:s,E:o,F:f,G:i,H:c}=this;return[t,n,r,s,o,f,i,c]}set(t,n,r,s,o,f,i,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=f|0,this.G=i|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ot[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const y=ot[l-15],w=ot[l-2],u=W(y,7)^W(y,18)^y>>>3,d=W(w,17)^W(w,19)^w>>>10;ot[l]=d+ot[l-7]+u+ot[l-16]|0}let{A:r,B:s,C:o,D:f,E:i,F:c,G:h,H:a}=this;for(let l=0;l<64;l++){const y=W(i,6)^W(i,11)^W(i,25),w=a+y+Pe(i,c,h)+Bn[l]+ot[l]|0,d=(W(r,2)^W(r,13)^W(r,22))+Ke(r,s,o)|0;a=h,h=c,c=i,i=f+w|0,f=o,o=s,s=r,r=w+d|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,f=f+this.D|0,i=i+this.E|0,c=c+this.F|0,h=h+this.G|0,a=a+this.H|0,this.set(r,s,o,f,i,c,h,a)}roundClean(){X(ot)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),X(this.buffer)}}class On extends In{constructor(){super(32);m(this,"A",tt[0]|0);m(this,"B",tt[1]|0);m(this,"C",tt[2]|0);m(this,"D",tt[3]|0);m(this,"E",tt[4]|0);m(this,"F",tt[5]|0);m(this,"G",tt[6]|0);m(this,"H",tt[7]|0)}}const Hn=ge(()=>new On,Ne(1)),Le="atterm-relay",_e=_t("atterm-account-key-v1");function Ue(){return{alg:"argon2id",m:64*1024,t:3,p:1}}function ve(e,t,n){return tn(_t(e),t,{m:n.m,t:n.t,p:n.p,dkLen:32})}function Sn(e,t,n=Ue()){if(t.length!==32)throw new Error(`accountKey must be 32 bytes, got ${t.length}`);const r=te(16),s=ve(e,r,n),o=te(24),i=Jt(s,o,_e).encrypt(t);return{method:"password",wrapped:Dt(i),nonce:Dt(o),salt:Dt(r),kdf_params:JSON.stringify(n)}}function Tn(e,t){const n=JSON.parse(t.kdf_params);if(n.alg!=="argon2id")throw new Error(`unsupported kdf alg: ${n.alg}`);const r=$t(t.salt),s=ve(e,r,n),o=$t(t.nonce),f=Jt(s,o,_e);try{return f.decrypt($t(t.wrapped))}catch{throw new Error("invalid password")}}function Dt(e){return btoa(String.fromCharCode(...e))}function $t(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),s=new Uint8Array(r.length);for(let o=0;o"u")throw new Error("opaque wasm: no DOM to load the Go runtime");const{default:e}=await ae(async()=>{const{default:t}=await import("./wasm_exec-BVJFcdQq.js");return{default:t}},[]);await new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.onload=()=>t(),r.onerror=()=>n(new Error("opaque wasm: failed to load wasm_exec.js")),document.head.appendChild(r)})}function kt(){return Bt||(Bt=(async()=>{await Dn();const{default:e}=await ae(async()=>{const{default:o}=await import("./opaque-BH0YqBjY.js");return{default:o}},[]),t=globalThis.Go,n=new t;let r;try{r=await WebAssembly.instantiateStreaming(fetch(e),n.importObject)}catch{const o=await fetch(e);r=await WebAssembly.instantiate(await o.arrayBuffer(),n.importObject)}n.run(r.instance);const s=globalThis.attermOpaque;if(!s)throw new Error("opaque wasm did not initialize");return s})(),Bt)}function Ct(e){if(e&&typeof e=="object"&&"error"in e)throw new Error(e.error);return e}async function $n(e){return Ct((await kt()).registerInit(e))}async function Nn(e,t,n,r){return Ct((await kt()).registerFinish(e,t,n,r))}async function Fn(e){return Ct((await kt()).loginInit(e))}async function Pn(e,t,n,r){return Ct((await kt()).loginFinish(e,t,n,r))}const Zt="atterm.account-key";function Kn(e){return btoa(String.fromCharCode(...e))}function jn(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r"u"||sessionStorage.setItem(Zt,Kn(e))}function Jn(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(Zt);if(!e)return null;try{return jn(e)}catch{return null}}function Gn(){typeof sessionStorage>"u"||sessionStorage.removeItem(Zt)}async function Zn(){const{data:e}=await zt("/api/bootstrap/status");return e}function He(e,t,n){const r=ke(),s=t??(r==null?void 0:r.realmId),o=n??(r==null?void 0:r.homeInstanceURL);Ce({baseURL:(r==null?void 0:r.baseURL)??"",allowInsecure:(r==null?void 0:r.allowInsecure)??!1,sessionToken:e,expiresAt:null,...s!==void 0?{realmId:s}:{},...o!==void 0?{homeInstanceURL:o}:{}})}async function Tt(e,t){const{data:n}=await zt(e,{method:"POST",body:JSON.stringify(t)});return n}async function Qn(e,t){const{handle:n,ke1:r}=await Fn(t),s=await Tt("/api/auth/login/init",{email:e,login_ke:r});let o;try{({ke3:o}=await Pn(n,s.login_response,Le,e))}catch{throw new Error("invalid credentials")}const f=await Tt("/api/auth/login/finalize",{email:e,session_id:s.session_id,login_ke3:o}),i=Tn(t,f.account_key_wrap);return Oe(i),He(f.session_token,f.realm_id,f.home_instance_url),{user_id:f.user_id,email:e}}async function Vn(e,t,n=""){const{handle:r,ke1:s}=await $n(t),o=await Tt("/api/auth/register/init",{email:e,registration_ke:s}),{record:f}=await Nn(r,o.registration_response,Le,e),i=new Uint8Array(32);crypto.getRandomValues(i);const c=Sn(t,i,Ue()),h={email:e,registration_record:f,account_key_wrap:c};n&&(h.claim_token=n);const a=await Tt("/api/auth/register/finalize",h);return Oe(i),He(a.session_token),{user_id:a.user_id,email:e,is_admin:a.is_admin}}async function tr(e,t,n=""){return Vn(e,t,n)}async function er(){try{await zt("/api/auth/logout",{method:"POST"})}finally{Gn(),Re()}}export{Le as S,Qn as a,er as b,Fn as c,Wn as d,qn as e,Zn as g,Jn as l,Pn as o,Vn as r,tr as s}; +var Se=Object.defineProperty;var Te=(e,t,n)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var m=(e,t,n)=>Te(e,typeof t!="symbol"?t+"":t,n);import{a as zt}from"./client-DMh7GjbV.js";import{_ as ae,be as ke,bV as Ce,Z as Re}from"./useI18n-lwZlSdSx.js";const Ut=BigInt(2**32-1),Qt=BigInt(32);function Me(e,t=!1){return t?{h:Number(e&Ut),l:Number(e>>Qt&Ut)}:{h:Number(e>>Qt&Ut)|0,l:Number(e&Ut)|0}}const It=(e,t,n)=>e>>>n|t<<32-n,Ot=(e,t,n)=>e<<32-n|t>>>n,he=(e,t,n)=>e<<64-n|t>>>n-32,le=(e,t,n)=>e>>>n-32|t<<64-n,ue=(e,t)=>t,de=(e,t)=>e;function pe(e,t,n,r){const s=(t>>>0)+(r>>>0);return{h:e+n+(s/2**32|0)|0,l:s|0}}const Yt=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0),Xt=(e,t,n,r)=>t+n+r+(e/2**32|0)|0;function De(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function ct(e,t=""){if(typeof e!="number"){const n=t&&`"${t}" `;throw new TypeError(`${n}expected number, got ${typeof e}`)}if(!Number.isSafeInteger(e)||e<0){const n=t&&`"${t}" `;throw new RangeError(`${n}expected integer >= 0, got ${e}`)}}function q(e,t,n=""){const r=De(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function qt(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(ct(e.outputLen),ct(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function wt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Wt(e,t){q(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length='+n)}function Ht(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function gt(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function X(...e){for(let t=0;t>>t}const ye=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function we(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Y=ye?e=>e:e=>we(e)>>>0;function $e(e){for(let t=0;te:$e;function _t(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Ft(e,t=""){return typeof e=="string"?_t(e):q(e,void 0,t)}function ge(e,t={}){const n=(s,o)=>e(o).update(s).digest(),r=e(void 0);return n.outputLen=r.outputLen,n.blockLen=r.blockLen,n.canXOF=r.canXOF,n.create=s=>e(s),Object.assign(n,t),Object.freeze(n)}function te(e=32){ct(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const Ne=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])}),Fe=Uint8Array.from([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9]);function Pe(e,t,n){return e&t^~e&n}function Ke(e,t,n){return e&t^e&n^t&n}class je{constructor(t,n,r,s){m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"padOffset");m(this,"isLE");m(this,"buffer");m(this,"view");m(this,"finished",!1);m(this,"length",0);m(this,"pos",0);m(this,"destroyed",!1);this.blockLen=t,this.outputLen=n,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(t),this.view=Rt(this.buffer)}update(t){wt(this),q(t);const{view:n,buffer:r,blockLen:s}=this,o=t.length;for(let f=0;fs-f&&(this.process(r,0),f=0);for(let l=f;la.length)throw new Error("_sha2: outputLen bigger than state");for(let l=0;ln)throw new Error("outputLen bigger than keyLen");const{key:o,salt:f,personalization:i}=t;if(o!==void 0&&(o.length<1||o.length>n))throw new Error('"key" expected to be undefined or of length=1..'+n);f!==void 0&&q(f,r,"salt"),i!==void 0&&q(i,s,"personalization")}class Ge{constructor(t,n){m(this,"buffer");m(this,"buffer32");m(this,"finished",!1);m(this,"destroyed",!1);m(this,"length",0);m(this,"pos",0);m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);ct(t),ct(n),this.blockLen=t,this.outputLen=n,this.buffer=new Uint8Array(t),this.buffer32=gt(this.buffer)}update(t){wt(this),q(t);const{blockLen:n,buffer:r,buffer32:s}=this,o=t.length,f=t.byteOffset,i=t.buffer;for(let c=0;c>>8*a}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}_cloneInto(t){const{buffer:n,length:r,finished:s,destroyed:o,outputLen:f,pos:i}=this;return t||(t=new this.constructor({dkLen:f})),t.set(...this.get()),t.buffer.set(n),t.destroyed=o,t.finished=s,t.length=r,t.pos=i,t.outputLen=f,t}clone(){return this._cloneInto()}}class ze extends Ge{constructor(n={}){const r=n.dkLen===void 0?64:n.dkLen;super(128,r);m(this,"v0l",j[0]|0);m(this,"v0h",j[1]|0);m(this,"v1l",j[2]|0);m(this,"v1h",j[3]|0);m(this,"v2l",j[4]|0);m(this,"v2h",j[5]|0);m(this,"v3l",j[6]|0);m(this,"v3h",j[7]|0);m(this,"v4l",j[8]|0);m(this,"v4h",j[9]|0);m(this,"v5l",j[10]|0);m(this,"v5h",j[11]|0);m(this,"v6l",j[12]|0);m(this,"v6h",j[13]|0);m(this,"v7l",j[14]|0);m(this,"v7h",j[15]|0);Ve(r,n,64,16,16);let{key:s,personalization:o,salt:f}=n,i=0;if(s!==void 0&&(q(s,void 0,"key"),i=s.length),this.v0l^=this.outputLen|i<<8|65536|1<<24,f!==void 0){q(f,void 0,"salt");const c=gt(f);this.v4l^=Y(c[0]),this.v4h^=Y(c[1]),this.v5l^=Y(c[2]),this.v5h^=Y(c[3])}if(o!==void 0){q(o,void 0,"personalization");const c=gt(o);this.v6l^=Y(c[0]),this.v6h^=Y(c[1]),this.v7l^=Y(c[2]),this.v7h^=Y(c[3])}if(s!==void 0){const c=new Uint8Array(this.blockLen);c.set(s),this.update(c)}}get(){let{v0l:n,v0h:r,v1l:s,v1h:o,v2l:f,v2h:i,v3l:c,v3h:h,v4l:a,v4h:l,v5l:y,v5h:w,v6l:u,v6h:d,v7l:b,v7h:x}=this;return[n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x]}set(n,r,s,o,f,i,c,h,a,l,y,w,u,d,b,x){this.v0l=n|0,this.v0h=r|0,this.v1l=s|0,this.v1h=o|0,this.v2l=f|0,this.v2h=i|0,this.v3l=c|0,this.v3h=h|0,this.v4l=a|0,this.v4h=l|0,this.v5l=y|0,this.v5h=w|0,this.v6l=u|0,this.v6h=d|0,this.v7l=b|0,this.v7h=x|0}compress(n,r,s){this.get().forEach((h,a)=>p[a]=h),p.set(j,16);let{h:o,l:f}=Me(BigInt(this.length));p[24]=j[8]^f,p[25]=j[9]^o,s&&(p[28]=~p[28],p[29]=~p[29]);let i=0;const c=Fe;for(let h=0;h<12;h++)et(0,4,8,12,n,r+2*c[i++]),nt(0,4,8,12,n,r+2*c[i++]),et(1,5,9,13,n,r+2*c[i++]),nt(1,5,9,13,n,r+2*c[i++]),et(2,6,10,14,n,r+2*c[i++]),nt(2,6,10,14,n,r+2*c[i++]),et(3,7,11,15,n,r+2*c[i++]),nt(3,7,11,15,n,r+2*c[i++]),et(0,5,10,15,n,r+2*c[i++]),nt(0,5,10,15,n,r+2*c[i++]),et(1,6,11,12,n,r+2*c[i++]),nt(1,6,11,12,n,r+2*c[i++]),et(2,7,8,13,n,r+2*c[i++]),nt(2,7,8,13,n,r+2*c[i++]),et(3,4,9,14,n,r+2*c[i++]),nt(3,4,9,14,n,r+2*c[i++]);this.v0l^=p[0]^p[16],this.v0h^=p[1]^p[17],this.v1l^=p[2]^p[18],this.v1h^=p[3]^p[19],this.v2l^=p[4]^p[20],this.v2h^=p[5]^p[21],this.v3l^=p[6]^p[22],this.v3h^=p[7]^p[23],this.v4l^=p[8]^p[24],this.v4h^=p[9]^p[25],this.v5l^=p[10]^p[26],this.v5h^=p[11]^p[27],this.v6l^=p[12]^p[28],this.v6h^=p[13]^p[29],this.v7l^=p[14]^p[30],this.v7h^=p[15]^p[31],X(p)}destroy(){this.destroyed=!0,X(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const xt=ge(e=>new ze(e)),be={Argond2d:0,Argon2i:1,Argon2id:2},mt=4,ee=(e,t="")=>e===void 0?Uint8Array.of():Ft(e,t);function Pt(e,t){const n=e&65535,r=e>>>16,s=t&65535,o=t>>>16,f=Math.imul(n,s),i=Math.imul(r,s),c=Math.imul(n,o),h=Math.imul(r,o),a=(f>>>16)+(i&65535)+c,l=h+(i>>>16)+(a>>>16)|0,y=a<<16|f&65535;return{h:l,l:y}}function Ye(e,t){const{h:n,l:r}=Pt(e,t);return{h:(n<<1|r>>>31)&4294967295,l:r<<1&4294967295}}function vt(e,t,n,r){const{h:s,l:o}=Ye(t,r),f=Yt(t,r,o);return{h:Xt(f,e,n,s),l:f|0}}const K=new Uint32Array(256);function rt(e,t,n,r){let s=K[2*e],o=K[2*e+1],f=K[2*t],i=K[2*t+1],c=K[2*n],h=K[2*n+1],a=K[2*r],l=K[2*r+1];({h:o,l:s}=vt(o,s,i,f)),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:ue(l,a),Dl:de(l)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:It(i,f,24),Bl:Ot(i,f,24)},{h:o,l:s}=vt(o,s,i,f),{Dh:l,Dl:a}={Dh:l^o,Dl:a^s},{Dh:l,Dl:a}={Dh:It(l,a,16),Dl:Ot(l,a,16)},{h,l:c}=vt(h,c,l,a),{Bh:i,Bl:f}={Bh:i^h,Bl:f^c},{Bh:i,Bl:f}={Bh:he(i,f,63),Bl:le(i,f,63)},K[2*e]=s,K[2*e+1]=o,K[2*t]=f,K[2*t+1]=i,K[2*n]=c,K[2*n+1]=h,K[2*r]=a,K[2*r+1]=l}function ne(e,t,n,r,s,o,f,i,c,h,a,l,y,w,u,d){rt(e,s,c,y),rt(t,o,h,w),rt(n,f,a,u),rt(r,i,l,d),rt(e,o,a,d),rt(t,f,l,y),rt(n,i,c,w),rt(r,s,h,u)}function Et(e,t,n,r,s){for(let o=0;o<256;o++)K[o]=e[t+o]^e[n+o];for(let o=0;o<128;o+=16)ne(o,o+1,o+2,o+3,o+4,o+5,o+6,o+7,o+8,o+9,o+10,o+11,o+12,o+13,o+14,o+15);for(let o=0;o<16;o+=2)ne(o,o+1,o+16,o+17,o+32,o+33,o+48,o+49,o+64,o+65,o+80,o+81,o+96,o+97,o+112,o+113);if(s)for(let o=0;o<256;o++)e[r+o]^=K[o]^e[t+o]^e[n+o];else for(let o=0;o<256;o++)e[r+o]=K[o]^e[t+o]^e[n+o];X(K)}function Kt(e,t){const n=Ht(e),r=new Uint32Array(1),s=Ht(r);if(r[0]=Y(t),t<=64)return xt.create({dkLen:t}).update(s).update(n).digest();const o=new Uint8Array(t);let f=xt.create({}).update(s).update(n).digest(),i=0;for(o.set(f.subarray(0,32)),i+=32;t-i>64;i+=32){const c=xt.create({}).update(f);c.digestInto(f),c.destroy(),o.set(f.subarray(0,32),i)}return o.set(xt(f,{dkLen:t-i}),i),X(f,r),o}function Xe(e,t,n,r,s,o,f=!1){let i;e===0?t===0?i=s-1:f?i=t*r+s-1:i=t*r+(s==0?-1:0):f?i=n-r+s-1:i=n-r+(s==0?-1:0);const c=e!==0&&t!==mt-1?(t+1)*r:0,h=i-1-Pt(i,Pt(o,o).h).h;return(c+h)%n}const xe=Math.pow(2,32);function st(e){return Number.isSafeInteger(e)&&e>=0&&e=Math.pow(2,24))throw new Error('"p" must be 1..2^24');if(!st(s))throw new Error('"m" must be 0..2^32');if(!st(o)||o<1)throw new Error('"t" (iterations) must be 1..2^32');if(i!==void 0&&typeof i!="function")throw new Error('"progressCb" must be a function');if(ct(c,"asyncTick"),!st(s)||s<8*r)throw new Error('"m" (memory) must be at least 8*p bytes');if(f!==16&&f!==19)throw new Error('"version" must be 0x10 or 0x13, got '+f);return t}function We(e,t,n,r){if(e=Ft(e,"password"),t=Ft(t,"salt"),!st(e.length))throw new Error('"password" must be less of length 1..4Gb');if(!st(t.length)||t.length<8)throw new Error('"salt" must be of length 8..4Gb');if(!Object.values(be).includes(n))throw new Error('"type" was invalid');let{p:s,dkLen:o,m:f,t:i,version:c,key:h,personalization:a,maxmem:l,onProgress:y,asyncTick:w}=qe(r);h=ee(h,"key"),a=ee(a,"personalization");const u=xt.create(),d=new Uint32Array(1),b=Ht(d);for(let L of[s,o,f,i,c,n])d[0]=Y(L),u.update(b);for(let L of[e,t,h,a])d[0]=Y(L.length),u.update(b).update(L);const x=new Uint32Array(18),A=Ht(x);u.digestInto(A);const _=s,B=4*s*Math.floor(f/(mt*s)),D=Math.floor(B/s),$=Math.floor(D/mt),O=B*1024;if(!st(l))throw new Error('"maxmem" expected <2**32, got '+l);if(O>l)throw new Error('"maxmem" limit was hit: memUsed(mP*1024)='+O+", maxmem="+l);const P=new Uint32Array(O/4);for(let L=0;L{};if(y){const L=i*mt*s*$-2*s,U=Math.max(Math.floor(L/1e4),1);let v=0;I=()=>{v++,y&&(!(v%U)||v===L)&&y(v/L)}}return X(d,x),{type:n,mP:B,p:s,t:i,version:c,B:P,laneLen:D,lanes:_,segmentLen:$,dkLen:o,perBlock:I,asyncTick:w}}function Je(e,t,n,r){const s=new Uint32Array(256);for(let f=0;fQe(be.Argon2id,e,t,n);/*! noble-ciphers - MIT License (c) 2023 Paul Miller (paulmillr.com) */function en(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"&&"BYTES_PER_ELEMENT"in e&&e.BYTES_PER_ELEMENT===1}function jt(e){if(typeof e!="boolean")throw new TypeError(`boolean expected, not ${e}`)}function At(e){if(typeof e!="number")throw new TypeError("number expected, got "+typeof e);if(!Number.isSafeInteger(e)||e<0)throw new RangeError("positive integer expected, got "+e)}function z(e,t,n=""){const r=en(e),s=e==null?void 0:e.length,o=t!==void 0;if(!r||o&&s!==t){const f=n&&`"${n}" `,i=o?` of length ${t}`:"",c=r?`length=${s}`:`type=${typeof e}`,h=f+"expected Uint8Array"+i+", got "+c;throw r?new RangeError(h):new TypeError(h)}return e}function re(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function nn(e,t,n=!1){z(e,void 0,"output");const r=t.outputLen;if(e.lengthe<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,G=at?e=>e:e=>me(e)>>>0,on=e=>{for(let t=0;te:on;function sn(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function fn(e,t){if(e.length!==t.length)return!1;let n=0;for(let r=0;r[],o=(i,c)=>r(c,...s(i)).update(i).digest(),f=r(new Uint8Array(e),...s(new Uint8Array(0)));return o.outputLen=f.outputLen,o.blockLen=f.blockLen,o.create=(i,...c)=>r(i,...c),o}const an=(e,t)=>{function n(r,...s){if(z(r,void 0,"key"),e.nonceLength!==void 0){const a=s[0];z(a,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const o=e.tagLength;o&&s[1]!==void 0&&z(s[1],void 0,"AAD");const f=t(r,...s),i=(a,l)=>{if(l!==void 0){if(a!==2)throw new Error("cipher output not supported");z(l,void 0,"output")}};let c=!1;return{encrypt(a,l){if(c)throw new Error("cannot encrypt() twice with same key + nonce");return c=!0,z(a),i(f.encrypt.length,l),f.encrypt(a,l)},decrypt(a,l){if(z(a),o&&a.lengthUint8Array.from(e.split(""),t=>t.charCodeAt(0)),ln=it(Q(Ee("expand 16-byte k"))),un=it(Q(Ee("expand 32-byte k")));function g(e,t){return e<>>32-t}const bt=64,dn=16,Gt=2**32-1,oe=Uint32Array.of();function pn(e,t,n,r,s,o,f,i){const c=s.length,h=new Uint8Array(bt),a=Q(h),l=at&&Lt(s)&&Lt(o),y=l?Q(s):oe,w=l?Q(o):oe;if(!at){for(let u=0;u=Gt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);for(let b=0,x;b=Gt)throw new Error("arx: counter overflow");const d=Math.min(bt,c-u);if(l&&d===bt){const b=u/4;if(u%4!==0)throw new Error("arx: invalid block position");for(let x=0,A;x{z(i,void 0,"key"),z(c,void 0,"nonce"),z(h,void 0,"data");const y=h.length;if(a=Vt(y,a,!1),At(l),l<0||l>=Gt)throw new Error("arx: counter overflow");const w=[];let u=i.length,d,b;if(u===32)w.push(d=St(i)),b=un;else if(u===16&&n)d=new Uint8Array(32),d.set(i),d.set(i,16),b=ln,w.push(d);else throw z(i,32,"arx key"),new Error("invalid key size");(!at||!Lt(c))&&w.push(c=St(c));let x=Q(d);if(r){if(c.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const B=c.subarray(0,16);if(at)r(b,x,Q(B),x);else{const D=it(Uint32Array.from(b));r(D,x,Q(B),x),ft(D),it(x)}c=c.subarray(16)}else at||it(x);const A=16-s;if(A!==c.length)throw new Error(`arx: nonce must be ${A} or 16 bytes`);if(A!==12){const B=new Uint8Array(12);B.set(c,o?0:12-c.length),c=B,w.push(c)}const _=it(Q(c));try{return pn(e,b,x,_,h,a,l,f),a}finally{ft(...w)}}}function V(e,t){return e[t++]&255|(e[t++]&255)<<8}class wn{constructor(t){m(this,"blockLen",16);m(this,"outputLen",16);m(this,"buffer",new Uint8Array(16));m(this,"r",new Uint16Array(10));m(this,"h",new Uint16Array(10));m(this,"pad",new Uint16Array(8));m(this,"pos",0);m(this,"finished",!1);m(this,"destroyed",!1);t=St(z(t,32,"key"));const n=V(t,0),r=V(t,2),s=V(t,4),o=V(t,6),f=V(t,8),i=V(t,10),c=V(t,12),h=V(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|r<<3)&8191,this.r[2]=(r>>>10|s<<6)&7939,this.r[3]=(s>>>7|o<<9)&8191,this.r[4]=(o>>>4|f<<12)&255,this.r[5]=f>>>1&8190,this.r[6]=(f>>>14|i<<2)&8191,this.r[7]=(i>>>11|c<<5)&8065,this.r[8]=(c>>>8|h<<8)&8191,this.r[9]=h>>>5&127;for(let a=0;a<8;a++)this.pad[a]=V(t,16+2*a)}process(t,n,r=!1){const s=r?0:2048,{h:o,r:f}=this,i=f[0],c=f[1],h=f[2],a=f[3],l=f[4],y=f[5],w=f[6],u=f[7],d=f[8],b=f[9],x=V(t,n+0),A=V(t,n+2),_=V(t,n+4),B=V(t,n+6),D=V(t,n+8),$=V(t,n+10),O=V(t,n+12),P=V(t,n+14);let I=o[0]+(x&8191),L=o[1]+((x>>>13|A<<3)&8191),U=o[2]+((A>>>10|_<<6)&8191),v=o[3]+((_>>>7|B<<9)&8191),H=o[4]+((B>>>4|D<<12)&8191),S=o[5]+(D>>>1&8191),T=o[6]+((D>>>14|$<<2)&8191),k=o[7]+(($>>>11|O<<5)&8191),C=o[8]+((O>>>8|P<<8)&8191),R=o[9]+(P>>>5|s),E=0,N=E+I*i+L*(5*b)+U*(5*d)+v*(5*u)+H*(5*w);E=N>>>13,N&=8191,N+=S*(5*y)+T*(5*l)+k*(5*a)+C*(5*h)+R*(5*c),E+=N>>>13,N&=8191;let F=E+I*c+L*i+U*(5*b)+v*(5*d)+H*(5*u);E=F>>>13,F&=8191,F+=S*(5*w)+T*(5*y)+k*(5*l)+C*(5*a)+R*(5*h),E+=F>>>13,F&=8191;let M=E+I*h+L*c+U*i+v*(5*b)+H*(5*d);E=M>>>13,M&=8191,M+=S*(5*u)+T*(5*w)+k*(5*y)+C*(5*l)+R*(5*a),E+=M>>>13,M&=8191;let J=E+I*a+L*h+U*c+v*i+H*(5*b);E=J>>>13,J&=8191,J+=S*(5*d)+T*(5*u)+k*(5*w)+C*(5*y)+R*(5*l),E+=J>>>13,J&=8191;let ht=E+I*l+L*a+U*h+v*c+H*i;E=ht>>>13,ht&=8191,ht+=S*(5*b)+T*(5*d)+k*(5*u)+C*(5*w)+R*(5*y),E+=ht>>>13,ht&=8191;let lt=E+I*y+L*l+U*a+v*h+H*c;E=lt>>>13,lt&=8191,lt+=S*i+T*(5*b)+k*(5*d)+C*(5*u)+R*(5*w),E+=lt>>>13,lt&=8191;let ut=E+I*w+L*y+U*l+v*a+H*h;E=ut>>>13,ut&=8191,ut+=S*c+T*i+k*(5*b)+C*(5*d)+R*(5*u),E+=ut>>>13,ut&=8191;let dt=E+I*u+L*w+U*y+v*l+H*a;E=dt>>>13,dt&=8191,dt+=S*h+T*c+k*i+C*(5*b)+R*(5*d),E+=dt>>>13,dt&=8191;let pt=E+I*d+L*u+U*w+v*y+H*l;E=pt>>>13,pt&=8191,pt+=S*a+T*h+k*c+C*i+R*(5*b),E+=pt>>>13,pt&=8191;let yt=E+I*b+L*d+U*u+v*w+H*y;E=yt>>>13,yt&=8191,yt+=S*l+T*a+k*h+C*c+R*i,E+=yt>>>13,yt&=8191,E=(E<<2)+E|0,E=E+N|0,N=E&8191,E=E>>>13,F+=E,o[0]=N,o[1]=F,o[2]=M,o[3]=J,o[4]=ht,o[5]=lt,o[6]=ut,o[7]=dt,o[8]=pt,o[9]=yt}finalize(){const{h:t,pad:n}=this,r=new Uint16Array(10);let s=t[1]>>>13;t[1]&=8191;for(let i=2;i<10;i++)t[i]+=s,s=t[i]>>>13,t[i]&=8191;t[0]+=s*5,s=t[0]>>>13,t[0]&=8191,t[1]+=s,s=t[1]>>>13,t[1]&=8191,t[2]+=s,r[0]=t[0]+5,s=r[0]>>>13,r[0]&=8191;for(let i=1;i<10;i++)r[i]=t[i]+s,s=r[i]>>>13,r[i]&=8191;r[9]-=8192;let o=(s^1)-1;for(let i=0;i<10;i++)r[i]&=o;o=~o;for(let i=0;i<10;i++)t[i]=t[i]&o|r[i];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let f=t[0]+n[0];t[0]=f&65535;for(let i=1;i<8;i++)f=(t[i]+n[i]|0)+(f>>>16)|0,t[i]=f&65535;ft(r)}update(t){re(this),z(t),t=St(t);const{buffer:n,blockLen:r}=this,s=t.length;for(let o=0;o>>0,t[o++]=r[f]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const r=t.slice(0,n);return this.destroy(),r}}const gn=cn(32,e=>new wn(e));function bn(e,t,n,r,s,o=20){let f=e[0],i=e[1],c=e[2],h=e[3],a=t[0],l=t[1],y=t[2],w=t[3],u=t[4],d=t[5],b=t[6],x=t[7],A=s,_=n[0],B=n[1],D=n[2],$=f,O=i,P=c,I=h,L=a,U=l,v=y,H=w,S=u,T=d,k=b,C=x,R=A,E=_,N=B,F=D;for(let J=0;J{e.update(t);const n=t.length%16;n&&e.update(En.subarray(n))},An=new Uint8Array(32);function ie(e,t,n,r,s){s!==void 0&&z(s,void 0,"AAD");const o=e(t,n,An),f=hn(r.length,s?s.length:0,!0),i=gn.create(o);s&&se(i,s),se(i,r),i.update(f);const c=i.digest();return ft(o,f),c}const Ln=e=>(t,n,r)=>({encrypt(o,f){const i=o.length;f=Vt(i+16,f,!1),f.set(o);const c=f.subarray(0,-16);e(t,n,c,c,1);const h=ie(e,t,n,c,r);return f.set(h,i),ft(h),f},decrypt(o,f){f=Vt(o.length-16,f,!1);const i=o.subarray(0,-16),c=o.subarray(-16),h=ie(e,t,n,i,r);if(!fn(c,h))throw ft(h),new Error("invalid tag");return f.set(o.subarray(0,-16)),e(t,n,f,f,1),ft(h),f}}),Jt=an({blockSize:64,nonceLength:24,tagLength:16},Ln(mn));class fe{constructor(t,n){m(this,"oHash");m(this,"iHash");m(this,"blockLen");m(this,"outputLen");m(this,"canXOF",!1);m(this,"finished",!1);m(this,"destroyed",!1);if(qt(t),q(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?t.create().update(n).digest():n);for(let o=0;o{const e=(t,n,r)=>new fe(t,n).update(r).digest();return e.create=(t,n)=>new fe(t,n),e})();function _n(e,t,n){return qt(e),n===void 0&&(n=new Uint8Array(e.outputLen)),Ae(e,n,t)}const Mt=Uint8Array.of(0),ce=Uint8Array.of();function Un(e,t,n,r=32){qt(e),ct(r,"length"),q(t,void 0,"prk");const s=e.outputLen;if(t.length255*s)throw new Error("Length must be <= 255*HashLen");const o=Math.ceil(r/s);n===void 0?n=ce:q(n,void 0,"info");const f=new Uint8Array(o*s),i=Ae.create(e,t),c=i._cloneInto(),h=new Uint8Array(i.outputLen);for(let a=0;aUn(e,_n(e,t,n),r,s),Bn=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),ot=new Uint32Array(64);class In extends je{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:n,C:r,D:s,E:o,F:f,G:i,H:c}=this;return[t,n,r,s,o,f,i,c]}set(t,n,r,s,o,f,i,c){this.A=t|0,this.B=n|0,this.C=r|0,this.D=s|0,this.E=o|0,this.F=f|0,this.G=i|0,this.H=c|0}process(t,n){for(let l=0;l<16;l++,n+=4)ot[l]=t.getUint32(n,!1);for(let l=16;l<64;l++){const y=ot[l-15],w=ot[l-2],u=W(y,7)^W(y,18)^y>>>3,d=W(w,17)^W(w,19)^w>>>10;ot[l]=d+ot[l-7]+u+ot[l-16]|0}let{A:r,B:s,C:o,D:f,E:i,F:c,G:h,H:a}=this;for(let l=0;l<64;l++){const y=W(i,6)^W(i,11)^W(i,25),w=a+y+Pe(i,c,h)+Bn[l]+ot[l]|0,d=(W(r,2)^W(r,13)^W(r,22))+Ke(r,s,o)|0;a=h,h=c,c=i,i=f+w|0,f=o,o=s,s=r,r=w+d|0}r=r+this.A|0,s=s+this.B|0,o=o+this.C|0,f=f+this.D|0,i=i+this.E|0,c=c+this.F|0,h=h+this.G|0,a=a+this.H|0,this.set(r,s,o,f,i,c,h,a)}roundClean(){X(ot)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),X(this.buffer)}}class On extends In{constructor(){super(32);m(this,"A",tt[0]|0);m(this,"B",tt[1]|0);m(this,"C",tt[2]|0);m(this,"D",tt[3]|0);m(this,"E",tt[4]|0);m(this,"F",tt[5]|0);m(this,"G",tt[6]|0);m(this,"H",tt[7]|0)}}const Hn=ge(()=>new On,Ne(1)),Le="atterm-relay",_e=_t("atterm-account-key-v1");function Ue(){return{alg:"argon2id",m:64*1024,t:3,p:1}}function ve(e,t,n){return tn(_t(e),t,{m:n.m,t:n.t,p:n.p,dkLen:32})}function Sn(e,t,n=Ue()){if(t.length!==32)throw new Error(`accountKey must be 32 bytes, got ${t.length}`);const r=te(16),s=ve(e,r,n),o=te(24),i=Jt(s,o,_e).encrypt(t);return{method:"password",wrapped:Dt(i),nonce:Dt(o),salt:Dt(r),kdf_params:JSON.stringify(n)}}function Tn(e,t){const n=JSON.parse(t.kdf_params);if(n.alg!=="argon2id")throw new Error(`unsupported kdf alg: ${n.alg}`);const r=$t(t.salt),s=ve(e,r,n),o=$t(t.nonce),f=Jt(s,o,_e);try{return f.decrypt($t(t.wrapped))}catch{throw new Error("invalid password")}}function Dt(e){return btoa(String.fromCharCode(...e))}function $t(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),r=atob(t+n),s=new Uint8Array(r.length);for(let o=0;o"u")throw new Error("opaque wasm: no DOM to load the Go runtime");const{default:e}=await ae(async()=>{const{default:t}=await import("./wasm_exec-BVJFcdQq.js");return{default:t}},[]);await new Promise((t,n)=>{const r=document.createElement("script");r.src=e,r.onload=()=>t(),r.onerror=()=>n(new Error("opaque wasm: failed to load wasm_exec.js")),document.head.appendChild(r)})}function kt(){return Bt||(Bt=(async()=>{await Dn();const{default:e}=await ae(async()=>{const{default:o}=await import("./opaque-BH0YqBjY.js");return{default:o}},[]),t=globalThis.Go,n=new t;let r;try{r=await WebAssembly.instantiateStreaming(fetch(e),n.importObject)}catch{const o=await fetch(e);r=await WebAssembly.instantiate(await o.arrayBuffer(),n.importObject)}n.run(r.instance);const s=globalThis.attermOpaque;if(!s)throw new Error("opaque wasm did not initialize");return s})(),Bt)}function Ct(e){if(e&&typeof e=="object"&&"error"in e)throw new Error(e.error);return e}async function $n(e){return Ct((await kt()).registerInit(e))}async function Nn(e,t,n,r){return Ct((await kt()).registerFinish(e,t,n,r))}async function Fn(e){return Ct((await kt()).loginInit(e))}async function Pn(e,t,n,r){return Ct((await kt()).loginFinish(e,t,n,r))}const Zt="atterm.account-key";function Kn(e){return btoa(String.fromCharCode(...e))}function jn(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r"u"||sessionStorage.setItem(Zt,Kn(e))}function Jn(){if(typeof sessionStorage>"u")return null;const e=sessionStorage.getItem(Zt);if(!e)return null;try{return jn(e)}catch{return null}}function Vn(){typeof sessionStorage>"u"||sessionStorage.removeItem(Zt)}async function Zn(){const{data:e}=await zt("/api/bootstrap/status");return e}function He(e,t,n){const r=ke(),s=t??(r==null?void 0:r.realmId),o=n??(r==null?void 0:r.homeInstanceURL);Ce({baseURL:(r==null?void 0:r.baseURL)??"",allowInsecure:(r==null?void 0:r.allowInsecure)??!1,sessionToken:e,expiresAt:null,...s!==void 0?{realmId:s}:{},...o!==void 0?{homeInstanceURL:o}:{}})}async function Tt(e,t){const{data:n}=await zt(e,{method:"POST",body:JSON.stringify(t)});return n}async function Qn(e,t){const{handle:n,ke1:r}=await Fn(t),s=await Tt("/api/auth/login/init",{email:e,login_ke:r});let o;try{({ke3:o}=await Pn(n,s.login_response,Le,e))}catch{throw new Error("invalid credentials")}const f=await Tt("/api/auth/login/finalize",{email:e,session_id:s.session_id,login_ke3:o}),i=Tn(t,f.account_key_wrap);return Oe(i),He(f.session_token,f.realm_id,f.home_instance_url),{user_id:f.user_id,email:e}}async function Gn(e,t,n=""){const{handle:r,ke1:s}=await $n(t),o=await Tt("/api/auth/register/init",{email:e,registration_ke:s}),{record:f}=await Nn(r,o.registration_response,Le,e),i=new Uint8Array(32);crypto.getRandomValues(i);const c=Sn(t,i,Ue()),h={email:e,registration_record:f,account_key_wrap:c};n&&(h.claim_token=n);const a=await Tt("/api/auth/register/finalize",h);return Oe(i),He(a.session_token),{user_id:a.user_id,email:e,is_admin:a.is_admin}}async function tr(e,t,n=""){return Gn(e,t,n)}async function er(){try{await zt("/api/auth/logout",{method:"POST"})}finally{Vn(),Re()}}export{Le as S,Qn as a,er as b,Fn as c,Wn as d,qn as e,Zn as g,Jn as l,Pn as o,Gn as r,tr as s}; diff --git a/internal/relay/web-dist/assets/client-2UEf7AK8.js b/internal/relay/web-dist/assets/client-DMh7GjbV.js similarity index 87% rename from internal/relay/web-dist/assets/client-2UEf7AK8.js rename to internal/relay/web-dist/assets/client-DMh7GjbV.js index fb4cfef2..a5639897 100644 --- a/internal/relay/web-dist/assets/client-2UEf7AK8.js +++ b/internal/relay/web-dist/assets/client-DMh7GjbV.js @@ -1 +1 @@ -import{bf as f,$ as d}from"./useI18n-CnvN0FfF.js";function m(o){if(!o||!o.startsWith("/")||o.startsWith("//")||o.startsWith("/\\")||typeof location>"u")return"/";try{const t=new URL(o,location.origin);return t.origin!==location.origin?"/":t.pathname+t.search+t.hash}catch{return"/"}}class l extends Error{constructor(t,a,s){super(`api error ${t} ${a}`),this.status=t,this.code=a,this.response=s,this.name="ApiError"}}async function C(o,t={}){const a=(t.method||"GET").toUpperCase(),s=new Headers(t.headers),n=f();n!=null&&n.sessionToken&&s.set("Authorization",`Bearer ${n.sessionToken}`),!s.has("Content-Type")&&t.body!==void 0&&a!=="GET"&&a!=="HEAD"&&s.set("Content-Type","application/json");const p=((n==null?void 0:n.baseURL)??"").replace(/\/$/,"")+o;let e;try{e=await fetch(p,{...t,headers:s,credentials:"omit"})}catch{throw new l(0,"network_error",null)}if(e.status===401&&(d(),typeof location<"u"&&!(location.pathname==="/login.html"||location.pathname==="/signup.html"))){const h=m(location.pathname+location.search+location.hash);location.assign("/login.html?next="+encodeURIComponent(h))}if(!e.ok){let i="http_error";if((e.headers.get("Content-Type")||"").includes("application/json"))try{const c=await e.clone().json();c&&typeof c.error=="string"&&(i=c.error)}catch{}throw new l(e.status,i,e)}const u=e.headers.get("Content-Type")||"";let r;return u.includes("application/json")?r=await e.json():r=void 0,{data:r,status:e.status,headers:e.headers}}export{l as A,C as a,m as s}; +import{be as d,Z as f}from"./useI18n-lwZlSdSx.js";function m(o){if(!o||!o.startsWith("/")||o.startsWith("//")||o.startsWith("/\\")||typeof location>"u")return"/";try{const t=new URL(o,location.origin);return t.origin!==location.origin?"/":t.pathname+t.search+t.hash}catch{return"/"}}class l extends Error{constructor(t,a,s){super(`api error ${t} ${a}`),this.status=t,this.code=a,this.response=s,this.name="ApiError"}}async function C(o,t={}){const a=(t.method||"GET").toUpperCase(),s=new Headers(t.headers),n=d();n!=null&&n.sessionToken&&s.set("Authorization",`Bearer ${n.sessionToken}`),!s.has("Content-Type")&&t.body!==void 0&&a!=="GET"&&a!=="HEAD"&&s.set("Content-Type","application/json");const p=((n==null?void 0:n.baseURL)??"").replace(/\/$/,"")+o;let e;try{e=await fetch(p,{...t,headers:s,credentials:"omit"})}catch{throw new l(0,"network_error",null)}if(e.status===401&&(f(),typeof location<"u"&&!(location.pathname==="/login.html"||location.pathname==="/signup.html"))){const h=m(location.pathname+location.search+location.hash);location.assign("/login.html?next="+encodeURIComponent(h))}if(!e.ok){let i="http_error";if((e.headers.get("Content-Type")||"").includes("application/json"))try{const c=await e.clone().json();c&&typeof c.error=="string"&&(i=c.error)}catch{}throw new l(e.status,i,e)}const u=e.headers.get("Content-Type")||"";let r;return u.includes("application/json")?r=await e.json():r=void 0,{data:r,status:e.status,headers:e.headers}}export{l as A,C as a,m as s}; diff --git a/internal/relay/web-dist/assets/firstrun-BkBSjRTR.js b/internal/relay/web-dist/assets/firstrun-BX3Qt0kf.js similarity index 59% rename from internal/relay/web-dist/assets/firstrun-BkBSjRTR.js rename to internal/relay/web-dist/assets/firstrun-BX3Qt0kf.js index 0e8faaa6..640761f4 100644 --- a/internal/relay/web-dist/assets/firstrun-BkBSjRTR.js +++ b/internal/relay/web-dist/assets/firstrun-BX3Qt0kf.js @@ -1 +1 @@ -import{aq as I,bI as n,a8 as L,bu as V,aJ as C,bx as v,ac as y,cy as l,al as r,cb as e,n as E,ab as o,g as M,c4 as u,j as S,k as f,m as _,B as P,aj as b,ae as j,ad as k,bj as N,an as T,h as U,ce as D,v as F,aR as R,aa as G}from"./useI18n-CnvN0FfF.js";import{A as H}from"./client-2UEf7AK8.js";import{g as J,r as O}from"./auth-Dhl8fEWW.js";import{formatVersionLabel as W,fetchVersion as z}from"./version-DPtnfoOB.js";import{L as K,a as Q}from"./mobile-guard-DNP_n6iV.js";import"./pwa-C6kIEQJT.js";const X={class:"auth-page"},Y={class:"auth-title"},Z={class:"auth-subtitle"},$={class:"auth-hint"},ee={key:0,class:"auth-error",role:"alert"},ae={class:"auth-alt"},te={href:"/login.html"},se={class:"auth-version"},re=I({__name:"App",setup(oe){const m=n(""),p=n(""),h=n(""),d=n(!1),i=n(""),g=n(!1),w=n("dev"),{t:a}=D(),A=L(()=>W(w.value,a));V(async()=>{try{const{admin_exists:t}=await J();if(t){location.replace("/login.html");return}}catch{}g.value=!0,w.value=await z()});function q(t){if(t instanceof H){if(t.code==="email_taken")return a("auth.errors.emailTaken");if(t.code==="password_weak")return a("auth.errors.passwordWeak");if(t.code==="invalid_email")return a("auth.errors.invalidEmail");if(t.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(t.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.setup.failed")}async function x(t){if(t.preventDefault(),!d.value){if(i.value="",p.value!==h.value){i.value=a("auth.setup.passwordMismatch");return}d.value=!0;try{(await O(m.value.trim(),p.value)).is_admin?location.assign("/"):i.value=a("auth.setup.notAdmin")}catch(s){i.value=q(s)}finally{d.value=!1}}}const B=C();return(t,s)=>(v(),y(e(U),{theme:e(T),"theme-overrides":e(B),locale:e(N).locale,"date-locale":e(N).dateLocale},{default:l(()=>[r(e(E),null,{default:l(()=>[o("main",X,[r(K,{class:"auth-language"}),g.value?(v(),y(e(M),{key:0,class:"auth-card",bordered:!1},{default:l(()=>[o("header",Y,[o("h1",null,u(e(a)("common.appName")),1),o("p",Z,u(e(a)("auth.setup.title")),1)]),o("p",$,u(e(a)("auth.setup.hint")),1),r(e(S),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:x},{default:l(()=>[r(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:m.value,"onUpdate:value":s[0]||(s[0]=c=>m.value=c),type:"text",placeholder:e(a)("auth.setup.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:p.value,"onUpdate:value":s[1]||(s[1]=c=>p.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.setup.confirmPassword"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:h.value,"onUpdate:value":s[2]||(s[2]=c=>h.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:d.value,disabled:d.value,block:""},{default:l(()=>[b(u(e(a)("auth.setup.createAdmin")),1)]),_:1},8,["loading","disabled"]),i.value?(v(),j("p",ee,u(i.value),1)):k("",!0),o("p",ae,[b(u(e(a)("auth.alreadyHaveAccount"))+" ",1),o("a",te,u(e(a)("auth.signIn")),1),s[3]||(s[3]=b(". "))])]),_:1})]),_:1})):k("",!0),o("p",se,u(A.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),le=F(re,[["__scopeId","data-v-687faf31"]]);Q("firstrun")||(R(),G(le).mount("#app")); +import{ap as L,bH as n,a7 as q,bt as V,aI as C,bw as v,ab as k,cx as l,ak as r,ca as e,n as E,aa as o,g as M,c3 as u,j as S,k as f,m as _,B as P,ai as b,ad as T,ac as y,bi as N,am as U,h as D,cd as F,v as H,aQ as j,a9 as G}from"./useI18n-lwZlSdSx.js";import{A as O}from"./client-DMh7GjbV.js";import{g as Q,r as R}from"./auth-B3RxKR1W.js";import{formatVersionLabel as W,fetchVersion as z}from"./version-Dm8mqW3q.js";import{L as J,a as K}from"./mobile-guard-Cco5WjS8.js";import"./pwa-BO-YW0rH.js";const X={class:"auth-page"},Y={class:"auth-title"},Z={class:"auth-subtitle"},$={class:"auth-hint"},ee={key:0,class:"auth-error",role:"alert"},ae={class:"auth-alt"},te={href:"/login.html"},se={class:"auth-version"},re=L({__name:"App",setup(oe){const m=n(""),p=n(""),h=n(""),d=n(!1),i=n(""),g=n(!1),w=n("dev"),{t:a}=F(),A=q(()=>W(w.value,a));V(async()=>{try{const{admin_exists:t}=await Q();if(t){location.replace("/login.html");return}}catch{}g.value=!0,w.value=await z()});function x(t){if(t instanceof O){if(t.code==="email_taken")return a("auth.errors.emailTaken");if(t.code==="password_weak")return a("auth.errors.passwordWeak");if(t.code==="invalid_email")return a("auth.errors.invalidEmail");if(t.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(t.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.setup.failed")}async function B(t){if(t.preventDefault(),!d.value){if(i.value="",p.value!==h.value){i.value=a("auth.setup.passwordMismatch");return}d.value=!0;try{(await R(m.value.trim(),p.value)).is_admin?location.assign("/"):i.value=a("auth.setup.notAdmin")}catch(s){i.value=x(s)}finally{d.value=!1}}}const I=C();return(t,s)=>(v(),k(e(D),{theme:e(U),"theme-overrides":e(I),locale:e(N).locale,"date-locale":e(N).dateLocale},{default:l(()=>[r(e(E),null,{default:l(()=>[o("main",X,[r(J,{class:"auth-language"}),g.value?(v(),k(e(M),{key:0,class:"auth-card",bordered:!1},{default:l(()=>[o("header",Y,[o("h1",null,u(e(a)("common.appName")),1),o("p",Z,u(e(a)("auth.setup.title")),1)]),o("p",$,u(e(a)("auth.setup.hint")),1),r(e(S),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:B},{default:l(()=>[r(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:m.value,"onUpdate:value":s[0]||(s[0]=c=>m.value=c),type:"text",placeholder:e(a)("auth.setup.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:p.value,"onUpdate:value":s[1]||(s[1]=c=>p.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(f),{label:e(a)("auth.setup.confirmPassword"),"show-feedback":!1},{default:l(()=>[r(e(_),{value:h.value,"onUpdate:value":s[2]||(s[2]=c=>h.value=c),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:d.value,disabled:d.value,block:""},{default:l(()=>[b(u(e(a)("auth.setup.createAdmin")),1)]),_:1},8,["loading","disabled"]),i.value?(v(),T("p",ee,u(i.value),1)):y("",!0),o("p",ae,[b(u(e(a)("auth.alreadyHaveAccount"))+" ",1),o("a",te,u(e(a)("auth.signIn")),1),s[3]||(s[3]=b(". "))])]),_:1})]),_:1})):y("",!0),o("p",se,u(A.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),le=H(re,[["__scopeId","data-v-687faf31"]]);K("firstrun")||(j(),G(le).mount("#app")); diff --git a/internal/relay/web-dist/assets/index-Ak5-vsum.js b/internal/relay/web-dist/assets/index-7QWmdym1.js similarity index 98% rename from internal/relay/web-dist/assets/index-Ak5-vsum.js rename to internal/relay/web-dist/assets/index-7QWmdym1.js index 5eb102d9..6cd8699f 100644 --- a/internal/relay/web-dist/assets/index-Ak5-vsum.js +++ b/internal/relay/web-dist/assets/index-7QWmdym1.js @@ -1,4 +1,4 @@ -import{k as st,i as Q,N as v,T as it,h as Ee,J as Ie,p as H,H as ot,Q as m,g as fe,l as at,C as lt,y as ht,O as X,E as P,s as z,e as ft,B as ut,t as dt,b as pt,x as Me,z as ct,G as mt,c as gt,f as ue,P as kt}from"./FileExplorer-BGCt84ef.js";import{C as Lt}from"./index-Bc7PlSwi.js";import{html as bt,htmlCompletionSource as wt}from"./index-CsH7OxDu.js";import"./useI18n-CnvN0FfF.js";import"./index-BH9vIdLD.js";import"./prefsSync-D8z1rJ8H.js";import"./client-2UEf7AK8.js";import"./Switch-CpxGRRqY.js";import"./auth-Dhl8fEWW.js";import"./index-q_Op_mkr.js";import"./index-BSlQSXjR.js";import"./index-CZ0p1U99.js";class _{static create(e,r,n,s,i){let o=s+(s<<8)+e+(r<<4)|0;return new _(e,r,n,o,i,[],[])}constructor(e,r,n,s,i,o,a){this.type=e,this.value=r,this.from=n,this.hash=s,this.end=i,this.children=o,this.positions=a,this.hashProp=[[v.contextHash,s]]}addChild(e,r){e.prop(v.contextHash)!=this.hash&&(e=new H(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(r)}toTree(e,r=this.end){let n=this.children.length-1;return n>=0&&(r=Math.max(r,this.positions[n]+this.children[n].length+this.from)),new H(e.types[this.type],this.children,this.positions,r-this.from).balance({makeTree:(s,i,o)=>new H(Q.none,s,i,o,this.hashProp)})}}var u;(function(t){t[t.Document=1]="Document",t[t.CodeBlock=2]="CodeBlock",t[t.FencedCode=3]="FencedCode",t[t.Blockquote=4]="Blockquote",t[t.HorizontalRule=5]="HorizontalRule",t[t.BulletList=6]="BulletList",t[t.OrderedList=7]="OrderedList",t[t.ListItem=8]="ListItem",t[t.ATXHeading1=9]="ATXHeading1",t[t.ATXHeading2=10]="ATXHeading2",t[t.ATXHeading3=11]="ATXHeading3",t[t.ATXHeading4=12]="ATXHeading4",t[t.ATXHeading5=13]="ATXHeading5",t[t.ATXHeading6=14]="ATXHeading6",t[t.SetextHeading1=15]="SetextHeading1",t[t.SetextHeading2=16]="SetextHeading2",t[t.HTMLBlock=17]="HTMLBlock",t[t.LinkReference=18]="LinkReference",t[t.Paragraph=19]="Paragraph",t[t.CommentBlock=20]="CommentBlock",t[t.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",t[t.Escape=22]="Escape",t[t.Entity=23]="Entity",t[t.HardBreak=24]="HardBreak",t[t.Emphasis=25]="Emphasis",t[t.StrongEmphasis=26]="StrongEmphasis",t[t.Link=27]="Link",t[t.Image=28]="Image",t[t.InlineCode=29]="InlineCode",t[t.HTMLTag=30]="HTMLTag",t[t.Comment=31]="Comment",t[t.ProcessingInstruction=32]="ProcessingInstruction",t[t.Autolink=33]="Autolink",t[t.HeaderMark=34]="HeaderMark",t[t.QuoteMark=35]="QuoteMark",t[t.ListMark=36]="ListMark",t[t.LinkMark=37]="LinkMark",t[t.EmphasisMark=38]="EmphasisMark",t[t.CodeMark=39]="CodeMark",t[t.CodeText=40]="CodeText",t[t.CodeInfo=41]="CodeInfo",t[t.LinkTitle=42]="LinkTitle",t[t.LinkLabel=43]="LinkLabel",t[t.URL=44]="URL"})(u||(u={}));class St{constructor(e,r){this.start=e,this.content=r,this.marks=[],this.parsers=[]}}class Ct{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return R(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,r=0,n=0){for(let s=r;s=e.stack[r.depth+1].value+r.baseIndent)return!0;if(r.indent>=r.baseIndent+4)return!1;let n=(t.type==u.OrderedList?oe:ie)(r,e,!1);return n>0&&(t.type!=u.BulletList||se(r,e,!1)<0)&&r.text.charCodeAt(r.pos+n-1)==t.value}const He={[u.Blockquote](t,e,r){return r.next!=62?!1:(r.markers.push(k(u.QuoteMark,e.lineStart+r.pos,e.lineStart+r.pos+1)),r.moveBase(r.pos+(A(r.text.charCodeAt(r.pos+1))?2:1)),t.end=e.lineStart+r.text.length,!0)},[u.ListItem](t,e,r){return r.indent-1?!1:(r.moveBaseColumn(r.baseIndent+t.value),!0)},[u.OrderedList]:de,[u.BulletList]:de,[u.Document](){return!0}};function A(t){return t==32||t==9||t==10||t==13}function R(t,e=0){for(;er&&A(t.charCodeAt(e-1));)e--;return e}function Pe(t){if(t.next!=96&&t.next!=126)return-1;let e=t.pos+1;for(;e-1&&t.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf(De.SetextHeading)>-1||n<3?-1:1}function Ne(t,e){for(let r=t.stack.length-1;r>=0;r--)if(t.stack[r].type==e)return!0;return!1}function ie(t,e,r){return(t.next==45||t.next==43||t.next==42)&&(t.pos==t.text.length-1||A(t.text.charCodeAt(t.pos+1)))&&(!r||Ne(e,u.BulletList)||t.skipSpace(t.pos+2)=48&&s<=57;){n++;if(n==t.text.length)return-1;s=t.text.charCodeAt(n)}return n==t.pos||n>t.pos+9||s!=46&&s!=41||nt.pos+1||t.next!=49)?-1:n+1-t.pos}function ye(t){if(t.next!=35)return-1;let e=t.pos+1;for(;e6?-1:r}function Oe(t){if(t.next!=45&&t.next!=61||t.indent>=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/,Te=/\?>/,ee=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Rt(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new xe(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,qe().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=Xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=``;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:$e.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Rt as html,Mt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage}; +import{L as be,E as $,C as he}from"./index-B2EmydOR.js";import{H as Te,J as Pe,Q as b,g as xe,L as Ve,z as ye,x as we,q as ve,c as Xe,O as K,E as $e}from"./FileExplorer-DTHAXsem.js";import{cssLanguage as J,css as qe}from"./index-BHEGRR_x.js";import{typescriptLanguage as _e,jsxLanguage as Ce,tsxLanguage as ke,javascriptLanguage as M,javascript as Qe}from"./index-ChhOm7oD.js";import"./useI18n-lwZlSdSx.js";import"./index-OVPV9rln.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";import"./index-X9DIw5ut.js";const Ae=55,Ye=1,Me=56,Re=2,Ee=57,Ze=3,z=4,Be=5,R=6,ee=7,te=8,ae=9,le=10,ze=11,De=12,We=13,q=58,Ne=14,Ge=15,D=59,re=21,Ie=23,ne=24,je=25,A=27,se=28,Ue=29,Le=32,Fe=35,He=37,Ke=38,Je=0,et=1,tt={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},at={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},W={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function lt(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}let N=null,G=null,I=0;function Y(e,a){let r=e.pos+a;if(I==r&&G==e)return N;let l=e.peek(a),t="";for(;lt(l);)t+=String.fromCharCode(l),l=e.peek(++a);return G=e,I=r,N=t?t.toLowerCase():l==rt||l==nt?void 0:null}const oe=60,X=62,E=47,rt=63,nt=33,st=45;function j(e,a){this.name=e,this.parent=a}const ot=[R,le,ee,te,ae],it=new he({start:null,shift(e,a,r,l){return ot.indexOf(a)>-1?new j(Y(l,1)||"",e):e},reduce(e,a){return a==re&&e?e.parent:e},reuse(e,a,r,l){let t=a.type.id;return t==R||t==He?new j(Y(l,1)||"",e):e},strict:!1}),ut=new $((e,a)=>{if(e.next!=oe){e.next<0&&a.context&&e.acceptToken(q);return}e.advance();let r=e.next==E;r&&e.advance();let l=Y(e,0);if(l===void 0)return;if(!l)return e.acceptToken(r?Ge:Ne);let t=a.context?a.context.name:null;if(r){if(l==t)return e.acceptToken(ze);if(t&&at[t])return e.acceptToken(q,-2);if(a.dialectEnabled(Je))return e.acceptToken(De);for(let s=a.context;s;s=s.parent)if(s.name==l)return;e.acceptToken(We)}else{if(l=="script")return e.acceptToken(ee);if(l=="style")return e.acceptToken(te);if(l=="textarea")return e.acceptToken(ae);if(tt.hasOwnProperty(l))return e.acceptToken(le);t&&W[t]&&W[t][l]?e.acceptToken(q,-1):e.acceptToken(R)}},{contextual:!0}),Ot=new $(e=>{for(let a=0,r=0;;r++){if(e.next<0){r&&e.acceptToken(D);break}if(e.next==st)a++;else if(e.next==X&&a>=2){r>=3&&e.acceptToken(D,-2);break}else a=0;e.advance()}});function dt(e){for(;e;e=e.parent)if(e.name=="svg"||e.name=="math")return!0;return!1}const ct=new $((e,a)=>{if(e.next==E&&e.peek(1)==X){let r=a.dialectEnabled(et)||dt(a.context);e.acceptToken(r?Be:z,2)}else e.next==X&&e.acceptToken(z,1)});function Z(e,a,r){let l=2+e.length;return new $(t=>{for(let s=0,o=0,i=0;;i++){if(t.next<0){i&&t.acceptToken(a);break}if(s==0&&t.next==oe||s==1&&t.next==E||s>=2&&so?t.acceptToken(a,-o):t.acceptToken(r,-(o-2));break}else if((t.next==10||t.next==13)&&i){t.acceptToken(a,1);break}else s=o=0;t.advance()}})}const pt=Z("script",Ae,Ye),mt=Z("style",Me,Re),ft=Z("textarea",Ee,Ze),gt=Pe({"Text RawText IncompleteTag IncompleteCloseTag":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),St=be.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#tO'#C{O!eQ#tO'#DOO!jQ#tO'#DRO!oQ#tO'#DTO!tOaO'#CqO#PObO'#CqO#[OdO'#CqO$kO!rO'#CqOOO`'#Cq'#CqO$rO$fO'#DUO$zQ#tO'#DWO%PQ#tO'#DXOOO`'#Dl'#DlOOO`'#DZ'#DZQVO!rOOO%UQ&rO,59^O%aQ&rO,59gO%lQ&rO,59jO%wQ&rO,59mO&SQ&rO,59oOOOa'#D_'#D_O&_OaO'#CyO&jOaO,59]OOOb'#D`'#D`O&rObO'#C|O&}ObO,59]OOOd'#Da'#DaO'VOdO'#DPO'bOdO,59]OOO`'#Db'#DbO'jO!rO,59]O'qQ#tO'#DSOOO`,59],59]OOOp'#Dc'#DcO'vO$fO,59pOOO`,59p,59pO(OQ#|O,59rO(TQ#|O,59sOOO`-E7X-E7XO(YQ&rO'#CtOOQW'#D['#D[O(hQ&rO1G.xOOOa1G.x1G.xOOO`1G/Z1G/ZO(sQ&rO1G/ROOOb1G/R1G/RO)OQ&rO1G/UOOOd1G/U1G/UO)ZQ&rO1G/XOOO`1G/X1G/XO)fQ&rO1G/ZOOOa-E7]-E7]O)qQ#tO'#CzOOO`1G.w1G.wOOOb-E7^-E7^O)vQ#tO'#C}OOOd-E7_-E7_O){Q#tO'#DQOOO`-E7`-E7`O*QQ#|O,59nOOOp-E7a-E7aOOO`1G/[1G/[OOO`1G/^1G/^OOO`1G/_1G/_O*VQ,UO,59`OOQW-E7Y-E7YOOOa7+$d7+$dOOO`7+$u7+$uOOOb7+$m7+$mOOOd7+$p7+$pOOO`7+$s7+$sO*bQ#|O,59fO*gQ#|O,59iO*lQ#|O,59lOOO`1G/Y1G/YO*qO7[O'#CwO+SOMhO'#CwOOQW1G.z1G.zOOO`1G/Q1G/QOOO`1G/T1G/TOOO`1G/W1G/WOOOO'#D]'#D]O+eO7[O,59cOOQW,59c,59cOOOO'#D^'#D^O+vOMhO,59cOOOO-E7Z-E7ZOOQW1G.}1G.}OOOO-E7[-E7[",stateData:",c~O!_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:it,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[gt],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zblWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOb!R!R7tP;=`<%l7S!Z8OYlWb!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{iiSlWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbiSlWb!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXiSb!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!V>SP;=`<%l;{!_>YP;=`<%l8t!_>dhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^/^!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!Z@TalWOX@OXZAYZ[@O[^AY^p@Oqr@OrsAYsw@OwxAYx!]@O!]!^Az!^!aAY!a#S@O#S#TAY#T;'S@O;'S;=`Bq<%lO@O!RA]UOpAYq!]AY!]!^Ao!^;'SAY;'S;=`At<%lOAY!RAtOc!R!RAwP;=`<%lAY!ZBRYlWc!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!ZBtP;=`<%l@O!_COhiSlWOX@OXZAYZ[@O[^AY^p@OqrBwrsAYswBwwxAYx!PBw!P!Q@O!Q!]Bw!]!^Dj!^!aAY!a#SBw#S#TE{#T#sBw#s$f@O$f;'SBw;'S;=`HS<%l?AhBw?Ah?BY@O?BY?MnBw?MnO@O!_DsbiSlWc!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VFQbiSOpAYqrE{rsAYswE{wxAYx!PE{!P!QAY!Q!]E{!]!^GY!^!aAY!a#sE{#s$fAY$f;'SE{;'S;=`G|<%l?AhE{?Ah?BYAY?BY?MnE{?MnOAY!VGaXiSc!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m!VHPP;=`<%lE{!_HVP;=`<%lBw!ZHcW!cxaP!b`Or(trs'ksv(tw!^(t!^!_)e!_;'S(t;'S;=`*P<%lO(t!aIYliSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OKQ!O!P-_!P!Q$q!Q!^-_!^!_*V!_!a&X!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!aK_kiSaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx!P-_!P!Q$q!Q!^-_!^!_*V!_!`&X!`!aMS!a#S-_#S#T1k#T#s-_#s$f$q$f;'S-_;'S;=`3X<%l?Ah-_?Ah?BY$q?BY?Mn-_?MnO$q!TM_XaP!b`!dp!fQOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X!aNZ!ZiSgQaPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr-_rs&}sv-_vw/^wx(tx}-_}!OMz!O!PMz!P!Q$q!Q![Mz![!]Mz!]!^-_!^!_*V!_!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f$}-_$}%OMz%O%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4UMz4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Je-_$Je$JgMz$Jg$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!a!$PP;=`<%lMz!R!$ZY!b`!dpOq*Vqr!$yrs(Vsv*Vwx)ex!a*V!a!b!4t!b;'S*V;'S;=`*s<%lO*V!R!%Q]!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!%y!O!f*V!f!g!']!g#W*V#W#X!0`#X;'S*V;'S;=`*s<%lO*V!R!&QX!b`!dpOr*Vrs(Vsv*Vwx)ex}*V}!O!&m!O;'S*V;'S;=`*s<%lO*V!R!&vV!b`!dp!ePOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!'dX!b`!dpOr*Vrs(Vsv*Vwx)ex!q*V!q!r!(P!r;'S*V;'S;=`*s<%lO*V!R!(WX!b`!dpOr*Vrs(Vsv*Vwx)ex!e*V!e!f!(s!f;'S*V;'S;=`*s<%lO*V!R!(zX!b`!dpOr*Vrs(Vsv*Vwx)ex!v*V!v!w!)g!w;'S*V;'S;=`*s<%lO*V!R!)nX!b`!dpOr*Vrs(Vsv*Vwx)ex!{*V!{!|!*Z!|;'S*V;'S;=`*s<%lO*V!R!*bX!b`!dpOr*Vrs(Vsv*Vwx)ex!r*V!r!s!*}!s;'S*V;'S;=`*s<%lO*V!R!+UX!b`!dpOr*Vrs(Vsv*Vwx)ex!g*V!g!h!+q!h;'S*V;'S;=`*s<%lO*V!R!+xY!b`!dpOr!+qrs!,hsv!+qvw!-Swx!.[x!`!+q!`!a!/j!a;'S!+q;'S;=`!0Y<%lO!+qq!,mV!dpOv!,hvx!-Sx!`!,h!`!a!-q!a;'S!,h;'S;=`!.U<%lO!,hP!-VTO!`!-S!`!a!-f!a;'S!-S;'S;=`!-k<%lO!-SP!-kO|PP!-nP;=`<%l!-Sq!-xS!dp|POv(Vx;'S(V;'S;=`(h<%lO(Vq!.XP;=`<%l!,ha!.aX!b`Or!.[rs!-Ssv!.[vw!-Sw!`!.[!`!a!.|!a;'S!.[;'S;=`!/d<%lO!.[a!/TT!b`|POr)esv)ew;'S)e;'S;=`)y<%lO)ea!/gP;=`<%l!.[!R!/sV!b`!dp|POr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!0]P;=`<%l!+q!R!0gX!b`!dpOr*Vrs(Vsv*Vwx)ex#c*V#c#d!1S#d;'S*V;'S;=`*s<%lO*V!R!1ZX!b`!dpOr*Vrs(Vsv*Vwx)ex#V*V#V#W!1v#W;'S*V;'S;=`*s<%lO*V!R!1}X!b`!dpOr*Vrs(Vsv*Vwx)ex#h*V#h#i!2j#i;'S*V;'S;=`*s<%lO*V!R!2qX!b`!dpOr*Vrs(Vsv*Vwx)ex#m*V#m#n!3^#n;'S*V;'S;=`*s<%lO*V!R!3eX!b`!dpOr*Vrs(Vsv*Vwx)ex#d*V#d#e!4Q#e;'S*V;'S;=`*s<%lO*V!R!4XX!b`!dpOr*Vrs(Vsv*Vwx)ex#X*V#X#Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let f=i.type.id;if(f==Ue)return _(i,u,r);if(f==Le)return _(i,u,l);if(f==Fe)return _(i,u,t);if(f==re&&s.length){let p=i.node,d=p.firstChild,m=d&&U(d,u),O;if(m){for(let c of s)if(c.tag==m&&(!c.attrs||c.attrs(O||(O=ie(d,u))))){let S=p.lastChild,h=S.type.id==Ke?S.from:p.to;if(h>d.to)return{parser:c.parser,overlay:[{from:d.to,to:h}]}}}}if(o&&f==ne){let p=i.node,d;if(d=p.firstChild){let m=o[u.read(d.from,d.to)];if(m)for(let O of m){if(O.tagName&&O.tagName!=U(p.parent,u))continue;let c=p.lastChild;if(c.type.id==A){let S=c.from+1,h=c.lastChild,T=c.to-(h&&h.isError?0:1);if(T>S)return{parser:O.parser,overlay:[{from:S,to:T}],bracketed:!0}}else if(c.type.id==se)return{parser:O.parser,overlay:[{from:c.from,to:c.to}]}}}}return null})}const V=["_blank","_self","_top","_parent"],C=["ascii","utf-8","utf-16","latin1","latin1"],k=["get","post","put","delete"],Q=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],g=["true","false"],n={},bt={a:{attrs:{href:null,ping:null,type:null,media:null,target:V,hreflang:null}},abbr:n,address:n,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:n,aside:n,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:n,base:{attrs:{href:null,target:V}},bdi:n,bdo:n,blockquote:{attrs:{cite:null}},body:n,br:n,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:n,center:n,cite:n,code:n,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:n,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:n,div:n,dl:n,dt:n,em:n,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:n,figure:n,footer:n,form:{attrs:{action:null,name:null,"accept-charset":C,autocomplete:["on","off"],enctype:Q,method:k,novalidate:["novalidate"],target:V}},h1:n,h2:n,h3:n,h4:n,h5:n,h6:n,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:n,hgroup:n,hr:n,html:{attrs:{manifest:null}},i:n,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Q,formmethod:k,formnovalidate:["novalidate"],formtarget:V,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:n,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:n,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:n,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:C,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:n,noscript:n,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:n,param:{attrs:{name:null,value:null}},pre:n,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:n,rt:n,ruby:n,samp:n,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:C}},section:n,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:n,source:{attrs:{src:null,type:null,media:null}},span:n,strong:n,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:n,summary:n,sup:n,table:n,tbody:n,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:n,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:n,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:n,time:{attrs:{datetime:null}},title:n,tr:n,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:n,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:n},Oe={accesskey:null,class:null,contenteditable:g,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:g,autocorrect:g,autocapitalize:g,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":g,"aria-autocomplete":["inline","list","both","none"],"aria-busy":g,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":g,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":g,"aria-hidden":g,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":g,"aria-multiselectable":g,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":g,"aria-relevant":null,"aria-required":g,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},de="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(e=>"on"+e);for(let e of de)Oe[e]=null;class y{constructor(a,r){this.tags={...bt,...a},this.globalAttrs={...Oe,...r},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}y.default=new y;function P(e,a,r=e.length){if(!a)return"";let l=a.firstChild,t=l&&l.getChild("TagName");return t?e.sliceString(t.from,Math.min(t.to,r)):""}function x(e,a=!1){for(;e;e=e.parent)if(e.name=="Element")if(a)a=!1;else return e;return null}function ce(e,a,r){let l=r.tags[P(e,x(a))];return(l==null?void 0:l.children)||r.allTags}function B(e,a){let r=[];for(let l=x(a);l&&!l.type.isTop;l=x(l.parent)){let t=P(e,l);if(t&&l.lastChild.name=="CloseTag")break;t&&r.indexOf(t)<0&&(a.name=="EndTag"||a.from>=l.firstChild.to)&&r.push(t)}return r}const pe=/^[:\-\.\w\u00b7-\uffff]*$/;function L(e,a,r,l,t){let s=/\s*>/.test(e.sliceDoc(t,t+5))?"":">",o=x(r,r.name=="StartTag"||r.name=="TagName");return{from:l,to:t,options:ce(e.doc,o,a).map(i=>({label:i,type:"type"})).concat(B(e.doc,r).map((i,u)=>({label:"/"+i,apply:"/"+i+s,type:"type",boost:99-u}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F(e,a,r,l){let t=/\s*>/.test(e.sliceDoc(l,l+5))?"":">";return{from:r,to:l,options:B(e.doc,a).map((s,o)=>({label:s,apply:s+t,type:"type",boost:99-o})),validFor:pe}}function ht(e,a,r,l){let t=[],s=0;for(let o of ce(e.doc,r,a))t.push({label:"<"+o,type:"type"});for(let o of B(e.doc,r))t.push({label:"",type:"type",boost:99-s++});return{from:l,to:l,options:t,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function Tt(e,a,r,l,t){let s=x(r),o=s?a.tags[P(e.doc,s)]:null,i=o&&o.attrs?Object.keys(o.attrs):[],u=o&&o.globalAttrs===!1?i:i.length?i.concat(a.globalAttrNames):a.globalAttrNames;return{from:l,to:t,options:u.map(f=>({label:f,type:"property"})),validFor:pe}}function Pt(e,a,r,l,t){var s;let o=(s=r.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),i=[],u;if(o){let f=e.sliceDoc(o.from,o.to),p=a.globalAttrs[f];if(!p){let d=x(r),m=d?a.tags[P(e.doc,d)]:null;p=(m==null?void 0:m.attrs)&&m.attrs[f]}if(p){let d=e.sliceDoc(l,t).toLowerCase(),m='"',O='"';/^['"]/.test(d)?(u=d[0]=='"'?/^[^"]*$/:/^[^']*$/,m="",O=e.sliceDoc(t,t+1)==d[0]?"":d[0],d=d.slice(1),l++):u=/^[^\s<>='"]*$/;for(let c of p)i.push({label:c,apply:m+c+O,type:"constant"})}}return{from:l,to:t,options:i,validFor:u}}function me(e,a){let{state:r,pos:l}=a,t=K(r).resolveInner(l,-1),s=t.resolve(l);for(let o=l,i;s==t&&(i=t.childBefore(o));){let u=i.lastChild;if(!u||!u.type.isError||u.fromme(l,t)}const Vt=M.parser.configure({top:"SingleExpression"}),fe=[{tag:"script",attrs:e=>e.type=="text/typescript"||e.lang=="ts",parser:_e.parser},{tag:"script",attrs:e=>e.type=="text/babel"||e.type=="text/jsx",parser:Ce.parser},{tag:"script",attrs:e=>e.type=="text/typescript-jsx",parser:ke.parser},{tag:"script",attrs(e){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(e.type)},parser:Vt},{tag:"script",attrs(e){return!e.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(e.type)},parser:M.parser},{tag:"style",attrs(e){return(!e.lang||e.lang=="css")&&(!e.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(e.type))},parser:J.parser}],ge=[{name:"style",parser:J.parser.configure({top:"Styles"})}].concat(de.map(e=>({name:e,parser:M.parser}))),Se=Ve.define({name:"html",parser:St.configure({props:[ye.add({Element(e){let a=/^(\s*)(<\/)?/.exec(e.textAfter);return e.node.to<=e.pos+a[0].length?e.continue():e.lineIndent(e.node.from)+(a[2]?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].lengthe.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),v=Se.configure({wrap:ue(fe,ge)});function Rt(e={}){let a="",r;e.matchClosingTags===!1&&(a="noMatch"),e.selfClosingTags===!0&&(a=(a?a+" ":"")+"selfClosing"),(e.nestedLanguages&&e.nestedLanguages.length||e.nestedAttributes&&e.nestedAttributes.length)&&(r=ue((e.nestedLanguages||[]).concat(fe),(e.nestedAttributes||[]).concat(ge)));let l=r?Se.configure({wrap:r,dialect:a}):a?v.configure({dialect:a}):v;return new xe(l,[v.data.of({autocomplete:xt(e)}),e.autoCloseTags!==!1?yt:[],Qe().support,qe().support])}const H=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),yt=Xe.inputHandler.of((e,a,r,l,t)=>{if(e.composing||e.state.readOnly||a!=r||l!=">"&&l!="/"||!v.isActiveAt(e.state,a,-1))return!1;let s=t(),{state:o}=s,i=o.changeByRange(u=>{var f,p,d;let m=o.doc.sliceString(u.from-1,u.to)==l,{head:O}=u,c=K(o).resolveInner(O,-1),S;if(m&&l==">"&&c.name=="EndTag"){let h=c.parent;if(((p=(f=h.parent)===null||f===void 0?void 0:f.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(S=P(o.doc,h.parent,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=``;return{range:u,changes:{from:O,to:T,insert:w}}}}else if(m&&l=="/"&&c.name=="IncompleteCloseTag"){let h=c.parent;if(c.from==O-2&&((d=h.lastChild)===null||d===void 0?void 0:d.name)!="CloseTag"&&(S=P(o.doc,h,O))&&!H.has(S)){let T=O+(o.doc.sliceString(O,O+1)===">"?1:0),w=`${S}>`;return{range:$e.cursor(O+w.length,-1),changes:{from:O,to:T,insert:w}}}}return{range:u}});return i.changes.empty?!1:(e.dispatch([s,o.update(i,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{yt as autoCloseTags,Rt as html,Mt as htmlCompletionSource,xt as htmlCompletionSourceWith,v as htmlLanguage}; diff --git a/internal/relay/web-dist/assets/index-DW5ZYIIZ.js b/internal/relay/web-dist/assets/index-DKJlFFIC.js similarity index 99% rename from internal/relay/web-dist/assets/index-DW5ZYIIZ.js rename to internal/relay/web-dist/assets/index-DKJlFFIC.js index d35964e8..6afbf26a 100644 --- a/internal/relay/web-dist/assets/index-DW5ZYIIZ.js +++ b/internal/relay/web-dist/assets/index-DKJlFFIC.js @@ -1,3 +1,3 @@ -import{L as D,E as h,C as L}from"./index-q_Op_mkr.js";import{J as H,Q as n,g as B,L as K,z as M,u as f,x as OO,w as eO,O as iO,j as aO,I as nO}from"./FileExplorer-BGCt84ef.js";import{i as rO,c as QO,s as d}from"./index-Bc7PlSwi.js";import"./useI18n-CnvN0FfF.js";import"./index-BH9vIdLD.js";import"./prefsSync-D8z1rJ8H.js";import"./client-2UEf7AK8.js";import"./Switch-CpxGRRqY.js";import"./auth-Dhl8fEWW.js";const tO=1,Z=194,j=195,oO=196,x=197,dO=198,sO=199,lO=200,TO=2,E=3,u=201,SO=24,pO=25,qO=49,gO=50,mO=55,PO=56,$O=57,hO=59,cO=60,fO=61,XO=62,yO=63,zO=65,WO=238,vO=71,RO=241,kO=242,_O=243,xO=244,uO=245,UO=246,bO=247,VO=248,Y=72,GO=249,wO=250,ZO=251,jO=252,EO=253,YO=254,FO=255,CO=256,JO=73,AO=77,IO=263,NO=112,DO=130,LO=151,HO=152,BO=155,p=10,q=13,k=32,c=9,_=35,KO=40,MO=46,R=123,U=125,F=39,C=34,b=92,Oe=111,ee=120,ie=78,ae=117,ne=85,re=new Set([pO,qO,gO,IO,zO,DO,PO,$O,WO,XO,yO,Y,JO,AO,cO,fO,LO,HO,BO,NO]);function X(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qe=new h((O,e)=>{let i;if(O.next<0)O.acceptToken(sO);else if(e.context.flags&P)X(O.next)&&O.acceptToken(dO,1);else if(((i=O.peek(-1))<0||X(i))&&e.canShift(x)){let a=0;for(;O.next==k||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==_)&&O.acceptToken(x,-a)}else X(O.next)&&O.acceptToken(oO,1)},{contextual:!0}),te=new h((O,e)=>{let i=e.context;if(i.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,Q=0;for(;;){if(O.next==k)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),Q++}r!=i.indent&&O.next!=p&&O.next!=q&&O.next!=_&&(r[O,e|J])),se=new L({start:oe,reduce(O,e,i,a){return O.flags&P&&re.has(e)||(e==vO||e==Y)&&O.flags&J?O.parent:O},shift(O,e,i,a){return e==Z?new $(O,de(a.read(a.pos,i.pos)),0):e==j?O.parent:e==SO||e==mO||e==hO||e==E?new $(O,0,P):V.has(e)?new $(O,0,V.get(e)|O.flags&P):O},hash(O){return O.hash}}),le=new h(O=>{for(let e=0;e<5;e++){if(O.next!="print".charCodeAt(e))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let e=0;;e++){let i=O.peek(e);if(!(i==k||i==c)){i!=KO&&i!=MO&&i!=p&&i!=q&&i!=_&&O.acceptToken(tO);return}}}),Te=new h((O,e)=>{let{flags:i}=e.context,a=i&s?C:F,r=(i&l)>0,Q=!(i&T),t=(i&S)>0,o=O.pos;for(;!(O.next<0);)if(t&&O.next==R)if(O.peek(1)==R)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(Q&&O.next==b){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Se(O,g)),O.acceptToken(TO);return}break}else if(O.next==b&&!Q&&O.peek(1)>-1)O.advance(2);else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(u,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(u);return}break}else O.advance();O.pos>o&&O.acceptToken(lO)});function Se(O,e){if(e==Oe)for(let i=0;i<2&&O.next>=48&&O.next<=55;i++)O.advance();else if(e==ee)for(let i=0;i<2&&y(O.next);i++)O.advance();else if(e==ae)for(let i=0;i<4&&y(O.next);i++)O.advance();else if(e==ne)for(let i=0;i<8&&y(O.next);i++)O.advance();else if(e==ie&&O.next==R){for(O.advance();O.next>=0&&O.next!=U&&O.next!=F&&O.next!=C&&O.next!=p;)O.advance();O.next==U&&O.advance()}}const pe=H({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qe={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},ge=D.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[le,te,Qe,Te,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qe[O]||-1}],tokenPrec:7668}),G=new aO,A=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function m(O){return(e,i,a)=>{if(a)return!1;let r=e.node.getChild("VariableName");return r&&i(r,O),!0}}const me={FunctionDefinition:m("function"),ClassDefinition:m("class"),ForStatement(O,e,i){if(i){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")e(a,"variable");else if(a.name=="in")break}},ImportStatement(O,e){var i,a;let{node:r}=O,Q=((i=r.firstChild)===null||i===void 0?void 0:i.name)=="from";for(let t=r.getChild("import");t;t=t.nextSibling)t.name=="VariableName"&&((a=t.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&e(t,Q?"variable":"namespace")},AssignStatement(O,e){for(let i=O.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")e(i,"variable");else if(i.name==":"||i.name=="AssignOp")break},ParamList(O,e){for(let i=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!i||!/\*|AssignOp/.test(i.name))&&e(a,"variable"),i=a},CapturePattern:m("variable"),AsPattern:m("variable"),__proto__:null};function I(O,e){let i=G.get(e);if(i)return i;let a=[],r=!0;function Q(t,o){let g=O.sliceString(t.from,t.to);a.push({label:g,type:o})}return e.cursor(nO.IncludeAnonymous).iterate(t=>{if(t.name){let o=me[t.name];if(o&&o(t,Q,r)||!r&&A.has(t.name))return!1;r=!1}else if(t.to-t.from>8192){for(let o of I(O,t.node))a.push(o);return!1}}),G.set(e,a),a}const w=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,N=["String","FormatString","Comment","PropertyName"];function Pe(O){let e=iO(O.state).resolveInner(O.pos,-1);if(N.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&w.test(O.state.sliceDoc(e.from,e.to));if(!i&&!O.explicit)return null;let a=[];for(let r=e;r;r=r.parent)A.has(r.name)&&(a=a.concat(I(O.state.doc,r)));return{options:a,from:i?e.from:O.pos,validFor:w}}const $e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),he=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: +import{L as D,E as h,C as L}from"./index-B2EmydOR.js";import{J as H,Q as n,g as B,L as K,z as M,u as f,x as OO,w as eO,O as iO,j as aO,I as nO}from"./FileExplorer-DTHAXsem.js";import{i as rO,c as QO,s as d}from"./index-X9DIw5ut.js";import"./useI18n-lwZlSdSx.js";import"./index-OVPV9rln.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const tO=1,Z=194,j=195,oO=196,x=197,dO=198,sO=199,lO=200,TO=2,E=3,u=201,SO=24,pO=25,qO=49,gO=50,mO=55,PO=56,$O=57,hO=59,cO=60,fO=61,XO=62,yO=63,zO=65,WO=238,vO=71,RO=241,kO=242,_O=243,xO=244,uO=245,UO=246,bO=247,VO=248,Y=72,GO=249,wO=250,ZO=251,jO=252,EO=253,YO=254,FO=255,CO=256,JO=73,AO=77,IO=263,NO=112,DO=130,LO=151,HO=152,BO=155,p=10,q=13,k=32,c=9,_=35,KO=40,MO=46,R=123,U=125,F=39,C=34,b=92,Oe=111,ee=120,ie=78,ae=117,ne=85,re=new Set([pO,qO,gO,IO,zO,DO,PO,$O,WO,XO,yO,Y,JO,AO,cO,fO,LO,HO,BO,NO]);function X(O){return O==p||O==q}function y(O){return O>=48&&O<=57||O>=65&&O<=70||O>=97&&O<=102}const Qe=new h((O,e)=>{let i;if(O.next<0)O.acceptToken(sO);else if(e.context.flags&P)X(O.next)&&O.acceptToken(dO,1);else if(((i=O.peek(-1))<0||X(i))&&e.canShift(x)){let a=0;for(;O.next==k||O.next==c;)O.advance(),a++;(O.next==p||O.next==q||O.next==_)&&O.acceptToken(x,-a)}else X(O.next)&&O.acceptToken(oO,1)},{contextual:!0}),te=new h((O,e)=>{let i=e.context;if(i.flags)return;let a=O.peek(-1);if(a==p||a==q){let r=0,Q=0;for(;;){if(O.next==k)r++;else if(O.next==c)r+=8-r%8;else break;O.advance(),Q++}r!=i.indent&&O.next!=p&&O.next!=q&&O.next!=_&&(r[O,e|J])),se=new L({start:oe,reduce(O,e,i,a){return O.flags&P&&re.has(e)||(e==vO||e==Y)&&O.flags&J?O.parent:O},shift(O,e,i,a){return e==Z?new $(O,de(a.read(a.pos,i.pos)),0):e==j?O.parent:e==SO||e==mO||e==hO||e==E?new $(O,0,P):V.has(e)?new $(O,0,V.get(e)|O.flags&P):O},hash(O){return O.hash}}),le=new h(O=>{for(let e=0;e<5;e++){if(O.next!="print".charCodeAt(e))return;O.advance()}if(!/\w/.test(String.fromCharCode(O.next)))for(let e=0;;e++){let i=O.peek(e);if(!(i==k||i==c)){i!=KO&&i!=MO&&i!=p&&i!=q&&i!=_&&O.acceptToken(tO);return}}}),Te=new h((O,e)=>{let{flags:i}=e.context,a=i&s?C:F,r=(i&l)>0,Q=!(i&T),t=(i&S)>0,o=O.pos;for(;!(O.next<0);)if(t&&O.next==R)if(O.peek(1)==R)O.advance(2);else{if(O.pos==o){O.acceptToken(E,1);return}break}else if(Q&&O.next==b){if(O.pos==o){O.advance();let g=O.next;g>=0&&(O.advance(),Se(O,g)),O.acceptToken(TO);return}break}else if(O.next==b&&!Q&&O.peek(1)>-1)O.advance(2);else if(O.next==a&&(!r||O.peek(1)==a&&O.peek(2)==a)){if(O.pos==o){O.acceptToken(u,r?3:1);return}break}else if(O.next==p){if(r)O.advance();else if(O.pos==o){O.acceptToken(u);return}break}else O.advance();O.pos>o&&O.acceptToken(lO)});function Se(O,e){if(e==Oe)for(let i=0;i<2&&O.next>=48&&O.next<=55;i++)O.advance();else if(e==ee)for(let i=0;i<2&&y(O.next);i++)O.advance();else if(e==ae)for(let i=0;i<4&&y(O.next);i++)O.advance();else if(e==ne)for(let i=0;i<8&&y(O.next);i++)O.advance();else if(e==ie&&O.next==R){for(O.advance();O.next>=0&&O.next!=U&&O.next!=F&&O.next!=C&&O.next!=p;)O.advance();O.next==U&&O.advance()}}const pe=H({'async "*" "**" FormatConversion FormatSpec':n.modifier,"for while if elif else try except finally return raise break continue with pass assert await yield match case":n.controlKeyword,"in not and or is del":n.operatorKeyword,"from def class global nonlocal lambda":n.definitionKeyword,import:n.moduleKeyword,"with as print":n.keyword,Boolean:n.bool,None:n.null,VariableName:n.variableName,"CallExpression/VariableName":n.function(n.variableName),"FunctionDefinition/VariableName":n.function(n.definition(n.variableName)),"ClassDefinition/VariableName":n.definition(n.className),PropertyName:n.propertyName,"CallExpression/MemberExpression/PropertyName":n.function(n.propertyName),Comment:n.lineComment,Number:n.number,String:n.string,FormatString:n.special(n.string),Escape:n.escape,UpdateOp:n.updateOperator,"ArithOp!":n.arithmeticOperator,BitOp:n.bitwiseOperator,CompareOp:n.compareOperator,AssignOp:n.definitionOperator,Ellipsis:n.punctuation,At:n.meta,"( )":n.paren,"[ ]":n.squareBracket,"{ }":n.brace,".":n.derefOperator,", ;":n.separator}),qe={__proto__:null,await:44,or:54,and:56,in:60,not:62,is:64,if:70,else:72,lambda:76,yield:94,from:96,async:102,for:104,None:162,True:164,False:164,del:178,pass:182,break:186,continue:190,return:194,raise:202,import:206,as:208,global:212,nonlocal:214,assert:218,type:223,elif:236,while:240,try:246,except:248,finally:250,with:254,def:258,class:268,match:279,case:285},ge=D.deserialize({version:14,states:"##jO`QeOOP$}OSOOO&WQtO'#HUOOQS'#Co'#CoOOQS'#Cp'#CpO'vQdO'#CnO*UQtO'#HTOOQS'#HU'#HUOOQS'#DU'#DUOOQS'#HT'#HTO*rQdO'#D_O+VQdO'#DfO+gQdO'#DjO+zOWO'#DuO,VOWO'#DvO.[QtO'#GuOOQS'#Gu'#GuO'vQdO'#GtO0ZQtO'#GtOOQS'#Eb'#EbO0rQdO'#EcOOQS'#Gs'#GsO0|QdO'#GrOOQV'#Gr'#GrO1XQdO'#FYOOQS'#G^'#G^O1^QdO'#FXOOQV'#IS'#ISOOQV'#Gq'#GqOOQV'#Fq'#FqQ`QeOOO'vQdO'#CqO1lQdO'#C}O1sQdO'#DRO2RQdO'#HYO2cQtO'#EVO'vQdO'#EWOOQS'#EY'#EYOOQS'#E['#E[OOQS'#E^'#E^O2wQdO'#E`O3_QdO'#EdO3rQdO'#EfO3zQtO'#EfO1XQdO'#EiO0rQdO'#ElO1XQdO'#EnO0rQdO'#EtO0rQdO'#EwO4VQdO'#EyO4^QdO'#FOO4iQdO'#EzO0rQdO'#FOO1XQdO'#FQO1XQdO'#FVO4nQdO'#F[P4uOdO'#GpPOOO)CBd)CBdOOQS'#Ce'#CeOOQS'#Cf'#CfOOQS'#Cg'#CgOOQS'#Ch'#ChOOQS'#Ci'#CiOOQS'#Cj'#CjOOQS'#Cl'#ClO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO'vQdO,59OO5TQdO'#DoOOQS,5:Y,5:YO5hQdO'#HdOOQS,5:],5:]O5uQ!fO,5:]O5zQtO,59YO1lQdO,59bO1lQdO,59bO1lQdO,59bO8jQdO,59bO8oQdO,59bO8vQdO,59jO8}QdO'#HTO:TQdO'#HSOOQS'#HS'#HSOOQS'#D['#D[O:lQdO,59aO'vQdO,59aO:zQdO,59aOOQS,59y,59yO;PQdO,5:RO'vQdO,5:ROOQS,5:Q,5:QO;_QdO,5:QO;dQdO,5:XO'vQdO,5:XO'vQdO,5:VOOQS,5:U,5:UO;uQdO,5:UO;zQdO,5:WOOOW'#Fy'#FyOOOOQS'#Ds'#DsOOQS1G/w1G/wOOQS1G.|1G.|O!/[QtO1G.|O!/cQtO1G.|O1lQdO1G.|O!0OQdO1G/UOOQS'#DZ'#DZO0rQdO,59tOOQS1G.{1G.{O!0VQdO1G/eO!0gQdO1G/eO!0oQdO1G/fO'vQdO'#H[O!0tQdO'#H[O!0yQtO1G.{O!1ZQdO,59iO!2aQdO,5=zO!2qQdO,5=zO!2yQdO1G/mO!3OQtO1G/mOOQS1G/l1G/lO!3`QdO,5=uO!4VQdO,5=uO0rQdO1G/qO!4tQdO1G/sO!4yQtO1G/sO!5ZQtO1G/qOOQS1G/p1G/pOOQS1G/r1G/rOOOW-E9w-E9wOOQS1G/{1G/{O!5kQdO'#HxO0rQdO'#HxO!5|QdO,5>cOOOW-E9x-E9xOOQS1G/|1G/|OOQS-E9{-E9{O!6[Q#xO1G2zO!6{QtO1G2zO'vQdO,5kOOQS1G1`1G1`O!8RQdO1G1`OOQS'#DV'#DVO0rQdO,5=qOOQS,5=q,5=qO!8WQdO'#FrO!8cQdO,59oO!8kQdO1G/XO!8uQtO,5=uOOQS1G3`1G3`OOQS,5:m,5:mO!9fQdO'#GtOOQS,5jO!;ZQdO,5>jO1XQdO,5>jO!;lQdO,5>iOOQS-E:R-E:RO!;qQdO1G0lO!;|QdO1G0lO!lO!lO!hO!=VQdO,5>hO!=hQdO'#EpO0rQdO1G0tO!=sQdO1G0tO!=xQgO1G0zO!AvQgO1G0}O!EqQdO,5>oO!E{QdO,5>oO!FTQtO,5>oO0rQdO1G1PO!F_QdO1G1PO4iQdO1G1UO!!vQdO1G1WOOQV,5;a,5;aO!FdQfO,5;aO!FiQgO1G1QO!JjQdO'#GZO4iQdO1G1QO4iQdO1G1QO!JzQdO,5>pO!KXQdO,5>pO1XQdO,5>pOOQV1G1U1G1UO!KaQdO'#FSO!KrQ!fO1G1WO!KzQdO1G1WOOQV1G1]1G1]O4iQdO1G1]O!LPQdO1G1]O!LXQdO'#F^OOQV1G1b1G1bO!#ZQtO1G1bPOOO1G2v1G2vP!L^OSO1G2vOOQS,5=},5=}OOQS'#Dp'#DpO0rQdO,5=}O!LfQdO,5=|O!LyQdO,5=|OOQS1G/u1G/uO!MRQdO,5>PO!McQdO,5>PO!MkQdO,5>PO!NOQdO,5>PO!N`QdO,5>POOQS1G3j1G3jOOQS7+$h7+$hO!8kQdO7+$pO#!RQdO1G.|O#!YQdO1G.|OOQS1G/`1G/`OOQS,5<`,5<`O'vQdO,5<`OOQS7+%P7+%PO#!aQdO7+%POOQS-E9r-E9rOOQS7+%Q7+%QO#!qQdO,5=vO'vQdO,5=vOOQS7+$g7+$gO#!vQdO7+%PO##OQdO7+%QO##TQdO1G3fOOQS7+%X7+%XO##eQdO1G3fO##mQdO7+%XOOQS,5<_,5<_O'vQdO,5<_O##rQdO1G3aOOQS-E9q-E9qO#$iQdO7+%]OOQS7+%_7+%_O#$wQdO1G3aO#%fQdO7+%_O#%kQdO1G3gO#%{QdO1G3gO#&TQdO7+%]O#&YQdO,5>dO#&sQdO,5>dO#&sQdO,5>dOOQS'#Dx'#DxO#'UO&jO'#DzO#'aO`O'#HyOOOW1G3}1G3}O#'fQdO1G3}O#'nQdO1G3}O#'yQ#xO7+(fO#(jQtO1G2UP#)TQdO'#GOOOQS,5nQdO,5sQdO1G4OOOQS-E9y-E9yO#?^QdO1G4OO<[QdO'#H{OOOO'#D{'#D{OOOO'#F|'#F|O#?oO&jO,5:fOOOW,5>e,5>eOOOW7+)i7+)iO#?zQdO7+)iO#@SQdO1G2zO#@mQdO1G2zP'vQdO'#FuO0rQdO<mO#BQQdO,5>mOOQS1G0v1G0vOOQS<rO#KgQdO,5>rO#KrQdO,5>rO#K}QdO,5>qO#L`QdO,5>qOOQS1G1Y1G1YOOQS,5;p,5;pOOQV<VAN>VO$ oQdO<cAN>cO0rQdO1G1|O$!PQtO1G1|P$!ZQdO'#FvOOQS1G2R1G2RP$!hQdO'#F{O$!uQdO7+)jO$#`QdO,5>gOOOO-E9z-E9zOOOW<tO$4{QdO,5>tO1XQdO,5vO$)nQdO,5>vOOQS1G1p1G1pOOQS,5<[,5<[OOQU7+'P7+'PO$+zQdO1G/iO$)nQdO,5wO$8zQdO,5>wOOQS1G1s1G1sOOQS7+'S7+'SP$)nQdO'#GdO$9SQdO1G4bO$9^QdO1G4bO$9fQdO1G4bOOQS7+%T7+%TO$9tQdO1G1tO$:SQtO'#FaO$:ZQdO,5<}OOQS,5<},5<}O$:iQdO1G4cOOQS-E:a-E:aO$)nQdO,5<|O$:pQdO,5<|O$:uQdO7+)|OOQS-E:`-E:`O$;PQdO7+)|O$)nQdO,5S~O%cOS%^OSSOS%]PQ~OPdOVaOfoOhYOopOs!POvqO!PrO!Q{O!T!SO!U!RO!XZO!][O!h`O!r`O!s`O!t`O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#l!QO#o!TO#s!UO#u!VO#z!WO#}hO$P!XO%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~O%]!YO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%j![O%k!]O%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aO~Ok%xXl%xXm%xXn%xXo%xXp%xXs%xXz%xX{%xX!x%xX#g%xX%[%xX%_%xX%z%xXg%xX!T%xX!U%xX%{%xX!W%xX![%xX!Q%xX#[%xXt%xX!m%xX~P%SOfoOhYO!XZO!][O!h`O!r`O!s`O!t`O%oRO%pRO%tSO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O~Oz%wX{%wX#g%wX%[%wX%_%wX%z%wX~Ok!pOl!qOm!oOn!oOo!rOp!sOs!tO!x%wX~P)pOV!zOg!|Oo0cOv0qO!PrO~P'vOV#OOo0cOv0qO!W#PO~P'vOV#SOa#TOo0cOv0qO![#UO~P'vOQ#XO%`#XO%a#ZO~OQ#^OR#[O%`#^O%a#`O~OV%iX_%iXa%iXh%iXk%iXl%iXm%iXn%iXo%iXp%iXs%iXz%iX!X%iX!f%iX%j%iX%k%iX%l%iX%m%iX%n%iX%o%iX%p%iX%q%iX%r%iX%s%iXg%iX!T%iX!U%iX~O&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O&c^O&d^O&e^O&f^O&g^O&h^O&i^O&j^O{%iX!x%iX#g%iX%[%iX%_%iX%z%iX%{%iX!W%iX![%iX!Q%iX#[%iXt%iX!m%iX~P,eOz#dO{%hX!x%hX#g%hX%[%hX%_%hX%z%hX~Oo0cOv0qO~P'vO#g#gO%[#iO%_#iO~O%uWO~O!T#nO#u!VO#z!WO#}hO~OopO~P'vOV#sOa#tO%uWO{wP~OV#xOo0cOv0qO!Q#yO~P'vO{#{O!x$QO%z#|O#g!yX%[!yX%_!yX~OV#xOo0cOv0qO#g#SX%[#SX%_#SX~P'vOo0cOv0qO#g#WX%[#WX%_#WX~P'vOh$WO%uWO~O!f$YO!r$YO%uWO~OV$eO~P'vO!U$gO#s$hO#u$iO~O{$jO~OV$qO~P'vOS$sO%[$rO%_$rO%c$tO~OV$}Oa$}Og%POo0cOv0qO~P'vOo0cOv0qO{%SO~P'vO&Y%UO~Oa!bOh!iO!X!kO!f!mOVba_bakbalbambanbaobapbasbazba{ba!xba#gba%[ba%_ba%jba%kba%lba%mba%nba%oba%pba%qba%rba%sba%zbagba!Tba!Uba%{ba!Wba![ba!Qba#[batba!mba~On%ZO~Oo%ZO~P'vOo0cO~P'vOk0eOl0fOm0dOn0dOo0mOp0nOs0rOg%wX!T%wX!U%wX%{%wX!W%wX![%wX!Q%wX#[%wX!m%wX~P)pO%{%]Og%vXz%vX!T%vX!U%vX!W%vX{%vX~Og%_Oz%`O!T%dO!U%cO~Og%_O~Oz%gO!T%dO!U%cO!W&SX~O!W%kO~Oz%lO{%nO!T%dO!U%cO![%}X~O![%rO~O![%sO~OQ#XO%`#XO%a%uO~OV%wOo0cOv0qO!PrO~P'vOQ#^OR#[O%`#^O%a%zO~OV!qa_!qaa!qah!qak!qal!qam!qan!qao!qap!qas!qaz!qa{!qa!X!qa!f!qa!x!qa#g!qa%[!qa%_!qa%j!qa%k!qa%l!qa%m!qa%n!qa%o!qa%p!qa%q!qa%r!qa%s!qa%z!qag!qa!T!qa!U!qa%{!qa!W!qa![!qa!Q!qa#[!qat!qa!m!qa~P#yOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P%SOV&OOopOvqO{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~P'vOz%|O{%ha!x%ha#g%ha%[%ha%_%ha%z%ha~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO#g$zX%[$zX%_$zX~P'vO#g#gO%[&TO%_&TO~O!f&UOh&sX%[&sXz&sX#[&sX#g&sX%_&sX#Z&sXg&sX~Oh!iO%[&WO~Okealeameaneaoeapeaseazea{ea!xea#gea%[ea%_ea%zeagea!Tea!Uea%{ea!Wea![ea!Qea#[eatea!mea~P%SOsqazqa{qa#gqa%[qa%_qa%zqa~Ok!pOl!qOm!oOn!oOo!rOp!sO!xqa~PEcO%z&YOz%yX{%yX~O%uWOz%yX{%yX~Oz&]O{wX~O{&_O~Oz%lO#g%}X%[%}X%_%}Xg%}X{%}X![%}X!m%}X%z%}X~OV0lOo0cOv0qO!PrO~P'vO%z#|O#gUa%[Ua%_Ua~Oz&hO#g&PX%[&PX%_&PXn&PX~P%SOz&kO!Q&jO#g#Wa%[#Wa%_#Wa~Oz&lO#[&nO#g&rX%[&rX%_&rXg&rX~O!f$YO!r$YO#Z&qO%uWO~O#Z&qO~Oz&sO#g&tX%[&tX%_&tX~Oz&uO#g&pX%[&pX%_&pX{&pX~O!X&wO%z&xO~Oz&|On&wX~P%SOn'PO~OPdOVaOopOvqO!PrO!Q{O!{tO!}uO#PvO#RwO#TxO#XyO#ZzO#^|O#_|O#a}O#c!OO%['UO~P'vOt'YO#p'WO#q'XOP#naV#naf#nah#nao#nas#nav#na!P#na!Q#na!T#na!U#na!X#na!]#na!h#na!r#na!s#na!t#na!{#na!}#na#P#na#R#na#T#na#X#na#Z#na#^#na#_#na#a#na#c#na#l#na#o#na#s#na#u#na#z#na#}#na$P#na%X#na%o#na%p#na%t#na%u#na&Z#na&[#na&]#na&^#na&_#na&`#na&a#na&b#na&c#na&d#na&e#na&f#na&g#na&h#na&i#na&j#na%Z#na%_#na~Oz'ZO#[']O{&xX~Oh'_O!X&wO~Oh!iO{$jO!X&wO~O{'eO~P%SO%['hO%_'hO~OS'iO%['hO%_'hO~OV!aO_!aOa!bOh!iO!X!kO!f!mO%l!^O%m!_O%n!_O%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%k!]O~P!#uO%kWi~P!#uOV!aO_!aOa!bOh!iO!X!kO!f!mO%o!`O%p!`O%q!aO%r!aO%s!aOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~O%m!_O%n!_O~P!&pO%mWi%nWi~P!&pOa!bOh!iO!X!kO!f!mOkWilWimWinWioWipWisWizWi{Wi!xWi#gWi%[Wi%_Wi%jWi%kWi%lWi%mWi%nWi%oWi%pWi%zWigWi!TWi!UWi%{Wi!WWi![Wi!QWi#[WitWi!mWi~OV!aO_!aO%q!aO%r!aO%s!aO~P!)nOVWi_Wi%qWi%rWi%sWi~P!)nO!T%dO!U%cOg&VXz&VX~O%z'kO%{'kO~P,eOz'mOg&UX~Og'oO~Oz'pO{'rO!W&XX~Oo0cOv0qOz'pO{'sO!W&XX~P'vO!W'uO~Om!oOn!oOo!rOp!sOkjisjizji{ji!xji#gji%[ji%_ji%zji~Ol!qO~P!.aOlji~P!.aOk0eOl0fOm0dOn0dOo0mOp0nO~Ot'wO~P!/jOV'|Og'}Oo0cOv0qO~P'vOg'}Oz(OO~Og(QO~O!U(SO~Og(TOz(OO!T%dO!U%cO~P%SOk0eOl0fOm0dOn0dOo0mOp0nOgqa!Tqa!Uqa%{qa!Wqa![qa!Qqa#[qatqa!mqa~PEcOV'|Oo0cOv0qO!W&Sa~P'vOz(WO!W&Sa~O!W(XO~Oz(WO!T%dO!U%cO!W&Sa~P%SOV(]Oo0cOv0qO![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~P'vOz(^O![%}a#g%}a%[%}a%_%}ag%}a{%}a!m%}a%z%}a~O![(aO~Oz(^O!T%dO!U%cO![%}a~P%SOz(dO!T%dO!U%cO![&Ta~P%SOz(gO{&lX![&lX!m&lX%z&lX~O{(kO![(mO!m(nO%z(jO~OV&OOopOvqO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~P'vOz(pO{%hi!x%hi#g%hi%[%hi%_%hi%z%hi~O!f&UOh&sa%[&saz&sa#[&sa#g&sa%_&sa#Z&sag&sa~O%[(uO~OV#sOa#tO%uWO~Oz&]O{wa~OopOvqO~P'vOz(^O#g%}a%[%}a%_%}ag%}a{%}a![%}a!m%}a%z%}a~P%SOz(zO#g%hX%[%hX%_%hX%z%hX~O%z#|O#gUi%[Ui%_Ui~O#g&Pa%[&Pa%_&Pan&Pa~P'vOz(}O#g&Pa%[&Pa%_&Pan&Pa~O%uWO#g&ra%[&ra%_&rag&ra~Oz)SO#g&ra%[&ra%_&rag&ra~Og)VO~OV)WOh$WO%uWO~O#Z)XO~O%uWO#g&ta%[&ta%_&ta~Oz)ZO#g&ta%[&ta%_&ta~Oo0cOv0qO#g&pa%[&pa%_&pa{&pa~P'vOz)^O#g&pa%[&pa%_&pa{&pa~OV)`Oa)`O%uWO~O%z)eO~Ot)hO#j)gOP#hiV#hif#hih#hio#his#hiv#hi!P#hi!Q#hi!T#hi!U#hi!X#hi!]#hi!h#hi!r#hi!s#hi!t#hi!{#hi!}#hi#P#hi#R#hi#T#hi#X#hi#Z#hi#^#hi#_#hi#a#hi#c#hi#l#hi#o#hi#s#hi#u#hi#z#hi#}#hi$P#hi%X#hi%o#hi%p#hi%t#hi%u#hi&Z#hi&[#hi&]#hi&^#hi&_#hi&`#hi&a#hi&b#hi&c#hi&d#hi&e#hi&f#hi&g#hi&h#hi&i#hi&j#hi%Z#hi%_#hi~Ot)iOP#kiV#kif#kih#kio#kis#kiv#ki!P#ki!Q#ki!T#ki!U#ki!X#ki!]#ki!h#ki!r#ki!s#ki!t#ki!{#ki!}#ki#P#ki#R#ki#T#ki#X#ki#Z#ki#^#ki#_#ki#a#ki#c#ki#l#ki#o#ki#s#ki#u#ki#z#ki#}#ki$P#ki%X#ki%o#ki%p#ki%t#ki%u#ki&Z#ki&[#ki&]#ki&^#ki&_#ki&`#ki&a#ki&b#ki&c#ki&d#ki&e#ki&f#ki&g#ki&h#ki&i#ki&j#ki%Z#ki%_#ki~OV)kOn&wa~P'vOz)lOn&wa~Oz)lOn&wa~P%SOn)pO~O%Y)tO~Ot)wO#p'WO#q)vOP#niV#nif#nih#nio#nis#niv#ni!P#ni!Q#ni!T#ni!U#ni!X#ni!]#ni!h#ni!r#ni!s#ni!t#ni!{#ni!}#ni#P#ni#R#ni#T#ni#X#ni#Z#ni#^#ni#_#ni#a#ni#c#ni#l#ni#o#ni#s#ni#u#ni#z#ni#}#ni$P#ni%X#ni%o#ni%p#ni%t#ni%u#ni&Z#ni&[#ni&]#ni&^#ni&_#ni&`#ni&a#ni&b#ni&c#ni&d#ni&e#ni&f#ni&g#ni&h#ni&i#ni&j#ni%Z#ni%_#ni~OV)zOo0cOv0qO{$jO~P'vOo0cOv0qO{&xa~P'vOz*OO{&xa~OV*SOa*TOg*WO%q*UO%uWO~O{$jO&{*YO~Oh'_O~Oh!iO{$jO~O%[*_O~O%[*aO%_*aO~OV$}Oa$}Oo0cOv0qOg&Ua~P'vOz*dOg&Ua~Oo0cOv0qO{*gO!W&Xa~P'vOz*hO!W&Xa~Oo0cOv0qOz*hO{*kO!W&Xa~P'vOo0cOv0qOz*hO!W&Xa~P'vOz*hO{*kO!W&Xa~Om0dOn0dOo0mOp0nOgjikjisjizji!Tji!Uji%{ji!Wji{ji![ji#gji%[ji%_ji!Qji#[jitji!mji%zji~Ol0fO~P!NkOlji~P!NkOV'|Og*pOo0cOv0qO~P'vOn*rO~Og*pOz*tO~Og*uO~OV'|Oo0cOv0qO!W&Si~P'vOz*vO!W&Si~O!W*wO~OV(]Oo0cOv0qO![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~P'vOz*zO!T%dO!U%cO![&Ti~Oz*}O![%}i#g%}i%[%}i%_%}ig%}i{%}i!m%}i%z%}i~O![+OO~Oa+QOo0cOv0qO![&Ti~P'vOz*zO![&Ti~O![+SO~OV+UOo0cOv0qO{&la![&la!m&la%z&la~P'vOz+VO{&la![&la!m&la%z&la~O!]+YO&n+[O![!nX~O![+^O~O{(kO![+_O~O{(kO![+_O!m+`O~OV&OOopOvqO{%hq!x%hq#g%hq%[%hq%_%hq%z%hq~P'vOz$ri{$ri!x$ri#g$ri%[$ri%_$ri%z$ri~P%SOV&OOopOvqO~P'vOV&OOo0cOv0qO#g%ha%[%ha%_%ha%z%ha~P'vOz+aO#g%ha%[%ha%_%ha%z%ha~Oz$ia#g$ia%[$ia%_$ian$ia~P%SO#g&Pi%[&Pi%_&Pin&Pi~P'vOz+dO#g#Wq%[#Wq%_#Wq~O#[+eOz$va#g$va%[$va%_$vag$va~O%uWO#g&ri%[&ri%_&rig&ri~Oz+gO#g&ri%[&ri%_&rig&ri~OV+iOh$WO%uWO~O%uWO#g&ti%[&ti%_&ti~Oo0cOv0qO#g&pi%[&pi%_&pi{&pi~P'vO{#{Oz#eX!W#eX~Oz+mO!W&uX~O!W+oO~Ot+rO#j)gOP#hqV#hqf#hqh#hqo#hqs#hqv#hq!P#hq!Q#hq!T#hq!U#hq!X#hq!]#hq!h#hq!r#hq!s#hq!t#hq!{#hq!}#hq#P#hq#R#hq#T#hq#X#hq#Z#hq#^#hq#_#hq#a#hq#c#hq#l#hq#o#hq#s#hq#u#hq#z#hq#}#hq$P#hq%X#hq%o#hq%p#hq%t#hq%u#hq&Z#hq&[#hq&]#hq&^#hq&_#hq&`#hq&a#hq&b#hq&c#hq&d#hq&e#hq&f#hq&g#hq&h#hq&i#hq&j#hq%Z#hq%_#hq~On$|az$|a~P%SOV)kOn&wi~P'vOz+yOn&wi~Oz,TO{$jO#[,TO~O#q,VOP#nqV#nqf#nqh#nqo#nqs#nqv#nq!P#nq!Q#nq!T#nq!U#nq!X#nq!]#nq!h#nq!r#nq!s#nq!t#nq!{#nq!}#nq#P#nq#R#nq#T#nq#X#nq#Z#nq#^#nq#_#nq#a#nq#c#nq#l#nq#o#nq#s#nq#u#nq#z#nq#}#nq$P#nq%X#nq%o#nq%p#nq%t#nq%u#nq&Z#nq&[#nq&]#nq&^#nq&_#nq&`#nq&a#nq&b#nq&c#nq&d#nq&e#nq&f#nq&g#nq&h#nq&i#nq&j#nq%Z#nq%_#nq~O#[,WOz%Oa{%Oa~Oo0cOv0qO{&xi~P'vOz,YO{&xi~O{#{O%z,[Og&zXz&zX~O%uWOg&zXz&zX~Oz,`Og&yX~Og,bO~O%Y,eO~O!T%dO!U%cOg&Viz&Vi~OV$}Oa$}Oo0cOv0qOg&Ui~P'vO{,hOz$la!W$la~Oo0cOv0qO{,iOz$la!W$la~P'vOo0cOv0qO{*gO!W&Xi~P'vOz,lO!W&Xi~Oo0cOv0qOz,lO!W&Xi~P'vOz,lO{,oO!W&Xi~Og$hiz$hi!W$hi~P%SOV'|Oo0cOv0qO~P'vOn,qO~OV'|Og,rOo0cOv0qO~P'vOV'|Oo0cOv0qO!W&Sq~P'vOz$gi![$gi#g$gi%[$gi%_$gig$gi{$gi!m$gi%z$gi~P%SOV(]Oo0cOv0qO~P'vOa+QOo0cOv0qO![&Tq~P'vOz,sO![&Tq~O![,tO~OV(]Oo0cOv0qO![%}q#g%}q%[%}q%_%}qg%}q{%}q!m%}q%z%}q~P'vO{,uO~OV+UOo0cOv0qO{&li![&li!m&li%z&li~P'vOz,zO{&li![&li!m&li%z&li~O!]+YO&n+[O![!na~O{(kO![,}O~OV&OOo0cOv0qO#g%hi%[%hi%_%hi%z%hi~P'vOz-OO#g%hi%[%hi%_%hi%z%hi~O%uWO#g&rq%[&rq%_&rqg&rq~Oz-RO#g&rq%[&rq%_&rqg&rq~OV)`Oa)`O%uWO!W&ua~Oz-TO!W&ua~On$|iz$|i~P%SOV)kO~P'vOV)kOn&wq~P'vOt-XOP#myV#myf#myh#myo#mys#myv#my!P#my!Q#my!T#my!U#my!X#my!]#my!h#my!r#my!s#my!t#my!{#my!}#my#P#my#R#my#T#my#X#my#Z#my#^#my#_#my#a#my#c#my#l#my#o#my#s#my#u#my#z#my#}#my$P#my%X#my%o#my%p#my%t#my%u#my&Z#my&[#my&]#my&^#my&_#my&`#my&a#my&b#my&c#my&d#my&e#my&f#my&g#my&h#my&i#my&j#my%Z#my%_#my~O%Z-]O%_-]O~P`O#q-^OP#nyV#nyf#nyh#nyo#nys#nyv#ny!P#ny!Q#ny!T#ny!U#ny!X#ny!]#ny!h#ny!r#ny!s#ny!t#ny!{#ny!}#ny#P#ny#R#ny#T#ny#X#ny#Z#ny#^#ny#_#ny#a#ny#c#ny#l#ny#o#ny#s#ny#u#ny#z#ny#}#ny$P#ny%X#ny%o#ny%p#ny%t#ny%u#ny&Z#ny&[#ny&]#ny&^#ny&_#ny&`#ny&a#ny&b#ny&c#ny&d#ny&e#ny&f#ny&g#ny&h#ny&i#ny&j#ny%Z#ny%_#ny~Oz-aO{$jO#[-aO~Oo0cOv0qO{&xq~P'vOz-dO{&xq~O%z,[Og&zaz&za~O{#{Og&zaz&za~OV*SOa*TO%q*UO%uWOg&ya~Oz-hOg&ya~O$S-lO~OV$}Oa$}Oo0cOv0qO~P'vOo0cOv0qO{-mOz$li!W$li~P'vOo0cOv0qOz$li!W$li~P'vO{-mOz$li!W$li~Oo0cOv0qO{*gO~P'vOo0cOv0qO{*gO!W&Xq~P'vOz-pO!W&Xq~Oo0cOv0qOz-pO!W&Xq~P'vOs-sO!T%dO!U%cOg&Oq!W&Oq![&Oqz&Oq~P!/jOa+QOo0cOv0qO![&Ty~P'vOz$ji![$ji~P%SOa+QOo0cOv0qO~P'vOV+UOo0cOv0qO~P'vOV+UOo0cOv0qO{&lq![&lq!m&lq%z&lq~P'vO{(kO![-xO!m-yO%z-wO~OV&OOo0cOv0qO#g%hq%[%hq%_%hq%z%hq~P'vO%uWO#g&ry%[&ry%_&ryg&ry~OV)`Oa)`O%uWO!W&ui~Ot-}OP#m!RV#m!Rf#m!Rh#m!Ro#m!Rs#m!Rv#m!R!P#m!R!Q#m!R!T#m!R!U#m!R!X#m!R!]#m!R!h#m!R!r#m!R!s#m!R!t#m!R!{#m!R!}#m!R#P#m!R#R#m!R#T#m!R#X#m!R#Z#m!R#^#m!R#_#m!R#a#m!R#c#m!R#l#m!R#o#m!R#s#m!R#u#m!R#z#m!R#}#m!R$P#m!R%X#m!R%o#m!R%p#m!R%t#m!R%u#m!R&Z#m!R&[#m!R&]#m!R&^#m!R&_#m!R&`#m!R&a#m!R&b#m!R&c#m!R&d#m!R&e#m!R&f#m!R&g#m!R&h#m!R&i#m!R&j#m!R%Z#m!R%_#m!R~Oo0cOv0qO{&xy~P'vOV*SOa*TO%q*UO%uWOg&yi~O$S-lO%Z.VO%_.VO~OV.aOh._O!X.^O!].`O!h.YO!s.[O!t.[O%p.XO%uWO&Z]O&[]O&]]O&^]O&_]O&`]O&a]O&b]O~Oo0cOv0qOz$lq!W$lq~P'vO{.fOz$lq!W$lq~Oo0cOv0qO{*gO!W&Xy~P'vOz.gO!W&Xy~Oo0cOv.kO~P'vOs-sO!T%dO!U%cOg&Oy!W&Oy![&Oyz&Oy~P!/jO{(kO![.nO~O{(kO![.nO!m.oO~OV*SOa*TO%q*UO%uWO~Oh.tO!f.rOz$TX#[$TX%j$TXg$TX~Os$TX{$TX!W$TX![$TX~P$-bO%o.vO%p.vOs$UXz$UX{$UX#[$UX%j$UX!W$UXg$UX![$UX~O!h.xO~Oz.|O#[/OO%j.yOs&|X{&|X!W&|Xg&|X~Oa/RO~P$)zOh.tOs&}Xz&}X{&}X#[&}X%j&}X!W&}Xg&}X![&}X~Os/VO{$jO~Oo0cOv0qOz$ly!W$ly~P'vOo0cOv0qO{*gO!W&X!R~P'vOz/ZO!W&X!R~Og&RXs&RX!T&RX!U&RX!W&RX![&RXz&RX~P!/jOs-sO!T%dO!U%cOg&Qa!W&Qa![&Qaz&Qa~O{(kO![/^O~O!f.rOh$[as$[az$[a{$[a#[$[a%j$[a!W$[ag$[a![$[a~O!h/eO~O%o.vO%p.vOs$Uaz$Ua{$Ua#[$Ua%j$Ua!W$Uag$Ua![$Ua~O%j.yOs$Yaz$Ya{$Ya#[$Ya!W$Yag$Ya![$Ya~Os&|a{&|a!W&|ag&|a~P$)nOz/jOs&|a{&|a!W&|ag&|a~O!W/mO~Og/mO~O{/oO~O![/pO~Oo0cOv0qO{*gO!W&X!Z~P'vO{/sO~O%z/tO~P$-bOz/uO#[/OO%j.yOg'PX~Oz/uOg'PX~Og/wO~O!h/xO~O#[/OOs%Saz%Sa{%Sa%j%Sa!W%Sag%Sa![%Sa~O#[/OO%j.yOs%Waz%Wa{%Wa!W%Wag%Wa~Os&|i{&|i!W&|ig&|i~P$)nOz/zO#[/OO%j.yO!['Oa~Og'Pa~P$)nOz0SOg'Pa~Oa0UO!['Oi~P$)zOz0WO!['Oi~Oz0WO#[/OO%j.yO!['Oi~O#[/OO%j.yOg$biz$bi~O%z0ZO~P$-bO#[/OO%j.yOg%Vaz%Va~Og'Pi~P$)nO{0^O~Oa0UO!['Oq~P$)zOz0`O!['Oq~O#[/OO%j.yOz%Ui![%Ui~Oa0UO~P$)zOa0UO!['Oy~P$)zO#[/OO%j.yOg$ciz$ci~O#[/OO%j.yOz%Uq![%Uq~Oz+aO#g%ha%[%ha%_%ha%z%ha~P%SOV&OOo0cOv0qO~P'vOn0hO~Oo0hO~P'vO{0iO~Ot0jO~P!/jO&]&Z&j&h&i&g&f&d&e&c&b&`&a&_&^&[%u~",goto:"!=j'QPPPPPP'RP'Z*s+[+t,_,y-fP.SP'Z.r.r'ZPPP'Z2[PPPPPP2[5PPP5PP7b7k=sPP=v>h>kPP'Z'ZPP>zPP'Z'ZPP'Z'Z'Z'Z'Z?O?w'ZP?zP@QDXGuGyPG|HWH['ZPPPH_Hk'RP'R'RP'RP'RP'RP'RP'R'R'RP'RPP'RPP'RP'RPHqH}IVPI^IdPI^PI^I^PPPI^PKrPK{LVL]KrPI^LfPI^PLmLsPLwM]MzNeLwLwNkNxLwLwLwLw! ^! d! g! l! o! y!!P!!]!!o!!u!#P!#V!#s!#y!$P!$Z!$a!$g!$y!%T!%Z!%a!%k!%q!%w!%}!&T!&Z!&e!&k!&u!&{!'U!'[!'k!'s!'}!(UPPPPPPPPPPP!([!(_!(e!(n!(x!)TPPPPPPPPPPPP!-u!/Z!3^!6oPP!6w!7W!7a!8Y!8P!8c!8i!8l!8o!8r!8z!9jPPPPPPPPPPPPPPPPP!9m!9q!9wP!:]!:a!:m!:v!;S!;j!;m!;p!;v!;|!_![!]Do!]!^Es!^!_FZ!_!`Gk!`!aHX!a!b%T!b!cIf!c!dJU!d!eK^!e!hJU!h!i!#f!i!tJU!t!u!,|!u!wJU!w!x!.t!x!}JU!}#O!0S#O#P&o#P#Q!0j#Q#R!1Q#R#SJU#S#T%T#T#UJU#U#VK^#V#YJU#Y#Z!#f#Z#fJU#f#g!,|#g#iJU#i#j!.t#j#oJU#o#p!1n#p#q!1s#q#r!2a#r#s!2f#s$g%T$g;'SJU;'S;=`KW<%lOJU`%YT&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T`%lP;=`<%l%To%v]&n`%c_OX%TXY%oY[%T[]%o]p%Tpq%oq#O%T#O#P&o#P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To&tX&n`OY%TYZ%oZ]%T]^%o^#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc'f[&n`O!_%T!_!`([!`#T%T#T#U(r#U#f%T#f#g(r#g#h(r#h#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(cTmR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc(yT!mR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk)aV&n`&[ZOr%Trs)vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk){V&n`Or%Trs*bs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk*iT&n`&^ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To+PZS_&n`OY*xYZ%TZ]*x]^%T^#o*x#o#p+r#p#q*x#q#r+r#r;'S*x;'S;=`,^<%lO*x_+wTS_OY+rZ]+r^;'S+r;'S;=`,W<%lO+r_,ZP;=`<%l+ro,aP;=`<%l*xj,kV%rQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-XT!xY&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj-oV%lQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.]V&n`&ZZOw%Twx.rx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk.wV&n`Ow%Twx/^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/eT&n`&]ZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk/{ThZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc0cTgR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk0yXVZ&n`Oz%Tz{1f{!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk1mVaR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk2ZV%oZ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc2wTzR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To3_W%pZ&n`O!_%T!_!`-Q!`!a3w!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Td4OT&{S&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk4fX!fQ&n`O!O%T!O!P5R!P!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5WV&n`O!O%T!O!P5m!P#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk5tT!rZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti6[a!hX&n`O!Q%T!Q![6T![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S6T#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti7fZ&n`O{%T{|8X|}%T}!O8X!O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8^V&n`O!Q%T!Q![8s![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti8z]!hX&n`O!Q%T!Q![8s![!l%T!l!m9s!m#R%T#R#S8s#S#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti9zT!hX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk:bX%qR&n`O!P%T!P!Q:}!Q!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj;UV%sQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti;ro!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!d%T!d!e?q!e!g%T!g!h7a!h!l%T!l!m9s!m!q%T!q!rA]!r!z%T!z!{Bq!{#R%T#R#S>_#S#U%T#U#V?q#V#X%T#X#Y7a#Y#^%T#^#_9s#_#c%T#c#dA]#d#l%T#l#mBq#m#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti=xV&n`O!Q%T!Q![6T![#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti>fc!hX&n`O!O%T!O!P=s!P!Q%T!Q![>_![!g%T!g!h7a!h!l%T!l!m9s!m#R%T#R#S>_#S#X%T#X#Y7a#Y#^%T#^#_9s#_#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti?vY&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Ti@mY!hX&n`O!Q%T!Q!R@f!R!S@f!S#R%T#R#S@f#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiAbX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBUX!hX&n`O!Q%T!Q!YA}!Y#R%T#R#SA}#S#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiBv]&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TiCv]!hX&n`O!Q%T!Q![Co![!c%T!c!iCo!i#R%T#R#SCo#S#T%T#T#ZCo#Z#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToDvV{_&n`O!_%T!_!`E]!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TcEdT%{R&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkEzT#gZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkFbXmR&n`O!^%T!^!_F}!_!`([!`!a([!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjGUV%mQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkGrV%zZ&n`O!_%T!_!`([!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkH`WmR&n`O!_%T!_!`([!`!aHx!a#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TjIPV%nQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkIoV_Q#}P&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%ToJ_]&n`&YS%uZO!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoKZP;=`<%lJUoKge&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!tJU!t!uLx!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#gLx#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUoMRa&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUkN_V&n`&`ZOr%TrsNts#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%TkNyV&n`Or%Trs! `s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! gT&n`&bZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk! }V&n`&_ZOw%Twx!!dx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!!iV&n`Ow%Twx!#Ox#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!#VT&n`&aZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!#oe&n`&YS%uZOr%Trs!%Qsw%Twx!&px!Q%T!Q![JU![!c%T!c!tJU!t!u!(`!u!}JU!}#R%T#R#SJU#S#T%T#T#fJU#f#g!(`#g#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!%XV&n`&dZOr%Trs!%ns#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!%sV&n`Or%Trs!&Ys#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&aT&n`&fZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!&wV&n`&cZOw%Twx!'^x#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!'cV&n`Ow%Twx!'xx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!(PT&n`&eZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!(ia&n`&YS%uZOr%Trs!)nsw%Twx!+^x!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!)uV&n`&hZOr%Trs!*[s#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*aV&n`Or%Trs!*vs#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!*}T&n`&jZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!+eV&n`&gZOw%Twx!+zx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,PV&n`Ow%Twx!,fx#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tk!,mT&n`&iZO#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%To!-Vi&n`&YS%uZOr%TrsNWsw%Twx! vx!Q%T!Q![JU![!c%T!c!dJU!d!eLx!e!hJU!h!i!(`!i!}JU!}#R%T#R#SJU#S#T%T#T#UJU#U#VLx#V#YJU#Y#Z!(`#Z#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUo!.}a&n`&YS%uZOr%Trs)Ysw%Twx.Ux!Q%T!Q![JU![!c%T!c!}JU!}#R%T#R#SJU#S#T%T#T#oJU#p#q%T#r$g%T$g;'SJU;'S;=`KW<%lOJUk!0ZT!XZ&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tc!0qT!WR&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%Tj!1XV%kQ&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!1sO!]~k!1zV%jR&n`O!_%T!_!`-Q!`#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T~!2fO![~i!2mT%tX&n`O#o%T#p#q%T#r;'S%T;'S;=`%i<%lO%T",tokenizers:[le,te,Qe,Te,0,1,2,3,4],topRules:{Script:[0,5]},specialized:[{term:221,get:O=>qe[O]||-1}],tokenPrec:7668}),G=new aO,A=new Set(["Script","Body","FunctionDefinition","ClassDefinition","LambdaExpression","ForStatement","MatchClause"]);function m(O){return(e,i,a)=>{if(a)return!1;let r=e.node.getChild("VariableName");return r&&i(r,O),!0}}const me={FunctionDefinition:m("function"),ClassDefinition:m("class"),ForStatement(O,e,i){if(i){for(let a=O.node.firstChild;a;a=a.nextSibling)if(a.name=="VariableName")e(a,"variable");else if(a.name=="in")break}},ImportStatement(O,e){var i,a;let{node:r}=O,Q=((i=r.firstChild)===null||i===void 0?void 0:i.name)=="from";for(let t=r.getChild("import");t;t=t.nextSibling)t.name=="VariableName"&&((a=t.nextSibling)===null||a===void 0?void 0:a.name)!="as"&&e(t,Q?"variable":"namespace")},AssignStatement(O,e){for(let i=O.node.firstChild;i;i=i.nextSibling)if(i.name=="VariableName")e(i,"variable");else if(i.name==":"||i.name=="AssignOp")break},ParamList(O,e){for(let i=null,a=O.node.firstChild;a;a=a.nextSibling)a.name=="VariableName"&&(!i||!/\*|AssignOp/.test(i.name))&&e(a,"variable"),i=a},CapturePattern:m("variable"),AsPattern:m("variable"),__proto__:null};function I(O,e){let i=G.get(e);if(i)return i;let a=[],r=!0;function Q(t,o){let g=O.sliceString(t.from,t.to);a.push({label:g,type:o})}return e.cursor(nO.IncludeAnonymous).iterate(t=>{if(t.name){let o=me[t.name];if(o&&o(t,Q,r)||!r&&A.has(t.name))return!1;r=!1}else if(t.to-t.from>8192){for(let o of I(O,t.node))a.push(o);return!1}}),G.set(e,a),a}const w=/^[\w\xa1-\uffff][\w\d\xa1-\uffff]*$/,N=["String","FormatString","Comment","PropertyName"];function Pe(O){let e=iO(O.state).resolveInner(O.pos,-1);if(N.indexOf(e.name)>-1)return null;let i=e.name=="VariableName"||e.to-e.from<20&&w.test(O.state.sliceDoc(e.from,e.to));if(!i&&!O.explicit)return null;let a=[];for(let r=e;r;r=r.parent)A.has(r.name)&&(a=a.concat(I(O.state.doc,r)));return{options:a,from:i?e.from:O.pos,validFor:w}}const $e=["__annotations__","__builtins__","__debug__","__doc__","__import__","__name__","__loader__","__package__","__spec__","False","None","True"].map(O=>({label:O,type:"constant"})).concat(["ArithmeticError","AssertionError","AttributeError","BaseException","BlockingIOError","BrokenPipeError","BufferError","BytesWarning","ChildProcessError","ConnectionAbortedError","ConnectionError","ConnectionRefusedError","ConnectionResetError","DeprecationWarning","EOFError","Ellipsis","EncodingWarning","EnvironmentError","Exception","FileExistsError","FileNotFoundError","FloatingPointError","FutureWarning","GeneratorExit","IOError","ImportError","ImportWarning","IndentationError","IndexError","InterruptedError","IsADirectoryError","KeyError","KeyboardInterrupt","LookupError","MemoryError","ModuleNotFoundError","NameError","NotADirectoryError","NotImplemented","NotImplementedError","OSError","OverflowError","PendingDeprecationWarning","PermissionError","ProcessLookupError","RecursionError","ReferenceError","ResourceWarning","RuntimeError","RuntimeWarning","StopAsyncIteration","StopIteration","SyntaxError","SyntaxWarning","SystemError","SystemExit","TabError","TimeoutError","TypeError","UnboundLocalError","UnicodeDecodeError","UnicodeEncodeError","UnicodeError","UnicodeTranslateError","UnicodeWarning","UserWarning","ValueError","Warning","ZeroDivisionError"].map(O=>({label:O,type:"type"}))).concat(["bool","bytearray","bytes","classmethod","complex","float","frozenset","int","list","map","memoryview","object","range","set","staticmethod","str","super","tuple","type"].map(O=>({label:O,type:"class"}))).concat(["abs","aiter","all","anext","any","ascii","bin","breakpoint","callable","chr","compile","delattr","dict","dir","divmod","enumerate","eval","exec","exit","filter","format","getattr","globals","hasattr","hash","help","hex","id","input","isinstance","issubclass","iter","len","license","locals","max","min","next","oct","open","ord","pow","print","property","quit","repr","reversed","round","setattr","slice","sorted","sum","vars","zip"].map(O=>({label:O,type:"function"}))),he=[d("def ${name}(${params}):\n ${}",{label:"def",detail:"function",type:"keyword"}),d("for ${name} in ${collection}:\n ${}",{label:"for",detail:"loop",type:"keyword"}),d("while ${}:\n ${}",{label:"while",detail:"loop",type:"keyword"}),d("try:\n ${}\nexcept ${error}:\n ${}",{label:"try",detail:"/ except block",type:"keyword"}),d(`if \${}: `,{label:"if",detail:"block",type:"keyword"}),d("if ${}:\n ${}\nelse:\n ${}",{label:"if",detail:"/ else block",type:"keyword"}),d("class ${name}:\n def __init__(self, ${params}):\n ${}",{label:"class",detail:"definition",type:"keyword"}),d("import ${module}",{label:"import",detail:"statement",type:"keyword"}),d("from ${module} import ${names}",{label:"from",detail:"import",type:"keyword"})],ce=rO(N,QO($e.concat(he)));function z(O){let{node:e,pos:i}=O,a=O.lineIndent(i,-1),r=null;for(;;){let Q=e.childBefore(i);if(Q)if(Q.name=="Comment")i=Q.from;else if(Q.name=="Body"||Q.name=="MatchBody")O.baseIndentFor(Q)+O.unit<=a&&(r=Q),e=Q;else if(Q.name=="MatchClause")e=Q;else if(Q.type.is("Statement"))e=Q;else break;else break}return r}function W(O,e){let i=O.baseIndentFor(e),a=O.lineAt(O.pos,-1),r=a.from+a.text.length;return/^\s*($|#)/.test(a.text)&&O.node.toi?null:i+O.unit}const v=K.define({name:"python",parser:ge.configure({props:[M.add({Body:O=>{var e;let i=/^\s*(#|$)/.test(O.textAfter)&&z(O)||O.node;return(e=W(O,i))!==null&&e!==void 0?e:O.continue()},MatchBody:O=>{var e;let i=z(O);return(e=W(O,i||O.node))!==null&&e!==void 0?e:O.continue()},IfStatement:O=>/^\s*(else:|elif )/.test(O.textAfter)?O.baseIndent:O.continue(),"ForStatement WhileStatement":O=>/^\s*else:/.test(O.textAfter)?O.baseIndent:O.continue(),TryStatement:O=>/^\s*(except[ :]|finally:|else:)/.test(O.textAfter)?O.baseIndent:O.continue(),MatchStatement:O=>/^\s*case /.test(O.textAfter)?O.baseIndent+O.unit:O.continue(),"TupleExpression ComprehensionExpression ParamList ArgList ParenthesizedExpression":f({closing:")"}),"DictionaryExpression DictionaryComprehensionExpression SetExpression SetComprehensionExpression":f({closing:"}"}),"ArrayExpression ArrayComprehensionExpression":f({closing:"]"}),MemberExpression:O=>O.baseIndent+O.unit,"String FormatString":()=>null,Script:O=>{var e;let i=z(O);return(e=i&&W(O,i))!==null&&e!==void 0?e:O.continue()}}),OO.add({"ArrayExpression DictionaryExpression SetExpression TupleExpression":eO,Body:(O,e)=>({from:O.from+1,to:O.to-(O.to==e.doc.length?0:1)}),"String FormatString":(O,e)=>({from:e.doc.lineAt(O.from).to,to:O.to})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"'''",'"""'],stringPrefixes:["f","fr","rf","r","u","b","br","rb","F","FR","RF","R","U","B","BR","RB"]},commentTokens:{line:"#"},indentOnInput:/^\s*([\}\]\)]|else:|elif |except |finally:|case\s+[^:]*:?)$/}});function xe(){return new B(v,[v.data.of({autocomplete:Pe}),v.data.of({autocomplete:ce})])}export{ce as globalCompletion,Pe as localCompletionSource,xe as python,v as pythonLanguage}; diff --git a/internal/relay/web-dist/assets/index-BEPhTiWa.js b/internal/relay/web-dist/assets/index-DL67eyEa.js similarity index 99% rename from internal/relay/web-dist/assets/index-BEPhTiWa.js rename to internal/relay/web-dist/assets/index-DL67eyEa.js index 42570501..d7fce1a6 100644 --- a/internal/relay/web-dist/assets/index-BEPhTiWa.js +++ b/internal/relay/web-dist/assets/index-DL67eyEa.js @@ -1 +1 @@ -import{L as V,E as X}from"./index-q_Op_mkr.js";import{J as d,Q as $,g as Z,H as R,L as s,z as t,r as c,u as y,x as U,w as l}from"./FileExplorer-BGCt84ef.js";import{html as w}from"./index-CsH7OxDu.js";import"./useI18n-CnvN0FfF.js";import"./index-BH9vIdLD.js";import"./prefsSync-D8z1rJ8H.js";import"./client-2UEf7AK8.js";import"./Switch-CpxGRRqY.js";import"./auth-Dhl8fEWW.js";import"./index-BSlQSXjR.js";import"./index-CZ0p1U99.js";import"./index-Bc7PlSwi.js";const W=1,p=2,q=275,u=3,b=276,_=277,m=278,f=4,k=5,G=6,x=7,r=8,h=9,v=10,g=11,j=12,E=13,I=14,N=15,L=16,F=17,C=18,H=19,A=20,K=21,D=22,B=23,M=24,J=25,OO=26,$O=27,QO=28,iO=29,aO=30,TO=31,PO=32,XO=33,SO=34,cO=35,eO=36,oO=37,_O=38,rO=39,nO=40,zO=41,YO=42,VO=43,dO=44,ZO=45,RO=46,sO=47,tO=48,yO=49,UO=50,lO=51,wO=52,WO=53,pO=54,qO=55,uO=56,bO=57,mO=58,fO=59,kO=60,GO=61,xO=62,e=63,hO=64,vO=65,gO=66,jO={abstract:f,and:k,array:G,as:x,true:r,false:r,break:h,case:v,catch:g,clone:j,const:E,continue:I,declare:L,default:N,do:F,echo:C,else:H,elseif:A,enddeclare:K,endfor:D,endforeach:B,endif:M,endswitch:J,endwhile:OO,enum:$O,extends:QO,final:iO,finally:aO,fn:TO,for:PO,foreach:XO,from:SO,function:cO,global:eO,goto:oO,if:_O,implements:rO,include:nO,include_once:zO,instanceof:YO,insteadof:VO,interface:dO,list:ZO,match:RO,namespace:sO,new:tO,null:yO,or:UO,print:lO,readonly:wO,require:WO,require_once:pO,return:qO,switch:uO,throw:bO,trait:mO,try:fO,unset:kO,use:GO,var:xO,public:e,private:e,protected:e,while:hO,xor:vO,yield:gO,__proto__:null};function n(O){let Q=jO[O.toLowerCase()];return Q??-1}function z(O){return O==9||O==10||O==13||O==32}function Y(O){return O>=97&&O<=122||O>=65&&O<=90}function T(O){return O==95||O>=128||Y(O)}function o(O){return O>=48&&O<=55||O>=97&&O<=102||O>=65&&O<=70}const EO={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},IO=new X(O=>{if(O.next==40){O.advance();let Q=0;for(;z(O.peek(Q));)Q++;let i="",a;for(;Y(a=O.peek(Q));)i+=String.fromCharCode(a),Q++;for(;z(O.peek(Q));)Q++;O.peek(Q)==41&&EO[i.toLowerCase()]&&O.acceptToken(W)}else if(O.next==60&&O.peek(1)==60&&O.peek(2)==60){for(let a=0;a<3;a++)O.advance();for(;O.next==32||O.next==9;)O.advance();let Q=O.next==39;if(Q&&O.advance(),!T(O.next))return;let i=String.fromCharCode(O.next);for(;O.advance(),!(!T(O.next)&&!(O.next>=48&&O.next<=55));)i+=String.fromCharCode(O.next);if(Q){if(O.next!=39)return;O.advance()}if(O.next!=10&&O.next!=13)return;for(;;){let a=O.next==10||O.next==13;if(O.advance(),O.next<0)return;if(a){for(;O.next==32||O.next==9;)O.advance();let P=!0;for(let S=0;S{O.next<0&&O.acceptToken(m)}),LO=new X((O,Q)=>{O.next==63&&Q.canShift(_)&&O.peek(1)==62&&O.acceptToken(_)});function FO(O){let Q=O.peek(1);if(Q==110||Q==114||Q==116||Q==118||Q==101||Q==102||Q==92||Q==36||Q==34||Q==123)return 2;if(Q>=48&&Q<=55){let i=2,a;for(;i<5&&(a=O.peek(i))>=48&&a<=55;)i++;return i}if(Q==120&&o(O.peek(2)))return o(O.peek(3))?4:3;if(Q==117&&O.peek(2)==123)for(let i=3;;i++){let a=O.peek(i);if(a==125)return i==2?0:i+1;if(!o(a))break}return 0}const CO=new X((O,Q)=>{let i=!1;for(;!(O.next==34||O.next<0||O.next==36&&(T(O.peek(1))||O.peek(1)==123)||O.next==123&&O.peek(1)==36);i=!0){if(O.next==92){let a=FO(O);if(a){if(i)break;return O.acceptToken(u,a)}}else if(!i&&(O.next==91||O.next==45&&O.peek(1)==62&&T(O.peek(2))||O.next==63&&O.peek(1)==45&&O.peek(2)==62&&T(O.peek(3)))&&Q.canShift(b))break;O.advance()}i&&O.acceptToken(q)}),HO=d({"Visibility abstract final static":$.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":$.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":$.controlKeyword,"and or xor yield unset clone instanceof insteadof":$.operatorKeyword,"function fn class trait implements extends const enum global interface use var":$.definitionKeyword,"include include_once require require_once namespace":$.moduleKeyword,"new from echo print array list as":$.keyword,null:$.null,Boolean:$.bool,VariableName:$.variableName,"NamespaceName/...":$.namespace,"NamedType/...":$.typeName,Name:$.name,"CallExpression/Name":$.function($.variableName),"LabelStatement/Name":$.labelName,"MemberExpression/Name":$.propertyName,"MemberExpression/VariableName":$.special($.propertyName),"ScopedExpression/ClassMemberName/Name":$.propertyName,"ScopedExpression/ClassMemberName/VariableName":$.special($.propertyName),"CallExpression/MemberExpression/Name":$.function($.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":$.function($.propertyName),"MethodDeclaration/Name":$.function($.definition($.variableName)),"FunctionDefinition/Name":$.function($.definition($.variableName)),"ClassDeclaration/Name":$.definition($.className),UpdateOp:$.updateOperator,ArithOp:$.arithmeticOperator,"LogicOp IntersectionType/&":$.logicOperator,BitOp:$.bitwiseOperator,CompareOp:$.compareOperator,ControlOp:$.controlOperator,AssignOp:$.definitionOperator,"$ ConcatOp":$.operator,LineComment:$.lineComment,BlockComment:$.blockComment,Integer:$.integer,Float:$.float,String:$.string,ShellExpression:$.special($.string),"=> ->":$.punctuation,"( )":$.paren,"#[ [ ]":$.squareBracket,"${ { }":$.brace,"-> ?->":$.derefOperator,", ; :: : \\":$.separator,"PhpOpen PhpClose":$.processingInstruction}),AO={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},KO=V.deserialize({version:14,states:"%#[Q`OWOOQhQaOOP%oO`OOOOO#t'#Hh'#HhO%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O'[QdO'#EQO+QQdO'#IqO+_QdO'#ERO-RQaO'#EXO/bQ`O'#EUO/gQ`O'#E_O2UQaO'#E_O2]Q`O'#EgO2bQ`O'#EqO-RQaO'#EqO2mQpO'#FOO2rQ`O'#FOOOQS'#Iq'#IqO2wQ`O'#ExOOQS'#Ih'#IhO5SQdO'#IeO9UQeO'#F]O-RQaO'#FlO-RQaO'#FmO-RQaO'#FnO-RQaO'#FoO-RQaO'#FoO-RQaO'#FrOOQO'#Ir'#IrO9cQ`O'#FxOOQO'#Ht'#HtO9kQ`O'#HXO:VQ`O'#FsO:bQ`O'#HfO:mQ`O'#GPO:uQaO'#GQO-RQaO'#G`O-RQaO'#GcO;bOrO'#GfOOQS'#JP'#JPOOQS'#JO'#JOOOQS'#Ie'#IeO/bQ`O'#GmO/bQ`O'#GoO/bQ`O'#GtOhQaO'#GvO;iQ`O'#GwO;nQ`O'#GzO:]Q`O'#G}O;sQeO'#HOO;sQeO'#HPO;sQeO'#HQO;}Q`O'#HROhQ`O'#HVO:]Q`O'#HWO>mQ`O'#HWO;}Q`O'#HXO:]Q`O'#HZO:]Q`O'#H[O:]Q`O'#H]O>rQ`O'#H`O>}Q`O'#HaOQO!$dQ`O,5POOQ#u-E;h-E;hO!1QQ`O,5=tOOO#u,5:_,5:_O!1]O#|O,5:_OOO#u-E;g-E;gOOOO,5>|,5>|OOQ#y1G0T1G0TO!1eQ`O1G0YO-RQaO1G0YO!2wQ`O1G0qOOQS1G0q1G0qOOQS'#Eo'#EoOOQS'#Il'#IlO-RQaO'#IlOOQS1G0r1G0rO!4ZQ`O'#IoO!5pQ`O'#IqO!5}QaO'#EwOOQO'#Io'#IoO!6XQ`O'#InO!6aQ`O,5;aO-RQaO'#FXOOQS'#FW'#FWOOQS1G1[1G1[O!6fQdO1G1dO!8kQdO1G1dO!:WQdO1G1dO!;sQdO1G1dO!=`QdO1G1dO!>{QdO1G1dO!@hQdO1G1dO!BTQdO1G1dO!CpQdO1G1dO!E]QdO1G1dO!FxQdO1G1dO!HeQdO1G1dO!JQQdO1G1dO!KmQdO1G1dO!MYQdO1G1dO!NuQdO1G1dOOQT1G0_1G0_O!#[Q`O,5<_O#!bQaO'#EYOOQS1G0[1G0[O#!iQ`O,5:zOEdQaO,5:zO#!nQaO,5;OO#!uQdO,5:|O#$tQdO,5?UO#&sQaO'#HmO#'TQ`O,5?TOOQS1G0e1G0eO#']Q`O1G0eO#'bQ`O'#IkO#(zQ`O'#IkO#)SQ`O,5;SOG|QaO,5;SOOQS1G0w1G0wOOQO,5>^,5>^OOQO-E;p-E;pOOQS1G1U1G1UO#)pQdO'#FQO#+uQ`O'#HsOJ}QpO1G1UO2wQ`O'#HpO#+zQtO,5;eO2wQ`O'#HqO#,iQtO,5;gO#-WQaO1G1OOOQS,5;h,5;hO#/gQtO'#FQO#/tQdO1G0dO-RQaO1G0dO#1aQdO1G1aO#2|QdO1G1cOOQO,5X,5>XOOQO-E;k-E;kOOQS7+&P7+&PO!+iQaO,5;TO$$^QaO'#HnO$$hQ`O,5?VOOQS1G0n1G0nO$$pQ`O1G0nPOQO'#FQ'#FQOOQO,5>_,5>_OOQO-E;q-E;qOOQS7+&p7+&pOOQS,5>[,5>[OOQS-E;n-E;nO$$uQtO,5>]OOQS-E;o-E;oO$%dQdO7+&jO$'iQtO'#FQO$'vQdO7+&OOOQS1G0j1G0jOOQO,5>a,5>aOOQO-E;s-E;sOOQ#u7+(x7+(xO!$[QdO7+(xOOQ#u7+(}7+(}O#JfQ`O7+(}O#JkQ`O7+(}OOQ#u7+(z7+(zO!.]Q`O7+(zO!1TQ`O7+(zO!1QQ`O7+(zO$)cQ`O,5i,5>iOOQS-E;{-E;{O$.lQdO7+'qO$.|QpO7+'qO$/XQdO'#IxOOQO,5pOOQ#u,5>p,5>pOOQ#u-EoOOQS-EVQdO1G2^OOQS,5>h,5>hOOQS-E;z-E;zOOQ#u7+({7+({O$?oQ`O'#GXO:]Q`O'#H_OOQO'#IV'#IVO$@fQ`O,5=xOOQ#u,5=x,5=xO$AcQ!bO'#EQO$AzQ!bO7+(}O$BYQpO7+)RO#KRQpO7+)RO$BbQ`O'#HbO!$[QdO7+)RO$BpQdO,5>rOOQS-EVOOQS-E;i-E;iO$D{QdO<Z,5>ZOOQO-E;m-E;mOOQS1G1_1G1_O$8rQaO,5:uO$G}QaO'#HlO$H[Q`O,5?QOOQS1G0`1G0`OOQS7+&Q7+&QO$HdQ`O7+&UO$IyQ`O1G0oO$K`Q`O,5>YOOQO,5>Y,5>YOOQO-E;l-E;lOOQS7+&Y7+&YOOQS7+&U7+&UOOQ#u<c,5>cOOQO-E;u-E;uOOQS<lOOQ#u-EmOOQO-EW,5>WOOQO-E;j-E;jO!+iQaO,5;UOOQ#uANBTANBTO#JfQ`OANBTOOQ#uANBQANBQO!.]Q`OANBQO!+iQaO7+'hOOQO7+'l7+'lO%-bQ`O7+'hO%.wQ`O7+'hO%/SQ`O7+'lO!+iQaO7+'mOOQO7+'m7+'mO%/XQdO'#F}OOQO'#Hv'#HvO%/jQ`O,5e,5>eOOQS-E;w-E;wOOQO1G2_1G2_O$1YQdO1G2_O$/jQpO1G2_O#JkQ`O1G2]O!.mQdO1G2aO%$dQ!bO1G2]O!$[QdO1G2]OOQO1G2a1G2aOOQO1G2]1G2]O%2uQaO'#G]OOQO1G2b1G2bOOQSAN@xAN@xO!.]Q`OAN@xOOOQ<]O%6rQ!bO'#FQO!$[QdOANBXOOQ#uANBXANBXO:]Q`O,5=}O%7WQ`O,5=}O%7cQ`O'#IXO%7wQ`O,5?rOOQS1G3h1G3hOOQS7+)x7+)xP%+OQpOANBXO%8PQ`O1G0pOOQ#uG27oG27oOOQ#uG27lG27lO%9fQ`O<d,5>dO%dOOQO-E;v-E;vO%hQ`O'#IqO%>rQ`O'#IhO!$[QdO'#IOO%@lQaO,5s,5>sOOQO-Ej,5>jOOQP-E;|-E;|OOQO1G2c1G2cOOQ#uLD,kLD,kOOQTG27[G27[O!$[QdOLD-RO!$[QdO<OO%EpQ`O,5>OPOQ#uLD-_LD-_OOQO7+'o7+'oO+_QdO7+'oOOQS!$( ]!$( ]OOQOAN@}AN@}OOQS1G2d1G2dOOQS1G2e1G2eO%E{QdO1G2eOOQ#u!$(!m!$(!mOOQOANBVANBVOOQO1G3j1G3jO:]Q`O1G3jOOQO<tQaO,5:xO'/vQaO,5;uO'/vQaO,5;wO'@sQdO,5YQdO,5<^O)@XQdO,5QQ`O,5=eO*>YQaO'#HkO*>dQ`O,5?ROlQdO7+%tO*@kQ`O1G0jO!+iQaO1G0jO*BQQdO7+&OOoO*GeQ`O,5>VO*HzQdO<[QdO,5{QdO'#IjO.BbQ`O'#IeO.BoQ`O'#GPO.BwQaO,5:nO.COQ`O,5uOs#fOx7xOy7xO}aO!O^O!Q8OO!R}O!T7}O!V7yO!W7yO!Z8QO!d:QO!z]O#T#mO#V#lO#X`O#dhO#fbO#gcO#sdO$[7|O$d7{O$e7|O$hqO%T8PO%U!OO%W}O%X}O%`|O'WYO'u{O#Y']P~O#O#qO~P/lO!z#rO~O#d#tO#fbO#gcO~O'a#vO~O#s#zO~OU$OO!R$OO!w#}O#s3hO'W#{O~OT'XXz'XX!S'XX!c'XX!n'XX!w'XX!z'XX#T'XX#X'XX#a'XX#b'XX#y'XX$R'XX$S'XX$T'XX$U'XX$V'XX$X'XX$Y'XX$Z'XX$['XX$]'XX$^'XX$_'XX%T'XX'P'XX!y'XX!o'XX~O#|$QO$O$RO~P3YOP7wOQ|OU_OW}O[7zOo>uOs#fOx7xOy7xO}aO!O^O!Q8OO!R}O!T7}O!V7yO!W7yO!Z8QO!d:QO!z]O#X`O#dhO#fbO#gcO#sdO$[7|O$d7{O$e7|O$hqO%T8PO%U!OO%W}O%X}O%`|O'WYO'u{OT$PXz$PX!S$PX!c$PX!n$PX!w$PX#a$PX#b$PX#y$PX$R$PX$S$PX$T$PX$U$PX$V$PX$X$PX$Y$PX$Z$PX$]$PX$^$PX$_$PX'P$PX!y$PX!o$PX~Or$TO#T8eO#V8dO~P5^O#sdO'WYO~OS$fO]$aOk$dOm$fOs$`O!a$bO$krO$u$eO~O!z$hO#T$jO'W$gO~Oo$mOs$lO#d$nO~O!z$hO#T$rO~O!U$uO$u$tO~P-ROR${O!p$zO#d$yO#g$zO&}${O~O't$}O~P;PO!z%SO~O!z%UO~O!n#bO'P#bO~P-RO!pXO~O!z%`O~OP7wOQ|OU_OW}O[7zOo>uOs#fOx7xOy7xO}aO!O^O!Q8OO!R}O!T7}O!V7yO!W7yO!Z8QO!d:QO!z]O#X`O#dhO#fbO#gcO#sdO$[7|O$d7{O$e7|O$hqO%T8PO%U!OO%W}O%X}O%`|O'WYO'u{O~O!z%dO~O]$aO~O!pXO#sdO'WYO~O]%rOs%rO#s%nO'WYO~O!j%wO'Q%wO'TRO~O'Q%zO~PhO!o%{O~PhO!r%}O~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'cX#O'cX~P!%aO!r)yO!y'eX#O'eX~P)dO!y#kX#O#kX~P!+iO#O){O!y'bX~O!y)}O~O%T#cOT$Qiz$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi$_$Qi'P$Qi!y$Qi#O$Qi#P$Qi#Y$Qi!o$Qi!r$QiV$Qi#|$Qi$O$Qi!p$Qi~P!%aOz#QO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO!w!yO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi'P$Qi!y$Qi!o$Qi~P!%aOT#SOz#QO!c#UO!w!yO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cO!S$Qi!n$Qi'P$Qi!y$Qi!o$Qi~P!%aOT#SOz#QO!w!yO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cO!S$Qi!c$Qi!n$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi$T$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi$T$Qi$U$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$[#_O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$Z#^O$[#_O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi'P$Qi!y$Qi!o$Qi~P!%aO_*PO~PxO$hqO$krO~P2wO#X+|O#a+{O#b+{O~O#d,OO%W,OO%^+}O'W$gO~O!o,PO~PCVOc%bXd%bXh%bXj%bXf%bXg%bXe%bX~PhOc,TOd,ROP%aiQ%aiS%aiU%aiW%aiX%ai[%ai]%ai^%ai`%aia%aib%aik%aim%aio%aip%aiq%ais%ait%aiu%aiv%aix%aiy%ai|%ai}%ai!O%ai!P%ai!Q%ai!R%ai!T%ai!V%ai!W%ai!X%ai!Y%ai!Z%ai![%ai!]%ai!^%ai!_%ai!a%ai!b%ai!d%ai!n%ai!p%ai!z%ai#X%ai#d%ai#f%ai#g%ai#s%ai$[%ai$d%ai$e%ai$h%ai$k%ai$u%ai%T%ai%U%ai%W%ai%X%ai%`%ai&|%ai'W%ai'u%ai'Q%ai!o%aih%aij%aif%aig%aiY%ai_%aii%aie%ai~Oc,XOd,UOh,WO~OY,YO_,ZO!o,^O~OY,YO_,ZOi%gX~Oi,`O~Oj,aO~O!n,cO~PxO$hqO$krO~P2wO!p)`O~OU$OO!R$OO!w3nO#s3iO'W,zO~O#s,|O~O!p-OO'a'UO~O#sdO'WYO!n&zX#O&zX'P&zX~O#O)gO!n'ya'P'ya~O#s-UO~O!n&_X#O&_X'P&_X#P&_X~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#ka#O#ka~P!%aO!y&cX#O&cX~P@aO#O){O!y'ba~O!o-_O~PCVO#P-`O~O#O-aO!o'YX~O!o-cO~O!y-dO~OT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O#Wi#Y#Wi~P!%aO!y&bX#O&bX~PxO#n'XO~OS+kO].cOm+kOs$`O!U+kO!`+kO!a+kO#d>xO$hqO$krO~P2wOS+kO].cOm+kOs$`O!U+kO!`+kO!a+kO#d>xO$hqO~P2wO!n#bO!p-yO'P#bO~OS+kO]+nOm+kOs$`O!U+kO!_+qO!`+kO!a+kO!o.mO#d>xO$hqO$krO~P2wO#d.rO%W.rO%^+}O'W$gO~O%W.sO~O#Y.tO~Oc%bad%bah%baj%baf%bag%bae%ba~PhOc.wOd,ROP%aqQ%aqS%aqU%aqW%aqX%aq[%aq]%aq^%aq`%aqa%aqb%aqk%aqm%aqo%aqp%aqq%aqs%aqt%aqu%aqv%aqx%aqy%aq|%aq}%aq!O%aq!P%aq!Q%aq!R%aq!T%aq!V%aq!W%aq!X%aq!Y%aq!Z%aq![%aq!]%aq!^%aq!_%aq!a%aq!b%aq!d%aq!n%aq!p%aq!z%aq#X%aq#d%aq#f%aq#g%aq#s%aq$[%aq$d%aq$e%aq$h%aq$k%aq$u%aq%T%aq%U%aq%W%aq%X%aq%`%aq&|%aq'W%aq'u%aq'Q%aq!o%aqh%aqj%aqf%aqg%aqY%aq_%aqi%aqe%aq~Oc.|Od,UOh.{O~O!r(hO~OP7wOQ|OU_OW}O[xO$hqO$krO~P2wOS+kOY,vO]+nOm+kOs$`O!U+kO!_+qO!`+kO!a+kO!o/fO#d>xO$hqO$krO~P2wOw!tX!p!tX#T!tX#n!tX#s#vX#|!tX'W!tX~Ow(ZO!p)`O#T3tO#n3sO~O!p-OO'a&fa~O]/nOs/nO#sdO'WYO~OV/rO!n&za#O&za'P&za~O#O)gO!n'yi'P'yi~O#s/tO~OT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!n&_a#O&_a'P&_a#P&_a~P!%aOz#QO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT!vy!S!vy!c!vy!n!vy!w!vy'P!vy!y!vy!o!vy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#ji#O#ji~P!%aO_*PO!o&`X#O&`X~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#]i#O#]i~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#P/yO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!y&ba#O&ba~P!%aO#|0OO!y$ji#O$ji~O#d0PO~O#V0SO#d0RO~P2wOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ji#O$ji~P!%aO!p-yO#|0TO!y$oi#O$oi~O!o0YO'W$gO~O#O0[O!y'kX~O#d0^O~O!y0_O~O!pXO!r0bO~O#T'ZO#n'XO!p'qy!n'qy'P'qy~O!n$sy'P$sy!y$sy!o$sy~PCVO#P0eO#T'ZO#n'XO~O#sdO'WYOw&mX!p&mX#O&mX!n&mX'P&mX~O#O.^Ow'la!p'la!n'la'P'la~OS+kO]0mOm+kOs$`O!U+kO!`+kO!a+kO#d>xO$hqO~P2wO#T3tO#n3sO'W$gO~O#|)XO#T'eX#n'eX'W'eX~O!n#bO!p0sO'P#bO~O#Y0wO~Oh0|O~OTvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$jq#O$jq~P!%aO#|1kO!y$jq#O$jq~O#d1lO~O!n#bO!pXO!z$hO#P1oO'P#bO~O!o1rO'W$gO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$oq#O$oq~P!%aO#T1tO#d1sO!y&lX#O&lX~O#O0[O!y'ka~O#T'ZO#n'XO!p'q!R!n'q!R'P'q!R~O!pXO!r1yO~O!n$s!R'P$s!R!y$s!R!o$s!R~PCVO#P1{O#T'ZO#n'XO~OP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#^i#O#^i~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$jy#O$jy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$oy#O$oy~P!%aO!pXO#P2rO~O#d2sO~O#O0[O!y'ki~O!n$s!Z'P$s!Z!y$s!Z!o$s!Z~PCVOTvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$j!R#O$j!R~P!%aO!n$s!c'P$s!c!y$s!c!o$s!c~PCVO!a3`O'W$gO~OV3dO!o&Wa#O&Wa~O'W$gO!n%Ri'P%Ri~O'a'_O~O'a/jO~O'a*iO~O'a1]O~OT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$ta#|$ta$O$ta'P$ta!y$ta!o$ta#O$ta~P!%aO#T3uO~P-RO#s3lO~O#s3mO~O!U$uO$u$tO~P#-WOT8TOz8RO!S8UO!c8VO!w:_O#P3pO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!n'^X'P'^X!y'^X!o'^X~P!%aOT6QOz6OO!S6RO!c6SO!w7oO#P5aO#T#PO$R6PO$S6TO$T6UO$U6VO$V6WO$X6YO$Y6ZO$Z6[O$[6]O$]6^O$^6_O$_6_O%T#cO#O'^X#Y'^X#|'^X$O'^X!n'^X'P'^X!r'^X!y'^X!o'^XV'^X!p'^X~P!%aO#T5OO~P#-WOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$`a#|$`a$O$`a'P$`a!y$`a!o$`a#O$`a~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$aa#|$aa$O$aa'P$aa!y$aa!o$aa#O$aa~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$ba#|$ba$O$ba'P$ba!y$ba!o$ba#O$ba~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$ca#|$ca$O$ca'P$ca!y$ca!o$ca#O$ca~P!%aOz3{O#|$ca$O$ca#O$ca~PMVOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$fa#|$fa$O$fa'P$fa!y$fa!o$fa#O$fa~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n%Va#|%Va$O%Va'P%Va!y%Va!o%Va#O%Va~P!%aOz3{O#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOT3}Oz3{O!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!S$Qi!n$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOT3}Oz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!S$Qi!c$Qi!n$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$[4YO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$Z4XO$[4YO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n#Ua#|#Ua$O#Ua'P#Ua!y#Ua!o#Ua#O#Ua~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n'^a#|'^a$O'^a'P'^a!y'^a!o'^a#O'^a~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT#Qi!S#Qi!c#Qi!n#Qi#|#Qi$O#Qi'P#Qi!y#Qi!o#Qi#O#Qi~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT#}i!S#}i!c#}i!n#}i#|#}i$O#}i'P#}i!y#}i!o#}i#O#}i~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$Pi#|$Pi$O$Pi'P$Pi!y$Pi!o$Pi#O$Pi~P!%aOz3{O#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT!vq!S!vq!c!vq!n!vq!w!vq#|!vq$O!vq'P!vq!y!vq!o!vq#O!vq~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT#Qq!S#Qq!c#Qq!n#Qq#|#Qq$O#Qq'P#Qq!y#Qq!o#Qq#O#Qq~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$sq#|$sq$O$sq'P$sq!y$sq!o$sq#O$sq~P!%aOz3{O#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT!vy!S!vy!c!vy!n!vy!w!vy#|!vy$O!vy'P!vy!y!vy!o!vy#O!vy~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$sy#|$sy$O$sy'P$sy!y$sy!o$sy#O$sy~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$s!R#|$s!R$O$s!R'P$s!R!y$s!R!o$s!R#O$s!R~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$s!Z#|$s!Z$O$s!Z'P$s!Z!y$s!Z!o$s!Z#O$s!Z~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$s!c#|$s!c$O$s!c'P$s!c!y$s!c!o$s!c#O$s!c~P!%aOP7wOU_O[5kOo9xOs#fOx5gOy5gO}aO!O^O!Q5{O!T5qO!V5iO!W5iO!Z5}O!d5eO!z]O#T5bO#X`O#dhO#fbO#gcO#sdO$[5oO$d5mO$e5oO$hqO%T5|O%U!OO'WYO~P$vO#O9_O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'xX~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#O9aO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'ZX~P!%aOz8RO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOT8TOz8RO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!S$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOT8TOz8RO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!S$Qi!c$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi$T$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$[8`O$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$Z8_O$[8`O$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aO#T9fO~P!+iO!n#Ua'P#Ua!y#Ua!o#Ua~PCVO!n'^a'P'^a!y'^a!o'^a~PCVO#T=PO#V=OO!y&aX#O&aX~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#Wi#O#Wi~P!%aOz8RO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT#Qq!S#Qq!c#Qq#O#Qq#P#Qq#Y#Qq!n#Qq'P#Qq!r#Qq!y#Qq!o#QqV#Qq!p#Qq~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$sq#P$sq#Y$sq!n$sq'P$sq!r$sq!y$sq!o$sqV$sq!p$sq~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y&wa#O&wa~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y&_a#O&_a~P!%aOz8RO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT!vy!S!vy!c!vy!w!vy#O!vy#P!vy#Y!vy!n!vy'P!vy!r!vy!y!vy!o!vyV!vy!p!vy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#Wq#O#Wq~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$sy#P$sy#Y$sy!n$sy'P$sy!r$sy!y$sy!o$syV$sy!p$sy~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$s!R#P$s!R#Y$s!R!n$s!R'P$s!R!r$s!R!y$s!R!o$s!RV$s!R!p$s!R~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$s!Z#P$s!Z#Y$s!Z!n$s!Z'P$s!Z!r$s!Z!y$s!Z!o$s!ZV$s!Z!p$s!Z~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$s!c#P$s!c#Y$s!c!n$s!c'P$s!c!r$s!c!y$s!c!o$s!cV$s!c!p$s!c~P!%aO#T9vO~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$`a#O$`a~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$aa#O$aa~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ba#O$ba~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ca#O$ca~P!%aOz:`O%T#cOT$ca!S$ca!c$ca!w$ca!y$ca#O$ca#T$ca$R$ca$S$ca$T$ca$U$ca$V$ca$X$ca$Y$ca$Z$ca$[$ca$]$ca$^$ca$_$ca~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$fa#O$fa~P!%aO!r?SO#P9^O~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ta#O$ta~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y%Va#O%Va~P!%aOT8TOz8RO!S8UO!c8VO!r9cO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aOz:`O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!y$Qi#O$Qi~P!%aOT:bOz:`O!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!S$Qi!y$Qi#O$Qi~P!%aOT:bOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!S$Qi!c$Qi!y$Qi#O$Qi~P!%aOz:`O#T#PO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi~P!%aOz:`O#T#PO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi$T$Qi~P!%aOz:`O#T#PO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi$T$Qi$U$Qi~P!%aOz:`O#T#PO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi~P!%aOz:`O$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi~P!%aOz:`O$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi~P!%aOz:`O$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi~P!%aOz:`O$[:mO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi~P!%aOz:`O$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi~P!%aOz:`O$Z:lO$[:mO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi~P!%aOz:`O$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT#Qi!S#Qi!c#Qi!y#Qi#O#Qi~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT#}i!S#}i!c#}i!y#}i#O#}i~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$Pi#O$Pi~P!%aO!r?TO#P9hO~Oz:`O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT!vq!S!vq!c!vq!w!vq!y!vq#O!vq~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT#Qq!S#Qq!c#Qq!y#Qq#O#Qq~P!%aO!r?YO#P9oO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$sq#O$sq~P!%aO#P9oO#T'ZO#n'XO~Oz:`O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT!vy!S!vy!c!vy!w!vy!y!vy#O!vy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$sy#O$sy~P!%aO#P9pO#T'ZO#n'XO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$s!R#O$s!R~P!%aO#P9sO#T'ZO#n'XO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$s!Z#O$s!Z~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$s!c#O$s!c~P!%aO#T;}O~P!+iOT8TOz8RO!S8UO!c8VO!w:_O#P;|O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!y'^X#O'^X~P!%aO!U$uO$u$tO~P$8rOP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QVO~P$8rOP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QWO#X`O#dhO#fbO#gcO#sdO$[vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#Ua#O#Ua~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'^a#O'^a~P!%aOz<]O!w?^O#T#PO$R<_O$SpO~P$8rOP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QqO#X`O#dhO#fbO#gcO#sdO$[oO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#P>nO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!n'^X!r'^X!o'^X#O'^X!p'^X'P'^X~P!%aOT'XXz'XX!S'XX!c'XX!w'XX!z'XX#O'XX#T'XX#X'XX#a'XX#b'XX#y'XX$R'XX$S'XX$T'XX$U'XX$V'XX$X'XX$Y'XX$Z'XX$['XX$]'XX$^'XX$_'XX%T'XX~O#|:uO$O:vO!y'XX~P.@qO!z$hO#T>zO~O!r;SO~PxO!n&qX!p&qX#O&qX'P&qX~O#O?QO!n'pa!p'pa'P'pa~O!r?rO#P;uO~OT[O~O!r?zO#P:rO~OT8TOz8RO!S8UO!c8VO!r>]O!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aOT8TOz8RO!S8UO!c8VO!r>^O!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aO!r?{O#P>cO~O!r?|O#P>hO~O#P>hO#T'ZO#n'XO~O#P:rO#T'ZO#n'XO~O#P>iO#T'ZO#n'XO~O#P>lO#T'ZO#n'XO~O!z$hO#T?nO~Oo>wOs$lO~O!z$hO#T?oO~O#O?QO!n'pX!p'pX'P'pX~O!z$hO#T?vO~O!z$hO#T?wO~O!z$hO#T?xO~Oo?lOs$lO~Oo?uOs$lO~Oo?tOs$lO~O%X$]%W$k!e$^#d%`#g'u'W#f~",goto:"%1O'{PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP'|P(TPP(Z(^PPP(vP(^*o(^6cP6cPP>cFxF{PP6cGR! RP! UP! UPPGR! e! h! lGRGRPP! oP! rPPGR!)u!0q!0qGR!0uP!0u!0u!0u!2PP!;g!S#>Y#>h#>n#>x#?O#?U#?[#?b#?l#?v#?|#@S#@^PPPPPPPP#@d#@hP#A^$(h$(k$(u$1R$1_$1t$1zP$1}$2Q$2W$5[$?Y$Gr$Gu$G{$HO$Kb$Ke$Kn$Kv$LQ$Li$MP$Mz%'}PP%0O%0S%0`%0u%0{Q!nQT!qV!rQUOR%x!mRVO}!hPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]|!hPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]Q%_!ZQ%h!aQ%m!eQ'k$cQ'x$iQ)d%lQ+W'{Q,k)QU.O+T+V+]Q.j+pQ/`,jS0a.T.UQ0q.dQ1n0VS1w0`0dQ2Q0nQ2q1pQ2t1xR3[2u|ZPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]2lf]`cgjklmnoprxyz!W!X!Y!]!e!f!g!y!z#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r#}$Q$R$T$h$z%S%U%d%r%}&S&W&[&q&t&u&x'P'X'Z']'a'e'p't'y(R(V(W(Y(Z([(t)T)X)`)c)g)n)u)y*V*Z*[*r*w*|+Q+X+[+^+_+j+m+q+t,Y,c,e,g,i,u,x-O-`-a-t-v-z.S.V.[.].^.b/X/n/y0O0T0b0e1R1S1b1k1o1y1{2k2r3n3p3s3t3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7i7j7k7o7w7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v9|9}:O:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?S?T?Y?^?_?p?q?r?y?z?{?|S$ku$`Q%W!V^%e!_$a'j)Y.f0o2OQ%i!bQ%j!cQ%k!dQ%v!kS&V!|){Q&]#OQ'l$dQ'm$eS'|$j'hQ)S%`Q*v'nQ+z(bQ,O(dQ-S)iU.g+n.c0mQ.q+{Q.r+|Q/d,vS0V-y0XQ1X/cQ1e/rS2T0s2WQ2h1`Q3U2iQ3^2zQ3_2{Q3c3VQ3f3`R3g3d0{!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_0z!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_Q#h^Q%O!PQ%P!QQ%Q!RQ,b(sQ.u,RR.y,UR&r#hQ*Q&qR/w-a0{hPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_R#j_k#n`j#i#q&t&x5d5e9W:Q:R:S:TR#saT&}#r'PR-h*[R&R!{0zhPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_R#tb-x!}[#e#k#u$U$V$W$X$Y$Z$v$w%X%Z%]%a%s%|&O&U&_&`&a&b&c&d&e&f&g&h&i&j&k&l&m&n&v&w&|'`'b'c(e(x)v)x)z*O*U*h*j+a+d,n,q-W-Y-[-e-f-g-w.Y/O/[/v0Q0Z0f1g1j1m1z2S2`2o2p2v3Z4]4^4d4e4f4g4h4i4j4l4m4n4o4p4q4r4s4t4u4v4w4x4y4z4{4|4}5P5Q5T5U5W5X5Y5]5^5`5t6e6f6g6h6i6j6k6m6n6o6p6q6r6s6t6u6v6w6x6y6z6{6|6}7O7Q7R7U7V7X7Y7Z7^7_7a7m7q8i8j8k8l8m8n8p8q8r8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9U9V9Y9[9]9d9e9g9i9j9k9l9m9n9q9r9t9w:p:x:y:z:{:|:};Q;R;T;U;V;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;g;l;m;p;r;s;w;y;{O>P>Q>R>S>T>U>X>Y>Z>_>`>a>b>d>e>f>g>j>k>m>r>s>{>|>}?V?b?cQ'd$[Y(X$s8o;P=^=_S(]3o7lQ(`$tR+y(aT&X!|){#a$Pg#}$h'X'Z'p't'y(W([)`)c*r*w+Q+X+[+_+j+m+n+t,i,u,x-v.S.V.].b.c0b0m1y3n3s3t7i7j7k7w9|9}:O?S?T?Y?p?q?r?y?z?{?|3yfPVX]`cgjklmnoprxyz!S!W!X!Y!]!e!f!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r#}$Q$R$T$h$z%O%Q%S%T%U%V%d%r%}&S&W&[&q&t&u&x'P'X'Z']'a'e'p't'y(R(V(W(Y(Z([(h(t)T)X)`)c)g)n)u)y){*V*Z*[*r*w*|+Q+X+[+^+_+j+m+n+q+t,Q,T,Y,c,e,g,i,u,x-O-`-a-t-v-z.S.V.[.].^.b.c.u.w/P/X/n/y0O0T0b0e0m0s0}1O1R1S1W1b1k1o1y1{2W2]2k2r3n3p3s3t3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7i7j7k7o7w7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v9|9}:O:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?S?T?Y?^?_?p?q?r?y?z?{?|[#wd#x3h3i3j3kh'V#z'W)f,}-U/k/u1f3l3m3q3rQ)e%nR-T)kY#yd%n)k3h3iV'T#x3j3k1dePVX]`cjklmnoprxyz!S!W!X!Y!]!e!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a'e(R(V(Y(Z(h(t)T)X)g)n)u)y){*V*Z*[*|+^+q,Q,T,Y,c,e,g-O-`-a-t-z.[.^.u.w/P/X/n/y0O0T0e0s0}1O1R1S1W1b1k1o1{2W2]2k2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_Q%o!fQ)l%r#O3vg#}$h'X'Z'p't'y(W([)`*w+Q+X+[+_+j+m+t,i,u,x-v.S.V.].b0b1y7i7j7k7w9|9}:O?S?T?Y?p?q?r?y?z?{?|a3w)c*r+n.c0m3n3s3tY'T#z)f-U3l3mZ*c'W,}/u3q3r0vhPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0}1O1R1S1W1k1o1{2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T2U0s2WR&^#OR&]#O!r#Z[#e#u$U$V$W$X$Z$s$w%X%Z%]&`&a&b&c&d&e&f&g'`'b'c(e)v)x*O*j+d-Y.Y0f1z2`2p2v3Z9U9V!Y4U3o4d4e4f4g4i4j4l4m4n4o4p4q4r4s4{4|4}5P5Q5T5U5W5X5Y5]5^5`!^6X4^6e6f6g6h6j6k6m6n6o6p6q6r6s6t6|6}7O7Q7R7U7V7X7Y7Z7^7_7a7l7m#b8[#k%a%s%|&O&v&w&|(x*U+a,n,q-W-e-g/[4]5t7q8i8j8k8l8n8o8p8t8u8v8w8x8y8z8{9Y9[9]9d9g9i9l9n9q9r9t9w:p;Rr>s>{?b?c!|:i&U)z-[-f-w0Q0Z1g1j1m2o8q8r9e9j9k9m:x:y:z:{:};P;Q;T;U;V;W;X;Y;Z;[;d;f;g;l;m;p;r;s;w;y;{>R>S!`T>X>Z>_>a>d>e>g>j>k>m>|>}?VoU>Y>`>b>fS$iu#fQ$qwU'{$j$l&pQ'}$kS(P$m$rQ+Z'|Q+](OQ+`(QQ1p0VQ5s7dS5v7f7gQ5w7hQ7p9xS7r9y9zQ7s9{Q;O>uS;h>w>zQ;o?PQ>y?jS?O?l?nQ?U?oQ?`?sS?a?t?wS?d?u?vR?e?xT'u$h+Q!csPVXt!S!j!r!s!w$h%O%Q%T%V'p([(h)`+Q+j+t,Q,T,u,x.u.w/P0}1O1W2]Q$]rR*l'eQ-{+PQ.i+oQ0U-xQ0j.`Q1|0kR2w1}T0W-y0XQ+V'zQ.U+YR0d.XQ(_$tQ)^%iQ)s%vQ*u'mS+x(`(aQ-q*vR.p+yQ(^$tQ)b%kQ)r%vQ*q'lS*t'm)sU+w(_(`(aS-p*u*vS.o+x+yQ/i,{Q/{-nQ/}-qR0v.pQ(]$tQ)]%iQ)_%jQ)q%vU*s'm)r)sW+v(^(_(`(aQ,t)^U-o*t*u*vU.n+w+x+yS/|-p-qS0u.o.pQ1i/}R2Y0vX+r([)`+t,xb%f!_$a'j+n.c.f0m0o2OR,r)YQ$ovS+b(S?Qg?m([)`+i+j+m+t,u,x.a.b0lR0t.kT2V0s2W0}|PVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$y{$|Q,O(dR.r+|T${{$|Q(j%OQ(r%QQ(w%TQ(z%VQ.},XQ0z.yQ0{.|R2c1WR(m%PX,[(k(l,],_R(n%PX(p%Q%T%V1WR%T!T_%b!]%S(t,c,e/X1RR%V!UR/],gR,j)PQ)a%kS*p'l)bS-m*q,{S/z-n/iR1h/{T,w)`,xQ-P)fU/l,|,}-UU1^/k/t/uR2n1fR/o-OR2l1bSSO!mR!oSQ!rVR%y!rQ!jPS!sV!rQ!wX[%u!j!s!w,Q1O2]Q,Q(hQ1O/PR2]0}Q)o%sS-X)o9bR9b8rQ-b*QR/x-bQ&y#oS*X&y9XR9X:tS*]&|&}R-i*]Q)|&YR-^)|!j'Y#|'o*f*z+O+T+e+i.T.W.Z.a/_0`0c0g0l1x2u5x5y5z7e7t7u7v;q;t;x?W?X?Z?f?g?h?iS*e'Y/g]/g,{-n.f0o1[2O!h'[#|'o*z+O+T+e+i.T.W.Z.a/_0`0c0g0l1x2u5x5y5z7e7t7u7v;q;t;x?W?X?Z?f?g?h?iS*g'[/hZ/h,{-n.f0o2OU#xd%n)kU'S#x3j3kQ3j3hR3k3iQ'W#z^*b'W,}/k/u1f3q3rQ,})fQ/u-UQ3q3lR3r3m|tPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]W$_t'p+j,uS'p$h+QS+j([+tT,u)`,xQ'f$]R*m'fQ0X-yR1q0XQ+R'vR-}+RQ0].PS1u0]1vR1v0^Q._+fR0i._Q+t([R.l+tW+m([)`+t,xS.b+j,uT.e+m.bQ)Z%fR,s)ZQ(T$oS+c(T?RR?R?mQ2W0sR2}2WQ$|{R(f$|Q,S(iR.v,SQ,V(jR.z,VQ,](kQ,_(lT/Q,],_Q)U%aS,o)U9`R9`8qQ)R%_R,l)RQ,x)`R/e,xQ)h%pS-R)h/sR/s-SQ1c/oR2m1cT!uV!rj!iPVX!j!r!s!w(h,Q/P0}1O2]Q%R!SQ(i%OW(p%Q%T%V1WQ.x,TQ0x.uR0y.w|[PVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]Q#e]U#k`#q&xQ#ucQ$UkQ$VlQ$WmQ$XnQ$YoQ$ZpQ$sx^$vy3y5|8P:]n>oQ+a(RQ+d(VQ,n)TQ,q)XQ-W)nQ-Y)uQ-[)yQ-e*VQ-f*ZQ-g*[^-k3u5b7c9v;}>p>qQ-w*|Q.Y+^Q/O,YQ/[,gQ/v-`Q0Q-tQ0Z-zQ0f.[Q1g/yQ1j0OQ1m0TQ1z0eU2S0s2W:rQ2`1SQ2o1kQ2p1oQ2v1{Q3Z2rQ3o3xQ4]jQ4^5eQ4d5fQ4e5hQ4f5jQ4g5lQ4h5nQ4i5pQ4j3zQ4l3|Q4m3}Q4n4OQ4o4PQ4p4QQ4q4RQ4r4SQ4s4TQ4t4UQ4u4VQ4v4WQ4w4XQ4x4YQ4y4ZQ4z4[Q4{4_Q4|4`Q4}4aQ5P4bQ5Q4cQ5T4kQ5U5OQ5W5RQ5X5SQ5Y5VQ5]5ZQ5^5[Q5`5_Q5t5rQ6e5gQ6f5iQ6g5kQ6h5mQ6i5oQ6j5qQ6k5}Q6m6PQ6n6QQ6o6RQ6p6SQ6q6TQ6r6UQ6s6VQ6t6WQ6u6XQ6v6YQ6w6ZQ6x6[Q6y6]Q6z6^Q6{6_Q6|6`Q6}6aQ7O6bQ7Q6cQ7R6dQ7U6lQ7V7PQ7X7SQ7Y7TQ7Z7WQ7^7[Q7_7]Q7a7`Q7l5{Q7m5dQ7q7oQ8i7xQ8j7yQ8k7zQ8l7{Q8m7|Q8n7}Q8o8OQ8p8QU8q,c/X1RQ8r%dQ8t8SQ8u8TQ8v8UQ8w8VQ8x8WQ8y8XQ8z8YQ8{8ZQ8|8[Q8}8]Q9O8^Q9P8_Q9Q8`Q9R8aQ9S8bQ9U8dQ9V8eQ9Y8fQ9[8gQ9]8hQ9d8sQ9e9TQ9g9ZQ9i9^Q9j9_Q9k9aQ9l9cQ9m9fQ9n9hQ9q9oQ9r9pQ9t9sQ9w:QU:p#i&t9WQ:x:UQ:y:VQ:z:WQ:{:XQ:|:YQ:}:ZQ;P:[Q;Q:^Q;R:_Q;T:aQ;U:bQ;V:cQ;W:dQ;X:eQ;Y:fQ;Z:gQ;[:hQ;]:iQ;^:jQ;_:kQ;`:lQ;a:mQ;b:nQ;c:oQ;d:uQ;f:vQ;g:wQ;l;SQ;m;eQ;p;jQ;r;kQ;s;nQ;w;uQ;y;vQ;{;zQOP<{Q>Q<|Q>R=OQ>S=PQ>T=QQ>U=RQ>X=SQ>Y=TQ>Z=UQ>_=aQ>`=bQ>a>VQ>b>WQ>d>[Q>e>]Q>f>^Q>g>cQ>j>hQ>k>iQ>m>lQ>r:SQ>s:RQ>{>vQ>|:qQ>}:sQ?V;iQ?b?^R?c?_R*R&qQ%t!gQ)W%dT*P&q-a$WiPVX]cklmnopxyz!S!W!X!Y!j!r!s!w#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a$Q$R$T$z%O%Q%T%V%}&S&['a(V(h)u+^,Q,T.[.u.w/P0e0}1O1S1W1o1{2]2r3p3u8d8e!t5c']3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5f5h5j5l5n5p7b7c!x7n5a5b5d5e5g5i5k5m5o5q5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`$`:P`j!]!g!y!z#i#l#m#q#r%S%U&q&t&u&x'P(R(t)T)X)n*V*[,e,g-a5r7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8f8g8h8s9W9Z9^9c9h9o9p9s9u9v:Q:R:S:T:_>v?^?_#l>t!|%d&W)y){*Z*|,c-t-z/X/y0O0T1R1k9T9_9a9f:U:V:W:X:Y:Z:[:]:^:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:u:v:w;S;e;j;k;n;u;v;z;|;}=O=P!x?[,Y-`:q:s;iV>[>]>c>h>i>l>n>p!]?]0s2W:rW>^>o>qQ#p`Q&s#iQ&{#qR*T&tS#o`#q^$Sj5d5e:Q:R:S:TS*W&x9WT:t#i&tQ'O#rR*_'PR&T!{R&Z!|Q&Y!|R-]){Q#|gS'^#}3nS'o$h+QS*d'X3sU*f'Z*w-vQ*z'pQ+O'tQ+T'yQ+e(WW+i([)`+t,xQ,{)cQ-n*rQ.T+XQ.W+[Q.Z+_U.a+j+m,uQ.f+nQ/_,iQ0`.SQ0c.VQ0g.]Q0l.bQ0o.cQ1[3tQ1x0bQ2O0mQ2u1yQ5x7iQ5y7jQ5z7kQ7e7wQ7t9|Q7u9}Q7v:OQ;q?SQ;t?TQ;x?YQ?W?pQ?X?qQ?Z?rQ?f?yQ?g?zQ?h?{R?i?|0z!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_#`$Og#}$h'X'Z'p't'y(W([)`)c*r*w+Q+X+[+_+j+m+n+t,i,u,x-v.S.V.].b.c0b0m1y3n3s3t7i7j7k7w9|9}:O?S?T?Y?p?q?r?y?z?{?|S$[r'eQ%l!eS%p!f%rU+f(Y(Z+qQ-Q)gQ/m-OQ0h.^Q1a/nQ2j1bR3W2k|vPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]#Y#g]cklmnopxyz!W!X!Y#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a$Q$R$T$z%}&S&['a(V)u+^.[0e1S1o1{2r3p3u8d8e`+k([)`+j+m+t,u,x.b!t8c']3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5f5h5j5l5n5p7b7c!x<}5a5b5d5e5g5i5k5m5o5q5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`$`?k`j!]!g!y!z#i#l#m#q#r%S%U&q&t&u&x'P(R(t)T)X)n*V*[,e,g-a5r7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8f8g8h8s9W9Z9^9c9h9o9p9s9u9v:Q:R:S:T:_>v?^?_#l?}!|%d&W)y){*Z*|,c-t-z/X/y0O0T1R1k9T9_9a9f:U:V:W:X:Y:Z:[:]:^:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:u:v:w;S;e;j;k;n;u;v;z;|;}=O=P!x@O,Y-`:q:s;iV>[>]>c>h>i>l>n>p!]@P0s2W:rW>^>o>qR'w$hQ'v$hR-|+QR$^rQ#d[Q%Y!WQ%[!XQ%^!YQ(U$pQ({%WQ(|%XQ(}%ZQ)O%]Q)V%cQ)[%gQ)d%lQ)j%qQ)p%tQ*n'iQ-V)mQ-l*oQ.i+oQ.j+pQ.x,WQ/S,`Q/T,aQ/U,bQ/Z,fQ/^,hQ/b,pQ/q-PQ0j.`Q0q.dQ0r.hQ0t.kQ0y.{Q1Y/dQ1_/lQ1n0VQ1|0kQ2Q0nQ2R0pQ2[0|Q2d1XQ2g1^Q2w1}Q2y2PQ2|2VQ3P2ZQ3T2fQ3X2nQ3Y2pQ3]2xQ3a3RQ3b3SR3e3ZR.R+UQ+g(YQ+h(ZR.k+qS+s([+tT,w)`,xa+l([)`+j+m+t,u,x.bQ%g!_Q'i$aQ*o'jQ.h+nS0p.c.fS2P0m0oR2x2OQ$pvW+o([)`+t,xW.`+i+j+m,uS0k.a.bR1}0l|!aPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]Q$ctW+p([)`+t,xU.d+j+m,uR0n.b0z!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_R/a,m0}}PVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$x{$|Q(q%QQ(v%TQ(y%VR2b1WQ%c!]Q(u%SQ,d(tQ/W,cQ/Y,eQ1Q/XR2_1RQ%q!fR)m%rR/p-O",nodeNames:"⚠ ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",87,"(",102,"#["],["closedBy",72,"phpClose",78,"}",88,")",165,"]"]],propSources:[HO],skippedNodes:[0],repeatNodeCount:32,tokenData:"!GQ_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9Y!e!}!7z!}#O!;b#O#P!V<%lO8VR9WV'TP%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%`QQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV'TP%`QOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRV<%l~8V~O8V~~%fR=OW'TPOY8VYZ9PZ!^8V!^!_;{!_;'S8V;'S;=`=h;=`<%l9m<%lO8VR=mW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l8V<%lO9mR>YP;=`<%l8VR>dV!zQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV?QV!yU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR?nY'TP$^QOY$zYZ%fZz$zz{@^{!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR@eW$_Q'TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zRAUY$[Q'TPOY$zYZ%fZ{$z{|At|!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zRA{V%TQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRBiV#OQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_CXZ$[Q%^W'TPOY$zYZ%fZ}$z}!OAt!O!^$z!^!_%k!_!`6U!`!aCz!a;'S$z;'S;=`&W<%lO$zVDRV#aU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zVDo['TP$]QOY$zYZ%fZ!O$z!O!PEe!P!Q$z!Q![Fs![!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zVEjX'TPOY$zYZ%fZ!O$z!O!PFV!P!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zVF^V#VU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRFz_'TP%XQOY$zYZ%fZ!Q$z!Q![Fs![!^$z!^!_%k!_!g$z!g!hGy!h#R$z#R#SJc#S#X$z#X#YGy#Y;'S$z;'S;=`&W<%lO$zRHO]'TPOY$zYZ%fZ{$z{|Hw|}$z}!OHw!O!Q$z!Q![Ii![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRH|X'TPOY$zYZ%fZ!Q$z!Q![Ii![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRIpZ'TP%XQOY$zYZ%fZ!Q$z!Q![Ii![!^$z!^!_%k!_#R$z#R#SHw#S;'S$z;'S;=`&W<%lO$zRJhX'TPOY$zYZ%fZ!Q$z!Q![Fs![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_K[['TP$^QOY$zYZ%fZz$zz{LQ{!P$z!P!Q,o!Q!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$z_LVX'TPOYLQYZLrZzLQz{N_{!^LQ!^!_! s!_;'SLQ;'S;=`!!i<%lOLQ_LwT'TPOzMWz{Mj{;'SMW;'S;=`NX<%lOMW^MZTOzMWz{Mj{;'SMW;'S;=`NX<%lOMW^MmVOzMWz{Mj{!PMW!P!QNS!Q;'SMW;'S;=`NX<%lOMW^NXO!f^^N[P;=`<%lMW_NdZ'TPOYLQYZLrZzLQz{N_{!PLQ!P!Q! V!Q!^LQ!^!_! s!_;'SLQ;'S;=`!!i<%lOLQ_! ^V!f^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_! vZOYLQYZLrZzLQz{N_{!aLQ!a!bMW!b;'SLQ;'S;=`!!i<%l~LQ~OLQ~~%f_!!lP;=`<%lLQZ!!vm'TP%WYOY$zYZ%fZ!O$z!O!PFs!P!Q$z!Q![!$q![!^$z!^!_%k!_!d$z!d!e!&o!e!g$z!g!hGy!h!q$z!q!r!(a!r!z$z!z!{!){!{#R$z#R#S!%}#S#U$z#U#V!&o#V#X$z#X#YGy#Y#c$z#c#d!(a#d#l$z#l#m!){#m;'S$z;'S;=`&W<%lO$zZ!$xa'TP%WYOY$zYZ%fZ!O$z!O!PFs!P!Q$z!Q![!$q![!^$z!^!_%k!_!g$z!g!hGy!h#R$z#R#S!%}#S#X$z#X#YGy#Y;'S$z;'S;=`&W<%lO$zZ!&SX'TPOY$zYZ%fZ!Q$z!Q![!$q![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!&tY'TPOY$zYZ%fZ!Q$z!Q!R!'d!R!S!'d!S!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!'k['TP%WYOY$zYZ%fZ!Q$z!Q!R!'d!R!S!'d!S!^$z!^!_%k!_#R$z#R#S!&o#S;'S$z;'S;=`&W<%lO$zZ!(fX'TPOY$zYZ%fZ!Q$z!Q!Y!)R!Y!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!)YZ'TP%WYOY$zYZ%fZ!Q$z!Q!Y!)R!Y!^$z!^!_%k!_#R$z#R#S!(a#S;'S$z;'S;=`&W<%lO$zZ!*Q]'TPOY$zYZ%fZ!Q$z!Q![!*y![!^$z!^!_%k!_!c$z!c!i!*y!i#T$z#T#Z!*y#Z;'S$z;'S;=`&W<%lO$zZ!+Q_'TP%WYOY$zYZ%fZ!Q$z!Q![!*y![!^$z!^!_%k!_!c$z!c!i!*y!i#R$z#R#S!){#S#T$z#T#Z!*y#Z;'S$z;'S;=`&W<%lO$zR!,WX!rQ'TPOY$zYZ%fZ![$z![!]!,s!]!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!,zV#yQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!-hV!nU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!.S[$YQOY$zYZ%fZ!^$z!^!_!.x!_!`!/i!`!a*c!a!b!0]!b;'S$z;'S;=`&W<%l~$z~O$z~~%fR!/PW$ZQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR!/pX$YQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`$z!`!a*c!a;'S$z;'S;=`&W<%lO$zP!0bR!jP!_!`!0k!r!s!0p#d#e!0pP!0pO!jPP!0sQ!j!k!0y#[#]!0yP!0|Q!r!s!0k#d#e!0k_!1ZX#|Y'TPOY$zYZ%fZ!^$z!^!_%k!_!`)r!`!a!1v!a;'S$z;'S;=`&W<%lO$zV!1}V#PU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!2kX$YQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`!3W!`!a!.x!a;'S$z;'S;=`&W<%lO$zR!3_V$YQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!3{[!wQ'TPOY$zYZ%fZ}$z}!O!4q!O!^$z!^!_%k!_!`$z!`!a!6P!a!b!6m!b;'S$z;'S;=`&W<%lO$zV!4vX'TPOY$zYZ%fZ!^$z!^!_%k!_!`$z!`!a!5c!a;'S$z;'S;=`&W<%lO$zV!5jV#bU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!6WV!h^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!6tW$RQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR!7eV$dQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!8Ta'aS'TP'WYOY$zYZ%fZ!Q$z!Q![!7z![!^$z!^!_%k!_!c$z!c!}!7z!}#R$z#R#S!7z#S#T$z#T#o!7z#o$g$z$g&j!7z&j;'S$z;'S;=`&W<%lO$z_!9ce'aS'TP'WYOY$zYZ%fZr$zrs!:tsw$zwx8Vx!Q$z!Q![!7z![!^$z!^!_%k!_!c$z!c!}!7z!}#R$z#R#S!7z#S#T$z#T#o!7z#o$g$z$g&j!7z&j;'S$z;'S;=`&W<%lO$zR!:{V'TP'uQOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!;iV#XU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!OZ'TPOY!=yYZ!>qZ!^!=y!^!_!@y!_#O!=y#O#P!Au#P#S!=y#S#T!CP#T;'S!=y;'S;=`!Cm<%lO!=yR!>vV'TPO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s<%lO!?]Q!?`VO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s<%lO!?]Q!?xRO;'S!?];'S;=`!@R;=`O!?]Q!@UWO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!?]<%lO!?]Q!@sO%UQQ!@vP;=`<%l!?]R!@|]OY!=yYZ!>qZ!a!=y!a!b!?]!b#O!=y#O#P!Au#P#S!=y#S#T!CP#T;'S!=y;'S;=`!Cm<%l~!=y~O!=y~~%fR!AzW'TPOY!=yYZ!>qZ!^!=y!^!_!@y!_;'S!=y;'S;=`!Bd;=`<%l!?]<%lO!=yR!BgWO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!=y<%lO!?]R!CWV%UQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!CpP;=`<%l!=y_!CzV!p^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!DjY$UQ#n['TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EY#q;'S$z;'S;=`&W<%lO$zR!EaV$SQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!E}V!oQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FkV$eQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[IO,CO,LO,0,1,2,3,NO],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(O,Q)=>n(O)<<1,external:n},{term:284,get:O=>AO[O]||-1}],tokenPrec:29889}),DO=s.define({name:"php",parser:KO.configure({props:[t.add({IfStatement:c({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:c({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:O=>{let Q=O.textAfter,i=/^\s*\}/.test(Q),a=/^\s*(case|default)\b/.test(Q);return O.baseIndent+(i?0:a?1:2)*O.unit},ColonBlock:O=>O.baseIndent+O.unit,"Block EnumBody DeclarationList":y({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"String BlockComment":()=>null,Statement:c({except:/^({|end(for|foreach|switch|while)\b)/})}),U.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":l,ColonBlock(O){return{from:O.from+1,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function c$(O={}){let Q=[],i;if(O.baseLanguage!==null)if(O.baseLanguage)i=O.baseLanguage;else{let a=w({matchClosingTags:!1});Q.push(a.support),i=a.language}return new Z(DO.configure({wrap:i&&R(a=>a.type.isTop?{parser:i.parser,overlay:P=>P.name=="Text"}:null),top:O.plain?"Program":"Template"}),Q)}export{c$ as php,DO as phpLanguage}; +import{L as V,E as X}from"./index-B2EmydOR.js";import{J as d,Q as $,g as Z,H as R,L as s,z as t,r as c,u as y,x as U,w as l}from"./FileExplorer-DTHAXsem.js";import{html as w}from"./index-DI-4cHpq.js";import"./useI18n-lwZlSdSx.js";import"./index-OVPV9rln.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";import"./index-BHEGRR_x.js";import"./index-ChhOm7oD.js";import"./index-X9DIw5ut.js";const W=1,p=2,q=275,u=3,b=276,_=277,m=278,f=4,k=5,G=6,x=7,r=8,h=9,v=10,g=11,j=12,E=13,I=14,N=15,L=16,F=17,C=18,H=19,A=20,K=21,D=22,B=23,M=24,J=25,OO=26,$O=27,QO=28,iO=29,aO=30,TO=31,PO=32,XO=33,SO=34,cO=35,eO=36,oO=37,_O=38,rO=39,nO=40,zO=41,YO=42,VO=43,dO=44,ZO=45,RO=46,sO=47,tO=48,yO=49,UO=50,lO=51,wO=52,WO=53,pO=54,qO=55,uO=56,bO=57,mO=58,fO=59,kO=60,GO=61,xO=62,e=63,hO=64,vO=65,gO=66,jO={abstract:f,and:k,array:G,as:x,true:r,false:r,break:h,case:v,catch:g,clone:j,const:E,continue:I,declare:L,default:N,do:F,echo:C,else:H,elseif:A,enddeclare:K,endfor:D,endforeach:B,endif:M,endswitch:J,endwhile:OO,enum:$O,extends:QO,final:iO,finally:aO,fn:TO,for:PO,foreach:XO,from:SO,function:cO,global:eO,goto:oO,if:_O,implements:rO,include:nO,include_once:zO,instanceof:YO,insteadof:VO,interface:dO,list:ZO,match:RO,namespace:sO,new:tO,null:yO,or:UO,print:lO,readonly:wO,require:WO,require_once:pO,return:qO,switch:uO,throw:bO,trait:mO,try:fO,unset:kO,use:GO,var:xO,public:e,private:e,protected:e,while:hO,xor:vO,yield:gO,__proto__:null};function n(O){let Q=jO[O.toLowerCase()];return Q??-1}function z(O){return O==9||O==10||O==13||O==32}function Y(O){return O>=97&&O<=122||O>=65&&O<=90}function T(O){return O==95||O>=128||Y(O)}function o(O){return O>=48&&O<=55||O>=97&&O<=102||O>=65&&O<=70}const EO={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},IO=new X(O=>{if(O.next==40){O.advance();let Q=0;for(;z(O.peek(Q));)Q++;let i="",a;for(;Y(a=O.peek(Q));)i+=String.fromCharCode(a),Q++;for(;z(O.peek(Q));)Q++;O.peek(Q)==41&&EO[i.toLowerCase()]&&O.acceptToken(W)}else if(O.next==60&&O.peek(1)==60&&O.peek(2)==60){for(let a=0;a<3;a++)O.advance();for(;O.next==32||O.next==9;)O.advance();let Q=O.next==39;if(Q&&O.advance(),!T(O.next))return;let i=String.fromCharCode(O.next);for(;O.advance(),!(!T(O.next)&&!(O.next>=48&&O.next<=55));)i+=String.fromCharCode(O.next);if(Q){if(O.next!=39)return;O.advance()}if(O.next!=10&&O.next!=13)return;for(;;){let a=O.next==10||O.next==13;if(O.advance(),O.next<0)return;if(a){for(;O.next==32||O.next==9;)O.advance();let P=!0;for(let S=0;S{O.next<0&&O.acceptToken(m)}),LO=new X((O,Q)=>{O.next==63&&Q.canShift(_)&&O.peek(1)==62&&O.acceptToken(_)});function FO(O){let Q=O.peek(1);if(Q==110||Q==114||Q==116||Q==118||Q==101||Q==102||Q==92||Q==36||Q==34||Q==123)return 2;if(Q>=48&&Q<=55){let i=2,a;for(;i<5&&(a=O.peek(i))>=48&&a<=55;)i++;return i}if(Q==120&&o(O.peek(2)))return o(O.peek(3))?4:3;if(Q==117&&O.peek(2)==123)for(let i=3;;i++){let a=O.peek(i);if(a==125)return i==2?0:i+1;if(!o(a))break}return 0}const CO=new X((O,Q)=>{let i=!1;for(;!(O.next==34||O.next<0||O.next==36&&(T(O.peek(1))||O.peek(1)==123)||O.next==123&&O.peek(1)==36);i=!0){if(O.next==92){let a=FO(O);if(a){if(i)break;return O.acceptToken(u,a)}}else if(!i&&(O.next==91||O.next==45&&O.peek(1)==62&&T(O.peek(2))||O.next==63&&O.peek(1)==45&&O.peek(2)==62&&T(O.peek(3)))&&Q.canShift(b))break;O.advance()}i&&O.acceptToken(q)}),HO=d({"Visibility abstract final static":$.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":$.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":$.controlKeyword,"and or xor yield unset clone instanceof insteadof":$.operatorKeyword,"function fn class trait implements extends const enum global interface use var":$.definitionKeyword,"include include_once require require_once namespace":$.moduleKeyword,"new from echo print array list as":$.keyword,null:$.null,Boolean:$.bool,VariableName:$.variableName,"NamespaceName/...":$.namespace,"NamedType/...":$.typeName,Name:$.name,"CallExpression/Name":$.function($.variableName),"LabelStatement/Name":$.labelName,"MemberExpression/Name":$.propertyName,"MemberExpression/VariableName":$.special($.propertyName),"ScopedExpression/ClassMemberName/Name":$.propertyName,"ScopedExpression/ClassMemberName/VariableName":$.special($.propertyName),"CallExpression/MemberExpression/Name":$.function($.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":$.function($.propertyName),"MethodDeclaration/Name":$.function($.definition($.variableName)),"FunctionDefinition/Name":$.function($.definition($.variableName)),"ClassDeclaration/Name":$.definition($.className),UpdateOp:$.updateOperator,ArithOp:$.arithmeticOperator,"LogicOp IntersectionType/&":$.logicOperator,BitOp:$.bitwiseOperator,CompareOp:$.compareOperator,ControlOp:$.controlOperator,AssignOp:$.definitionOperator,"$ ConcatOp":$.operator,LineComment:$.lineComment,BlockComment:$.blockComment,Integer:$.integer,Float:$.float,String:$.string,ShellExpression:$.special($.string),"=> ->":$.punctuation,"( )":$.paren,"#[ [ ]":$.squareBracket,"${ { }":$.brace,"-> ?->":$.derefOperator,", ; :: : \\":$.separator,"PhpOpen PhpClose":$.processingInstruction}),AO={__proto__:null,static:325,STATIC:325,class:351,CLASS:351},KO=V.deserialize({version:14,states:"%#[Q`OWOOQhQaOOP%oO`OOOOO#t'#Hh'#HhO%tO#|O'#DuOOO#u'#Dx'#DxQ&SOWO'#DxO&XO$VOOOOQ#u'#Dy'#DyO&lQaO'#D}O'[QdO'#EQO+QQdO'#IqO+_QdO'#ERO-RQaO'#EXO/bQ`O'#EUO/gQ`O'#E_O2UQaO'#E_O2]Q`O'#EgO2bQ`O'#EqO-RQaO'#EqO2mQpO'#FOO2rQ`O'#FOOOQS'#Iq'#IqO2wQ`O'#ExOOQS'#Ih'#IhO5SQdO'#IeO9UQeO'#F]O-RQaO'#FlO-RQaO'#FmO-RQaO'#FnO-RQaO'#FoO-RQaO'#FoO-RQaO'#FrOOQO'#Ir'#IrO9cQ`O'#FxOOQO'#Ht'#HtO9kQ`O'#HXO:VQ`O'#FsO:bQ`O'#HfO:mQ`O'#GPO:uQaO'#GQO-RQaO'#G`O-RQaO'#GcO;bOrO'#GfOOQS'#JP'#JPOOQS'#JO'#JOOOQS'#Ie'#IeO/bQ`O'#GmO/bQ`O'#GoO/bQ`O'#GtOhQaO'#GvO;iQ`O'#GwO;nQ`O'#GzO:]Q`O'#G}O;sQeO'#HOO;sQeO'#HPO;sQeO'#HQO;}Q`O'#HROhQ`O'#HVO:]Q`O'#HWO>mQ`O'#HWO;}Q`O'#HXO:]Q`O'#HZO:]Q`O'#H[O:]Q`O'#H]O>rQ`O'#H`O>}Q`O'#HaOQO!$dQ`O,5POOQ#u-E;h-E;hO!1QQ`O,5=tOOO#u,5:_,5:_O!1]O#|O,5:_OOO#u-E;g-E;gOOOO,5>|,5>|OOQ#y1G0T1G0TO!1eQ`O1G0YO-RQaO1G0YO!2wQ`O1G0qOOQS1G0q1G0qOOQS'#Eo'#EoOOQS'#Il'#IlO-RQaO'#IlOOQS1G0r1G0rO!4ZQ`O'#IoO!5pQ`O'#IqO!5}QaO'#EwOOQO'#Io'#IoO!6XQ`O'#InO!6aQ`O,5;aO-RQaO'#FXOOQS'#FW'#FWOOQS1G1[1G1[O!6fQdO1G1dO!8kQdO1G1dO!:WQdO1G1dO!;sQdO1G1dO!=`QdO1G1dO!>{QdO1G1dO!@hQdO1G1dO!BTQdO1G1dO!CpQdO1G1dO!E]QdO1G1dO!FxQdO1G1dO!HeQdO1G1dO!JQQdO1G1dO!KmQdO1G1dO!MYQdO1G1dO!NuQdO1G1dOOQT1G0_1G0_O!#[Q`O,5<_O#!bQaO'#EYOOQS1G0[1G0[O#!iQ`O,5:zOEdQaO,5:zO#!nQaO,5;OO#!uQdO,5:|O#$tQdO,5?UO#&sQaO'#HmO#'TQ`O,5?TOOQS1G0e1G0eO#']Q`O1G0eO#'bQ`O'#IkO#(zQ`O'#IkO#)SQ`O,5;SOG|QaO,5;SOOQS1G0w1G0wOOQO,5>^,5>^OOQO-E;p-E;pOOQS1G1U1G1UO#)pQdO'#FQO#+uQ`O'#HsOJ}QpO1G1UO2wQ`O'#HpO#+zQtO,5;eO2wQ`O'#HqO#,iQtO,5;gO#-WQaO1G1OOOQS,5;h,5;hO#/gQtO'#FQO#/tQdO1G0dO-RQaO1G0dO#1aQdO1G1aO#2|QdO1G1cOOQO,5X,5>XOOQO-E;k-E;kOOQS7+&P7+&PO!+iQaO,5;TO$$^QaO'#HnO$$hQ`O,5?VOOQS1G0n1G0nO$$pQ`O1G0nPOQO'#FQ'#FQOOQO,5>_,5>_OOQO-E;q-E;qOOQS7+&p7+&pOOQS,5>[,5>[OOQS-E;n-E;nO$$uQtO,5>]OOQS-E;o-E;oO$%dQdO7+&jO$'iQtO'#FQO$'vQdO7+&OOOQS1G0j1G0jOOQO,5>a,5>aOOQO-E;s-E;sOOQ#u7+(x7+(xO!$[QdO7+(xOOQ#u7+(}7+(}O#JfQ`O7+(}O#JkQ`O7+(}OOQ#u7+(z7+(zO!.]Q`O7+(zO!1TQ`O7+(zO!1QQ`O7+(zO$)cQ`O,5i,5>iOOQS-E;{-E;{O$.lQdO7+'qO$.|QpO7+'qO$/XQdO'#IxOOQO,5pOOQ#u,5>p,5>pOOQ#u-EoOOQS-EVQdO1G2^OOQS,5>h,5>hOOQS-E;z-E;zOOQ#u7+({7+({O$?oQ`O'#GXO:]Q`O'#H_OOQO'#IV'#IVO$@fQ`O,5=xOOQ#u,5=x,5=xO$AcQ!bO'#EQO$AzQ!bO7+(}O$BYQpO7+)RO#KRQpO7+)RO$BbQ`O'#HbO!$[QdO7+)RO$BpQdO,5>rOOQS-EVOOQS-E;i-E;iO$D{QdO<Z,5>ZOOQO-E;m-E;mOOQS1G1_1G1_O$8rQaO,5:uO$G}QaO'#HlO$H[Q`O,5?QOOQS1G0`1G0`OOQS7+&Q7+&QO$HdQ`O7+&UO$IyQ`O1G0oO$K`Q`O,5>YOOQO,5>Y,5>YOOQO-E;l-E;lOOQS7+&Y7+&YOOQS7+&U7+&UOOQ#u<c,5>cOOQO-E;u-E;uOOQS<lOOQ#u-EmOOQO-EW,5>WOOQO-E;j-E;jO!+iQaO,5;UOOQ#uANBTANBTO#JfQ`OANBTOOQ#uANBQANBQO!.]Q`OANBQO!+iQaO7+'hOOQO7+'l7+'lO%-bQ`O7+'hO%.wQ`O7+'hO%/SQ`O7+'lO!+iQaO7+'mOOQO7+'m7+'mO%/XQdO'#F}OOQO'#Hv'#HvO%/jQ`O,5e,5>eOOQS-E;w-E;wOOQO1G2_1G2_O$1YQdO1G2_O$/jQpO1G2_O#JkQ`O1G2]O!.mQdO1G2aO%$dQ!bO1G2]O!$[QdO1G2]OOQO1G2a1G2aOOQO1G2]1G2]O%2uQaO'#G]OOQO1G2b1G2bOOQSAN@xAN@xO!.]Q`OAN@xOOOQ<]O%6rQ!bO'#FQO!$[QdOANBXOOQ#uANBXANBXO:]Q`O,5=}O%7WQ`O,5=}O%7cQ`O'#IXO%7wQ`O,5?rOOQS1G3h1G3hOOQS7+)x7+)xP%+OQpOANBXO%8PQ`O1G0pOOQ#uG27oG27oOOQ#uG27lG27lO%9fQ`O<d,5>dO%dOOQO-E;v-E;vO%hQ`O'#IqO%>rQ`O'#IhO!$[QdO'#IOO%@lQaO,5s,5>sOOQO-Ej,5>jOOQP-E;|-E;|OOQO1G2c1G2cOOQ#uLD,kLD,kOOQTG27[G27[O!$[QdOLD-RO!$[QdO<OO%EpQ`O,5>OPOQ#uLD-_LD-_OOQO7+'o7+'oO+_QdO7+'oOOQS!$( ]!$( ]OOQOAN@}AN@}OOQS1G2d1G2dOOQS1G2e1G2eO%E{QdO1G2eOOQ#u!$(!m!$(!mOOQOANBVANBVOOQO1G3j1G3jO:]Q`O1G3jOOQO<tQaO,5:xO'/vQaO,5;uO'/vQaO,5;wO'@sQdO,5YQdO,5<^O)@XQdO,5QQ`O,5=eO*>YQaO'#HkO*>dQ`O,5?ROlQdO7+%tO*@kQ`O1G0jO!+iQaO1G0jO*BQQdO7+&OOoO*GeQ`O,5>VO*HzQdO<[QdO,5{QdO'#IjO.BbQ`O'#IeO.BoQ`O'#GPO.BwQaO,5:nO.COQ`O,5uOs#fOx7xOy7xO}aO!O^O!Q8OO!R}O!T7}O!V7yO!W7yO!Z8QO!d:QO!z]O#T#mO#V#lO#X`O#dhO#fbO#gcO#sdO$[7|O$d7{O$e7|O$hqO%T8PO%U!OO%W}O%X}O%`|O'WYO'u{O#Y']P~O#O#qO~P/lO!z#rO~O#d#tO#fbO#gcO~O'a#vO~O#s#zO~OU$OO!R$OO!w#}O#s3hO'W#{O~OT'XXz'XX!S'XX!c'XX!n'XX!w'XX!z'XX#T'XX#X'XX#a'XX#b'XX#y'XX$R'XX$S'XX$T'XX$U'XX$V'XX$X'XX$Y'XX$Z'XX$['XX$]'XX$^'XX$_'XX%T'XX'P'XX!y'XX!o'XX~O#|$QO$O$RO~P3YOP7wOQ|OU_OW}O[7zOo>uOs#fOx7xOy7xO}aO!O^O!Q8OO!R}O!T7}O!V7yO!W7yO!Z8QO!d:QO!z]O#X`O#dhO#fbO#gcO#sdO$[7|O$d7{O$e7|O$hqO%T8PO%U!OO%W}O%X}O%`|O'WYO'u{OT$PXz$PX!S$PX!c$PX!n$PX!w$PX#a$PX#b$PX#y$PX$R$PX$S$PX$T$PX$U$PX$V$PX$X$PX$Y$PX$Z$PX$]$PX$^$PX$_$PX'P$PX!y$PX!o$PX~Or$TO#T8eO#V8dO~P5^O#sdO'WYO~OS$fO]$aOk$dOm$fOs$`O!a$bO$krO$u$eO~O!z$hO#T$jO'W$gO~Oo$mOs$lO#d$nO~O!z$hO#T$rO~O!U$uO$u$tO~P-ROR${O!p$zO#d$yO#g$zO&}${O~O't$}O~P;PO!z%SO~O!z%UO~O!n#bO'P#bO~P-RO!pXO~O!z%`O~OP7wOQ|OU_OW}O[7zOo>uOs#fOx7xOy7xO}aO!O^O!Q8OO!R}O!T7}O!V7yO!W7yO!Z8QO!d:QO!z]O#X`O#dhO#fbO#gcO#sdO$[7|O$d7{O$e7|O$hqO%T8PO%U!OO%W}O%X}O%`|O'WYO'u{O~O!z%dO~O]$aO~O!pXO#sdO'WYO~O]%rOs%rO#s%nO'WYO~O!j%wO'Q%wO'TRO~O'Q%zO~PhO!o%{O~PhO!r%}O~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'cX#O'cX~P!%aO!r)yO!y'eX#O'eX~P)dO!y#kX#O#kX~P!+iO#O){O!y'bX~O!y)}O~O%T#cOT$Qiz$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi$_$Qi'P$Qi!y$Qi#O$Qi#P$Qi#Y$Qi!o$Qi!r$QiV$Qi#|$Qi$O$Qi!p$Qi~P!%aOz#QO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO!w!yO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi'P$Qi!y$Qi!o$Qi~P!%aOT#SOz#QO!c#UO!w!yO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cO!S$Qi!n$Qi'P$Qi!y$Qi!o$Qi~P!%aOT#SOz#QO!w!yO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cO!S$Qi!c$Qi!n$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi$T$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi$T$Qi$U$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO#T#PO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$[#_O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$Z#^O$[#_O$^#aO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi'P$Qi!y$Qi!o$Qi~P!%aOz#QO$_#aO%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi'P$Qi!y$Qi!o$Qi~P!%aO_*PO~PxO$hqO$krO~P2wO#X+|O#a+{O#b+{O~O#d,OO%W,OO%^+}O'W$gO~O!o,PO~PCVOc%bXd%bXh%bXj%bXf%bXg%bXe%bX~PhOc,TOd,ROP%aiQ%aiS%aiU%aiW%aiX%ai[%ai]%ai^%ai`%aia%aib%aik%aim%aio%aip%aiq%ais%ait%aiu%aiv%aix%aiy%ai|%ai}%ai!O%ai!P%ai!Q%ai!R%ai!T%ai!V%ai!W%ai!X%ai!Y%ai!Z%ai![%ai!]%ai!^%ai!_%ai!a%ai!b%ai!d%ai!n%ai!p%ai!z%ai#X%ai#d%ai#f%ai#g%ai#s%ai$[%ai$d%ai$e%ai$h%ai$k%ai$u%ai%T%ai%U%ai%W%ai%X%ai%`%ai&|%ai'W%ai'u%ai'Q%ai!o%aih%aij%aif%aig%aiY%ai_%aii%aie%ai~Oc,XOd,UOh,WO~OY,YO_,ZO!o,^O~OY,YO_,ZOi%gX~Oi,`O~Oj,aO~O!n,cO~PxO$hqO$krO~P2wO!p)`O~OU$OO!R$OO!w3nO#s3iO'W,zO~O#s,|O~O!p-OO'a'UO~O#sdO'WYO!n&zX#O&zX'P&zX~O#O)gO!n'ya'P'ya~O#s-UO~O!n&_X#O&_X'P&_X#P&_X~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#ka#O#ka~P!%aO!y&cX#O&cX~P@aO#O){O!y'ba~O!o-_O~PCVO#P-`O~O#O-aO!o'YX~O!o-cO~O!y-dO~OT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O#Wi#Y#Wi~P!%aO!y&bX#O&bX~PxO#n'XO~OS+kO].cOm+kOs$`O!U+kO!`+kO!a+kO#d>xO$hqO$krO~P2wOS+kO].cOm+kOs$`O!U+kO!`+kO!a+kO#d>xO$hqO~P2wO!n#bO!p-yO'P#bO~OS+kO]+nOm+kOs$`O!U+kO!_+qO!`+kO!a+kO!o.mO#d>xO$hqO$krO~P2wO#d.rO%W.rO%^+}O'W$gO~O%W.sO~O#Y.tO~Oc%bad%bah%baj%baf%bag%bae%ba~PhOc.wOd,ROP%aqQ%aqS%aqU%aqW%aqX%aq[%aq]%aq^%aq`%aqa%aqb%aqk%aqm%aqo%aqp%aqq%aqs%aqt%aqu%aqv%aqx%aqy%aq|%aq}%aq!O%aq!P%aq!Q%aq!R%aq!T%aq!V%aq!W%aq!X%aq!Y%aq!Z%aq![%aq!]%aq!^%aq!_%aq!a%aq!b%aq!d%aq!n%aq!p%aq!z%aq#X%aq#d%aq#f%aq#g%aq#s%aq$[%aq$d%aq$e%aq$h%aq$k%aq$u%aq%T%aq%U%aq%W%aq%X%aq%`%aq&|%aq'W%aq'u%aq'Q%aq!o%aqh%aqj%aqf%aqg%aqY%aq_%aqi%aqe%aq~Oc.|Od,UOh.{O~O!r(hO~OP7wOQ|OU_OW}O[xO$hqO$krO~P2wOS+kOY,vO]+nOm+kOs$`O!U+kO!_+qO!`+kO!a+kO!o/fO#d>xO$hqO$krO~P2wOw!tX!p!tX#T!tX#n!tX#s#vX#|!tX'W!tX~Ow(ZO!p)`O#T3tO#n3sO~O!p-OO'a&fa~O]/nOs/nO#sdO'WYO~OV/rO!n&za#O&za'P&za~O#O)gO!n'yi'P'yi~O#s/tO~OT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!n&_a#O&_a'P&_a#P&_a~P!%aOz#QO#T#PO$R#RO$S#VO$T#WO$U#XO$V#YO$X#[O$Y#]O$Z#^O$[#_O$]#`O$^#aO$_#aO%T#cOT!vy!S!vy!c!vy!n!vy!w!vy'P!vy!y!vy!o!vy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#ji#O#ji~P!%aO_*PO!o&`X#O&`X~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#]i#O#]i~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#P/yO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!y&ba#O&ba~P!%aO#|0OO!y$ji#O$ji~O#d0PO~O#V0SO#d0RO~P2wOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ji#O$ji~P!%aO!p-yO#|0TO!y$oi#O$oi~O!o0YO'W$gO~O#O0[O!y'kX~O#d0^O~O!y0_O~O!pXO!r0bO~O#T'ZO#n'XO!p'qy!n'qy'P'qy~O!n$sy'P$sy!y$sy!o$sy~PCVO#P0eO#T'ZO#n'XO~O#sdO'WYOw&mX!p&mX#O&mX!n&mX'P&mX~O#O.^Ow'la!p'la!n'la'P'la~OS+kO]0mOm+kOs$`O!U+kO!`+kO!a+kO#d>xO$hqO~P2wO#T3tO#n3sO'W$gO~O#|)XO#T'eX#n'eX'W'eX~O!n#bO!p0sO'P#bO~O#Y0wO~Oh0|O~OTvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$jq#O$jq~P!%aO#|1kO!y$jq#O$jq~O#d1lO~O!n#bO!pXO!z$hO#P1oO'P#bO~O!o1rO'W$gO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$oq#O$oq~P!%aO#T1tO#d1sO!y&lX#O&lX~O#O0[O!y'ka~O#T'ZO#n'XO!p'q!R!n'q!R'P'q!R~O!pXO!r1yO~O!n$s!R'P$s!R!y$s!R!o$s!R~PCVO#P1{O#T'ZO#n'XO~OP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#^i#O#^i~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$jy#O$jy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$oy#O$oy~P!%aO!pXO#P2rO~O#d2sO~O#O0[O!y'ki~O!n$s!Z'P$s!Z!y$s!Z!o$s!Z~PCVOTvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$j!R#O$j!R~P!%aO!n$s!c'P$s!c!y$s!c!o$s!c~PCVO!a3`O'W$gO~OV3dO!o&Wa#O&Wa~O'W$gO!n%Ri'P%Ri~O'a'_O~O'a/jO~O'a*iO~O'a1]O~OT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$ta#|$ta$O$ta'P$ta!y$ta!o$ta#O$ta~P!%aO#T3uO~P-RO#s3lO~O#s3mO~O!U$uO$u$tO~P#-WOT8TOz8RO!S8UO!c8VO!w:_O#P3pO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!n'^X'P'^X!y'^X!o'^X~P!%aOT6QOz6OO!S6RO!c6SO!w7oO#P5aO#T#PO$R6PO$S6TO$T6UO$U6VO$V6WO$X6YO$Y6ZO$Z6[O$[6]O$]6^O$^6_O$_6_O%T#cO#O'^X#Y'^X#|'^X$O'^X!n'^X'P'^X!r'^X!y'^X!o'^XV'^X!p'^X~P!%aO#T5OO~P#-WOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$`a#|$`a$O$`a'P$`a!y$`a!o$`a#O$`a~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$aa#|$aa$O$aa'P$aa!y$aa!o$aa#O$aa~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$ba#|$ba$O$ba'P$ba!y$ba!o$ba#O$ba~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$ca#|$ca$O$ca'P$ca!y$ca!o$ca#O$ca~P!%aOz3{O#|$ca$O$ca#O$ca~PMVOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$fa#|$fa$O$fa'P$fa!y$fa!o$fa#O$fa~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n%Va#|%Va$O%Va'P%Va!y%Va!o%Va#O%Va~P!%aOz3{O#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOT3}Oz3{O!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!S$Qi!n$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOT3}Oz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!S$Qi!c$Qi!n$Qi#|$Qi$O$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O#T#PO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$[4YO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$Z4XO$[4YO$^4[O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOz3{O$_4[O%T#cOT$Qi!S$Qi!c$Qi!n$Qi!w$Qi#T$Qi#|$Qi$O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi'P$Qi!y$Qi!o$Qi#O$Qi~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n#Ua#|#Ua$O#Ua'P#Ua!y#Ua!o#Ua#O#Ua~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n'^a#|'^a$O'^a'P'^a!y'^a!o'^a#O'^a~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT#Qi!S#Qi!c#Qi!n#Qi#|#Qi$O#Qi'P#Qi!y#Qi!o#Qi#O#Qi~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT#}i!S#}i!c#}i!n#}i#|#}i$O#}i'P#}i!y#}i!o#}i#O#}i~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$Pi#|$Pi$O$Pi'P$Pi!y$Pi!o$Pi#O$Pi~P!%aOz3{O#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT!vq!S!vq!c!vq!n!vq!w!vq#|!vq$O!vq'P!vq!y!vq!o!vq#O!vq~P!%aOz3{O!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT#Qq!S#Qq!c#Qq!n#Qq#|#Qq$O#Qq'P#Qq!y#Qq!o#Qq#O#Qq~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$sq#|$sq$O$sq'P$sq!y$sq!o$sq#O$sq~P!%aOz3{O#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cOT!vy!S!vy!c!vy!n!vy!w!vy#|!vy$O!vy'P!vy!y!vy!o!vy#O!vy~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$sy#|$sy$O$sy'P$sy!y$sy!o$sy#O$sy~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$s!R#|$s!R$O$s!R'P$s!R!y$s!R!o$s!R#O$s!R~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$s!Z#|$s!Z$O$s!Z'P$s!Z!y$s!Z!o$s!Z#O$s!Z~P!%aOT3}Oz3{O!S4OO!c4PO!w5rO#T#PO$R3|O$S4QO$T4RO$U4SO$V4TO$X4VO$Y4WO$Z4XO$[4YO$]4ZO$^4[O$_4[O%T#cO!n$s!c#|$s!c$O$s!c'P$s!c!y$s!c!o$s!c#O$s!c~P!%aOP7wOU_O[5kOo9xOs#fOx5gOy5gO}aO!O^O!Q5{O!T5qO!V5iO!W5iO!Z5}O!d5eO!z]O#T5bO#X`O#dhO#fbO#gcO#sdO$[5oO$d5mO$e5oO$hqO%T5|O%U!OO'WYO~P$vO#O9_O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'xX~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#O9aO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'ZX~P!%aOz8RO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOT8TOz8RO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!S$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOT8TOz8RO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!S$Qi!c$Qi#O$Qi#P$Qi#Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi$T$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO#T#PO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$[8`O$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$Z8_O$[8`O$^8bO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aOz8RO$_8bO%T#cOT$Qi!S$Qi!c$Qi!w$Qi#O$Qi#P$Qi#T$Qi#Y$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi!n$Qi'P$Qi!r$Qi!y$Qi!o$QiV$Qi!p$Qi~P!%aO#T9fO~P!+iO!n#Ua'P#Ua!y#Ua!o#Ua~PCVO!n'^a'P'^a!y'^a!o'^a~PCVO#T=PO#V=OO!y&aX#O&aX~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#Wi#O#Wi~P!%aOz8RO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT#Qq!S#Qq!c#Qq#O#Qq#P#Qq#Y#Qq!n#Qq'P#Qq!r#Qq!y#Qq!o#QqV#Qq!p#Qq~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$sq#P$sq#Y$sq!n$sq'P$sq!r$sq!y$sq!o$sqV$sq!p$sq~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y&wa#O&wa~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y&_a#O&_a~P!%aOz8RO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cOT!vy!S!vy!c!vy!w!vy#O!vy#P!vy#Y!vy!n!vy'P!vy!r!vy!y!vy!o!vyV!vy!p!vy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#Wq#O#Wq~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$sy#P$sy#Y$sy!n$sy'P$sy!r$sy!y$sy!o$syV$sy!p$sy~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$s!R#P$s!R#Y$s!R!n$s!R'P$s!R!r$s!R!y$s!R!o$s!RV$s!R!p$s!R~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$s!Z#P$s!Z#Y$s!Z!n$s!Z'P$s!Z!r$s!Z!y$s!Z!o$s!ZV$s!Z!p$s!Z~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO#O$s!c#P$s!c#Y$s!c!n$s!c'P$s!c!r$s!c!y$s!c!o$s!cV$s!c!p$s!c~P!%aO#T9vO~PvO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$`a#O$`a~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$aa#O$aa~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ba#O$ba~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ca#O$ca~P!%aOz:`O%T#cOT$ca!S$ca!c$ca!w$ca!y$ca#O$ca#T$ca$R$ca$S$ca$T$ca$U$ca$V$ca$X$ca$Y$ca$Z$ca$[$ca$]$ca$^$ca$_$ca~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$fa#O$fa~P!%aO!r?SO#P9^O~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$ta#O$ta~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y%Va#O%Va~P!%aOT8TOz8RO!S8UO!c8VO!r9cO!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aOz:`O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!y$Qi#O$Qi~P!%aOT:bOz:`O!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!S$Qi!y$Qi#O$Qi~P!%aOT:bOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!S$Qi!c$Qi!y$Qi#O$Qi~P!%aOz:`O#T#PO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi~P!%aOz:`O#T#PO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi$T$Qi~P!%aOz:`O#T#PO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi$T$Qi$U$Qi~P!%aOz:`O#T#PO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi~P!%aOz:`O$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi~P!%aOz:`O$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi~P!%aOz:`O$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi~P!%aOz:`O$[:mO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$]$Qi~P!%aOz:`O$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi~P!%aOz:`O$Z:lO$[:mO$^:oO$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$]$Qi~P!%aOz:`O$_:oO%T#cOT$Qi!S$Qi!c$Qi!w$Qi!y$Qi#O$Qi#T$Qi$R$Qi$S$Qi$T$Qi$U$Qi$V$Qi$X$Qi$Y$Qi$Z$Qi$[$Qi$]$Qi$^$Qi~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT#Qi!S#Qi!c#Qi!y#Qi#O#Qi~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT#}i!S#}i!c#}i!y#}i#O#}i~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$Pi#O$Pi~P!%aO!r?TO#P9hO~Oz:`O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT!vq!S!vq!c!vq!w!vq!y!vq#O!vq~P!%aOz:`O!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT#Qq!S#Qq!c#Qq!y#Qq#O#Qq~P!%aO!r?YO#P9oO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$sq#O$sq~P!%aO#P9oO#T'ZO#n'XO~Oz:`O#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cOT!vy!S!vy!c!vy!w!vy!y!vy#O!vy~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$sy#O$sy~P!%aO#P9pO#T'ZO#n'XO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$s!R#O$s!R~P!%aO#P9sO#T'ZO#n'XO~OT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$s!Z#O$s!Z~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y$s!c#O$s!c~P!%aO#T;}O~P!+iOT8TOz8RO!S8UO!c8VO!w:_O#P;|O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!y'^X#O'^X~P!%aO!U$uO$u$tO~P$8rOP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QVO~P$8rOP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QWO#X`O#dhO#fbO#gcO#sdO$[vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y#Ua#O#Ua~P!%aOT:bOz:`O!S:cO!c:dO!w>vO#T#PO$R:aO$S:eO$T:fO$U:gO$V:hO$X:jO$Y:kO$Z:lO$[:mO$]:nO$^:oO$_:oO%T#cO!y'^a#O'^a~P!%aOz<]O!w?^O#T#PO$R<_O$SpO~P$8rOP7wOU_O[:rOo?tOs#fOx:rOy:rO}aO!O^O!QqO#X`O#dhO#fbO#gcO#sdO$[oO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aOT8TOz8RO!S8UO!c8VO!w:_O#P>nO#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO!n'^X!r'^X!o'^X#O'^X!p'^X'P'^X~P!%aOT'XXz'XX!S'XX!c'XX!w'XX!z'XX#O'XX#T'XX#X'XX#a'XX#b'XX#y'XX$R'XX$S'XX$T'XX$U'XX$V'XX$X'XX$Y'XX$Z'XX$['XX$]'XX$^'XX$_'XX%T'XX~O#|:uO$O:vO!y'XX~P.@qO!z$hO#T>zO~O!r;SO~PxO!n&qX!p&qX#O&qX'P&qX~O#O?QO!n'pa!p'pa'P'pa~O!r?rO#P;uO~OT[O~O!r?zO#P:rO~OT8TOz8RO!S8UO!c8VO!r>]O!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aOT8TOz8RO!S8UO!c8VO!r>^O!w:_O#T#PO$R8SO$S8WO$T8XO$U8YO$V8ZO$X8]O$Y8^O$Z8_O$[8`O$]8aO$^8bO$_8bO%T#cO~P!%aO!r?{O#P>cO~O!r?|O#P>hO~O#P>hO#T'ZO#n'XO~O#P:rO#T'ZO#n'XO~O#P>iO#T'ZO#n'XO~O#P>lO#T'ZO#n'XO~O!z$hO#T?nO~Oo>wOs$lO~O!z$hO#T?oO~O#O?QO!n'pX!p'pX'P'pX~O!z$hO#T?vO~O!z$hO#T?wO~O!z$hO#T?xO~Oo?lOs$lO~Oo?uOs$lO~Oo?tOs$lO~O%X$]%W$k!e$^#d%`#g'u'W#f~",goto:"%1O'{PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP'|P(TPP(Z(^PPP(vP(^*o(^6cP6cPP>cFxF{PP6cGR! RP! UP! UPPGR! e! h! lGRGRPP! oP! rPPGR!)u!0q!0qGR!0uP!0u!0u!0u!2PP!;g!S#>Y#>h#>n#>x#?O#?U#?[#?b#?l#?v#?|#@S#@^PPPPPPPP#@d#@hP#A^$(h$(k$(u$1R$1_$1t$1zP$1}$2Q$2W$5[$?Y$Gr$Gu$G{$HO$Kb$Ke$Kn$Kv$LQ$Li$MP$Mz%'}PP%0O%0S%0`%0u%0{Q!nQT!qV!rQUOR%x!mRVO}!hPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]|!hPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]Q%_!ZQ%h!aQ%m!eQ'k$cQ'x$iQ)d%lQ+W'{Q,k)QU.O+T+V+]Q.j+pQ/`,jS0a.T.UQ0q.dQ1n0VS1w0`0dQ2Q0nQ2q1pQ2t1xR3[2u|ZPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]2lf]`cgjklmnoprxyz!W!X!Y!]!e!f!g!y!z#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r#}$Q$R$T$h$z%S%U%d%r%}&S&W&[&q&t&u&x'P'X'Z']'a'e'p't'y(R(V(W(Y(Z([(t)T)X)`)c)g)n)u)y*V*Z*[*r*w*|+Q+X+[+^+_+j+m+q+t,Y,c,e,g,i,u,x-O-`-a-t-v-z.S.V.[.].^.b/X/n/y0O0T0b0e1R1S1b1k1o1y1{2k2r3n3p3s3t3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7i7j7k7o7w7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v9|9}:O:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?S?T?Y?^?_?p?q?r?y?z?{?|S$ku$`Q%W!V^%e!_$a'j)Y.f0o2OQ%i!bQ%j!cQ%k!dQ%v!kS&V!|){Q&]#OQ'l$dQ'm$eS'|$j'hQ)S%`Q*v'nQ+z(bQ,O(dQ-S)iU.g+n.c0mQ.q+{Q.r+|Q/d,vS0V-y0XQ1X/cQ1e/rS2T0s2WQ2h1`Q3U2iQ3^2zQ3_2{Q3c3VQ3f3`R3g3d0{!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_0z!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_Q#h^Q%O!PQ%P!QQ%Q!RQ,b(sQ.u,RR.y,UR&r#hQ*Q&qR/w-a0{hPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_R#j_k#n`j#i#q&t&x5d5e9W:Q:R:S:TR#saT&}#r'PR-h*[R&R!{0zhPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_R#tb-x!}[#e#k#u$U$V$W$X$Y$Z$v$w%X%Z%]%a%s%|&O&U&_&`&a&b&c&d&e&f&g&h&i&j&k&l&m&n&v&w&|'`'b'c(e(x)v)x)z*O*U*h*j+a+d,n,q-W-Y-[-e-f-g-w.Y/O/[/v0Q0Z0f1g1j1m1z2S2`2o2p2v3Z4]4^4d4e4f4g4h4i4j4l4m4n4o4p4q4r4s4t4u4v4w4x4y4z4{4|4}5P5Q5T5U5W5X5Y5]5^5`5t6e6f6g6h6i6j6k6m6n6o6p6q6r6s6t6u6v6w6x6y6z6{6|6}7O7Q7R7U7V7X7Y7Z7^7_7a7m7q8i8j8k8l8m8n8p8q8r8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9U9V9Y9[9]9d9e9g9i9j9k9l9m9n9q9r9t9w:p:x:y:z:{:|:};Q;R;T;U;V;W;X;Y;Z;[;];^;_;`;a;b;c;d;f;g;l;m;p;r;s;w;y;{O>P>Q>R>S>T>U>X>Y>Z>_>`>a>b>d>e>f>g>j>k>m>r>s>{>|>}?V?b?cQ'd$[Y(X$s8o;P=^=_S(]3o7lQ(`$tR+y(aT&X!|){#a$Pg#}$h'X'Z'p't'y(W([)`)c*r*w+Q+X+[+_+j+m+n+t,i,u,x-v.S.V.].b.c0b0m1y3n3s3t7i7j7k7w9|9}:O?S?T?Y?p?q?r?y?z?{?|3yfPVX]`cgjklmnoprxyz!S!W!X!Y!]!e!f!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r#}$Q$R$T$h$z%O%Q%S%T%U%V%d%r%}&S&W&[&q&t&u&x'P'X'Z']'a'e'p't'y(R(V(W(Y(Z([(h(t)T)X)`)c)g)n)u)y){*V*Z*[*r*w*|+Q+X+[+^+_+j+m+n+q+t,Q,T,Y,c,e,g,i,u,x-O-`-a-t-v-z.S.V.[.].^.b.c.u.w/P/X/n/y0O0T0b0e0m0s0}1O1R1S1W1b1k1o1y1{2W2]2k2r3n3p3s3t3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7i7j7k7o7w7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v9|9}:O:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?S?T?Y?^?_?p?q?r?y?z?{?|[#wd#x3h3i3j3kh'V#z'W)f,}-U/k/u1f3l3m3q3rQ)e%nR-T)kY#yd%n)k3h3iV'T#x3j3k1dePVX]`cjklmnoprxyz!S!W!X!Y!]!e!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a'e(R(V(Y(Z(h(t)T)X)g)n)u)y){*V*Z*[*|+^+q,Q,T,Y,c,e,g-O-`-a-t-z.[.^.u.w/P/X/n/y0O0T0e0s0}1O1R1S1W1b1k1o1{2W2]2k2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_Q%o!fQ)l%r#O3vg#}$h'X'Z'p't'y(W([)`*w+Q+X+[+_+j+m+t,i,u,x-v.S.V.].b0b1y7i7j7k7w9|9}:O?S?T?Y?p?q?r?y?z?{?|a3w)c*r+n.c0m3n3s3tY'T#z)f-U3l3mZ*c'W,}/u3q3r0vhPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0}1O1R1S1W1k1o1{2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T2U0s2WR&^#OR&]#O!r#Z[#e#u$U$V$W$X$Z$s$w%X%Z%]&`&a&b&c&d&e&f&g'`'b'c(e)v)x*O*j+d-Y.Y0f1z2`2p2v3Z9U9V!Y4U3o4d4e4f4g4i4j4l4m4n4o4p4q4r4s4{4|4}5P5Q5T5U5W5X5Y5]5^5`!^6X4^6e6f6g6h6j6k6m6n6o6p6q6r6s6t6|6}7O7Q7R7U7V7X7Y7Z7^7_7a7l7m#b8[#k%a%s%|&O&v&w&|(x*U+a,n,q-W-e-g/[4]5t7q8i8j8k8l8n8o8p8t8u8v8w8x8y8z8{9Y9[9]9d9g9i9l9n9q9r9t9w:p;Rr>s>{?b?c!|:i&U)z-[-f-w0Q0Z1g1j1m2o8q8r9e9j9k9m:x:y:z:{:};P;Q;T;U;V;W;X;Y;Z;[;d;f;g;l;m;p;r;s;w;y;{>R>S!`T>X>Z>_>a>d>e>g>j>k>m>|>}?VoU>Y>`>b>fS$iu#fQ$qwU'{$j$l&pQ'}$kS(P$m$rQ+Z'|Q+](OQ+`(QQ1p0VQ5s7dS5v7f7gQ5w7hQ7p9xS7r9y9zQ7s9{Q;O>uS;h>w>zQ;o?PQ>y?jS?O?l?nQ?U?oQ?`?sS?a?t?wS?d?u?vR?e?xT'u$h+Q!csPVXt!S!j!r!s!w$h%O%Q%T%V'p([(h)`+Q+j+t,Q,T,u,x.u.w/P0}1O1W2]Q$]rR*l'eQ-{+PQ.i+oQ0U-xQ0j.`Q1|0kR2w1}T0W-y0XQ+V'zQ.U+YR0d.XQ(_$tQ)^%iQ)s%vQ*u'mS+x(`(aQ-q*vR.p+yQ(^$tQ)b%kQ)r%vQ*q'lS*t'm)sU+w(_(`(aS-p*u*vS.o+x+yQ/i,{Q/{-nQ/}-qR0v.pQ(]$tQ)]%iQ)_%jQ)q%vU*s'm)r)sW+v(^(_(`(aQ,t)^U-o*t*u*vU.n+w+x+yS/|-p-qS0u.o.pQ1i/}R2Y0vX+r([)`+t,xb%f!_$a'j+n.c.f0m0o2OR,r)YQ$ovS+b(S?Qg?m([)`+i+j+m+t,u,x.a.b0lR0t.kT2V0s2W0}|PVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$y{$|Q,O(dR.r+|T${{$|Q(j%OQ(r%QQ(w%TQ(z%VQ.},XQ0z.yQ0{.|R2c1WR(m%PX,[(k(l,],_R(n%PX(p%Q%T%V1WR%T!T_%b!]%S(t,c,e/X1RR%V!UR/],gR,j)PQ)a%kS*p'l)bS-m*q,{S/z-n/iR1h/{T,w)`,xQ-P)fU/l,|,}-UU1^/k/t/uR2n1fR/o-OR2l1bSSO!mR!oSQ!rVR%y!rQ!jPS!sV!rQ!wX[%u!j!s!w,Q1O2]Q,Q(hQ1O/PR2]0}Q)o%sS-X)o9bR9b8rQ-b*QR/x-bQ&y#oS*X&y9XR9X:tS*]&|&}R-i*]Q)|&YR-^)|!j'Y#|'o*f*z+O+T+e+i.T.W.Z.a/_0`0c0g0l1x2u5x5y5z7e7t7u7v;q;t;x?W?X?Z?f?g?h?iS*e'Y/g]/g,{-n.f0o1[2O!h'[#|'o*z+O+T+e+i.T.W.Z.a/_0`0c0g0l1x2u5x5y5z7e7t7u7v;q;t;x?W?X?Z?f?g?h?iS*g'[/hZ/h,{-n.f0o2OU#xd%n)kU'S#x3j3kQ3j3hR3k3iQ'W#z^*b'W,}/k/u1f3q3rQ,})fQ/u-UQ3q3lR3r3m|tPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]W$_t'p+j,uS'p$h+QS+j([+tT,u)`,xQ'f$]R*m'fQ0X-yR1q0XQ+R'vR-}+RQ0].PS1u0]1vR1v0^Q._+fR0i._Q+t([R.l+tW+m([)`+t,xS.b+j,uT.e+m.bQ)Z%fR,s)ZQ(T$oS+c(T?RR?R?mQ2W0sR2}2WQ$|{R(f$|Q,S(iR.v,SQ,V(jR.z,VQ,](kQ,_(lT/Q,],_Q)U%aS,o)U9`R9`8qQ)R%_R,l)RQ,x)`R/e,xQ)h%pS-R)h/sR/s-SQ1c/oR2m1cT!uV!rj!iPVX!j!r!s!w(h,Q/P0}1O2]Q%R!SQ(i%OW(p%Q%T%V1WQ.x,TQ0x.uR0y.w|[PVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]Q#e]U#k`#q&xQ#ucQ$UkQ$VlQ$WmQ$XnQ$YoQ$ZpQ$sx^$vy3y5|8P:]n>oQ+a(RQ+d(VQ,n)TQ,q)XQ-W)nQ-Y)uQ-[)yQ-e*VQ-f*ZQ-g*[^-k3u5b7c9v;}>p>qQ-w*|Q.Y+^Q/O,YQ/[,gQ/v-`Q0Q-tQ0Z-zQ0f.[Q1g/yQ1j0OQ1m0TQ1z0eU2S0s2W:rQ2`1SQ2o1kQ2p1oQ2v1{Q3Z2rQ3o3xQ4]jQ4^5eQ4d5fQ4e5hQ4f5jQ4g5lQ4h5nQ4i5pQ4j3zQ4l3|Q4m3}Q4n4OQ4o4PQ4p4QQ4q4RQ4r4SQ4s4TQ4t4UQ4u4VQ4v4WQ4w4XQ4x4YQ4y4ZQ4z4[Q4{4_Q4|4`Q4}4aQ5P4bQ5Q4cQ5T4kQ5U5OQ5W5RQ5X5SQ5Y5VQ5]5ZQ5^5[Q5`5_Q5t5rQ6e5gQ6f5iQ6g5kQ6h5mQ6i5oQ6j5qQ6k5}Q6m6PQ6n6QQ6o6RQ6p6SQ6q6TQ6r6UQ6s6VQ6t6WQ6u6XQ6v6YQ6w6ZQ6x6[Q6y6]Q6z6^Q6{6_Q6|6`Q6}6aQ7O6bQ7Q6cQ7R6dQ7U6lQ7V7PQ7X7SQ7Y7TQ7Z7WQ7^7[Q7_7]Q7a7`Q7l5{Q7m5dQ7q7oQ8i7xQ8j7yQ8k7zQ8l7{Q8m7|Q8n7}Q8o8OQ8p8QU8q,c/X1RQ8r%dQ8t8SQ8u8TQ8v8UQ8w8VQ8x8WQ8y8XQ8z8YQ8{8ZQ8|8[Q8}8]Q9O8^Q9P8_Q9Q8`Q9R8aQ9S8bQ9U8dQ9V8eQ9Y8fQ9[8gQ9]8hQ9d8sQ9e9TQ9g9ZQ9i9^Q9j9_Q9k9aQ9l9cQ9m9fQ9n9hQ9q9oQ9r9pQ9t9sQ9w:QU:p#i&t9WQ:x:UQ:y:VQ:z:WQ:{:XQ:|:YQ:}:ZQ;P:[Q;Q:^Q;R:_Q;T:aQ;U:bQ;V:cQ;W:dQ;X:eQ;Y:fQ;Z:gQ;[:hQ;]:iQ;^:jQ;_:kQ;`:lQ;a:mQ;b:nQ;c:oQ;d:uQ;f:vQ;g:wQ;l;SQ;m;eQ;p;jQ;r;kQ;s;nQ;w;uQ;y;vQ;{;zQOP<{Q>Q<|Q>R=OQ>S=PQ>T=QQ>U=RQ>X=SQ>Y=TQ>Z=UQ>_=aQ>`=bQ>a>VQ>b>WQ>d>[Q>e>]Q>f>^Q>g>cQ>j>hQ>k>iQ>m>lQ>r:SQ>s:RQ>{>vQ>|:qQ>}:sQ?V;iQ?b?^R?c?_R*R&qQ%t!gQ)W%dT*P&q-a$WiPVX]cklmnopxyz!S!W!X!Y!j!r!s!w#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a$Q$R$T$z%O%Q%T%V%}&S&['a(V(h)u+^,Q,T.[.u.w/P0e0}1O1S1W1o1{2]2r3p3u8d8e!t5c']3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5f5h5j5l5n5p7b7c!x7n5a5b5d5e5g5i5k5m5o5q5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`$`:P`j!]!g!y!z#i#l#m#q#r%S%U&q&t&u&x'P(R(t)T)X)n*V*[,e,g-a5r7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8f8g8h8s9W9Z9^9c9h9o9p9s9u9v:Q:R:S:T:_>v?^?_#l>t!|%d&W)y){*Z*|,c-t-z/X/y0O0T1R1k9T9_9a9f:U:V:W:X:Y:Z:[:]:^:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:u:v:w;S;e;j;k;n;u;v;z;|;}=O=P!x?[,Y-`:q:s;iV>[>]>c>h>i>l>n>p!]?]0s2W:rW>^>o>qQ#p`Q&s#iQ&{#qR*T&tS#o`#q^$Sj5d5e:Q:R:S:TS*W&x9WT:t#i&tQ'O#rR*_'PR&T!{R&Z!|Q&Y!|R-]){Q#|gS'^#}3nS'o$h+QS*d'X3sU*f'Z*w-vQ*z'pQ+O'tQ+T'yQ+e(WW+i([)`+t,xQ,{)cQ-n*rQ.T+XQ.W+[Q.Z+_U.a+j+m,uQ.f+nQ/_,iQ0`.SQ0c.VQ0g.]Q0l.bQ0o.cQ1[3tQ1x0bQ2O0mQ2u1yQ5x7iQ5y7jQ5z7kQ7e7wQ7t9|Q7u9}Q7v:OQ;q?SQ;t?TQ;x?YQ?W?pQ?X?qQ?Z?rQ?f?yQ?g?zQ?h?{R?i?|0z!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_#`$Og#}$h'X'Z'p't'y(W([)`)c*r*w+Q+X+[+_+j+m+n+t,i,u,x-v.S.V.].b.c0b0m1y3n3s3t7i7j7k7w9|9}:O?S?T?Y?p?q?r?y?z?{?|S$[r'eQ%l!eS%p!f%rU+f(Y(Z+qQ-Q)gQ/m-OQ0h.^Q1a/nQ2j1bR3W2k|vPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]#Y#g]cklmnopxyz!W!X!Y#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a$Q$R$T$z%}&S&['a(V)u+^.[0e1S1o1{2r3p3u8d8e`+k([)`+j+m+t,u,x.b!t8c']3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5f5h5j5l5n5p7b7c!x<}5a5b5d5e5g5i5k5m5o5q5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`$`?k`j!]!g!y!z#i#l#m#q#r%S%U&q&t&u&x'P(R(t)T)X)n*V*[,e,g-a5r7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8f8g8h8s9W9Z9^9c9h9o9p9s9u9v:Q:R:S:T:_>v?^?_#l?}!|%d&W)y){*Z*|,c-t-z/X/y0O0T1R1k9T9_9a9f:U:V:W:X:Y:Z:[:]:^:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:u:v:w;S;e;j;k;n;u;v;z;|;}=O=P!x@O,Y-`:q:s;iV>[>]>c>h>i>l>n>p!]@P0s2W:rW>^>o>qR'w$hQ'v$hR-|+QR$^rQ#d[Q%Y!WQ%[!XQ%^!YQ(U$pQ({%WQ(|%XQ(}%ZQ)O%]Q)V%cQ)[%gQ)d%lQ)j%qQ)p%tQ*n'iQ-V)mQ-l*oQ.i+oQ.j+pQ.x,WQ/S,`Q/T,aQ/U,bQ/Z,fQ/^,hQ/b,pQ/q-PQ0j.`Q0q.dQ0r.hQ0t.kQ0y.{Q1Y/dQ1_/lQ1n0VQ1|0kQ2Q0nQ2R0pQ2[0|Q2d1XQ2g1^Q2w1}Q2y2PQ2|2VQ3P2ZQ3T2fQ3X2nQ3Y2pQ3]2xQ3a3RQ3b3SR3e3ZR.R+UQ+g(YQ+h(ZR.k+qS+s([+tT,w)`,xa+l([)`+j+m+t,u,x.bQ%g!_Q'i$aQ*o'jQ.h+nS0p.c.fS2P0m0oR2x2OQ$pvW+o([)`+t,xW.`+i+j+m,uS0k.a.bR1}0l|!aPVX!S!j!r!s!w%O%Q%T%V(h,Q,T.u.w/P0}1O1W2]Q$ctW+p([)`+t,xU.d+j+m,uR0n.b0z!OPVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_R/a,m0}}PVX]`cjklmnopxyz!S!W!X!Y!]!g!j!r!s!w!y!z!|#Q#R#S#T#U#V#W#X#Y#Z#[#]#^#_#`#a#i#l#m#q#r$Q$R$T$z%O%Q%S%T%U%V%d%}&S&W&[&q&t&u&x'P']'a(R(V(h(t)T)X)n)u)y){*V*Z*[*|+^,Q,T,Y,c,e,g,m-`-a-t-z.[.u.w/P/X/y0O0T0e0s0}1O1R1S1W1k1o1{2W2]2r3p3u3x3y3z3{3|3}4O4P4Q4R4S4T4U4V4W4X4Y4Z4[4_4`4a4b4c4k5O5R5S5V5Z5[5_5a5b5d5e5f5g5h5i5j5k5l5m5n5o5p5q5r5u5{5|5}6O6P6Q6R6S6T6U6V6W6X6Y6Z6[6]6^6_6`6a6b6c6d6l7P7S7T7W7[7]7`7b7c7o7x7y7z7{7|7}8O8P8Q8R8S8T8U8V8W8X8Y8Z8[8]8^8_8`8a8b8d8e8f8g8h8s9T9W9Z9^9_9a9c9f9h9o9p9s9u9v:Q:R:S:T:U:V:W:X:Y:Z:[:]:^:_:`:a:b:c:d:e:f:g:h:i:j:k:l:m:n:o:q:r:s:u:v:w;S;e;i;j;k;n;u;v;z;|;}V>W>[>]>^>c>h>i>l>n>o>p>q>v?^?_T$x{$|Q(q%QQ(v%TQ(y%VR2b1WQ%c!]Q(u%SQ,d(tQ/W,cQ/Y,eQ1Q/XR2_1RQ%q!fR)m%rR/p-O",nodeNames:"⚠ ( HeredocString EscapeSequence abstract LogicOp array as Boolean break case catch clone const continue default declare do echo else elseif enddeclare endfor endforeach endif endswitch endwhile enum extends final finally fn for foreach from function global goto if implements include include_once LogicOp insteadof interface list match namespace new null LogicOp print readonly require require_once return switch throw trait try unset use var Visibility while LogicOp yield LineComment BlockComment TextInterpolation PhpClose Text PhpOpen Template TextInterpolation EmptyStatement ; } { Block : LabelStatement Name ExpressionStatement ConditionalExpression LogicOp MatchExpression ) ( ParenthesizedExpression MatchBlock MatchArm , => AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> Name VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp IntersectionType OptionalType NamedType QualifiedName \\ NamespaceName Name NamespaceName Name ScopedExpression :: ClassMemberName DynamicMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter PropertyHooks PropertyHook UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:318,nodeProps:[["group",-36,2,8,49,82,84,86,89,94,95,103,107,108,112,113,116,120,126,132,137,139,140,154,155,156,157,160,161,173,174,188,190,191,192,193,194,200,"Expression",-28,75,79,81,83,201,203,208,210,211,214,217,218,219,220,221,223,224,225,226,227,228,229,230,231,234,235,239,240,"Statement",-4,121,123,124,125,"Type"],["isolate",-4,67,68,71,200,""],["openedBy",70,"phpOpen",77,"{",87,"(",102,"#["],["closedBy",72,"phpClose",78,"}",88,")",165,"]"]],propSources:[HO],skippedNodes:[0],repeatNodeCount:32,tokenData:"!GQ_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9Y!e!}!7z!}#O!;b#O#P!V<%lO8VR9WV'TP%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%`QQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV'TP%`QOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRV<%l~8V~O8V~~%fR=OW'TPOY8VYZ9PZ!^8V!^!_;{!_;'S8V;'S;=`=h;=`<%l9m<%lO8VR=mW%`QOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l8V<%lO9mR>YP;=`<%l8VR>dV!zQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV?QV!yU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR?nY'TP$^QOY$zYZ%fZz$zz{@^{!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR@eW$_Q'TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zRAUY$[Q'TPOY$zYZ%fZ{$z{|At|!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zRA{V%TQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRBiV#OQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_CXZ$[Q%^W'TPOY$zYZ%fZ}$z}!OAt!O!^$z!^!_%k!_!`6U!`!aCz!a;'S$z;'S;=`&W<%lO$zVDRV#aU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zVDo['TP$]QOY$zYZ%fZ!O$z!O!PEe!P!Q$z!Q![Fs![!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zVEjX'TPOY$zYZ%fZ!O$z!O!PFV!P!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zVF^V#VU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRFz_'TP%XQOY$zYZ%fZ!Q$z!Q![Fs![!^$z!^!_%k!_!g$z!g!hGy!h#R$z#R#SJc#S#X$z#X#YGy#Y;'S$z;'S;=`&W<%lO$zRHO]'TPOY$zYZ%fZ{$z{|Hw|}$z}!OHw!O!Q$z!Q![Ii![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRH|X'TPOY$zYZ%fZ!Q$z!Q![Ii![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRIpZ'TP%XQOY$zYZ%fZ!Q$z!Q![Ii![!^$z!^!_%k!_#R$z#R#SHw#S;'S$z;'S;=`&W<%lO$zRJhX'TPOY$zYZ%fZ!Q$z!Q![Fs![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_K[['TP$^QOY$zYZ%fZz$zz{LQ{!P$z!P!Q,o!Q!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$z_LVX'TPOYLQYZLrZzLQz{N_{!^LQ!^!_! s!_;'SLQ;'S;=`!!i<%lOLQ_LwT'TPOzMWz{Mj{;'SMW;'S;=`NX<%lOMW^MZTOzMWz{Mj{;'SMW;'S;=`NX<%lOMW^MmVOzMWz{Mj{!PMW!P!QNS!Q;'SMW;'S;=`NX<%lOMW^NXO!f^^N[P;=`<%lMW_NdZ'TPOYLQYZLrZzLQz{N_{!PLQ!P!Q! V!Q!^LQ!^!_! s!_;'SLQ;'S;=`!!i<%lOLQ_! ^V!f^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_! vZOYLQYZLrZzLQz{N_{!aLQ!a!bMW!b;'SLQ;'S;=`!!i<%l~LQ~OLQ~~%f_!!lP;=`<%lLQZ!!vm'TP%WYOY$zYZ%fZ!O$z!O!PFs!P!Q$z!Q![!$q![!^$z!^!_%k!_!d$z!d!e!&o!e!g$z!g!hGy!h!q$z!q!r!(a!r!z$z!z!{!){!{#R$z#R#S!%}#S#U$z#U#V!&o#V#X$z#X#YGy#Y#c$z#c#d!(a#d#l$z#l#m!){#m;'S$z;'S;=`&W<%lO$zZ!$xa'TP%WYOY$zYZ%fZ!O$z!O!PFs!P!Q$z!Q![!$q![!^$z!^!_%k!_!g$z!g!hGy!h#R$z#R#S!%}#S#X$z#X#YGy#Y;'S$z;'S;=`&W<%lO$zZ!&SX'TPOY$zYZ%fZ!Q$z!Q![!$q![!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!&tY'TPOY$zYZ%fZ!Q$z!Q!R!'d!R!S!'d!S!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!'k['TP%WYOY$zYZ%fZ!Q$z!Q!R!'d!R!S!'d!S!^$z!^!_%k!_#R$z#R#S!&o#S;'S$z;'S;=`&W<%lO$zZ!(fX'TPOY$zYZ%fZ!Q$z!Q!Y!)R!Y!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zZ!)YZ'TP%WYOY$zYZ%fZ!Q$z!Q!Y!)R!Y!^$z!^!_%k!_#R$z#R#S!(a#S;'S$z;'S;=`&W<%lO$zZ!*Q]'TPOY$zYZ%fZ!Q$z!Q![!*y![!^$z!^!_%k!_!c$z!c!i!*y!i#T$z#T#Z!*y#Z;'S$z;'S;=`&W<%lO$zZ!+Q_'TP%WYOY$zYZ%fZ!Q$z!Q![!*y![!^$z!^!_%k!_!c$z!c!i!*y!i#R$z#R#S!){#S#T$z#T#Z!*y#Z;'S$z;'S;=`&W<%lO$zR!,WX!rQ'TPOY$zYZ%fZ![$z![!]!,s!]!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!,zV#yQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!-hV!nU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!.S[$YQOY$zYZ%fZ!^$z!^!_!.x!_!`!/i!`!a*c!a!b!0]!b;'S$z;'S;=`&W<%l~$z~O$z~~%fR!/PW$ZQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR!/pX$YQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`$z!`!a*c!a;'S$z;'S;=`&W<%lO$zP!0bR!jP!_!`!0k!r!s!0p#d#e!0pP!0pO!jPP!0sQ!j!k!0y#[#]!0yP!0|Q!r!s!0k#d#e!0k_!1ZX#|Y'TPOY$zYZ%fZ!^$z!^!_%k!_!`)r!`!a!1v!a;'S$z;'S;=`&W<%lO$zV!1}V#PU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!2kX$YQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`!3W!`!a!.x!a;'S$z;'S;=`&W<%lO$zR!3_V$YQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!3{[!wQ'TPOY$zYZ%fZ}$z}!O!4q!O!^$z!^!_%k!_!`$z!`!a!6P!a!b!6m!b;'S$z;'S;=`&W<%lO$zV!4vX'TPOY$zYZ%fZ!^$z!^!_%k!_!`$z!`!a!5c!a;'S$z;'S;=`&W<%lO$zV!5jV#bU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!6WV!h^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!6tW$RQ'TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`;'S$z;'S;=`&W<%lO$zR!7eV$dQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!8Ta'aS'TP'WYOY$zYZ%fZ!Q$z!Q![!7z![!^$z!^!_%k!_!c$z!c!}!7z!}#R$z#R#S!7z#S#T$z#T#o!7z#o$g$z$g&j!7z&j;'S$z;'S;=`&W<%lO$z_!9ce'aS'TP'WYOY$zYZ%fZr$zrs!:tsw$zwx8Vx!Q$z!Q![!7z![!^$z!^!_%k!_!c$z!c!}!7z!}#R$z#R#S!7z#S#T$z#T#o!7z#o$g$z$g&j!7z&j;'S$z;'S;=`&W<%lO$zR!:{V'TP'uQOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!;iV#XU'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!OZ'TPOY!=yYZ!>qZ!^!=y!^!_!@y!_#O!=y#O#P!Au#P#S!=y#S#T!CP#T;'S!=y;'S;=`!Cm<%lO!=yR!>vV'TPO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s<%lO!?]Q!?`VO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s<%lO!?]Q!?xRO;'S!?];'S;=`!@R;=`O!?]Q!@UWO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!?]<%lO!?]Q!@sO%UQQ!@vP;=`<%l!?]R!@|]OY!=yYZ!>qZ!a!=y!a!b!?]!b#O!=y#O#P!Au#P#S!=y#S#T!CP#T;'S!=y;'S;=`!Cm<%l~!=y~O!=y~~%fR!AzW'TPOY!=yYZ!>qZ!^!=y!^!_!@y!_;'S!=y;'S;=`!Bd;=`<%l!?]<%lO!=yR!BgWO#O!?]#O#P!?u#P#S!?]#S#T!@n#T;'S!?];'S;=`!@s;=`<%l!=y<%lO!?]R!CWV%UQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!CpP;=`<%l!=y_!CzV!p^'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z_!DjY$UQ#n['TPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EY#q;'S$z;'S;=`&W<%lO$zR!EaV$SQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!E}V!oQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FkV$eQ'TPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[IO,CO,LO,0,1,2,3,NO],topRules:{Template:[0,73],Program:[1,241]},dynamicPrecedences:{298:1},specialized:[{term:284,get:(O,Q)=>n(O)<<1,external:n},{term:284,get:O=>AO[O]||-1}],tokenPrec:29889}),DO=s.define({name:"php",parser:KO.configure({props:[t.add({IfStatement:c({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:c({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:O=>{let Q=O.textAfter,i=/^\s*\}/.test(Q),a=/^\s*(case|default)\b/.test(Q);return O.baseIndent+(i?0:a?1:2)*O.unit},ColonBlock:O=>O.baseIndent+O.unit,"Block EnumBody DeclarationList":y({closing:"}"}),ArrowFunction:O=>O.baseIndent+O.unit,"String BlockComment":()=>null,Statement:c({except:/^({|end(for|foreach|switch|while)\b)/})}),U.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":l,ColonBlock(O){return{from:O.from+1,to:O.to}},BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function c$(O={}){let Q=[],i;if(O.baseLanguage!==null)if(O.baseLanguage)i=O.baseLanguage;else{let a=w({matchClosingTags:!1});Q.push(a.support),i=a.language}return new Z(DO.configure({wrap:i&&R(a=>a.type.isTop?{parser:i.parser,overlay:P=>P.name=="Text"}:null),top:O.plain?"Program":"Template"}),Q)}export{c$ as php,DO as phpLanguage}; diff --git a/internal/relay/web-dist/assets/index-CH6joGJR.js b/internal/relay/web-dist/assets/index-DO3lkMm1.js similarity index 99% rename from internal/relay/web-dist/assets/index-CH6joGJR.js rename to internal/relay/web-dist/assets/index-DO3lkMm1.js index 9593b097..8f85577e 100644 --- a/internal/relay/web-dist/assets/index-CH6joGJR.js +++ b/internal/relay/web-dist/assets/index-DO3lkMm1.js @@ -1 +1 @@ -import{L as t,E as Z,a as o}from"./index-q_Op_mkr.js";import{J as S,Q as e,g as s,L as m,z as d,v as Y,r as a,u as w,x as n,w as V}from"./FileExplorer-BGCt84ef.js";import"./useI18n-CnvN0FfF.js";import"./index-BH9vIdLD.js";import"./prefsSync-D8z1rJ8H.js";import"./client-2UEf7AK8.js";import"./Switch-CpxGRRqY.js";import"./auth-Dhl8fEWW.js";const P=1,l=2,q=3,T=82,z=76,_=117,h=85,c=97,j=122,b=65,p=90,v=95,i=48,U=34,R=40,r=41,W=32,x=62,f=new Z(O=>{if(O.next==z||O.next==h?O.advance():O.next==_&&(O.advance(),O.next==i+8&&O.advance()),O.next!=T||(O.advance(),O.next!=U))return;O.advance();let Q="";for(;O.next!=R;){if(O.next==W||O.next<=13||O.next==r)return;Q+=String.fromCharCode(O.next),O.advance()}for(O.advance();;){if(O.next<0)return O.acceptToken(P);if(O.next==r){let $=!0;for(let X=0;$&&X{if(O.next==x)O.peek(1)==x&&O.acceptToken(l,1);else{let Q=!1,$=0;for(;;$++){if(O.next>=b&&O.next<=p)Q=!0;else{if(O.next>=c&&O.next<=j)return;if(O.next!=v&&!(O.next>=i&&O.next<=i+9))break}O.advance()}Q&&$>1&&O.acceptToken(q)}},{extend:!0}),k=S({"typedef struct union enum class typename decltype auto template operator friend noexcept namespace using requires concept import export module __attribute__ __declspec __based":e.definitionKeyword,"extern MsCallModifier MsPointerModifier extern static register thread_local inline const volatile restrict _Atomic mutable constexpr constinit consteval virtual explicit VirtualSpecifier Access":e.modifier,"if else switch for while do case default return break continue goto throw try catch":e.controlKeyword,"co_return co_yield co_await":e.controlKeyword,"new sizeof delete static_assert":e.operatorKeyword,"NULL nullptr":e.null,this:e.self,"True False":e.bool,"TypeSize PrimitiveType":e.standard(e.typeName),TypeIdentifier:e.typeName,FieldIdentifier:e.propertyName,"CallExpression/FieldExpression/FieldIdentifier":e.function(e.propertyName),"ModuleName/Identifier":e.namespace,PartitionName:e.labelName,StatementIdentifier:e.labelName,"Identifier DestructorName":e.variableName,"CallExpression/Identifier":e.function(e.variableName),"CallExpression/ScopedIdentifier/Identifier":e.function(e.variableName),"FunctionDeclarator/Identifier FunctionDeclarator/DestructorName":e.function(e.definition(e.variableName)),NamespaceIdentifier:e.namespace,OperatorName:e.operator,ArithOp:e.arithmeticOperator,LogicOp:e.logicOperator,BitOp:e.bitwiseOperator,CompareOp:e.compareOperator,AssignOp:e.definitionOperator,UpdateOp:e.updateOperator,LineComment:e.lineComment,BlockComment:e.blockComment,Number:e.number,String:e.string,"RawString SystemLibString":e.special(e.string),CharLiteral:e.character,EscapeSequence:e.escape,"UserDefinedLiteral/Identifier":e.literal,PreprocArg:e.meta,"PreprocDirectiveName #include #ifdef #ifndef #if #define #else #endif #elif":e.processingInstruction,MacroName:e.special(e.name),"( )":e.paren,"[ ]":e.squareBracket,"{ }":e.brace,"< >":e.angleBracket,". ->":e.derefOperator,", ;":e.separator}),u={__proto__:null,bool:36,char:36,int:36,float:36,double:36,void:36,size_t:36,ssize_t:36,intptr_t:36,uintptr_t:36,charptr_t:36,int8_t:36,int16_t:36,int32_t:36,int64_t:36,uint8_t:36,uint16_t:36,uint32_t:36,uint64_t:36,char8_t:36,char16_t:36,char32_t:36,char64_t:36,const:70,volatile:72,restrict:74,_Atomic:76,mutable:78,constexpr:80,constinit:82,consteval:84,struct:88,__declspec:92,final:148,override:148,public:152,private:152,protected:152,virtual:154,extern:160,static:162,register:164,inline:166,thread_local:168,__attribute__:172,__based:178,__restrict:180,__uptr:180,__sptr:180,_unaligned:180,__unaligned:180,noexcept:194,requires:198,TRUE:798,true:798,FALSE:800,false:800,typename:218,class:220,template:234,throw:248,__cdecl:256,__clrcall:256,__stdcall:256,__fastcall:256,__thiscall:256,__vectorcall:256,try:260,catch:264,export:282,import:286,case:296,default:298,if:308,else:314,switch:318,do:322,while:324,for:330,return:334,break:338,continue:342,goto:346,co_return:350,co_yield:354,using:362,typedef:366,namespace:380,new:398,delete:400,co_await:402,concept:406,enum:410,static_assert:414,friend:422,union:424,explicit:430,operator:444,module:456,signed:518,unsigned:518,long:518,short:518,decltype:528,auto:530,sizeof:566,NULL:572,nullptr:586,this:588},G={__proto__:null,"<":767},y={__proto__:null,">":135},E={__proto__:null,operator:388,new:576,delete:582},C=t.deserialize({version:14,states:"$<[Q!QQVOOP'gOUOOO([OWO'#CdO,UQUO'#CgO,`QUO'#FjO-vQbO'#CxO.XQUO'#CxO0WQUO'#KaO0_QUO'#CwO0jOpO'#DvO0rQ!dO'#D]OOQR'#JP'#JPO5[QVO'#GUO5iQUO'#JWOOQQ'#JW'#JWO8}QUO'#KtOxQVO'#IbO!(}QVO'#IdO!?SQUO'#IgO!?ZQVO'#IjP!AQO!LQO'#CaP!A]{,UO'#CbP!6q{,UO'#CbP!Ah{7[O'#CbP!6q{,UO'#CbP!Am{,UO'#CbP!AxOSO'#IzPOOO)CEp)CEpOOOO'#I}'#I}O!BSOWO,59OOOQR,59O,59OO!(}QVO,59VOOQQ,59X,59XOOQR'#Do'#DoO!(}QVO,5;ROOQR,5qOOQR'#IX'#IXOOQR'#IY'#IYOOQR'#IZ'#IZOOQR'#I['#I[O!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!D^QVO,5>zOOQQ,5?W,5?WO!FPQVO'#CjO!IxQUO'#CzOOQQ,59d,59dOOQQ,59c,59cOOQQ,5<},5<}O!JVQ&lO,5=mO!?SQUO,5?RO!LyQVO,5?UO!MQQbO,59dO!M]QVO'#FYOOQQ,5?P,5?PO!MmQVO,59WO!MtO`O,5:bO!MyQbO'#D^O!N[QbO'#KeO!NjQbO,59wO!NrQbO'#CxO# TQUO'#CxO# YQUO'#KaO# dQUO'#CwOOQR-E<}-E<}O# oQUO,5AvO# vQVO'#EfO@[QVO'#EiOBXQUO,5;kOOQR,5l,5>lO#3uQUO'#CgO#4kQUO,5>pO#6^QUO'#IeOOQR'#JO'#JOO#6fQUO,5:xO#7SQUO,5:xO#7sQUO,5:xO#8hQUO'#CuO!0TQUO'#CmOOQQ'#JX'#JXO#7SQUO,5:xO#8pQUO,5;QO!4{QUO'#DOO#9yQUO,5;QO#:OQUO,5>QO#;[QUO'#DOO#;rQUO,5>{O#;wQUO'#LOO#=QQUO,5;TO#=YQVO,5;TO#=dQUO,5;TOOQQ,5;T,5;TO#?]QUO'#LdO#?dQUO,5>UO#?iQbO'#CxO#?tQUO'#GcO#?yQUO'#E^O#@jQUO,5;kO#ARQUO'#LUO#AZQUO,5;rOKnQUO'#HfOBXQUO'#HgO#A`QUO'#KxO!6qQUO'#HjO#BWQUO'#CuO!0wQVO,5PO$(fQUO'#E[O$(sQUO,5>ROOQQ,5>S,5>SO$,aQVO'#C|OOQQ-E=q-E=qOOQQ,5>d,5>dOOQQ,59a,59aO$,kQUO,5>wO$.kQUO,5>zO!6qQUO,59uO$/OQUO,5;qO$/]QUO,5<{O!0TQUO,5:oOOQQ,5:r,5:rO$/hQUO,5;mO$/mQUO'#KtOBXQUO,5;kOOQR,5;x,5;xO$0^QUO'#FbO$0lQUO'#FbO$0qQUO,5;zO$4[QVO'#FmO!0wQVO,5sQUO'#L^O$>{QUO,5T,5>TO$FxQUO,5>TO$GSQUO,5>TO$GXQUO,5>TO$G^QUO,5>TO!6qQUO,5>TO$I[QUO'#KaO$IcQUO,5=oO$InQUO,5=aOKnQUO,5=oO$JhQUO,5=sOOQR,5=s,5=sO$JpQUO,5=sO$L{QVO'#H[OOQQ,5=u,5=uO!;`QUO,5=uO%#vQUO'#KqO%#}QUO'#KbO%$cQUO'#KqO%$mQUO'#DyO%%OQUO'#D|O%'{QUO'#KbOOQQ'#Kb'#KbO%)nQUO'#KbO%#}QUO'#KbO%)sQUO'#KbOOQQ,59s,59sOOQQ,5>a,5>aOOQQ,5>b,5>bO%){QUO'#HzO%*TQUO,5>cOOQQ,5>c,5>cO%-oQUO,5>cO%-zQUO,5>hO%1fQVO,5>iO%1mQUO,5>|O# vQVO'#EfO%4sQUO,5>|OOQQ,5>|,5>|O%5dQUO,5?OO%7hQUO,5?RO!<_QUO,5?RO%9dQUO,5?UO%=PQVO,5?UPOOO'#I|'#I|P%=WO!LQO,58{POOO,58{,58{P!Am{,UO,58|P%=c{,UO,58|P%=q{7[O,58|PO{O'#Jw'#JwP%>S{,UO'#LkPOOO'#Lk'#LkP%>Y{,UO'#LkPOOO,58|,58|POOO,5?f,5?fP%>_OSO,5?fOOOO-E<{-E<{OOQR1G.j1G.jO%>fQUO1G.qO%?lQUO1G0mOOQQ1G0m1G0mO%@xQUO'#CpO%CXQbO'#CxO%CdQUO'#CsO%CiQUO'#CsO%CnQUO1G.uO#BWQUO'#CrOOQQ1G.u1G.uO%EqQUO1G4]O%FwQUO1G4^O%HjQUO1G4^O%J]QUO1G4^O%LOQUO1G4^O%MqQUO1G4^O& dQUO1G4^O&#VQUO1G4^O&$xQUO1G4^O&&kQUO1G4^O&(^QUO1G4^O&*PQUO1G4^O&+rQUO'#KVO&,{QUO'#KVO&-TQUO,59UOOQQ,5=P,5=PO&/]QUO,5=PO&/gQUO,5=PO&/lQUO,5=PO&/qQUO,5=PO!6qQUO,5=PO#NsQUO1G3XO&/{QUO1G4mO!<_QUO1G4mO&1wQUO1G4pO&3jQVO1G4pOOQQ1G/O1G/OOOQQ1G.}1G.}OOQQ1G2i1G2iO!JVQ&lO1G3XO&3qQUO'#LVO@[QVO'#EiO&4zQUO'#F]OOQQ'#Jb'#JbO&5PQUO'#FZO&5[QUO'#LVO&5dQUO,5;tO&5iQUO1G.rOOQQ1G.r1G.rOOQR1G/|1G/|O&7[Q!dO'#JQO&7aQbO,59xO&9rQ!eO'#D`O&9yQ!dO'#JSO&:OQbO,5APO&:OQbO,5APOOQR1G/c1G/cO&:ZQbO1G/cO&:`Q&lO'#GeO&;^QbO,59dOOQR1G7b1G7bO#@jQUO1G1VO&;iQUO1G1^OBXQUO1G1VO&=zQUO'#CzO#+VQbO,59dO&AmQUO1G6zOOQR-E<|-E<|O&CPQUO1G0dO#6fQUO1G0dOOQQ-E=V-E=VO#7SQUO1G0dOOQQ1G0l1G0lO&CtQUO,59jOOQQ1G3l1G3lO&D[QUO,59jO&DrQUO,59jO!MmQVO1G4gO!(}QVO'#JZO&E^QUO,5AjOOQQ1G0o1G0oO!(}QVO1G0oO!6qQUO'#JpO&EfQUO,5BOOOQQ1G3p1G3pOOQR1G1V1G1VO&IcQVO'#FOO!MmQVO,5;sOOQQ,5;s,5;sOBXQUO'#JdO&K_QUO,5ApO&KgQVO'#E[OOQR1G1^1G1^O&NUQUO'#LdOOQR1G1n1G1nOOQR-E=h-E=hOOQR1G7e1G7eO#DvQUO1G7eOGYQUO1G7eO#DvQUO1G7gOOQR1G7g1G7gO&N^QUO'#G}O&NfQUO'#L`OOQQ,5=h,5=hO&NtQUO,5=jO&NyQUO,5=kOOQR1G7h1G7hO#EtQVO1G7hO' OQUO1G7hO'!UQVO,5=kOOQR1G1U1G1UO$/UQUO'#E]O'!zQUO'#E]OOQQ'#LQ'#LQO'#eQUO'#LPO'#pQUO,5;UO'#xQUO'#ElO'$]QUO'#ElO'$pQUO'#EtOOQQ'#J]'#J]O'$uQUO,5;cO'%lQUO,5;cO'&gQUO,5;dO''mQVO,5;dOOQQ,5;d,5;dO''wQVO,5;dO''mQVO,5;dO'(OQUO,5;bO'({QUO,5;eO')WQUO'#KwO')`QUO,5:vO')eQUO,5;fOOQQ1G0n1G0nOOQQ'#J^'#J^O'(OQUO,5;bO!4{QUO'#E}OOQQ,5;b,5;bO'*`QUO'#E`O',YQUO'#E{OHuQUO1G0nO',_QUO'#EbOOQQ'#JY'#JYO'-wQUO'#KyOOQQ'#Ky'#KyO'.qQUO1G0eO'/iQUO1G3kO'0oQVO1G3kOOQQ1G3k1G3kO'0yQVO1G3kO'1QQUO'#LgO'2^QUO'#K_O'2lQUO'#K^O'2wQUO,59hO'3PQUO1G/aO'3UQUO'#FPOOQR1G1]1G1]OOQR1G2g1G2gO$?]QUO1G2gO'3`QUO1G2gO'3kQUO1G0ZOOQR'#Ja'#JaO'3pQVO1G1XO'9iQUO'#FTO'9nQUO1G1VO!6qQUO'#JeO'9|QUO,5;|O$0lQUO,5;|OOQQ'#Fc'#FcOOQQ,5;|,5;|O':[QUO1G1fOOQR1G1f1G1fO':dQUO,5fO(*vQUO'#LeOOQQ1G3}1G3}O(.mQUO1G3}O(.tQUO1G3}O(.{QUO1G4TO(0RQUO1G4TO(0WQUO,5BUO!6qQUO1G4hO!(}QVO'#IiOOQQ1G4m1G4mO(0]QUO1G4mO(2`QVO1G4pPOOO-Em,5>mO$)hQVO'#JuO)+xQUO,5@xOOQQ1G/S1G/SOOQQ7+${7+${O),TQUO7+(RO),YQUO7+(ROOQR7+(R7+(RO$?]QUO7+(ROOQQ7+%u7+%uOOQR-E=_-E=_O!0YQUO,5;oOOQQ,5@P,5@POOQQ-E=c-E=cO$0lQUO1G1hOOQQ1G1h1G1hOOQR7+'Q7+'QOOQR1G1s1G1sOBXQUO,5;rO),vQUO,5yQUO7+(`O)@PQUO7+(dO)@UQVO7+(dOOQQ7+(l7+(lOOQQ7+)Z7+)ZO)@^QUO'#KqO)@hQUO'#KqOOQR,5=b,5=bO)@uQUO,5=bO!;eQUO,5=bO!;eQUO,5=bO!;eQUO,5=bOOQR7+(g7+(gOOQR7+(u7+(uOOQR7+(y7+(yOOQR,5=w,5=wO)@zQUO,5=zO)BQQUO,5=yOOQR,5A},5A}OOQR-E=k-E=kOOQQ1G3b1G3bO)CWQUO,5=xO)C]QVO'#EfOOQQ1G6h1G6hO%)nQUO1G6hO%)sQUO1G6hOOQQ1G0P1G0POOQQ-E=R-E=RO)EtQUO,5A^O(&jQUO'#JUO)FPQUO,5A^O)FPQUO,5A^O)FXQUO,5:iO8}QUO,5:iOOQQ,5>],5>]O)FcQUO,5AyO)FjQUO'#EVO)GtQUO'#EVO)H_QUO,5:iO)HiQUO'#HlO)HiQUO'#HmOOQQ'#Kv'#KvO)IWQUO'#KvO!(}QVO'#HnOOQQ,5:i,5:iO)IxQUO,5:iO!MmQVO,5:iOOQQ-E=T-E=TOOQQ1G0S1G0SOOQQ,5>`,5>`O)I}QUO1G6hO!(}QVO,5>gO)MlQUO'#JtO)MwQUO,5BQOOQQ1G4Q1G4QO)NPQUO,5BPOOQQ,5BP,5BPOOQQ7+)i7+)iO*#nQUO7+)iOOQQ7+)o7+)oO*(mQVO1G7pO**oQUO7+*SO**tQUO,5?TO*+zQUO7+*[POOO7+$S7+$SP*-mQUO'#LnP*-uQUO,5BXP!Am{,UO7+$SPOOO1G7q1G7qO*-zQUO<_QUO1G0xOOQQ1G0y1G0yO*>pQUO'#ElOOQQ1G0z1G0zOOQQ7+&j7+&jO*?UQUO7+&jO*@[QVO7+&jOOQQ7+&h7+&hOOQQ,5@],5@]OOQQ-E=o-E=oO*AWQUO1G1TO*AbQUO1G1TO*A{QUO1G0fOOQQ1G0f1G0fO*CRQUO'#LSO*CZQUO1G1ROOQQ<VO)HiQUO'#JrO*N}QUO1G0TO+ `QVO1G0TOOQQ1G3u1G3uO+ gQUO,5>WO+ rQUO,5>XO+!aQUO,5>YO+#gQUO1G0TO%)sQUO7+,SO+$mQUO1G4ROOQQ,5@`,5@`OOQQ-E=r-E=rOOQQ<n,5>nO+0fQUOANAXOOQRANAXANAXO+0kQUO7+'`OOQRAN@cAN@cO+1wQVOAN@nO+2OQUOAN@nO!0wQVOAN@nO+3XQUOAN@nO+3^QUOAN@}O+3iQUOAN@}O+4oQUOAN@}OOQRAN@nAN@nO!MmQVOAN@}OOQRANAOANAOO+4tQUO7+'|O)8XQUO7+'|OOQQ7+(O7+(OO+5VQUO7+(OO+6]QVO7+(OO+6dQVO7+'hO+6kQUOANAjOOQR7+(h7+(hOOQR7+)P7+)PO+6pQUO7+)PO+6uQUO7+)POOQQ<= n<= nO+6}QUO7+,dO+7VQUO1G5[OOQQ1G5[1G5[O+7bQUO7+%oOOQQ7+%o7+%oO+7sQUO7+%oO+ `QVO7+%oOOQQ7+)a7+)aO+7xQUO7+%oO+9OQUO7+%oO!MmQVO7+%oO+9YQUO1G0]O*MhQUO1G0]O)FjQUO1G0]OOQQ1G0a1G0aO+9wQUO1G3qO+:}QVO1G3qOOQQ1G3q1G3qO+;XQVO1G3qO+;`QUO,5@^OOQQ-E=p-E=pOOQQ1G3r1G3rO%)nQUO<= nOOQQ7+*Z7+*ZPOQQ,5@d,5@dPOQQ-E=v-E=vOOQQ1G/}1G/}OOQQ,5?y,5?yOOQQ-E=]-E=]OOQRG26sG26sO+;wQUOG26YO!0wQVOG26YO+=QQUOG26YOOQRG26YG26YO!MmQVOG26iO!0wQVOG26iO+=VQUOG26iO+>]QUOG26iO+>bQUO<sQUO<xQUO<}QUO<uAN>uO+CmQUOAN>uO+DsQUOAN>uO!MmQVOAN>uO+DxQUO<VQUO'#CzO,>eQbO,59dO,5^QUO7+&OO,;hQUO7+&OO,>pQUO'#EwO,?cQUO'#EzO,@SQUO'#E^O,@XQUO'#GcO,@^QUO'#CwO,@cQUO'#CxO,@hQUO'#CxO,@mQUO'#GcO,@rQUO'#CwO,@wQUO'#KaO,AeQUO'#KaO,AoQUO'#CwO,AzQUO'#CwO,BVQUO'#CwO,;hQUO,5:xO,6xQUO,5:xO,6xQUO,5:xO,BbQUO'#KaO,BuQbO'#CxO,CQQUO'#CsO,CVQUO'#E^",stateData:",C{~O(pOSSOSRPQVPQ'ePQ'gPQ'hPQ'iPQ'jPQ'kPQ'lPQ'mPQ(qPQ~O*cOS~OPmO]eOb!]Oe!POmTOs!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O|#RO!O!_O!TxO!VfO!X!XO!Y!WO!i!YO!opO!r!`O!s!aO!t!aO!u!bO!v!aO!x!cO!{!dO#V#QO#a#VO#b#TO#i#OO#p!xO#t!fO#v!eO$R!gO$T!hO$Y!vO$Z!wO$`!iO$e!jO$g!kO$h!lO$k!mO$m!nO$o!oO$q!pO$s!qO$u!rO$w!sO${!tO$}!uO%U!yO%_#ZO%`#[O%a#YO%c!zO%e#UO%g!{O%l#SO%o!|O%v!}O%|#PO&m!RO&r#WO&s!TO'Q!WO'R!WO'V#XO'Y![O'a![O'b![O(vQO(xRO)WYO)ZaO)]|O)^{O)`iO)a!ZO)cXO)ocO)pdO~OR#cOV#^O'e#_O'g#`O'h#aO'i#aO'j#bO'k#bO'l#`O'm#`O(q#]O~OX#eO(u#gO(w#eO~O]ZX]jXejXmhXqZXqjXsjXtjXujXvjXwjXxjXyjXzjX!OjX!TjX!VZX!VjX!XZX!YZX![ZX!^ZX!_ZX!aZX!bZX!eZX!fZX!gZX!hZX!rjX!sjX!tjX!ujX!vjX!xjX!{jX%vjX&rjX&sjX(xjX({ZX(|$]X(}ZX)OZX)ZZX)ZjX)[ZX)]ZX)]jX)^ZX)^jX)_ZX)`ZX)aZX)qZX~O)`jX!UZX~P(gO]$PO!V#nO!X#}O!Y#sO![#tO!^#wO!_#xO!a#zO!b#{O!e#{O!f#|O!h#kO({#hO(}#mO)O#mO)Z#oO)[#qO)]#pO)^#rO)_#jO)`#lO)a$OO~Oe$TO%Y$UO'[$VO'_$WO)P$QO~Om$XO~O!T$YO])TXe)TXs)TXt)TXu)TXv)TXw)TXx)TXy)TXz)TX!O)TX!V)TX!r)TX!s)TX!t)TX!u)TX!v)TX!x)TX!{)TX%v)TX&r)TX&s)TX(x)TX)Z)TX)])TX)^)TX)`)TX~Om$XO~P.^Om$XO!g$[O)q$[O~OX$]O)d$]O~O!R$^O)V)XP)a)XP~OPmO]$gOb!]Os!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O|#RO!O!_O!TxO!V$hO!X!XO!Y!WO!i!YO!r!aO!s!aO!t!aO!u!aO!v!aO!x!cO#V#QO#a#VO#b#TO#v!eO$Y!vO$Z!wO$`!iO$e!jO$g!kO$h!lO$k!mO$m!nO$o!oO$q!pO$s!qO$u!rO$w!sO%_#ZO%`#[O%a#YO%e#UO%l#SO%v$oO&m!RO&r#WO&s!TO'Q!WO'R!WO'V#XO'Y![O'a![O'b![O(vQO)WYO)Z$mO)^$mO)`iO)a!ZO)cXO)ocO)pdO~Om$aO#t$nO(xRO~P0}O](_Xb'zXe(_Xm'zXm(_Xs'zXs(_Xt'zXt(_Xu'zXu(_Xv'zXv(_Xw'zXw(_Xx'zXx(_Xy'zXy(_Xz'zXz(_X|'zX!O'zX!V(_X!o(_X!r'zX!r(_X!s'zX!s(_X!t'zX!t(_X!u'zX!u(_X!v'zX!v(_X!x'zX!x(_X!{(_X#a'zX#b'zX%e'zX%l'zX%o(_X%v(_X&m'zX&r'zX&s'zX(x'zX(x(_X)Z(_X)](_X)^(_X~Ob!TOm$qOs!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O|#RO!O!_O!r!aO!s!aO!t!aO!u!aO!v!aO!x!cO#a#VO#b#TO%e#UO%l#SO&m!RO&r#WO&s!TO(x$pO~Os!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O!O!_O!r!aO!s!aO!t!aO!u!aO!v!aO!x!cO&r#WO&s$yO])hXe)hXm)hX!V)hX!{)hX%v)hX(x)hX)Z)hX)])hX)^)hX~O)`$xO~P:qOPmO]eOe!POs!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O!VfO!X!XO!Y!WO!i!YO!{!dO#V#QO%_#ZO%`#[O%a#YO%v$oO'Q!WO'R!WO'V#XO'Y![O'a![O'b![O(vQO)ZaO)]|O)^{O)a!ZO)cXO)ocO)pdO~Ob%SOm;UO!|%TO(x$zO~PfP?P?c?wFpMq!&v!-_P!4Y!4}!5rP!6^PPPPPPPP!6wP!8aP!9r!;[P!;bPPPPPP!;eP!;ePP!;ePP!;qPPPPPP!=s!AZP!A^PP!Az!BoPPPPP!BsP?S!DUPP?S!F]!H^!Hl!JR!KrP!K}P!L^!L^# n#$}#&e#)q#,{!H^#-VPP!H^#-^#-d#-V#-V#-gP#-k#.Y#.Y#.Y#.Y!KrP#.s#/U#1kP#2PP#3lP#3p#3x#4m#4x#7W#7`#7`#3pP#3pP#7g#7mP#7wPP#8d#9R#9s#8dP#:e#:qP#8dP#8dPP#8d#8dP#8dP#8dP#8dP#8dP#8dP#8dP#:t#7w#;bP#;wP#<^#<^#<^#<^#S$@Y$@`$@v$AQ$A]$Al$Ar$CQ$DP$DW$D_$De$Dm$Dw$D}$EY$E`$Ei$Eq$E|$FS$F^$Fd$Fn$Ft$F{$G[$Gb$GhP$Gn$Gv$G}$H]$Iy$JP$JV$J^$JjPPPPPPPPPPPP$Jp$JtPPPPP%#v$*i%#y%'R%)ZPP%)h%)kPPPPPPPPPP%)w%*z%+Q%+U%,{%.Y%.{%/S%1c%1iPPP%1s%2O%2R%2X%3`%3c%3m%3w%3{%5P%5r%5x#CeP%6c%6i%6y%6|%7^%7j%7n%7t%7z$*i$*l$*l%7}%8QP%8a%8dQ#dPa(s#b(p(q(r(t/]/_4rR#dP'`mO[aefwx{!W!X!g!k!n!r!s!v!x#X#Y#[#h#k#n#s#t#u#v#w#x#y#z#{#|#}$P$W$Y$[$g$h$m%_%o&S&U&Y&d&h&z&{'O'Q'R'e'l'm'|(c(e(l)q)w*m*n*q*v*w*{+]+_+m+o+p,U,W,s,v,|-d-e-h-n.W.X.]/U/X/d/k/t/v/{/}0p1T1Y1i1j1t1x2S2U2k2n2q3P3U3X3s4Y4]4b4k5d5o5{6i6m6p6r6t7O7Q7V7l7t7w8o8q8w8}9O9]9a9g9i9v9y9z:V:Y:`:b:g:l:pU%qm%r7[Q&o!`Q(p#^d0X*S0U0V0W0Z5X5Y5Z5^8[R7[3_b}Oaewx{!g&U*v&v$k[!W!X!k!n!r!s!v!x#X#Y#[#h#k#n#s#t#u#v#w#x#y#z#{#|#}$P$W$Y$[$g$h$m%_%o&S&Y&d&h&z&{'O'Q'R'e'l'm'|(c(e(l)q)w*m*n*q*w*{+]+_+m+o+p,U,W,s,v,|-d-e-h-n.W.X.]/U/X/d/k/t/v/{/}1T1i1j1t1x2S2U2k2n2q3P3U3X3s4Y4]4b4k5d5o5{6i6m6p6r6t7O7Q7V7l7t7w8o8q8w8}9O9]9a9g9i9v9y9z:V:Y:`:b:g:l:pS%bf0p#d%lgnp|#O$i%O%P%U%f%j%k%y&u'w'x(T*_*e*g*y+b,q,{-f-w.O.m.t.v0e1R1S1W1[2g2r5k6q;b;c;d;j;k;l;y;z;{;| MacroName LineComment BlockComment PreprocDirective #include String EscapeSequence SystemLibString Identifier ) ( ArgumentList ConditionalExpression AssignmentExpression CallExpression PrimitiveType FieldExpression FieldIdentifier DestructorName TemplateMethod ScopedFieldIdentifier NamespaceIdentifier TemplateType TypeIdentifier ScopedTypeIdentifier ScopedNamespaceIdentifier :: NamespaceIdentifier TypeIdentifier TemplateArgumentList < TypeDescriptor const volatile restrict _Atomic mutable constexpr constinit consteval StructSpecifier struct MsDeclspecModifier __declspec Attribute AttributeName Identifier AttributeArgs { } [ ] UpdateOp ArithOp ArithOp ArithOp LogicOp BitOp BitOp BitOp CompareOp CompareOp CompareOp > CompareOp BitOp UpdateOp , Number CharLiteral AttributeArgs VirtualSpecifier BaseClassClause Access virtual FieldDeclarationList FieldDeclaration extern static register inline thread_local AttributeSpecifier __attribute__ PointerDeclarator MsBasedModifier __based MsPointerModifier FunctionDeclarator ParameterList ParameterDeclaration PointerDeclarator FunctionDeclarator Noexcept noexcept RequiresClause requires True False ParenthesizedExpression CommaExpression LambdaExpression LambdaCaptureSpecifier TemplateParameterList OptionalParameterDeclaration TypeParameterDeclaration typename class VariadicParameterDeclaration VariadicDeclarator ReferenceDeclarator OptionalTypeParameterDeclaration VariadicTypeParameterDeclaration TemplateTemplateParameterDeclaration template AbstractFunctionDeclarator AbstractPointerDeclarator AbstractArrayDeclarator AbstractParenthesizedDeclarator AbstractReferenceDeclarator ThrowSpecifier throw TrailingReturnType CompoundStatement FunctionDefinition MsCallModifier TryStatement try CatchClause catch LinkageSpecification Declaration InitDeclarator InitializerList InitializerPair SubscriptDesignator FieldDesignator ExportDeclaration export ImportDeclaration import ModuleName PartitionName HeaderName CaseStatement case default LabeledStatement StatementIdentifier ExpressionStatement IfStatement if ConditionClause Declaration else SwitchStatement switch DoStatement do while WhileStatement ForStatement for ReturnStatement return BreakStatement break ContinueStatement continue GotoStatement goto CoReturnStatement co_return CoYieldStatement co_yield AttributeStatement ForRangeLoop AliasDeclaration using TypeDefinition typedef PointerDeclarator FunctionDeclarator ArrayDeclarator ParenthesizedDeclarator ThrowStatement NamespaceDefinition namespace ScopedIdentifier Identifier OperatorName operator ArithOp BitOp CompareOp LogicOp new delete co_await ConceptDefinition concept UsingDeclaration enum StaticAssertDeclaration static_assert ConcatenatedString TemplateDeclaration FriendDeclaration friend union FunctionDefinition ExplicitFunctionSpecifier explicit FieldInitializerList FieldInitializer DefaultMethodClause DeleteMethodClause FunctionDefinition OperatorCast operator TemplateInstantiation FunctionDefinition FunctionDefinition Declaration ModuleDeclaration module RequiresExpression RequirementList SimpleRequirement TypeRequirement CompoundRequirement ReturnTypeRequirement ConstraintConjuction LogicOp ConstraintDisjunction LogicOp ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator TemplateFunction OperatorName StructuredBindingDeclarator ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator BitfieldClause FunctionDefinition FunctionDefinition Declaration FunctionDefinition Declaration AccessSpecifier UnionSpecifier ClassSpecifier EnumSpecifier SizedTypeSpecifier TypeSize EnumeratorList Enumerator DependentType Decltype decltype auto PlaceholderTypeSpecifier ParameterPackExpansion ParameterPackExpansion FieldIdentifier PointerExpression SubscriptExpression BinaryExpression ArithOp LogicOp LogicOp BitOp UnaryExpression LogicOp BitOp UpdateExpression CastExpression SizeofExpression sizeof CoAwaitExpression CompoundLiteralExpression NULL NewExpression new NewDeclarator DeleteExpression delete ParameterPackExpansion nullptr this UserDefinedLiteral ParamPack #define PreprocArg #if #ifdef #ifndef #else #endif #elif PreprocDirectiveName Macro Program",maxTerm:433,nodeProps:[["group",-35,1,8,11,15,16,17,19,71,72,100,101,102,104,191,208,229,242,243,270,271,272,277,280,281,282,284,285,286,287,290,292,293,294,295,296,"Expression",-13,18,25,26,27,43,255,256,257,258,262,263,265,266,"Type",-19,126,129,147,150,152,153,158,160,163,164,166,168,170,172,174,176,178,179,188,"Statement"],["isolate",-4,4,5,8,10,""],["openedBy",12,"(",52,"{",54,"["],["closedBy",13,")",51,"}",53,"]"]],propSources:[k],skippedNodes:[0,3,4,5,6,7,10,297,298,299,300,301,302,303,304,305,306,308,349,350],repeatNodeCount:43,tokenData:"&AbMfR!UOX$eXY/]YZ5gZ]$e]^1g^p$epq/]qr5}rs8Zst:Ttu$euv!AWvw!Cbwx!Eqxy!Flyz!Gmz{!Hn{|!Iw|}!LX}!O!MY!O!P# m!P!Q#8a!Q!R#@T!R![$'k![!]$@f!]!^$Bn!^!_$Co!_!`%C`!`!a%Dg!a!b%HP!b!c$e!c!n%IQ!n!o%Jl!o!w%IQ!w!x%Jl!x!}%IQ!}#O%Mx#O#P& }#P#Q&3[#Q#R&5a#R#S%IQ#S#T$e#T#i%IQ#i#j&6j#j#o%IQ#o#p&8[#p#q&9]#q#r&;o#r#s&|#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz?Xe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z@j#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz@ue)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^BW#^#o;x#o;'S$e;'S;=`/V<%lO$eGzBce)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#b;x#b#cCt#c#o;x#o;'S$e;'S;=`/V<%lO$eGzDPe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#YEb#Y#o;x#o;'S$e;'S;=`/V<%lO$eGzEoc)d`(wS'e<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGzGVg)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#`;x#`#aHn#a#b;x#b#c!!n#c#o;x#o;'S$e;'S;=`/V<%lO$eGzHyg)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^Jb#^#g;x#g#hMh#h#o;x#o;'S$e;'S;=`/V<%lO$eGzJme)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#ZLO#Z#o;x#o;'S$e;'S;=`/V<%lO$eGzL]c)d`(wS'f,U'l<`'m<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGzMse)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y! U#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz! cc)d`(wS'j<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!!ye)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#W;x#W#X!$[#X#o;x#o;'S$e;'S;=`/V<%lO$eGz!$ge)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^!%x#^#o;x#o;'S$e;'S;=`/V<%lO$eGz!&Te)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!'f#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz!'sc)d`(wS'f,U'k<`'m<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!)Zg)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!*r#Z#b;x#b#c!7l#c#o;x#o;'S$e;'S;=`/V<%lO$eGz!+Pg)d`(wS'g<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#W;x#W#X!,h#X#b;x#b#c!1[#c#o;x#o;'S$e;'S;=`/V<%lO$eGz!,se)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y!.U#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz!.ae)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!/r#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz!0Pc)d`(wS'h<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!1ge)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#W;x#W#X!2x#X#o;x#o;'S$e;'S;=`/V<%lO$eGz!3Te)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y!4f#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz!4qe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!6S#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz!6ac)d`(wS'i<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!7we)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#V;x#V#W!9Y#W#o;x#o;'S$e;'S;=`/V<%lO$eGz!9ee)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#`;x#`#a!:v#a#o;x#o;'S$e;'S;=`/V<%lO$eGz!;Re)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#i;x#i#j!Q#X#o;x#o;'S$e;'S;=`/V<%lO$eGz!>]e)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y!?n#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz!?{c)d`(wSV<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eF`!Ae^)d`(wS%Z#t![8O'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Bl[!g:t)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Co_)^8O)d`(wS%[#t'f,UOY$eZr$ers%dsv$evw!Dnwx*mx!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!D{[)]8O%^#t)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCb!E|Y)bW(wS)c8O'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q#O*m#O#P'b#P;'S*m;'S;=`-P<%lO*mLS!Fw[)d`(wS]Kn'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$e-^!Gx[[r)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!H{^)Z8O)d`(wS%Z#t'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!JU`)d`(wS%Z#t!Y8O'f,UOY$eZr$ers%dsw$ewx*mx{$e{|!KW|!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Kc[)d`!X:t(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr!Ld[!h8W)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Mga)d`(wS%Z#t!Y8O'f,UOY$eZr$ers%dsw$ewx*mx}$e}!O!KW!O!P$e!P!Q-V!Q!_$e!_!`!Ba!`!a!Nl!a#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Nw[)O:t)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr# x^)d`(wS'f,U(}8OOY$eZr$ers%dsw$ewx*mx!O$e!O!P#!t!P!Q-V!Q![#$w![#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr#!}])d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!O$e!O!P##v!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr#$R[)a8W)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCj#%So)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx#'Tx!P$e!P!Q-V!Q![#$w![!g$e!g!h#1O!h!i#6j!i!n$e!n!o#6j!o!r$e!r!s#1O!s!w$e!w!x#6j!x#O$e#O#P'b#P#X$e#X#Y#1O#Y#Z#6j#Z#`$e#`#a#6j#a#d$e#d#e#1O#e#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eCY#'[Z(wS'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q![#'}![#O*m#O#P'b#P;'S*m;'S;=`-P<%lO*mCY#(Wo(wS!i8O'f,UOY*mZr*mrs&Zsw*mwx#'Tx!P*m!P!Q+d!Q![#'}![!g*m!g!h#*X!h!i#/a!i!n*m!n!o#/a!o!r*m!r!s#*X!s!w*m!w!x#/a!x#O*m#O#P'b#P#X*m#X#Y#*X#Y#Z#/a#Z#`*m#`#a#/a#a#d*m#d#e#*X#e#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCY#*bm(wS!i8O'f,UOY*mZr*mrs&Zs{*m{|#,]|}*m}!O#,]!O!P*m!P!Q+d!Q![#-c![!c*m!c!h#-c!h!i#-c!i!n*m!n!o#/a!o!w*m!w!x#/a!x#O*m#O#P'b#P#T*m#T#Y#-c#Y#Z#-c#Z#`*m#`#a#/a#a#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCY#,d_(wS'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q![#-c![!c*m!c!i#-c!i#O*m#O#P'b#P#T*m#T#Z#-c#Z;'S*m;'S;=`-P<%lO*mCY#-lk(wS!i8O'f,UOY*mZr*mrs&Zsw*mwx#,]x!P*m!P!Q+d!Q![#-c![!c*m!c!h#-c!h!i#-c!i!n*m!n!o#/a!o!w*m!w!x#/a!x#O*m#O#P'b#P#T*m#T#Y#-c#Y#Z#-c#Z#`*m#`#a#/a#a#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCY#/jf(wS!i8O'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q!h*m!h!i#/a!i!n*m!n!o#/a!o!w*m!w!x#/a!x#O*m#O#P'b#P#Y*m#Y#Z#/a#Z#`*m#`#a#/a#a#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCj#1Zo)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx*mx{$e{|#3[|}$e}!O#3[!O!P$e!P!Q-V!Q![#4j![!c$e!c!h#4j!h!i#4j!i!n$e!n!o#6j!o!w$e!w!x#6j!x#O$e#O#P'b#P#T$e#T#Y#4j#Y#Z#4j#Z#`$e#`#a#6j#a#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eCj#3ea)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![#4j![!c$e!c!i#4j!i#O$e#O#P'b#P#T$e#T#Z#4j#Z;'S$e;'S;=`/V<%lO$eCj#4uk)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx#,]x!P$e!P!Q-V!Q![#4j![!c$e!c!h#4j!h!i#4j!i!n$e!n!o#6j!o!w$e!w!x#6j!x#O$e#O#P'b#P#T$e#T#Y#4j#Y#Z#4j#Z#`$e#`#a#6j#a#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eCj#6uh)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!h$e!h!i#6j!i!n$e!n!o#6j!o!w$e!w!x#6j!x#O$e#O#P'b#P#Y$e#Y#Z#6j#Z#`$e#`#a#6j#a#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eMf#8la)d`(wS%Z#t![8OOY$eYZ&ZZr$ers%dsw$ewx*mxz$ez{#9q{!P$e!P!Q#:g!Q!_$e!_!`!Ba!`#O$e#O#P&Z#P;'S$e;'S;=`/V<%lO$eMf#9zX)d`(wS(qMQOY.]Zr.]rs)xsw.]wx,bx#O.]#P;'S.];'S;=`/P<%lO.]Mf#:pY)d`(wSSMQOY#:gZr#:grs#;`sw#:gwx#?Wx#O#:g#O#P#z<%lO#z<%lO#z<%lO#]#P;'S#z<%lO#bWSMQOY#z<%lO#}P;=`<%l#Ov)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx$3hx!O$e!O!P#NV!P!Q-V!Q![$1R![!c$e!c!g$1R!g!h$9o!h!i$1R!i!n$e!n!o#6j!o!r$e!r!s#1O!s!w$e!w!x#6j!x#O$e#O#P'b#P#T$e#T#U$1R#U#V$1R#V#X$1R#X#Y$9o#Y#Z$1R#Z#`$e#`#a#6j#a#d$e#d#e#1O#e#i$e#i#j#6j#j#l$e#l#m$/s#m;'S$e;'S;=`/V<%lO$eGz$@q^(|9b)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![$e![!]$Am!]#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eFh$Ax[m:|)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCj$By[)`8O)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eM^$C|aq8O%]#t)d`(wS'f,UOY$ERYZ$FZZr$ERrs$Fxsw$ERwx%4^x!P$ER!P!Q%8|!Q!^$ER!^!_%=a!_!`%?z!`!a%B_!a#O$ER#O#P%.w#P;'S$ER;'S;=`%=Z<%lO$ER3h$E[_)d`(wS'f,UOY$ERYZ$FZZr$ERrs$Fxsw$ERwx%4^x!P$ER!P!Q%8|!Q!`$ER!`!a%p!`!a%{_!g:t)d`(wS'f,UOY$ERYZ$FZZr$ERrs$Fxsw$ERwx%4^x!P$ER!P!Q%8|!Q!`$ER!`!a%`Zp$epq&>`qr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e,t&>ie)d`(wS'f,UOX$eXY&>`Zp$epq&>`qr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e,t&@Vc)d`(wSeY'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![&?z![!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e",tokenizers:[f,g,1,2,3,4,5,6,7,8,9,10,new o("j~RQYZXz{^~^O(s~~aP!P!Qd~iO(t~~",25,356)],topRules:{Program:[0,307]},dynamicPrecedences:{17:1,65:1,87:1,94:1,119:1,184:1,187:-10,240:-10,241:1,244:-1,246:-10,247:1,262:-1,267:2,268:2,306:-10,371:3,425:1,426:3,427:1,428:1},specialized:[{term:362,get:O=>u[O]||-1},{term:33,get:O=>G[O]||-1},{term:66,get:O=>y[O]||-1},{term:369,get:O=>E[O]||-1}],tokenPrec:24852}),F=m.define({name:"cpp",parser:C.configure({props:[d.add({IfStatement:a({except:/^\s*({|else\b)/}),TryStatement:a({except:/^\s*({|catch)\b/}),LabeledStatement:Y,CaseStatement:O=>O.baseIndent+O.unit,BlockComment:()=>null,CompoundStatement:w({closing:"}"}),Statement:a({except:/^{/})}),n.add({"DeclarationList CompoundStatement EnumeratorList FieldDeclarationList InitializerList":V,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/,closeBrackets:{stringPrefixes:["L","u","U","u8","LR","UR","uR","u8R","R"]}}});function J(){return new s(F)}export{J as cpp,F as cppLanguage}; +import{L as t,E as Z,a as o}from"./index-B2EmydOR.js";import{J as S,Q as e,g as s,L as m,z as d,v as Y,r as a,u as w,x as n,w as V}from"./FileExplorer-DTHAXsem.js";import"./useI18n-lwZlSdSx.js";import"./index-OVPV9rln.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const P=1,l=2,q=3,T=82,z=76,_=117,h=85,c=97,j=122,b=65,p=90,v=95,i=48,U=34,R=40,r=41,W=32,x=62,f=new Z(O=>{if(O.next==z||O.next==h?O.advance():O.next==_&&(O.advance(),O.next==i+8&&O.advance()),O.next!=T||(O.advance(),O.next!=U))return;O.advance();let Q="";for(;O.next!=R;){if(O.next==W||O.next<=13||O.next==r)return;Q+=String.fromCharCode(O.next),O.advance()}for(O.advance();;){if(O.next<0)return O.acceptToken(P);if(O.next==r){let $=!0;for(let X=0;$&&X{if(O.next==x)O.peek(1)==x&&O.acceptToken(l,1);else{let Q=!1,$=0;for(;;$++){if(O.next>=b&&O.next<=p)Q=!0;else{if(O.next>=c&&O.next<=j)return;if(O.next!=v&&!(O.next>=i&&O.next<=i+9))break}O.advance()}Q&&$>1&&O.acceptToken(q)}},{extend:!0}),k=S({"typedef struct union enum class typename decltype auto template operator friend noexcept namespace using requires concept import export module __attribute__ __declspec __based":e.definitionKeyword,"extern MsCallModifier MsPointerModifier extern static register thread_local inline const volatile restrict _Atomic mutable constexpr constinit consteval virtual explicit VirtualSpecifier Access":e.modifier,"if else switch for while do case default return break continue goto throw try catch":e.controlKeyword,"co_return co_yield co_await":e.controlKeyword,"new sizeof delete static_assert":e.operatorKeyword,"NULL nullptr":e.null,this:e.self,"True False":e.bool,"TypeSize PrimitiveType":e.standard(e.typeName),TypeIdentifier:e.typeName,FieldIdentifier:e.propertyName,"CallExpression/FieldExpression/FieldIdentifier":e.function(e.propertyName),"ModuleName/Identifier":e.namespace,PartitionName:e.labelName,StatementIdentifier:e.labelName,"Identifier DestructorName":e.variableName,"CallExpression/Identifier":e.function(e.variableName),"CallExpression/ScopedIdentifier/Identifier":e.function(e.variableName),"FunctionDeclarator/Identifier FunctionDeclarator/DestructorName":e.function(e.definition(e.variableName)),NamespaceIdentifier:e.namespace,OperatorName:e.operator,ArithOp:e.arithmeticOperator,LogicOp:e.logicOperator,BitOp:e.bitwiseOperator,CompareOp:e.compareOperator,AssignOp:e.definitionOperator,UpdateOp:e.updateOperator,LineComment:e.lineComment,BlockComment:e.blockComment,Number:e.number,String:e.string,"RawString SystemLibString":e.special(e.string),CharLiteral:e.character,EscapeSequence:e.escape,"UserDefinedLiteral/Identifier":e.literal,PreprocArg:e.meta,"PreprocDirectiveName #include #ifdef #ifndef #if #define #else #endif #elif":e.processingInstruction,MacroName:e.special(e.name),"( )":e.paren,"[ ]":e.squareBracket,"{ }":e.brace,"< >":e.angleBracket,". ->":e.derefOperator,", ;":e.separator}),u={__proto__:null,bool:36,char:36,int:36,float:36,double:36,void:36,size_t:36,ssize_t:36,intptr_t:36,uintptr_t:36,charptr_t:36,int8_t:36,int16_t:36,int32_t:36,int64_t:36,uint8_t:36,uint16_t:36,uint32_t:36,uint64_t:36,char8_t:36,char16_t:36,char32_t:36,char64_t:36,const:70,volatile:72,restrict:74,_Atomic:76,mutable:78,constexpr:80,constinit:82,consteval:84,struct:88,__declspec:92,final:148,override:148,public:152,private:152,protected:152,virtual:154,extern:160,static:162,register:164,inline:166,thread_local:168,__attribute__:172,__based:178,__restrict:180,__uptr:180,__sptr:180,_unaligned:180,__unaligned:180,noexcept:194,requires:198,TRUE:798,true:798,FALSE:800,false:800,typename:218,class:220,template:234,throw:248,__cdecl:256,__clrcall:256,__stdcall:256,__fastcall:256,__thiscall:256,__vectorcall:256,try:260,catch:264,export:282,import:286,case:296,default:298,if:308,else:314,switch:318,do:322,while:324,for:330,return:334,break:338,continue:342,goto:346,co_return:350,co_yield:354,using:362,typedef:366,namespace:380,new:398,delete:400,co_await:402,concept:406,enum:410,static_assert:414,friend:422,union:424,explicit:430,operator:444,module:456,signed:518,unsigned:518,long:518,short:518,decltype:528,auto:530,sizeof:566,NULL:572,nullptr:586,this:588},G={__proto__:null,"<":767},y={__proto__:null,">":135},E={__proto__:null,operator:388,new:576,delete:582},C=t.deserialize({version:14,states:"$<[Q!QQVOOP'gOUOOO([OWO'#CdO,UQUO'#CgO,`QUO'#FjO-vQbO'#CxO.XQUO'#CxO0WQUO'#KaO0_QUO'#CwO0jOpO'#DvO0rQ!dO'#D]OOQR'#JP'#JPO5[QVO'#GUO5iQUO'#JWOOQQ'#JW'#JWO8}QUO'#KtOxQVO'#IbO!(}QVO'#IdO!?SQUO'#IgO!?ZQVO'#IjP!AQO!LQO'#CaP!A]{,UO'#CbP!6q{,UO'#CbP!Ah{7[O'#CbP!6q{,UO'#CbP!Am{,UO'#CbP!AxOSO'#IzPOOO)CEp)CEpOOOO'#I}'#I}O!BSOWO,59OOOQR,59O,59OO!(}QVO,59VOOQQ,59X,59XOOQR'#Do'#DoO!(}QVO,5;ROOQR,5qOOQR'#IX'#IXOOQR'#IY'#IYOOQR'#IZ'#IZOOQR'#I['#I[O!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!(}QVO,5>rO!D^QVO,5>zOOQQ,5?W,5?WO!FPQVO'#CjO!IxQUO'#CzOOQQ,59d,59dOOQQ,59c,59cOOQQ,5<},5<}O!JVQ&lO,5=mO!?SQUO,5?RO!LyQVO,5?UO!MQQbO,59dO!M]QVO'#FYOOQQ,5?P,5?PO!MmQVO,59WO!MtO`O,5:bO!MyQbO'#D^O!N[QbO'#KeO!NjQbO,59wO!NrQbO'#CxO# TQUO'#CxO# YQUO'#KaO# dQUO'#CwOOQR-E<}-E<}O# oQUO,5AvO# vQVO'#EfO@[QVO'#EiOBXQUO,5;kOOQR,5l,5>lO#3uQUO'#CgO#4kQUO,5>pO#6^QUO'#IeOOQR'#JO'#JOO#6fQUO,5:xO#7SQUO,5:xO#7sQUO,5:xO#8hQUO'#CuO!0TQUO'#CmOOQQ'#JX'#JXO#7SQUO,5:xO#8pQUO,5;QO!4{QUO'#DOO#9yQUO,5;QO#:OQUO,5>QO#;[QUO'#DOO#;rQUO,5>{O#;wQUO'#LOO#=QQUO,5;TO#=YQVO,5;TO#=dQUO,5;TOOQQ,5;T,5;TO#?]QUO'#LdO#?dQUO,5>UO#?iQbO'#CxO#?tQUO'#GcO#?yQUO'#E^O#@jQUO,5;kO#ARQUO'#LUO#AZQUO,5;rOKnQUO'#HfOBXQUO'#HgO#A`QUO'#KxO!6qQUO'#HjO#BWQUO'#CuO!0wQVO,5PO$(fQUO'#E[O$(sQUO,5>ROOQQ,5>S,5>SO$,aQVO'#C|OOQQ-E=q-E=qOOQQ,5>d,5>dOOQQ,59a,59aO$,kQUO,5>wO$.kQUO,5>zO!6qQUO,59uO$/OQUO,5;qO$/]QUO,5<{O!0TQUO,5:oOOQQ,5:r,5:rO$/hQUO,5;mO$/mQUO'#KtOBXQUO,5;kOOQR,5;x,5;xO$0^QUO'#FbO$0lQUO'#FbO$0qQUO,5;zO$4[QVO'#FmO!0wQVO,5sQUO'#L^O$>{QUO,5T,5>TO$FxQUO,5>TO$GSQUO,5>TO$GXQUO,5>TO$G^QUO,5>TO!6qQUO,5>TO$I[QUO'#KaO$IcQUO,5=oO$InQUO,5=aOKnQUO,5=oO$JhQUO,5=sOOQR,5=s,5=sO$JpQUO,5=sO$L{QVO'#H[OOQQ,5=u,5=uO!;`QUO,5=uO%#vQUO'#KqO%#}QUO'#KbO%$cQUO'#KqO%$mQUO'#DyO%%OQUO'#D|O%'{QUO'#KbOOQQ'#Kb'#KbO%)nQUO'#KbO%#}QUO'#KbO%)sQUO'#KbOOQQ,59s,59sOOQQ,5>a,5>aOOQQ,5>b,5>bO%){QUO'#HzO%*TQUO,5>cOOQQ,5>c,5>cO%-oQUO,5>cO%-zQUO,5>hO%1fQVO,5>iO%1mQUO,5>|O# vQVO'#EfO%4sQUO,5>|OOQQ,5>|,5>|O%5dQUO,5?OO%7hQUO,5?RO!<_QUO,5?RO%9dQUO,5?UO%=PQVO,5?UPOOO'#I|'#I|P%=WO!LQO,58{POOO,58{,58{P!Am{,UO,58|P%=c{,UO,58|P%=q{7[O,58|PO{O'#Jw'#JwP%>S{,UO'#LkPOOO'#Lk'#LkP%>Y{,UO'#LkPOOO,58|,58|POOO,5?f,5?fP%>_OSO,5?fOOOO-E<{-E<{OOQR1G.j1G.jO%>fQUO1G.qO%?lQUO1G0mOOQQ1G0m1G0mO%@xQUO'#CpO%CXQbO'#CxO%CdQUO'#CsO%CiQUO'#CsO%CnQUO1G.uO#BWQUO'#CrOOQQ1G.u1G.uO%EqQUO1G4]O%FwQUO1G4^O%HjQUO1G4^O%J]QUO1G4^O%LOQUO1G4^O%MqQUO1G4^O& dQUO1G4^O&#VQUO1G4^O&$xQUO1G4^O&&kQUO1G4^O&(^QUO1G4^O&*PQUO1G4^O&+rQUO'#KVO&,{QUO'#KVO&-TQUO,59UOOQQ,5=P,5=PO&/]QUO,5=PO&/gQUO,5=PO&/lQUO,5=PO&/qQUO,5=PO!6qQUO,5=PO#NsQUO1G3XO&/{QUO1G4mO!<_QUO1G4mO&1wQUO1G4pO&3jQVO1G4pOOQQ1G/O1G/OOOQQ1G.}1G.}OOQQ1G2i1G2iO!JVQ&lO1G3XO&3qQUO'#LVO@[QVO'#EiO&4zQUO'#F]OOQQ'#Jb'#JbO&5PQUO'#FZO&5[QUO'#LVO&5dQUO,5;tO&5iQUO1G.rOOQQ1G.r1G.rOOQR1G/|1G/|O&7[Q!dO'#JQO&7aQbO,59xO&9rQ!eO'#D`O&9yQ!dO'#JSO&:OQbO,5APO&:OQbO,5APOOQR1G/c1G/cO&:ZQbO1G/cO&:`Q&lO'#GeO&;^QbO,59dOOQR1G7b1G7bO#@jQUO1G1VO&;iQUO1G1^OBXQUO1G1VO&=zQUO'#CzO#+VQbO,59dO&AmQUO1G6zOOQR-E<|-E<|O&CPQUO1G0dO#6fQUO1G0dOOQQ-E=V-E=VO#7SQUO1G0dOOQQ1G0l1G0lO&CtQUO,59jOOQQ1G3l1G3lO&D[QUO,59jO&DrQUO,59jO!MmQVO1G4gO!(}QVO'#JZO&E^QUO,5AjOOQQ1G0o1G0oO!(}QVO1G0oO!6qQUO'#JpO&EfQUO,5BOOOQQ1G3p1G3pOOQR1G1V1G1VO&IcQVO'#FOO!MmQVO,5;sOOQQ,5;s,5;sOBXQUO'#JdO&K_QUO,5ApO&KgQVO'#E[OOQR1G1^1G1^O&NUQUO'#LdOOQR1G1n1G1nOOQR-E=h-E=hOOQR1G7e1G7eO#DvQUO1G7eOGYQUO1G7eO#DvQUO1G7gOOQR1G7g1G7gO&N^QUO'#G}O&NfQUO'#L`OOQQ,5=h,5=hO&NtQUO,5=jO&NyQUO,5=kOOQR1G7h1G7hO#EtQVO1G7hO' OQUO1G7hO'!UQVO,5=kOOQR1G1U1G1UO$/UQUO'#E]O'!zQUO'#E]OOQQ'#LQ'#LQO'#eQUO'#LPO'#pQUO,5;UO'#xQUO'#ElO'$]QUO'#ElO'$pQUO'#EtOOQQ'#J]'#J]O'$uQUO,5;cO'%lQUO,5;cO'&gQUO,5;dO''mQVO,5;dOOQQ,5;d,5;dO''wQVO,5;dO''mQVO,5;dO'(OQUO,5;bO'({QUO,5;eO')WQUO'#KwO')`QUO,5:vO')eQUO,5;fOOQQ1G0n1G0nOOQQ'#J^'#J^O'(OQUO,5;bO!4{QUO'#E}OOQQ,5;b,5;bO'*`QUO'#E`O',YQUO'#E{OHuQUO1G0nO',_QUO'#EbOOQQ'#JY'#JYO'-wQUO'#KyOOQQ'#Ky'#KyO'.qQUO1G0eO'/iQUO1G3kO'0oQVO1G3kOOQQ1G3k1G3kO'0yQVO1G3kO'1QQUO'#LgO'2^QUO'#K_O'2lQUO'#K^O'2wQUO,59hO'3PQUO1G/aO'3UQUO'#FPOOQR1G1]1G1]OOQR1G2g1G2gO$?]QUO1G2gO'3`QUO1G2gO'3kQUO1G0ZOOQR'#Ja'#JaO'3pQVO1G1XO'9iQUO'#FTO'9nQUO1G1VO!6qQUO'#JeO'9|QUO,5;|O$0lQUO,5;|OOQQ'#Fc'#FcOOQQ,5;|,5;|O':[QUO1G1fOOQR1G1f1G1fO':dQUO,5fO(*vQUO'#LeOOQQ1G3}1G3}O(.mQUO1G3}O(.tQUO1G3}O(.{QUO1G4TO(0RQUO1G4TO(0WQUO,5BUO!6qQUO1G4hO!(}QVO'#IiOOQQ1G4m1G4mO(0]QUO1G4mO(2`QVO1G4pPOOO-Em,5>mO$)hQVO'#JuO)+xQUO,5@xOOQQ1G/S1G/SOOQQ7+${7+${O),TQUO7+(RO),YQUO7+(ROOQR7+(R7+(RO$?]QUO7+(ROOQQ7+%u7+%uOOQR-E=_-E=_O!0YQUO,5;oOOQQ,5@P,5@POOQQ-E=c-E=cO$0lQUO1G1hOOQQ1G1h1G1hOOQR7+'Q7+'QOOQR1G1s1G1sOBXQUO,5;rO),vQUO,5yQUO7+(`O)@PQUO7+(dO)@UQVO7+(dOOQQ7+(l7+(lOOQQ7+)Z7+)ZO)@^QUO'#KqO)@hQUO'#KqOOQR,5=b,5=bO)@uQUO,5=bO!;eQUO,5=bO!;eQUO,5=bO!;eQUO,5=bOOQR7+(g7+(gOOQR7+(u7+(uOOQR7+(y7+(yOOQR,5=w,5=wO)@zQUO,5=zO)BQQUO,5=yOOQR,5A},5A}OOQR-E=k-E=kOOQQ1G3b1G3bO)CWQUO,5=xO)C]QVO'#EfOOQQ1G6h1G6hO%)nQUO1G6hO%)sQUO1G6hOOQQ1G0P1G0POOQQ-E=R-E=RO)EtQUO,5A^O(&jQUO'#JUO)FPQUO,5A^O)FPQUO,5A^O)FXQUO,5:iO8}QUO,5:iOOQQ,5>],5>]O)FcQUO,5AyO)FjQUO'#EVO)GtQUO'#EVO)H_QUO,5:iO)HiQUO'#HlO)HiQUO'#HmOOQQ'#Kv'#KvO)IWQUO'#KvO!(}QVO'#HnOOQQ,5:i,5:iO)IxQUO,5:iO!MmQVO,5:iOOQQ-E=T-E=TOOQQ1G0S1G0SOOQQ,5>`,5>`O)I}QUO1G6hO!(}QVO,5>gO)MlQUO'#JtO)MwQUO,5BQOOQQ1G4Q1G4QO)NPQUO,5BPOOQQ,5BP,5BPOOQQ7+)i7+)iO*#nQUO7+)iOOQQ7+)o7+)oO*(mQVO1G7pO**oQUO7+*SO**tQUO,5?TO*+zQUO7+*[POOO7+$S7+$SP*-mQUO'#LnP*-uQUO,5BXP!Am{,UO7+$SPOOO1G7q1G7qO*-zQUO<_QUO1G0xOOQQ1G0y1G0yO*>pQUO'#ElOOQQ1G0z1G0zOOQQ7+&j7+&jO*?UQUO7+&jO*@[QVO7+&jOOQQ7+&h7+&hOOQQ,5@],5@]OOQQ-E=o-E=oO*AWQUO1G1TO*AbQUO1G1TO*A{QUO1G0fOOQQ1G0f1G0fO*CRQUO'#LSO*CZQUO1G1ROOQQ<VO)HiQUO'#JrO*N}QUO1G0TO+ `QVO1G0TOOQQ1G3u1G3uO+ gQUO,5>WO+ rQUO,5>XO+!aQUO,5>YO+#gQUO1G0TO%)sQUO7+,SO+$mQUO1G4ROOQQ,5@`,5@`OOQQ-E=r-E=rOOQQ<n,5>nO+0fQUOANAXOOQRANAXANAXO+0kQUO7+'`OOQRAN@cAN@cO+1wQVOAN@nO+2OQUOAN@nO!0wQVOAN@nO+3XQUOAN@nO+3^QUOAN@}O+3iQUOAN@}O+4oQUOAN@}OOQRAN@nAN@nO!MmQVOAN@}OOQRANAOANAOO+4tQUO7+'|O)8XQUO7+'|OOQQ7+(O7+(OO+5VQUO7+(OO+6]QVO7+(OO+6dQVO7+'hO+6kQUOANAjOOQR7+(h7+(hOOQR7+)P7+)PO+6pQUO7+)PO+6uQUO7+)POOQQ<= n<= nO+6}QUO7+,dO+7VQUO1G5[OOQQ1G5[1G5[O+7bQUO7+%oOOQQ7+%o7+%oO+7sQUO7+%oO+ `QVO7+%oOOQQ7+)a7+)aO+7xQUO7+%oO+9OQUO7+%oO!MmQVO7+%oO+9YQUO1G0]O*MhQUO1G0]O)FjQUO1G0]OOQQ1G0a1G0aO+9wQUO1G3qO+:}QVO1G3qOOQQ1G3q1G3qO+;XQVO1G3qO+;`QUO,5@^OOQQ-E=p-E=pOOQQ1G3r1G3rO%)nQUO<= nOOQQ7+*Z7+*ZPOQQ,5@d,5@dPOQQ-E=v-E=vOOQQ1G/}1G/}OOQQ,5?y,5?yOOQQ-E=]-E=]OOQRG26sG26sO+;wQUOG26YO!0wQVOG26YO+=QQUOG26YOOQRG26YG26YO!MmQVOG26iO!0wQVOG26iO+=VQUOG26iO+>]QUOG26iO+>bQUO<sQUO<xQUO<}QUO<uAN>uO+CmQUOAN>uO+DsQUOAN>uO!MmQVOAN>uO+DxQUO<VQUO'#CzO,>eQbO,59dO,5^QUO7+&OO,;hQUO7+&OO,>pQUO'#EwO,?cQUO'#EzO,@SQUO'#E^O,@XQUO'#GcO,@^QUO'#CwO,@cQUO'#CxO,@hQUO'#CxO,@mQUO'#GcO,@rQUO'#CwO,@wQUO'#KaO,AeQUO'#KaO,AoQUO'#CwO,AzQUO'#CwO,BVQUO'#CwO,;hQUO,5:xO,6xQUO,5:xO,6xQUO,5:xO,BbQUO'#KaO,BuQbO'#CxO,CQQUO'#CsO,CVQUO'#E^",stateData:",C{~O(pOSSOSRPQVPQ'ePQ'gPQ'hPQ'iPQ'jPQ'kPQ'lPQ'mPQ(qPQ~O*cOS~OPmO]eOb!]Oe!POmTOs!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O|#RO!O!_O!TxO!VfO!X!XO!Y!WO!i!YO!opO!r!`O!s!aO!t!aO!u!bO!v!aO!x!cO!{!dO#V#QO#a#VO#b#TO#i#OO#p!xO#t!fO#v!eO$R!gO$T!hO$Y!vO$Z!wO$`!iO$e!jO$g!kO$h!lO$k!mO$m!nO$o!oO$q!pO$s!qO$u!rO$w!sO${!tO$}!uO%U!yO%_#ZO%`#[O%a#YO%c!zO%e#UO%g!{O%l#SO%o!|O%v!}O%|#PO&m!RO&r#WO&s!TO'Q!WO'R!WO'V#XO'Y![O'a![O'b![O(vQO(xRO)WYO)ZaO)]|O)^{O)`iO)a!ZO)cXO)ocO)pdO~OR#cOV#^O'e#_O'g#`O'h#aO'i#aO'j#bO'k#bO'l#`O'm#`O(q#]O~OX#eO(u#gO(w#eO~O]ZX]jXejXmhXqZXqjXsjXtjXujXvjXwjXxjXyjXzjX!OjX!TjX!VZX!VjX!XZX!YZX![ZX!^ZX!_ZX!aZX!bZX!eZX!fZX!gZX!hZX!rjX!sjX!tjX!ujX!vjX!xjX!{jX%vjX&rjX&sjX(xjX({ZX(|$]X(}ZX)OZX)ZZX)ZjX)[ZX)]ZX)]jX)^ZX)^jX)_ZX)`ZX)aZX)qZX~O)`jX!UZX~P(gO]$PO!V#nO!X#}O!Y#sO![#tO!^#wO!_#xO!a#zO!b#{O!e#{O!f#|O!h#kO({#hO(}#mO)O#mO)Z#oO)[#qO)]#pO)^#rO)_#jO)`#lO)a$OO~Oe$TO%Y$UO'[$VO'_$WO)P$QO~Om$XO~O!T$YO])TXe)TXs)TXt)TXu)TXv)TXw)TXx)TXy)TXz)TX!O)TX!V)TX!r)TX!s)TX!t)TX!u)TX!v)TX!x)TX!{)TX%v)TX&r)TX&s)TX(x)TX)Z)TX)])TX)^)TX)`)TX~Om$XO~P.^Om$XO!g$[O)q$[O~OX$]O)d$]O~O!R$^O)V)XP)a)XP~OPmO]$gOb!]Os!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O|#RO!O!_O!TxO!V$hO!X!XO!Y!WO!i!YO!r!aO!s!aO!t!aO!u!aO!v!aO!x!cO#V#QO#a#VO#b#TO#v!eO$Y!vO$Z!wO$`!iO$e!jO$g!kO$h!lO$k!mO$m!nO$o!oO$q!pO$s!qO$u!rO$w!sO%_#ZO%`#[O%a#YO%e#UO%l#SO%v$oO&m!RO&r#WO&s!TO'Q!WO'R!WO'V#XO'Y![O'a![O'b![O(vQO)WYO)Z$mO)^$mO)`iO)a!ZO)cXO)ocO)pdO~Om$aO#t$nO(xRO~P0}O](_Xb'zXe(_Xm'zXm(_Xs'zXs(_Xt'zXt(_Xu'zXu(_Xv'zXv(_Xw'zXw(_Xx'zXx(_Xy'zXy(_Xz'zXz(_X|'zX!O'zX!V(_X!o(_X!r'zX!r(_X!s'zX!s(_X!t'zX!t(_X!u'zX!u(_X!v'zX!v(_X!x'zX!x(_X!{(_X#a'zX#b'zX%e'zX%l'zX%o(_X%v(_X&m'zX&r'zX&s'zX(x'zX(x(_X)Z(_X)](_X)^(_X~Ob!TOm$qOs!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O|#RO!O!_O!r!aO!s!aO!t!aO!u!aO!v!aO!x!cO#a#VO#b#TO%e#UO%l#SO&m!RO&r#WO&s!TO(x$pO~Os!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O!O!_O!r!aO!s!aO!t!aO!u!aO!v!aO!x!cO&r#WO&s$yO])hXe)hXm)hX!V)hX!{)hX%v)hX(x)hX)Z)hX)])hX)^)hX~O)`$xO~P:qOPmO]eOe!POs!^Ot!^Ou!^Ov!^Ow!^Ox!^Oy!^Oz!^O!VfO!X!XO!Y!WO!i!YO!{!dO#V#QO%_#ZO%`#[O%a#YO%v$oO'Q!WO'R!WO'V#XO'Y![O'a![O'b![O(vQO)ZaO)]|O)^{O)a!ZO)cXO)ocO)pdO~Ob%SOm;UO!|%TO(x$zO~PfP?P?c?wFpMq!&v!-_P!4Y!4}!5rP!6^PPPPPPPP!6wP!8aP!9r!;[P!;bPPPPPP!;eP!;ePP!;ePP!;qPPPPPP!=s!AZP!A^PP!Az!BoPPPPP!BsP?S!DUPP?S!F]!H^!Hl!JR!KrP!K}P!L^!L^# n#$}#&e#)q#,{!H^#-VPP!H^#-^#-d#-V#-V#-gP#-k#.Y#.Y#.Y#.Y!KrP#.s#/U#1kP#2PP#3lP#3p#3x#4m#4x#7W#7`#7`#3pP#3pP#7g#7mP#7wPP#8d#9R#9s#8dP#:e#:qP#8dP#8dPP#8d#8dP#8dP#8dP#8dP#8dP#8dP#8dP#:t#7w#;bP#;wP#<^#<^#<^#<^#S$@Y$@`$@v$AQ$A]$Al$Ar$CQ$DP$DW$D_$De$Dm$Dw$D}$EY$E`$Ei$Eq$E|$FS$F^$Fd$Fn$Ft$F{$G[$Gb$GhP$Gn$Gv$G}$H]$Iy$JP$JV$J^$JjPPPPPPPPPPPP$Jp$JtPPPPP%#v$*i%#y%'R%)ZPP%)h%)kPPPPPPPPPP%)w%*z%+Q%+U%,{%.Y%.{%/S%1c%1iPPP%1s%2O%2R%2X%3`%3c%3m%3w%3{%5P%5r%5x#CeP%6c%6i%6y%6|%7^%7j%7n%7t%7z$*i$*l$*l%7}%8QP%8a%8dQ#dPa(s#b(p(q(r(t/]/_4rR#dP'`mO[aefwx{!W!X!g!k!n!r!s!v!x#X#Y#[#h#k#n#s#t#u#v#w#x#y#z#{#|#}$P$W$Y$[$g$h$m%_%o&S&U&Y&d&h&z&{'O'Q'R'e'l'm'|(c(e(l)q)w*m*n*q*v*w*{+]+_+m+o+p,U,W,s,v,|-d-e-h-n.W.X.]/U/X/d/k/t/v/{/}0p1T1Y1i1j1t1x2S2U2k2n2q3P3U3X3s4Y4]4b4k5d5o5{6i6m6p6r6t7O7Q7V7l7t7w8o8q8w8}9O9]9a9g9i9v9y9z:V:Y:`:b:g:l:pU%qm%r7[Q&o!`Q(p#^d0X*S0U0V0W0Z5X5Y5Z5^8[R7[3_b}Oaewx{!g&U*v&v$k[!W!X!k!n!r!s!v!x#X#Y#[#h#k#n#s#t#u#v#w#x#y#z#{#|#}$P$W$Y$[$g$h$m%_%o&S&Y&d&h&z&{'O'Q'R'e'l'm'|(c(e(l)q)w*m*n*q*w*{+]+_+m+o+p,U,W,s,v,|-d-e-h-n.W.X.]/U/X/d/k/t/v/{/}1T1i1j1t1x2S2U2k2n2q3P3U3X3s4Y4]4b4k5d5o5{6i6m6p6r6t7O7Q7V7l7t7w8o8q8w8}9O9]9a9g9i9v9y9z:V:Y:`:b:g:l:pS%bf0p#d%lgnp|#O$i%O%P%U%f%j%k%y&u'w'x(T*_*e*g*y+b,q,{-f-w.O.m.t.v0e1R1S1W1[2g2r5k6q;b;c;d;j;k;l;y;z;{;| MacroName LineComment BlockComment PreprocDirective #include String EscapeSequence SystemLibString Identifier ) ( ArgumentList ConditionalExpression AssignmentExpression CallExpression PrimitiveType FieldExpression FieldIdentifier DestructorName TemplateMethod ScopedFieldIdentifier NamespaceIdentifier TemplateType TypeIdentifier ScopedTypeIdentifier ScopedNamespaceIdentifier :: NamespaceIdentifier TypeIdentifier TemplateArgumentList < TypeDescriptor const volatile restrict _Atomic mutable constexpr constinit consteval StructSpecifier struct MsDeclspecModifier __declspec Attribute AttributeName Identifier AttributeArgs { } [ ] UpdateOp ArithOp ArithOp ArithOp LogicOp BitOp BitOp BitOp CompareOp CompareOp CompareOp > CompareOp BitOp UpdateOp , Number CharLiteral AttributeArgs VirtualSpecifier BaseClassClause Access virtual FieldDeclarationList FieldDeclaration extern static register inline thread_local AttributeSpecifier __attribute__ PointerDeclarator MsBasedModifier __based MsPointerModifier FunctionDeclarator ParameterList ParameterDeclaration PointerDeclarator FunctionDeclarator Noexcept noexcept RequiresClause requires True False ParenthesizedExpression CommaExpression LambdaExpression LambdaCaptureSpecifier TemplateParameterList OptionalParameterDeclaration TypeParameterDeclaration typename class VariadicParameterDeclaration VariadicDeclarator ReferenceDeclarator OptionalTypeParameterDeclaration VariadicTypeParameterDeclaration TemplateTemplateParameterDeclaration template AbstractFunctionDeclarator AbstractPointerDeclarator AbstractArrayDeclarator AbstractParenthesizedDeclarator AbstractReferenceDeclarator ThrowSpecifier throw TrailingReturnType CompoundStatement FunctionDefinition MsCallModifier TryStatement try CatchClause catch LinkageSpecification Declaration InitDeclarator InitializerList InitializerPair SubscriptDesignator FieldDesignator ExportDeclaration export ImportDeclaration import ModuleName PartitionName HeaderName CaseStatement case default LabeledStatement StatementIdentifier ExpressionStatement IfStatement if ConditionClause Declaration else SwitchStatement switch DoStatement do while WhileStatement ForStatement for ReturnStatement return BreakStatement break ContinueStatement continue GotoStatement goto CoReturnStatement co_return CoYieldStatement co_yield AttributeStatement ForRangeLoop AliasDeclaration using TypeDefinition typedef PointerDeclarator FunctionDeclarator ArrayDeclarator ParenthesizedDeclarator ThrowStatement NamespaceDefinition namespace ScopedIdentifier Identifier OperatorName operator ArithOp BitOp CompareOp LogicOp new delete co_await ConceptDefinition concept UsingDeclaration enum StaticAssertDeclaration static_assert ConcatenatedString TemplateDeclaration FriendDeclaration friend union FunctionDefinition ExplicitFunctionSpecifier explicit FieldInitializerList FieldInitializer DefaultMethodClause DeleteMethodClause FunctionDefinition OperatorCast operator TemplateInstantiation FunctionDefinition FunctionDefinition Declaration ModuleDeclaration module RequiresExpression RequirementList SimpleRequirement TypeRequirement CompoundRequirement ReturnTypeRequirement ConstraintConjuction LogicOp ConstraintDisjunction LogicOp ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator TemplateFunction OperatorName StructuredBindingDeclarator ArrayDeclarator ParenthesizedDeclarator ReferenceDeclarator BitfieldClause FunctionDefinition FunctionDefinition Declaration FunctionDefinition Declaration AccessSpecifier UnionSpecifier ClassSpecifier EnumSpecifier SizedTypeSpecifier TypeSize EnumeratorList Enumerator DependentType Decltype decltype auto PlaceholderTypeSpecifier ParameterPackExpansion ParameterPackExpansion FieldIdentifier PointerExpression SubscriptExpression BinaryExpression ArithOp LogicOp LogicOp BitOp UnaryExpression LogicOp BitOp UpdateExpression CastExpression SizeofExpression sizeof CoAwaitExpression CompoundLiteralExpression NULL NewExpression new NewDeclarator DeleteExpression delete ParameterPackExpansion nullptr this UserDefinedLiteral ParamPack #define PreprocArg #if #ifdef #ifndef #else #endif #elif PreprocDirectiveName Macro Program",maxTerm:433,nodeProps:[["group",-35,1,8,11,15,16,17,19,71,72,100,101,102,104,191,208,229,242,243,270,271,272,277,280,281,282,284,285,286,287,290,292,293,294,295,296,"Expression",-13,18,25,26,27,43,255,256,257,258,262,263,265,266,"Type",-19,126,129,147,150,152,153,158,160,163,164,166,168,170,172,174,176,178,179,188,"Statement"],["isolate",-4,4,5,8,10,""],["openedBy",12,"(",52,"{",54,"["],["closedBy",13,")",51,"}",53,"]"]],propSources:[k],skippedNodes:[0,3,4,5,6,7,10,297,298,299,300,301,302,303,304,305,306,308,349,350],repeatNodeCount:43,tokenData:"&AbMfR!UOX$eXY/]YZ5gZ]$e]^1g^p$epq/]qr5}rs8Zst:Ttu$euv!AWvw!Cbwx!Eqxy!Flyz!Gmz{!Hn{|!Iw|}!LX}!O!MY!O!P# m!P!Q#8a!Q!R#@T!R![$'k![!]$@f!]!^$Bn!^!_$Co!_!`%C`!`!a%Dg!a!b%HP!b!c$e!c!n%IQ!n!o%Jl!o!w%IQ!w!x%Jl!x!}%IQ!}#O%Mx#O#P& }#P#Q&3[#Q#R&5a#R#S%IQ#S#T$e#T#i%IQ#i#j&6j#j#o%IQ#o#p&8[#p#q&9]#q#r&;o#r#s&|#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz?Xe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z@j#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz@ue)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^BW#^#o;x#o;'S$e;'S;=`/V<%lO$eGzBce)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#b;x#b#cCt#c#o;x#o;'S$e;'S;=`/V<%lO$eGzDPe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#YEb#Y#o;x#o;'S$e;'S;=`/V<%lO$eGzEoc)d`(wS'e<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGzGVg)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#`;x#`#aHn#a#b;x#b#c!!n#c#o;x#o;'S$e;'S;=`/V<%lO$eGzHyg)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^Jb#^#g;x#g#hMh#h#o;x#o;'S$e;'S;=`/V<%lO$eGzJme)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#ZLO#Z#o;x#o;'S$e;'S;=`/V<%lO$eGzL]c)d`(wS'f,U'l<`'m<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGzMse)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y! U#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz! cc)d`(wS'j<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!!ye)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#W;x#W#X!$[#X#o;x#o;'S$e;'S;=`/V<%lO$eGz!$ge)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#];x#]#^!%x#^#o;x#o;'S$e;'S;=`/V<%lO$eGz!&Te)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!'f#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz!'sc)d`(wS'f,U'k<`'m<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!)Zg)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!*r#Z#b;x#b#c!7l#c#o;x#o;'S$e;'S;=`/V<%lO$eGz!+Pg)d`(wS'g<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#W;x#W#X!,h#X#b;x#b#c!1[#c#o;x#o;'S$e;'S;=`/V<%lO$eGz!,se)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y!.U#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz!.ae)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!/r#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz!0Pc)d`(wS'h<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!1ge)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#W;x#W#X!2x#X#o;x#o;'S$e;'S;=`/V<%lO$eGz!3Te)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y!4f#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz!4qe)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#Y;x#Y#Z!6S#Z#o;x#o;'S$e;'S;=`/V<%lO$eGz!6ac)d`(wS'i<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eGz!7we)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#V;x#V#W!9Y#W#o;x#o;'S$e;'S;=`/V<%lO$eGz!9ee)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#`;x#`#a!:v#a#o;x#o;'S$e;'S;=`/V<%lO$eGz!;Re)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#i;x#i#j!Q#X#o;x#o;'S$e;'S;=`/V<%lO$eGz!>]e)d`(wS'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#X;x#X#Y!?n#Y#o;x#o;'S$e;'S;=`/V<%lO$eGz!?{c)d`(wSV<`'f,U'm<`OY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![;x![!c$e!c!};x!}#O$e#O#P'b#P#R$e#R#S;x#S#T$e#T#o;x#o;'S$e;'S;=`/V<%lO$eF`!Ae^)d`(wS%Z#t![8O'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Bl[!g:t)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Co_)^8O)d`(wS%[#t'f,UOY$eZr$ers%dsv$evw!Dnwx*mx!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!D{[)]8O%^#t)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCb!E|Y)bW(wS)c8O'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q#O*m#O#P'b#P;'S*m;'S;=`-P<%lO*mLS!Fw[)d`(wS]Kn'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$e-^!Gx[[r)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!H{^)Z8O)d`(wS%Z#t'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!JU`)d`(wS%Z#t!Y8O'f,UOY$eZr$ers%dsw$ewx*mx{$e{|!KW|!P$e!P!Q-V!Q!_$e!_!`!Ba!`#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Kc[)d`!X:t(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr!Ld[!h8W)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Mga)d`(wS%Z#t!Y8O'f,UOY$eZr$ers%dsw$ewx*mx}$e}!O!KW!O!P$e!P!Q-V!Q!_$e!_!`!Ba!`!a!Nl!a#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eF`!Nw[)O:t)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr# x^)d`(wS'f,U(}8OOY$eZr$ers%dsw$ewx*mx!O$e!O!P#!t!P!Q-V!Q![#$w![#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr#!}])d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!O$e!O!P##v!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCr#$R[)a8W)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCj#%So)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx#'Tx!P$e!P!Q-V!Q![#$w![!g$e!g!h#1O!h!i#6j!i!n$e!n!o#6j!o!r$e!r!s#1O!s!w$e!w!x#6j!x#O$e#O#P'b#P#X$e#X#Y#1O#Y#Z#6j#Z#`$e#`#a#6j#a#d$e#d#e#1O#e#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eCY#'[Z(wS'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q![#'}![#O*m#O#P'b#P;'S*m;'S;=`-P<%lO*mCY#(Wo(wS!i8O'f,UOY*mZr*mrs&Zsw*mwx#'Tx!P*m!P!Q+d!Q![#'}![!g*m!g!h#*X!h!i#/a!i!n*m!n!o#/a!o!r*m!r!s#*X!s!w*m!w!x#/a!x#O*m#O#P'b#P#X*m#X#Y#*X#Y#Z#/a#Z#`*m#`#a#/a#a#d*m#d#e#*X#e#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCY#*bm(wS!i8O'f,UOY*mZr*mrs&Zs{*m{|#,]|}*m}!O#,]!O!P*m!P!Q+d!Q![#-c![!c*m!c!h#-c!h!i#-c!i!n*m!n!o#/a!o!w*m!w!x#/a!x#O*m#O#P'b#P#T*m#T#Y#-c#Y#Z#-c#Z#`*m#`#a#/a#a#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCY#,d_(wS'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q![#-c![!c*m!c!i#-c!i#O*m#O#P'b#P#T*m#T#Z#-c#Z;'S*m;'S;=`-P<%lO*mCY#-lk(wS!i8O'f,UOY*mZr*mrs&Zsw*mwx#,]x!P*m!P!Q+d!Q![#-c![!c*m!c!h#-c!h!i#-c!i!n*m!n!o#/a!o!w*m!w!x#/a!x#O*m#O#P'b#P#T*m#T#Y#-c#Y#Z#-c#Z#`*m#`#a#/a#a#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCY#/jf(wS!i8O'f,UOY*mZr*mrs&Zs!P*m!P!Q+d!Q!h*m!h!i#/a!i!n*m!n!o#/a!o!w*m!w!x#/a!x#O*m#O#P'b#P#Y*m#Y#Z#/a#Z#`*m#`#a#/a#a#i*m#i#j#/a#j;'S*m;'S;=`-P<%lO*mCj#1Zo)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx*mx{$e{|#3[|}$e}!O#3[!O!P$e!P!Q-V!Q![#4j![!c$e!c!h#4j!h!i#4j!i!n$e!n!o#6j!o!w$e!w!x#6j!x#O$e#O#P'b#P#T$e#T#Y#4j#Y#Z#4j#Z#`$e#`#a#6j#a#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eCj#3ea)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![#4j![!c$e!c!i#4j!i#O$e#O#P'b#P#T$e#T#Z#4j#Z;'S$e;'S;=`/V<%lO$eCj#4uk)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx#,]x!P$e!P!Q-V!Q![#4j![!c$e!c!h#4j!h!i#4j!i!n$e!n!o#6j!o!w$e!w!x#6j!x#O$e#O#P'b#P#T$e#T#Y#4j#Y#Z#4j#Z#`$e#`#a#6j#a#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eCj#6uh)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!h$e!h!i#6j!i!n$e!n!o#6j!o!w$e!w!x#6j!x#O$e#O#P'b#P#Y$e#Y#Z#6j#Z#`$e#`#a#6j#a#i$e#i#j#6j#j;'S$e;'S;=`/V<%lO$eMf#8la)d`(wS%Z#t![8OOY$eYZ&ZZr$ers%dsw$ewx*mxz$ez{#9q{!P$e!P!Q#:g!Q!_$e!_!`!Ba!`#O$e#O#P&Z#P;'S$e;'S;=`/V<%lO$eMf#9zX)d`(wS(qMQOY.]Zr.]rs)xsw.]wx,bx#O.]#P;'S.];'S;=`/P<%lO.]Mf#:pY)d`(wSSMQOY#:gZr#:grs#;`sw#:gwx#?Wx#O#:g#O#P#z<%lO#z<%lO#z<%lO#]#P;'S#z<%lO#bWSMQOY#z<%lO#}P;=`<%l#Ov)d`(wS!i8O'f,UOY$eZr$ers%dsw$ewx$3hx!O$e!O!P#NV!P!Q-V!Q![$1R![!c$e!c!g$1R!g!h$9o!h!i$1R!i!n$e!n!o#6j!o!r$e!r!s#1O!s!w$e!w!x#6j!x#O$e#O#P'b#P#T$e#T#U$1R#U#V$1R#V#X$1R#X#Y$9o#Y#Z$1R#Z#`$e#`#a#6j#a#d$e#d#e#1O#e#i$e#i#j#6j#j#l$e#l#m$/s#m;'S$e;'S;=`/V<%lO$eGz$@q^(|9b)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![$e![!]$Am!]#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eFh$Ax[m:|)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eCj$By[)`8O)d`(wS'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q#O$e#O#P'b#P;'S$e;'S;=`/V<%lO$eM^$C|aq8O%]#t)d`(wS'f,UOY$ERYZ$FZZr$ERrs$Fxsw$ERwx%4^x!P$ER!P!Q%8|!Q!^$ER!^!_%=a!_!`%?z!`!a%B_!a#O$ER#O#P%.w#P;'S$ER;'S;=`%=Z<%lO$ER3h$E[_)d`(wS'f,UOY$ERYZ$FZZr$ERrs$Fxsw$ERwx%4^x!P$ER!P!Q%8|!Q!`$ER!`!a%p!`!a%{_!g:t)d`(wS'f,UOY$ERYZ$FZZr$ERrs$Fxsw$ERwx%4^x!P$ER!P!Q%8|!Q!`$ER!`!a%`Zp$epq&>`qr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e,t&>ie)d`(wS'f,UOX$eXY&>`Zp$epq&>`qr$ers%dsw$ewx*mx!P$e!P!Q-V!Q!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e,t&@Vc)d`(wSeY'f,UOY$eZr$ers%dsw$ewx*mx!P$e!P!Q-V!Q![&?z![!c$e!c!}&?z!}#O$e#O#P'b#P#R$e#R#S&?z#S#T$e#T#o&?z#o;'S$e;'S;=`/V<%lO$e",tokenizers:[f,g,1,2,3,4,5,6,7,8,9,10,new o("j~RQYZXz{^~^O(s~~aP!P!Qd~iO(t~~",25,356)],topRules:{Program:[0,307]},dynamicPrecedences:{17:1,65:1,87:1,94:1,119:1,184:1,187:-10,240:-10,241:1,244:-1,246:-10,247:1,262:-1,267:2,268:2,306:-10,371:3,425:1,426:3,427:1,428:1},specialized:[{term:362,get:O=>u[O]||-1},{term:33,get:O=>G[O]||-1},{term:66,get:O=>y[O]||-1},{term:369,get:O=>E[O]||-1}],tokenPrec:24852}),F=m.define({name:"cpp",parser:C.configure({props:[d.add({IfStatement:a({except:/^\s*({|else\b)/}),TryStatement:a({except:/^\s*({|catch)\b/}),LabeledStatement:Y,CaseStatement:O=>O.baseIndent+O.unit,BlockComment:()=>null,CompoundStatement:w({closing:"}"}),Statement:a({except:/^{/})}),n.add({"DeclarationList CompoundStatement EnumeratorList FieldDeclarationList InitializerList":V,BlockComment(O){return{from:O.from+2,to:O.to-2}}})]}),languageData:{commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\})$/,closeBrackets:{stringPrefixes:["L","u","U","u8","LR","UR","uR","u8R","R"]}}});function J(){return new s(F)}export{J as cpp,F as cppLanguage}; diff --git a/internal/relay/web-dist/assets/index-OVPV9rln.js b/internal/relay/web-dist/assets/index-OVPV9rln.js new file mode 100644 index 00000000..8f720713 --- /dev/null +++ b/internal/relay/web-dist/assets/index-OVPV9rln.js @@ -0,0 +1,2110 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FileExplorer-DTHAXsem.js","assets/useI18n-lwZlSdSx.js","assets/FileExplorer-DKo_tolh.css","assets/sessions-RpM2fLHY.js","assets/client-DMh7GjbV.js","assets/auth-B3RxKR1W.js","assets/prefsSync-C5tz9Q-s.js","assets/version-Dm8mqW3q.js"])))=>i.map(i=>d[i]); +var hb=Object.defineProperty;var fb=(e,t,n)=>t in e?hb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Y=(e,t,n)=>fb(e,typeof t!="symbol"?t+"":t,n);import{bH as H,bf as Ru,at as Zv,aR as Ut,aM as pb,bF as na,b9 as wl,b8 as eg,c5 as vb,aE as gb,bu as Zl,cv as yt,bj as cn,c7 as mb,a7 as j,aL as B,ap as $e,br as Vt,bw as $,ad as F,bl as nn,ac as Z,aa as b,F as Oe,bt as Dt,bk as lt,bJ as at,ca as C,c3 as L,ak as Pe,ab as bt,cA as ut,v as Ct,ai as ot,cz as Xn,cy as it,cr as Pt,_ as fo,bY as tg,cs as ms,T as Sl,ah as _b,bG as Ld,aD as ng,bq as yb,bm as Fn,bo as Kn,af as ds,cf as en,a as bb,bC as kn,b as wb,c6 as dt,cj as Tu,b4 as ba,V as Dd,bg as or,bp as Sb,bs as sg,aq as oo,bD as Gn,bK as ig,ae as Pu,aK as Ar,bN as Ac,cu as Ir,aJ as ec,bU as tc,bx as Cb,b7 as kb,aZ as Eu,w as xb,aY as po,A as rg,c8 as To,M as Md,c as Rb,q as Hh,ax as Tb,U as Nh,a$ as zh,o as cl,bc as Pb,b6 as Uh,b5 as Eb,Q as Lb,c4 as Lu,b2 as Db,b0 as Mb,aX as Ab,b1 as og,aC as Ad,z as Ib,aP as $b,y as Ob,x as Fb,bM as Du,H as Ce,K as qe,G as ze,d as Vn,cb as mn,cl as Ht,av as Bb,ce as Qs,ag as Mt,cm as Bn,bI as li,s as ys,a1 as Hb,L as Ue,O as Cn,bS as Ns,e as nc,S as Es,bQ as Jt,ci as ui,aV as Nb,aH as ao,J as zb,bA as Ub,cw as zs,aB as ls,bb as Vh,u as ag,$ as Vb,r as Kb,ch as ns,P as Xe,ar as lg,a2 as Wb,R as wn,N as jb,a0 as Kh,t as qb,f as Yb,aW as Gb,c2 as Ft,b_ as $i,aF as wa,aw as cg,ba as Xb,cc as ur,aO as Qr,aT as dg,aU as ug,l as hg,Y as Jb,bB as fg,bd as pg,bn as Mu,bW as Qb,m as Ls,by as Zb,bE as vg,c9 as e0,cg as gg,au as t0,ck as n0,B as gn,aN as s0,as as i0,C as r0,a8 as o0,al as a0,bv as sc,bL as l0,an as c0,X as di,bR as bs,c0 as mg,c1 as d0,ao as u0,bh as h0,aj as f0,aS as p0,D as v0,bT as g0,W as m0,bz as _0,az as y0,bZ as b0,g as ic,cx as jt,cd as Po,aA as _g,j as yg,k as Ji,bi as Wh,aI as w0,n as S0,am as C0,h as k0,cq as bg,cn as vo,co as x0,cp as Id,bP as R0,bV as wg,Z as Sg,aQ as T0,bX as jh,a9 as P0,be as E0}from"./useI18n-lwZlSdSx.js";import{PrefsSyncEngine as L0,localStorageAdapter as D0,apiRelayClient as M0,setSharedPrefsSync as A0}from"./prefsSync-C5tz9Q-s.js";import{a as vn,A as Xs}from"./client-DMh7GjbV.js";import{f as Cg,g as I0,a as Bs,N as kg,b as Cl}from"./Switch-DguIL3dU.js";import{c as $0,o as O0,S as F0,b as B0,l as H0}from"./auth-B3RxKR1W.js";/*! + * pinia v3.0.4 + * (c) 2025 Eduardo San Martin Morote + * @license MIT + */let xg;const rc=e=>xg=e,Rg=Symbol();function $d(e){return e&&typeof e=="object"&&Object.prototype.toString.call(e)==="[object Object]"&&typeof e.toJSON!="function"}var sa;(function(e){e.direct="direct",e.patchObject="patch object",e.patchFunction="patch function"})(sa||(sa={}));function N0(){const e=Zv(!0),t=e.run(()=>H({}));let n=[],s=[];const i=Ru({install(a){rc(i),i._a=a,a.provide(Rg,i),a.config.globalProperties.$pinia=i,s.forEach(d=>n.push(d)),s=[]},use(a){return this._a?n.push(a):s.push(a),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return i}const Tg=()=>{};function qh(e,t,n,s=Tg){e.add(t);const i=()=>{e.delete(t)&&s()};return!n&&gb()&&Zl(i),i}function jr(e,...t){e.forEach(n=>{n(...t)})}const z0=e=>e(),Yh=Symbol(),Ic=Symbol();function Od(e,t){e instanceof Map&&t instanceof Map?t.forEach((n,s)=>e.set(s,n)):e instanceof Set&&t instanceof Set&&t.forEach(e.add,e);for(const n in t){if(!t.hasOwnProperty(n))continue;const s=t[n],i=e[n];$d(i)&&$d(s)&&e.hasOwnProperty(n)&&!wl(s)&&!eg(s)?e[n]=Od(i,s):e[n]=s}return e}const U0=Symbol();function V0(e){return!$d(e)||!Object.prototype.hasOwnProperty.call(e,U0)}const{assign:Gi}=Object;function K0(e){return!!(wl(e)&&e.effect)}function W0(e,t,n,s){const{state:i,actions:a,getters:d}=t,r=n.state.value[e];let o;function c(){r||(n.state.value[e]=i?i():{});const p=mb(n.state.value[e]);return Gi(p,a,Object.keys(d||{}).reduce((u,g)=>(u[g]=Ru(j(()=>{rc(n);const m=n._s.get(e);return d[g].call(m,m)})),u),{}))}return o=Pg(e,c,t,n,s,!0),o}function Pg(e,t,n={},s,i,a){let d;const r=Gi({actions:{}},n),o={deep:!0};let c,p,u=new Set,g=new Set,m;const y=s.state.value[e];!a&&!y&&(s.state.value[e]={}),H({});let v;function l(w){let T;c=p=!1,typeof w=="function"?(w(s.state.value[e]),T={type:sa.patchFunction,storeId:e,events:m}):(Od(s.state.value[e],w),T={type:sa.patchObject,payload:w,storeId:e,events:m});const A=v=Symbol();cn().then(()=>{v===A&&(c=!0)}),p=!0,jr(u,T,s.state.value[e])}const h=a?function(){const{state:T}=n,A=T?T():{};this.$patch(E=>{Gi(E,A)})}:Tg;function f(){d.stop(),u.clear(),g.clear(),s._s.delete(e)}const _=(w,T="")=>{if(Yh in w)return w[Ic]=T,w;const A=function(){rc(s);const E=Array.from(arguments),R=new Set,D=new Set;function I(W){R.add(W)}function O(W){D.add(W)}jr(g,{args:E,name:A[Ic],store:k,after:I,onError:O});let U;try{U=w.apply(this&&this.$id===e?this:k,E)}catch(W){throw jr(D,W),W}return U instanceof Promise?U.then(W=>(jr(R,W),W)).catch(W=>(jr(D,W),Promise.reject(W))):(jr(R,U),U)};return A[Yh]=!0,A[Ic]=T,A},S={_p:s,$id:e,$onAction:qh.bind(null,g),$patch:l,$reset:h,$subscribe(w,T={}){const A=qh(u,w,T.detached,()=>E()),E=d.run(()=>yt(()=>s.state.value[e],R=>{(T.flush==="sync"?p:c)&&w({storeId:e,type:sa.direct,events:m},R)},Gi({},o,T)));return A},$dispose:f},k=na(S);s._s.set(e,k);const M=(s._a&&s._a.runWithContext||z0)(()=>s._e.run(()=>(d=Zv()).run(()=>t({action:_}))));for(const w in M){const T=M[w];if(wl(T)&&!K0(T)||eg(T))a||(y&&V0(T)&&(wl(T)?T.value=y[w]:Od(T,y[w])),s.state.value[e][w]=T);else if(typeof T=="function"){const A=_(T,w);M[w]=A,r.actions[w]=T}}return Gi(k,M),Gi(vb(k),M),Object.defineProperty(k,"$state",{get:()=>s.state.value[e],set:w=>{l(T=>{Gi(T,w)})}}),s._p.forEach(w=>{Gi(k,d.run(()=>w({store:k,app:s._a,pinia:s,options:r})))}),y&&a&&n.hydrate&&n.hydrate(k.$state,y),c=!0,p=!0,k}/*! #__NO_SIDE_EFFECTS__ */function Au(e,t,n){let s;const i=typeof t=="function";s=i?n:t;function a(d,r){const o=pb();return d=d||(o?Ut(Rg,null):null),d&&rc(d),d=xg,d._s.has(e)||(i?Pg(e,t,s,d):W0(e,s,d)),d._s.get(e)}return a.$id=e,a}const j0=64,q0=1e3,dl=512,Y0=/pass|token|key|secret|cred|auth/i;let Ti=[],lo=null,Zr=0,$c=!1,Ko=[];function Eg(){var e,t,n;return typeof window<"u"&&typeof((n=(t=(e=window.go)==null?void 0:e.main)==null?void 0:t.App)==null?void 0:n.AppendFrontendLogs)=="function"}function G0(e){if(!e)return"";const t=[];for(const[n,s]of Object.entries(e)){if(s===void 0)continue;const i=Y0.test(n)?"***":String(s);t.push(`${n}=${JSON.stringify(i)}`)}return t.length?" "+t.join(" "):""}function X0(e){switch(e){case"ERROR":return console.error;case"WARN":return console.warn;case"DEBUG":return console.debug;default:return console.info}}function J0(e,t,n){if(Ti.push({timestamp_ms:Date.now(),level:e,tag:t,message:n}),Ti.length>dl&&(Zr+=Ti.length-dl,Ti=Ti.slice(-dl)),e==="ERROR"||Ti.length>=j0){kl();return}Q0()}function Q0(){lo===null&&(lo=setTimeout(()=>{lo=null,kl()},q0))}async function kl(){if(lo!==null&&(clearTimeout(lo),lo=null),$c)return;if(!Eg()){Ti=[],Ko=[],Zr=0;return}const e=Ko.concat(Ti);if(Ko=[],Ti=[],Zr>0&&(e.push({timestamp_ms:Date.now(),level:"WARN",tag:"log",message:`dropped ${Zr} log record(s): renderer buffer overflow`}),Zr=0),e.length!==0){$c=!0;try{await window.go.main.App.AppendFrontendLogs(e)}catch{Ko.length===0?Ko=e.slice(-dl):Zr+=e.length}finally{$c=!1}}}function oc(e,t,n,s){const i=n+G0(s);Eg()||X0(e)(`[${t}] ${i}`),J0(e,t,i)}function Js(e,t,n){oc("DEBUG",e,t,n)}function Z0(e,t,n){oc("INFO",e,t,n)}function Lt(e,t,n){oc("WARN",e,t,n)}function Us(e,t,n){oc("ERROR",e,t,n)}function Rt(e){if(e instanceof Error)return`${e.name}: ${e.message}`;if(typeof e=="string")return e;try{return String(e)}catch{return"unknown error"}}function ew(){typeof window>"u"||(window.addEventListener("beforeunload",()=>void kl()),document.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&kl()}))}/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const tw=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Gh=e=>e==="";/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const nw=(...e)=>e.filter((t,n,s)=>!!t&&t.trim()!==""&&s.indexOf(t)===n).join(" ").trim();/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Xh=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const sw=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,s)=>s?s.toUpperCase():n.toLowerCase());/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const iw=e=>{const t=sw(e);return t.charAt(0).toUpperCase()+t.slice(1)};/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */var Wo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const rw=({name:e,iconNode:t,absoluteStrokeWidth:n,"absolute-stroke-width":s,strokeWidth:i,"stroke-width":a,size:d=Wo.width,color:r=Wo.stroke,...o},{slots:c})=>B("svg",{...Wo,...o,width:d,height:d,stroke:r,"stroke-width":Gh(n)||Gh(s)||n===!0||s===!0?Number(i||a||Wo["stroke-width"])*24/Number(d):i||a||Wo["stroke-width"],class:nw("lucide",o.class,...e?[`lucide-${Xh(iw(e))}-icon`,`lucide-${Xh(e)}`]:["lucide-icon"]),...!c.default&&!tw(o)&&{"aria-hidden":"true"}},[...t.map(p=>B(...p)),...c.default?[c.default()]:[]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hn=(e,t)=>(n,{slots:s,attrs:i})=>B(rw,{...i,...n,iconNode:t,name:e},s);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Jh=hn("activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ow=hn("arrow-down-right",[["path",{d:"m7 7 10 10",key:"1fmybs"}],["path",{d:"M17 7v10H7",key:"6fjiku"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const aw=hn("arrow-up-right",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const lw=hn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const cw=hn("clock-3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const dw=hn("copy",[["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"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const uw=hn("eye-off",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Lg=hn("eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Qh=hn("file-down",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 18v-6",key:"17g6i2"}],["path",{d:"m9 15 3 3 3-3",key:"1npd3o"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const hw=hn("file-up",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const fw=hn("gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const qa=hn("key-round",[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const pw=hn("minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ul=hn("network",[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Oc=hn("pencil",[["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"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const vw=hn("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Vi=hn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const gw=hn("radio",[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Dg=hn("refresh-cw",[["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"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Mg=hn("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const to=hn("server",[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const mw=hn("shield-user",[["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:"M6.376 18.91a6 6 0 0 1 11.249.003",key:"hnjrf2"}],["circle",{cx:"12",cy:"11",r:"4",key:"1gt34v"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const _w=hn("square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Ya=hn("trash-2",[["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"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const yw=hn("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const Fc=hn("users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const ii=hn("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** + * @license lucide-vue-next v1.0.0 - ISC + * + * This source code is licensed under the ISC license. + * See the LICENSE file in the root directory of this source tree. + */const bw=hn("zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]]),ww={common:{language:"Language",system:"System",english:"English",simplifiedChinese:"Simplified Chinese",save:"Save",cancel:"Cancel",close:"Close",refresh:"Refresh",copy:"Copy",paste:"Paste",send:"Send",disconnect:"Disconnect",connect:"Connect",settings:"Settings",loading:"loading...",disabled:"disabled",discard:"discard",stay:"stay",delete:"Delete",retry:"Retry",unknown:"(unknown)",countSessions:"{count} sessions",countSessionsOne:"1 session",minimize:"Minimize",maximize:"Maximize",restore:"Restore",yes:"Yes",no:"No"},app:{authInvalidToken:"Invalid or revoked API token. Generate a new one in web settings.",authUserDisabled:"Account disabled. Contact your relay admin.",sessionIdOwnerMismatch:"Session id collision. Restart the desktop app.",forbidden:"Not authorized to connect to this relay.",openSettings:"Open settings",dismiss:"Dismiss",showPanel:"Show panel",hidePanel:"Hide panel",startingFirstSession:"starting first session...",waitingForSessionSelection:"waiting for session selection...",noShellsFound:"no shells found on this machine",wailsBindingsUnavailable:"Wails bindings unavailable",wailsBindingsNotReady:"Wails bindings not ready",sessionAlreadyInTab:"Session is already open in this tab",paneFull:"pane full - close one first",splitFailed:"split failed: {message}",noActiveSession:"No active session",noEndpoint:"No endpoint",pluginFailedToLoad:'Plugin "{title}" failed to load',startupFailureTitle:"AT Term could not start",startupFailureIntro:"The desktop backend hit a fatal startup error. Your terminal sessions were not started.",startupFailureLogPath:"Log file",startupFailureCopy:"Copy diagnostics",startupFailureCopied:"Startup diagnostics copied"},titlebar:{e2eeOffChip:"Plaintext",e2eeOffTitle:"End-to-end encryption is disabled: this desktop's agent is sending terminal output, session title / cwd / current command, and command-finished notifications to the relay in clear text. Turn it back on in Settings → Remote relay."},terminal:{connecting:"connecting...",reconnecting:"reconnecting...",ended:"session ended",sessionEndedBanner:"[AT Term] session ended (exit {exitCode})",connectionError:"connection error",remoteHasTakenControl:"remote has taken control",byHost:"by {host}",pressSpaceToTakeBack:"press space to take back",takeControl:"Take control",clearBuffer:"clear buffer",search:{placeholder:"Find",next:"Next match",prev:"Previous match",close:"Close search",noResults:"No results"},sendSelection:"send",pickImage:"image",pickFile:"file",emptyPaneHint:"[empty pane - press Cmd+N / Ctrl+N to fill]",remote:"remote",remotePrefix:"[remote] ",shellFallback:"shell",emptyTab:"(empty)",tabDisconnectedSuffix:"(disconnected)",closePaneTitle:"close pane (Cmd+W / Ctrl+W)",dragPaneOut:"drag onto the tab bar for its own tab",detachToTab:"Own tab",alreadyOwnTab:"Session already has its own tab",remoteViewerWatching:"{count} remote viewer(s) watching",relaySettings:"relay settings",adminPanel:"admin panel",newTab:"new tab",starting:"starting...",newTabProfileLabel:"profile for new tabs / splits",useDefaultProfile:"Default profile",layoutVertical:"side-by-side split",layoutHorizontal:"stacked split",layoutGrid2x2:"2x2 grid split",sessionStatusOne:"{count} session",sessionStatusMany:"{count} sessions",uplinkOn:"uplink on",imagePasteRequiresFull:"image paste requires full remote permission",pasteSessionNotWritable:"session is not writable right now",clipboardEmpty:"clipboard has no text or image",clipboardImageTooLarge:"clipboard image is too large",clipboardImageToolsMissing:"install xclip, wl-paste, or xsel to paste images",readOnlySession:"session is read-only",websocketNotOpen:"websocket is not open",imageTooLarge:"image too large: {size} bytes exceeds {limit}",copyFailed:"copy failed",pasteFailed:"paste failed",driverNow:"you are now the driver",viewerNow:"you are now a viewer",preview:{open:"Preview web service",opening:"Opening…",portPrompt:"Enter the loopback port of the web service on the remote desktop (for example 3000)",targetHost:"Remote service loopback address",additionalPort:"Additional service port",pathPrefix:"Path prefix",addMapping:"Add service mapping",removeMapping:"Remove service mapping",invalidPathPrefix:"Additional mappings need distinct path prefixes (for example /api or /ws)",desktopOnly:"Remote Preview is available in the desktop app",requiresConnection:"Wait for the remote session to connect before opening Preview",requiresDriver:"Take control of the remote session before opening Preview",requiresFullPermission:"Remote Preview requires full permission from the host",invalidPort:"Port must be an integer from 1 to 65535",noLongerAllowed:"Preview permission was withdrawn while opening",openFailed:"Could not open remote preview: {error}",terminal:"Terminal",previewPort:"Preview :{port}",switch:"Switch preview",closeThis:"Close this preview",newPreview:"New preview…",reconnecting:"Reconnecting…",frameTitle:"Remote web preview :{port}",openInBrowser:"Open in system browser",copyURL:"Copy preview URL",urlCopied:"Preview URL copied",browserOpenFailed:"Could not open the system browser",copyFailed:"Could not copy the preview URL"},bellNotification:"Bell in {session}",commandFinishedNotification:"Command finished - exit {exitCode} - {elapsed} - {session}",loadingHistoryBytes:"loading history - {bytes}",loadingHistoryProgress:"loading history {pct}% - {bytes} / {total}",contextMenu:{openLink:"Open Link",copyLink:"Copy Link"},resize:"Fit PTY to terminal",link:{openFailed:"Failed to open link",openFailedNoHome:"Cannot resolve ~ (home directory unavailable)"}},sessions:{local:"local",remote:"remote",remoteSessions:"remote sessions",hostIdTitle:"host_id {hostId}",sessionTitle:"session {sessionId}",cancelEsc:"cancel (esc)",endLocalSessionOne:"End {count} local shell session",endLocalSessionMany:"End {count} local shell sessions",detachRemoteSessionOne:"Detach from {count} remote session",detachRemoteSessionMany:"Detach from {count} remote sessions",runningProcessesTerminated:"(running processes will be terminated)",remotePtyKeepsRunning:"(the remote PTY keeps running on its host)",saveWorkFirst:"Save your work first.",quitTitle:"quit AT Term",closingWill:"Closing AT Term will:",quit:"quit",closeSessionTitle:"Close session?",closeSessionBody:'Close "{title}"?',closeSessionManyBody:"Close {count} sessions?",closeAiSessionWarning:"This is an AI session. Confirm the task is finished or the context is saved before closing.",closeRunningSessionWarning:"This session is still running. Closing it may interrupt the active command.",closeLocalTerminateHint:"Local sessions will be ended and running processes will be terminated.",closeRemoteDetachHint:"Remote sessions will be detached from this window; the remote PTY keeps running.",closeSessionConfirm:"Close session",unknownHost:"unknown host",thisMachine:"this machine"},ssh:{tabHosts:"Hosts",tabKeys:"Keys",filterPlaceholder:"Filter hosts…",newHost:"New Host",newKey:"New Key",edit:"Edit",subtitleAuthKey:"key",subtitleAuthPassword:"password",importedHosts:"Imported {count} host(s)",hosts:{emptyTitle:"No saved hosts",emptySub:"Add a host to connect and take it over from any device.",clearTags:"Clear",noMatchTitle:"No hosts match",noMatchSub:"Loosen the filter or clear the selected tags.",menuConnect:"Connect",menuEdit:"Edit Host Details",menuDuplicate:"Duplicate",menuCopySsh:"Copy SSH command",menuRemove:"Remove"},keys:{emptyTitle:"No keys yet",emptySub:"Add a private key here, then reference it from a host.",typeLabel:"Type {type}",genericSubtitle:"SSH key"},proxy:{jumpBadge:"Via {target}",commandBadge:"ProxyCommand",jumpReason:"Connects through jump host {target}. Every hop on the chain must itself be a saved host in atterm — atterm signs in to each one with that host's own credential, and never sends this host's.",commandReason:"Configured with a ProxyCommand ({command}) — atterm never runs that command, so this host cannot be connected directly."},hostKey:{title:"Unknown host key",direct:"Unknown host key. Verify this fingerprint before trusting it:",jumpHop:"This fingerprint belongs to {name}, hop {hop} on the route to {target} — it is not {target} itself. Check it against {name} before trusting it:",targetHop:"This fingerprint belongs to {target}, the host you asked to connect (reached as hop {hop}). Verify it before trusting it:",chainNote:"Each machine on the route is asked about separately; accepting this one accepts nothing else.",accept:"Accept & Connect",reject:"Cancel"},hostDrawer:{titleNew:"New Host",titleEdit:"Edit Host",address:"Address",addressPlaceholder:"IP or hostname",label:"Label",labelPlaceholder:"optional",port:"Port",tags:"Tags",tagsPlaceholder:"comma separated",removeTag:"Remove {tag}",username:"Username",usernamePlaceholder:"user",authPassword:"Password",authKey:"Key",identityFileLabel:"From ~/.ssh/config",identityFileHint:"Import this key under Keys, then select it below.",password:"Password",keepBlank:"(leave blank to keep)",keyPicker:"Key",keyPickerAria:"SSH key",noKeys:"No keys yet.",addKey:"Add a key",submitNew:"Add Host"},keyDrawer:{titleNew:"New Key",titleEdit:"Edit Key",name:"Name",namePlaceholder:"e.g. aws",pem:"Private key (PEM)",keepBlank:"(leave blank to keep)",passphrase:"Passphrase",encryptedHint:"This key is encrypted — enter its passphrase above.",dropzone:"Drag and drop a private key file to import",importFromFile:"Import from key file",submitNew:"Add Key",reveal:"Show the stored private key",hide:"Hide",copy:"Copy the private key"},startup:{sectionTitle:"Startup command",sectionHint:"For a bastion that shows a menu instead of a shell. Each line is typed and followed by Enter, one per prompt — for JumpServer that is the asset at Opt>, then the system user at ID>.",placeholder:"one answer per line",delay:"Step interval (ms)",steps:"{count} steps will be sent after login."},forwards:{tab:"Tunnels",sectionTitle:"Port forwarding",sectionHint:"Rules are configuration only. Nothing starts until you start it under Tunnels.",add:"Add rule",remove:"Remove this rule",noRules:"No forwarding rules yet.",kindLocal:"Local",kindRemote:"Remote",kindDynamic:"Dynamic",kindLocalHint:"This machine listens; each connection is opened from the SSH host to the target (ssh -L).",kindRemoteHint:"The SSH host listens; each connection it accepts is opened from this machine to the target (ssh -R).",kindDynamicHint:"This machine listens as a SOCKS5 proxy; every connection names its own destination, resolved on the SSH host (ssh -D).",bindAddr:"Bind address",bindPort:"Port",targetHost:"Target host",targetPort:"Target port",label:"Label",labelPlaceholder:"optional",warnLocal:"Binding {addr} instead of 127.0.0.1 puts this forwarded service in front of anyone on the same network, with no SSH credential — they reach it through your machine. This rule syncs to every device you sign in on and binds the same way there.",warnRemote:"Binding {addr} instead of 127.0.0.1 asks the SSH host to accept connections from anyone on the same network as that host, with no SSH credential, and hand them to the target below through your machine. Most sshd configs refuse it unless GatewayPorts is on. This rule syncs to every device you sign in on.",warnDynamic:"Binding {addr} instead of 127.0.0.1 makes this an unauthenticated SOCKS5 open proxy: anyone on the same network can reach everything this SSH host can reach, to any destination they name, using your SSH credential and appearing in the far side's logs as you. This rule syncs to every device you sign in on and binds the same way there.",emptyTitle:"No forwarding rules",emptySub:"Create one here, or add a rule in a host's Port forwarding section.",new:"New tunnel",newNeedsHost:"Save an SSH host first — a tunnel runs over one.",drawerTitleNew:"New tunnel",drawerTitleEdit:"Edit tunnel",hostPicker:"SSH host",hostPickerAria:"SSH host this tunnel runs over",hostPickerHint:"The tunnel runs over this host's connection — the bastion, when the target is behind one. It is saved as one of that host's forwarding rules.",saveAndStart:"Save and start",start:"Start",stop:"Stop",dismiss:"Dismiss",stateIdle:"Not started",stateRunning:"Running",stateStopped:"Stopped",conns:"{count} accepted",dynamicTarget:"SOCKS5 (destination per connection)",proxyBlocked:"Tunnels cannot be started for this host.",refresh:"Refresh"},configImport:{open:"Import from ~/.ssh/config",title:"Import from ~/.ssh/config",loading:"Reading ~/.ssh/config…",emptyTitle:"No importable hosts",emptySub:"No usable Host entries were found in ~/.ssh/config.",importableTitle:"Importable hosts ({count})",skippedTitle:"Skipped ({count})",overwriteBadge:"Updates existing",overwriteTitle:"A saved host already uses this label — importing updates it in place",proxyBadge:"{label} — not directly connectable",importing:"Importing…",confirm:"Import selected hosts ({count})"}},settings:{title:"Settings",tabs:{general:"General",relay:"Relay",logging:"Logging",updates:"Updates",plugins:"Plugins",shortcuts:"Shortcuts",devices:"Signed-in devices",receivedFiles:"Received files",mobileProfiles:"Synced profiles",mobileHosts:"SSH hosts"},discardRelayTitle:"Discard unsaved relay changes?",discardRelayBody:"Your edits to relay URL, token, permissions, or insecure mode are not saved yet.",general:{languageLabel:"Language",languageHint:"Use System to follow your device language.",terminalTheme:"terminal theme",terminalThemeHint:"Applies to all terminal panes immediately and is saved as your local desktop preference.",terminalFont:"terminal font",terminalFontHint:"Your choice is placed ahead of the built-in fallback chain; CJK glyphs keep using the bundled families.",terminalFontSize:"font size",terminalLineHeight:"line height",terminalCursorStyle:"cursor style",terminalCursorStyleBlock:"Block",terminalCursorStyleUnderline:"Underline",terminalCursorStyleBar:"Bar",terminalCursorBlink:"blink the cursor",terminalScrollback:"scrollback lines",terminalScrollbackHint:"Roughly {mb} MB per pane at this setting. Every open pane pays it.",notificationsBell:"Show system notifications on terminal bell",notificationsHint:"Only fires when the AT Term window is not focused.",shellIntegration:"Enable shell integration",shellIntegrationHint:"Injects OSC 133 hooks into zsh / bash / fish / pwsh at session start so we can detect when a command finishes. Only affects new sessions.",recoveryEnabled:"Show recovery prompt at launch",recoveryEnabledHint:"Ask before restoring last session's tabs and panes.",defaultShell:"default shell",auto:"Auto",customPath:"Custom path...",defaultShellHint:"Auto chooses a platform default for new local sessions. Pick a detected shell or save a custom shell path if you prefer Git Bash, PowerShell 7, or another terminal program.",customShellPath:"custom shell path",customShellRequired:"custom shell path is required",saveCustom:"save custom",webglRenderer:"Use WebGL terminal renderer",webglHint:"GPU-rasterized rendering keeps light themes free of cell ghosting on dense TUI output. Off by default on Linux because NVIDIA proprietary + X11 + WebKitGTK paint the cursor / last cell a frame late, which surfaces as visible typing lag. Affects new terminal sessions only.",commandNotifyThreshold:"Command-finished notification threshold (seconds)",commandNotifyHint:"Commands shorter than this duration do not produce a notification. Requires shell integration to be enabled.",pushNotifications:{title:"Push notifications",enable:"Enable push notifications",test:"Send test notification",errors:{denied:"Browser denied the notification permission.",disabled:"Push notifications are disabled on the server.",keyFailed:"Could not fetch the push key from the relay.",subscribeFailed:"Browser subscription failed.",subscribeRejected:"The relay rejected the subscription.",generic:"Push notification request failed."}},themes:{classicLabel:"AT Term Classic",classicDescription:"Current black terminal look.",nordLabel:"Nord / Arctic",nordDescription:"Cool low-contrast dark palette.",solarizedDarkLabel:"Solarized Dark",solarizedDarkDescription:"Classic warm low-contrast dark palette.",daylightLabel:"Daylight",daylightDescription:"Light palette for bright environments."}},configio:{title:"Import & export",export:{title:"Export",hint:"Save your preferences, SSH hosts, and session profiles to a JSON file you can move to another machine. Your SSH passwords and private keys are never included in this file.",includeEnvLabel:"Include profile environment variables that aren't set to sync — these can contain API tokens and other secrets",button:"Export…",exporting:"Exporting…",success:"Saved to {path}"},import:{title:"Import",hint:"Choose a previously exported JSON file. Nothing is applied until you confirm. Imported SSH hosts never bring a credential with them: new hosts need a password or key added here afterward, and if an existing host's address changed, its saved credential is cleared for safety and needs to be re-entered too.",pickFile:"Choose file…",fileLabel:"File: {name}",previewing:"Reading file…",fileReadError:"Could not read file",previewError:"Could not read this file: {error}",previewTitle:"Preview — nothing applied yet",changesAdd:"Add",changesReplace:"Replace",changesUnchanged:"Unchanged",noChanges:"Nothing would change.",skippedTitle:"Skipped",apply:"Apply import",applying:"Applying…",applyError:"Import failed: {error}",appliedTitle:"Import applied",appliedSummary:"Applied {count} change(s)."}},relay:{uplink:"Uplink",off:"OFF",on:"ON",connectedAs:"connected as {identity}",notConfigured:"not configured",paused:"paused (config kept)",connecting:"Connecting…",relayInvalid:"Invalid relay address",versionProbeFailed:"Failed to reach relay: {reason}",loginFailedInline:"Login failed: {reason}",credentialsRequired:"Email and password required",hint:"configure a remote atterm-relay so this machine's sessions can be attached from other devices. when no one is attached, no bytes leave this machine.",relayUrl:"relay url",email:"Email",password:"Password",passwordShow:"Show password",passwordHide:"Hide password",modeLogin:"Log in",modeRegister:"Register",noAccountPrompt:"Need an account?",haveAccountPrompt:"Have an account?",claimToken:"Claim token (optional)",claimTokenPlaceholder:"claim_…",claimTokenHint:"Paste the token printed by `atterm-relay` bootstrap to claim an admin account. Leave empty for a regular user.",insecureMode:"trust self-signed cert",insecureWarning:"Skips TLS certificate verification for this relay, so a relay serving a self-signed certificate is reachable. The connection is still encrypted, but an attacker able to intercept it could impersonate the relay. Enable only for a relay you control (e.g. atterm-relay's self-signed quick-start); prefer a real certificate for anything public.",disableE2EE:"disable end-to-end encryption (testing / debug only)",disableE2EEWarning:"Session content (terminal output, session title / cwd / current command, command-finished notifications) is sent to the relay without end-to-end sealing, so the relay server itself can read it. Transport TLS (if enabled) still applies. Your account key stays loaded — only outbound sealing is paused. The title bar keeps a ⚠ Plaintext indicator while this is on.",saving:"saving...",saveConnect:"save & connect",clearTitle:"Clear relay info",clearHint:"Removes the saved relay address, account, and login info from this device. Open terminals are not affected.",clearAction:"Clear",clearing:"Clearing…",clearConfirm:"Clear all relay info saved on this device?",clearFailed:"Clear failed: {reason}",pairing:{title:"Mobile pairing",hint:"Generate a single-use QR code so a phone can attach to this relay without copy-pasting tokens.",generate:"Generate QR",generating:"generating...",regenerate:"Regenerate",expiresIn:"expires in",expired:"expired - generate a new code",wrappedBadge:"includes E2EE key",unwrappedWarning:"E2EE key is locked — mobile will connect but sealed session details won't decrypt. Log in with email + password in the Relay settings above to unlock."}},logging:{title:"desktop logs",noContent:"no log file content is available yet.",truncated:"showing the most recent portion of the log file.",writeLogs:"write logs to file",currentFile:"current log file",changeLocation:"change location",resetDefault:"reset default",viewLogs:"view logs",liveTail:"Live tail (auto-refreshes every 3s)",levelFilter:"Show",tagFilter:"Subsystem",tagFilterAll:"All",writeLevel:"Log level",writeLevelHint:"Minimum severity written to the file. DEBUG adds per-frame and per-keystroke tracing — useful when reproducing a problem, noisy otherwise.",ptyInputDebug:"Log terminal input bytes",ptyInputDebugHint:"Diagnose stuck or dropped input. Recorded regardless of the log level above.",tailPaused:"Paused",tailPausedHint:"Following paused while scrolled up — click or scroll to the bottom to resume"},updates:{devDisabled:"development build - auto-update disabled",checking:"checking...",readyToInstall:"{version} downloaded - ready to install",downloadingStatus:"downloading {version} ({pct}%)",available:"{version} available",upToDate:"up to date - last checked {ago}",notChecked:"not checked yet",justNow:"just now",minutesAgo:"{count} min ago",hoursAgo:"{count} h ago",daysAgo:"{count} d ago",currentVersion:"current version",status:"status",downloadPath:"download path",autoCheck:"automatically check for updates",ghProxy:"GitHub download proxy",proxyHint:"Optional. Only GitHub Release file downloads use this proxy; update checks and signature verification stay unchanged.",releaseNotes:"release notes",checkNow:"check now",versionLine:"{minor} line",downloadVersion:"download {version}",cancelDownload:"Cancel ({pct}%)",cancelling:"Cancelling…",redownload:"Redownload",redownloadPrompt:"{version} is already downloaded on this device. Redownload?",forceInstallRestart:"force install & restart",installTitle:"install AT Term {version}",installIntro:"AT Term will quit and relaunch on the new version.",installThisWill:" This will:",forceInstall:"force install",installRestart:"install & restart"},plugins:{hint:"Plugins are loaded on demand. Disabled plugins do not affect startup time or memory.",panelDragHint:"Panel width and inner ratio are adjusted by dragging in the panel. View options live in the file tree's context menu.",noneRegistered:"No plugins registered."},shortcuts:{keyboardShortcuts:"Keyboard Shortcuts",pane:"Pane",tab:"Tab",sidebar:"Sidebar",pressKey:"Press a key...",resetTo:"Reset to {binding}",conflictsWith:"Conflicts with: {labels}",resetAll:"Reset all to defaults",splitPaneVertically:"Split pane vertically",splitPaneHorizontally:"Split pane horizontally",closePane:"Close pane",focusPaneLeft:"Focus pane left",focusPaneRight:"Focus pane right",focusPaneUp:"Focus pane up",focusPaneDown:"Focus pane down",newTab:"New tab",previousTab:"Previous tab",nextTab:"Next tab",focusSidebarSearch:"Focus sidebar search",terminalSearch:"Search terminal"},diagnostics:{tab:"Diagnostics",section:"Diagnostics snapshot",hint:"Snapshot of the desktop runtime, with API tokens and headers redacted. Useful for bug reports.",copy:"Copy",export:"Export…",refresh:"Refresh",copied:"Copied to clipboard.",copyFailed:"Copy failed.",exported:"Saved to {path}"},feishu:{title:"Feishu Integration",disabled:"Feishu integration is not active.",relay_disabled:"The server (relay) has Feishu integration turned off.",load_error:"Couldn't fetch Feishu status: {error}",retry_status:"Retry",mode:{label:"Mode",options:{auto:"Auto (follow Relay login)",local:"Force Local (local LongConn)",relay:"Force Relay (depend on Relay)"},effective:{label:"Effective mode",fallbackWarn:"Relay requested but not effectively logged in"}},bound:"Bound to open_id: {open_id}",save:"Save Credentials",begin_pair:"Start Pair",pair_hint:'Send "/bind {code}" to the bot in private chat within 15 minutes.',delete:"Delete Binding",configured:"Credentials saved",app_id_label:"App ID",callback_label:"Event callback URL",callback_hint_relay:'In Feishu "Event Subscriptions", choose "Send events to developer server" and paste the URL above.',longconn_hint_local:'Local long-connection mode: in Feishu "Event Subscriptions", choose "Receive events via long connection" — no callback URL needed.',copy:"Copy",copied:"Copied",reconfigure:"Re-enter credentials",aiOnlyNotifications:"Notify for AI sessions only",remoteTerminal:{enable:"Enable Feishu remote terminal",autoAttachLabel:"Auto-attach sessions",autoAttach:{ai:"AI sessions only",all:"All sessions",none:"Never (manual attach)"}},hook_install:{enable:"Auto-install Claude Code hook",retry:"Retry",healthy:"Hook installed and healthy",needs_attention:"Hook needs attention",disabled:"Hook auto-install disabled"},test_send:{title:"Test send",hint:"Send a sample card to your bound Feishu account to verify the notification path works.",command_success:"Command finished (success)",command_failure:"Command finished (failure)",command_sealed:"Command finished (this device only)",waiting_input:"Waiting for input",sending:"Sending…",sent:"Sent — check Feishu",failed:"Send failed: {error}"}},templates:{tab:"Templates",intro:"Each template sends its text to the active session when clicked.",add:"Add template",label:"Label",text:"Send text",hotkey:"Hotkey (e.g. Alt+1)",showBar:"Show template bar above the terminal",save:"Save",edit:"Edit",delete:"Delete",reset:"Reset to defaults",resetConfirm:"Replace your list with the defaults?"},profiles:{tab:"Session profiles",intro:"A profile is a named launch configuration for new tabs and splits: shell, working directory, startup command, and environment variables.",precedenceHint:"New session order: an explicitly picked profile wins, then the default profile below, then falls back to General → default shell + your home directory. default shell is not replaced by profiles — it's what runs when no profile applies.",envPrivacyIntro:`Environment variables stay on this machine by default and are never synced. Turn on "sync these environment variables" per profile to send that profile's env, end-to-end encrypted, to your other devices.`,empty:"No profiles yet.",add:"Add profile",edit:"Edit",delete:"Delete",save:"Save",name:"Name",shellPlaceholder:"Shell path (leave blank to use default shell)",cwdPlaceholder:"Working directory (leave blank to use home)",shellUnset:"default shell",cwdUnset:"home directory",startupCmdPlaceholder:"Startup command (optional)",startupCmdHint:"Runs once the shell's first prompt appears, same as AI-session resume — not sent as raw keystrokes.",envPlaceholder:"KEY=value, one per line",envHint:"TERM is always protected: a profile can never override it, to keep terminal rendering correct.",syncEnv:"Sync these environment variables to my other devices",syncEnvOffHint:"Off (default): these environment variables stay on this machine only and are stripped before anything is synced. Every other field (name, shell, cwd, startup command) still syncs.",syncEnvOnHint:"On: these environment variables travel encrypted to your other signed-in devices, end-to-end sealed so the relay cannot read them.",setDefault:"Set as default",clearDefault:"Unset default",defaultBadge:"Default",nameRequired:"Name is required."},mobileSync:{locked:"Waiting for your account key — make sure you're signed in.",noData:"Nothing has synced from a desktop yet.",error:"Couldn't read the synced data: {error}"},mobileProfiles:{intro:"Profiles synced from your desktop, for reference only. Edit them on the machine that runs them.",empty:"Your desktop has no session profiles configured.",defaultBadge:"Default",shell:"Shell",cwd:"Working directory",startupCmd:"Startup command",env:"Environment",envNone:"None",envNotSynced:"Not synced from that machine",hostLabel:"Open on",noHosts:"No desktop found. Open a session on a desktop from this account first, so this phone can find it.",openButton:"Open",opening:"Opening…",openErrors:{unknown_profile:"That profile no longer exists on the desktop.",permission_denied:"That desktop is published read-only — it cannot start new sessions from a phone.",request_in_flight:"A session is already being created. Wait for it to finish before trying again.",duplicate_request_id:"That request was already sent. Wait for it to finish.",unknown_host_id:"That desktop isn't reachable right now.",invalid_request:"Couldn't send that request. Try again.",upstream_unavailable:"Couldn't reach that desktop. Try again.",session_create_busy:"That desktop is busy right now. Try again in a moment.",timeout:"Timed out waiting for that desktop to respond. It was not retried — check the desktop before trying again.",relay_not_configured:"Sign in to a relay on this phone first.",generic:"Couldn't start a session: {error}"}},mobileHosts:{intro:"SSH hosts synced from your desktop, for reference only. This device cannot connect to them.",empty:"Your desktop has no SSH hosts configured.",user:"User",port:"Port",tags:"Tags",note:"Note",jumpChain:"Reaches this host via a jump chain",proxyCommand:"Uses ProxyCommand — not dialable",key:"Key"},devices:{hint:"Devices signed in to this relay account.",refresh:"Refresh",signOutOthers:"Sign out other devices",signingOut:"Signing out…",signOutOthersConfirm:"Sign out every device except this one?",revoke:"Revoke",revoking:"Revoking…",revokeConfirm:"Revoke this device ({ua})?",currentTag:"Current",loginLine:"Signed in {time} · {ip}",timeFormat:"{y}-{m}-{d} {hh}:{mm}",empty:"No signed-in devices yet.",unknownUA:"Unknown device",notAuthenticated:"Log in to your relay account first (Settings → Relay)."},account:{title:"Account",email:"Email",logout:{button:"Log out",submitting:"Logging out..."},changePassword:{title:"Change password",oldPassword:"Current password",newPassword:"New password",confirmPassword:"Confirm new password",hintLength:"New password must be at least 8 characters.",hintMismatch:"Passwords do not match.",submit:"Update password",submitting:"Updating…",successToast:"Password updated"},dangerZone:{title:"Danger zone",warning:"Deleting your account is permanent and cannot be undone.",toggle:"Delete account",currentPassword:"Current password",typeEmailToConfirm:"Type your email to confirm",deleteButton:"Delete account",deleting:"Deleting…",confirmPrompt:"This action cannot be undone."},errors:{wrongPassword:"Current password is incorrect.",sessionExpired:"Your session has expired, please log in again.",rateLimited:"Too many attempts, please try again later.",network:"Network error.",generic:"Something went wrong, please try again."}}},mobile:{relayUrl:"Relay URL",email:"Email",password:"Password",passwordShow:"Show password",passwordHide:"Hide password",emailRequired:"Email is required",passwordRequired:"Password is required",invalidCredentials:"Invalid email or password",rateLimited:"Too many attempts, please try again later",loginButton:"Log in",allowInsecure:"Allow insecure HTTP/WS (non-loopback)",originRejected:"Relay rejected the origin. Start the relay with ATTERM_ORIGINS containing capacitor://localhost.",cannotReachRelay:"Cannot reach relay: {message}",relayUrlRequired:"relay URL is required",relayUrlMalformed:"invalid or malformed relay URL",relayUrlProtocol:"relay URL must start with http:// or https://",relayUrlNoPath:"relay URL must not contain a path, query, or fragment",relayUrlInsecure:'enable "Allow insecure HTTP/WS" to use http:// with a non-loopback host',taskSections:{needs_attention:"Needs attention",running:"Running",completed:"Completed",failed:"Failed",disconnected:"Disconnected"},taskStates:{idle:"idle",running:"running",waiting_input:"waiting input",completed:"completed",failed:"failed",disconnected:"disconnected",closed:"closed"},taskTypes:{ai:"AI",test:"Test",build:"Build",deploy:"Deploy"},started:"started",lastOutput:"last output",openBadge:"open",back:"Back",pasteClipboard:"Paste",pasteImage:"Image",pasteConfirm:"Paste",pastePreview:"Clipboard text",protectMode:{banner:"Tap-protect mode · enable Control mode below to type"},settings:{title:"Settings",back:"Back",language:"Language",templates:"Quick templates",auxKeys:"Shortcut keys",logout:"Log out",add:"Add",edit:"Edit",delete:"Delete",reset:"Reset to defaults",resetConfirm:"Replace your list with the defaults?",label:"Label",text:"Send text",seq:"Send bytes (\\r \\n \\t \\e \\xNN ^X)",showBar:"Show template bar above the terminal",save:"Save"},image:{prompt:"Add image",fromLibrary:"Photo Library",takePhoto:"Take Photo"},pairing:{connecting:"Pairing…",failed:"Pairing failed.",back:"Try again",scan:"Scan QR code",cameraDenied:"Camera permission required to scan the QR code.",noQrDetected:"No QR code detected — try again.",scanNotAvailable:"QR scanning is not available in this build — enter the relay URL manually below.",errInvalidUrl:"The QR code does not contain a valid pairing link.",errInvalidScheme:"QR scheme must be https. To pair with http, enable the insecure HTTP/WS toggle on the setup screen and rescan.",errPlatformUnsupported:"This platform does not support QR pairing.",errCannotReachRelay:"Cannot reach the relay. Check the QR address or your network, then try again.",errTimeout:"Pairing timed out after 15s. Confirm the relay is reachable, then try again.",errPairInvalid:"The pairing token is invalid or expired. Generate a new QR.",errCancelled:"Pairing cancelled.",errGeneric:"Pairing failed: {message}",stepParsing:"Parsing QR…",stepRequesting:"Contacting relay…",stepSaving:"Saving config…"},insecure:{warning:{title:"Insecure relay (HTTP)",body:"API tokens and terminal output are transmitted unencrypted. Use HTTPS in production.",dismiss:"Dismiss"}},selection:{copy:"Copy",send:"Send",cancel:"Cancel",copied:"Copied to clipboard",copyFailed:"Copy failed"}},tasks:{bulk:{selectedCount:"{count} selected",mergeTab:"Merge tab",mergeTooMany:"Merge up to 4",close:"Close ({count})",closeHint:"Close {count} open panes",closeNoneOpen:"None of the selected sessions are open in this window",cancel:"Cancel"},details:{title:"Session details",sessionId:"Session ID",type:"Type",host:"Host",cwd:"CWD",command:"Command",state:"State",startedAt:"Started",commandStartedAt:"Cmd started",commandEndedAt:"Cmd ended",commandDuration:"Cmd duration",commandExitCode:"Cmd exit code",unread:"Unread",pinned:"Pinned",paneLocation:"Open in",paneAt:"Tab {tab} · Pane {pane}",paneNone:"Not open in this window"},rowMenu:{details:"Details",merge:"Merge into new tab ({n})",closeSelected:"Close selected ({n})"},sidebar:{title:"Sessions",collapse:"Collapse sidebar (Cmd/Ctrl+B)",expand:"Expand sidebar (Cmd/Ctrl+B)",searchPlaceholder:"Search",openDrawer:"Open sidebar",closeDrawer:"Close sidebar"},preset:{iconOnly:{name:"Icon only",description:"Color + glyph carry the state. Most compact."},iconLabel:{name:"Icon + label",description:"Adds a short status label (Running / Waiting / Done) next to the icon. More explicit."}},pinned:{title:"Pinned",menuPin:"Pin to top",menuUnpin:"Unpin"},search:{empty:'No sessions match "{q}"'},markAllRead:"Mark all read",completedFold:"Completed",unreadBadge:"{count} unread",settings:{section:"Session bar",preset:"Display style",expandByDefault:"Expand session bar by default",groupBy:"Group by",groupByHost:"Host",groupByState:"State"}},plugins:{fileExplorer:{title:"File Explorer",description:"Side panel with file tree and read-only syntax-highlighted preview. Follows the active pane's cwd.",noActivePaneShort:"(no active pane)",noActivePane:"No active pane.",selectFile:"Select a file.",pinCurrentCwd:"Pin current cwd",unpinFollow:"Unpin (follow active pane)",showHidden:"Show hidden files",showLineNumbers:"Show line numbers in editor",searchFiles:"Search files",noSearchResults:"No matching files.",searchTruncated:"Showing first 200 matches.",fileChanged:"File changed on disk",reload:"Reload",tooLarge:"File too large to preview. Open externally.",binary:"Binary file - no preview.",errorPrefix:"Error: {message}",unexpectedContentType:"Unexpected file content type",unknownError:"Preview failed for an unknown reason",openInSystem:"Open in System App",unsupportedPreview:"Inline preview unavailable for this file type.",showAsCode:"View as code",showAsRender:"View as image",save:"Save",dontSave:"Don't Save",cancel:"Cancel",dirty:"Unsaved changes",staleModTime:"File was modified on disk since you opened it.",overwrite:"Overwrite",reloadDiscard:"Reload (discard changes)",confirmCloseTitle:"Save changes to {name}?",newFile:"New File",newFolder:"New Folder",rename:"Rename",delete:"Delete",copyPath:"Copy Path",sendToTerminal:"Send to Terminal",pathCopied:"Path copied",moveToTrash:"Move to Trash",confirmTrash:"Move {name} to Trash?",confirmHardDelete:"Permanently delete {name}? This cannot be undone.",saveFailed:"Save failed: {message}",sourceLabel:"File source",sourceActivePane:"Active pane",listingTruncated:"{path}: the host returned {shown} of {total} entries; the rest were not listed.",sshUpload:"Upload a file to {dir}",sshUploadDone:"Uploaded {name} to {dir}",sshUploadExists:"{path} already exists on the remote host. Nothing was written — there is no trash there, so an overwrite could not be undone. Rename or delete it first.",sshNoOpenExternal:"There is no way to hand a file on an SSH host to this machine's system apps.",sshNoInlineAsset:"This file type cannot be previewed inline from an SSH host.",sshNoRecursiveDelete:"{path} is a directory on an SSH host. Deleting one would remove everything inside it, permanently — there is no trash there and no way to undo it — so the panel does not offer it. Delete it from a terminal on that host instead.",sshBridgeDisposed:"This SSH file source was closed.",treeLoadFailed:"Could not list {path}: {message}",retry:"Try again"},deskWidget:{title:"Desk Widget",description:"A small always-on-top window showing which sessions are running, failed, or waiting for you — AI agents and plain shells alike. Click a row to jump to that tab.",aiOnly:"Only show AI sessions",aiOnlyHint:"Limits the widget to sessions running claude / codex / aider. Off by default: session state comes from OSC 133, so it works for any command."},translate:{title:"Translate",description:"Translate the selected text via an OpenAI-compatible API; result shown in a floating panel.",selection:"Translate selection",notConfigured:"Translate plugin not configured",closePanel:"Close translate panel",source:"Source",detected:"detected {lang}",target:"Target",translating:"Translating...",noResult:"No result yet.",recent:"Recent ({count})",baseUrl:"Base URL",apiKey:"API Key",model:"Model",defaultTargetLanguage:"Default target language",keyStoredPlaintext:"API key is stored plaintext in {path}.",extraParams:"Extra params",extraParamsHint:"JSON object merged into every request body (e.g. stream, top_p, max_tokens). Wins over defaults.",extraParamsInvalid:"Not a valid JSON object.",invalidExtraParams:"invalid extra params: {detail}",simplifiedChinese:"Chinese (Simplified)",targetEnglish:"English",targetJapanese:"Japanese",targetKorean:"Korean",targetGerman:"German",targetFrench:"French",targetSpanish:"Spanish",userCancelled:"user cancelled",requestTimedOut:"request timed out after {seconds}s",authFailed:"auth failed ({status})",rateLimited:"rate limited (429)",serverError:"server error ({status})",providerNonJson:"provider returned non-JSON outer envelope",missingTranslated:"missing translated",responseFormatUnsupported:"response_format unsupported"}},connHealth:{pillLabelConnecting:"connecting…",pillLabelReconnecting:"reconnecting…",pillLabelOff:"off",drawerTitle:"Connection health",drawerRttNow:"RTT (now)",drawerRttP50P95:"p50 / p95 (5 min)",drawerBytesIn:"↓ in",drawerBytesOut:"↑ out",drawerState:"State",drawerReconnectsLastHour:"Reconnects (1 h)",drawerReconnectsTime:"time",drawerReconnectsReason:"reason",drawerReconnectsDowntime:"downtime",drawerSeqGaps:"Seq gaps observed:"},startupUpdate:{title:"Update available",currentToLatest:"{current} → {latest}",releaseNotes:"release notes",statusAvailable:"{version} is available",statusDownloading:"downloading {version} ({pct}%)",statusReady:"{version} downloaded — ready to install",downloadInstall:"Download & install",cancel:"Cancel ({pct}%)",cancelling:"Cancelling…",installRestart:"Install & restart",later:"Later"},recovery:{dialog:{title:"Restore your previous session?",subtitleClean:"Last cleanly exited · {minutes} min ago",subtitleUnclean:"Last session ended unexpectedly · {minutes} min ago",btnRestoreAll:"Restore all {count}",btnRestoreSelected:"Restore {count} selected",btnDiscard:"Discard all",badgeResumable:"resumable",badgeFresh:"fresh (sid not captured)",badgeShell:"(no AI)",badgeUnclassified:"not classified as AI"},pane:{failed:"(failed)"}},snippets:{runOnHosts:"Run on hosts…",selectHosts:"Select hosts",pending:"Pending",running:"Running…",ok:"OK",failed:"Failed",error:"Error",exitCode:"Exit code {code}",truncated:"Output truncated",copyAll:"Copy all",cancel:"Cancel",noHostsSelected:"Select at least one host"},sync:{stateIdle:"Up to date",stateSyncing:"Syncing…",stateOffline:"Not syncing",stateError:"Sync failed",syncNow:"Sync now",lastSyncedNever:"Never synced",lastSyncedAt:"Last synced {time}",pendingKeys:"{count} change(s) waiting to sync",pulledAdopted:"Updated from another device: {keys}",pulledConflict:"Kept this device's version (changed elsewhere too): {keys}",keys:{locale_preference:"Language",quick_templates:"Quick templates",notifications_enabled:"Notifications",ai_notifications_only:"AI-only notifications",command_notify_threshold_seconds:"Command-finished notification threshold",shell_integration_enabled:"Shell integration",pinned_session_ids:"Pinned sessions",ssh_hosts_encrypted:"SSH hosts",terminal_theme:"Terminal theme",terminal_font_head:"Terminal font",terminal_font_size:"Terminal font size",terminal_line_height:"Terminal line height",terminal_cursor_style:"Cursor style",terminal_cursor_blink:"Cursor blink",terminal_scrollback:"Scrollback lines",default_shell:"Default shell",shortcut_bindings:"Keyboard shortcuts",profiles_encrypted:"Session profiles"}}},Sw={common:{language:"语言",system:"跟随系统",english:"英语",simplifiedChinese:"简体中文",save:"保存",cancel:"取消",close:"关闭",refresh:"刷新",copy:"复制",paste:"粘贴",send:"发送",disconnect:"断开连接",connect:"连接",settings:"设置",loading:"加载中...",disabled:"已禁用",discard:"放弃",stay:"留在此处",delete:"删除",retry:"重试",unknown:"(未知)",countSessions:"{count} 个会话",countSessionsOne:"1 个会话",minimize:"最小化",maximize:"最大化",restore:"还原",yes:"是",no:"否"},app:{authInvalidToken:"API token 无效或已撤销。请在网页设置中生成新的 token。",authUserDisabled:"账号已禁用。请联系 relay 管理员。",sessionIdOwnerMismatch:"会话 ID 冲突。请重启桌面应用。",forbidden:"无权连接到此 relay。",openSettings:"打开设置",dismiss:"关闭提示",showPanel:"显示面板",hidePanel:"隐藏面板",startingFirstSession:"正在启动第一个会话...",waitingForSessionSelection:"等待会话选择...",noShellsFound:"此机器上找不到 shell",wailsBindingsUnavailable:"Wails 绑定不可用",wailsBindingsNotReady:"Wails 绑定尚未就绪",sessionAlreadyInTab:"该会话已在当前标签页",paneFull:"面板已满 - 请先关闭一个",splitFailed:"分屏失败:{message}",noActiveSession:"没有活动会话",noEndpoint:"没有 endpoint",pluginFailedToLoad:"插件“{title}”加载失败",startupFailureTitle:"AT Term 启动失败",startupFailureIntro:"桌面后端遇到了致命启动错误。终端会话尚未启动。",startupFailureLogPath:"日志文件",startupFailureCopy:"复制诊断信息",startupFailureCopied:"启动诊断信息已复制"},titlebar:{e2eeOffChip:"明文",e2eeOffTitle:"已禁用端到端加密:本机 agent 现在以明文向 relay 发送终端输出、会话标题 / cwd / 当前命令、命令完成通知。在 Settings → Remote relay 关闭即可恢复加密。"},terminal:{connecting:"连接中...",reconnecting:"重新连接中...",ended:"会话已结束",sessionEndedBanner:"[AT Term] 会话已结束(退出码 {exitCode})",connectionError:"连接错误",remoteHasTakenControl:"远端已接管控制",byHost:"来自 {host}",pressSpaceToTakeBack:"按空格取回控制",takeControl:"接管控制",clearBuffer:"清空缓冲区",search:{placeholder:"查找",next:"下一个匹配",prev:"上一个匹配",close:"关闭搜索",noResults:"无匹配"},sendSelection:"发送",pickImage:"图片",pickFile:"文件",emptyPaneHint:"[空面板 - 按 Cmd+N / Ctrl+N 填充]",remote:"远端",remotePrefix:"[远端] ",shellFallback:"shell",emptyTab:"(空)",tabDisconnectedSuffix:"(已断开)",closePaneTitle:"关闭面板 (Cmd+W / Ctrl+W)",dragPaneOut:"拖到标签条可独立成标签页",detachToTab:"独立标签页",alreadyOwnTab:"该会话已是独立标签页",remoteViewerWatching:"{count} 个远端查看者正在观看",relaySettings:"relay 设置",adminPanel:"管理面板",newTab:"新建标签页",starting:"启动中...",newTabProfileLabel:"新建标签页 / 分屏用的配置档",useDefaultProfile:"默认配置档",layoutVertical:"左右分屏",layoutHorizontal:"上下分屏",layoutGrid2x2:"2x2 网格分屏",sessionStatusOne:"{count} 个会话",sessionStatusMany:"{count} 个会话",uplinkOn:"uplink 已开启",imagePasteRequiresFull:"粘贴图片需要 full 远端权限",pasteSessionNotWritable:"当前会话暂时不可写入",clipboardEmpty:"剪贴板没有可粘贴的文本或图片",clipboardImageTooLarge:"剪贴板图片过大",clipboardImageToolsMissing:"请安装 xclip、wl-paste 或 xsel 以粘贴图片",readOnlySession:"会话为只读",websocketNotOpen:"websocket 未打开",imageTooLarge:"图片过大:{size} 字节,超过 {limit}",copyFailed:"复制失败",pasteFailed:"粘贴失败",driverNow:"你现在是控制者",viewerNow:"你现在是查看者",preview:{open:"预览 Web 服务",opening:"正在打开…",portPrompt:"输入远端桌面上 Web 服务的 loopback 端口(例如 3000)",targetHost:"远程服务 loopback 地址",additionalPort:"附加服务端口",pathPrefix:"路径前缀",addMapping:"添加服务映射",removeMapping:"移除服务映射",invalidPathPrefix:"附加服务映射必须使用不同的路径前缀(例如 /api、/ws)",desktopOnly:"远程预览仅在桌面客户端可用",requiresConnection:"请等待远程会话连接后再打开预览",requiresDriver:"请先接管远程会话,再打开预览",requiresFullPermission:"远程预览需要主机授予完整权限",invalidPort:"端口必须是 1–65535 的整数",noLongerAllowed:"打开过程中 Preview 权限已失效",openFailed:"无法打开远程预览:{error}",terminal:"终端",previewPort:"预览 :{port}",switch:"切换预览",closeThis:"关闭此预览",newPreview:"新开预览…",reconnecting:"正在重连…",frameTitle:"远程 Web 预览 :{port}",openInBrowser:"在系统浏览器打开",copyURL:"复制预览地址",urlCopied:"预览地址已复制",browserOpenFailed:"无法打开系统浏览器",copyFailed:"复制预览地址失败"},bellNotification:"{session} 中有响铃",commandFinishedNotification:"命令已完成 - 退出码 {exitCode} - {elapsed} - {session}",loadingHistoryBytes:"正在加载历史 - {bytes}",loadingHistoryProgress:"正在加载历史 {pct}% - {bytes} / {total}",contextMenu:{openLink:"打开链接",copyLink:"复制链接"},resize:"适配终端尺寸",link:{openFailed:"无法打开链接",openFailedNoHome:"无法解析 ~(拿不到 home 目录)"}},sessions:{local:"本地",remote:"远端",remoteSessions:"远端会话",hostIdTitle:"host_id {hostId}",sessionTitle:"会话 {sessionId}",cancelEsc:"取消 (esc)",endLocalSessionOne:"结束 {count} 个本地 shell 会话",endLocalSessionMany:"结束 {count} 个本地 shell 会话",detachRemoteSessionOne:"从 {count} 个远端会话分离",detachRemoteSessionMany:"从 {count} 个远端会话分离",runningProcessesTerminated:"(运行中的进程将被终止)",remotePtyKeepsRunning:"(远端 PTY 会继续在其主机上运行)",saveWorkFirst:"请先保存你的工作。",quitTitle:"退出 AT Term",closingWill:"关闭 AT Term 将会:",quit:"退出",closeSessionTitle:"关闭会话?",closeSessionBody:"确认关闭「{title}」?",closeSessionManyBody:"确认关闭 {count} 个会话?",closeAiSessionWarning:"这是 AI 会话,关闭前请确认任务已经结束或已保存需要的上下文。",closeRunningSessionWarning:"这是运行中的会话,关闭可能中断正在执行的命令。",closeLocalTerminateHint:"本地会话会被结束,运行中的进程将被终止。",closeRemoteDetachHint:"远端会话会从当前窗口分离,远端 PTY 会继续运行。",closeSessionConfirm:"确认关闭",unknownHost:"未知主机",thisMachine:"本机"},ssh:{tabHosts:"主机",tabKeys:"密钥",filterPlaceholder:"筛选主机…",newHost:"新建主机",newKey:"新建密钥",edit:"编辑",subtitleAuthKey:"密钥",subtitleAuthPassword:"密码",importedHosts:"已导入 {count} 台主机",hosts:{emptyTitle:"还没有保存的主机",emptySub:"添加一台主机后就能连接它,并在任意设备上接管这个会话。",clearTags:"清除",noMatchTitle:"没有匹配的主机",noMatchSub:"放宽筛选条件,或清除已选中的标签。",menuConnect:"连接",menuEdit:"编辑主机信息",menuDuplicate:"复制一份",menuCopySsh:"复制 SSH 命令",menuRemove:"移除"},keys:{emptyTitle:"还没有密钥",emptySub:"先在这里添加私钥,再在主机里引用它。",typeLabel:"类型 {type}",genericSubtitle:"SSH 密钥"},proxy:{jumpBadge:"经 {target}",commandBadge:"ProxyCommand",jumpReason:"经跳板机 {target} 连接。链路上每一跳都必须是 atterm 里已保存的主机——atterm 用那台主机自己的凭据登录它,绝不会把这台主机的凭据发过去。",commandReason:"配置了 ProxyCommand({command}):atterm 不会执行这条命令,所以这台主机不能直接连。"},hostKey:{title:"未知的主机密钥",direct:"未知的主机密钥。信任之前请先核对这个指纹:",jumpHop:"这个指纹属于 {name},是通往 {target} 途中的第 {hop} 跳,不是 {target} 本身。请对着 {name} 核对之后再信任:",targetHop:"这个指纹属于 {target},也就是你要连的那台主机(在链路上是第 {hop} 跳)。核对之后再信任:",chainNote:"链路上每台机器都会单独询问一次;接受这一台不代表接受其它任何一台。",accept:"接受并连接",reject:"取消"},hostDrawer:{titleNew:"新建主机",titleEdit:"编辑主机",address:"地址",addressPlaceholder:"IP 或主机名",label:"别名",labelPlaceholder:"可不填",port:"端口",tags:"标签",tagsPlaceholder:"用逗号分隔",removeTag:"移除 {tag}",username:"用户名",usernamePlaceholder:"user",authPassword:"密码",authKey:"密钥",identityFileLabel:"来自 ~/.ssh/config",identityFileHint:"先到「密钥」里导入这个私钥,再回来在下面选中它。",password:"密码",keepBlank:"(留空表示不修改)",keyPicker:"密钥",keyPickerAria:"SSH 密钥",noKeys:"还没有密钥。",addKey:"添加密钥",submitNew:"添加主机"},keyDrawer:{titleNew:"新建密钥",titleEdit:"编辑密钥",name:"名称",namePlaceholder:"例如 aws",pem:"私钥(PEM)",keepBlank:"(留空表示不修改)",passphrase:"口令",encryptedHint:"这个私钥是加密的,请在上面填写它的口令。",dropzone:"把私钥文件拖到这里导入",importFromFile:"从密钥文件导入",submitNew:"添加密钥",reveal:"查看已保存的私钥",hide:"隐藏",copy:"复制私钥"},startup:{sectionTitle:"启动命令",sectionHint:"给那些登录后先给一个菜单、而不是直接给 shell 的堡垒机用。每行会依次输入并回车,一行对应一个提示符——JumpServer 就是先在 Opt> 选资产,再在 ID> 选系统用户。",placeholder:"一行一个回答",delay:"步骤间隔(毫秒)",steps:"登录后会依次发送 {count} 步。"},forwards:{tab:"隧道",sectionTitle:"端口转发",sectionHint:"规则只是配置,要到「隧道」里手动启动才会生效。",add:"添加规则",remove:"删除这条规则",noRules:"还没有转发规则。",kindLocal:"本地",kindRemote:"远程",kindDynamic:"动态",kindLocalHint:"本机监听,每条连接由 SSH 主机去连目标(ssh -L)。",kindRemoteHint:"SSH 主机监听,它收到的每条连接由本机去连目标(ssh -R)。",kindDynamicHint:"本机以 SOCKS5 代理监听,每条连接自带目标地址,由 SSH 主机解析(ssh -D)。",bindAddr:"监听地址",bindPort:"端口",targetHost:"目标主机",targetPort:"目标端口",label:"备注",labelPlaceholder:"可不填",warnLocal:"监听 {addr} 而不是 127.0.0.1,意味着同网段的任何人都能经由你这台机器访问这个被转发的服务,不需要任何 SSH 凭据。这条规则会同步到你登录的每台设备,在那些设备上也这样监听。",warnRemote:"监听 {addr} 而不是 127.0.0.1,意味着 SSH 主机会接受同网段任何人的连接(不需要任何 SSH 凭据),并经由你这台机器转给下面的目标。远端 sshd 默认的 GatewayPorts 通常会拒绝这种绑定。这条规则会同步到你登录的每台设备。",warnDynamic:"监听 {addr} 而不是 127.0.0.1,会让它变成一个无认证的 SOCKS5 开放代理:同网段的任何人都能访问这台 SSH 主机能访问的一切,目标由调用方自己指定,用的是你的 SSH 凭据,在对端日志里显示成你。这条规则会同步到你登录的每台设备,在那些设备上也这样监听。",emptyTitle:"还没有转发规则",emptySub:"可以直接在这里新建,也可以在某台主机的「端口转发」里添加。",new:"新建隧道",newNeedsHost:"先保存一台 SSH 主机——隧道要跑在主机的连接上。",drawerTitleNew:"新建隧道",drawerTitleEdit:"编辑隧道",hostPicker:"SSH 主机",hostPickerAria:"这条隧道所走的 SSH 主机",hostPickerHint:"隧道走这台主机的连接——目标在跳板机后面时,这里选的就是跳板机。它会保存成这台主机的一条转发规则。",saveAndStart:"保存并启动",start:"启动",stop:"停止",dismiss:"清除",stateIdle:"未启动",stateRunning:"运行中",stateStopped:"已停止",conns:"已接受 {count} 条",dynamicTarget:"SOCKS5(目标由每条连接指定)",proxyBlocked:"这台主机不能启动隧道。",refresh:"刷新"},configImport:{open:"从 ~/.ssh/config 导入",title:"从 ~/.ssh/config 导入",loading:"正在读取 ~/.ssh/config…",emptyTitle:"没有可导入的主机",emptySub:"在 ~/.ssh/config 里没有找到可用的 Host 条目。",importableTitle:"可导入的主机({count})",skippedTitle:"已跳过({count})",overwriteBadge:"更新已有",overwriteTitle:"已保存的主机里已经有这个别名,导入会就地更新它",proxyBadge:"{label} · 不能直接连接",importing:"导入中…",confirm:"导入选中的主机({count})"}},settings:{title:"设置",tabs:{general:"通用",relay:"Relay",logging:"日志",updates:"更新",plugins:"插件",shortcuts:"快捷键",devices:"已登录设备",receivedFiles:"接收文件",mobileProfiles:"同步的配置",mobileHosts:"SSH 主机"},discardRelayTitle:"放弃未保存的 relay 更改?",discardRelayBody:"你对 relay URL、token、权限或 insecure mode 的编辑尚未保存。",general:{languageLabel:"语言",languageHint:"选择跟随系统时,会使用设备语言。",terminalTheme:"终端主题",terminalThemeHint:"立即应用到所有终端面板,并保存为本地桌面偏好。",terminalFont:"终端字体",terminalFontHint:"所选字体会排在内置回退链之前;中日韩字符仍由内置字体族渲染。",terminalFontSize:"字号",terminalLineHeight:"行高",terminalCursorStyle:"光标样式",terminalCursorStyleBlock:"方块",terminalCursorStyleUnderline:"下划线",terminalCursorStyleBar:"竖线",terminalCursorBlink:"光标闪烁",terminalScrollback:"回滚行数",terminalScrollbackHint:"当前设置下每个 pane 约占 {mb} MB,开几个就是几份。",notificationsBell:"终端响铃时显示系统通知",notificationsHint:"仅在 AT Term 窗口未聚焦时触发。",shellIntegration:"启用 shell 集成",shellIntegrationHint:"在会话启动时向 zsh / bash / fish / pwsh 注入 OSC 133 hooks,用于检测命令何时完成。仅影响新会话。",recoveryEnabled:"启动时检测并提示恢复上次会话",recoveryEnabledHint:"在启动时询问是否恢复上次的标签页和分屏。",defaultShell:"默认 shell",auto:"自动",customPath:"自定义路径...",defaultShellHint:"自动为新本地会话选择平台默认 shell。也可以选择检测到的 shell,或保存自定义 shell 路径,例如 Git Bash、PowerShell 7 或其他终端程序。",customShellPath:"自定义 shell 路径",customShellRequired:"必须填写自定义 shell 路径",saveCustom:"保存自定义项",webglRenderer:"使用 WebGL 终端渲染器",webglHint:"GPU 光栅化渲染可避免浅色主题在密集 TUI 输出中出现单元格残影。Linux 默认关闭,因为 NVIDIA 专有驱动 + X11 + WebKitGTK 会让光标/最后一个单元格晚一帧绘制,表现为可见输入延迟。仅影响新终端会话。",commandNotifyThreshold:"命令完成通知阈值(秒)",commandNotifyHint:"短于此时长的命令不会产生通知。需要启用 shell 集成。",pushNotifications:{title:"推送通知",enable:"启用推送通知",test:"发送测试通知",errors:{denied:"浏览器拒绝了通知权限。",disabled:"服务器已禁用推送通知。",keyFailed:"无法从 relay 获取推送密钥。",subscribeFailed:"浏览器订阅失败。",subscribeRejected:"relay 拒绝了此订阅。",generic:"推送通知请求失败。"}},themes:{classicLabel:"AT Term 经典",classicDescription:"当前的黑色终端外观。",nordLabel:"Nord / Arctic",nordDescription:"冷色低对比度深色调色板。",solarizedDarkLabel:"Solarized Dark",solarizedDarkDescription:"经典暖色低对比度深色调色板。",daylightLabel:"Daylight",daylightDescription:"适合明亮环境的浅色调色板。"}},configio:{title:"导入与导出",export:{title:"导出",hint:"将偏好设置、SSH 主机和会话配置导出为 JSON 文件,可拷贝到另一台设备上使用。文件中不会包含你的 SSH 密码或私钥。",includeEnvLabel:"包含未设置同步的会话配置环境变量(可能含有 API token 等敏感信息)",button:"导出…",exporting:"导出中…",success:"已保存到 {path}"},import:{title:"导入",hint:"选择之前导出的 JSON 文件。确认前不会应用任何更改。导入的 SSH 主机不会带来凭据:新增的主机需要之后在这里补充密码或私钥;如果某个已有主机的地址发生了变化,其已保存的凭据会为安全起见被清除,同样需要重新填写。",pickFile:"选择文件…",fileLabel:"文件:{name}",previewing:"正在读取文件…",fileReadError:"无法读取文件",previewError:"无法读取该文件:{error}",previewTitle:"预览 — 尚未应用",changesAdd:"新增",changesReplace:"替换",changesUnchanged:"无变化",noChanges:"没有需要变更的内容。",skippedTitle:"已跳过",apply:"应用导入",applying:"应用中…",applyError:"导入失败:{error}",appliedTitle:"导入已应用",appliedSummary:"已应用 {count} 项变更。"}},relay:{uplink:"Uplink",off:"关",on:"开",connectedAs:"已连接为 {identity}",notConfigured:"未配置",paused:"已暂停(保留配置)",connecting:"正在连接…",relayInvalid:"relay 地址无效",versionProbeFailed:"无法连接到 relay:{reason}",loginFailedInline:"登录失败:{reason}",credentialsRequired:"请填邮箱和密码",hint:"配置远端 atterm-relay 后,此机器上的会话可从其他设备附加。无人附加时,不会有字节离开此机器。",relayUrl:"relay url",email:"邮箱",password:"密码",passwordShow:"显示密码",passwordHide:"隐藏密码",modeLogin:"登录",modeRegister:"注册",noAccountPrompt:"没有账号?",haveAccountPrompt:"已有账号?",claimToken:"领取码(可选)",claimTokenPlaceholder:"claim_…",claimTokenHint:"粘贴 `atterm-relay` bootstrap 输出的领取码以注册为管理员账户;留空则注册为普通用户。",insecureMode:"信任自签证书",insecureWarning:"跳过该 relay 的 TLS 证书校验,使自签证书的 relay 可被连接。连接仍然是加密的,但能够中间人拦截的攻击者可冒充该 relay。仅对你自己掌控的 relay 启用(例如 atterm-relay 的自签 quick-start);对外公开服务请使用正式证书。",disableE2EE:"禁用端到端加密(测试 / 调试用)",disableE2EEWarning:"会话内容(终端输出、标题 / cwd / 当前命令、命令完成通知)将不经端到端封装直接发送给 relay,relay 服务器本身即可读取。传输层 TLS(若启用)仍然生效。账号密钥仍保留,仅暂停本机出站封装。开启期间标题栏会持续显示 ⚠ Plaintext 提醒。",saving:"保存中...",saveConnect:"保存并连接",clearTitle:"清理 relay 信息",clearHint:"这将清除本机保存的 relay 地址、账号和登录信息。已经打开的本地终端不受影响。",clearAction:"清理",clearing:"清理中…",clearConfirm:"确定要清除本机保存的 relay 信息吗?",clearFailed:"清理失败:{reason}",pairing:{title:"移动端配对",hint:"生成一次性二维码,让手机无需复制 token 即可接入此 relay。",generate:"生成二维码",generating:"生成中...",regenerate:"重新生成",expiresIn:"剩余",expired:"已过期 - 请重新生成",wrappedBadge:"含 E2EE 密钥",unwrappedWarning:"当前 E2EE 密钥未解锁 — 手机端扫码后将看不到会话详情。请先在上方 Relay 设置里用邮箱/密码登录以解锁。"}},logging:{title:"桌面日志",noContent:"暂时没有可用的日志文件内容。",truncated:"正在显示日志文件的最近部分。",writeLogs:"将日志写入文件",currentFile:"当前日志文件",changeLocation:"更改位置",resetDefault:"重置默认值",viewLogs:"查看日志",liveTail:"实时尾部(每 3 秒刷新)",levelFilter:"显示",tagFilter:"子系统",tagFilterAll:"全部",writeLevel:"日志级别",writeLevelHint:"写入文件的最低级别。DEBUG 会记录逐帧、逐按键的细节——复现问题时有用,平时很吵。",ptyInputDebug:"记录终端输入字节",ptyInputDebugHint:"排查输入丢失 / 卡死。不受上面的日志级别限制,勾选即记录。",tailPaused:"已暂停",tailPausedHint:"向上滚动时已暂停跟随 —— 点此或滚动到底部恢复"},updates:{devDisabled:"开发构建 - 自动更新已禁用",checking:"检查中...",readyToInstall:"{version} 已下载 - 可安装",downloadingStatus:"正在下载 {version} ({pct}%)",available:"{version} 可用",upToDate:"已是最新 - 上次检查 {ago}",notChecked:"尚未检查",justNow:"刚刚",minutesAgo:"{count} 分钟前",hoursAgo:"{count} 小时前",daysAgo:"{count} 天前",currentVersion:"当前版本",status:"状态",downloadPath:"下载路径",autoCheck:"自动检查更新",ghProxy:"GitHub 下载代理",proxyHint:"可选。只有 GitHub Release 文件下载会使用此代理;更新检查与签名验证保持不变。",releaseNotes:"发布说明",checkNow:"立即检查",versionLine:"{minor} 线",downloadVersion:"下载 {version}",cancelDownload:"取消 ({pct}%)",cancelling:"取消中…",redownload:"重新下载",redownloadPrompt:"本机已下载过 {version} 的安装包。是否重新下载?",forceInstallRestart:"强制安装并重启",installTitle:"安装 AT Term {version}",installIntro:"AT Term 将退出并以新版本重新启动。",installThisWill:" 这将:",forceInstall:"强制安装",installRestart:"安装并重启"},plugins:{hint:"插件按需加载。禁用的插件不会影响启动时间或内存。",panelDragHint:"可在面板中拖拽调整面板宽度和内部比例。显示选项在文件树的右键菜单中。",noneRegistered:"未注册插件。"},shortcuts:{keyboardShortcuts:"键盘快捷键",pane:"面板",tab:"标签页",sidebar:"侧栏",pressKey:"按一个键...",resetTo:"重置为 {binding}",conflictsWith:"冲突:{labels}",resetAll:"全部重置为默认值",splitPaneVertically:"垂直分割面板",splitPaneHorizontally:"水平分割面板",closePane:"关闭面板",focusPaneLeft:"聚焦左侧面板",focusPaneRight:"聚焦右侧面板",focusPaneUp:"聚焦上方面板",focusPaneDown:"聚焦下方面板",newTab:"新建标签页",previousTab:"上一个标签页",nextTab:"下一个标签页",focusSidebarSearch:"聚焦侧栏搜索",terminalSearch:"搜索终端"},diagnostics:{tab:"诊断",section:"诊断快照",hint:"桌面端运行时快照,API token 和请求头已脱敏。适合反馈问题时附上。",copy:"复制",export:"导出…",refresh:"刷新",copied:"已复制到剪贴板",copyFailed:"复制失败",exported:"已保存到 {path}"},feishu:{title:"飞书集成",disabled:"飞书集成尚未启用。",relay_disabled:"服务端(relay)已关闭飞书集成。",load_error:"无法获取飞书状态:{error}",retry_status:"重试",mode:{label:"模式",options:{auto:"自动(跟随 Relay 登录态)",local:"强制 Local(本机 LongConn)",relay:"强制 Relay(依赖 Relay 转发)"},effective:{label:"生效模式",fallbackWarn:"已请求 relay 但未登录 / UPLINK 关闭"}},bound:"已绑定到 open_id:{open_id}",save:"保存凭据",begin_pair:"开始绑定",pair_hint:"请在 15 分钟内向机器人发送私聊:/bind {code}",delete:"解绑",configured:"凭据已保存",app_id_label:"App ID",callback_label:"事件回调地址",callback_hint_relay:"在飞书「事件订阅」选择『将事件发送至开发者服务器』,并填入上面的地址。",longconn_hint_local:"本地长连接模式:在飞书「事件订阅」选择『使用长连接接收事件』,无需填回调地址。",copy:"复制",copied:"已复制",reconfigure:"重新配置凭据",aiOnlyNotifications:"仅 AI 会话通知",remoteTerminal:{enable:"启用飞书远程接管",autoAttachLabel:"自动接管会话",autoAttach:{ai:"仅 AI 会话",all:"所有会话",none:"不自动接管"}},hook_install:{enable:"自动安装 Claude Code Hook",retry:"重试",healthy:"Hook 已安装且健康",needs_attention:"Hook 需要修复",disabled:"Hook 自动安装已关闭"},test_send:{title:"测试发送",hint:"向已绑定的飞书账号发送一张测试卡片,验证通知链路是否打通。",command_success:"命令完成(成功)",command_failure:"命令完成(失败)",command_sealed:"命令完成(仅本机可见)",waiting_input:"等待输入",sending:"发送中…",sent:"已发送,请在飞书查看",failed:"发送失败:{error}"}},templates:{tab:"快捷模板",intro:"每个模板被点击时会把它的文本发到当前会话。",add:"新增模板",label:"标签",text:"发送文本",hotkey:"快捷键(如 Alt+1)",showBar:"在终端上方显示快捷模板栏",save:"保存",edit:"编辑",delete:"删除",reset:"恢复默认",resetConfirm:"用默认列表覆盖当前模板?"},profiles:{tab:"会话配置档",intro:"配置档(profile)是新开 tab / split 时用的一组命名启动配置:shell、启动目录、启动命令、环境变量。",precedenceHint:"新建会话的优先级:显式选的配置档 > 下面设置的默认配置档 > 通用设置里的默认 shell + 主目录。配置档不会取代默认 shell——没有配置档生效时,用的还是它。",envPrivacyIntro:"环境变量默认只留在这台机器,不会同步。想同步某个配置档的环境变量,在它上面单独打开「同步这些环境变量」。",empty:"还没有配置档。",add:"新增配置档",edit:"编辑",delete:"删除",save:"保存",name:"名称",shellPlaceholder:"shell 路径(留空则用默认 shell)",cwdPlaceholder:"启动目录(留空则用主目录)",shellUnset:"默认 shell",cwdUnset:"主目录",startupCmdPlaceholder:"启动命令(可选)",startupCmdHint:"在 shell 出现第一个提示符后执行一次,走的是 AI 会话恢复同一条路径——不是按原始按键发送。",envPlaceholder:"KEY=值,一行一个",envHint:"TERM 始终受保护:配置档无法覆盖它,以保证终端渲染正常。",syncEnv:"把这些环境变量同步到我的其他设备",syncEnvOffHint:"关闭(默认):这些环境变量只留在这台机器,同步前会被剥离;名称、shell、目录、启动命令等其余字段仍会同步。",syncEnvOnHint:"开启:这些环境变量会加密同步到你其他已登录的设备,端到端封装,relay 读不到明文。",setDefault:"设为默认",clearDefault:"取消默认",defaultBadge:"默认",nameRequired:"请填写名称。"},mobileSync:{locked:"正在等待账户密钥——请确认已登录。",noData:"还没有任何桌面同步过数据。",error:"无法读取同步的数据:{error}"},mobileProfiles:{intro:"从桌面同步的配置,仅供查看。请在运行它们的机器上编辑。",empty:"桌面上还没有会话配置。",defaultBadge:"默认",shell:"Shell",cwd:"工作目录",startupCmd:"启动命令",env:"环境变量",envNone:"无",envNotSynced:"未从该机器同步",hostLabel:"在此桌面打开",noHosts:"没有找到可用的桌面。请先在这个账号下的某台桌面上打开一个会话,这样手机才能发现它。",openButton:"打开",opening:"正在打开…",openErrors:{unknown_profile:"该配置在桌面上已不存在。",permission_denied:"该桌面以只读方式发布,无法从手机新建会话。",request_in_flight:"已有一个创建请求正在处理,请等它完成后再试。",duplicate_request_id:"该请求已发送过,请等它完成。",unknown_host_id:"暂时无法连接到该桌面。",invalid_request:"请求发送失败,请重试。",upstream_unavailable:"无法连接到该桌面,请重试。",session_create_busy:"该桌面当前繁忙,请稍后重试。",timeout:"等待桌面响应超时,系统不会自动重试——请先检查桌面状态再重试。",relay_not_configured:"请先在此手机上登录 relay。",generic:"无法创建会话:{error}"}},mobileHosts:{intro:"从桌面同步的 SSH 主机,仅供查看。此设备无法连接它们。",empty:"你的桌面还没有配置 SSH 主机。",user:"用户",port:"端口",tags:"标签",note:"备注",jumpChain:"需要通过跳板链才能到达此主机",proxyCommand:"使用 ProxyCommand——不能直接连接",key:"密钥"},devices:{hint:"此账号已登录的浏览器 / 桌面 / 移动设备。",refresh:"刷新",signOutOthers:"登出其他设备",signingOut:"登出中…",signOutOthersConfirm:"确定要登出除本机外的所有设备吗?",revoke:"撤销",revoking:"撤销中…",revokeConfirm:"确定要撤销此设备 ({ua}) 吗?",currentTag:"当前",loginLine:"登录于 {time} · {ip}",timeFormat:"{y}年{m}月{d}日 {hh}:{mm}",empty:"尚未有登录设备。",unknownUA:"未知设备",notAuthenticated:'请先在 "Relay" 页登录 relay 账号。'},account:{title:"账号",email:"邮箱",logout:{button:"退出登录",submitting:"退出中..."},changePassword:{title:"修改密码",oldPassword:"当前密码",newPassword:"新密码",confirmPassword:"确认新密码",hintLength:"新密码至少需要 8 位。",hintMismatch:"两次输入的密码不一致。",submit:"更新密码",submitting:"更新中…",successToast:"密码已更新"},dangerZone:{title:"危险区",warning:"注销账号是永久性操作,无法撤销。",toggle:"注销账号",currentPassword:"当前密码",typeEmailToConfirm:"输入你的邮箱以确认",deleteButton:"注销账号",deleting:"注销中…",confirmPrompt:"此操作不可恢复。"},errors:{wrongPassword:"旧密码不正确。",sessionExpired:"会话已过期,请重新登录。",rateLimited:"请稍后重试。",network:"网络错误。",generic:"操作失败,请重试。"}}},mobile:{relayUrl:"Relay URL",email:"邮箱",password:"密码",passwordShow:"显示密码",passwordHide:"隐藏密码",emailRequired:"请输入邮箱",passwordRequired:"请输入密码",invalidCredentials:"邮箱或密码错误",rateLimited:"操作过于频繁,请稍后再试",loginButton:"登录",allowInsecure:"允许 insecure HTTP/WS(非 loopback)",originRejected:"Relay 拒绝了此 origin。请启动 relay 时让 ATTERM_ORIGINS 包含 capacitor://localhost。",cannotReachRelay:"无法连接 relay:{message}",relayUrlRequired:"必须填写 relay URL",relayUrlMalformed:"relay URL 无效或格式错误",relayUrlProtocol:"relay URL 必须以 http:// 或 https:// 开头",relayUrlNoPath:"relay URL 不能包含路径、查询或片段",relayUrlInsecure:'若要将 http:// 用于非 loopback 主机,请启用 "允许 insecure HTTP/WS"',taskSections:{needs_attention:"需要处理",running:"运行中",completed:"已完成",failed:"失败",disconnected:"已断开"},taskStates:{idle:"空闲",running:"运行中",waiting_input:"等待输入",completed:"已完成",failed:"失败",disconnected:"已断开",closed:"已关闭"},taskTypes:{ai:"AI",test:"测试",build:"构建",deploy:"部署"},started:"开始于",lastOutput:"最近输出",openBadge:"已打开",back:"返回",pasteClipboard:"粘贴",pasteImage:"图片",pasteConfirm:"确认粘贴",pastePreview:"剪贴板文本",protectMode:{banner:"防误触模式 · 打开下方控制模式可输入"},settings:{title:"设置",back:"返回",language:"语言",templates:"快捷模板",auxKeys:"快捷按键",logout:"退出登录",add:"新增",edit:"编辑",delete:"删除",reset:"恢复默认",resetConfirm:"用默认列表覆盖当前设置?",label:"标签",text:"发送文本",seq:"发送字节(\\r \\n \\t \\e \\xNN ^X)",showBar:"在终端上方显示快捷模板栏",save:"保存"},image:{prompt:"添加图片",fromLibrary:"从相册选择",takePhoto:"拍照"},pairing:{connecting:"配对中…",failed:"配对失败",back:"重试",scan:"扫描二维码",cameraDenied:"需要相机权限才能扫描二维码",noQrDetected:"未识别到二维码,请重试",scanNotAvailable:"此版本暂不支持扫码功能,请在下方手动填入 relay 地址",errInvalidUrl:"二维码内容不是合法的配对链接",errInvalidScheme:"二维码地址不是 https,无法配对(如需 http 请回到设置打开 insecure 开关)",errPlatformUnsupported:"当前平台不支持二维码配对",errCannotReachRelay:"无法连接 relay,请检查二维码地址或网络后重试",errTimeout:"配对请求超时(15s),请确认 relay 可达后重试",errPairInvalid:"二维码配对令牌无效或已过期,请重新生成",errCancelled:"已取消配对",errGeneric:"配对失败:{message}",stepParsing:"解析二维码…",stepRequesting:"请求 relay 服务器…",stepSaving:"保存配置…"},insecure:{warning:{title:"不安全的 relay (HTTP)",body:"API token 和终端输出会以明文方式传输。生产环境请使用 HTTPS。",dismiss:"知道了"}},selection:{copy:"复制",send:"发送",cancel:"取消",copied:"已复制到剪贴板",copyFailed:"复制失败"}},tasks:{bulk:{selectedCount:"已选 {count}",mergeTab:"合并 tab",mergeTooMany:"最多合并 4 个",close:"关闭 ({count})",closeHint:"关闭 {count} 个已打开的 pane",closeNoneOpen:"选中集合中没有本窗口已打开的会话",cancel:"取消"},details:{title:"会话详细信息",sessionId:"Session ID",type:"类型",host:"主机",cwd:"工作目录",command:"命令",state:"状态",startedAt:"开始于",commandStartedAt:"命令开始",commandEndedAt:"命令结束",commandDuration:"命令耗时",commandExitCode:"退出码",unread:"未读",pinned:"已置顶",paneLocation:"所在位置",paneAt:"Tab {tab} · Pane {pane}",paneNone:"本窗口未打开"},rowMenu:{details:"详细信息",merge:"合并 tab ({n})",closeSelected:"关闭已打开 ({n})"},sidebar:{title:"会话",collapse:"折叠侧栏 (Cmd/Ctrl+B)",expand:"展开侧栏 (Cmd/Ctrl+B)",searchPlaceholder:"搜索",openDrawer:"打开侧栏",closeDrawer:"关闭侧栏"},preset:{iconOnly:{name:"仅图标",description:"用颜色 + 图标传达状态。最紧凑。"},iconLabel:{name:"图标 + 文案",description:"图标旁加一段「运行中 / 等待输入 / 已完成」文字。更直观。"}},pinned:{title:"置顶",menuPin:"置顶",menuUnpin:"取消置顶"},search:{empty:'搜索 "{q}" 无匹配会话'},markAllRead:"全部标已读",completedFold:"已完成",unreadBadge:"{count} 条未读",settings:{section:"会话栏",preset:"显示样式",expandByDefault:"默认展开会话栏",groupBy:"分组方式",groupByHost:"按主机",groupByState:"按状态"}},plugins:{fileExplorer:{title:"文件浏览器",description:"侧边面板,包含文件树和只读语法高亮预览。跟随当前面板的 cwd。",noActivePaneShort:"(无活动面板)",noActivePane:"无活动面板。",selectFile:"选择一个文件。",pinCurrentCwd:"固定当前 cwd",unpinFollow:"取消固定(跟随活动面板)",showHidden:"显示隐藏文件",showLineNumbers:"在编辑器中显示行号",searchFiles:"搜索文件名",noSearchResults:"没有匹配的文件。",searchTruncated:"仅显示前 200 个匹配项。",fileChanged:"磁盘上的文件已更改",reload:"重新加载",tooLarge:"文件过大,无法预览。请在外部打开。",binary:"二进制文件 - 无法预览。",errorPrefix:"错误:{message}",unexpectedContentType:"文件内容类型异常",unknownError:"预览失败,原因未知",openInSystem:"用系统应用打开",unsupportedPreview:"此文件类型暂不支持内嵌预览。",showAsCode:"看源码",showAsRender:"看渲染",save:"保存",dontSave:"不保存",cancel:"取消",dirty:"有未保存的更改",staleModTime:"文件在你打开后已被外部修改。",overwrite:"覆盖",reloadDiscard:"重新加载(放弃更改)",confirmCloseTitle:"是否保存对 {name} 的更改?",newFile:"新建文件",newFolder:"新建文件夹",rename:"重命名",delete:"删除",copyPath:"复制路径",sendToTerminal:"终端引用",pathCopied:"路径已复制",moveToTrash:"移到回收站",confirmTrash:"把 {name} 移到回收站?",confirmHardDelete:"永久删除 {name}?此操作无法撤销。",saveFailed:"保存失败:{message}",sourceLabel:"文件来源",sourceActivePane:"当前面板",listingTruncated:"{path}:共 {total} 项,主机只返回了 {shown} 项,其余未列出。",sshUpload:"上传文件到 {dir}",sshUploadDone:"已把 {name} 上传到 {dir}",sshUploadExists:"远端已存在 {path},没有写入任何内容——那边没有回收站,覆盖无法撤销。请先重命名或删除它。",sshNoOpenExternal:"SSH 主机上的文件无法交给本机的系统应用打开。",sshNoInlineAsset:"SSH 主机上的这类文件无法内嵌预览。",sshNoRecursiveDelete:"{path} 是 SSH 主机上的目录。删除它会连同里面的一切一起永久删除——那边没有回收站,也无法撤销——所以面板不提供这个操作。请在该主机的终端里删除。",sshBridgeDisposed:"该 SSH 文件来源已关闭。",treeLoadFailed:"无法列出 {path}:{message}",retry:"重试"},deskWidget:{title:"桌面挂件",description:"一个置顶的小窗口,显示哪些会话在跑、失败了、或者在等你输入——AI agent 和普通 shell 一视同仁。点会话行可直接跳到对应标签页。",aiOnly:"仅显示 AI 会话",aiOnlyHint:"只显示跑着 claude / codex / aider 的会话。默认关闭:会话状态来自 OSC 133,任何命令都适用。"},translate:{title:"翻译",description:"通过兼容 OpenAI 的 API 翻译选中文本,并在浮动面板中显示结果。",selection:"翻译选中文本",notConfigured:"翻译插件尚未配置",closePanel:"关闭翻译面板",source:"原文",detected:"检测到 {lang}",target:"目标语言",translating:"翻译中...",noResult:"还没有结果。",recent:"最近 ({count})",baseUrl:"Base URL",apiKey:"API Key",model:"模型",defaultTargetLanguage:"默认目标语言",keyStoredPlaintext:"API key 以明文存储在 {path}。",extraParams:"额外参数",extraParamsHint:"合并进每次请求 body 的 JSON 对象(例如 stream、top_p、max_tokens),会覆盖默认值。",extraParamsInvalid:"不是合法的 JSON 对象。",invalidExtraParams:"额外参数无效:{detail}",simplifiedChinese:"中文(简体)",targetEnglish:"英语",targetJapanese:"日语",targetKorean:"韩语",targetGerman:"德语",targetFrench:"法语",targetSpanish:"西班牙语",userCancelled:"用户已取消",requestTimedOut:"请求在 {seconds}s 后超时",authFailed:"认证失败 ({status})",rateLimited:"请求过于频繁 (429)",serverError:"服务器错误 ({status})",providerNonJson:"provider 返回的外层响应不是 JSON",missingTranslated:"缺少 translated 字段",responseFormatUnsupported:"不支持 response_format"}},connHealth:{pillLabelConnecting:"连接中…",pillLabelReconnecting:"重连中…",pillLabelOff:"已关闭",drawerTitle:"连接质量",drawerRttNow:"RTT(当前)",drawerRttP50P95:"p50 / p95(最近 5 分钟)",drawerBytesIn:"↓ 接收",drawerBytesOut:"↑ 发送",drawerState:"状态",drawerReconnectsLastHour:"最近 1 小时重连",drawerReconnectsTime:"时间",drawerReconnectsReason:"原因",drawerReconnectsDowntime:"断开时长",drawerSeqGaps:"观察到的序号跳跃:"},startupUpdate:{title:"有可用更新",currentToLatest:"{current} → {latest}",releaseNotes:"更新说明",statusAvailable:"{version} 可用",statusDownloading:"正在下载 {version}({pct}%)",statusReady:"{version} 已下载 — 可安装",downloadInstall:"下载并安装",cancel:"取消({pct}%)",cancelling:"正在取消…",installRestart:"安装并重启",later:"稍后"},recovery:{dialog:{title:"恢复上次的会话?",subtitleClean:"上次正常退出 · {minutes} 分钟前",subtitleUnclean:"上次异常结束 · {minutes} 分钟前",btnRestoreAll:"恢复全部 {count} 个",btnRestoreSelected:"恢复选中的 {count} 个",btnDiscard:"全部丢弃",badgeResumable:"可续接",badgeFresh:"无 sid(不自动续接)",badgeShell:"(无 AI)",badgeUnclassified:"未识别为 AI"},pane:{failed:"(已失败)"}},snippets:{runOnHosts:"在多台主机上运行…",selectHosts:"选择主机",pending:"等待中",running:"运行中…",ok:"成功",failed:"失败",error:"出错",exitCode:"退出码 {code}",truncated:"输出已截断",copyAll:"复制全部",cancel:"取消",noHostsSelected:"请至少选择一台主机"},sync:{stateIdle:"已是最新",stateSyncing:"同步中…",stateOffline:"未同步",stateError:"同步失败",syncNow:"立即同步",lastSyncedNever:"从未同步",lastSyncedAt:"上次同步 {time}",pendingKeys:"还有 {count} 项改动待同步",pulledAdopted:"已从其他设备更新:{keys}",pulledConflict:"保留了本机版本(其他设备也改过):{keys}",keys:{locale_preference:"语言",quick_templates:"快捷模板",notifications_enabled:"通知",ai_notifications_only:"仅 AI 通知",command_notify_threshold_seconds:"命令完成通知阈值",shell_integration_enabled:"Shell 集成",pinned_session_ids:"置顶会话",ssh_hosts_encrypted:"SSH 主机",terminal_theme:"终端主题",terminal_font_head:"终端字体",terminal_font_size:"终端字号",terminal_line_height:"终端行高",terminal_cursor_style:"光标样式",terminal_cursor_blink:"光标闪烁",terminal_scrollback:"回滚行数",default_shell:"默认 shell",shortcut_bindings:"键盘快捷键",profiles_encrypted:"会话配置"}}},Zh={en:ww,"zh-CN":Sw},Cw=[{labelKey:"common.system",value:"system"},{labelKey:"common.english",value:"en"},{labelKey:"common.simplifiedChinese",value:"zh-CN"}],ir=H("system"),ac=H("en");let hl,Ag=$g,jo;function kw(e,t){if(e!=="system")return e;for(const n of t){const s=n.trim().toLowerCase();if(s!==""){if(s==="zh"||s.startsWith("zh-"))return"zh-CN";if(s==="en"||s.startsWith("en-"))return"en"}}return"en"}async function xw(e={}){jo==null||jo(),jo=void 0,hl=e.savePreference,Ag=e.getLanguages??$g;const t=e.loadPreference?await e.loadPreference():"system";ir.value=Pw(t),Fd(),jo=(e.listenLanguageChange??Dw)(()=>{Fd()})}async function Rw(e){const t=ir.value,n=ac.value;ir.value=e,Fd();try{await(hl==null?void 0:hl(e))}catch(s){throw ir.value=t,Ig(n),s}}function rn(e,t={}){const n=ef(Zh[ac.value],e)??ef(Zh.en,e);return n===void 0?e:Ew(n,t)}function Fd(){Ig(kw(ir.value,Ag()))}function Ig(e){ac.value=e,Tw(e)}function Tw(e){typeof document>"u"||(document.documentElement.lang=e)}function Pw(e){return e==="en"||e==="zh-CN"||e==="system"?e:"system"}function ef(e,t){let n=e;for(const s of t.split(".")){if(!Lw(n)||!(s in n))return;n=n[s]}return typeof n=="string"?n:void 0}function Ew(e,t){return e.replace(/\{([A-Za-z0-9_]+)\}/g,(n,s)=>{const i=t[s];return i===void 0?n:String(i)})}function Lw(e){return typeof e=="object"&&e!==null}function $g(){return typeof navigator>"u"?[]:navigator.languages.length>0?navigator.languages:[navigator.language]}function Dw(e){return typeof window>"u"?()=>{}:(window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e))}function $t(){return{t:rn,languageOptions:Cw,localePreference:ir,resolvedLocale:ac,setLocalePreference:Rw}}function Mw(){return window.runtime.InitializeNotifications()}function Aw(){return window.runtime.IsNotificationAvailable()}function Iw(){return window.runtime.RequestNotificationAuthorization()}function $w(){return window.runtime.CheckNotificationAuthorization()}function Ow(e){return window.runtime.SendNotification(e)}function He(){var t,n;const e=(n=(t=window.go)==null?void 0:t.main)==null?void 0:n.App;if(!e)throw new Error(rn("app.wailsBindingsNotReady"));return e}const Og=1,Qi=6,er=16,Sn={OPEN:1,IN:2,OUT:3,RESIZE:4,META:5,CLOSE:6,ATTACH:16,LIST:17,LIST_RESP:18,REPLAY_PROGRESS:19,PREFS_CHANGED:20,PING:32,PONG:33,PASTE_IMAGE:51,CLAIM_DRIVER:52,PASTE_FILE:55,FS_REQUEST:56,FS_RESPONSE:57,FS_EVENT:58,SESSION_CREATE:59,SESSION_CREATED:60,SERVICE_OPEN:61,SERVICE_OPENED:62,SERVICE_CLOSE:63},Fw=new TextEncoder,Bw=new TextDecoder;function Hw(e){const t=e.replace(/-/g,"");if(t.length!==32)throw new Error("bad uuid");const n=new Uint8Array(er);for(let s=0;s= 0, got ${e}`)}}function ua(e,t,n=""){const s=Uw(e),i=e==null?void 0:e.length;if(!s||t!==void 0){const d=n&&`"${n}" `,r="",o=s?`length=${i}`:`type=${typeof e}`,c=d+"expected Uint8Array"+r+", got "+o;throw s?new RangeError(c):new TypeError(c)}return e}function Iu(e){if(typeof e!="function"||typeof e.create!="function")throw new TypeError("Hash must wrapped by utils.createHasher");if(xl(e.outputLen),xl(e.blockLen),e.outputLen<1)throw new Error('"outputLen" must be >= 1');if(e.blockLen<1)throw new Error('"blockLen" must be >= 1')}function Rl(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Bg(e,t){ua(e,void 0,"digestInto() output");const n=t.outputLen;if(e.length='+n)}function ha(...e){for(let t=0;t>>t}function lc(e){if(typeof e!="string")throw new TypeError("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Vw(e,t={}){const n=(i,a)=>e(a).update(i).digest(),s=e(void 0);return n.outputLen=s.outputLen,n.blockLen=s.blockLen,n.canXOF=s.canXOF,n.create=i=>e(i),Object.assign(n,t),Object.freeze(n)}function Kw(e=32){xl(e,"bytesLength");const t=typeof globalThis=="object"?globalThis.crypto:null;if(typeof(t==null?void 0:t.getRandomValues)!="function")throw new Error("crypto.getRandomValues must be defined");if(e>65536)throw new RangeError(`"bytesLength" expected <= 65536, got ${e}`);return t.getRandomValues(new Uint8Array(e))}const Ww=e=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,e])});function jw(e,t,n){return e&t^~e&n}function qw(e,t,n){return e&t^e&n^t&n}class Yw{constructor(t,n,s,i){Y(this,"blockLen");Y(this,"outputLen");Y(this,"canXOF",!1);Y(this,"padOffset");Y(this,"isLE");Y(this,"buffer");Y(this,"view");Y(this,"finished",!1);Y(this,"length",0);Y(this,"pos",0);Y(this,"destroyed",!1);this.blockLen=t,this.outputLen=n,this.padOffset=s,this.isLE=i,this.buffer=new Uint8Array(t),this.view=Bc(this.buffer)}update(t){Rl(this),ua(t);const{view:n,buffer:s,blockLen:i}=this,a=t.length;for(let d=0;di-d&&(this.process(s,0),d=0);for(let u=d;up.length)throw new Error("_sha2: outputLen bigger than state");for(let u=0;ue<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255,os=Dr?e=>e:e=>Hg(e)>>>0,Qw=e=>{for(let t=0;te:Qw;function Zw(e,t){if(t==null||typeof t!="object")throw new Error("options must be defined");return Object.assign(e,t)}function e1(e,t){if(e.length!==t.length)return!1;let n=0;for(let s=0;s[],a=(r,o)=>s(o,...i(r)).update(r).digest(),d=s(new Uint8Array(e),...i(new Uint8Array(0)));return a.outputLen=d.outputLen,a.blockLen=d.blockLen,a.create=(r,...o)=>s(r,...o),a}const n1=(e,t)=>{function n(s,...i){if(as(s,void 0,"key"),e.nonceLength!==void 0){const p=i[0];as(p,e.varSizeNonce?void 0:e.nonceLength,"nonce")}const a=e.tagLength;a&&i[1]!==void 0&&as(i[1],void 0,"AAD");const d=t(s,...i),r=(p,u)=>{if(u!==void 0){if(p!==2)throw new Error("cipher output not supported");as(u,void 0,"output")}};let o=!1;return{encrypt(p,u){if(o)throw new Error("cannot encrypt() twice with same key + nonce");return o=!0,as(p),r(d.encrypt.length,u),d.encrypt(p,u)},decrypt(p,u){if(as(p),a&&p.lengthUint8Array.from(e.split(""),t=>t.charCodeAt(0)),i1=tr(Di(Ng("expand 16-byte k"))),r1=tr(Di(Ng("expand 32-byte k")));function xt(e,t){return e<>>32-t}const qo=64,o1=16,zd=2**32-1,sf=Uint32Array.of();function a1(e,t,n,s,i,a,d,r){const o=i.length,c=new Uint8Array(qo),p=Di(c),u=Dr&&fa(i)&&fa(a),g=u?Di(i):sf,m=u?Di(a):sf;if(!Dr){for(let y=0;y=zd)throw new Error("arx: counter overflow");const v=Math.min(qo,o-y);for(let l=0,h;l=zd)throw new Error("arx: counter overflow");const v=Math.min(qo,o-y);if(u&&v===qo){const l=y/4;if(y%4!==0)throw new Error("arx: invalid block position");for(let h=0,f;h{as(r,void 0,"key"),as(o,void 0,"nonce"),as(c,void 0,"data");const g=c.length;if(p=Nd(g,p,!1),ia(u),u<0||u>=zd)throw new Error("arx: counter overflow");const m=[];let y=r.length,v,l;if(y===32)m.push(v=Tl(r)),l=r1;else if(y===16&&n)v=new Uint8Array(32),v.set(r),v.set(r,16),l=i1,m.push(v);else throw as(r,32,"arx key"),new Error("invalid key size");(!Dr||!fa(o))&&m.push(o=Tl(o));let h=Di(v);if(s){if(o.length!==24)throw new Error("arx: extended nonce must be 24 bytes");const S=o.subarray(0,16);if(Dr)s(l,h,Di(S),h);else{const k=tr(Uint32Array.from(l));s(k,h,Di(S),h),rr(k),tr(h)}o=o.subarray(16)}else Dr||tr(h);const f=16-i;if(f!==o.length)throw new Error(`arx: nonce must be ${f} or 16 bytes`);if(f!==12){const S=new Uint8Array(12);S.set(o,a?0:12-o.length),o=S,m.push(o)}const _=tr(Di(o));try{return a1(e,l,h,_,c,p,u,d),p}finally{rr(...m)}}}function Qn(e,t){return e[t++]&255|(e[t++]&255)<<8}class c1{constructor(t){Y(this,"blockLen",16);Y(this,"outputLen",16);Y(this,"buffer",new Uint8Array(16));Y(this,"r",new Uint16Array(10));Y(this,"h",new Uint16Array(10));Y(this,"pad",new Uint16Array(8));Y(this,"pos",0);Y(this,"finished",!1);Y(this,"destroyed",!1);t=Tl(as(t,32,"key"));const n=Qn(t,0),s=Qn(t,2),i=Qn(t,4),a=Qn(t,6),d=Qn(t,8),r=Qn(t,10),o=Qn(t,12),c=Qn(t,14);this.r[0]=n&8191,this.r[1]=(n>>>13|s<<3)&8191,this.r[2]=(s>>>10|i<<6)&7939,this.r[3]=(i>>>7|a<<9)&8191,this.r[4]=(a>>>4|d<<12)&255,this.r[5]=d>>>1&8190,this.r[6]=(d>>>14|r<<2)&8191,this.r[7]=(r>>>11|o<<5)&8065,this.r[8]=(o>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let p=0;p<8;p++)this.pad[p]=Qn(t,16+2*p)}process(t,n,s=!1){const i=s?0:2048,{h:a,r:d}=this,r=d[0],o=d[1],c=d[2],p=d[3],u=d[4],g=d[5],m=d[6],y=d[7],v=d[8],l=d[9],h=Qn(t,n+0),f=Qn(t,n+2),_=Qn(t,n+4),S=Qn(t,n+6),k=Qn(t,n+8),P=Qn(t,n+10),M=Qn(t,n+12),w=Qn(t,n+14);let T=a[0]+(h&8191),A=a[1]+((h>>>13|f<<3)&8191),E=a[2]+((f>>>10|_<<6)&8191),R=a[3]+((_>>>7|S<<9)&8191),D=a[4]+((S>>>4|k<<12)&8191),I=a[5]+(k>>>1&8191),O=a[6]+((k>>>14|P<<2)&8191),U=a[7]+((P>>>11|M<<5)&8191),W=a[8]+((M>>>8|w<<8)&8191),z=a[9]+(w>>>5|i),N=0,V=N+T*r+A*(5*l)+E*(5*v)+R*(5*y)+D*(5*m);N=V>>>13,V&=8191,V+=I*(5*g)+O*(5*u)+U*(5*p)+W*(5*c)+z*(5*o),N+=V>>>13,V&=8191;let q=N+T*o+A*r+E*(5*l)+R*(5*v)+D*(5*y);N=q>>>13,q&=8191,q+=I*(5*m)+O*(5*g)+U*(5*u)+W*(5*p)+z*(5*c),N+=q>>>13,q&=8191;let G=N+T*c+A*o+E*r+R*(5*l)+D*(5*v);N=G>>>13,G&=8191,G+=I*(5*y)+O*(5*m)+U*(5*g)+W*(5*u)+z*(5*p),N+=G>>>13,G&=8191;let te=N+T*p+A*c+E*o+R*r+D*(5*l);N=te>>>13,te&=8191,te+=I*(5*v)+O*(5*y)+U*(5*m)+W*(5*g)+z*(5*u),N+=te>>>13,te&=8191;let oe=N+T*u+A*p+E*c+R*o+D*r;N=oe>>>13,oe&=8191,oe+=I*(5*l)+O*(5*v)+U*(5*y)+W*(5*m)+z*(5*g),N+=oe>>>13,oe&=8191;let ie=N+T*g+A*u+E*p+R*c+D*o;N=ie>>>13,ie&=8191,ie+=I*r+O*(5*l)+U*(5*v)+W*(5*y)+z*(5*m),N+=ie>>>13,ie&=8191;let ye=N+T*m+A*g+E*u+R*p+D*c;N=ye>>>13,ye&=8191,ye+=I*o+O*r+U*(5*l)+W*(5*v)+z*(5*y),N+=ye>>>13,ye&=8191;let K=N+T*y+A*m+E*g+R*u+D*p;N=K>>>13,K&=8191,K+=I*c+O*o+U*r+W*(5*l)+z*(5*v),N+=K>>>13,K&=8191;let J=N+T*v+A*y+E*m+R*g+D*u;N=J>>>13,J&=8191,J+=I*p+O*c+U*o+W*r+z*(5*l),N+=J>>>13,J&=8191;let Q=N+T*l+A*v+E*y+R*m+D*g;N=Q>>>13,Q&=8191,Q+=I*u+O*p+U*c+W*o+z*r,N+=Q>>>13,Q&=8191,N=(N<<2)+N|0,N=N+V|0,V=N&8191,N=N>>>13,q+=N,a[0]=V,a[1]=q,a[2]=G,a[3]=te,a[4]=oe,a[5]=ie,a[6]=ye,a[7]=K,a[8]=J,a[9]=Q}finalize(){const{h:t,pad:n}=this,s=new Uint16Array(10);let i=t[1]>>>13;t[1]&=8191;for(let r=2;r<10;r++)t[r]+=i,i=t[r]>>>13,t[r]&=8191;t[0]+=i*5,i=t[0]>>>13,t[0]&=8191,t[1]+=i,i=t[1]>>>13,t[1]&=8191,t[2]+=i,s[0]=t[0]+5,i=s[0]>>>13,s[0]&=8191;for(let r=1;r<10;r++)s[r]=t[r]+i,i=s[r]>>>13,s[r]&=8191;s[9]-=8192;let a=(i^1)-1;for(let r=0;r<10;r++)s[r]&=a;a=~a;for(let r=0;r<10;r++)t[r]=t[r]&a|s[r];t[0]=(t[0]|t[1]<<13)&65535,t[1]=(t[1]>>>3|t[2]<<10)&65535,t[2]=(t[2]>>>6|t[3]<<7)&65535,t[3]=(t[3]>>>9|t[4]<<4)&65535,t[4]=(t[4]>>>12|t[5]<<1|t[6]<<14)&65535,t[5]=(t[6]>>>2|t[7]<<11)&65535,t[6]=(t[7]>>>5|t[8]<<8)&65535,t[7]=(t[8]>>>8|t[9]<<5)&65535;let d=t[0]+n[0];t[0]=d&65535;for(let r=1;r<8;r++)d=(t[r]+n[r]|0)+(d>>>16)|0,t[r]=d&65535;rr(s)}update(t){nf(this),as(t),t=Tl(t);const{buffer:n,blockLen:s}=this,i=t.length;for(let a=0;a>>0,t[a++]=s[d]>>>8}digest(){const{buffer:t,outputLen:n}=this;this.digestInto(t);const s=t.slice(0,n);return this.destroy(),s}}const d1=t1(32,e=>new c1(e));function u1(e,t,n,s,i,a=20){let d=e[0],r=e[1],o=e[2],c=e[3],p=t[0],u=t[1],g=t[2],m=t[3],y=t[4],v=t[5],l=t[6],h=t[7],f=i,_=n[0],S=n[1],k=n[2],P=d,M=r,w=o,T=c,A=p,E=u,R=g,D=m,I=y,O=v,U=l,W=h,z=f,N=_,V=S,q=k;for(let te=0;te{e.update(t);const n=t.length%16;n&&e.update(p1.subarray(n))},v1=new Uint8Array(32);function of(e,t,n,s,i){i!==void 0&&as(i,void 0,"AAD");const a=e(t,n,v1),d=s1(s.length,i?i.length:0,!0),r=d1.create(a);i&&rf(r,i),rf(r,s),r.update(d);const o=r.digest();return rr(a,d),o}const g1=e=>(t,n,s)=>({encrypt(a,d){const r=a.length;d=Nd(r+16,d,!1),d.set(a);const o=d.subarray(0,-16);e(t,n,o,o,1);const c=of(e,t,n,o,s);return d.set(c,r),rr(c),d},decrypt(a,d){d=Nd(a.length-16,d,!1);const r=a.subarray(0,-16),o=a.subarray(-16),c=of(e,t,n,r,s);if(!e1(o,c))throw rr(c),new Error("invalid tag");return d.set(a.subarray(0,-16)),e(t,n,d,d,1),rr(c),d}}),cc=n1({blockSize:64,nonceLength:24,tagLength:16},g1(f1));class af{constructor(t,n){Y(this,"oHash");Y(this,"iHash");Y(this,"blockLen");Y(this,"outputLen");Y(this,"canXOF",!1);Y(this,"finished",!1);Y(this,"destroyed",!1);if(Iu(t),ua(n,void 0,"key"),this.iHash=t.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,i=new Uint8Array(s);i.set(n.length>s?t.create().update(n).digest():n);for(let a=0;a{const e=(t,n,s)=>new af(t,n).update(s).digest();return e.create=(t,n)=>new af(t,n),e})();function m1(e,t,n){return Iu(e),n===void 0&&(n=new Uint8Array(e.outputLen)),zg(e,n,t)}const Hc=Uint8Array.of(0),lf=Uint8Array.of();function _1(e,t,n,s=32){Iu(e),xl(s,"length"),ua(t,void 0,"prk");const i=e.outputLen;if(t.length255*i)throw new Error("Length must be <= 255*HashLen");const a=Math.ceil(s/i);n===void 0?n=lf:ua(n,void 0,"info");const d=new Uint8Array(a*i),r=zg.create(e,t),o=r._cloneInto(),c=new Uint8Array(r.outputLen);for(let p=0;p_1(e,m1(e,t,n),s,i),y1=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Wi=new Uint32Array(64);class b1 extends Yw{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:n,C:s,D:i,E:a,F:d,G:r,H:o}=this;return[t,n,s,i,a,d,r,o]}set(t,n,s,i,a,d,r,o){this.A=t|0,this.B=n|0,this.C=s|0,this.D=i|0,this.E=a|0,this.F=d|0,this.G=r|0,this.H=o|0}process(t,n){for(let u=0;u<16;u++,n+=4)Wi[u]=t.getUint32(n,!1);for(let u=16;u<64;u++){const g=Wi[u-15],m=Wi[u-2],y=ni(g,7)^ni(g,18)^g>>>3,v=ni(m,17)^ni(m,19)^m>>>10;Wi[u]=v+Wi[u-7]+y+Wi[u-16]|0}let{A:s,B:i,C:a,D:d,E:r,F:o,G:c,H:p}=this;for(let u=0;u<64;u++){const g=ni(r,6)^ni(r,11)^ni(r,25),m=p+g+jw(r,o,c)+y1[u]+Wi[u]|0,v=(ni(s,2)^ni(s,13)^ni(s,22))+qw(s,i,a)|0;p=c,c=o,o=r,r=d+m|0,d=a,a=i,i=s,s=m+v|0}s=s+this.A|0,i=i+this.B|0,a=a+this.C|0,d=d+this.D|0,r=r+this.E|0,o=o+this.F|0,c=c+this.G|0,p=p+this.H|0,this.set(s,i,a,d,r,o,c,p)}roundClean(){ha(Wi)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),ha(this.buffer)}}class w1 extends b1{constructor(){super(32);Y(this,"A",Ki[0]|0);Y(this,"B",Ki[1]|0);Y(this,"C",Ki[2]|0);Y(this,"D",Ki[3]|0);Y(this,"E",Ki[4]|0);Y(this,"F",Ki[5]|0);Y(this,"G",Ki[6]|0);Y(this,"H",Ki[7]|0)}}const Vg=Vw(()=>new w1,Ww(1));lc("atterm-account-key-v1");function $u(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),s=atob(t+n),i=new Uint8Array(s.length);for(let a=0;a255)throw new Error(`fs segments: bad segment count ${e.length}`);let t=1;for(const a of e){if(a.length>qg)throw new Error("fs segments: segment too large");t+=4+a.length}const n=new Uint8Array(t),s=new DataView(n.buffer);n[0]=e.length;let i=1;for(const a of e)s.setUint32(i,a.length,!1),i+=4,n.set(a,i),i+=a.length;return n}function df(e){if(e.length<1)return null;const t=e[0];if(t===0)return null;const n=new DataView(e.buffer,e.byteOffset,e.byteLength),s=[];let i=1;for(let a=0;ae.length)return null;const d=n.getUint32(i,!1);if(d>qg||(i+=4,i+d>e.length))return null;s.push(e.slice(i,i+d)),i+=d}return i!==e.length?null:s}const uf=10*1024*1024,E1=/^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/,L1=3e4,D1=3e4;function hf(e,t){return e!==WebSocket.OPEN?rn("terminal.websocketNotOpen"):t>uf?rn("terminal.imageTooLarge",{size:t,limit:uf}):null}function Ud(e){const t=new Uint8Array(e);let n="";const s=32768;for(let i=0;it?`${s}…`:s}class ff{constructor(t,n){Y(this,"ws",null);Y(this,"reconnectAttempts",0);Y(this,"reconnectTimer",null);Y(this,"detached",!1);Y(this,"listParseFailures",0);this.endpoint=t,this.handlers=n}attach(){this.detached||this.openWS()}detach(){if(this.detached=!0,this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws){try{this.ws.close()}catch{}this.ws=null}}openWS(){var s,i;if(this.detached)return;const t=Yg(this.endpoint,"/client-sessions");let n;try{n=t.protocols?new WebSocket(t.url,t.protocols):new WebSocket(t.url)}catch(a){this.handleOpenFailure(a,t);return}n.binaryType="arraybuffer",this.ws=n,(i=(s=this.handlers).onStatus)==null||i.call(s,this.reconnectAttempts===0?"connecting":"reconnecting"),n.onopen=()=>{var a,d;(d=(a=this.handlers).onStatus)==null||d.call(a,"attached")},n.onmessage=a=>{var o,c;let d;try{d=Fg(new Uint8Array(a.data))}catch{return}if(this.reconnectAttempts=0,d.type===Sn.PREFS_CHANGED){(c=(o=this.handlers).onPrefsChanged)==null||c.call(o);return}if(d.type!==Sn.LIST_RESP)return;let r;try{r=Xg(JSON.parse(xi(d.payload)))}catch(p){this.noteUnusableListFrame(d.payload,p);return}this.listParseFailures=0;try{this.handlers.onSessions(r)}catch(p){Lt("conn","session list handler threw",{url:this.endpoint.url,error:Rt(p)})}},n.onclose=()=>{var d,r;if(this.ws=null,this.detached)return;(r=(d=this.handlers).onStatus)==null||r.call(d,"reconnecting");const a=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),a)},n.onerror=()=>{}}noteUnusableListFrame(t,n){this.listParseFailures++;const s=this.listParseFailures;s!==1&&s%100!==0||Lt("conn","dropping unusable LIST_RESP",{url:this.endpoint.url,consecutive:s,payload_len:t.length,payload_head:N1(t),error:Rt(n)})}handleOpenFailure(t,n){var a,d,r;const s=t;if(Us("conn","session-list: new WebSocket failed",{url:n.url,protocols:(a=n.protocols)==null?void 0:a.join(","),name:s==null?void 0:s.name,message:(s==null?void 0:s.message)??String(t)}),this.ws=null,(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),this.detached)return;const i=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),i)}}function z1(e,t){const n=Ei();if(!n)return cf([$s(JSON.stringify(e))]);const s=$s(JSON.stringify({path:e.path,new_path:e.new_path})),i=jg(n,t,Sn.FS_REQUEST,s),a={...e};return delete a.path,delete a.new_path,cf([$s(JSON.stringify(a)),i])}function pf(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t)}class Gg{constructor(t,n,s={},i={}){Y(this,"ws",null);Y(this,"sidBytes");Y(this,"lastSeq",0);Y(this,"reconnectAttempts",0);Y(this,"reconnectTimer",null);Y(this,"detached",!1);Y(this,"suspended",!1);Y(this,"pendingResize",null);Y(this,"pendingInputs",[]);Y(this,"clientID");Y(this,"clientName");Y(this,"remote");Y(this,"currentDriverClientID","");Y(this,"isDriverRole",!1);Y(this,"recoverDriverIfVacant",!1);Y(this,"pendingFSRequests",new Map);Y(this,"retiredFSRequestIDs",new Set);Y(this,"fsEventHandlers",new Set);Y(this,"pendingServiceOpens",new Map);this.endpoint=t,this.sessionId=n,this.handlers=s,this.sidBytes=Hw(n),this.clientID=crypto.randomUUID(),this.clientName=(i.clientName??"").trim()||A1(),this.remote=i.remote??!1}decryptOut(t,n){if(t.length<41||t[0]!==1)return t;const i=Ei();return i?x1(t,i,this.sessionId,n):null}attach(){this.detached||(this.suspended=!1,!(this.ws||this.reconnectTimer!==null)&&this.openWS())}suspend(){if(!this.detached&&(this.suspended=!0,this.rejectPendingFSRequests(new Error("filesystem request failed: connection suspended")),this.rejectPendingServiceOpens(new Error("service preview failed: connection suspended")),this.retiredFSRequestIDs.clear(),this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws)){try{this.ws.close()}catch{}this.ws=null}}detach(){if(this.detached=!0,this.suspended=!1,this.rejectPendingFSRequests(new Error("filesystem request failed: connection detached")),this.rejectPendingServiceOpens(new Error("service preview failed: connection detached")),this.retiredFSRequestIDs.clear(),this.reconnectTimer!==null&&(window.clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws){try{this.ws.close()}catch{}this.ws=null}}sendFSRequest(t,n=L1){const s=this.ws;if(!s||s.readyState!==WebSocket.OPEN)return Promise.reject(new Error("filesystem request failed: websocket is not open"));const i=t.request_id||this.newUniqueFSRequestID();if(this.pendingFSRequests.has(i))return Promise.reject(new Error(`duplicate filesystem request_id: ${i}`));if(this.retiredFSRequestIDs.has(i))return Promise.reject(new Error(`retired filesystem request_id after timeout: ${i}`));const a={...t,request_id:i},d=z1(a,this.sessionId);return new Promise((r,o)=>{const c=window.setTimeout(()=>{this.pendingFSRequests.delete(i),this.retiredFSRequestIDs.add(i),o(new Error(`filesystem request timed out: ${i}`))},n);this.pendingFSRequests.set(i,{resolve:r,reject:o,timer:c});try{s.send(Ys(Sn.FS_REQUEST,this.sidBytes,d))}catch(p){window.clearTimeout(c),this.pendingFSRequests.delete(i),o(p instanceof Error?p:new Error(String(p)))}})}openService(t,n="localhost",s=D1){const i=this.ws;if(!i||i.readyState!==WebSocket.OPEN)return Promise.reject(new Error("service preview failed: websocket is not open"));if(!Number.isInteger(t)||t<1||t>65535)return Promise.reject(new Error("service preview failed: invalid port"));if(!["localhost","127.0.0.1","::1"].includes(n))return Promise.reject(new Error("service preview failed: target must be loopback"));const a=Ei();if(!a||a.length!==32)return Promise.reject(new Error("service preview requires unlocked E2EE"));const d=crypto.randomUUID(),r=crypto.randomUUID(),o=P1(a,r),c=jg(a,this.sessionId,Sn.SERVICE_OPEN,$s(JSON.stringify({port:t,scheme:"http",host:n}))),p=$s(JSON.stringify({request_id:d,service_id:r,sealed:pf(c)}));return new Promise((u,g)=>{const m=window.setTimeout(()=>{this.pendingServiceOpens.delete(d),g(new Error("service preview timed out"))},s);this.pendingServiceOpens.set(d,{serviceId:r,resolve:u,reject:g,timer:m,clientToHostKey:o.clientToHost,hostToClientKey:o.hostToClient});try{i.send(Ys(Sn.SERVICE_OPEN,this.sidBytes,p))}catch(y){window.clearTimeout(m),this.pendingServiceOpens.delete(d),g(y instanceof Error?y:new Error(String(y)))}})}closeService(t){const n=this.ws;if(!(!n||n.readyState!==WebSocket.OPEN))try{n.send(Ys(Sn.SERVICE_CLOSE,this.sidBytes,$s(JSON.stringify({service_id:t}))))}catch{}}onFSEvent(t){return this.fsEventHandlers.add(t),()=>{this.fsEventHandlers.delete(t)}}sendInput(t){if(!this.ws||this.ws.readyState===WebSocket.CONNECTING){this.pendingInputs.push(t);return}this.ws.readyState===WebSocket.OPEN&&this.ws.send(Ys(Sn.IN,this.sidBytes,$s(t)))}claimDriver(){if(!this.ws||this.ws.readyState!==WebSocket.OPEN)return;const t=$s(JSON.stringify({client_id:this.clientID,client_name:this.clientName}));this.ws.send(Ys(Sn.CLAIM_DRIVER,this.sidBytes,t))}async sendPasteImage(t,n="clipboard-image"){var d,r;const s=this.ws,i=hf(s==null?void 0:s.readyState,t.size);if(i||!s)throw(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),new Error(i??"websocket is not open");const a=$s(JSON.stringify({filename:n,content_type:t.type||"image/png",data:Ud(await t.arrayBuffer())}));return Js("conn","sending paste image",{filename:n,contentType:t.type||"image/png",bytes:t.size}),s.send(Ys(Sn.PASTE_IMAGE,this.sidBytes,a)),!0}async sendPasteFile(t,n){var d,r;const s=this.ws,i=hf(s==null?void 0:s.readyState,t.size);if(i||!s)throw(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),new Error(i??"websocket is not open");const a=$s(JSON.stringify({filename:n,content_type:t.type||"application/octet-stream",data:Ud(await t.arrayBuffer())}));return Js("conn","sending paste file",{filename:n,contentType:t.type||"application/octet-stream",bytes:t.size}),s.send(Ys(Sn.PASTE_FILE,this.sidBytes,a)),!0}sendResize(t,n){if(this.ws&&this.ws.readyState===WebSocket.OPEN){this.ws.send(Ys(Sn.RESIZE,this.sidBytes,tf(t,n))),this.pendingResize=null;return}this.pendingResize={cols:t,rows:n}}openWS(){var s,i;if(this.detached)return;const t=Yg(this.endpoint,"/client");let n;try{n=t.protocols?new WebSocket(t.url,t.protocols):new WebSocket(t.url)}catch(a){this.handleOpenFailure(a,t);return}n.binaryType="arraybuffer",this.ws=n,(i=(s=this.handlers).onStatus)==null||i.call(s,this.reconnectAttempts===0?"connecting":"reconnecting"),n.onopen=()=>{var d,r;this.retiredFSRequestIDs.clear(),this.recoverDriverIfVacant=this.isDriverRole,(r=(d=this.handlers).onStatus)==null||r.call(d,"attached");const a=$s(JSON.stringify({session_id:this.sessionId,since_seq:this.lastSeq,client_id:this.clientID,client_name:this.clientName}));if(n.send(Ys(Sn.ATTACH,this.sidBytes,a)),this.pendingResize){const{cols:o,rows:c}=this.pendingResize;this.pendingResize=null,n.send(Ys(Sn.RESIZE,this.sidBytes,tf(o,c)))}if(this.pendingInputs.length>0){const o=this.pendingInputs;this.pendingInputs=[];for(const c of o)n.send(Ys(Sn.IN,this.sidBytes,$s(c)))}},n.onmessage=a=>{var r,o,c,p,u,g,m,y,v,l,h,f,_,S;let d;try{d=Fg(new Uint8Array(a.data))}catch{return}if(this.reconnectAttempts=0,d.type===Sn.OUT){const{seq:k,data:P}=Nw(d.payload);if(k>0&&k<=this.lastSeq){Js("conn","dropping duplicate OUT",{sessionId:this.sessionId,seq:k,lastSeq:this.lastSeq});return}const M=this.remote?this.decryptOut(P,k):P;M&&((o=(r=this.handlers).onOutput)==null||o.call(r,M)),k>this.lastSeq&&(this.lastSeq=k)}else if(d.type===Sn.CLOSE){try{const k=JSON.parse(xi(d.payload));(p=(c=this.handlers).onClose)==null||p.call(c,k)}catch{(g=(u=this.handlers).onClose)==null||g.call(u,{exit_code:0})}(y=(m=this.handlers).onStatus)==null||y.call(m,"ended")}else if(d.type===Sn.META)try{const k=JSON.parse(xi(d.payload)),P=Ei();if(P&&typeof k.sealed=="string"&&k.sealed.length>0){const A=$u(k.sealed),E=T1(A,P,this.sessionId);E&&(E.cwd!==void 0&&(k.cwd=E.cwd),E.title!==void 0&&(k.title=E.title),E.current_command!==void 0&&(k.current_command=E.current_command))}(l=(v=this.handlers).onMeta)==null||l.call(v,k);const M=String(k.driver_client_id??""),w=String(k.driver_client_name??""),T=this.recoverDriverIfVacant;if(this.recoverDriverIfVacant=!1,T&&M==="")this.claimDriver();else if(M!==this.currentDriverClientID){this.currentDriverClientID=M;const A=M!==""&&M===this.clientID;this.isDriverRole=A,(f=(h=this.handlers).onDriverChange)==null||f.call(h,M,A,w)}}catch{}else if(d.type===Sn.REPLAY_PROGRESS)try{(S=(_=this.handlers).onReplayProgress)==null||S.call(_,JSON.parse(xi(d.payload)))}catch{}else d.type===Sn.FS_RESPONSE?this.handleFSResponse(d.payload):d.type===Sn.FS_EVENT?this.handleFSEvent(d.payload):d.type===Sn.SERVICE_OPENED&&this.handleServiceOpened(d.payload)},n.onclose=a=>{var r,o;if(this.ws!==n||(this.ws=null,this.rejectPendingFSRequests(new Error("filesystem request failed: websocket closed")),this.rejectPendingServiceOpens(new Error("service preview failed: websocket closed")),this.retiredFSRequestIDs.clear(),this.detached||this.suspended))return;Lt("conn","session websocket closed",{sessionId:this.sessionId,code:a==null?void 0:a.code,reason:a==null?void 0:a.reason,wasClean:a==null?void 0:a.wasClean,attempt:this.reconnectAttempts}),(o=(r=this.handlers).onStatus)==null||o.call(r,"reconnecting");const d=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),d)},n.onerror=()=>{}}handleOpenFailure(t,n){var a,d,r;const s=t;if(Us("conn","session: new WebSocket failed",{url:n.url,protocols:(a=n.protocols)==null?void 0:a.join(","),sessionId:this.sessionId,name:s==null?void 0:s.name,message:(s==null?void 0:s.message)??String(t)}),this.ws=null,(r=(d=this.handlers).onStatus)==null||r.call(d,"error"),this.detached)return;const i=Math.min(8e3,500*Math.pow(2,this.reconnectAttempts++));this.reconnectTimer=window.setTimeout(()=>this.openWS(),i)}newFSRequestID(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?`fs-${crypto.randomUUID()}`:`fs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}handleServiceOpened(t){let n;try{n=JSON.parse(xi(t))}catch{return}if(!n.request_id)return;const s=this.pendingServiceOpens.get(n.request_id);if(s){if(window.clearTimeout(s.timer),this.pendingServiceOpens.delete(n.request_id),!n.ok||!n.client_ticket||n.service_id!==s.serviceId){s.reject(new Error(n.error||"service preview rejected"));return}s.resolve({serviceId:s.serviceId,clientTicket:n.client_ticket,clientToHostKey:s.clientToHostKey,hostToClientKey:s.hostToClientKey})}}rejectPendingServiceOpens(t){for(const n of this.pendingServiceOpens.values())window.clearTimeout(n.timer),n.reject(t);this.pendingServiceOpens.clear()}newUniqueFSRequestID(){for(let t=0;t<5;t++){const n=this.newFSRequestID();if(!this.pendingFSRequests.has(n))return n}return`fs-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}handleFSResponse(t){const n=df(t);if(!n)return;let s;try{const a=JSON.parse(xi(n[0]));if(!H1(a))return;s=a}catch{return}if(n.length>1&&!this.openSealedFSResponse(s,n))return;const i=this.pendingFSRequests.get(s.request_id);i&&(window.clearTimeout(i.timer),this.pendingFSRequests.delete(s.request_id),i.resolve(s))}handleFSEvent(t){const n=df(t);if(!n)return;let s;try{const i=JSON.parse(xi(n[0]));if(!i||typeof i.watch_id!="string"||typeof i.event!="string")return;if(n.length>1){const a=Ei();if(!a)return;const d=fl(a,this.sessionId,Sn.FS_EVENT,n[1]);if(!d)return;const r=JSON.parse(xi(d));i.path=r.path??""}if(typeof i.path!="string")return;s=i}catch{return}for(const i of this.fsEventHandlers)try{i(s)}catch(a){Lt("conn","fs event handler threw",{error:Rt(a)})}}openSealedFSResponse(t,n){const s=Ei();if(!s)return!1;const i=fl(s,this.sessionId,Sn.FS_RESPONSE,n[1]);if(!i)return!1;try{Object.assign(t,JSON.parse(xi(i)))}catch{return!1}if(n.length>2){const a=fl(s,this.sessionId,Sn.FS_RESPONSE,n[2]);if(!a)return!1;const d=pf(a);t.content?t.content.data=d:t.chunk&&(t.chunk.data=d)}return!0}rejectPendingFSRequests(t){if(this.pendingFSRequests.size===0)return;const n=Array.from(this.pendingFSRequests.values());this.pendingFSRequests.clear();for(const s of n)window.clearTimeout(s.timer),s.reject(t)}}function Xg(e){const t=Ei();return t?e.map(n=>{if(!n.sealed)return n;try{const s=C1($u(n.sealed),t,n.id);if(!s)return n;const i={...n};return s.title!==void 0&&(i.title=s.title),s.cwd!==void 0&&(i.cwd=s.cwd),s.command!==void 0&&(i.command=s.command),s.current_command!==void 0&&(i.current_command=s.current_command),i}catch{return n}}):e}function U1(){return He().GetUplinkHealth()}function Pl(){return He().GetRelayConfig()}function vf(e){return He().SetRelayConfig({url:e.url,token:e.token,session_expires_at:e.session_expires_at??0,allow_insecure_relay:e.allow_insecure_relay??!1,disable_e2ee:e.disable_e2ee??!1,remote_permission:e.remote_permission??"full",last_email:e.last_email??"",connected:!1})}function V1(){return He().ClearRelayConfig()}function K1(e){return He().SetRelayDisableE2EE(e)}function W1(e){return He().SetUplinkPaused(e)}function j1(e,t,n,s){return He().LoginRemoteRelay(e,t,n,s)}function q1(e,t,n,s,i){return He().RegisterRemoteRelay(e,t,n,s,i)}function Y1(){return He().LoadSavedRelayPassword()}function G1(e){return He().RememberRelayPassword(e)}function X1(e,t){return He().ProbeRelayVersion(e,t)}function gf(){return He().FetchRelayMe()}function J1(){return He().CreatePairingToken()}function Q1(e){return He().GetDiagnostics(e)}function Z1(e){return He().ExportDiagnostics(e)}async function eS(){const e=await He().ListRemoteSessions(),t=JSON.parse(e);return Xg(t??[])}const tS={host:"",fingerprint:""};function nS(e){return He().NewSshSession(e)}function Jg(e,t=tS){return He().NewSshSessionByID(e,t)}function Qg(){return He().ListSSHHosts()}function mf(e,t){return He().AddSSHHost(e,t)}function zc(e,t){return He().UpdateSSHHost(e,t)}function sS(e){return He().DeleteSSHHost(e)}function iS(){return He().PreviewSSHConfigImport()}function rS(e){return He().ImportSSHHosts(e)}function oS(e,t){return He().StartForward(e,t)}function _f(e,t){return He().StopForward(e,t)}function aS(){return He().ListActiveForwards()}function aZ(){return He().ListSFTPHosts()}function lZ(e,t){return He().SFTPListDir(e,t)}function cZ(e,t){return He().SFTPFileMeta(e,t)}function dZ(e,t,n){return He().SFTPReadFile(e,t,n)}function uZ(e,t,n,s,i){return He().SFTPWriteFile(e,t,Array.from(n),s,i)}function hZ(e,t){return He().SFTPCreateFile(e,t)}function fZ(e,t){return He().SFTPMkdir(e,t)}function pZ(e,t,n){return He().SFTPRename(e,t,n)}function vZ(e,t,n){return He().SFTPRemove(e,t,n)}function gZ(e){return He().SFTPDisconnect(e)}function lS(){return He().ListSSHKeys()}function cS(e,t,n){return He().AddSSHKey(e,t,n)}function dS(e,t,n,s){return He().UpdateSSHKey(e,t,n,s)}function uS(e){return He().DeleteSSHKey(e)}function yf(e){return He().RevealSSHKey(e)}function bf(){return He().GetFeishuModePref()}function hS(e){return He().SetFeishuModePref(e)}function wf(){return He().GetFeishuEffectiveMode()}function Uc(){return He().GetFeishuRemoteTerminalSettings()}function Sf(e,t){return He().SetFeishuRemoteTerminalSettings(e,t)}function fS(){return He().GetFeishuStatus()}function pS(e){return He().SetFeishuCredentials(e)}function vS(){return He().BeginFeishuPair()}function gS(){return He().DeleteFeishuBinding()}function mS(e){return He().SendFeishuTestCard(e)}function _S(){return He().GetHookInstallState()}function Cf(e){return He().SetHookInstallEnabled(e)}function Zg(){return He().GetTaskPreset()}function yS(e){return He().SetTaskPreset(e)}function bS(){return He().GetTaskGroupBy()}function wS(e){return He().SetTaskGroupBy(e)}function em(){return He().GetTaskSidebarCollapsed()}function tm(e){return He().SetTaskSidebarCollapsed(e)}function SS(){return He().GetTaskSidebarWidth()}function CS(e){return He().SetTaskSidebarWidth(e)}function kS(e){return"all"in e&&e.all?He().MarkSessionsSeen([],!0):He().MarkSessionsSeen(e.ids,!1)}function xS(e,t,n,s){return He().BroadcastCommandFinished(e,t,n,s)}function go(){return He().GetUpdateState()}function nm(){return He().CheckUpdate()}function sm(){return He().StartDownload()}function RS(e){return He().DownloadVersion(e)}function im(){return He().CancelDownload()}function kf(e){return He().ForceRedownload(e)}function rm(){return He().InstallUpdate()}function om(){return He().GetAutoCheckUpdates()}function TS(e){return He().SetAutoCheckUpdates(e)}function xf(){return He().GetUpdateGHProxyURL()}function PS(e){return He().SetUpdateGHProxyURL(e)}function ES(){return He().LoadRecoverySnapshot()}function LS(e){return He().SaveRecoverySnapshot(JSON.stringify(e))}function DS(){return He().DiscardRecoverySnapshot()}function am(){return He().GetRecoveryDialogEnabled()}function MS(e){return He().SetRecoveryDialogEnabled(e)}function AS(e,t,n){return He().RunSnippetOnHosts(e,t,n)}function IS(e){return He().CancelSnippetRun(e)}function $S(){return He().GetSyncStatus()}function OS(){return He().SyncNow()}function FS(e){return He().ExportConfig(e)}function BS(e){return He().PreviewConfigImport(e)}function HS(e){return He().ApplyConfigImport(e)}let pl,Wd=0;function NS(){pl=void 0,Wd=0}async function zS(){return pl||(pl=(async()=>{try{return await Aw()?(await Mw(),await $w()?!0:await Iw()):!1}catch{return!1}})()),pl}function US(){return He().GetClipboardPastePayload()}function VS(){const e=He();return e.GetStartupError?e.GetStartupError():Promise.resolve({fatal:!1,message:"",log_path:""})}function KS(){return He().GetEndpoint()}function lm(e){return He().NewSession(e)}function Rf(e){return He().CloseSession(e)}let Jo=null;function Ou(){return Jo||(Jo=He().ListShells().catch(e=>{throw Jo=null,e})),Jo}function cm(){return He().GetHostInfo()}function Yo(){return He().GetLoggingConfig()}function Ga(e){return He().SetLoggingConfig({enabled:e.enabled,path:e.path??"",effective_path:"",dev_dual_output:!1,level:e.level??""})}function WS(){return He().PickLogFilePath()}function dm(){return He().GetLogPreview()}function um(){return He().GetTerminalTheme()}function jS(e){return He().SetTerminalTheme(e)}function hm(){return He().GetShortcutBindings()}function qS(e){return He().SetShortcutBindings(e)}function fm(){return He().GetTerminalFontHead()}function YS(e){return He().SetTerminalFontHead(e)}function pm(){return He().GetTerminalFontSize()}function GS(e){return He().SetTerminalFontSize(e)}function vm(){return He().GetTerminalLineHeight()}function XS(e){return He().SetTerminalLineHeight(e)}function gm(){return He().GetTerminalCursorStyle()}function JS(e){return He().SetTerminalCursorStyle(e)}function mm(){return He().GetTerminalCursorBlink()}function QS(e){return He().SetTerminalCursorBlink(e)}function _m(){return He().GetTerminalScrollback()}function ZS(e){return He().SetTerminalScrollback(e)}function eC(){return He().GetLocalePreference()}function tC(){return He().GetDefaultShell()}async function Tf(e){await He().SetDefaultShell(e),Jo=null}function Pf(){return He().ConfirmQuit()}function ym(){return He().GetNotificationsEnabled()}function nC(e){return He().SetNotificationsEnabled(e)}function Ef(){return He().GetAINotificationsOnly()}function sC(e){return He().SetAINotificationsOnly(e)}function iC(){return He().GetPtyInputDebugEnabled()}function rC(e){return He().SetPtyInputDebugEnabled(e)}async function Lf(e,t,n){try{if(!await ym())return}catch(s){Js("notify","enabled-lookup failed; defaulting to allow",{error:Rt(s)})}if(await zS())try{Wd+=1,await Ow({id:`atterm-${Date.now()}-${Wd}`,title:e,body:t,...n?{data:n}:{}});return}catch{NS()}return He().ShowNotification(e,t)}function oC(){return He().GetShellIntegrationEnabled()}function aC(e){return He().SetShellIntegrationEnabled(e)}function bm(){return He().GetWebglRendererEnabled()}function lC(e){return He().SetWebglRendererEnabled(e)}function wm(){return He().GetCommandNotifyThresholdSeconds()}function cC(e){return He().SetCommandNotifyThresholdSeconds(e)}function Fu(){return He().GetUserHomeDir()}function Sm(){const e=He();return e.GetProfiles?e.GetProfiles():Promise.resolve([])}function dC(e){const t=He();return t.SetProfiles?t.SetProfiles(e):Promise.reject(new Error("SetProfiles binding is not available"))}function uC(){const e=He();return e.GetDefaultProfileID?e.GetDefaultProfileID():Promise.resolve("")}function hC(e){const t=He();return t.SetDefaultProfileID?t.SetDefaultProfileID(e):Promise.reject(new Error("SetDefaultProfileID binding is not available"))}const Cm={idle:"#6b7280",running:"#06b6d4",waiting_input:"#f59e0b",completed:"#22c55e",failed:"#ef4444",disconnected:"#6b7280",closed:"#6b7280"};function km(e){return Cm[e]}function Df(e,t){return{id:e,i18nKey:`tasks.preset.${e}`,colorOf:n=>Cm[n],textOpacity:1,showLabel:t}}const Qo={iconOnly:Df("iconOnly",!1),iconLabel:Df("iconLabel",!0)};function xm(e){const t=H(e.defaultValue);let n=!1;async function s(){try{const r=await e.load();if(e.isValid(r)){t.value=r;return}}catch{}if(typeof localStorage<"u"){const r=localStorage.getItem(e.storageKey);e.isValid(r)&&(t.value=r)}}function i(){n||(n=!0,s())}async function a(r){t.value=r;try{await e.save(r)}catch{typeof localStorage<"u"&&localStorage.setItem(e.storageKey,String(r))}}function d(){n=!1,t.value=e.defaultValue}return{activeId:t,ensureLoaded:i,set:a,__resetForTests:d}}function fC(e){return e==="iconOnly"||e==="iconLabel"}const Xa=xm({defaultValue:"iconOnly",storageKey:"taskPreset",load:()=>Zg(),save:e=>yS(e),isValid:fC});function Bu(){Xa.ensureLoaded();const e=j(()=>Qo[Xa.activeId.value]);return{activeId:Xa.activeId,active:e,setPreset:Xa.set}}const pC=125,Rm=H(0);let co=0,uo=null,jd=0;function Tm(e){e-jd>=pC&&(jd=e,Rm.value++),co>0&&(uo=requestAnimationFrame(Tm))}function vC(){co++,co===1&&uo===null&&(jd=performance.now(),uo=requestAnimationFrame(Tm))}function gC(){co!==0&&(co--,co===0&&uo!==null&&(cancelAnimationFrame(uo),uo=null))}function Pm(){return{phase:Rm,acquire:vC,release:gC}}const mC=["data-state","data-unread"],_C=["width","height"],yC=["fill"],bC=["transform"],wC=["stroke","transform"],SC=["stroke"],CC=["stroke"],kC=["stroke"],xC=["r","fill"],RC=["fill"],Mf="#0d1117",ci=$e({__name:"TaskStateIcon",props:{state:{},size:{default:12},preset:{},unread:{type:Boolean,default:!1}},setup(e){const t=e,n=Bu(),s=j(()=>t.preset??n.active.value),i=j(()=>t.unread),a=j(()=>s.value.colorOf(t.state)),d=j(()=>i.value?Mf:a.value),r=Pm(),o=j(()=>t.state==="running"),c=j(()=>o.value?r.phase.value*30%360:0),p=j(()=>o.value?`rotate(${c.value} 8 8)`:void 0);let u=!1;return yt(o,g=>{g&&!u?(u=!0,r.acquire()):!g&&u&&(u=!1,r.release())},{immediate:!0}),Vt(()=>{u&&(u=!1,r.release())}),(g,m)=>($(),F("span",{class:"task-state-icon",style:nn({color:a.value,display:"inline-flex",alignItems:"center",gap:"2px"}),"data-state":g.state,"data-unread":i.value?"true":void 0},[($(),F("svg",{width:g.size,height:g.size,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",style:{overflow:"visible"}},[i.value?($(),F("circle",{key:0,class:"task-unread-disc",cx:"8",cy:"8",r:"7.5",fill:a.value},null,8,yC)):Z("",!0),b("g",{transform:i.value?"translate(8,8) scale(0.62) translate(-8,-8)":void 0},[g.state==="running"?($(),F("path",{key:0,class:"task-running-arc",d:"M14 8 a6 6 0 1 1 -3 -5.196",stroke:d.value,"stroke-width":"2","stroke-linecap":"round",transform:p.value},null,8,wC)):g.state==="completed"?($(),F("path",{key:1,class:"task-completed-check",d:"M3 8 l3 3 l7 -7",stroke:d.value,"stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},null,8,SC)):g.state==="failed"?($(),F("path",{key:2,d:"M4 4 L12 12 M12 4 L4 12",stroke:d.value,"stroke-width":"2","stroke-linecap":"round"},null,8,CC)):g.state==="waiting_input"?($(),F("path",{key:3,class:"task-waiting-prompt",d:"M3 4.5 L6.5 8 L3 11.5 M8 11.5 H13",stroke:d.value,"stroke-width":"1.8","stroke-linecap":"round","stroke-linejoin":"round"},null,8,kC)):($(),F("circle",{key:4,cx:"8",cy:"8",r:i.value?3.2:2,fill:d.value},null,8,xC))],8,bC),i.value?($(),F(Oe,{key:1},[b("circle",{cx:"12.6",cy:"3.4",r:"3.3",fill:Mf}),b("circle",{class:"task-unread-dot",cx:"12.6",cy:"3.4",r:"2.5",fill:a.value},null,8,RC)],64)):Z("",!0)],8,_C))],12,mC))}});function Hu(e,t){switch(e){case"running":return t("mobile.taskStates.running");case"waiting_input":return t("mobile.taskStates.waiting_input");case"completed":return t("mobile.taskStates.completed");case"failed":return t("mobile.taskStates.failed");case"disconnected":return t("mobile.taskStates.disconnected");case"closed":return t("mobile.taskStates.closed");default:return t("mobile.taskStates.idle")}}function Em(e){return e.current_command||e.title||e.session_id.slice(0,8)}function Br(e){const t=Em(e),n=t.split(/\s+/)[0]||t;return n.split("/").pop()||n}function Lm(e){const t=Em(e);return e.cwd?`${t} +${e.cwd}`:t}function TC(e){const t=(e??"").replace(/\/+$/,"");return t?t.split("/").pop()??"":""}function PC(e){return e.replace(/^[\s::;·•∙.∷⋮⋯\u2800-\u28ff]+/u,"").trim()}function Dm(e,t,n){if(!t)return"";const s=TC(n);if(!s)return"";const i=PC(e);return Br({current_command:t,title:"",session_id:""})!=="codex"?"":i===s?i:""}function EC(e){if(e.type!=="ai")return"";const t=(e.title??"").trim();if(!t)return"";const n=Dm(t,e.current_command,e.cwd);return n||t}function LC(e){const t=(e.title??"").trim();if(!t)return"";const n=Dm(t,e.current_command,e.cwd);if(n)return n;const s=Br(e);if(t===s)return"";const i=t.split("/").pop();return i&&i===s?"":t}function El(e){const t=LC(e);return t||Br(e)}function DC(e,t,n){const s=t==null?void 0:t[0];return(s==null?void 0:s.host)||e||n}function MC(e,t){var i;if(!t)return new Map;const n=[];for(const a of Object.keys(e)){const d=e[a];d&&d.length>0&&(((i=d[0])==null?void 0:i.host)??"")===t&&n.push(a)}if(n.length<2)return new Map;n.sort();const s=new Map;return n.forEach((a,d)=>s.set(a,d+1)),s}function AC(e,t,n,s){const i=DC(e,t,n);return s&&s>=1?`${i} #${s}`:i}const pa="application/x-atterm-session";function Ll(e){return!!e&&Array.prototype.includes.call(e,pa)}let Nu="";function Mm(e){Nu=e}function Am(){return Nu}function no(){Nu=""}function IC(e,t){if(!t)return null;for(const n of e){const s=n.panes.findIndex(i=>i.sessionId===t);if(s!==-1)return{pane:{...n.panes[s]},from:{tabId:n.id,paneIdx:s}}}return{pane:{sessionId:t,remote:!0}}}function Af(e,t){if(!t)return null;for(const n of e){const s=n.panes.findIndex(i=>i.sessionId===t);if(s!==-1)return n.panes.length<2?null:{tabId:n.id,paneIdx:s,pane:{...n.panes[s]}}}return null}function $C(e,t,n){const s=e.map(a=>({...a}));if(t===n||t<0||n<0||t>=s.length||n>=s.length)return s;const i=s[t];return s[t]=s[n],s[n]=i,s}const OC=["data-tab-id","title","onClick","onPointerdown"],FC={class:"num"},BC=["title"],HC={class:"title"},NC=["onClick"],zC=["aria-label","title","value"],UC={value:""},VC=["value"],KC=["disabled","title"],WC=["title"],jC=["title"],qC={key:0,class:"dot"},YC=4,Ja=40,If=8,GC=$e({__name:"TabBar",props:{tabs:{},currentId:{},starting:{type:Boolean},canNewLocal:{type:Boolean,default:!0},updateBadge:{type:Boolean,default:!1},isAdmin:{type:Boolean,default:!1},adminOpen:{type:Boolean,default:!1},profiles:{default:()=>[]},selectedProfileId:{default:""}},emits:["activate","close","new","new-ssh","reorder","open-settings","toggle-admin","detach-session","select-profile"],setup(e,{emit:t}){const n=t,s=H(null),i=H(null);let a=0,d=null;function r(E){var D;const R=E.target;return!!R&&!!((D=R.closest)!=null&&D.call(R,".close"))}function o(E,R){R.button===0&&(r(R)||(s.value={fromId:E,startX:R.clientX,active:!1,pointerId:R.pointerId,overId:null,position:null,hadDrag:!1}))}function c(E){if(!i.value)return null;const R=Array.from(i.value.querySelectorAll(".tab"));if(R.length===0)return null;for(const I of R){const O=I.getBoundingClientRect();if(E>=O.left&&E<=O.right){const U=(O.left+O.right)/2;return{id:I.dataset.tabId,position:E{D.stopPropagation(),D.preventDefault(),E.removeEventListener("click",R,!0)};E.addEventListener("click",R,!0),setTimeout(()=>E.removeEventListener("click",R,!0),0)}function m(E){const R=s.value;R&&(R.hadDrag&&!E&&g(),s.value=null,d!==null&&(cancelAnimationFrame(d),d=null))}function y(E){!s.value||E.pointerId!==s.value.pointerId||m(!1)}function v(E){!s.value||E.pointerId!==s.value.pointerId||m(!0)}Dt(()=>{window.addEventListener("pointermove",u),window.addEventListener("pointerup",y),window.addEventListener("pointercancel",v)}),Vt(()=>{window.removeEventListener("pointermove",u),window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",v),d!==null&&cancelAnimationFrame(d)});const{t:l}=$t();function h(E){if(!E)return l("terminal.emptyTab");if(E.cwd){const D=E.cwd.replace(/\/+$/,"");if(D==="")return"/";const I=D.split("/").pop();if(I)return I}const R=(E.command||"").split(/\s+/)[0]||l("terminal.shellFallback");return R.split("/").pop()||R}function f(E){if((E==null?void 0:E.unread)===!0)return{"--unread-c":km(E.task_state??"idle")}}function _(E){if(E){const R=EC({type:E.type,title:E.title,current_command:E.current_command,cwd:E.cwd});if(R)return R}return h(E)}function S(E){switch(E.layout){case"single":return"";case"vertical":return"▮▮";case"horizontal":return`▬ +▬`;case"grid2x2":return"▦"}}function k(E){switch(E.layout){case"single":return"";case"vertical":return l("terminal.layoutVertical");case"horizontal":return l("terminal.layoutHorizontal");case"grid2x2":return l("terminal.layoutGrid2x2")}}function P(E,R){E.stopPropagation(),n("close",R)}const M=H(!1);function w(E){var R;Ll((R=E.dataTransfer)==null?void 0:R.types)&&(E.preventDefault(),E.dataTransfer&&(E.dataTransfer.dropEffect="move"),M.value=!0)}function T(E){const R=E.relatedTarget;R&&E.currentTarget instanceof Node&&E.currentTarget.contains(R)||(M.value=!1)}function A(E){var D,I;if(M.value=!1,!Ll((D=E.dataTransfer)==null?void 0:D.types))return;E.preventDefault();const R=Am()||(((I=E.dataTransfer)==null?void 0:I.getData(pa))??"");R&&n("detach-session",R)}return(E,R)=>($(),F("div",{class:lt(["tabbar",{"drop-active":M.value}]),"data-test":"tabbar",onDragover:w,onDragleave:T,onDrop:A},[b("div",{class:"tabs",ref_key:"tabsEl",ref:i},[($(!0),F(Oe,null,at(E.tabs,(D,I)=>{var O,U,W,z,N,V,q,G;return $(),F("div",{key:D.id,"data-tab-id":D.id,class:lt(["tab",{active:D.id===E.currentId,unread:((O=D.activeSession)==null?void 0:O.unread)===!0,remote:D.activeRemote,disconnected:D.disconnected,dragging:((U=s.value)==null?void 0:U.active)&&((W=s.value)==null?void 0:W.fromId)===D.id}]),style:nn(f(D.activeSession)),title:(D.activeRemote?C(l)("terminal.remotePrefix"):"")+(D.disconnected?C(l)("terminal.tabDisconnectedSuffix")+" ":"")+(((z=D.activeSession)==null?void 0:z.command)??""),onClick:te=>n("activate",D.id),onPointerdown:te=>o(D.id,te)},[b("span",FC,L(I+1)+":",1),D.layout!=="single"?($(),F("span",{key:0,class:"layout-icon",title:k(D)},L(S(D)),9,BC)):D.activeRemote?($(),F("span",{key:1,class:lt(["dot remote-dot",{disconnected:D.disconnected}])},[Pe(ci,{state:((N=D.activeSession)==null?void 0:N.task_state)??"idle",unread:((V=D.activeSession)==null?void 0:V.unread)===!0,size:10},null,8,["state","unread"])],2)):($(),bt(ci,{key:2,state:((q=D.activeSession)==null?void 0:q.task_state)??"idle",unread:((G=D.activeSession)==null?void 0:G.unread)===!0,size:10},null,8,["state","unread"])),b("span",HC,L(_(D.activeSession)),1),b("button",{class:"close",onPointerdown:R[0]||(R[0]=ut(()=>{},["stop"])),onClick:te=>P(te,D.id)},"×",40,NC)],46,OC)}),128))],512),E.canNewLocal&&E.profiles.length>0?($(),F("select",{key:0,class:"profile-picker","data-test":"new-tab-profile","aria-label":C(l)("terminal.newTabProfileLabel"),title:C(l)("terminal.newTabProfileLabel"),value:E.selectedProfileId,onChange:R[1]||(R[1]=D=>n("select-profile",D.target.value)),onClick:R[2]||(R[2]=ut(()=>{},["stop"]))},[b("option",UC,L(C(l)("terminal.useDefaultProfile")),1),($(!0),F(Oe,null,at(E.profiles,D=>($(),F("option",{key:D.id,value:D.id},L(D.name),9,VC))),128))],40,zC)):Z("",!0),E.canNewLocal?($(),F("button",{key:1,class:"plus","data-test":"new-local-shell",disabled:E.starting,title:E.starting?C(l)("terminal.starting"):C(l)("terminal.newTab"),onClick:R[3]||(R[3]=D=>n("new"))},"+",8,KC)):Z("",!0),E.canNewLocal?($(),F("button",{key:2,class:"ssh-btn",type:"button","data-test":"new-ssh",title:"SSH hosts",onClick:R[4]||(R[4]=D=>n("new-ssh"))},[Pe(C(to),{size:14})])):Z("",!0),E.isAdmin?($(),F("button",{key:3,class:lt(["admin-btn",{active:E.adminOpen}]),type:"button","data-test":"admin-button",title:C(l)("terminal.adminPanel"),onClick:R[5]||(R[5]=D=>n("toggle-admin"))},[Pe(C(mw),{size:14})],10,WC)):Z("",!0),b("button",{class:"settings-btn",type:"button","data-test":"tabbar-settings",title:C(l)("terminal.relaySettings"),onClick:R[6]||(R[6]=D=>n("open-settings"))},[R[7]||(R[7]=b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),b("circle",{cx:"12",cy:"12",r:"3"})],-1)),E.updateBadge?($(),F("span",qC)):Z("",!0)],8,jC)],34))}}),XC=Ct(GC,[["__scopeId","data-v-e57c51b9"]]);let ra=null;function JC(e){if(ra)return ra;const t=e();return ra=t,t}function dn(){if(!ra)throw new Error("platform: call initPlatform() in main.ts before usePlatform()");return ra}const Dl=H(!1);let $f=!1;function QC(){$f||($f=!0,Promise.resolve().then(()=>{const t=dn().system.windowIsMaximized;return t?t():Promise.resolve(!1)}).then(e=>{Dl.value=!!e}).catch(()=>{Dl.value=!1}))}function zu(){return QC(),Dl}function Im(e){Dl.value=e}const ZC={class:"window-controls",style:{"--wails-draggable":"no-drag"}},ek=["aria-label"],tk=["aria-label"],nk={key:0,width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},sk={key:1,width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},ik=["aria-label"],rk=$e({__name:"WindowControls",setup(e){const t=dn(),{t:n}=$t(),s=zu(),i=j(()=>s.value?n("common.restore"):n("common.maximize"));function a(c){try{c()}catch(p){Lt("window","runtime call failed",{error:Rt(p)})}}function d(){a(()=>{var c,p;(p=(c=t.system).windowMinimize)==null||p.call(c)})}function r(){a(()=>{var c,p;(p=(c=t.system).windowToggleMaximize)==null||p.call(c),Im(!s.value)})}function o(){a(()=>{var c,p;(p=(c=t.system).quit)==null||p.call(c)})}return(c,p)=>($(),F("div",ZC,[b("button",{class:"wc-btn",type:"button","data-testid":"window-min","aria-label":C(n)("common.minimize"),onClick:d},p[0]||(p[0]=[b("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},[b("rect",{x:"1",y:"4.5",width:"8",height:"1",fill:"currentColor"})],-1)]),8,ek),b("button",{class:"wc-btn",type:"button","data-testid":"window-max","aria-label":i.value,onClick:r},[C(s)?($(),F("svg",sk,p[2]||(p[2]=[b("rect",{x:"1",y:"3",width:"6",height:"6",fill:"none",stroke:"currentColor"},null,-1),b("rect",{x:"3",y:"1",width:"6",height:"6",fill:"none",stroke:"currentColor"},null,-1)]))):($(),F("svg",nk,p[1]||(p[1]=[b("rect",{x:"1",y:"1",width:"8",height:"8",fill:"none",stroke:"currentColor"},null,-1)])))],8,tk),b("button",{class:"wc-btn wc-close",type:"button","data-testid":"window-close","aria-label":C(n)("common.close"),onClick:o},p[3]||(p[3]=[b("svg",{width:"10",height:"10",viewBox:"0 0 10 10","aria-hidden":"true"},[b("path",{d:"M1 1 L9 9 M9 1 L1 9",stroke:"currentColor","stroke-width":"1",fill:"none"})],-1)]),8,ik)]))}}),ok=Ct(rk,[["__scopeId","data-v-1ccfd0fb"]]),ak={state:"closed",rtt:{last_ms:null,p50_ms:null,p95_ms:null},rtt_samples:[],reconnect:{count_last_hour:0,last_at_ms:null,last_reason:"",history:[]},bytes:{in_per_sec:0,out_per_sec:0},seq_gaps:0};function lk(e={}){const t=H(ak);let n=null,s=!1;async function i(){try{t.value=await U1()}catch(d){Js("uplink","health poll failed; keeping last value",{error:Rt(d)})}}function a(){var r;if(n!==null&&clearTimeout(n),s)return;const d=(r=e.fast)!=null&&r.call(e)?1e3:5e3;n=setTimeout(async()=>{await i(),a()},d)}return Dt(()=>{i(),a()}),Vt(()=>{s=!0,n!==null&&clearTimeout(n)}),t}const ck=["aria-label"],dk={class:"text"},uk=$e({__name:"ConnHealthPill",props:{health:{},labels:{}},setup(e){const t=e,n=j(()=>{var a,d,r,o;return{connecting:((a=t.labels)==null?void 0:a.connecting)??"connecting…",reconnecting:((d=t.labels)==null?void 0:d.reconnecting)??"reconnecting…",off:((r=t.labels)==null?void 0:r.off)??"off",unknownMS:((o=t.labels)==null?void 0:o.unknownMS)??"—"}}),s=j(()=>{if(t.health.state==="reconnecting"||t.health.state==="connecting")return"band-reconnecting";if(t.health.state==="closed")return"band-off";const a=t.health.rtt.last_ms;return a===null||a<150?"band-green":a<500?"band-yellow":"band-red"}),i=j(()=>{if(t.health.state==="reconnecting")return n.value.reconnecting;if(t.health.state==="connecting")return n.value.connecting;if(t.health.state==="closed")return n.value.off;const a=t.health.rtt.last_ms;return a===null?n.value.unknownMS:`${a} ms`});return(a,d)=>($(),F("button",{class:lt(["conn-health-pill",s.value]),type:"button","aria-label":i.value},[d[0]||(d[0]=b("span",{class:"dot"},"●",-1)),b("span",dk,L(i.value),1)],10,ck))}}),hk=Ct(uk,[["__scopeId","data-v-5daa187a"]]),fk=["aria-label"],pk={class:"head"},vk=["aria-label"],gk={class:"rtt"},mk={class:"row"},_k={class:"metric-label"},yk={class:"metric-value"},bk={class:"row"},wk={class:"metric-label"},Sk={class:"metric-value"},Ck={width:"240",height:"60",class:"spark","aria-hidden":"true"},kk=["d"],xk={class:"bytes"},Rk={class:"row"},Tk={class:"metric-label"},Pk={class:"metric-value"},Ek={class:"row"},Lk={class:"metric-label"},Dk={class:"metric-value"},Mk={class:"recon"},Ak={class:"row"},Ik={class:"metric-label"},$k={class:"metric-value"},Ok={class:"row"},Fk={class:"metric-label"},Bk={class:"metric-value"},Hk={key:0,class:"reconn-table"},Nk={key:0,class:"gaps"},zk=$e({__name:"ConnHealthDrawer",props:{health:{},open:{type:Boolean},labels:{}},emits:["close"],setup(e){const t=e,n=j(()=>{var r,o,c,p,u,g,m,y,v,l,h,f;return{title:((r=t.labels)==null?void 0:r.title)??"Connection health",rttNow:((o=t.labels)==null?void 0:o.rttNow)??"RTT (now)",rttP50P95:((c=t.labels)==null?void 0:c.rttP50P95)??"p50 / p95 (5 min)",bytesIn:((p=t.labels)==null?void 0:p.bytesIn)??"↓ in",bytesOut:((u=t.labels)==null?void 0:u.bytesOut)??"↑ out",state:((g=t.labels)==null?void 0:g.state)??"State",reconnectsLastHour:((m=t.labels)==null?void 0:m.reconnectsLastHour)??"Reconnects (1 h)",reconnectsTime:((y=t.labels)==null?void 0:y.reconnectsTime)??"time",reconnectsReason:((v=t.labels)==null?void 0:v.reconnectsReason)??"reason",reconnectsDowntime:((l=t.labels)==null?void 0:l.reconnectsDowntime)??"downtime",seqGaps:((h=t.labels)==null?void 0:h.seqGaps)??"Seq gaps observed:",close:((f=t.labels)==null?void 0:f.close)??"Close"}}),s=j(()=>{const r=t.health.rtt_samples;if(r.length<2)return"";const o=240,c=60,p=4,u=h=>p+h/(r.length-1)*(o-2*p),g=r.map(h=>h.rtt_ms),m=Math.min(...g),y=Math.max(...g),v=Math.max(1,y-m),l=h=>p+(1-(h-m)/v)*(c-2*p);return r.map((h,f)=>`${f===0?"M":"L"} ${u(f).toFixed(1)} ${l(h.rtt_ms).toFixed(1)}`).join(" ")}),i=r=>`${(r/1024).toFixed(1)} KB/s`,a=r=>r<1e3?`${r} ms`:`${Math.round(r/1e3)} s`,d=r=>new Date(r).toLocaleTimeString();return(r,o)=>r.open?($(),F("aside",{key:0,class:"drawer",role:"dialog","aria-label":n.value.title},[b("header",pk,[b("span",null,L(n.value.title),1),b("button",{class:"close",type:"button","aria-label":n.value.close,onClick:o[0]||(o[0]=c=>r.$emit("close"))},"×",8,vk)]),b("section",gk,[b("div",mk,[b("span",_k,L(n.value.rttNow),1),b("span",yk,L(r.health.rtt.last_ms??"—")+" ms",1)]),b("div",bk,[b("span",wk,L(n.value.rttP50P95),1),b("span",Sk,L(r.health.rtt.p50_ms??"—")+" / "+L(r.health.rtt.p95_ms??"—")+" ms",1)]),($(),F("svg",Ck,[b("path",{d:s.value,fill:"none",stroke:"currentColor","stroke-width":"1.5"},null,8,kk)]))]),b("section",xk,[b("div",Rk,[b("span",Tk,L(n.value.bytesIn),1),b("span",Pk,L(i(r.health.bytes.in_per_sec)),1)]),b("div",Ek,[b("span",Lk,L(n.value.bytesOut),1),b("span",Dk,L(i(r.health.bytes.out_per_sec)),1)])]),b("section",Mk,[b("div",Ak,[b("span",Ik,L(n.value.state),1),b("span",$k,L(r.health.state),1)]),b("div",Ok,[b("span",Fk,L(n.value.reconnectsLastHour),1),b("span",Bk,L(r.health.reconnect.count_last_hour),1)]),r.health.reconnect.history.length>0?($(),F("table",Hk,[b("thead",null,[b("tr",null,[b("th",null,L(n.value.reconnectsTime),1),b("th",null,L(n.value.reconnectsReason),1),b("th",null,L(n.value.reconnectsDowntime),1)])]),b("tbody",null,[($(!0),F(Oe,null,at(r.health.reconnect.history,c=>($(),F("tr",{key:c.at_ms},[b("td",null,L(d(c.at_ms)),1),b("td",null,L(c.reason),1),b("td",null,L(a(c.duration_ms)),1)]))),128))])])):Z("",!0)]),r.health.seq_gaps>0?($(),F("section",Nk,L(n.value.seqGaps)+" "+L(r.health.seq_gaps),1)):Z("",!0)],8,fk)):Z("",!0)}}),Uk=Ct(zk,[["__scopeId","data-v-c8bb9e85"]]),Vk=["title"],Kk={class:"status"},Wk={key:1,class:"bad"},jk={key:0,class:"dim"},qk=["title"],Yk=1120,Gk=40,Xk=$e({__name:"TitleBar",props:{status:{},errorMsg:{},sessionCount:{},remoteEndpoint:{},currentTitle:{},currentTaskState:{}},setup(e){const t=dn(),{t:n}=$t(),s=H(!1),i=lk({fast:()=>s.value}),a=j(()=>({connecting:n("connHealth.pillLabelConnecting"),reconnecting:n("connHealth.pillLabelReconnecting"),off:n("connHealth.pillLabelOff")})),d=j(()=>({title:n("connHealth.drawerTitle"),rttNow:n("connHealth.drawerRttNow"),rttP50P95:n("connHealth.drawerRttP50P95"),bytesIn:n("connHealth.drawerBytesIn"),bytesOut:n("connHealth.drawerBytesOut"),state:n("connHealth.drawerState"),reconnectsLastHour:n("connHealth.drawerReconnectsLastHour"),reconnectsTime:n("connHealth.drawerReconnectsTime"),reconnectsReason:n("connHealth.drawerReconnectsReason"),reconnectsDowntime:n("connHealth.drawerReconnectsDowntime"),seqGaps:n("connHealth.drawerSeqGaps"),close:n("common.close")})),r=e,o=j(()=>r.currentTaskState==="running"),c=Pm(),p=j(()=>o.value?c.phase.value*Gk%Yk:0);let u=!1;yt(o,k=>{k&&!u?(u=!0,c.acquire()):!k&&u&&(u=!1,c.release())},{immediate:!0}),Vt(()=>{u&&(u=!1,c.release())});const g=H(!1),m=j(()=>n("titlebar.e2eeOffTitle")),y=j(()=>n("titlebar.e2eeOffChip"));Dt(async()=>{try{const k=await Pl();g.value=k.disable_e2ee??!1}catch{}}),t.events.on("e2ee-mode-changed",k=>{const P=k==null?void 0:k.disabled;typeof P=="boolean"&&(g.value=P)});const v=H("linux");Dt(async()=>{try{const k=await t.system.getEnvironment();if(k==null){Lt("titlebar","getEnvironment() returned null, falling back to linux");return}const P=(k.platform??"").toLowerCase();P==="darwin"||P==="windows"||P==="linux"?v.value=P:Lt("titlebar","unknown platform, falling back to linux",{platform:String(P)})}catch(k){Lt("titlebar","getEnvironment() failed, falling back to linux",{error:Rt(k)})}});const l=j(()=>({"padding-left":v.value==="darwin"?"80px":void 0,"--sweep-offset":o.value?`${p.value}px`:void 0})),h=j(()=>v.value!=="darwin"),f=zu(),_=j(()=>r.sessionCount===1?"terminal.sessionStatusOne":"terminal.sessionStatusMany");function S(){var k,P;(P=(k=t.system).windowToggleMaximize)==null||P.call(k),Im(!f.value)}return(k,P)=>($(),F("header",{class:lt(["titlebar",{"is-running":o.value}]),"data-testid":"titlebar-root",style:nn(l.value),onDblclick:ut(S,["self"])},[b("div",{class:"window-title","data-testid":"titlebar-current-title",title:k.currentTitle||"",onDblclick:ut(S,["self"])},L(k.currentTitle||""),41,Vk),b("div",Kk,[k.status==="loading"?($(),F(Oe,{key:0},[ot(L(C(n)("terminal.starting")),1)],64)):k.status==="error"?($(),F("span",Wk,L(k.errorMsg),1)):($(),F(Oe,{key:2},[ot(L(C(n)(_.value,{count:k.sessionCount}))+" ",1),k.remoteEndpoint?($(),F("span",jk," · "+L(C(n)("terminal.uplinkOn")),1)):Z("",!0)],64))]),g.value?($(),F("div",{key:0,class:"e2ee-off-chip",role:"status","data-testid":"titlebar-e2ee-off",title:m.value},[P[2]||(P[2]=b("span",{class:"chip-icon","aria-hidden":"true"},"⚠",-1)),b("span",null,L(y.value),1)],8,qk)):Z("",!0),k.remoteEndpoint?($(),bt(hk,{key:1,health:C(i),labels:a.value,class:"titlebar-conn-pill","data-testid":"titlebar-conn-health-pill",onClick:P[0]||(P[0]=M=>s.value=!s.value)},null,8,["health","labels"])):Z("",!0),k.remoteEndpoint?($(),bt(Uk,{key:2,health:C(i),open:s.value,labels:d.value,onClose:P[1]||(P[1]=M=>s.value=!1)},null,8,["health","open","labels"])):Z("",!0),h.value?($(),bt(ok,{key:3})):Z("",!0)],38))}}),Jk=Ct(Xk,[["__scopeId","data-v-2cf685eb"]]);function $m(e,t,n){if(!e||!Number.isFinite(e)||e<=0)return null;if(t==="running")return{text:"live",live:!0,title:"Output active"};const s=n-e*1e3,i=Math.max(0,s),a=Math.floor(i/1e3);if(a<60)return{text:"now",live:!1,title:"Last output just now"};if(a<60*60){const r=`${Math.floor(a/60)}m`;return{text:r,live:!1,title:`Last output ${r} ago`}}if(a<24*60*60){const r=`${Math.floor(a/3600)}h`;return{text:r,live:!1,title:`Last output ${r} ago`}}const d=`${Math.floor(a/(24*60*60))}d`;return{text:d,live:!1,title:`Last output ${d} ago`}}const Qk=["title","aria-label"],Zk=$e({__name:"LastOutputIndicator",props:{lastOutputAt:{},taskState:{},nowMs:{}},setup(e){const t=e,n=j(()=>$m(t.lastOutputAt,t.taskState,t.nowMs));return(s,i)=>n.value?($(),F("span",{key:0,class:lt(["last-output",{live:n.value.live}]),title:n.value.title,"aria-label":n.value.title,"data-test":"last-output"},[i[0]||(i[0]=b("svg",{class:"last-output-clock",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round","aria-hidden":"true"},[b("circle",{cx:"6",cy:"6",r:"4.5"}),b("path",{d:"M6 3.3v3l2 1.2"})],-1)),b("span",null,L(n.value.text),1)],10,Qk)):Z("",!0)}}),Om=Ct(Zk,[["__scopeId","data-v-ea632618"]]);function Ml(e,t){if(!e)return"";let n=e;if(t){if(n===t)return"~";n.startsWith(t+"/")&&(n="~"+n.slice(t.length))}const a=(n.startsWith("~/")?n.slice(2):n.replace(/^\//,"")).split("/").filter(Boolean);return a.length<=2?n:"…/"+a.slice(-2).join("/")}const ex={class:"row-main"},tx={class:"row-top"},nx={key:0,class:"state-label","data-test":"state-label"},sx=["title"],ix={class:"cmd"},rx={key:0,class:"row-meta","data-test":"row-meta"},ox={class:"cwd","data-test":"row-cwd"},ax={key:0,class:"kind","data-test":"row-kind"},lx=["title","aria-label"],cx=$e({__name:"TaskRowInner",props:{session:{},showStateLabel:{type:Boolean,default:!1},home:{default:""},showClose:{type:Boolean,default:!1},nowMs:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=j(()=>Ml(n.session.cwd,n.home));j(()=>$m(n.session.last_output_at,n.session.task_state,n.nowMs)!==null);const d=j(()=>n.session.type==="ai"?Br(n.session):"");function r(o){return Hu(o,i)}return(o,c)=>($(),F(Oe,null,[b("span",ex,[b("span",tx,[Pe(ci,{state:n.session.task_state??"idle",unread:n.session.unread===!0},null,8,["state","unread"]),o.showStateLabel?($(),F("span",nx,L(r(n.session.task_state)),1)):Z("",!0),b("span",{class:"cmd-and-cwd",title:C(Lm)(n.session)},[b("span",ix,L(C(El)(n.session)),1)],8,sx)]),a.value?($(),F("span",rx,[b("span",ox,L(a.value),1)])):Z("",!0)]),b("span",{class:lt(["row-tail",{"time-only":!d.value}]),"data-test":"row-tail"},[d.value?($(),F("span",ax,L(d.value),1)):Z("",!0),Pe(Om,{"last-output-at":n.session.last_output_at,"task-state":n.session.task_state,"now-ms":n.nowMs},null,8,["last-output-at","task-state","now-ms"])],2),n.showClose?($(),F("span",{key:0,class:"row-close","data-test":"row-close",role:"button",tabindex:"0",title:C(i)("common.close"),"aria-label":C(i)("common.close"),onClick:c[0]||(c[0]=ut(p=>s("close"),["stop"])),onKeydown:[c[1]||(c[1]=Xn(ut(p=>s("close"),["stop","prevent"]),["enter"])),c[2]||(c[2]=Xn(ut(p=>s("close"),["stop","prevent"]),["space"]))]}," × ",40,lx)):Z("",!0)],64))}}),Of=Ct(cx,[["__scopeId","data-v-81d1a3d4"]]),dx=["data-test"],ux=["data-test","disabled","onClick"],hx=$e({__name:"SessionRowMenu",props:{open:{type:Boolean,default:!1},x:{},y:{},items:{}},emits:["close","select"],setup(e,{emit:t}){const n=e,s=t,i=H(null),a=H(0),d=H(0);function r(){if(!i.value){a.value=n.x,d.value=n.y;return}const m=i.value.getBoundingClientRect(),y=window.innerWidth,v=window.innerHeight;a.value=n.x+m.width>y?Math.max(0,n.x-m.width):n.x,d.value=n.y+m.height>v?Math.max(0,n.y-m.height):n.y}const o=j(()=>({left:a.value+"px",top:d.value+"px"}));function c(m){m.disabled||(s("select",m.key),s("close"))}function p(m){m.key==="Escape"&&s("close")}function u(m){i.value&&(i.value.contains(m.target)||s("close"))}function g(m){if(!i.value)return;const y=m.relatedTarget;(!y||!i.value.contains(y))&&s("close")}return yt(()=>n.open,m=>{m?(a.value=n.x,d.value=n.y,requestAnimationFrame(r),window.addEventListener("keydown",p),window.addEventListener("mousedown",u)):(window.removeEventListener("keydown",p),window.removeEventListener("mousedown",u))},{immediate:!0}),Dt(()=>{n.open&&requestAnimationFrame(r)}),Vt(()=>{window.removeEventListener("keydown",p),window.removeEventListener("mousedown",u)}),(m,y)=>m.open?($(),F("div",{key:0,ref_key:"menuRef",ref:i,class:"session-row-menu","data-test":"session-row-menu",role:"menu",style:nn(o.value),onFocusoutCapture:g,onContextmenu:y[0]||(y[0]=ut(()=>{},["prevent"]))},[($(!0),F(Oe,null,at(m.items,v=>($(),F(Oe,{key:v.key},[v.separatorBefore?($(),F("div",{key:0,class:"menu-separator","data-test":`session-row-menu-separator-${v.key}`,role:"separator"},null,8,dx)):Z("",!0),b("button",{class:lt(["menu-item",{disabled:v.disabled}]),"data-test":`session-row-menu-item-${v.key}`,role:"menuitem",type:"button",disabled:v.disabled,onClick:ut(l=>c(v),["stop"])},L(v.label),11,ux)],64))),128))],36)):Z("",!0)}}),Fm=Ct(hx,[["__scopeId","data-v-f6b9c7cb"]]),gs=H(new Set);let Ff=!1,Go=null,Pr=null,Bf=!1;const fx=300;async function Uu(){try{const e=await dn().sessions.getPins();gs.value=new Set(e)}catch{}}async function Hf(){if(!Ff)return Go||(Go=(async()=>{try{await Uu()}finally{Ff=!0,Go=null}})(),Go)}function Vu(){Pr&&clearTimeout(Pr),Pr=setTimeout(()=>{Pr=null,dn().sessions.setPins(Array.from(gs.value)).catch(e=>{Lt("pins","schedulePersist failed",{error:Rt(e)})})},fx)}function px(){Bf||(Bf=!0,dn().events.on("prefs:changed",()=>{Uu()}))}function Nf(e){if(!e||gs.value.has(e))return;const t=new Set(gs.value);t.add(e),gs.value=t,Vu()}function zf(e){if(!gs.value.has(e))return;const t=new Set(gs.value);t.delete(e),gs.value=t,Vu()}function vx(e,t){if(!e||!t||e===t||!gs.value.has(e))return;const n=new Set(gs.value);n.delete(e),n.add(t),gs.value=n,Vu()}async function gx(){Pr&&(clearTimeout(Pr),Pr=null);try{await dn().sessions.setPins(Array.from(gs.value))}catch(e){Lt("pins","flushNow persist failed",{error:Rt(e)})}}function Ku(){return Hf(),px(),{pinnedIds:gs,isPinned:e=>gs.value.has(e),pin:Nf,unpin:zf,toggle:e=>gs.value.has(e)?zf(e):Nf(e),rename:vx,flushNow:gx,ready:()=>Hf(),reload:()=>Uu()}}const mx=["aria-label"],_x={class:"popover-title"},yx={class:"rows"},bx=["data-test"],wx={class:"label"},Sx=["title"],Cx=["title","aria-label","onClick"],kx=$e({__name:"SessionDetailsPopover",props:{open:{type:Boolean,default:!1},x:{},y:{},session:{},paneLocation:{},tabIndexById:{}},emits:["close"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=Ku(),d=H(null),r=H(0),o=H(0);function c(){if(!d.value){r.value=n.x,o.value=n.y;return}const f=d.value.getBoundingClientRect(),_=window.innerWidth,S=window.innerHeight;r.value=n.x+f.width>_?Math.max(0,n.x-f.width):n.x,o.value=n.y+f.height>S?Math.max(0,n.y-f.height):n.y}const p=j(()=>({left:r.value+"px",top:o.value+"px"}));function u(f){return f?new Date(f*1e3).toISOString().replace("T"," ").replace(/\.\d+Z$/,"Z"):""}function g(f){if(f==null)return"";if(f<1e3)return`${f}ms`;const _=f/1e3;if(_<60)return`${_.toFixed(1)}s`;const S=Math.floor(_/60),k=Math.round(_-S*60);return`${S}m${k}s`}async function m(f){try{await navigator.clipboard.writeText(f)}catch{}}const y=j(()=>{const f=n.session;if(!f)return[];const _=[];_.push({key:"sessionId",label:i("tasks.details.sessionId"),value:f.session_id,copy:!0}),f.type&&_.push({key:"type",label:i("tasks.details.type"),value:f.type});const S=[f.user,f.host].filter(Boolean).join("@");(S||f.host_id)&&_.push({key:"host",label:i("tasks.details.host"),value:S||f.host_id,copy:!0}),f.cwd&&_.push({key:"cwd",label:i("tasks.details.cwd"),value:f.cwd,copy:!0});const k=f.current_command||f.title;k&&_.push({key:"command",label:i("tasks.details.command"),value:k,copy:!0}),f.task_state&&_.push({key:"state",label:i("tasks.details.state"),value:Hu(f.task_state,i)}),f.started_at&&_.push({key:"startedAt",label:i("tasks.details.startedAt"),value:u(f.started_at)}),f.command_started_at&&_.push({key:"commandStartedAt",label:i("tasks.details.commandStartedAt"),value:u(f.command_started_at)}),f.command_ended_at&&_.push({key:"commandEndedAt",label:i("tasks.details.commandEndedAt"),value:u(f.command_ended_at)});const P=g(f.command_duration_ms);P&&_.push({key:"commandDuration",label:i("tasks.details.commandDuration"),value:P}),typeof f.command_exit_code=="number"&&_.push({key:"commandExitCode",label:i("tasks.details.commandExitCode"),value:String(f.command_exit_code)}),_.push({key:"unread",label:i("tasks.details.unread"),value:f.unread?i("common.yes"):i("common.no")}),_.push({key:"pinned",label:i("tasks.details.pinned"),value:a.isPinned(f.session_id)?i("common.yes"):i("common.no")});const M=n.paneLocation,w=M?i("tasks.details.paneAt",{tab:n.tabIndexById(M.tabId),pane:M.paneIdx+1}):i("tasks.details.paneNone");return _.push({key:"paneLocation",label:i("tasks.details.paneLocation"),value:w}),_});function v(f){f.key==="Escape"&&s("close")}function l(f){d.value&&(d.value.contains(f.target)||s("close"))}function h(f){if(!d.value)return;const _=f.relatedTarget;(!_||!d.value.contains(_))&&s("close")}return yt(()=>n.open,f=>{f?(r.value=n.x,o.value=n.y,requestAnimationFrame(c),window.addEventListener("keydown",v),window.addEventListener("mousedown",l)):(window.removeEventListener("keydown",v),window.removeEventListener("mousedown",l))},{immediate:!0}),Dt(()=>{n.open&&requestAnimationFrame(c)}),Vt(()=>{window.removeEventListener("keydown",v),window.removeEventListener("mousedown",l)}),(f,_)=>f.open&&f.session?($(),F("div",{key:0,ref_key:"popoverRef",ref:d,class:"session-details-popover","data-test":"session-details-popover",role:"dialog","aria-label":C(i)("tasks.details.title"),tabindex:"-1",style:nn(p.value),onFocusoutCapture:h,onContextmenu:_[0]||(_[0]=ut(()=>{},["prevent"]))},[b("div",_x,L(C(i)("tasks.details.title")),1),b("div",yx,[($(!0),F(Oe,null,at(y.value,S=>($(),F("div",{key:S.key,class:"row","data-test":`details-field-${S.key}`},[b("span",wx,L(S.label),1),b("span",{class:"value",title:S.value},L(S.value),9,Sx),S.copy?($(),F("button",{key:0,class:"copy",type:"button",title:C(i)("common.copy"),"aria-label":C(i)("common.copy"),onClick:ut(k=>m(S.value),["stop"])},"⧉",8,Cx)):Z("",!0)],8,bx))),128))])],44,mx)):Z("",!0)}}),xx=Ct(kx,[["__scopeId","data-v-9528360b"]]),si=H(new Set),wr=H(null);function Wu(){const e=j(()=>si.value.size);function t(d){return si.value.has(d)}function n(d){const r=new Set(si.value);r.has(d)?r.delete(d):r.add(d),si.value=r,wr.value=d}function s(d){si.value=new Set([d]),wr.value=d}function i(d,r){if(!wr.value)return n(d);const o=r.indexOf(wr.value),c=r.indexOf(d);if(o<0||c<0)return n(d);const[p,u]=o0?Math.floor(t/Rx):0}function Bm(e,t){const n=Uf(t)-Uf(e);if(n!==0)return n;const s=Vf(t)-Vf(e);return s!==0?s:(e.session_id??"").localeCompare(t.session_id??"")}function Al(e,t){const n=mo(e.task_state)-mo(t.task_state);if(n!==0)return n;const s=(e.unread?0:1)-(t.unread?0:1);return s!==0?s:Bm(e,t)}function Tx(e,t){return Bm(e,t)}const Px={class:"task-grouped-list"},Ex=["aria-expanded"],Lx={class:"caret","aria-hidden":"true"},Dx={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor"},Mx={key:0,d:"M3 1 L7 5 L3 9 Z"},Ax={key:1,d:"M1 3 L9 3 L5 8 Z"},Ix={class:"group-title"},$x={class:"group-count"},Ox=["data-session-id","data-active","data-selected","onClick","onContextmenu","onPointerdown","onDragstart"],Fx=["data-test"],Bx=["aria-expanded","onClick","onKeydown"],Hx={class:"caret","aria-hidden":"true"},Nx={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor"},zx={key:0,d:"M3 1 L7 5 L3 9 Z"},Ux={key:1,d:"M1 3 L9 3 L5 8 Z"},Vx={class:"host-name"},Kx={key:0,class:"local-chip","data-test":"local-chip"},Wx={class:"counts"},jx={class:"count"},qx={key:1,class:"unread-badge"},Yx=["title","aria-label","onClick"],Gx=["data-session-id","data-active","data-selected","onClick","onContextmenu","onPointerdown","onDragstart"],Xx={key:1,class:"empty-hint","data-test":"search-empty"},Jx={key:2,class:"completed-fold"},Qx={width:"10",height:"10",viewBox:"0 0 10 10",fill:"currentColor","aria-hidden":"true"},Zx={key:0,d:"M1 3 L9 3 L5 8 Z"},e2={key:1,d:"M3 1 L7 5 L3 9 Z"},t2=["data-active","data-selected","onClick","onContextmenu","onPointerdown"],n2={class:"row-main"},s2={class:"row-top"},i2={key:0,class:"state-label","data-test":"state-label"},r2=["title"],o2={class:"cmd"},a2={key:0,class:"row-meta","data-test":"row-meta"},l2={class:"cwd"},c2={key:0,class:"kind","data-test":"row-kind"},d2=["title","aria-label","onClick"],Sr="__pinned__",u2=1e3,Kf=10,h2=$e({__name:"TaskGroupedList",props:{byHost:{},primaryStateForHost:{},completedSeen:{},groupBy:{default:"host"},byState:{default:()=>({})},activeSessionId:{default:null},localHostId:{default:""},localHost:{default:""},openSessionIds:{default:()=>[]},searchQuery:{default:""},paneLocationFor:{type:Function,default:()=>null},tabIndexById:{type:Function,default:()=>0},canDetachSession:{type:Function,default:()=>!1}},emits:["open","close","markSeen","merge-selected","close-selected","detach-session"],setup(e,{emit:t}){const n=Bu(),s=j(()=>n.active.value.showLabel),i=e,a=t,{t:d}=$t(),r=Wu(),o=vl,c=Ku(),p=j(()=>i.searchQuery.trim().toLocaleLowerCase()),u=j(()=>new Set(i.openSessionIds)),g=j(()=>i.groupBy==="state"?i.byState:i.byHost),m=j(()=>{const re={};for(const[we,fe]of Object.entries(g.value))re[we]=fe.filter(De=>!c.isPinned(De.session_id)&&Vc(De,p.value));return re}),y=j(()=>{if(i.groupBy==="state")return o.filter(fe=>(m.value[fe]??[]).length>0);const re=Object.keys(g.value).sort().filter(fe=>(m.value[fe]??[]).length>0);if(!i.localHostId)return re;const we=re.indexOf(i.localHostId);return we<=0?re:[i.localHostId,...re.slice(0,we),...re.slice(we+1)]}),v=H(!1),l=H(new Set);function h(re){return p.value?!1:l.value.has(re)}function f(re){const we=new Set(l.value);we.has(re)?we.delete(re):we.add(re),l.value=we}const _=H(""),S=H(Date.now());let k=null;Dt(async()=>{k=window.setInterval(()=>{S.value=Date.now()},1e3);try{_.value=await Fu()}catch{}}),Vt(()=>{k!==null&&window.clearInterval(k)});const P=j(()=>{const re=[],we=new Set,fe=i.groupBy==="state"?i.byState??{}:i.byHost??{};for(const De of Object.values(fe))for(const Qe of De)we.has(Qe.session_id)||c.isPinned(Qe.session_id)&&Vc(Qe,p.value)&&(we.add(Qe.session_id),re.push(Qe));return re.sort(Al),re}),M=j(()=>i.completedSeen.filter(re=>Vc(re,p.value))),w=j(()=>P.value.length>0||y.value.length>0||M.value.length>0),T=j(()=>{const re=[];if(!h(Sr))for(const we of P.value)re.push(we.session_id);for(const we of y.value)if(!h(we))for(const fe of m.value[we]??[])re.push(fe.session_id);if(v.value)for(const we of M.value)re.push(we.session_id);return re});function A(re,we){if(U===we.session_id){U="",re.preventDefault();return}if(re.shiftKey){r.selectRange(we.session_id,T.value);return}if(re.metaKey||re.ctrlKey){r.toggle(we.session_id);return}r.clear(),a("open",we)}const E=H({open:!1,x:0,y:0,session:null});function R(re,we,fe){E.value={open:!0,x:re,y:we,session:fe}}function D(re,we){re.preventDefault(),R(re.clientX,re.clientY,we)}let I=null,O=null,U="";function W(){I&&(clearTimeout(I),I=null),O=null}function z(re,we){re.pointerType==="mouse"||re.button!==0||(W(),O={x:re.clientX,y:re.clientY,sessionId:we.session_id},I=setTimeout(()=>{I=null,U=we.session_id,R(re.clientX,re.clientY,we)},u2))}function N(re){if(!O)return;const we=Math.abs(re.clientX-O.x),fe=Math.abs(re.clientY-O.y);(we>Kf||fe>Kf)&&W()}function V(){W()}function q(re,we){Mm(we.session_id),re.dataTransfer&&(re.dataTransfer.setData(pa,we.session_id),re.dataTransfer.effectAllowed="move")}function G(){no()}Vt(W);function te(){E.value={...E.value,open:!1,session:null}}const oe=j(()=>{const re=E.value.session;if(!re)return[];const we=r.size.value;if(we>=2&&r.isSelected(re.session_id)){const Qe=Array.from(r.selectedIds.value).filter(We=>u.value.has(We)).length;return[{key:"merge",label:d("tasks.rowMenu.merge",{n:we}),disabled:we>4},{key:"close",label:d("tasks.rowMenu.closeSelected",{n:Qe}),disabled:Qe===0},{key:c.isPinned(re.session_id)?"unpin":"pin",label:c.isPinned(re.session_id)?d("tasks.pinned.menuUnpin"):d("tasks.pinned.menuPin")},{key:"details",label:d("tasks.rowMenu.details"),disabled:!0}]}const De=[{key:c.isPinned(re.session_id)?"unpin":"pin",label:c.isPinned(re.session_id)?d("tasks.pinned.menuUnpin"):d("tasks.pinned.menuPin")}];return De.push({key:"details",label:d("tasks.rowMenu.details")}),i.canDetachSession(re.session_id)&&De.push({key:"detach",label:d("terminal.detachToTab")}),De}),ie=H({open:!1,x:0,y:0,session:null});function ye(re){const we=E.value.session;we&&(re==="pin"||re==="unpin"?c.toggle(we.session_id):re==="details"?ie.value={open:!0,x:E.value.x,y:E.value.y,session:we}:re==="merge"?a("merge-selected"):re==="close"?a("close-selected"):re==="detach"&&a("detach-session",we.session_id))}function K(){ie.value={...ie.value,open:!1,session:null}}const J=j(()=>MC(i.byHost,i.localHost??""));function Q(re){return AC(re,g.value[re],d("sessions.unknownHost"),J.value.get(re))}function ce(re){return i.groupBy==="state"?et(re):Q(re)}function Fe(re){if(i.groupBy==="state")return re;const we=m.value[re]??[];let fe=we[0];for(const De of we)mo(De.task_state)we.unread).map(we=>we.session_id)}function Ze(re){a("markSeen",{ids:Ye(re)})}function ue(){a("markSeen",{ids:i.completedSeen.map(re=>re.session_id)})}function et(re){return Hu(re,d)}return(re,we)=>($(),F("div",Px,[P.value.length>0?($(),F(Oe,{key:0},[b("div",{class:"group-header pinned-group","data-test":"pinned-group-header",role:"button",tabindex:"0","aria-expanded":!h(Sr),onClick:we[0]||(we[0]=fe=>f(Sr)),onKeydown:[we[1]||(we[1]=Xn(ut(fe=>f(Sr),["prevent"]),["enter"])),we[2]||(we[2]=Xn(ut(fe=>f(Sr),["prevent"]),["space"]))]},[b("span",Lx,[($(),F("svg",Dx,[h(Sr)?($(),F("path",Mx)):($(),F("path",Ax))]))]),we[7]||(we[7]=b("span",{class:"pin-icon","aria-hidden":"true"},[b("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"currentColor","aria-hidden":"true"},[b("path",{d:"M4 2 h8 v12 l-4 -3 l-4 3 z"})])],-1)),b("span",Ix,L(C(d)("tasks.pinned.title")),1),b("span",$x,L(P.value.length),1)],40,Ex),h(Sr)?Z("",!0):($(!0),F(Oe,{key:0},at(P.value,fe=>($(),F("button",{key:fe.session_id,class:lt(["task-row",{active:fe.session_id===re.activeSessionId,selected:C(r).isSelected(fe.session_id),unread:fe.unread===!0}]),style:nn(Ee(fe)),"data-test":"task-row","data-session-id":fe.session_id,"data-active":fe.session_id===re.activeSessionId?"true":void 0,"data-selected":C(r).isSelected(fe.session_id)?"true":void 0,onClick:De=>A(De,fe),onContextmenu:De=>D(De,fe),onPointerdown:De=>z(De,fe),onPointermove:we[3]||(we[3]=De=>N(De)),onPointerup:V,onPointercancel:V,onPointerleave:V,draggable:"true",onDragstart:De=>q(De,fe),onDragend:G},[Pe(Of,{session:fe,"show-state-label":s.value,home:_.value,"show-close":u.value.has(fe.session_id),"now-ms":S.value,onClose:De=>a("close",fe)},null,8,["session","show-state-label","home","show-close","now-ms","onClose"])],46,Ox))),128))],64)):Z("",!0),($(!0),F(Oe,null,at(y.value,fe=>($(),F(Oe,{key:fe},[(m.value[fe]??[]).length>0?($(),F("section",{key:0,class:"host-group","data-test":`host-group-${fe}`},[b("header",{class:"host-header","data-test":"host-header",role:"button",tabindex:"0","aria-expanded":!h(fe),onClick:De=>f(fe),onKeydown:[Xn(ut(De=>f(fe),["prevent"]),["enter"]),Xn(ut(De=>f(fe),["prevent"]),["space"])]},[b("span",Hx,[($(),F("svg",Nx,[h(fe)?($(),F("path",zx)):($(),F("path",Ux))]))]),b("span",Vx,L(ce(fe)),1),re.groupBy==="host"&&re.localHostId&&fe===re.localHostId?($(),F("span",Kx,L(C(d)("sessions.thisMachine")),1)):Z("",!0),b("span",Wx,[Pe(ci,{state:Fe(fe),size:10},null,8,["state"]),b("span",jx,L((m.value[fe]??[]).length),1)]),Ye(fe).length>0?($(),F("span",qx,L(C(d)("tasks.unreadBadge",{count:Ye(fe).length})),1)):Z("",!0),Ye(fe).length>0?($(),F("button",{key:2,class:"mark-all","data-test":"host-mark-all",title:C(d)("tasks.markAllRead"),"aria-label":C(d)("tasks.markAllRead"),onClick:ut(De=>Ze(fe),["stop"])},we[8]||(we[8]=[b("svg",{width:"12",height:"12",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("path",{d:"M3 8 l3 3 l7 -7"})],-1)]),8,Yx)):Z("",!0)],40,Bx),($(!0),F(Oe,null,at(h(fe)?[]:m.value[fe],De=>($(),F("button",{key:De.session_id,class:lt(["task-row",{active:De.session_id===re.activeSessionId,selected:C(r).isSelected(De.session_id),unread:De.unread===!0}]),style:nn(Ee(De)),"data-test":"task-row","data-session-id":De.session_id,"data-active":De.session_id===re.activeSessionId?"true":void 0,"data-selected":C(r).isSelected(De.session_id)?"true":void 0,onClick:Qe=>A(Qe,De),onContextmenu:Qe=>D(Qe,De),onPointerdown:Qe=>z(Qe,De),onPointermove:we[4]||(we[4]=Qe=>N(Qe)),onPointerup:V,onPointercancel:V,onPointerleave:V,draggable:"true",onDragstart:Qe=>q(Qe,De),onDragend:G},[Pe(Of,{session:De,"show-state-label":s.value,home:_.value,"show-close":u.value.has(De.session_id),"now-ms":S.value,onClose:Qe=>a("close",De)},null,8,["session","show-state-label","home","show-close","now-ms","onClose"])],46,Gx))),128))],8,Fx)):Z("",!0)],64))),128)),p.value&&!w.value?($(),F("div",Xx,L(C(d)("tasks.search.empty",{q:i.searchQuery})),1)):Z("",!0),M.value.length>0?($(),F("section",Jx,[b("button",{class:"fold-toggle","data-test":"completed-fold-toggle",onClick:we[5]||(we[5]=fe=>v.value=!v.value)},[($(),F("svg",Qx,[v.value?($(),F("path",Zx)):($(),F("path",e2))])),ot(" "+L(C(d)("tasks.completedFold"))+" ("+L(M.value.length)+") ",1)]),v.value?($(),F(Oe,{key:0},[($(!0),F(Oe,null,at(M.value,fe=>($(),F("div",{key:fe.session_id,class:lt(["task-row dim",{active:fe.session_id===re.activeSessionId,selected:C(r).isSelected(fe.session_id),unread:fe.unread===!0}]),style:nn(Ee(fe)),"data-test":"completed-fold-row","data-active":fe.session_id===re.activeSessionId?"true":void 0,"data-selected":C(r).isSelected(fe.session_id)?"true":void 0,onClick:De=>A(De,fe),onContextmenu:De=>D(De,fe),onPointerdown:De=>z(De,fe),onPointermove:we[6]||(we[6]=De=>N(De)),onPointerup:V,onPointercancel:V,onPointerleave:V},[b("span",n2,[b("span",s2,[Pe(ci,{state:fe.task_state??"idle",unread:fe.unread===!0},null,8,["state","unread"]),s.value?($(),F("span",i2,L(et(fe.task_state)),1)):Z("",!0),b("span",{class:"cmd-and-cwd",title:C(Lm)(fe)},[b("span",o2,L(C(El)(fe)),1)],8,r2)]),C(Ml)(fe.cwd,_.value)?($(),F("span",a2,[b("span",l2,L(C(Ml)(fe.cwd,_.value)),1)])):Z("",!0)]),b("span",{class:lt(["row-tail",{"time-only":fe.type!=="ai"}]),"data-test":"row-tail"},[fe.type==="ai"?($(),F("span",c2,L(C(Br)(fe)),1)):Z("",!0),Pe(Om,{"last-output-at":fe.last_output_at,"task-state":fe.task_state,"now-ms":S.value},null,8,["last-output-at","task-state","now-ms"])],2),u.value.has(fe.session_id)?($(),F("button",{key:0,class:"row-close completed-row-close","data-test":"row-close",title:C(d)("common.close"),"aria-label":C(d)("common.close"),onClick:ut(De=>a("close",fe),["stop"])}," × ",8,d2)):Z("",!0)],46,t2))),128)),b("button",{class:"fold-mark-all","data-test":"fold-mark-all",onClick:ue},L(C(d)("tasks.markAllRead")),1)],64)):Z("",!0)])):Z("",!0),Pe(Fm,{open:E.value.open,x:E.value.x,y:E.value.y,items:oe.value,onClose:te,onSelect:ye},null,8,["open","x","y","items"]),Pe(xx,{open:ie.value.open,x:ie.value.x,y:ie.value.y,session:ie.value.session,"pane-location":ie.value.session?re.paneLocationFor(ie.value.session.session_id):null,"tab-index-by-id":re.tabIndexById,onClose:K},null,8,["open","x","y","session","pane-location","tab-index-by-id"])]))}}),f2=Ct(h2,[["__scopeId","data-v-42b39ad3"]]),p2={class:"bulk-bar","data-test":"bulk-action-bar",role:"toolbar"},v2={class:"counter","data-test":"bulk-selected-count"},g2=["disabled","title"],m2=["disabled","title"],_2=["title"],y2=$e({__name:"BulkActionBar",props:{count:{},openCount:{},canMerge:{type:Boolean}},emits:["merge","close-selected","clear"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=j(()=>n.count>4?i("tasks.bulk.mergeTooMany"):i("tasks.bulk.mergeTab")),d=j(()=>n.openCount===0?i("tasks.bulk.closeNoneOpen"):i("tasks.bulk.closeHint",{count:n.openCount}));function r(){n.canMerge&&s("merge")}function o(){n.openCount!==0&&s("close-selected")}function c(){s("clear")}return(p,u)=>($(),F("div",p2,[b("span",v2,L(C(i)("tasks.bulk.selectedCount",{count:p.count})),1),b("button",{class:"btn primary","data-test":"bulk-merge",type:"button",disabled:!p.canMerge,title:a.value,onClick:r},L(C(i)("tasks.bulk.mergeTab"))+" ("+L(p.count)+") ",9,g2),b("button",{class:"btn","data-test":"bulk-close",type:"button",disabled:p.openCount===0,title:d.value,onClick:o},L(C(i)("tasks.bulk.close",{count:p.openCount})),9,m2),b("button",{class:"btn ghost","data-test":"bulk-clear",type:"button",title:C(i)("tasks.bulk.cancel"),onClick:c},L(C(i)("tasks.bulk.cancel")),9,_2)]))}}),b2=Ct(y2,[["__scopeId","data-v-c912fe83"]]);function w2(e){return e==="host"||e==="state"}const Kc=xm({defaultValue:"host",storageKey:"taskGroupBy",load:()=>bS(),save:e=>wS(e),isValid:w2});function Hm(){return Kc.ensureLoaded(),{activeId:Kc.activeId,setGroupBy:Kc.set}}const S2={class:"task-sidebar-shell"},C2=["aria-label"],k2={key:1,class:"rail","data-test":"sidebar-rail"},x2=["title","aria-label"],R2={key:0,class:"rail-badge","data-test":"sidebar-rail-badge"},T2=["aria-label","onClick","onKeydown"],P2={key:2,class:"expanded"},E2={class:"sidebar-header"},L2={key:0,class:"title"},D2=["title","aria-label"],M2=["placeholder","aria-label","onKeydown"],A2=["title"],I2=["title","aria-label"],$2={class:"list-wrap","data-test":"task-grouped-list"},O2={key:0},F2={key:1},B2=180,H2=480,N2=$e({__name:"TaskSidebar",props:{collapsed:{type:Boolean},byHost:{},primaryStateForHost:{},completedSeen:{},totalUnread:{},byStateGroups:{default:()=>({})},activeSessionId:{default:null},openSessionIds:{default:()=>[]},localHostId:{default:""},localHost:{default:""},paneLocationFor:{type:Function,default:()=>null},canDetachSession:{type:Function,default:()=>!1},tabIndexById:{type:Function,default:()=>0}},emits:["update:collapsed","open","close","markSeen","merge-selected","close-selected","detach-session"],setup(e,{expose:t,emit:n}){const{t:s}=$t(),i=Hm(),a=e,d=n,r=Wu(),o=j(()=>{const N=new Set(a.openSessionIds??[]);let V=0;for(const q of r.selectedIds.value)N.has(q)&&V++;return V}),c=j(()=>r.size.value>=1&&r.size.value<=4);function p(N){N.key==="Escape"&&r.size.value>0&&(N.preventDefault(),r.clear())}function u(N){if(r.size.value===0)return;const V=N.target;V&&(V.closest(".task-row, .host-header, .group-header, .bulk-bar, .session-row-menu, .session-details-popover, .resize-handle")||r.clear())}const g=H(240);let m=0,y=0,v=!1;const l=H(""),h=H(null),f=H(!1);async function _(){var N,V;f.value=!0,await cn(),(N=h.value)==null||N.focus(),(V=h.value)==null||V.select()}function S(){l.value===""&&(f.value=!1)}function k(){if(l.value!==""){l.value="";return}f.value=!1}async function P(){a.collapsed&&(d("update:collapsed",!1),await cn()),await _()}t({focusSearch:P}),Dt(async()=>{try{const N=await SS();N>0&&(g.value=M(N))}catch{}});function M(N){return Math.max(B2,Math.min(H2,N))}const w=H(!1),T=H(!1);function A(){const N=w.value;w.value=window.innerWidth<768,N&&!w.value&&(T.value=!1)}function E(N){N.key==="Escape"&&T.value&&(T.value=!1,N.preventDefault())}Dt(()=>{A(),window.addEventListener("resize",A),window.addEventListener("keydown",E)}),Vt(()=>{window.removeEventListener("resize",A),window.removeEventListener("keydown",E)});function R(N){if(!a.collapsed){v=!0,m=N.clientX,y=g.value;try{N.target.setPointerCapture(N.pointerId)}catch{}}}function D(N){v&&(g.value=M(y+(N.clientX-m)))}async function I(N){if(v){v=!1;try{N.target.releasePointerCapture(N.pointerId)}catch{}try{await CS(g.value)}catch{}}}const O=["waiting_input","failed","running","completed","idle","disconnected","closed"];function U(N){if(!N)return O.length;const V=O.indexOf(N);return V===-1?O.length:V}function W(){const N=i.activeId.value==="state"?"host":"state";i.setGroupBy(N)}const z=j(()=>{const N=[];for(const V of Object.values(a.byHost))N.push(...V);return N.sort((V,q)=>U(V.task_state)-U(q.task_state)),N.slice(0,20)});return(N,V)=>($(),F("div",S2,[w.value?($(),F("button",{key:0,"data-test":"sidebar-hamburger",class:"sidebar-hamburger","aria-label":T.value?C(s)("tasks.sidebar.closeDrawer"):C(s)("tasks.sidebar.openDrawer"),onClick:V[0]||(V[0]=q=>T.value=!T.value)},V[14]||(V[14]=[b("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","aria-hidden":"true"},[b("line",{x1:"3",y1:"4.5",x2:"13",y2:"4.5"}),b("line",{x1:"3",y1:"8",x2:"13",y2:"8"}),b("line",{x1:"3",y1:"11.5",x2:"13",y2:"11.5"})],-1)]),8,C2)):Z("",!0),b("aside",{class:lt(["task-sidebar",{collapsed:N.collapsed,drawer:w.value,open:w.value&&T.value}]),style:nn(N.collapsed?void 0:{width:g.value+"px"}),tabindex:"-1",onKeydown:p,onClickCapture:u},[N.collapsed?Z("",!0):($(),F("div",{key:0,class:"resize-handle","data-test":"sidebar-resize-handle",onPointerdown:R,onPointermove:D,onPointerup:I,onPointercancel:I},null,32)),N.collapsed?($(),F("div",k2,[b("button",{class:"expand-button",title:C(s)("tasks.sidebar.expand"),"aria-label":C(s)("tasks.sidebar.expand"),onClick:V[1]||(V[1]=q=>d("update:collapsed",!1))},V[15]||(V[15]=[b("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("polyline",{points:"3 2 7 6 3 10"}),b("polyline",{points:"6 2 10 6 6 10"})],-1)]),8,x2),N.totalUnread>0?($(),F("span",R2,L(N.totalUnread),1)):Z("",!0),($(!0),F(Oe,null,at(z.value,q=>($(),F("span",{key:q.session_id,class:"rail-icon","data-test":"sidebar-rail-icon",role:"button",tabindex:"0","aria-label":q.current_command||q.title||q.session_id.slice(0,8),onClick:G=>d("open",q),onKeydown:[Xn(ut(G=>d("open",q),["prevent"]),["enter"]),Xn(ut(G=>d("open",q),["prevent"]),["space"])]},[Pe(ci,{state:q.task_state??"idle",unread:q.unread===!0,size:14},null,8,["state","unread"])],40,T2))),128))])):($(),F("div",P2,[b("header",E2,[f.value||l.value?Z("",!0):($(),F("span",L2,L(C(s)("tasks.sidebar.title")),1)),f.value||l.value?it(($(),F("input",{key:2,ref_key:"searchEl",ref:h,"onUpdate:modelValue":V[2]||(V[2]=q=>l.value=q),type:"search",class:"sidebar-search","data-test":"sidebar-search",placeholder:C(s)("tasks.sidebar.searchPlaceholder"),"aria-label":C(s)("tasks.sidebar.searchPlaceholder"),onKeydown:Xn(ut(k,["prevent"]),["esc"]),onBlur:S},null,40,M2)),[[Pt,l.value]]):($(),F("button",{key:1,class:"search-icon-btn","data-test":"sidebar-search-toggle",title:C(s)("tasks.sidebar.searchPlaceholder"),"aria-label":C(s)("tasks.sidebar.searchPlaceholder"),onClick:_},V[16]||(V[16]=[b("svg",{width:"14",height:"14",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false"},[b("circle",{cx:"7",cy:"7",r:"4.5",fill:"none",stroke:"currentColor","stroke-width":"1.5"}),b("line",{x1:"10.5",y1:"10.5",x2:"14",y2:"14",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round"})],-1)]),8,D2)),f.value||l.value?Z("",!0):($(),F("button",{key:3,class:"group-toggle","data-test":"group-toggle",title:C(s)("tasks.settings.groupBy"),onClick:W},L(C(i).activeId.value==="state"?C(s)("tasks.settings.groupByState"):C(s)("tasks.settings.groupByHost")),9,A2)),b("button",{class:"collapse-button","data-test":"collapse-button",title:C(s)("tasks.sidebar.collapse"),"aria-label":C(s)("tasks.sidebar.collapse"),onClick:V[3]||(V[3]=q=>d("update:collapsed",!0))},V[17]||(V[17]=[b("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",stroke:"currentColor","stroke-width":"1.6","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("polyline",{points:"9 2 5 6 9 10"}),b("polyline",{points:"6 2 2 6 6 10"})],-1)]),8,I2)]),b("div",$2,[Pe(f2,{"by-host":N.byHost,"primary-state-for-host":N.primaryStateForHost,"completed-seen":N.completedSeen,"group-by":C(i).activeId.value,"by-state":N.byStateGroups,"active-session-id":N.activeSessionId,"open-session-ids":N.openSessionIds,"local-host-id":N.localHostId,"local-host":N.localHost,"search-query":l.value,"pane-location-for":N.paneLocationFor,"can-detach-session":N.canDetachSession,"tab-index-by-id":N.tabIndexById,onOpen:V[4]||(V[4]=q=>d("open",q)),onClose:V[5]||(V[5]=q=>d("close",q)),onMarkSeen:V[6]||(V[6]=q=>d("markSeen",q)),onMergeSelected:V[7]||(V[7]=q=>d("merge-selected")),onCloseSelected:V[8]||(V[8]=q=>d("close-selected")),onDetachSession:V[9]||(V[9]=q=>d("detach-session",q))},null,8,["by-host","primary-state-for-host","completed-seen","group-by","by-state","active-session-id","open-session-ids","local-host-id","local-host","search-query","pane-location-for","can-detach-session","tab-index-by-id"])]),C(r).size.value>=1?($(),F("footer",O2,[Pe(b2,{count:C(r).size.value,"open-count":o.value,"can-merge":c.value,onMerge:V[10]||(V[10]=q=>d("merge-selected")),onCloseSelected:V[11]||(V[11]=q=>d("close-selected")),onClear:V[12]||(V[12]=q=>C(r).clear())},null,8,["count","open-count","can-merge"])])):N.totalUnread>0?($(),F("footer",F2,[b("button",{class:"mark-all","data-test":"sidebar-mark-all",onClick:V[13]||(V[13]=q=>d("markSeen",{all:!0}))},L(C(s)("tasks.markAllRead")),1)])):Z("",!0)]))],38)]))}}),z2=Ct(N2,[["__scopeId","data-v-0741527d"]]);var Nm={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={4567:function(d,r,o){var c=this&&this.__decorate||function(_,S,k,P){var M,w=arguments.length,T=w<3?S:P===null?P=Object.getOwnPropertyDescriptor(S,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,S,k,P);else for(var A=_.length-1;A>=0;A--)(M=_[A])&&(T=(w<3?M(T):w>3?M(S,k,T):M(S,k))||T);return w>3&&T&&Object.defineProperty(S,k,T),T},p=this&&this.__param||function(_,S){return function(k,P){S(k,P,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;const u=o(9042),g=o(6114),m=o(9924),y=o(844),v=o(5596),l=o(4725),h=o(3656);let f=r.AccessibilityManager=class extends y.Disposable{constructor(_,S){super(),this._terminal=_,this._renderService=S,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=document.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let k=0;kthis._handleBoundaryFocus(k,0),this._bottomBoundaryFocusListener=k=>this._handleBoundaryFocus(k,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new m.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize(k=>this._handleResize(k.rows))),this.register(this._terminal.onRender(k=>this._refreshRows(k.start,k.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(k=>this._handleChar(k))),this.register(this._terminal.onLineFeed(()=>this._handleChar(` +`))),this.register(this._terminal.onA11yTab(k=>this._handleTab(k))),this.register(this._terminal.onKey(k=>this._handleKey(k.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new v.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,h.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions())),this._refreshRows(),this.register((0,y.toDisposable)(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(_){for(let S=0;S<_;S++)this._handleChar(" ")}_handleChar(_){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==_&&(this._charsToAnnounce+=_):this._charsToAnnounce+=_,_===` +`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=u.tooMuchOutput)),g.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityContainer.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,g.isMac&&this._liveRegion.remove()}_handleKey(_){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(_)||this._charsToConsume.push(_)}_refreshRows(_,S){this._liveRegionDebouncer.refresh(_,S,this._terminal.rows)}_renderRows(_,S){const k=this._terminal.buffer,P=k.lines.length.toString();for(let M=_;M<=S;M++){const w=k.translateBufferLineToString(k.ydisp+M,!0),T=(k.ydisp+M+1).toString(),A=this._rowElements[M];A&&(w.length===0?A.innerText=" ":A.textContent=w,A.setAttribute("aria-posinset",T),A.setAttribute("aria-setsize",P))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(_,S){const k=_.target,P=this._rowElements[S===0?1:this._rowElements.length-2];if(k.getAttribute("aria-posinset")===(S===0?"1":`${this._terminal.buffer.lines.length}`)||_.relatedTarget!==P)return;let M,w;if(S===0?(M=k,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(M=this._rowElements.shift(),w=k,this._rowContainer.removeChild(M)),M.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),S===0){const T=this._createAccessibilityTreeNode();this._rowElements.unshift(T),this._rowContainer.insertAdjacentElement("afterbegin",T)}else{const T=this._createAccessibilityTreeNode();this._rowElements.push(T),this._rowContainer.appendChild(T)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(S===0?-1:1),this._rowElements[S===0?1:this._rowElements.length-2].focus(),_.preventDefault(),_.stopImmediatePropagation()}_handleResize(_){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let S=this._rowContainer.children.length;S_;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const _=document.createElement("div");return _.setAttribute("role","listitem"),_.tabIndex=-1,this._refreshRowDimensions(_),_}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let _=0;_{function o(g){return g.replace(/\r?\n/g,"\r")}function c(g,m){return m?"\x1B[200~"+g+"\x1B[201~":g}function p(g,m,y,v){g=c(g=o(g),y.decPrivateModes.bracketedPasteMode&&v.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(g,!0),m.value=""}function u(g,m,y){const v=y.getBoundingClientRect(),l=g.clientX-v.left-10,h=g.clientY-v.top-10;m.style.width="20px",m.style.height="20px",m.style.left=`${l}px`,m.style.top=`${h}px`,m.style.zIndex="1000",m.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=o,r.bracketTextForPaste=c,r.copyHandler=function(g,m){g.clipboardData&&g.clipboardData.setData("text/plain",m.selectionText),g.preventDefault()},r.handlePasteEvent=function(g,m,y,v){g.stopPropagation(),g.clipboardData&&p(g.clipboardData.getData("text/plain"),m,y,v)},r.paste=p,r.moveTextAreaUnderMouseCursor=u,r.rightClickHandler=function(g,m,y,v,l){u(g,m,y),l&&v.rightClickSelect(g),m.value=v.selectionText,m.select()}},7239:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;const c=o(1505);r.ColorContrastCache=class{constructor(){this._color=new c.TwoKeyMap,this._css=new c.TwoKeyMap}setCss(p,u,g){this._css.set(p,u,g)}getCss(p,u){return this._css.get(p,u)}setColor(p,u,g){this._color.set(p,u,g)}getColor(p,u){return this._color.get(p,u)}clear(){this._color.clear(),this._css.clear()}}},3656:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,p,u){o.addEventListener(c,p,u);let g=!1;return{dispose:()=>{g||(g=!0,o.removeEventListener(c,p,u))}}}},6465:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;const u=o(3656),g=o(8460),m=o(844),y=o(2585);let v=r.Linkifier2=class extends m.Disposable{get currentLink(){return this._currentLink}constructor(l){super(),this._bufferService=l,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,m.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,m.toDisposable)(()=>{this._lastMouseEvent=void 0})),this.register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0}))}registerLinkProvider(l){return this._linkProviders.push(l),{dispose:()=>{const h=this._linkProviders.indexOf(l);h!==-1&&this._linkProviders.splice(h,1)}}}attachToDom(l,h,f){this._element=l,this._mouseService=h,this._renderService=f,this.register((0,u.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,u.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,u.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(l){if(this._lastMouseEvent=l,!this._element||!this._mouseService)return;const h=this._positionFromMouseEvent(l,this._element,this._mouseService);if(!h)return;this._isMouseOut=!1;const f=l.composedPath();for(let _=0;_{k==null||k.forEach(P=>{P.link.dispose&&P.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=l.y);let S=!1;for(const[k,P]of this._linkProviders.entries())h?!((_=this._activeProviderReplies)===null||_===void 0)&&_.get(k)&&(S=this._checkLinkProviderResult(k,l,S)):P.provideLinks(l.y,M=>{var w,T;if(this._isMouseOut)return;const A=M==null?void 0:M.map(E=>({link:E}));(w=this._activeProviderReplies)===null||w===void 0||w.set(k,A),S=this._checkLinkProviderResult(k,l,S),((T=this._activeProviderReplies)===null||T===void 0?void 0:T.size)===this._linkProviders.length&&this._removeIntersectingLinks(l.y,this._activeProviderReplies)})}_removeIntersectingLinks(l,h){const f=new Set;for(let _=0;_l?this._bufferService.cols:P.link.range.end.x;for(let T=M;T<=w;T++){if(f.has(T)){S.splice(k--,1);break}f.add(T)}}}}_checkLinkProviderResult(l,h,f){var _;if(!this._activeProviderReplies)return f;const S=this._activeProviderReplies.get(l);let k=!1;for(let P=0;Pthis._linkAtPosition(M.link,h));P&&(f=!0,this._handleNewLink(P))}if(this._activeProviderReplies.size===this._linkProviders.length&&!f)for(let P=0;Pthis._linkAtPosition(w.link,h));if(M){f=!0,this._handleNewLink(M);break}}return f}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(l){if(!this._element||!this._mouseService||!this._currentLink)return;const h=this._positionFromMouseEvent(l,this._element,this._mouseService);h&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,h)&&this._currentLink.link.activate(l,this._currentLink.link.text)}_clearCurrentLink(l,h){this._element&&this._currentLink&&this._lastMouseEvent&&(!l||!h||this._currentLink.link.range.start.y>=l&&this._currentLink.link.range.end.y<=h)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,m.disposeArray)(this._linkCacheDisposables))}_handleNewLink(l){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;const h=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);h&&this._linkAtPosition(l.link,h)&&(this._currentLink=l,this._currentLink.state={decorations:{underline:l.link.decorations===void 0||l.link.decorations.underline,pointerCursor:l.link.decorations===void 0||l.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,l.link,this._lastMouseEvent),l.link.decorations={},Object.defineProperties(l.link.decorations,{pointerCursor:{get:()=>{var f,_;return(_=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||_===void 0?void 0:_.decorations.pointerCursor},set:f=>{var _,S;!((_=this._currentLink)===null||_===void 0)&&_.state&&this._currentLink.state.decorations.pointerCursor!==f&&(this._currentLink.state.decorations.pointerCursor=f,this._currentLink.state.isHovered&&((S=this._element)===null||S===void 0||S.classList.toggle("xterm-cursor-pointer",f)))}},underline:{get:()=>{var f,_;return(_=(f=this._currentLink)===null||f===void 0?void 0:f.state)===null||_===void 0?void 0:_.decorations.underline},set:f=>{var _,S,k;!((_=this._currentLink)===null||_===void 0)&&_.state&&((k=(S=this._currentLink)===null||S===void 0?void 0:S.state)===null||k===void 0?void 0:k.decorations.underline)!==f&&(this._currentLink.state.decorations.underline=f,this._currentLink.state.isHovered&&this._fireUnderlineEvent(l.link,f))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(f=>{if(!this._currentLink)return;const _=f.start===0?0:f.start+1+this._bufferService.buffer.ydisp,S=this._bufferService.buffer.ydisp+1+f.end;if(this._currentLink.link.range.start.y>=_&&this._currentLink.link.range.end.y<=S&&(this._clearCurrentLink(_,S),this._lastMouseEvent&&this._element)){const k=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);k&&this._askForLink(k,!1)}})))}_linkHover(l,h,f){var _;!((_=this._currentLink)===null||_===void 0)&&_.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!0),this._currentLink.state.decorations.pointerCursor&&l.classList.add("xterm-cursor-pointer")),h.hover&&h.hover(f,h.text)}_fireUnderlineEvent(l,h){const f=l.range,_=this._bufferService.buffer.ydisp,S=this._createLinkUnderlineEvent(f.start.x-1,f.start.y-_-1,f.end.x,f.end.y-_-1,void 0);(h?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(S)}_linkLeave(l,h,f){var _;!((_=this._currentLink)===null||_===void 0)&&_.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(h,!1),this._currentLink.state.decorations.pointerCursor&&l.classList.remove("xterm-cursor-pointer")),h.leave&&h.leave(f,h.text)}_linkAtPosition(l,h){const f=l.range.start.y*this._bufferService.cols+l.range.start.x,_=l.range.end.y*this._bufferService.cols+l.range.end.x,S=h.y*this._bufferService.cols+h.x;return f<=S&&S<=_}_positionFromMouseEvent(l,h,f){const _=f.getCoords(l,h,this._bufferService.cols,this._bufferService.rows);if(_)return{x:_[0],y:_[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(l,h,f,_,S){return{x1:l,y1:h,x2:f,y2:_,cols:this._bufferService.cols,fg:S}}};r.Linkifier2=v=c([p(0,y.IBufferService)],v)},9042:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(d,r,o){var c=this&&this.__decorate||function(v,l,h,f){var _,S=arguments.length,k=S<3?l:f===null?f=Object.getOwnPropertyDescriptor(l,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,l,h,f);else for(var P=v.length-1;P>=0;P--)(_=v[P])&&(k=(S<3?_(k):S>3?_(l,h,k):_(l,h))||k);return S>3&&k&&Object.defineProperty(l,h,k),k},p=this&&this.__param||function(v,l){return function(h,f){l(h,f,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;const u=o(511),g=o(2585);let m=r.OscLinkProvider=class{constructor(v,l,h){this._bufferService=v,this._optionsService=l,this._oscLinkService=h}provideLinks(v,l){var h;const f=this._bufferService.buffer.lines.get(v-1);if(!f)return void l(void 0);const _=[],S=this._optionsService.rawOptions.linkHandler,k=new u.CellData,P=f.getTrimmedLength();let M=-1,w=-1,T=!1;for(let A=0;AS?S.activate(I,O,R):y(0,O),hover:(I,O)=>{var U;return(U=S==null?void 0:S.hover)===null||U===void 0?void 0:U.call(S,I,O,R)},leave:(I,O)=>{var U;return(U=S==null?void 0:S.leave)===null||U===void 0?void 0:U.call(S,I,O,R)}})}T=!1,k.hasExtendedAttrs()&&k.extended.urlId?(w=A,M=k.extended.urlId):(w=-1,M=-1)}}l(_)}};function y(v,l){if(confirm(`Do you want to navigate to ${l}? + +WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=l}else console.warn("Opening link blocked as opener could not be cleared")}}r.OscLinkProvider=m=c([p(0,g.IBufferService),p(1,g.IOptionsService),p(2,g.IOscLinkService)],m)},6193:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(o,c){this._parentWindow=o,this._renderCallback=c,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(o){return this._refreshCallbacks.push(o),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(o,c,p){this._rowCount=p,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c,this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return void this._runRefreshCallbacks();const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const o of this._refreshCallbacks)o(0);this._refreshCallbacks=[]}}},5596:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;const c=o(844);class p extends c.Disposable{constructor(g){super(),this._parentWindow=g,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this.register((0,c.toDisposable)(()=>{this.clearListener()}))}setListener(g){this._listener&&this.clearListener(),this._listener=g,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}_updateDpr(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)===null||g===void 0||g.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=p},3236:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;const c=o(3614),p=o(3656),u=o(6465),g=o(9042),m=o(3730),y=o(1680),v=o(3107),l=o(5744),h=o(2950),f=o(1296),_=o(428),S=o(4269),k=o(5114),P=o(8934),M=o(3230),w=o(9312),T=o(4725),A=o(6731),E=o(8055),R=o(8969),D=o(8460),I=o(844),O=o(6114),U=o(8437),W=o(2584),z=o(7399),N=o(5941),V=o(9074),q=o(2585),G=o(5435),te=o(4567),oe=typeof window<"u"?window.document:null;class ie extends R.CoreTerminal{get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}constructor(K={}){super(K),this.browser=O,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new I.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(u.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(m.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(V.DecorationService),this._instantiationService.setService(q.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((J,Q)=>this.refresh(J,Q))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(J=>this._reportWindowsOptions(J))),this.register(this._inputHandler.onColor(J=>this._handleColorEvent(J))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(J=>this._afterResize(J.cols,J.rows))),this.register((0,I.toDisposable)(()=>{var J,Q;this._customKeyEventHandler=void 0,(Q=(J=this.element)===null||J===void 0?void 0:J.parentNode)===null||Q===void 0||Q.removeChild(this.element)}))}_handleColorEvent(K){if(this._themeService)for(const J of K){let Q,ce="";switch(J.index){case 256:Q="foreground",ce="10";break;case 257:Q="background",ce="11";break;case 258:Q="cursor",ce="12";break;default:Q="ansi",ce="4;"+J.index}switch(J.type){case 0:const Fe=E.color.toColorRGB(Q==="ansi"?this._themeService.colors.ansi[J.index]:this._themeService.colors[Q]);this.coreService.triggerDataEvent(`${W.C0.ESC}]${ce};${(0,N.toRgbString)(Fe)}${W.C1_ESCAPED.ST}`);break;case 1:if(Q==="ansi")this._themeService.modifyColors(Ee=>Ee.ansi[J.index]=E.rgba.toColor(...J.color));else{const Ee=Q;this._themeService.modifyColors(Ye=>Ye[Ee]=E.rgba.toColor(...J.color))}break;case 2:this._themeService.restoreColor(J.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(K){K?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(te.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(K){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[I"),this.updateCursorStyle(K),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var K;return(K=this.textarea)===null||K===void 0?void 0:K.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(W.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const K=this.buffer.ybase+this.buffer.y,J=this.buffer.lines.get(K);if(!J)return;const Q=Math.min(this.buffer.x,this.cols-1),ce=this._renderService.dimensions.css.cell.height,Fe=J.getWidth(Q),Ee=this._renderService.dimensions.css.cell.width*Fe,Ye=this.buffer.y*this._renderService.dimensions.css.cell.height,Ze=Q*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ze+"px",this.textarea.style.top=Ye+"px",this.textarea.style.width=Ee+"px",this.textarea.style.height=ce+"px",this.textarea.style.lineHeight=ce+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,p.addDisposableDomListener)(this.element,"copy",J=>{this.hasSelection()&&(0,c.copyHandler)(J,this._selectionService)}));const K=J=>(0,c.handlePasteEvent)(J,this.textarea,this.coreService,this.optionsService);this.register((0,p.addDisposableDomListener)(this.textarea,"paste",K)),this.register((0,p.addDisposableDomListener)(this.element,"paste",K)),O.isFirefox?this.register((0,p.addDisposableDomListener)(this.element,"mousedown",J=>{J.button===2&&(0,c.rightClickHandler)(J,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,p.addDisposableDomListener)(this.element,"contextmenu",J=>{(0,c.rightClickHandler)(J,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),O.isLinux&&this.register((0,p.addDisposableDomListener)(this.element,"auxclick",J=>{J.button===1&&(0,c.moveTextAreaUnderMouseCursor)(J,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,p.addDisposableDomListener)(this.textarea,"keyup",K=>this._keyUp(K),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keydown",K=>this._keyDown(K),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"keypress",K=>this._keyPress(K),!0)),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionupdate",K=>this._compositionHelper.compositionupdate(K))),this.register((0,p.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,p.addDisposableDomListener)(this.textarea,"input",K=>this._inputEvent(K),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(K){var J;if(!K)throw new Error("Terminal requires a parent element.");K.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=K.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),K.appendChild(this.element);const Q=oe.createDocumentFragment();this._viewportElement=oe.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),Q.appendChild(this._viewportElement),this._viewportScrollArea=oe.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=oe.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=oe.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),Q.appendChild(this.screenElement),this.textarea=oe.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),O.isChromeOS||this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this._coreBrowserService=this._instantiationService.createInstance(k.CoreBrowserService,this.textarea,(J=this._document.defaultView)!==null&&J!==void 0?J:window),this._instantiationService.setService(T.ICoreBrowserService,this._coreBrowserService),this.register((0,p.addDisposableDomListener)(this.textarea,"focus",ce=>this._handleTextAreaFocus(ce))),this.register((0,p.addDisposableDomListener)(this.textarea,"blur",()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(_.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(T.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(A.ThemeService),this._instantiationService.setService(T.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(T.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(T.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(ce=>this._onRender.fire(ce))),this.onResize(ce=>this._renderService.resize(ce.cols,ce.rows)),this._compositionView=oe.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(Q);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._mouseService=this._instantiationService.createInstance(P.MouseService),this._instantiationService.setService(T.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines(ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent,1)),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.handleBlur())),this.register(this.onFocus(()=>this._renderService.handleFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(w.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(T.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(ce=>this.scrollLines(ce.amount,ce.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(ce=>this._renderService.handleSelectionChanged(ce.start,ce.end,ce.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(ce=>{this.textarea.value=ce,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(ce=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(v.BufferDecorationRenderer,this.screenElement)),this.register((0,p.addDisposableDomListener)(this.element,"mousedown",ce=>this._selectionService.handleMouseDown(ce))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(te.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",ce=>this._handleScreenReaderModeOptionChange(ce))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",ce=>{!this._overviewRulerRenderer&&ce&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(l.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(f.DomRenderer,this.element,this.screenElement,this._viewportElement,this.linkifier2)}bindMouse(){const K=this,J=this.element;function Q(Ee){const Ye=K._mouseService.getMouseReportCoords(Ee,K.screenElement);if(!Ye)return!1;let Ze,ue;switch(Ee.overrideType||Ee.type){case"mousemove":ue=32,Ee.buttons===void 0?(Ze=3,Ee.button!==void 0&&(Ze=Ee.button<3?Ee.button:3)):Ze=1&Ee.buttons?0:4&Ee.buttons?1:2&Ee.buttons?2:3;break;case"mouseup":ue=0,Ze=Ee.button<3?Ee.button:3;break;case"mousedown":ue=1,Ze=Ee.button<3?Ee.button:3;break;case"wheel":if(K.viewport.getLinesScrolled(Ee)===0)return!1;ue=Ee.deltaY<0?0:1,Ze=4;break;default:return!1}return!(ue===void 0||Ze===void 0||Ze>4)&&K.coreMouseService.triggerMouseEvent({col:Ye.col,row:Ye.row,x:Ye.x,y:Ye.y,button:Ze,action:ue,ctrl:Ee.ctrlKey,alt:Ee.altKey,shift:Ee.shiftKey})}const ce={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Fe={mouseup:Ee=>(Q(Ee),Ee.buttons||(this._document.removeEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.removeEventListener("mousemove",ce.mousedrag)),this.cancel(Ee)),wheel:Ee=>(Q(Ee),this.cancel(Ee,!0)),mousedrag:Ee=>{Ee.buttons&&Q(Ee)},mousemove:Ee=>{Ee.buttons||Q(Ee)}};this.register(this.coreMouseService.onProtocolChange(Ee=>{Ee?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(Ee)),this.element.classList.add("enable-mouse-events"),this._selectionService.disable()):(this._logService.debug("Unbinding from mouse events."),this.element.classList.remove("enable-mouse-events"),this._selectionService.enable()),8&Ee?ce.mousemove||(J.addEventListener("mousemove",Fe.mousemove),ce.mousemove=Fe.mousemove):(J.removeEventListener("mousemove",ce.mousemove),ce.mousemove=null),16&Ee?ce.wheel||(J.addEventListener("wheel",Fe.wheel,{passive:!1}),ce.wheel=Fe.wheel):(J.removeEventListener("wheel",ce.wheel),ce.wheel=null),2&Ee?ce.mouseup||(J.addEventListener("mouseup",Fe.mouseup),ce.mouseup=Fe.mouseup):(this._document.removeEventListener("mouseup",ce.mouseup),J.removeEventListener("mouseup",ce.mouseup),ce.mouseup=null),4&Ee?ce.mousedrag||(ce.mousedrag=Fe.mousedrag):(this._document.removeEventListener("mousemove",ce.mousedrag),ce.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,p.addDisposableDomListener)(J,"mousedown",Ee=>{if(Ee.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(Ee))return Q(Ee),ce.mouseup&&this._document.addEventListener("mouseup",ce.mouseup),ce.mousedrag&&this._document.addEventListener("mousemove",ce.mousedrag),this.cancel(Ee)})),this.register((0,p.addDisposableDomListener)(J,"wheel",Ee=>{if(!ce.wheel){if(!this.buffer.hasScrollback){const Ye=this.viewport.getLinesScrolled(Ee);if(Ye===0)return;const Ze=W.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(Ee.deltaY<0?"A":"B");let ue="";for(let et=0;et{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(Ee),this.cancel(Ee)},{passive:!0})),this.register((0,p.addDisposableDomListener)(J,"touchmove",Ee=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(Ee)?void 0:this.cancel(Ee)},{passive:!1}))}refresh(K,J){var Q;(Q=this._renderService)===null||Q===void 0||Q.refreshRows(K,J)}updateCursorStyle(K){var J;!((J=this._selectionService)===null||J===void 0)&&J.shouldColumnSelect(K)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(K,J,Q=0){var ce;Q===1?(super.scrollLines(K,J,Q),this.refresh(0,this.rows-1)):(ce=this.viewport)===null||ce===void 0||ce.scrollLines(K)}paste(K){(0,c.paste)(K,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(K){this._customKeyEventHandler=K}registerLinkProvider(K){return this.linkifier2.registerLinkProvider(K)}registerCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const J=this._characterJoinerService.register(K);return this.refresh(0,this.rows-1),J}deregisterCharacterJoiner(K){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(K)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(K){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+K)}registerDecoration(K){return this._decorationService.registerDecoration(K)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(K,J,Q){this._selectionService.setSelection(K,J,Q)}getSelection(){return this._selectionService?this._selectionService.selectionText:""}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){var K;(K=this._selectionService)===null||K===void 0||K.clearSelection()}selectAll(){var K;(K=this._selectionService)===null||K===void 0||K.selectAll()}selectLines(K,J){var Q;(Q=this._selectionService)===null||Q===void 0||Q.selectLines(K,J)}_keyDown(K){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;const J=this.browser.isMac&&this.options.macOptionIsMeta&&K.altKey;if(!J&&!this._compositionHelper.keydown(K))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;J||K.key!=="Dead"&&K.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const Q=(0,z.evaluateKeyboardEvent)(K,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(K),Q.type===3||Q.type===2){const ce=this.rows-1;return this.scrollLines(Q.type===2?-ce:ce),this.cancel(K,!0)}return Q.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,K)||(Q.cancel&&this.cancel(K,!0),!Q.key||!!(K.key&&!K.ctrlKey&&!K.altKey&&!K.metaKey&&K.key.length===1&&K.key.charCodeAt(0)>=65&&K.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(Q.key!==W.C0.ETX&&Q.key!==W.C0.CR||(this.textarea.value=""),this._onKey.fire({key:Q.key,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(Q.key,!0),!this.optionsService.rawOptions.screenReaderMode||K.altKey||K.ctrlKey?this.cancel(K,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(K,J){const Q=K.isMac&&!this.options.macOptionIsMeta&&J.altKey&&!J.ctrlKey&&!J.metaKey||K.isWindows&&J.altKey&&J.ctrlKey&&!J.metaKey||K.isWindows&&J.getModifierState("AltGraph");return J.type==="keypress"?Q:Q&&(!J.keyCode||J.keyCode>47)}_keyUp(K){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1||(function(J){return J.keyCode===16||J.keyCode===17||J.keyCode===18}(K)||this.focus(),this.updateCursorStyle(K),this._keyPressHandled=!1)}_keyPress(K){let J;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(K)===!1)return!1;if(this.cancel(K),K.charCode)J=K.charCode;else if(K.which===null||K.which===void 0)J=K.keyCode;else{if(K.which===0||K.charCode===0)return!1;J=K.which}return!(!J||(K.altKey||K.ctrlKey||K.metaKey)&&!this._isThirdLevelShift(this.browser,K)||(J=String.fromCharCode(J),this._onKey.fire({key:J,domEvent:K}),this._showCursor(),this.coreService.triggerDataEvent(J,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(K){if(K.data&&K.inputType==="insertText"&&(!K.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const J=K.data;return this.coreService.triggerDataEvent(J,!0),this.cancel(K),!0}return!1}resize(K,J){K!==this.cols||J!==this.rows?super.resize(K,J):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(K,J){var Q,ce;(Q=this._charSizeService)===null||Q===void 0||Q.measure(),(ce=this.viewport)===null||ce===void 0||ce.syncScrollArea(!0)}clear(){var K;if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let J=1;J{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(o,c=1e3){this._renderCallback=o,this._debounceThresholdMS=c,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(o,c,p){this._rowCount=p,o=o!==void 0?o:0,c=c!==void 0?c:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,o):o,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,c):c;const u=Date.now();if(u-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=u,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=u-this._lastRefreshMs,m=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},m)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const o=Math.max(this._rowStart,0),c=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(o,c)}}},1680:function(d,r,o){var c=this&&this.__decorate||function(h,f,_,S){var k,P=arguments.length,M=P<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,f,_,S);else for(var w=h.length-1;w>=0;w--)(k=h[w])&&(M=(P<3?k(M):P>3?k(f,_,M):k(f,_))||M);return P>3&&M&&Object.defineProperty(f,_,M),M},p=this&&this.__param||function(h,f){return function(_,S){f(_,S,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;const u=o(3656),g=o(4725),m=o(8460),y=o(844),v=o(2585);let l=r.Viewport=class extends y.Disposable{constructor(h,f,_,S,k,P,M,w){super(),this._viewportElement=h,this._scrollArea=f,this._bufferService=_,this._optionsService=S,this._charSizeService=k,this._renderService=P,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new m.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(T=>this._activeBuffer=T.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(T=>this._renderDimensions=T)),this._handleThemeChange(w.colors),this.register(w.onChangeColors(T=>this._handleThemeChange(T))),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.syncScrollArea())),setTimeout(()=>this.syncScrollArea())}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame(()=>this.syncScrollArea())}_refresh(h){if(h)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderService.dimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const f=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.css.canvas.height);this._lastRecordedBufferHeight!==f&&(this._lastRecordedBufferHeight=f,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const f=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:f,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<1?this._coreBrowserService.window.requestAnimationFrame(()=>this._smoothScroll()):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(h,f){const _=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(f<0&&this._viewportElement.scrollTop!==0||f>0&&_0&&(S=R),k=""}}return{bufferElements:P,cursorElement:S}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let f=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(f/=this._currentRowHeight+0,this._wheelPartialScroll+=f,f=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(f*=this._bufferService.rows),f}_applyScrollModifier(h,f){const _=this._optionsService.rawOptions.fastScrollModifier;return _==="alt"&&f.altKey||_==="ctrl"&&f.ctrlKey||_==="shift"&&f.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const f=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,f!==0&&(this._viewportElement.scrollTop+=f,this._bubbleScroll(h,f))}};r.Viewport=l=c([p(2,v.IBufferService),p(3,v.IOptionsService),p(4,g.ICharSizeService),p(5,g.IRenderService),p(6,g.ICoreBrowserService),p(7,g.IThemeService)],l)},3107:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;const u=o(3656),g=o(4725),m=o(844),y=o(2585);let v=r.BufferDecorationRenderer=class extends m.Disposable{constructor(l,h,f,_){super(),this._screenElement=l,this._bufferService=h,this._decorationService=f,this._renderService=_,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,u.addDisposableDomListener)(window,"resize",()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this.register(this._decorationService.onDecorationRemoved(S=>this._removeDecoration(S))),this.register((0,m.toDisposable)(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(const l of this._decorationService.decorations)this._renderDecoration(l);this._dimensionsChanged=!1}_renderDecoration(l){this._refreshStyle(l),this._dimensionsChanged&&this._refreshXPosition(l)}_createElement(l){var h,f;const _=document.createElement("div");_.classList.add("xterm-decoration"),_.classList.toggle("xterm-decoration-top-layer",((h=l==null?void 0:l.options)===null||h===void 0?void 0:h.layer)==="top"),_.style.width=`${Math.round((l.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,_.style.height=(l.options.height||1)*this._renderService.dimensions.css.cell.height+"px",_.style.top=(l.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",_.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const S=(f=l.options.x)!==null&&f!==void 0?f:0;return S&&S>this._bufferService.cols&&(_.style.display="none"),this._refreshXPosition(l,_),_}_refreshStyle(l){const h=l.marker.line-this._bufferService.buffers.active.ydisp;if(h<0||h>=this._bufferService.rows)l.element&&(l.element.style.display="none",l.onRenderEmitter.fire(l.element));else{let f=this._decorationElements.get(l);f||(f=this._createElement(l),l.element=f,this._decorationElements.set(l,f),this._container.appendChild(f),l.onDispose(()=>{this._decorationElements.delete(l),f.remove()})),f.style.top=h*this._renderService.dimensions.css.cell.height+"px",f.style.display=this._altBufferIsActive?"none":"block",l.onRenderEmitter.fire(f)}}_refreshXPosition(l,h=l.element){var f;if(!h)return;const _=(f=l.options.x)!==null&&f!==void 0?f:0;(l.options.anchor||"left")==="right"?h.style.right=_?_*this._renderService.dimensions.css.cell.width+"px":"":h.style.left=_?_*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(l){var h;(h=this._decorationElements.get(l))===null||h===void 0||h.remove(),this._decorationElements.delete(l),l.dispose()}};r.BufferDecorationRenderer=v=c([p(1,y.IBufferService),p(2,y.IDecorationService),p(3,g.IRenderService)],v)},5871:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.ColorZoneStore=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(o){if(o.options.overviewRulerOptions){for(const c of this._zones)if(c.color===o.options.overviewRulerOptions.color&&c.position===o.options.overviewRulerOptions.position){if(this._lineIntersectsZone(c,o.marker.line))return;if(this._lineAdjacentToZone(c,o.marker.line,o.options.overviewRulerOptions.position))return void this._addLineToZone(c,o.marker.line)}if(this._zonePoolIndex=o.startBufferLine&&c<=o.endBufferLine}_lineAdjacentToZone(o,c,p){return c>=o.startBufferLine-this._linePadding[p||"full"]&&c<=o.endBufferLine+this._linePadding[p||"full"]}_addLineToZone(o,c){o.startBufferLine=Math.min(o.startBufferLine,c),o.endBufferLine=Math.max(o.endBufferLine,c)}}},5744:function(d,r,o){var c=this&&this.__decorate||function(S,k,P,M){var w,T=arguments.length,A=T<3?k:M===null?M=Object.getOwnPropertyDescriptor(k,P):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,k,P,M);else for(var E=S.length-1;E>=0;E--)(w=S[E])&&(A=(T<3?w(A):T>3?w(k,P,A):w(k,P))||A);return T>3&&A&&Object.defineProperty(k,P,A),A},p=this&&this.__param||function(S,k){return function(P,M){k(P,M,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;const u=o(5871),g=o(3656),m=o(4725),y=o(844),v=o(2585),l={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0},f={full:0,left:0,center:0,right:0};let _=r.OverviewRulerRenderer=class extends y.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(S,k,P,M,w,T,A){var E;super(),this._viewportElement=S,this._screenElement=k,this._bufferService=P,this._decorationService=M,this._renderService=w,this._optionsService=T,this._coreBrowseService=A,this._colorZoneStore=new u.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(E=this._viewportElement.parentElement)===null||E===void 0||E.insertBefore(this._canvas,this._viewportElement);const R=this._canvas.getContext("2d");if(!R)throw new Error("Ctx cannot be null");this._ctx=R,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,y.toDisposable)(()=>{var D;(D=this._canvas)===null||D===void 0||D.remove()}))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this.register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0)))}_registerBufferChangeListeners(){this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?"none":"block"})),this.register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())}))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender(()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",()=>this._queueRefresh(!0))),this.register((0,g.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>this._queueRefresh(!0))),this._queueRefresh(!0)}_refreshDrawConstants(){const S=Math.floor(this._canvas.width/3),k=Math.ceil(this._canvas.width/3);h.full=this._canvas.width,h.left=S,h.center=k,h.right=S,this._refreshDrawHeightConstants(),f.full=0,f.left=0,f.center=h.left,f.right=h.left+h.center}_refreshDrawHeightConstants(){l.full=Math.round(2*this._coreBrowseService.dpr);const S=this._canvas.height/this._bufferService.buffer.lines.length,k=Math.round(Math.max(Math.min(S,12),6)*this._coreBrowseService.dpr);l.left=k,l.center=k,l.right=k}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*l.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(const k of this._decorationService.decorations)this._colorZoneStore.addDecoration(k);this._ctx.lineWidth=1;const S=this._colorZoneStore.zones;for(const k of S)k.position!=="full"&&this._renderColorZone(k);for(const k of S)k.position==="full"&&this._renderColorZone(k);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(S){this._ctx.fillStyle=S.color,this._ctx.fillRect(f[S.position||"full"],Math.round((this._canvas.height-1)*(S.startBufferLine/this._bufferService.buffers.active.lines.length)-l[S.position||"full"]/2),h[S.position||"full"],Math.round((this._canvas.height-1)*((S.endBufferLine-S.startBufferLine)/this._bufferService.buffers.active.lines.length)+l[S.position||"full"]))}_queueRefresh(S,k){this._shouldUpdateDimensions=S||this._shouldUpdateDimensions,this._shouldUpdateAnchor=k||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};r.OverviewRulerRenderer=_=c([p(2,v.IBufferService),p(3,v.IDecorationService),p(4,m.IRenderService),p(5,v.IOptionsService),p(6,m.ICoreBrowserService)],_)},2950:function(d,r,o){var c=this&&this.__decorate||function(v,l,h,f){var _,S=arguments.length,k=S<3?l:f===null?f=Object.getOwnPropertyDescriptor(l,h):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(v,l,h,f);else for(var P=v.length-1;P>=0;P--)(_=v[P])&&(k=(S<3?_(k):S>3?_(l,h,k):_(l,h))||k);return S>3&&k&&Object.defineProperty(l,h,k),k},p=this&&this.__param||function(v,l){return function(h,f){l(h,f,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;const u=o(4725),g=o(2585),m=o(2584);let y=r.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(v,l,h,f,_,S){this._textarea=v,this._compositionView=l,this._bufferService=h,this._optionsService=f,this._coreService=_,this._renderService=S,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(v){this._compositionView.textContent=v.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(v){if(this._isComposing||this._isSendingComposition){if(v.keyCode===229||v.keyCode===16||v.keyCode===17||v.keyCode===18)return!1;this._finalizeComposition(!1)}return v.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(v){if(this._compositionView.classList.remove("active"),this._isComposing=!1,v){const l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,l.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(l.start,l.end):this._textarea.value.substring(l.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}},0)}else{this._isSendingComposition=!1;const l=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(l,!0)}}_handleAnyTextareaChanges(){const v=this._textarea.value;setTimeout(()=>{if(!this._isComposing){const l=this._textarea.value,h=l.replace(v,"");this._dataAlreadySent=h,l.length>v.length?this._coreService.triggerDataEvent(h,!0):l.lengththis.updateCompositionElements(!0),0)}}};r.CompositionHelper=y=c([p(2,g.IBufferService),p(3,g.IOptionsService),p(4,g.ICoreService),p(5,u.IRenderService)],y)},9806:(d,r)=>{function o(c,p,u){const g=u.getBoundingClientRect(),m=c.getComputedStyle(u),y=parseInt(m.getPropertyValue("padding-left")),v=parseInt(m.getPropertyValue("padding-top"));return[p.clientX-g.left-y,p.clientY-g.top-v]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=o,r.getCoords=function(c,p,u,g,m,y,v,l,h){if(!y)return;const f=o(c,p,u);return f?(f[0]=Math.ceil((f[0]+(h?v/2:0))/v),f[1]=Math.ceil(f[1]/l),f[0]=Math.min(Math.max(f[0],1),g+(h?1:0)),f[1]=Math.min(Math.max(f[1],1),m),f):void 0}},9504:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;const c=o(2584);function p(l,h,f,_){const S=l-u(l,f),k=h-u(h,f),P=Math.abs(S-k)-function(M,w,T){let A=0;const E=M-u(M,T),R=w-u(w,T);for(let D=0;D=0&&lh?"A":"B"}function m(l,h,f,_,S,k){let P=l,M=h,w="";for(;P!==f||M!==_;)P+=S?1:-1,S&&P>k.cols-1?(w+=k.buffer.translateBufferLineToString(M,!1,l,P),P=0,l=0,M++):!S&&P<0&&(w+=k.buffer.translateBufferLineToString(M,!1,0,l+1),P=k.cols-1,l=P,M--);return w+k.buffer.translateBufferLineToString(M,!1,l,P)}function y(l,h){const f=h?"O":"[";return c.C0.ESC+f+l}function v(l,h){l=Math.floor(l);let f="";for(let _=0;_0?E-u(E,R):T;const O=E,U=function(W,z,N,V,q,G){let te;return te=p(N,V,q,G).length>0?V-u(V,q):z,W=N&&tel?"D":"C",v(Math.abs(S-l),y(P,_));P=k>h?"D":"C";const M=Math.abs(k-h);return v(function(w,T){return T.cols-w}(k>h?l:S,f)+(M-1)*f.cols+1+((k>h?S:l)-1),y(P,_))}},1296:function(d,r,o){var c=this&&this.__decorate||function(R,D,I,O){var U,W=arguments.length,z=W<3?D:O===null?O=Object.getOwnPropertyDescriptor(D,I):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")z=Reflect.decorate(R,D,I,O);else for(var N=R.length-1;N>=0;N--)(U=R[N])&&(z=(W<3?U(z):W>3?U(D,I,z):U(D,I))||z);return W>3&&z&&Object.defineProperty(D,I,z),z},p=this&&this.__param||function(R,D){return function(I,O){D(I,O,R)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;const u=o(3787),g=o(2550),m=o(2223),y=o(6171),v=o(4725),l=o(8055),h=o(8460),f=o(844),_=o(2585),S="xterm-dom-renderer-owner-",k="xterm-rows",P="xterm-fg-",M="xterm-bg-",w="xterm-focus",T="xterm-selection";let A=1,E=r.DomRenderer=class extends f.Disposable{constructor(R,D,I,O,U,W,z,N,V,q){super(),this._element=R,this._screenElement=D,this._viewportElement=I,this._linkifier2=O,this._charSizeService=W,this._optionsService=z,this._bufferService=N,this._coreBrowserService=V,this._themeService=q,this._terminalClass=A++,this._rowElements=[],this.onRequestRedraw=this.register(new h.EventEmitter).event,this._rowContainer=document.createElement("div"),this._rowContainer.classList.add(k),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add(T),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._themeService.onChangeColors(G=>this._injectCss(G))),this._injectCss(this._themeService.colors),this._rowFactory=U.createInstance(u.DomRendererRowFactory,document),this._element.classList.add(S+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(G=>this._handleLinkHover(G))),this.register(this._linkifier2.onHideLinkUnderline(G=>this._handleLinkLeave(G))),this.register((0,f.toDisposable)(()=>{this._element.classList.remove(S+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new g.WidthCache(document),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){const R=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*R,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*R),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/R),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/R),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(const I of this._rowElements)I.style.width=`${this.dimensions.css.canvas.width}px`,I.style.height=`${this.dimensions.css.cell.height}px`,I.style.lineHeight=`${this.dimensions.css.cell.height}px`,I.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const D=`${this._terminalSelector} .${k} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=D,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(R){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let D=`${this._terminalSelector} .${k} { color: ${R.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;D+=`${this._terminalSelector} .${k} .xterm-dim { color: ${l.color.multiplyOpacity(R.foreground,.5).css};}`,D+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`,D+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { border-bottom-style: hidden; }}",D+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css}; } 50% { background-color: inherit; color: ${R.cursor.css}; }}`,D+=`${this._terminalSelector} .${k}.${w} .xterm-cursor.xterm-cursor-blink:not(.xterm-cursor-block) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${k}.${w} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-block { background-color: ${R.cursor.css}; color: ${R.cursorAccent.css};}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${R.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${R.cursor.css} inset;}${this._terminalSelector} .${k} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${R.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,D+=`${this._terminalSelector} .${T} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${T} div { position: absolute; background-color: ${R.selectionBackgroundOpaque.css};}${this._terminalSelector} .${T} div { position: absolute; background-color: ${R.selectionInactiveBackgroundOpaque.css};}`;for(const[I,O]of R.ansi.entries())D+=`${this._terminalSelector} .${P}${I} { color: ${O.css}; }${this._terminalSelector} .${P}${I}.xterm-dim { color: ${l.color.multiplyOpacity(O,.5).css}; }${this._terminalSelector} .${M}${I} { background-color: ${O.css}; }`;D+=`${this._terminalSelector} .${P}${m.INVERTED_DEFAULT_COLOR} { color: ${l.color.opaque(R.background).css}; }${this._terminalSelector} .${P}${m.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${l.color.multiplyOpacity(l.color.opaque(R.background),.5).css}; }${this._terminalSelector} .${M}${m.INVERTED_DEFAULT_COLOR} { background-color: ${R.foreground.css}; }`,this._themeStyleElement.textContent=D}_setDefaultSpacing(){const R=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${R}px`,this._rowFactory.defaultSpacing=R}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(R,D){for(let I=this._rowElements.length;I<=D;I++){const O=document.createElement("div");this._rowContainer.appendChild(O),this._rowElements.push(O)}for(;this._rowElements.length>D;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(R,D){this._refreshRowElements(R,D),this._updateDimensions()}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(w)}handleFocus(){this._rowContainer.classList.add(w),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(R,D,I){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(R,D,I),this.renderRows(0,this._bufferService.rows-1),!R||!D)return;const O=R[1]-this._bufferService.buffer.ydisp,U=D[1]-this._bufferService.buffer.ydisp,W=Math.max(O,0),z=Math.min(U,this._bufferService.rows-1);if(W>=this._bufferService.rows||z<0)return;const N=document.createDocumentFragment();if(I){const V=R[0]>D[0];N.appendChild(this._createSelectionElement(W,V?D[0]:R[0],V?R[0]:D[0],z-W+1))}else{const V=O===W?R[0]:0,q=W===U?D[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(W,V,q));const G=z-W-1;if(N.appendChild(this._createSelectionElement(W+1,0,this._bufferService.cols,G)),W!==z){const te=U===z?D[0]:this._bufferService.cols;N.appendChild(this._createSelectionElement(z,0,te))}}this._selectionContainer.appendChild(N)}_createSelectionElement(R,D,I,O=1){const U=document.createElement("div");return U.style.height=O*this.dimensions.css.cell.height+"px",U.style.top=R*this.dimensions.css.cell.height+"px",U.style.left=D*this.dimensions.css.cell.width+"px",U.style.width=this.dimensions.css.cell.width*(I-D)+"px",U}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(const R of this._rowElements)R.replaceChildren()}renderRows(R,D){const I=this._bufferService.buffer,O=I.ybase+I.y,U=Math.min(I.x,this._bufferService.cols-1),W=this._optionsService.rawOptions.cursorBlink,z=this._optionsService.rawOptions.cursorStyle,N=this._optionsService.rawOptions.cursorInactiveStyle;for(let V=R;V<=D;V++){const q=V+I.ydisp,G=this._rowElements[V],te=I.lines.get(q);if(!G||!te)break;G.replaceChildren(...this._rowFactory.createRow(te,q,q===O,z,N,U,W,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${S}${this._terminalClass}`}_handleLinkHover(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!0)}_handleLinkLeave(R){this._setCellUnderline(R.x1,R.x2,R.y1,R.y2,R.cols,!1)}_setCellUnderline(R,D,I,O,U,W){I<0&&(R=0),O<0&&(D=0);const z=this._bufferService.rows-1;I=Math.max(Math.min(I,z),0),O=Math.max(Math.min(O,z),0),U=Math.min(U,this._bufferService.cols);const N=this._bufferService.buffer,V=N.ybase+N.y,q=Math.min(N.x,U-1),G=this._optionsService.rawOptions.cursorBlink,te=this._optionsService.rawOptions.cursorStyle,oe=this._optionsService.rawOptions.cursorInactiveStyle;for(let ie=I;ie<=O;++ie){const ye=ie+N.ydisp,K=this._rowElements[ie],J=N.lines.get(ye);if(!K||!J)break;K.replaceChildren(...this._rowFactory.createRow(J,ye,ye===V,te,oe,q,G,this.dimensions.css.cell.width,this._widthCache,W?ie===I?R:0:-1,W?(ie===O?D:U)-1:-1))}}};r.DomRenderer=E=c([p(4,_.IInstantiationService),p(5,v.ICharSizeService),p(6,_.IOptionsService),p(7,_.IBufferService),p(8,v.ICoreBrowserService),p(9,v.IThemeService)],E)},3787:function(d,r,o){var c=this&&this.__decorate||function(P,M,w,T){var A,E=arguments.length,R=E<3?M:T===null?T=Object.getOwnPropertyDescriptor(M,w):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(P,M,w,T);else for(var D=P.length-1;D>=0;D--)(A=P[D])&&(R=(E<3?A(R):E>3?A(M,w,R):A(M,w))||R);return E>3&&R&&Object.defineProperty(M,w,R),R},p=this&&this.__param||function(P,M){return function(w,T){M(w,T,P)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=void 0;const u=o(2223),g=o(643),m=o(511),y=o(2585),v=o(8055),l=o(4725),h=o(4269),f=o(6171),_=o(3734);let S=r.DomRendererRowFactory=class{constructor(P,M,w,T,A,E,R){this._document=P,this._characterJoinerService=M,this._optionsService=w,this._coreBrowserService=T,this._coreService=A,this._decorationService=E,this._themeService=R,this._workCell=new m.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(P,M,w){this._selectionStart=P,this._selectionEnd=M,this._columnSelectMode=w}createRow(P,M,w,T,A,E,R,D,I,O,U){const W=[],z=this._characterJoinerService.getJoinedCharacters(M),N=this._themeService.colors;let V,q=P.getNoBgTrimmedLength();w&&q0&&Ye===z[0][0]){ue=!0;const Je=z.shift();re=new h.JoinedCellData(this._workCell,P.translateToString(!0,Je[0],Je[1]),Je[1]-Je[0]),et=Je[1]-1,Ze=re.getWidth()}const we=this._isCellInSelection(Ye,M),fe=w&&Ye===E,De=Ee&&Ye>=O&&Ye<=U;let Qe=!1;this._decorationService.forEachDecorationAtCell(Ye,M,void 0,Je=>{Qe=!0});let We=re.getChars()||g.WHITESPACE_CELL_CHAR;if(We===" "&&(re.isUnderline()||re.isOverline())&&(We=" "),ce=Ze*D-I.get(We,re.isBold(),re.isItalic()),V){if(G&&(we&&Q||!we&&!Q&&re.bg===oe)&&(we&&Q&&N.selectionForeground||re.fg===ie)&&re.extended.ext===ye&&De===K&&ce===J&&!fe&&!ue&&!Qe){te+=We,G++;continue}G&&(V.textContent=te),V=this._document.createElement("span"),G=0,te=""}else V=this._document.createElement("span");if(oe=re.bg,ie=re.fg,ye=re.extended.ext,K=De,J=ce,Q=we,ue&&E>=Ye&&E<=et&&(E=Ye),!this._coreService.isCursorHidden&&fe){if(Fe.push("xterm-cursor"),this._coreBrowserService.isFocused)R&&Fe.push("xterm-cursor-blink"),Fe.push(T==="bar"?"xterm-cursor-bar":T==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(A)switch(A){case"outline":Fe.push("xterm-cursor-outline");break;case"block":Fe.push("xterm-cursor-block");break;case"bar":Fe.push("xterm-cursor-bar");break;case"underline":Fe.push("xterm-cursor-underline")}}if(re.isBold()&&Fe.push("xterm-bold"),re.isItalic()&&Fe.push("xterm-italic"),re.isDim()&&Fe.push("xterm-dim"),te=re.isInvisible()?g.WHITESPACE_CELL_CHAR:re.getChars()||g.WHITESPACE_CELL_CHAR,re.isUnderline()&&(Fe.push(`xterm-underline-${re.extended.underlineStyle}`),te===" "&&(te=" "),!re.isUnderlineColorDefault()))if(re.isUnderlineColorRGB())V.style.textDecorationColor=`rgb(${_.AttributeData.toColorRGB(re.getUnderlineColor()).join(",")})`;else{let Je=re.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&re.isBold()&&Je<8&&(Je+=8),V.style.textDecorationColor=N.ansi[Je].css}re.isOverline()&&(Fe.push("xterm-overline"),te===" "&&(te=" ")),re.isStrikethrough()&&Fe.push("xterm-strikethrough"),De&&(V.style.textDecoration="underline");let ae=re.getFgColor(),_e=re.getFgColorMode(),be=re.getBgColor(),Me=re.getBgColorMode();const x=!!re.isInverse();if(x){const Je=ae;ae=be,be=Je;const wt=_e;_e=Me,Me=wt}let Re,Ge,Ve,kt=!1;switch(this._decorationService.forEachDecorationAtCell(Ye,M,void 0,Je=>{Je.options.layer!=="top"&&kt||(Je.backgroundColorRGB&&(Me=50331648,be=Je.backgroundColorRGB.rgba>>8&16777215,Re=Je.backgroundColorRGB),Je.foregroundColorRGB&&(_e=50331648,ae=Je.foregroundColorRGB.rgba>>8&16777215,Ge=Je.foregroundColorRGB),kt=Je.options.layer==="top")}),!kt&&we&&(Re=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,be=Re.rgba>>8&16777215,Me=50331648,kt=!0,N.selectionForeground&&(_e=50331648,ae=N.selectionForeground.rgba>>8&16777215,Ge=N.selectionForeground)),kt&&Fe.push("xterm-decoration-top"),Me){case 16777216:case 33554432:Ve=N.ansi[be],Fe.push(`xterm-bg-${be}`);break;case 50331648:Ve=v.rgba.toColor(be>>16,be>>8&255,255&be),this._addStyle(V,`background-color:#${k((be>>>0).toString(16),"0",6)}`);break;default:x?(Ve=N.foreground,Fe.push(`xterm-bg-${u.INVERTED_DEFAULT_COLOR}`)):Ve=N.background}switch(Re||re.isDim()&&(Re=v.color.multiplyOpacity(Ve,.5)),_e){case 16777216:case 33554432:re.isBold()&&ae<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ae+=8),this._applyMinimumContrast(V,Ve,N.ansi[ae],re,Re,void 0)||Fe.push(`xterm-fg-${ae}`);break;case 50331648:const Je=v.rgba.toColor(ae>>16&255,ae>>8&255,255&ae);this._applyMinimumContrast(V,Ve,Je,re,Re,Ge)||this._addStyle(V,`color:#${k(ae.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(V,Ve,N.foreground,re,Re,void 0)||x&&Fe.push(`xterm-fg-${u.INVERTED_DEFAULT_COLOR}`)}Fe.length&&(V.className=Fe.join(" "),Fe.length=0),fe||ue||Qe?V.textContent=te:G++,ce!==this.defaultSpacing&&(V.style.letterSpacing=`${ce}px`),W.push(V),Ye=et}return V&&G&&(V.textContent=te),W}_applyMinimumContrast(P,M,w,T,A,E){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,f.excludeFromContrastRatioDemands)(T.getCode()))return!1;const R=this._getContrastCache(T);let D;if(A||E||(D=R.getColor(M.rgba,w.rgba)),D===void 0){const I=this._optionsService.rawOptions.minimumContrastRatio/(T.isDim()?2:1);D=v.color.ensureContrastRatio(A||M,E||w,I),R.setColor((A||M).rgba,(E||w).rgba,D??null)}return!!D&&(this._addStyle(P,`color:${D.css}`),!0)}_getContrastCache(P){return P.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(P,M){P.setAttribute("style",`${P.getAttribute("style")||""}${M};`)}_isCellInSelection(P,M){const w=this._selectionStart,T=this._selectionEnd;return!(!w||!T)&&(this._columnSelectMode?w[0]<=T[0]?P>=w[0]&&M>=w[1]&&P=w[1]&&P>=T[0]&&M<=T[1]:M>w[1]&&M=w[0]&&P=w[0])}};function k(P,M,w){for(;P.length{Object.defineProperty(r,"__esModule",{value:!0}),r.WidthCache=void 0,r.WidthCache=class{constructor(o){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=o.createElement("div"),this._container.style.position="absolute",this._container.style.top="-50000px",this._container.style.width="50000px",this._container.style.whiteSpace="pre",this._container.style.fontKerning="none";const c=o.createElement("span"),p=o.createElement("span");p.style.fontWeight="bold";const u=o.createElement("span");u.style.fontStyle="italic";const g=o.createElement("span");g.style.fontWeight="bold",g.style.fontStyle="italic",this._measureElements=[c,p,u,g],this._container.appendChild(c),this._container.appendChild(p),this._container.appendChild(u),this._container.appendChild(g),o.body.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(o,c,p,u){o===this._font&&c===this._fontSize&&p===this._weight&&u===this._weightBold||(this._font=o,this._fontSize=c,this._weight=p,this._weightBold=u,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${p}`,this._measureElements[1].style.fontWeight=`${u}`,this._measureElements[2].style.fontWeight=`${p}`,this._measureElements[3].style.fontWeight=`${u}`,this.clear())}get(o,c,p){let u=0;if(!c&&!p&&o.length===1&&(u=o.charCodeAt(0))<256)return this._flat[u]!==-9999?this._flat[u]:this._flat[u]=this._measure(o,0);let g=o;c&&(g+="B"),p&&(g+="I");let m=this._holey.get(g);if(m===void 0){let y=0;c&&(y|=1),p&&(y|=2),m=this._measure(o,y),this._holey.set(g,m)}return m}_measure(o,c){const p=this._measureElements[c];return p.textContent=o.repeat(32),p.offsetWidth/32}}},2223:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const c=o(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},6171:(d,r)=>{function o(c){return 57508<=c&&c<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},r.excludeFromContrastRatioDemands=function(c){return o(c)||function(p){return 9472<=p&&p<=9631}(c)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},456:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(o){this._bufferService=o,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?o%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)-1]:[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[o,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const o=this.selectionStart[0]+this.selectionStartLength;return o>this._bufferService.cols?[o%this._bufferService.cols,this.selectionStart[1]+Math.floor(o/this._bufferService.cols)]:[Math.max(o,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const o=this.selectionStart,c=this.selectionEnd;return!(!o||!c)&&(o[1]>c[1]||o[1]===c[1]&&o[0]>c[0])}handleTrim(o){return this.selectionStart&&(this.selectionStart[1]-=o),this.selectionEnd&&(this.selectionEnd[1]-=o),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;const u=o(2585),g=o(8460),m=o(844);let y=r.CharSizeService=class extends m.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,h,f){super(),this._optionsService=f,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event,this._measureStrategy=new v(l,h,this._optionsService),this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],()=>this.measure()))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};r.CharSizeService=y=c([p(2,u.IOptionsService)],y);class v{constructor(h,f,_){this._document=h,this._parentElement=f,this._optionsService=_,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W".repeat(32),this._measureElement.setAttribute("aria-hidden","true"),this._measureElement.style.whiteSpace="pre",this._measureElement.style.fontKerning="none",this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;const h={height:Number(this._measureElement.offsetHeight),width:Number(this._measureElement.offsetWidth)};return h.width!==0&&h.height!==0&&(this._result.width=h.width/32,this._result.height=Math.ceil(h.height)),this._result}}},4269:function(d,r,o){var c=this&&this.__decorate||function(h,f,_,S){var k,P=arguments.length,M=P<3?f:S===null?S=Object.getOwnPropertyDescriptor(f,_):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(h,f,_,S);else for(var w=h.length-1;w>=0;w--)(k=h[w])&&(M=(P<3?k(M):P>3?k(f,_,M):k(f,_))||M);return P>3&&M&&Object.defineProperty(f,_,M),M},p=this&&this.__param||function(h,f){return function(_,S){f(_,S,h)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;const u=o(3734),g=o(643),m=o(511),y=o(2585);class v extends u.AttributeData{constructor(f,_,S){super(),this.content=0,this.combinedData="",this.fg=f.fg,this.bg=f.bg,this.combinedData=_,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(f){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.JoinedCellData=v;let l=r.CharacterJoinerService=class zm{constructor(f){this._bufferService=f,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new m.CellData}register(f){const _={id:this._nextCharacterJoinerId++,handler:f};return this._characterJoiners.push(_),_.id}deregister(f){for(let _=0;_1){const R=this._getJoinedRanges(k,w,M,_,P);for(let D=0;D1){const E=this._getJoinedRanges(k,w,M,_,P);for(let R=0;R{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(o,c){this._textarea=o,this.window=c,this._isFocused=!1,this._cachedIsFocused=void 0,this._textarea.addEventListener("focus",()=>this._isFocused=!0),this._textarea.addEventListener("blur",()=>this._isFocused=!1)}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}}},8934:function(d,r,o){var c=this&&this.__decorate||function(y,v,l,h){var f,_=arguments.length,S=_<3?v:h===null?h=Object.getOwnPropertyDescriptor(v,l):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,v,l,h);else for(var k=y.length-1;k>=0;k--)(f=y[k])&&(S=(_<3?f(S):_>3?f(v,l,S):f(v,l))||S);return _>3&&S&&Object.defineProperty(v,l,S),S},p=this&&this.__param||function(y,v){return function(l,h){v(l,h,y)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;const u=o(4725),g=o(9806);let m=r.MouseService=class{constructor(y,v){this._renderService=y,this._charSizeService=v}getCoords(y,v,l,h,f){return(0,g.getCoords)(window,y,v,l,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,f)}getMouseReportCoords(y,v){const l=(0,g.getCoordsRelativeToElement)(window,y,v);if(this._charSizeService.hasValidSize)return l[0]=Math.min(Math.max(l[0],0),this._renderService.dimensions.css.canvas.width-1),l[1]=Math.min(Math.max(l[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(l[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(l[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(l[0]),y:Math.floor(l[1])}}};r.MouseService=m=c([p(0,u.IRenderService),p(1,u.ICharSizeService)],m)},3230:function(d,r,o){var c=this&&this.__decorate||function(S,k,P,M){var w,T=arguments.length,A=T<3?k:M===null?M=Object.getOwnPropertyDescriptor(k,P):M;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(S,k,P,M);else for(var E=S.length-1;E>=0;E--)(w=S[E])&&(A=(T<3?w(A):T>3?w(k,P,A):w(k,P))||A);return T>3&&A&&Object.defineProperty(k,P,A),A},p=this&&this.__param||function(S,k){return function(P,M){k(P,M,S)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;const u=o(3656),g=o(6193),m=o(5596),y=o(4725),v=o(8460),l=o(844),h=o(7226),f=o(2585);let _=r.RenderService=class extends l.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(S,k,P,M,w,T,A,E){if(super(),this._rowCount=S,this._charSizeService=M,this._renderer=this.register(new l.MutableDisposable),this._pausedResizeTask=new h.DebouncedIdleTask,this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this.register(new v.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new v.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new v.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new v.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new g.RenderDebouncer(A.window,(R,D)=>this._renderRows(R,D)),this.register(this._renderDebouncer),this._screenDprMonitor=new m.ScreenDprMonitor(A.window),this._screenDprMonitor.setListener(()=>this.handleDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(T.onResize(()=>this._fullRefresh())),this.register(T.buffers.onBufferActivate(()=>{var R;return(R=this._renderer.value)===null||R===void 0?void 0:R.clear()})),this.register(P.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this.register(w.onDecorationRegistered(()=>this._fullRefresh())),this.register(w.onDecorationRemoved(()=>this._fullRefresh())),this.register(P.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio"],()=>{this.clear(),this.handleResize(T.cols,T.rows),this._fullRefresh()})),this.register(P.onMultipleOptionChange(["cursorBlink","cursorStyle"],()=>this.refreshRows(T.buffer.y,T.buffer.y,!0))),this.register((0,u.addDisposableDomListener)(A.window,"resize",()=>this.handleDevicePixelRatioChange())),this.register(E.onChangeColors(()=>this._fullRefresh())),"IntersectionObserver"in A.window){const R=new A.window.IntersectionObserver(D=>this._handleIntersectionChange(D[D.length-1]),{threshold:0});R.observe(k),this.register({dispose:()=>R.disconnect()})}}_handleIntersectionChange(S){this._isPaused=S.isIntersecting===void 0?S.intersectionRatio===0:!S.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(S,k,P=!1){this._isPaused?this._needsFullRefresh=!0:(P||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(S,k,this._rowCount))}_renderRows(S,k){this._renderer.value&&(S=Math.min(S,this._rowCount-1),k=Math.min(k,this._rowCount-1),this._renderer.value.renderRows(S,k),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:S,end:k}),this._onRender.fire({start:S,end:k}),this._isNextRenderRedrawOnly=!0)}resize(S,k){this._rowCount=k,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(S){this._renderer.value=S,this._renderer.value.onRequestRedraw(k=>this.refreshRows(k.start,k.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(S){return this._renderDebouncer.addRefreshCallback(S)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var S,k;this._renderer.value&&((k=(S=this._renderer.value).clearTextureAtlas)===null||k===void 0||k.call(S),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(S,k){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value.handleResize(S,k)):this._renderer.value.handleResize(S,k),this._fullRefresh())}handleCharSizeChanged(){var S;(S=this._renderer.value)===null||S===void 0||S.handleCharSizeChanged()}handleBlur(){var S;(S=this._renderer.value)===null||S===void 0||S.handleBlur()}handleFocus(){var S;(S=this._renderer.value)===null||S===void 0||S.handleFocus()}handleSelectionChanged(S,k,P){var M;this._selectionState.start=S,this._selectionState.end=k,this._selectionState.columnSelectMode=P,(M=this._renderer.value)===null||M===void 0||M.handleSelectionChanged(S,k,P)}handleCursorMove(){var S;(S=this._renderer.value)===null||S===void 0||S.handleCursorMove()}clear(){var S;(S=this._renderer.value)===null||S===void 0||S.clear()}};r.RenderService=_=c([p(2,f.IOptionsService),p(3,y.ICharSizeService),p(4,f.IDecorationService),p(5,f.IBufferService),p(6,y.ICoreBrowserService),p(7,y.IThemeService)],_)},9312:function(d,r,o){var c=this&&this.__decorate||function(w,T,A,E){var R,D=arguments.length,I=D<3?T:E===null?E=Object.getOwnPropertyDescriptor(T,A):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(w,T,A,E);else for(var O=w.length-1;O>=0;O--)(R=w[O])&&(I=(D<3?R(I):D>3?R(T,A,I):R(T,A))||I);return D>3&&I&&Object.defineProperty(T,A,I),I},p=this&&this.__param||function(w,T){return function(A,E){T(A,E,w)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;const u=o(9806),g=o(9504),m=o(456),y=o(4725),v=o(8460),l=o(844),h=o(6114),f=o(4841),_=o(511),S=o(2585),k=" ",P=new RegExp(k,"g");let M=r.SelectionService=class extends l.Disposable{constructor(w,T,A,E,R,D,I,O,U){super(),this._element=w,this._screenElement=T,this._linkifier=A,this._bufferService=E,this._coreService=R,this._mouseService=D,this._optionsService=I,this._renderService=O,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new v.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new v.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new v.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new v.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=W=>this._handleMouseMove(W),this._mouseUpListener=W=>this._handleMouseUp(W),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(W=>this._handleTrim(W)),this.register(this._bufferService.buffers.onBufferActivate(W=>this._handleBufferActivate(W))),this.enable(),this._model=new m.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,l.toDisposable)(()=>{this._removeMouseDownListeners()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){const w=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;return!(!w||!T||w[0]===T[0]&&w[1]===T[1])}get selectionText(){const w=this._model.finalSelectionStart,T=this._model.finalSelectionEnd;if(!w||!T)return"";const A=this._bufferService.buffer,E=[];if(this._activeSelectionMode===3){if(w[0]===T[0])return"";const R=w[0]R.replace(P," ")).join(h.isWindows?`\r +`:` +`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(w){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h.isLinux&&w&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(w){const T=this._getMouseBufferCoords(w),A=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!!(A&&E&&T)&&this._areCoordsInSelection(T,A,E)}isCellInSelection(w,T){const A=this._model.finalSelectionStart,E=this._model.finalSelectionEnd;return!(!A||!E)&&this._areCoordsInSelection([w,T],A,E)}_areCoordsInSelection(w,T,A){return w[1]>T[1]&&w[1]=T[0]&&w[0]=T[0]}_selectWordAtCursor(w,T){var A,E;const R=(E=(A=this._linkifier.currentLink)===null||A===void 0?void 0:A.link)===null||E===void 0?void 0:E.range;if(R)return this._model.selectionStart=[R.start.x-1,R.start.y-1],this._model.selectionStartLength=(0,f.getRangeLength)(R,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const D=this._getMouseBufferCoords(w);return!!D&&(this._selectWordAt(D,T),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(w,T){this._model.clearSelection(),w=Math.max(w,0),T=Math.min(T,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,w],this._model.selectionEnd=[this._bufferService.cols,T],this.refresh(),this._onSelectionChange.fire()}_handleTrim(w){this._model.handleTrim(w)&&this.refresh()}_getMouseBufferCoords(w){const T=this._mouseService.getCoords(w,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(T)return T[0]--,T[1]--,T[1]+=this._bufferService.buffer.ydisp,T}_getMouseEventScrollAmount(w){let T=(0,u.getCoordsRelativeToElement)(this._coreBrowserService.window,w,this._screenElement)[1];const A=this._renderService.dimensions.css.canvas.height;return T>=0&&T<=A?0:(T>A&&(T-=A),T=Math.min(Math.max(T,-50),50),T/=50,T/Math.abs(T)+Math.round(14*T))}shouldForceSelection(w){return h.isMac?w.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:w.shiftKey}handleMouseDown(w){if(this._mouseDownTimeStamp=w.timeStamp,(w.button!==2||!this.hasSelection)&&w.button===0){if(!this._enabled){if(!this.shouldForceSelection(w))return;w.stopPropagation()}w.preventDefault(),this._dragScrollAmount=0,this._enabled&&w.shiftKey?this._handleIncrementalClick(w):w.detail===1?this._handleSingleClick(w):w.detail===2?this._handleDoubleClick(w):w.detail===3&&this._handleTripleClick(w),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),50)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(w){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(w))}_handleSingleClick(w){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(w)?3:0,this._model.selectionStart=this._getMouseBufferCoords(w),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const T=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);T&&T.length!==this._model.selectionStart[0]&&T.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(w){this._selectWordAtCursor(w,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(w){const T=this._getMouseBufferCoords(w);T&&(this._activeSelectionMode=2,this._selectLineAt(T[1]))}shouldColumnSelect(w){return w.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(w){if(w.stopImmediatePropagation(),!this._model.selectionStart)return;const T=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(w),!this._model.selectionEnd)return void this.refresh(!0);this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const A=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(w.ydisp+this._bufferService.rows,w.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=w.ydisp),this.refresh()}}_handleMouseUp(w){const T=w.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&T<500&&w.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const A=this._mouseService.getCoords(w,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(A&&A[0]!==void 0&&A[1]!==void 0){const E=(0,g.moveToCellSequence)(A[0]-1,A[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(E,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const w=this._model.finalSelectionStart,T=this._model.finalSelectionEnd,A=!(!w||!T||w[0]===T[0]&&w[1]===T[1]);A?w&&T&&(this._oldSelectionStart&&this._oldSelectionEnd&&w[0]===this._oldSelectionStart[0]&&w[1]===this._oldSelectionStart[1]&&T[0]===this._oldSelectionEnd[0]&&T[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(w,T,A)):this._oldHasSelection&&this._fireOnSelectionChange(w,T,A)}_fireOnSelectionChange(w,T,A){this._oldSelectionStart=w,this._oldSelectionEnd=T,this._oldHasSelection=A,this._onSelectionChange.fire()}_handleBufferActivate(w){this.clearSelection(),this._trimListener.dispose(),this._trimListener=w.activeBuffer.lines.onTrim(T=>this._handleTrim(T))}_convertViewportColToCharacterIndex(w,T){let A=T;for(let E=0;T>=E;E++){const R=w.loadCell(E,this._workCell).getChars().length;this._workCell.getWidth()===0?A--:R>1&&T!==E&&(A+=R-1)}return A}setSelection(w,T,A){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[w,T],this._model.selectionStartLength=A,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(w){this._isClickInSelection(w)||(this._selectWordAtCursor(w,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(w,T,A=!0,E=!0){if(w[0]>=this._bufferService.cols)return;const R=this._bufferService.buffer,D=R.lines.get(w[1]);if(!D)return;const I=R.translateBufferLineToString(w[1],!1);let O=this._convertViewportColToCharacterIndex(D,w[0]),U=O;const W=w[0]-O;let z=0,N=0,V=0,q=0;if(I.charAt(O)===" "){for(;O>0&&I.charAt(O-1)===" ";)O--;for(;U1&&(q+=ye-1,U+=ye-1);oe>0&&O>0&&!this._isCharWordSeparator(D.loadCell(oe-1,this._workCell));){D.loadCell(oe-1,this._workCell);const K=this._workCell.getChars().length;this._workCell.getWidth()===0?(z++,oe--):K>1&&(V+=K-1,O-=K-1),O--,oe--}for(;ie1&&(q+=K-1,U+=K-1),U++,ie++}}U++;let G=O+W-z+V,te=Math.min(this._bufferService.cols,U-O+z+N-V-q);if(T||I.slice(O,U).trim()!==""){if(A&&G===0&&D.getCodePoint(0)!==32){const oe=R.lines.get(w[1]-1);if(oe&&D.isWrapped&&oe.getCodePoint(this._bufferService.cols-1)!==32){const ie=this._getWordAt([this._bufferService.cols-1,w[1]-1],!1,!0,!1);if(ie){const ye=this._bufferService.cols-ie.start;G-=ye,te+=ye}}}if(E&&G+te===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const oe=R.lines.get(w[1]+1);if(oe!=null&&oe.isWrapped&&oe.getCodePoint(0)!==32){const ie=this._getWordAt([0,w[1]+1],!1,!1,!0);ie&&(te+=ie.length)}}return{start:G,length:te}}}_selectWordAt(w,T){const A=this._getWordAt(w,T);if(A){for(;A.start<0;)A.start+=this._bufferService.cols,w[1]--;this._model.selectionStart=[A.start,w[1]],this._model.selectionStartLength=A.length}}_selectToWordAt(w){const T=this._getWordAt(w,!0);if(T){let A=w[1];for(;T.start<0;)T.start+=this._bufferService.cols,A--;if(!this._model.areSelectionValuesReversed())for(;T.start+T.length>this._bufferService.cols;)T.length-=this._bufferService.cols,A++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?T.start:T.start+T.length,A]}}_isCharWordSeparator(w){return w.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(w.getChars())>=0}_selectLineAt(w){const T=this._bufferService.buffer.getWrappedRangeForLine(w),A={start:{x:0,y:T.first},end:{x:this._bufferService.cols-1,y:T.last}};this._model.selectionStart=[0,T.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,f.getRangeLength)(A,this._bufferService.cols)}};r.SelectionService=M=c([p(3,S.IBufferService),p(4,S.ICoreService),p(5,y.IMouseService),p(6,S.IOptionsService),p(7,y.IRenderService),p(8,y.ICoreBrowserService)],M)},4725:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IThemeService=r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;const c=o(8343);r.ICharSizeService=(0,c.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,c.createDecorator)("CoreBrowserService"),r.IMouseService=(0,c.createDecorator)("MouseService"),r.IRenderService=(0,c.createDecorator)("RenderService"),r.ISelectionService=(0,c.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,c.createDecorator)("CharacterJoinerService"),r.IThemeService=(0,c.createDecorator)("ThemeService")},6731:function(d,r,o){var c=this&&this.__decorate||function(M,w,T,A){var E,R=arguments.length,D=R<3?w:A===null?A=Object.getOwnPropertyDescriptor(w,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(M,w,T,A);else for(var I=M.length-1;I>=0;I--)(E=M[I])&&(D=(R<3?E(D):R>3?E(w,T,D):E(w,T))||D);return R>3&&D&&Object.defineProperty(w,T,D),D},p=this&&this.__param||function(M,w){return function(T,A){w(T,A,M)}};Object.defineProperty(r,"__esModule",{value:!0}),r.ThemeService=r.DEFAULT_ANSI_COLORS=void 0;const u=o(7239),g=o(8055),m=o(8460),y=o(844),v=o(2585),l=g.css.toColor("#ffffff"),h=g.css.toColor("#000000"),f=g.css.toColor("#ffffff"),_=g.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],w=[0,95,135,175,215,255];for(let T=0;T<216;T++){const A=w[T/36%6|0],E=w[T/6%6|0],R=w[T%6];M.push({css:g.channels.toCss(A,E,R),rgba:g.channels.toRgba(A,E,R)})}for(let T=0;T<24;T++){const A=8+10*T;M.push({css:g.channels.toCss(A,A,A),rgba:g.channels.toRgba(A,A,A)})}return M})());let k=r.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new u.ColorContrastCache,this._halfContrastCache=new u.ColorContrastCache,this._onChangeColors=this.register(new m.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:l,background:h,cursor:f,cursorAccent:_,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:g.color.blend(h,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:g.color.blend(h,S),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this.register(this._optionsService.onSpecificOptionChange("minimumContrastRatio",()=>this._contrastCache.clear())),this.register(this._optionsService.onSpecificOptionChange("theme",()=>this._setTheme(this._optionsService.rawOptions.theme)))}_setTheme(M={}){const w=this._colors;if(w.foreground=P(M.foreground,l),w.background=P(M.background,h),w.cursor=P(M.cursor,f),w.cursorAccent=P(M.cursorAccent,_),w.selectionBackgroundTransparent=P(M.selectionBackground,S),w.selectionBackgroundOpaque=g.color.blend(w.background,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundTransparent=P(M.selectionInactiveBackground,w.selectionBackgroundTransparent),w.selectionInactiveBackgroundOpaque=g.color.blend(w.background,w.selectionInactiveBackgroundTransparent),w.selectionForeground=M.selectionForeground?P(M.selectionForeground,g.NULL_COLOR):void 0,w.selectionForeground===g.NULL_COLOR&&(w.selectionForeground=void 0),g.color.isOpaque(w.selectionBackgroundTransparent)&&(w.selectionBackgroundTransparent=g.color.opacity(w.selectionBackgroundTransparent,.3)),g.color.isOpaque(w.selectionInactiveBackgroundTransparent)&&(w.selectionInactiveBackgroundTransparent=g.color.opacity(w.selectionInactiveBackgroundTransparent,.3)),w.ansi=r.DEFAULT_ANSI_COLORS.slice(),w.ansi[0]=P(M.black,r.DEFAULT_ANSI_COLORS[0]),w.ansi[1]=P(M.red,r.DEFAULT_ANSI_COLORS[1]),w.ansi[2]=P(M.green,r.DEFAULT_ANSI_COLORS[2]),w.ansi[3]=P(M.yellow,r.DEFAULT_ANSI_COLORS[3]),w.ansi[4]=P(M.blue,r.DEFAULT_ANSI_COLORS[4]),w.ansi[5]=P(M.magenta,r.DEFAULT_ANSI_COLORS[5]),w.ansi[6]=P(M.cyan,r.DEFAULT_ANSI_COLORS[6]),w.ansi[7]=P(M.white,r.DEFAULT_ANSI_COLORS[7]),w.ansi[8]=P(M.brightBlack,r.DEFAULT_ANSI_COLORS[8]),w.ansi[9]=P(M.brightRed,r.DEFAULT_ANSI_COLORS[9]),w.ansi[10]=P(M.brightGreen,r.DEFAULT_ANSI_COLORS[10]),w.ansi[11]=P(M.brightYellow,r.DEFAULT_ANSI_COLORS[11]),w.ansi[12]=P(M.brightBlue,r.DEFAULT_ANSI_COLORS[12]),w.ansi[13]=P(M.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),w.ansi[14]=P(M.brightCyan,r.DEFAULT_ANSI_COLORS[14]),w.ansi[15]=P(M.brightWhite,r.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const T=Math.min(w.ansi.length-16,M.extendedAnsi.length);for(let A=0;A{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;const c=o(8460),p=o(844);class u extends p.Disposable{constructor(m){super(),this._maxLength=m,this.onDeleteEmitter=this.register(new c.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new c.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new c.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(m){if(this._maxLength===m)return;const y=new Array(m);for(let v=0;vthis._length)for(let y=this._length;y=m;l--)this._array[this._getCyclicIndex(l+v.length)]=this._array[this._getCyclicIndex(l)];for(let l=0;lthis._maxLength){const l=this._length+v.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=v.length}trimStart(m){m>this._length&&(m=this._length),this._startIndex+=m,this._length-=m,this.onTrimEmitter.fire(m)}shiftElements(m,y,v){if(!(y<=0)){if(m<0||m>=this._length)throw new Error("start argument out of range");if(m+v<0)throw new Error("Cannot shift elements in list beyond index 0");if(v>0){for(let h=y-1;h>=0;h--)this.set(m+h+v,this.get(m+h));const l=m+y+v-this._length;if(l>0)for(this._length+=l;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let l=0;l{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function o(c,p=5){if(typeof c!="object")return c;const u=Array.isArray(c)?[]:{};for(const g in c)u[g]=p<=1?c[g]:c[g]&&o(c[g],p-1);return u}},8055:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const c=o(6114);let p=0,u=0,g=0,m=0;var y,v,l,h,f;function _(k){const P=k.toString(16);return P.length<2?"0"+P:P}function S(k,P){return k>>0}}(y||(r.channels=y={})),function(k){function P(M,w){return m=Math.round(255*w),[p,u,g]=f.toChannels(M.rgba),{css:y.toCss(p,u,g,m),rgba:y.toRgba(p,u,g,m)}}k.blend=function(M,w){if(m=(255&w.rgba)/255,m===1)return{css:w.css,rgba:w.rgba};const T=w.rgba>>24&255,A=w.rgba>>16&255,E=w.rgba>>8&255,R=M.rgba>>24&255,D=M.rgba>>16&255,I=M.rgba>>8&255;return p=R+Math.round((T-R)*m),u=D+Math.round((A-D)*m),g=I+Math.round((E-I)*m),{css:y.toCss(p,u,g),rgba:y.toRgba(p,u,g)}},k.isOpaque=function(M){return(255&M.rgba)==255},k.ensureContrastRatio=function(M,w,T){const A=f.ensureContrastRatio(M.rgba,w.rgba,T);if(A)return f.toColor(A>>24&255,A>>16&255,A>>8&255)},k.opaque=function(M){const w=(255|M.rgba)>>>0;return[p,u,g]=f.toChannels(w),{css:y.toCss(p,u,g),rgba:w}},k.opacity=P,k.multiplyOpacity=function(M,w){return m=255&M.rgba,P(M,m*w/255)},k.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}}(v||(r.color=v={})),function(k){let P,M;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const T=w.getContext("2d",{willReadFrequently:!0});T&&(P=T,P.globalCompositeOperation="copy",M=P.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),f.toColor(p,u,g);case 5:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),m=parseInt(w.slice(4,5).repeat(2),16),f.toColor(p,u,g,m);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const T=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return p=parseInt(T[1]),u=parseInt(T[2]),g=parseInt(T[3]),m=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),f.toColor(p,u,g,m);if(!P||!M)throw new Error("css.toColor: Unsupported css format");if(P.fillStyle=M,P.fillStyle=w,typeof P.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(P.fillRect(0,0,1,1),[p,u,g,m]=P.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(p,u,g,m),css:w}}}(l||(r.css=l={})),function(k){function P(M,w,T){const A=M/255,E=w/255,R=T/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}k.relativeLuminance=function(M){return P(M>>16&255,M>>8&255,255&M)},k.relativeLuminance2=P}(h||(r.rgb=h={})),function(k){function P(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W0||O>0||U>0);)I-=Math.max(0,Math.ceil(.1*I)),O-=Math.max(0,Math.ceil(.1*O)),U-=Math.max(0,Math.ceil(.1*U)),W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));return(I<<24|O<<16|U<<8|255)>>>0}function M(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W>>0}k.ensureContrastRatio=function(w,T,A){const E=h.relativeLuminance(w>>8),R=h.relativeLuminance(T>>8);if(S(E,R)>8));if(US(E,h.relativeLuminance(W>>8))?O:W}return O}const D=M(w,T,A),I=S(E,h.relativeLuminance(D>>8));if(IS(E,h.relativeLuminance(O>>8))?D:O}return D}},k.reduceLuminance=P,k.increaseLuminance=M,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,T,A,E){return{css:y.toCss(w,T,A,E),rgba:y.toRgba(w,T,A,E)}}}(f||(r.rgba=f={})),r.toPaddedHex=_,r.contrastRatio=S},8969:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;const c=o(844),p=o(2585),u=o(4348),g=o(7866),m=o(744),y=o(7302),v=o(6975),l=o(8460),h=o(1753),f=o(1480),_=o(7994),S=o(9282),k=o(5435),P=o(5981),M=o(2660);let w=!1;class T extends c.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new l.EventEmitter),this._onScroll.event(E=>{var R;(R=this._onScrollApi)===null||R===void 0||R.fire(E.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(E){for(const R in E)this.optionsService.options[R]=E[R]}constructor(E){super(),this._windowsWrappingHeuristics=this.register(new c.MutableDisposable),this._onBinary=this.register(new l.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new l.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new l.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new l.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new l.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new l.EventEmitter),this._instantiationService=new u.InstantiationService,this.optionsService=this.register(new y.OptionsService(E)),this._instantiationService.setService(p.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(m.BufferService)),this._instantiationService.setService(p.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(p.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(v.CoreService)),this._instantiationService.setService(p.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(p.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(f.UnicodeService)),this._instantiationService.setService(p.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(_.CharsetService),this._instantiationService.setService(p.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(p.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new k.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,l.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,l.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,l.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,l.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom())),this.register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],()=>this._handleWindowsPtyOptionChange())),this.register(this._bufferService.onScroll(R=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(R=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this.register(new P.WriteBuffer((R,D)=>this._inputHandler.parse(R,D))),this.register((0,l.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(E,R){this._writeBuffer.write(E,R)}writeSync(E,R){this._logService.logLevel<=p.LogLevelEnum.WARN&&!w&&(this._logService.warn("writeSync is unreliable and will be removed soon."),w=!0),this._writeBuffer.writeSync(E,R)}resize(E,R){isNaN(E)||isNaN(R)||(E=Math.max(E,m.MINIMUM_COLS),R=Math.max(R,m.MINIMUM_ROWS),this._bufferService.resize(E,R))}scroll(E,R=!1){this._bufferService.scroll(E,R)}scrollLines(E,R,D){this._bufferService.scrollLines(E,R,D)}scrollPages(E){this.scrollLines(E*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(E){const R=E-this._bufferService.buffer.ydisp;R!==0&&this.scrollLines(R)}registerEscHandler(E,R){return this._inputHandler.registerEscHandler(E,R)}registerDcsHandler(E,R){return this._inputHandler.registerDcsHandler(E,R)}registerCsiHandler(E,R){return this._inputHandler.registerCsiHandler(E,R)}registerOscHandler(E,R){return this._inputHandler.registerOscHandler(E,R)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let E=!1;const R=this.optionsService.rawOptions.windowsPty;R&&R.buildNumber!==void 0&&R.buildNumber!==void 0?E=R.backend==="conpty"&&R.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(E=!0),E?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const E=[];E.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),E.push(this.registerCsiHandler({final:"H"},()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsWrappingHeuristics.value=(0,c.toDisposable)(()=>{for(const R of E)R.dispose()})}}}r.CoreTerminal=T},8460:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(p))}},5435:function(d,r,o){var c=this&&this.__decorate||function(W,z,N,V){var q,G=arguments.length,te=G<3?z:V===null?V=Object.getOwnPropertyDescriptor(z,N):V;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")te=Reflect.decorate(W,z,N,V);else for(var oe=W.length-1;oe>=0;oe--)(q=W[oe])&&(te=(G<3?q(te):G>3?q(z,N,te):q(z,N))||te);return G>3&&te&&Object.defineProperty(z,N,te),te},p=this&&this.__param||function(W,z){return function(N,V){z(N,V,W)}};Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;const u=o(2584),g=o(7116),m=o(2015),y=o(844),v=o(482),l=o(8437),h=o(8460),f=o(643),_=o(511),S=o(3734),k=o(2585),P=o(6242),M=o(6351),w=o(5941),T={"(":0,")":1,"*":2,"+":3,"-":1,".":2},A=131072;function E(W,z){if(W>24)return z.setWinLines||!1;switch(W){case 1:return!!z.restoreWin;case 2:return!!z.minimizeWin;case 3:return!!z.setWinPosition;case 4:return!!z.setWinSizePixels;case 5:return!!z.raiseWin;case 6:return!!z.lowerWin;case 7:return!!z.refreshWin;case 8:return!!z.setWinSizeChars;case 9:return!!z.maximizeWin;case 10:return!!z.fullscreenWin;case 11:return!!z.getWinState;case 13:return!!z.getWinPosition;case 14:return!!z.getWinSizePixels;case 15:return!!z.getScreenSizePixels;case 16:return!!z.getCellSizePixels;case 18:return!!z.getWinSizeChars;case 19:return!!z.getScreenSizeChars;case 20:return!!z.getIconTitle;case 21:return!!z.getWinTitle;case 22:return!!z.pushTitle;case 23:return!!z.popTitle;case 24:return!!z.setWinLines}return!1}var R;(function(W){W[W.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",W[W.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(R||(r.WindowsOptionsReportType=R={}));let D=0;class I extends y.Disposable{getAttrData(){return this._curAttrData}constructor(z,N,V,q,G,te,oe,ie,ye=new m.EscapeSequenceParser){super(),this._bufferService=z,this._charsetService=N,this._coreService=V,this._logService=q,this._optionsService=G,this._oscLinkService=te,this._coreMouseService=oe,this._unicodeService=ie,this._parser=ye,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new v.StringToUtf32,this._utf8Decoder=new v.Utf8ToUtf32,this._workCell=new _.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.EventEmitter),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._dirtyRowTracker=new O(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(K=>this._activeBuffer=K.activeBuffer)),this._parser.setCsiHandlerFallback((K,J)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(K),params:J.toArray()})}),this._parser.setEscHandlerFallback(K=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(K)})}),this._parser.setExecuteHandlerFallback(K=>{this._logService.debug("Unknown EXECUTE code: ",{code:K})}),this._parser.setOscHandlerFallback((K,J,Q)=>{this._logService.debug("Unknown OSC code: ",{identifier:K,action:J,data:Q})}),this._parser.setDcsHandlerFallback((K,J,Q)=>{J==="HOOK"&&(Q=Q.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(K),action:J,payload:Q})}),this._parser.setPrintHandler((K,J,Q)=>this.print(K,J,Q)),this._parser.registerCsiHandler({final:"@"},K=>this.insertChars(K)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},K=>this.scrollLeft(K)),this._parser.registerCsiHandler({final:"A"},K=>this.cursorUp(K)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},K=>this.scrollRight(K)),this._parser.registerCsiHandler({final:"B"},K=>this.cursorDown(K)),this._parser.registerCsiHandler({final:"C"},K=>this.cursorForward(K)),this._parser.registerCsiHandler({final:"D"},K=>this.cursorBackward(K)),this._parser.registerCsiHandler({final:"E"},K=>this.cursorNextLine(K)),this._parser.registerCsiHandler({final:"F"},K=>this.cursorPrecedingLine(K)),this._parser.registerCsiHandler({final:"G"},K=>this.cursorCharAbsolute(K)),this._parser.registerCsiHandler({final:"H"},K=>this.cursorPosition(K)),this._parser.registerCsiHandler({final:"I"},K=>this.cursorForwardTab(K)),this._parser.registerCsiHandler({final:"J"},K=>this.eraseInDisplay(K,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},K=>this.eraseInDisplay(K,!0)),this._parser.registerCsiHandler({final:"K"},K=>this.eraseInLine(K,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},K=>this.eraseInLine(K,!0)),this._parser.registerCsiHandler({final:"L"},K=>this.insertLines(K)),this._parser.registerCsiHandler({final:"M"},K=>this.deleteLines(K)),this._parser.registerCsiHandler({final:"P"},K=>this.deleteChars(K)),this._parser.registerCsiHandler({final:"S"},K=>this.scrollUp(K)),this._parser.registerCsiHandler({final:"T"},K=>this.scrollDown(K)),this._parser.registerCsiHandler({final:"X"},K=>this.eraseChars(K)),this._parser.registerCsiHandler({final:"Z"},K=>this.cursorBackwardTab(K)),this._parser.registerCsiHandler({final:"`"},K=>this.charPosAbsolute(K)),this._parser.registerCsiHandler({final:"a"},K=>this.hPositionRelative(K)),this._parser.registerCsiHandler({final:"b"},K=>this.repeatPrecedingCharacter(K)),this._parser.registerCsiHandler({final:"c"},K=>this.sendDeviceAttributesPrimary(K)),this._parser.registerCsiHandler({prefix:">",final:"c"},K=>this.sendDeviceAttributesSecondary(K)),this._parser.registerCsiHandler({final:"d"},K=>this.linePosAbsolute(K)),this._parser.registerCsiHandler({final:"e"},K=>this.vPositionRelative(K)),this._parser.registerCsiHandler({final:"f"},K=>this.hVPosition(K)),this._parser.registerCsiHandler({final:"g"},K=>this.tabClear(K)),this._parser.registerCsiHandler({final:"h"},K=>this.setMode(K)),this._parser.registerCsiHandler({prefix:"?",final:"h"},K=>this.setModePrivate(K)),this._parser.registerCsiHandler({final:"l"},K=>this.resetMode(K)),this._parser.registerCsiHandler({prefix:"?",final:"l"},K=>this.resetModePrivate(K)),this._parser.registerCsiHandler({final:"m"},K=>this.charAttributes(K)),this._parser.registerCsiHandler({final:"n"},K=>this.deviceStatus(K)),this._parser.registerCsiHandler({prefix:"?",final:"n"},K=>this.deviceStatusPrivate(K)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},K=>this.softReset(K)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},K=>this.setCursorStyle(K)),this._parser.registerCsiHandler({final:"r"},K=>this.setScrollRegion(K)),this._parser.registerCsiHandler({final:"s"},K=>this.saveCursor(K)),this._parser.registerCsiHandler({final:"t"},K=>this.windowOptions(K)),this._parser.registerCsiHandler({final:"u"},K=>this.restoreCursor(K)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},K=>this.insertColumns(K)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},K=>this.deleteColumns(K)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},K=>this.selectProtected(K)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},K=>this.requestMode(K,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},K=>this.requestMode(K,!1)),this._parser.setExecuteHandler(u.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(u.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(u.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(u.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(u.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(u.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(u.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(u.C1.IND,()=>this.index()),this._parser.setExecuteHandler(u.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(u.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new P.OscHandler(K=>(this.setTitle(K),this.setIconName(K),!0))),this._parser.registerOscHandler(1,new P.OscHandler(K=>this.setIconName(K))),this._parser.registerOscHandler(2,new P.OscHandler(K=>this.setTitle(K))),this._parser.registerOscHandler(4,new P.OscHandler(K=>this.setOrReportIndexedColor(K))),this._parser.registerOscHandler(8,new P.OscHandler(K=>this.setHyperlink(K))),this._parser.registerOscHandler(10,new P.OscHandler(K=>this.setOrReportFgColor(K))),this._parser.registerOscHandler(11,new P.OscHandler(K=>this.setOrReportBgColor(K))),this._parser.registerOscHandler(12,new P.OscHandler(K=>this.setOrReportCursorColor(K))),this._parser.registerOscHandler(104,new P.OscHandler(K=>this.restoreIndexedColor(K))),this._parser.registerOscHandler(110,new P.OscHandler(K=>this.restoreFgColor(K))),this._parser.registerOscHandler(111,new P.OscHandler(K=>this.restoreBgColor(K))),this._parser.registerOscHandler(112,new P.OscHandler(K=>this.restoreCursorColor(K))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(const K in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:K},()=>this.selectCharset("("+K)),this._parser.registerEscHandler({intermediates:")",final:K},()=>this.selectCharset(")"+K)),this._parser.registerEscHandler({intermediates:"*",final:K},()=>this.selectCharset("*"+K)),this._parser.registerEscHandler({intermediates:"+",final:K},()=>this.selectCharset("+"+K)),this._parser.registerEscHandler({intermediates:"-",final:K},()=>this.selectCharset("-"+K)),this._parser.registerEscHandler({intermediates:".",final:K},()=>this.selectCharset("."+K)),this._parser.registerEscHandler({intermediates:"/",final:K},()=>this.selectCharset("/"+K));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(K=>(this._logService.error("Parsing error: ",K),K)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new M.DcsHandler((K,J)=>this.requestStatusString(K,J)))}_preserveStack(z,N,V,q){this._parseStack.paused=!0,this._parseStack.cursorStartX=z,this._parseStack.cursorStartY=N,this._parseStack.decodedLength=V,this._parseStack.position=q}_logSlowResolvingAsync(z){this._logService.logLevel<=k.LogLevelEnum.WARN&&Promise.race([z,new Promise((N,V)=>setTimeout(()=>V("#SLOW_TIMEOUT"),5e3))]).catch(N=>{if(N!=="#SLOW_TIMEOUT")throw N;console.warn("async parser handler taking longer than 5000 ms")})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(z,N){let V,q=this._activeBuffer.x,G=this._activeBuffer.y,te=0;const oe=this._parseStack.paused;if(oe){if(V=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,N))return this._logSlowResolvingAsync(V),V;q=this._parseStack.cursorStartX,G=this._parseStack.cursorStartY,this._parseStack.paused=!1,z.length>A&&(te=this._parseStack.position+A)}if(this._logService.logLevel<=k.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof z=="string"?` "${z}"`:` "${Array.prototype.map.call(z,ie=>String.fromCharCode(ie)).join("")}"`),typeof z=="string"?z.split("").map(ie=>ie.charCodeAt(0)):z),this._parseBuffer.lengthA)for(let ie=te;ie0&&Q.getWidth(this._activeBuffer.x-1)===2&&Q.setCellFromCodePoint(this._activeBuffer.x-1,0,1,J.fg,J.bg,J.extended);for(let ce=N;ce=ie){if(ye){for(;this._activeBuffer.x=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),Q=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=ie-1,G===2)continue}if(K&&(Q.insertCells(this._activeBuffer.x,G,this._activeBuffer.getNullCell(J),J),Q.getWidth(ie-1)===2&&Q.setCellFromCodePoint(ie-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,J.fg,J.bg,J.extended)),Q.setCellFromCodePoint(this._activeBuffer.x++,q,G,J.fg,J.bg,J.extended),G>0)for(;--G;)Q.setCellFromCodePoint(this._activeBuffer.x++,0,0,J.fg,J.bg,J.extended)}else Q.getWidth(this._activeBuffer.x-1)?Q.addCodepointToCell(this._activeBuffer.x-1,q):Q.addCodepointToCell(this._activeBuffer.x-2,q)}V-N>0&&(Q.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x0&&Q.getWidth(this._activeBuffer.x)===0&&!Q.hasContent(this._activeBuffer.x)&&Q.setCellFromCodePoint(this._activeBuffer.x,0,1,J.fg,J.bg,J.extended),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(z,N){return z.final!=="t"||z.prefix||z.intermediates?this._parser.registerCsiHandler(z,N):this._parser.registerCsiHandler(z,V=>!E(V.params[0],this._optionsService.rawOptions.windowOptions)||N(V))}registerDcsHandler(z,N){return this._parser.registerDcsHandler(z,new M.DcsHandler(N))}registerEscHandler(z,N){return this._parser.registerEscHandler(z,N)}registerOscHandler(z,N){return this._parser.registerOscHandler(z,new P.OscHandler(N))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var z;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&(!((z=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||z===void 0)&&z.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const z=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-z),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(z=this._bufferService.cols-1){this._activeBuffer.x=Math.min(z,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(z,N){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=z,this._activeBuffer.y=this._activeBuffer.scrollTop+N):(this._activeBuffer.x=z,this._activeBuffer.y=N),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(z,N){this._restrictCursor(),this._setCursor(this._activeBuffer.x+z,this._activeBuffer.y+N)}cursorUp(z){const N=this._activeBuffer.y-this._activeBuffer.scrollTop;return N>=0?this._moveCursor(0,-Math.min(N,z.params[0]||1)):this._moveCursor(0,-(z.params[0]||1)),!0}cursorDown(z){const N=this._activeBuffer.scrollBottom-this._activeBuffer.y;return N>=0?this._moveCursor(0,Math.min(N,z.params[0]||1)):this._moveCursor(0,z.params[0]||1),!0}cursorForward(z){return this._moveCursor(z.params[0]||1,0),!0}cursorBackward(z){return this._moveCursor(-(z.params[0]||1),0),!0}cursorNextLine(z){return this.cursorDown(z),this._activeBuffer.x=0,!0}cursorPrecedingLine(z){return this.cursorUp(z),this._activeBuffer.x=0,!0}cursorCharAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(z){return this._setCursor(z.length>=2?(z.params[1]||1)-1:0,(z.params[0]||1)-1),!0}charPosAbsolute(z){return this._setCursor((z.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(z){return this._moveCursor(z.params[0]||1,0),!0}linePosAbsolute(z){return this._setCursor(this._activeBuffer.x,(z.params[0]||1)-1),!0}vPositionRelative(z){return this._moveCursor(0,z.params[0]||1),!0}hVPosition(z){return this.cursorPosition(z),!0}tabClear(z){const N=z.params[0];return N===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:N===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=z.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(z){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let N=z.params[0]||1;for(;N--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(z){const N=z.params[0];return N===1&&(this._curAttrData.bg|=536870912),N!==2&&N!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(z,N,V,q=!1,G=!1){const te=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);te.replaceCells(N,V,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),G),q&&(te.isWrapped=!1)}_resetBufferLine(z,N=!1){const V=this._activeBuffer.lines.get(this._activeBuffer.ybase+z);V&&(V.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),N),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+z),V.isWrapped=!1)}eraseInDisplay(z,N=!1){let V;switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:for(V=this._activeBuffer.y,this._dirtyRowTracker.markDirty(V),this._eraseInBufferLine(V++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);V=this._bufferService.cols&&(this._activeBuffer.lines.get(V+1).isWrapped=!1);V--;)this._resetBufferLine(V,N);this._dirtyRowTracker.markDirty(0);break;case 2:for(V=this._bufferService.rows,this._dirtyRowTracker.markDirty(V-1);V--;)this._resetBufferLine(V,N);this._dirtyRowTracker.markDirty(0);break;case 3:const q=this._activeBuffer.lines.length-this._bufferService.rows;q>0&&(this._activeBuffer.lines.trimStart(q),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-q,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-q,0),this._onScroll.fire(0))}return!0}eraseInLine(z,N=!1){switch(this._restrictCursor(this._bufferService.cols),z.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,N);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,N);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,N)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(z){this._restrictCursor();let N=z.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.ythis._activeBuffer.scrollBottom||this._activeBuffer.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(u.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(u.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(z){return z.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(u.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(u.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(z.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(u.C0.ESC+"[>83;40003;0c")),!0}_is(z){return(this._optionsService.rawOptions.termName+"").indexOf(z)===0}setMode(z){for(let N=0;NYe?1:2,ce=z.params[0];return Fe=ce,Ee=N?ce===2?4:ce===4?Q(te.modes.insertMode):ce===12?3:ce===20?Q(J.convertEol):0:ce===1?Q(V.applicationCursorKeys):ce===3?J.windowOptions.setWinLines?ie===80?2:ie===132?1:0:0:ce===6?Q(V.origin):ce===7?Q(V.wraparound):ce===8?3:ce===9?Q(q==="X10"):ce===12?Q(J.cursorBlink):ce===25?Q(!te.isCursorHidden):ce===45?Q(V.reverseWraparound):ce===66?Q(V.applicationKeypad):ce===67?4:ce===1e3?Q(q==="VT200"):ce===1002?Q(q==="DRAG"):ce===1003?Q(q==="ANY"):ce===1004?Q(V.sendFocus):ce===1005?4:ce===1006?Q(G==="SGR"):ce===1015?4:ce===1016?Q(G==="SGR_PIXELS"):ce===1048?1:ce===47||ce===1047||ce===1049?Q(ye===K):ce===2004?Q(V.bracketedPasteMode):0,te.triggerDataEvent(`${u.C0.ESC}[${N?"":"?"}${Fe};${Ee}$y`),!0;var Fe,Ee}_updateAttrColor(z,N,V,q,G){return N===2?(z|=50331648,z&=-16777216,z|=S.AttributeData.fromColorRGB([V,q,G])):N===5&&(z&=-50331904,z|=33554432|255&V),z}_extractColor(z,N,V){const q=[0,0,-1,0,0,0];let G=0,te=0;do{if(q[te+G]=z.params[N+te],z.hasSubParams(N+te)){const oe=z.getSubParams(N+te);let ie=0;do q[1]===5&&(G=1),q[te+ie+1+G]=oe[ie];while(++ie=2||q[1]===2&&te+G>=5)break;q[1]&&(G=1)}while(++te+N5)&&(z=1),N.extended.underlineStyle=z,N.fg|=268435456,z===0&&(N.fg&=-268435457),N.updateExtended()}_processSGR0(z){z.fg=l.DEFAULT_ATTR_DATA.fg,z.bg=l.DEFAULT_ATTR_DATA.bg,z.extended=z.extended.clone(),z.extended.underlineStyle=0,z.extended.underlineColor&=-67108864,z.updateExtended()}charAttributes(z){if(z.length===1&&z.params[0]===0)return this._processSGR0(this._curAttrData),!0;const N=z.length;let V;const q=this._curAttrData;for(let G=0;G=30&&V<=37?(q.fg&=-50331904,q.fg|=16777216|V-30):V>=40&&V<=47?(q.bg&=-50331904,q.bg|=16777216|V-40):V>=90&&V<=97?(q.fg&=-50331904,q.fg|=16777224|V-90):V>=100&&V<=107?(q.bg&=-50331904,q.bg|=16777224|V-100):V===0?this._processSGR0(q):V===1?q.fg|=134217728:V===3?q.bg|=67108864:V===4?(q.fg|=268435456,this._processUnderline(z.hasSubParams(G)?z.getSubParams(G)[0]:1,q)):V===5?q.fg|=536870912:V===7?q.fg|=67108864:V===8?q.fg|=1073741824:V===9?q.fg|=2147483648:V===2?q.bg|=134217728:V===21?this._processUnderline(2,q):V===22?(q.fg&=-134217729,q.bg&=-134217729):V===23?q.bg&=-67108865:V===24?(q.fg&=-268435457,this._processUnderline(0,q)):V===25?q.fg&=-536870913:V===27?q.fg&=-67108865:V===28?q.fg&=-1073741825:V===29?q.fg&=2147483647:V===39?(q.fg&=-67108864,q.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):V===49?(q.bg&=-67108864,q.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):V===38||V===48||V===58?G+=this._extractColor(z,G,q):V===53?q.bg|=1073741824:V===55?q.bg&=-1073741825:V===59?(q.extended=q.extended.clone(),q.extended.underlineColor=-1,q.updateExtended()):V===100?(q.fg&=-67108864,q.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,q.bg&=-67108864,q.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",V);return!0}deviceStatus(z){switch(z.params[0]){case 5:this._coreService.triggerDataEvent(`${u.C0.ESC}[0n`);break;case 6:const N=this._activeBuffer.y+1,V=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[${N};${V}R`)}return!0}deviceStatusPrivate(z){if(z.params[0]===6){const N=this._activeBuffer.y+1,V=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${u.C0.ESC}[?${N};${V}R`)}return!0}softReset(z){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(z){const N=z.params[0]||1;switch(N){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const V=N%2==1;return this._optionsService.options.cursorBlink=V,!0}setScrollRegion(z){const N=z.params[0]||1;let V;return(z.length<2||(V=z.params[1])>this._bufferService.rows||V===0)&&(V=this._bufferService.rows),V>N&&(this._activeBuffer.scrollTop=N-1,this._activeBuffer.scrollBottom=V-1,this._setCursor(0,0)),!0}windowOptions(z){if(!E(z.params[0],this._optionsService.rawOptions.windowOptions))return!0;const N=z.length>1?z.params[1]:0;switch(z.params[0]){case 14:N!==2&&this._onRequestWindowsOptionsReport.fire(R.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(R.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${u.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:N!==0&&N!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),N!==0&&N!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:N!==0&&N!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),N!==0&&N!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(z){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(z){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(z){return this._windowTitle=z,this._onTitleChange.fire(z),!0}setIconName(z){return this._iconName=z,!0}setOrReportIndexedColor(z){const N=[],V=z.split(";");for(;V.length>1;){const q=V.shift(),G=V.shift();if(/^\d+$/.exec(q)){const te=parseInt(q);if(U(te))if(G==="?")N.push({type:0,index:te});else{const oe=(0,w.parseColor)(G);oe&&N.push({type:1,index:te,color:oe})}}}return N.length&&this._onColor.fire(N),!0}setHyperlink(z){const N=z.split(";");return!(N.length<2)&&(N[1]?this._createHyperlink(N[0],N[1]):!N[0]&&this._finishHyperlink())}_createHyperlink(z,N){this._getCurrentLinkId()&&this._finishHyperlink();const V=z.split(":");let q;const G=V.findIndex(te=>te.startsWith("id="));return G!==-1&&(q=V[G].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:q,uri:N}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(z,N){const V=z.split(";");for(let q=0;q=this._specialColors.length);++q,++N)if(V[q]==="?")this._onColor.fire([{type:0,index:this._specialColors[N]}]);else{const G=(0,w.parseColor)(V[q]);G&&this._onColor.fire([{type:1,index:this._specialColors[N],color:G}])}return!0}setOrReportFgColor(z){return this._setOrReportSpecialColor(z,0)}setOrReportBgColor(z){return this._setOrReportSpecialColor(z,1)}setOrReportCursorColor(z){return this._setOrReportSpecialColor(z,2)}restoreIndexedColor(z){if(!z)return this._onColor.fire([{type:2}]),!0;const N=[],V=z.split(";");for(let q=0;q=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){const z=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,z,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(z){return this._charsetService.setgLevel(z),!0}screenAlignmentPattern(){const z=new _.CellData;z.content=4194373,z.fg=this._curAttrData.fg,z.bg=this._curAttrData.bg,this._setCursor(0,0);for(let N=0;N(this._coreService.triggerDataEvent(`${u.C0.ESC}${G}${u.C0.ESC}\\`),!0))(z==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:z==='"p'?'P1$r61;1"p':z==="r"?`P1$r${V.scrollTop+1};${V.scrollBottom+1}r`:z==="m"?"P1$r0m":z===" q"?`P1$r${{block:2,underline:4,bar:6}[q.cursorStyle]-(q.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(z,N){this._dirtyRowTracker.markRangeDirty(z,N)}}r.InputHandler=I;let O=class{constructor(W){this._bufferService=W,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(W){Wthis.end&&(this.end=W)}markRangeDirty(W,z){W>z&&(D=W,W=z,z=D),Wthis.end&&(this.end=z)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function U(W){return 0<=W&&W<256}O=c([p(0,k.IBufferService)],O)},844:(d,r)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)===null||p===void 0||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},1505:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(p,u,g){this._data[p]||(this._data[p]={}),this._data[p][u]=g}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(c,p,u,g,m){this._data.get(c,p)||this._data.set(c,p,new o),this._data.get(c,p).set(u,g,m)}get(c,p,u,g){var m;return(m=this._data.get(c,p))===null||m===void 0?void 0:m.get(u,g)}clear(){this._data.clear()}}},6114:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const p=o.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},6106:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let o=0;r.SortedList=class{constructor(c){this._getKey=c,this._array=[]}clear(){this._array.length=0}insert(c){this._array.length!==0?(o=this._search(this._getKey(c)),this._array.splice(o,0,c)):this._array.push(c)}delete(c){if(this._array.length===0)return!1;const p=this._getKey(c);if(p===void 0||(o=this._search(p),o===-1)||this._getKey(this._array[o])!==p)return!1;do if(this._array[o]===c)return this._array.splice(o,1),!0;while(++o=this._array.length)&&this._getKey(this._array[o])===c))do yield this._array[o];while(++o=this._array.length)&&this._getKey(this._array[o])===c))do p(this._array[o]);while(++o=p;){let g=p+u>>1;const m=this._getKey(this._array[g]);if(m>c)u=g-1;else{if(!(m0&&this._getKey(this._array[g-1])===c;)g--;return g}p=g+1}}return p}}},7226:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const c=o(6114);class p{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ih)return l-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-y))}ms`),void this._start();l=h}this.clear()}}class u extends p{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const y=Date.now()+m;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}r.PriorityTaskQueue=u,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:u,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;const c=o(643);r.updateWindowsModeWrappedState=function(p){const u=p.buffer.lines.get(p.buffer.ybase+p.buffer.y-1),g=u==null?void 0:u.get(p.cols-1),m=p.buffer.lines.get(p.buffer.ybase+p.buffer.y);m&&g&&(m.isWrapped=g[c.CHAR_DATA_CODE_INDEX]!==c.NULL_CELL_CODE&&g[c.CHAR_DATA_CODE_INDEX]!==c.WHITESPACE_CELL_CODE)}},3734:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,g=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=g}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},9092:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Buffer=r.MAX_BUFFER_SIZE=void 0;const c=o(6349),p=o(7226),u=o(3734),g=o(8437),m=o(4634),y=o(511),v=o(643),l=o(4863),h=o(7116);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(f,_,S){this._hasScrollback=f,this._optionsService=_,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,v.NULL_CELL_CHAR,v.NULL_CELL_WIDTH,v.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,v.WHITESPACE_CELL_CHAR,v.WHITESPACE_CELL_WIDTH,v.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new p.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(f){return f?(this._nullCell.fg=f.fg,this._nullCell.bg=f.bg,this._nullCell.extended=f.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new u.ExtendedAttrs),this._nullCell}getWhitespaceCell(f){return f?(this._whitespaceCell.fg=f.fg,this._whitespaceCell.bg=f.bg,this._whitespaceCell.extended=f.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new u.ExtendedAttrs),this._whitespaceCell}getBlankLine(f,_){return new g.BufferLine(this._bufferService.cols,this.getNullCell(f),_)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const f=this.ybase+this.y-this.ydisp;return f>=0&&fr.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:_}fillViewportRows(f){if(this.lines.length===0){f===void 0&&(f=g.DEFAULT_ATTR_DATA);let _=this._rows;for(;_--;)this.lines.push(this.getBlankLine(f))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new c.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(f,_){const S=this.getNullCell(g.DEFAULT_ATTR_DATA);let k=0;const P=this._getCorrectBufferLength(_);if(P>this.lines.maxLength&&(this.lines.maxLength=P),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(f,S)));else for(let w=this._rows;w>_;w--)this.lines.length>_+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(P0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=P}this.x=Math.min(this.x,f-1),this.y=Math.min(this.y,_-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,f-1),this.scrollTop=0}if(this.scrollBottom=_-1,this._isReflowEnabled&&(this._reflow(f,_),this._cols>f))for(let M=0;M.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let f=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,f=!1);let _=0;for(;this._memoryCleanupPosition100)return!0;return f}get _isReflowEnabled(){const f=this._optionsService.rawOptions.windowsPty;return f&&f.buildNumber?this._hasScrollback&&f.backend==="conpty"&&f.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(f,_){this._cols!==f&&(f>this._cols?this._reflowLarger(f,_):this._reflowSmaller(f,_))}_reflowLarger(f,_){const S=(0,m.reflowLargerGetLinesToRemove)(this.lines,this._cols,f,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(S.length>0){const k=(0,m.reflowLargerCreateNewLayout)(this.lines,S);(0,m.reflowLargerApplyNewLayout)(this.lines,k.layout),this._reflowLargerAdjustViewport(f,_,k.countRemoved)}}_reflowLargerAdjustViewport(f,_,S){const k=this.getNullCell(g.DEFAULT_ATTR_DATA);let P=S;for(;P-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<_&&this.lines.push(new g.BufferLine(f,k))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(f,_){const S=this.getNullCell(g.DEFAULT_ATTR_DATA),k=[];let P=0;for(let M=this.lines.length-1;M>=0;M--){let w=this.lines.get(M);if(!w||!w.isWrapped&&w.getTrimmedLength()<=f)continue;const T=[w];for(;w.isWrapped&&M>0;)w=this.lines.get(--M),T.unshift(w);const A=this.ybase+this.y;if(A>=M&&A0&&(k.push({start:M+T.length+P,newLines:O}),P+=O.length),T.push(...O);let U=R.length-1,W=R[U];W===0&&(U--,W=R[U]);let z=T.length-D-1,N=E;for(;z>=0;){const q=Math.min(N,W);if(T[U]===void 0)break;if(T[U].copyCellsFrom(T[z],N-q,W-q,q,!0),W-=q,W===0&&(U--,W=R[U]),N-=q,N===0){z--;const G=Math.max(z,0);N=(0,m.getWrappedLineTrimmedLength)(T,G,this._cols)}}for(let q=0;q0;)this.ybase===0?this.y<_-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase0){const M=[],w=[];for(let U=0;U=0;U--)if(R&&R.start>A+D){for(let W=R.newLines.length-1;W>=0;W--)this.lines.set(U--,R.newLines[W]);U++,M.push({index:A+1,amount:R.newLines.length}),D+=R.newLines.length,R=k[++E]}else this.lines.set(U,w[A--]);let I=0;for(let U=M.length-1;U>=0;U--)M[U].index+=I,this.lines.onInsertEmitter.fire(M[U]),I+=M[U].amount;const O=Math.max(0,T+P-this.lines.maxLength);O>0&&this.lines.onTrimEmitter.fire(O)}}translateBufferLineToString(f,_,S=0,k){const P=this.lines.get(f);return P?P.translateToString(_,S,k):""}getWrappedRangeForLine(f){let _=f,S=f;for(;_>0&&this.lines.get(_).isWrapped;)_--;for(;S+10;);return f>=this._cols?this._cols-1:f<0?0:f}nextStop(f){for(f==null&&(f=this.x);!this.tabs[++f]&&f=this._cols?this._cols-1:f<0?0:f}clearMarkers(f){this._isClearing=!0;for(let _=0;_{_.line-=S,_.line<0&&_.dispose()})),_.register(this.lines.onInsert(S=>{_.line>=S.index&&(_.line+=S.amount)})),_.register(this.lines.onDelete(S=>{_.line>=S.index&&_.lineS.index&&(_.line-=S.amount)})),_.register(_.onDispose(()=>this._removeMarker(_))),_}_removeMarker(f){this._isClearing||this.markers.splice(this.markers.indexOf(f),1)}}},8437:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;const c=o(3734),p=o(511),u=o(643),g=o(482);r.DEFAULT_ATTR_DATA=Object.freeze(new c.AttributeData);let m=0;class y{constructor(l,h,f=!1){this.isWrapped=f,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*l);const _=h||p.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]);for(let S=0;S>22,2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):f]}set(l,h){this._data[3*l+1]=h[u.CHAR_DATA_ATTR_INDEX],h[u.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[l]=h[1],this._data[3*l+0]=2097152|l|h[u.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*l+0]=h[u.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[u.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(l){return this._data[3*l+0]>>22}hasWidth(l){return 12582912&this._data[3*l+0]}getFg(l){return this._data[3*l+1]}getBg(l){return this._data[3*l+2]}hasContent(l){return 4194303&this._data[3*l+0]}getCodePoint(l){const h=this._data[3*l+0];return 2097152&h?this._combined[l].charCodeAt(this._combined[l].length-1):2097151&h}isCombined(l){return 2097152&this._data[3*l+0]}getString(l){const h=this._data[3*l+0];return 2097152&h?this._combined[l]:2097151&h?(0,g.stringFromCodePoint)(2097151&h):""}isProtected(l){return 536870912&this._data[3*l+2]}loadCell(l,h){return m=3*l,h.content=this._data[m+0],h.fg=this._data[m+1],h.bg=this._data[m+2],2097152&h.content&&(h.combinedData=this._combined[l]),268435456&h.bg&&(h.extended=this._extendedAttrs[l]),h}setCell(l,h){2097152&h.content&&(this._combined[l]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[l]=h.extended),this._data[3*l+0]=h.content,this._data[3*l+1]=h.fg,this._data[3*l+2]=h.bg}setCellFromCodePoint(l,h,f,_,S,k){268435456&S&&(this._extendedAttrs[l]=k),this._data[3*l+0]=h|f<<22,this._data[3*l+1]=_,this._data[3*l+2]=S}addCodepointToCell(l,h){let f=this._data[3*l+0];2097152&f?this._combined[l]+=(0,g.stringFromCodePoint)(h):(2097151&f?(this._combined[l]=(0,g.stringFromCodePoint)(2097151&f)+(0,g.stringFromCodePoint)(h),f&=-2097152,f|=2097152):f=h|4194304,this._data[3*l+0]=f)}insertCells(l,h,f,_){if((l%=this.length)&&this.getWidth(l-1)===2&&this.setCellFromCodePoint(l-1,0,1,(_==null?void 0:_.fg)||0,(_==null?void 0:_.bg)||0,(_==null?void 0:_.extended)||new c.ExtendedAttrs),h=0;--k)this.setCell(l+h+k,this.loadCell(l+k,S));for(let k=0;kthis.length){if(this._data.buffer.byteLength>=4*f)this._data=new Uint32Array(this._data.buffer,0,f);else{const _=new Uint32Array(f);_.set(this._data),this._data=_}for(let _=this.length;_=l&&delete this._combined[P]}const S=Object.keys(this._extendedAttrs);for(let k=0;k=l&&delete this._extendedAttrs[P]}}return this.length=l,4*f*2=0;--l)if(4194303&this._data[3*l+0])return l+(this._data[3*l+0]>>22);return 0}getNoBgTrimmedLength(){for(let l=this.length-1;l>=0;--l)if(4194303&this._data[3*l+0]||50331648&this._data[3*l+2])return l+(this._data[3*l+0]>>22);return 0}copyCellsFrom(l,h,f,_,S){const k=l._data;if(S)for(let M=_-1;M>=0;M--){for(let w=0;w<3;w++)this._data[3*(f+M)+w]=k[3*(h+M)+w];268435456&k[3*(h+M)+2]&&(this._extendedAttrs[f+M]=l._extendedAttrs[h+M])}else for(let M=0;M<_;M++){for(let w=0;w<3;w++)this._data[3*(f+M)+w]=k[3*(h+M)+w];268435456&k[3*(h+M)+2]&&(this._extendedAttrs[f+M]=l._extendedAttrs[h+M])}const P=Object.keys(l._combined);for(let M=0;M=h&&(this._combined[w-h+f]=l._combined[w])}}translateToString(l=!1,h=0,f=this.length){l&&(f=Math.min(f,this.getTrimmedLength()));let _="";for(;h>22||1}return _}}r.BufferLine=y},4841:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(o,c){if(o.start.y>o.end.y)throw new Error(`Buffer range end (${o.end.x}, ${o.end.y}) cannot be before start (${o.start.x}, ${o.start.y})`);return c*(o.end.y-o.start.y)+(o.end.x-o.start.x+1)}},4634:(d,r)=>{function o(c,p,u){if(p===c.length-1)return c[p].getTrimmedLength();const g=!c[p].hasContent(u-1)&&c[p].getWidth(u-1)===1,m=c[p+1].getWidth(0)===2;return g&&m?u-1:u}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(c,p,u,g,m){const y=[];for(let v=0;v=v&&g0&&(w>_||f[w].getTrimmedLength()===0);w--)M++;M>0&&(y.push(v+f.length-M),y.push(M)),v+=f.length-1}return y},r.reflowLargerCreateNewLayout=function(c,p){const u=[];let g=0,m=p[g],y=0;for(let v=0;vo(c,f,p)).reduce((h,f)=>h+f);let y=0,v=0,l=0;for(;lh&&(y-=h,v++);const f=c[v].getWidth(y-1)===2;f&&y--;const _=f?u-1:u;g.push(_),l+=_}return g},r.getWrappedLineTrimmedLength=o},5295:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;const c=o(8460),p=o(844),u=o(9092);class g extends p.Disposable{constructor(y,v){super(),this._optionsService=y,this._bufferService=v,this._onBufferActivate=this.register(new c.EventEmitter),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this.register(this._optionsService.onSpecificOptionChange("scrollback",()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this.register(this._optionsService.onSpecificOptionChange("tabStopWidth",()=>this.setupTabStops()))}reset(){this._normal=new u.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new u.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(y,v){this._normal.resize(y,v),this._alt.resize(y,v),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}r.BufferSet=g},511:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const c=o(482),p=o(643),u=o(3734);class g extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new g;return v.setFromCharData(y),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[p.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[p.CHAR_DATA_CHAR_INDEX].length===2){const l=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const h=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(l-55296)+h-56320+65536|y[p.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=g},643:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;const c=o(8460),p=o(844);class u{get id(){return this._id}constructor(m){this.line=m,this.isDisposed=!1,this._disposables=[],this._id=u._nextId++,this._onDispose=this.register(new c.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,p.disposeArray)(this._disposables),this._disposables.length=0)}register(m){return this._disposables.push(m),m}}r.Marker=u,u._nextId=1},7116:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},r.CHARSETS.A={"#":"£"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},r.CHARSETS.C=r.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},r.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},r.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},r.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},r.CHARSETS.E=r.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},r.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},r.CHARSETS.H=r.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},r.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(d,r)=>{var o,c,p;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(u){u.NUL="\0",u.SOH="",u.STX="",u.ETX="",u.EOT="",u.ENQ="",u.ACK="",u.BEL="\x07",u.BS="\b",u.HT=" ",u.LF=` +`,u.VT="\v",u.FF="\f",u.CR="\r",u.SO="",u.SI="",u.DLE="",u.DC1="",u.DC2="",u.DC3="",u.DC4="",u.NAK="",u.SYN="",u.ETB="",u.CAN="",u.EM="",u.SUB="",u.ESC="\x1B",u.FS="",u.GS="",u.RS="",u.US="",u.SP=" ",u.DEL=""}(o||(r.C0=o={})),function(u){u.PAD="€",u.HOP="",u.BPH="‚",u.NBH="ƒ",u.IND="„",u.NEL="…",u.SSA="†",u.ESA="‡",u.HTS="ˆ",u.HTJ="‰",u.VTS="Š",u.PLD="‹",u.PLU="Œ",u.RI="",u.SS2="Ž",u.SS3="",u.DCS="",u.PU1="‘",u.PU2="’",u.STS="“",u.CCH="”",u.MW="•",u.SPA="–",u.EPA="—",u.SOS="˜",u.SGCI="™",u.SCI="š",u.CSI="›",u.ST="œ",u.OSC="",u.PM="ž",u.APC="Ÿ"}(c||(r.C1=c={})),function(u){u.ST=`${o.ESC}\\`}(p||(r.C1_ESCAPED=p={}))},7399:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;const c=o(2584),p={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(u,g,m,y){const v={type:0,cancel:!1,key:void 0},l=(u.shiftKey?1:0)|(u.altKey?2:0)|(u.ctrlKey?4:0)|(u.metaKey?8:0);switch(u.keyCode){case 0:u.key==="UIKeyInputUpArrow"?v.key=g?c.C0.ESC+"OA":c.C0.ESC+"[A":u.key==="UIKeyInputLeftArrow"?v.key=g?c.C0.ESC+"OD":c.C0.ESC+"[D":u.key==="UIKeyInputRightArrow"?v.key=g?c.C0.ESC+"OC":c.C0.ESC+"[C":u.key==="UIKeyInputDownArrow"&&(v.key=g?c.C0.ESC+"OB":c.C0.ESC+"[B");break;case 8:if(u.altKey){v.key=c.C0.ESC+c.C0.DEL;break}v.key=c.C0.DEL;break;case 9:if(u.shiftKey){v.key=c.C0.ESC+"[Z";break}v.key=c.C0.HT,v.cancel=!0;break;case 13:v.key=u.altKey?c.C0.ESC+c.C0.CR:c.C0.CR,v.cancel=!0;break;case 27:v.key=c.C0.ESC,u.altKey&&(v.key=c.C0.ESC+c.C0.ESC),v.cancel=!0;break;case 37:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"D",v.key===c.C0.ESC+"[1;3D"&&(v.key=c.C0.ESC+(m?"b":"[1;5D"))):v.key=g?c.C0.ESC+"OD":c.C0.ESC+"[D";break;case 39:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"C",v.key===c.C0.ESC+"[1;3C"&&(v.key=c.C0.ESC+(m?"f":"[1;5C"))):v.key=g?c.C0.ESC+"OC":c.C0.ESC+"[C";break;case 38:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"A",m||v.key!==c.C0.ESC+"[1;3A"||(v.key=c.C0.ESC+"[1;5A")):v.key=g?c.C0.ESC+"OA":c.C0.ESC+"[A";break;case 40:if(u.metaKey)break;l?(v.key=c.C0.ESC+"[1;"+(l+1)+"B",m||v.key!==c.C0.ESC+"[1;3B"||(v.key=c.C0.ESC+"[1;5B")):v.key=g?c.C0.ESC+"OB":c.C0.ESC+"[B";break;case 45:u.shiftKey||u.ctrlKey||(v.key=c.C0.ESC+"[2~");break;case 46:v.key=l?c.C0.ESC+"[3;"+(l+1)+"~":c.C0.ESC+"[3~";break;case 36:v.key=l?c.C0.ESC+"[1;"+(l+1)+"H":g?c.C0.ESC+"OH":c.C0.ESC+"[H";break;case 35:v.key=l?c.C0.ESC+"[1;"+(l+1)+"F":g?c.C0.ESC+"OF":c.C0.ESC+"[F";break;case 33:u.shiftKey?v.type=2:u.ctrlKey?v.key=c.C0.ESC+"[5;"+(l+1)+"~":v.key=c.C0.ESC+"[5~";break;case 34:u.shiftKey?v.type=3:u.ctrlKey?v.key=c.C0.ESC+"[6;"+(l+1)+"~":v.key=c.C0.ESC+"[6~";break;case 112:v.key=l?c.C0.ESC+"[1;"+(l+1)+"P":c.C0.ESC+"OP";break;case 113:v.key=l?c.C0.ESC+"[1;"+(l+1)+"Q":c.C0.ESC+"OQ";break;case 114:v.key=l?c.C0.ESC+"[1;"+(l+1)+"R":c.C0.ESC+"OR";break;case 115:v.key=l?c.C0.ESC+"[1;"+(l+1)+"S":c.C0.ESC+"OS";break;case 116:v.key=l?c.C0.ESC+"[15;"+(l+1)+"~":c.C0.ESC+"[15~";break;case 117:v.key=l?c.C0.ESC+"[17;"+(l+1)+"~":c.C0.ESC+"[17~";break;case 118:v.key=l?c.C0.ESC+"[18;"+(l+1)+"~":c.C0.ESC+"[18~";break;case 119:v.key=l?c.C0.ESC+"[19;"+(l+1)+"~":c.C0.ESC+"[19~";break;case 120:v.key=l?c.C0.ESC+"[20;"+(l+1)+"~":c.C0.ESC+"[20~";break;case 121:v.key=l?c.C0.ESC+"[21;"+(l+1)+"~":c.C0.ESC+"[21~";break;case 122:v.key=l?c.C0.ESC+"[23;"+(l+1)+"~":c.C0.ESC+"[23~";break;case 123:v.key=l?c.C0.ESC+"[24;"+(l+1)+"~":c.C0.ESC+"[24~";break;default:if(!u.ctrlKey||u.shiftKey||u.altKey||u.metaKey)if(m&&!y||!u.altKey||u.metaKey)!m||u.altKey||u.ctrlKey||u.shiftKey||!u.metaKey?u.key&&!u.ctrlKey&&!u.altKey&&!u.metaKey&&u.keyCode>=48&&u.key.length===1?v.key=u.key:u.key&&u.ctrlKey&&(u.key==="_"&&(v.key=c.C0.US),u.key==="@"&&(v.key=c.C0.NUL)):u.keyCode===65&&(v.type=1);else{const h=p[u.keyCode],f=h==null?void 0:h[u.shiftKey?1:0];if(f)v.key=c.C0.ESC+f;else if(u.keyCode>=65&&u.keyCode<=90){const _=u.ctrlKey?u.keyCode-64:u.keyCode+32;let S=String.fromCharCode(_);u.shiftKey&&(S=S.toUpperCase()),v.key=c.C0.ESC+S}else if(u.keyCode===32)v.key=c.C0.ESC+(u.ctrlKey?c.C0.NUL:" ");else if(u.key==="Dead"&&u.code.startsWith("Key")){let _=u.code.slice(3,4);u.shiftKey||(_=_.toLowerCase()),v.key=c.C0.ESC+_,v.cancel=!0}}else u.keyCode>=65&&u.keyCode<=90?v.key=String.fromCharCode(u.keyCode-64):u.keyCode===32?v.key=c.C0.NUL:u.keyCode>=51&&u.keyCode<=55?v.key=String.fromCharCode(u.keyCode-51+27):u.keyCode===56?v.key=c.C0.DEL:u.keyCode===219?v.key=c.C0.ESC:u.keyCode===220?v.key=c.C0.FS:u.keyCode===221&&(v.key=c.C0.GS)}return v}},482:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,c=0,p=o.length){let u="";for(let g=c;g65535?(m-=65536,u+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):u+=String.fromCharCode(m)}return u},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const p=o.length;if(!p)return 0;let u=0,g=0;if(this._interim){const m=o.charCodeAt(g++);56320<=m&&m<=57343?c[u++]=1024*(this._interim-55296)+m-56320+65536:(c[u++]=this._interim,c[u++]=m),this._interim=0}for(let m=g;m=p)return this._interim=y,u;const v=o.charCodeAt(m);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const p=o.length;if(!p)return 0;let u,g,m,y,v=0,l=0,h=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let P,M=0;for(;(P=63&this.interim[++M])&&M<4;)k<<=6,k|=P;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=w-M;for(;h=p)return 0;if(P=o[h++],(192&P)!=128){h--,S=!0;break}this.interim[M++]=P,k<<=6,k|=63&P}S||(w===2?k<128?h--:c[v++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[v++]=k):k<65536||k>1114111||(c[v++]=k)),this.interim.fill(0)}const f=p-4;let _=h;for(;_=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(l=(31&u)<<6|63&g,l<128){_--;continue}c[v++]=l}else if((240&u)==224){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(l=(15&u)<<12|(63&g)<<6|63&m,l<2048||l>=55296&&l<=57343||l===65279)continue;c[v++]=l}else if((248&u)==240){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,this.interim[2]=m,v;if(y=o[_++],(192&y)!=128){_--;continue}if(l=(7&u)<<18|(63&g)<<12|(63&m)<<6|63&y,l<65536||l>1114111)continue;c[v++]=l}}return v}}},225:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;const o=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],c=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];let p;r.UnicodeV6=class{constructor(){if(this.version="6",!p){p=new Uint8Array(65536),p.fill(1),p[0]=0,p.fill(0,1,32),p.fill(0,127,160),p.fill(2,4352,4448),p[9001]=2,p[9002]=2,p.fill(2,11904,42192),p[12351]=1,p.fill(2,44032,55204),p.fill(2,63744,64256),p.fill(2,65040,65050),p.fill(2,65072,65136),p.fill(2,65280,65377),p.fill(2,65504,65511);for(let u=0;um[l][1])return!1;for(;l>=v;)if(y=v+l>>1,g>m[y][1])v=y+1;else{if(!(g=131072&&u<=196605||u>=196608&&u<=262141?2:1}}},5981:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;const c=o(8460),p=o(844);class u extends p.Disposable{constructor(m){super(),this._action=m,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new c.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(m,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let v;for(this._isSyncWriting=!0;v=this._writeBuffer.shift();){this._action(v);const l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(m,y){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(y),void this._innerWrite();setTimeout(()=>this._innerWrite())}this._pendingData+=m.length,this._writeBuffer.push(m),this._callbacks.push(y)}_innerWrite(m=0,y=!0){const v=m||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const l=this._writeBuffer[this._bufferOffset],h=this._action(l,y);if(h){const _=S=>Date.now()-v>=12?setTimeout(()=>this._innerWrite(0,S)):this._innerWrite(v,S);return void h.catch(S=>(queueMicrotask(()=>{throw S}),Promise.resolve(!1))).then(_)}const f=this._callbacks[this._bufferOffset];if(f&&f(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-v>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}}r.WriteBuffer=u},5941:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;const o=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,c=/^[\da-f]+$/;function p(u,g){const m=u.toString(16),y=m.length<2?"0"+m:m;switch(g){case 4:return m[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}r.parseColor=function(u){if(!u)return;let g=u.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const m=o.exec(g);if(m){const y=m[1]?15:m[4]?255:m[7]?4095:65535;return[Math.round(parseInt(m[1]||m[4]||m[7]||m[10],16)/y*255),Math.round(parseInt(m[2]||m[5]||m[8]||m[11],16)/y*255),Math.round(parseInt(m[3]||m[6]||m[9]||m[12],16)/y*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),c.exec(g)&&[3,6,9,12].includes(g.length))){const m=g.length/3,y=[0,0,0];for(let v=0;v<3;++v){const l=parseInt(g.slice(m*v,m*v+m),16);y[v]=m===1?l<<4:m===2?l:m===3?l>>4:l>>8}return y}},r.toRgbString=function(u,g=16){const[m,y,v]=u;return`rgb:${p(m,g)}/${p(y,g)}/${p(v,g)}`}},5770:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;const c=o(482),p=o(8742),u=o(5770),g=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(y,v){this._handlers[y]===void 0&&(this._handlers[y]=[]);const l=this._handlers[y];return l.push(v),{dispose:()=>{const h=l.indexOf(v);h!==-1&&l.splice(h,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(y,v){if(this.reset(),this._ident=y,this._active=this._handlers[y]||g,this._active.length)for(let l=this._active.length-1;l>=0;l--)this._active[l].hook(v);else this._handlerFb(this._ident,"HOOK",v)}put(y,v,l){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(y,v,l);else this._handlerFb(this._ident,"PUT",(0,c.utf32ToString)(y,v,l))}unhook(y,v=!0){if(this._active.length){let l=!1,h=this._active.length-1,f=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,l=v,f=this._stack.fallThrough,this._stack.paused=!1),!f&&l===!1){for(;h>=0&&(l=this._active[h].unhook(y),l!==!0);h--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,l;h--}for(;h>=0;h--)if(l=this._active[h].unhook(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,l}else this._handlerFb(this._ident,"UNHOOK",y);this._active=g,this._ident=0}};const m=new p.Params;m.addParam(0),r.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=m,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():m,this._data="",this._hitLimit=!1}put(y,v,l){this._hitLimit||(this._data+=(0,c.utf32ToString)(y,v,l),this._data.length>u.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let v=!1;if(this._hitLimit)v=!1;else if(y&&(v=this._handler(this._data,this._params),v instanceof Promise))return v.then(l=>(this._params=m,this._data="",this._hitLimit=!1,l));return this._params=m,this._data="",this._hitLimit=!1,v}}},2015:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;const c=o(844),p=o(8742),u=o(6242),g=o(6351);class m{constructor(h){this.table=new Uint8Array(h)}setDefault(h,f){this.table.fill(h<<4|f)}add(h,f,_,S){this.table[f<<8|h]=_<<4|S}addMany(h,f,_,S){for(let k=0;kw),f=(M,w)=>h.slice(M,w),_=f(32,127),S=f(0,24);S.push(25),S.push.apply(S,f(28,32));const k=f(0,14);let P;for(P in l.setDefault(1,0),l.addMany(_,0,2,0),k)l.addMany([24,26,153,154],P,3,0),l.addMany(f(128,144),P,3,0),l.addMany(f(144,152),P,3,0),l.add(156,P,0,0),l.add(27,P,11,1),l.add(157,P,4,8),l.addMany([152,158,159],P,0,7),l.add(155,P,11,3),l.add(144,P,11,9);return l.addMany(S,0,3,0),l.addMany(S,1,3,1),l.add(127,1,0,1),l.addMany(S,8,0,8),l.addMany(S,3,3,3),l.add(127,3,0,3),l.addMany(S,4,3,4),l.add(127,4,0,4),l.addMany(S,6,3,6),l.addMany(S,5,3,5),l.add(127,5,0,5),l.addMany(S,2,3,2),l.add(127,2,0,2),l.add(93,1,4,8),l.addMany(_,8,5,8),l.add(127,8,5,8),l.addMany([156,27,24,26,7],8,6,0),l.addMany(f(28,32),8,0,8),l.addMany([88,94,95],1,0,7),l.addMany(_,7,0,7),l.addMany(S,7,0,7),l.add(156,7,0,0),l.add(127,7,0,7),l.add(91,1,11,3),l.addMany(f(64,127),3,7,0),l.addMany(f(48,60),3,8,4),l.addMany([60,61,62,63],3,9,4),l.addMany(f(48,60),4,8,4),l.addMany(f(64,127),4,7,0),l.addMany([60,61,62,63],4,0,6),l.addMany(f(32,64),6,0,6),l.add(127,6,0,6),l.addMany(f(64,127),6,0,0),l.addMany(f(32,48),3,9,5),l.addMany(f(32,48),5,9,5),l.addMany(f(48,64),5,0,6),l.addMany(f(64,127),5,7,0),l.addMany(f(32,48),4,9,5),l.addMany(f(32,48),1,9,2),l.addMany(f(32,48),2,9,2),l.addMany(f(48,127),2,10,0),l.addMany(f(48,80),1,10,0),l.addMany(f(81,88),1,10,0),l.addMany([89,90,92],1,10,0),l.addMany(f(96,127),1,10,0),l.add(80,1,11,9),l.addMany(S,9,0,9),l.add(127,9,0,9),l.addMany(f(28,32),9,0,9),l.addMany(f(32,48),9,9,12),l.addMany(f(48,60),9,8,10),l.addMany([60,61,62,63],9,9,10),l.addMany(S,11,0,11),l.addMany(f(32,128),11,0,11),l.addMany(f(28,32),11,0,11),l.addMany(S,10,0,10),l.add(127,10,0,10),l.addMany(f(28,32),10,0,10),l.addMany(f(48,60),10,8,10),l.addMany([60,61,62,63],10,0,11),l.addMany(f(32,48),10,9,12),l.addMany(S,12,0,12),l.add(127,12,0,12),l.addMany(f(28,32),12,0,12),l.addMany(f(32,48),12,9,12),l.addMany(f(48,64),12,0,11),l.addMany(f(64,127),12,12,13),l.addMany(f(64,127),10,12,13),l.addMany(f(64,127),9,12,13),l.addMany(S,13,13,13),l.addMany(_,13,13,13),l.add(127,13,0,13),l.addMany([27,156,24,26],13,14,0),l.add(y,0,2,0),l.add(y,8,5,8),l.add(y,6,0,6),l.add(y,11,0,11),l.add(y,13,13,13),l}();class v extends c.Disposable{constructor(h=r.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new p.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(f,_,S)=>{},this._executeHandlerFb=f=>{},this._csiHandlerFb=(f,_)=>{},this._escHandlerFb=f=>{},this._errorHandlerFb=f=>f,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,c.toDisposable)(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this.register(new u.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(h,f=[64,126]){let _=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(_=h.prefix.charCodeAt(0),_&&60>_||_>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let k=0;kP||P>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");_<<=8,_|=P}}if(h.final.length!==1)throw new Error("final must be a single byte");const S=h.final.charCodeAt(0);if(f[0]>S||S>f[1])throw new Error(`final must be in range ${f[0]} .. ${f[1]}`);return _<<=8,_|=S,_}identToString(h){const f=[];for(;h;)f.push(String.fromCharCode(255&h)),h>>=8;return f.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,f){const _=this._identifier(h,[48,126]);this._escHandlers[_]===void 0&&(this._escHandlers[_]=[]);const S=this._escHandlers[_];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,f){this._executeHandlers[h.charCodeAt(0)]=f}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,f){const _=this._identifier(h);this._csiHandlers[_]===void 0&&(this._csiHandlers[_]=[]);const S=this._csiHandlers[_];return S.push(f),{dispose:()=>{const k=S.indexOf(f);k!==-1&&S.splice(k,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,f){return this._dcsParser.registerHandler(this._identifier(h),f)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,f){return this._oscParser.registerHandler(h,f)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(h,f,_,S,k){this._parseStack.state=h,this._parseStack.handlers=f,this._parseStack.handlerPos=_,this._parseStack.transition=S,this._parseStack.chunkPos=k}parse(h,f,_){let S,k=0,P=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(_===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const w=this._parseStack.handlers;let T=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(_===!1&&T>-1){for(;T>=0&&(S=w[T](this._params),S!==!0);T--)if(S instanceof Promise)return this._parseStack.handlerPos=T,S}this._parseStack.handlers=[];break;case 4:if(_===!1&&T>-1){for(;T>=0&&(S=w[T](),S!==!0);T--)if(S instanceof Promise)return this._parseStack.handlerPos=T,S}this._parseStack.handlers=[];break;case 6:if(k=h[this._parseStack.chunkPos],S=this._dcsParser.unhook(k!==24&&k!==26,_),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(k=h[this._parseStack.chunkPos],S=this._oscParser.end(k!==24&&k!==26,_),S)return S;k===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let w=M;w>4){case 2:for(let D=w+1;;++D){if(D>=f||(k=h[D])<32||k>126&&k=f||(k=h[D])<32||k>126&&k=f||(k=h[D])<32||k>126&&k=f||(k=h[D])<32||k>126&&k=0&&(S=T[A](this._params),S!==!0);A--)if(S instanceof Promise)return this._preserveStack(3,T,A,P,w),S;A<0&&this._csiHandlerFb(this._collect<<8|k,this._params),this.precedingCodepoint=0;break;case 8:do switch(k){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(k-48)}while(++w47&&k<60);w--;break;case 9:this._collect<<=8,this._collect|=k;break;case 10:const E=this._escHandlers[this._collect<<8|k];let R=E?E.length-1:-1;for(;R>=0&&(S=E[R](),S!==!0);R--)if(S instanceof Promise)return this._preserveStack(4,E,R,P,w),S;R<0&&this._escHandlerFb(this._collect<<8|k),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|k,this._params);break;case 13:for(let D=w+1;;++D)if(D>=f||(k=h[D])===24||k===26||k===27||k>127&&k=f||(k=h[D])<32||k>127&&k{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;const c=o(5770),p=o(482),u=[];r.OscParser=class{constructor(){this._state=0,this._active=u,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,m){this._handlers[g]===void 0&&(this._handlers[g]=[]);const y=this._handlers[g];return y.push(m),{dispose:()=>{const v=y.indexOf(m);v!==-1&&y.splice(v,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=u,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||u,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,m,y){if(this._active.length)for(let v=this._active.length-1;v>=0;v--)this._active[v].put(g,m,y);else this._handlerFb(this._id,"PUT",(0,p.utf32ToString)(g,m,y))}start(){this.reset(),this._state=1}put(g,m,y){if(this._state!==3){if(this._state===1)for(;m0&&this._put(g,m,y)}}end(g,m=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,v=this._active.length-1,l=!1;if(this._stack.paused&&(v=this._stack.loopPosition-1,y=m,l=this._stack.fallThrough,this._stack.paused=!1),!l&&y===!1){for(;v>=0&&(y=this._active[v].end(g),y!==!0);v--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!1,y;v--}for(;v>=0;v--)if(y=this._active[v].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=v,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",g);this._active=u,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,m,y){this._hitLimit||(this._data+=(0,p.utf32ToString)(g,m,y),this._data.length>c.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let m=!1;if(this._hitLimit)m=!1;else if(g&&(m=this._handler(this._data),m instanceof Promise))return m.then(y=>(this._data="",this._hitLimit=!1,y));return this._data="",this._hitLimit=!1,m}}},8742:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;const o=2147483647;class c{static fromArray(u){const g=new c;if(!u.length)return g;for(let m=Array.isArray(u[0])?1:0;m256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(u),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(u),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const u=new c(this.maxLength,this.maxSubParamsLength);return u.params.set(this.params),u.length=this.length,u._subParams.set(this._subParams),u._subParamsLength=this._subParamsLength,u._subParamsIdx.set(this._subParamsIdx),u._rejectDigits=this._rejectDigits,u._rejectSubDigits=this._rejectSubDigits,u._digitIsSub=this._digitIsSub,u}toArray(){const u=[];for(let g=0;g>8,y=255&this._subParamsIdx[g];y-m>0&&u.push(Array.prototype.slice.call(this._subParams,m,y))}return u}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(u){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=u>o?o:u}}addSubParam(u){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(u<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=u>o?o:u,this._subParamsIdx[this.length-1]++}}hasSubParams(u){return(255&this._subParamsIdx[u])-(this._subParamsIdx[u]>>8)>0}getSubParams(u){const g=this._subParamsIdx[u]>>8,m=255&this._subParamsIdx[u];return m-g>0?this._subParams.subarray(g,m):null}getSubParamsAll(){const u={};for(let g=0;g>8,y=255&this._subParamsIdx[g];y-m>0&&(u[g]=this._subParams.slice(m,y))}return u}addDigit(u){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const m=this._digitIsSub?this._subParams:this.params,y=m[g-1];m[g-1]=~y?Math.min(10*y+u,o):u}}r.Params=c},5741:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let o=this._addons.length-1;o>=0;o--)this._addons[o].instance.dispose()}loadAddon(o,c){const p={instance:c,dispose:c.dispose,isDisposed:!1};this._addons.push(p),c.dispose=()=>this._wrappedAddonDispose(p),c.activate(o)}_wrappedAddonDispose(o){if(o.isDisposed)return;let c=-1;for(let p=0;p{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;const c=o(3785),p=o(511);r.BufferApiView=class{constructor(u,g){this._buffer=u,this.type=g}init(u){return this._buffer=u,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(u){const g=this._buffer.lines.get(u);if(g)return new c.BufferLineApiView(g)}getNullCell(){return new p.CellData}}},3785:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;const c=o(511);r.BufferLineApiView=class{constructor(p){this._line=p}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(p,u){if(!(p<0||p>=this._line.length))return u?(this._line.loadCell(p,u),u):this._line.loadCell(p,new c.CellData)}translateToString(p,u,g){return this._line.translateToString(p,u,g)}}},8285:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;const c=o(8771),p=o(8460),u=o(844);class g extends u.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new p.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new c.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new c.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}}r.BufferNamespaceApi=g},7975:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(o){this._core=o}registerCsiHandler(o,c){return this._core.registerCsiHandler(o,p=>c(p.toArray()))}addCsiHandler(o,c){return this.registerCsiHandler(o,c)}registerDcsHandler(o,c){return this._core.registerDcsHandler(o,(p,u)=>c(p,u.toArray()))}addDcsHandler(o,c){return this.registerDcsHandler(o,c)}registerEscHandler(o,c){return this._core.registerEscHandler(o,c)}addEscHandler(o,c){return this.registerEscHandler(o,c)}registerOscHandler(o,c){return this._core.registerOscHandler(o,c)}addOscHandler(o,c){return this.registerOscHandler(o,c)}}},7090:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(o){this._core=o}register(o){this._core.unicodeService.register(o)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(o){this._core.unicodeService.activeVersion=o}}},744:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;const u=o(8460),g=o(844),m=o(5295),y=o(2585);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let v=r.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(l){super(),this.isUserScrolling=!1,this._onResize=this.register(new u.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new u.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(l.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(l.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=this.register(new m.BufferSet(l,this))}resize(l,h){this.cols=l,this.rows=h,this.buffers.resize(l,h),this._onResize.fire({cols:l,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(l,h=!1){const f=this.buffer;let _;_=this._cachedBlankLine,_&&_.length===this.cols&&_.getFg(0)===l.fg&&_.getBg(0)===l.bg||(_=f.getBlankLine(l,h),this._cachedBlankLine=_),_.isWrapped=h;const S=f.ybase+f.scrollTop,k=f.ybase+f.scrollBottom;if(f.scrollTop===0){const P=f.lines.isFull;k===f.lines.length-1?P?f.lines.recycle().copyFrom(_):f.lines.push(_.clone()):f.lines.splice(k+1,0,_.clone()),P?this.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this.isUserScrolling||f.ydisp++)}else{const P=k-S+1;f.lines.shiftElements(S+1,P-1,-1),f.lines.set(k,_.clone())}this.isUserScrolling||(f.ydisp=f.ybase),this._onScroll.fire(f.ydisp)}scrollLines(l,h,f){const _=this.buffer;if(l<0){if(_.ydisp===0)return;this.isUserScrolling=!0}else l+_.ydisp>=_.ybase&&(this.isUserScrolling=!1);const S=_.ydisp;_.ydisp=Math.max(Math.min(_.ydisp+l,_.ybase),0),S!==_.ydisp&&(h||this._onScroll.fire(_.ydisp))}};r.BufferService=v=c([p(0,y.IOptionsService)],v)},7994:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(o){this.glevel=o,this.charset=this._charsets[o]}setgCharset(o,c){this._charsets[o]=c,this.glevel===o&&(this.charset=c)}}},1753:function(d,r,o){var c=this&&this.__decorate||function(_,S,k,P){var M,w=arguments.length,T=w<3?S:P===null?P=Object.getOwnPropertyDescriptor(S,k):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(_,S,k,P);else for(var A=_.length-1;A>=0;A--)(M=_[A])&&(T=(w<3?M(T):w>3?M(S,k,T):M(S,k))||T);return w>3&&T&&Object.defineProperty(S,k,T),T},p=this&&this.__param||function(_,S){return function(k,P){S(k,P,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;const u=o(2585),g=o(8460),m=o(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:_=>_.button!==4&&_.action===1&&(_.ctrl=!1,_.alt=!1,_.shift=!1,!0)},VT200:{events:19,restrict:_=>_.action!==32},DRAG:{events:23,restrict:_=>_.action!==32||_.button!==3},ANY:{events:31,restrict:_=>!0}};function v(_,S){let k=(_.ctrl?16:0)|(_.shift?4:0)|(_.alt?8:0);return _.button===4?(k|=64,k|=_.action):(k|=3&_.button,4&_.button&&(k|=64),8&_.button&&(k|=128),_.action===32?k|=32:_.action!==0||S||(k|=3)),k}const l=String.fromCharCode,h={DEFAULT:_=>{const S=[v(_,!1)+32,_.col+32,_.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${l(S[0])}${l(S[1])}${l(S[2])}`},SGR:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${v(_,!0)};${_.col};${_.row}${S}`},SGR_PIXELS:_=>{const S=_.action===0&&_.button!==4?"m":"M";return`\x1B[<${v(_,!0)};${_.x};${_.y}${S}`}};let f=r.CoreMouseService=class extends m.Disposable{constructor(_,S){super(),this._bufferService=_,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const k of Object.keys(y))this.addProtocol(k,y[k]);for(const k of Object.keys(h))this.addEncoding(k,h[k]);this.reset()}addProtocol(_,S){this._protocols[_]=S}addEncoding(_,S){this._encodings[_]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(_){if(!this._protocols[_])throw new Error(`unknown protocol "${_}"`);this._activeProtocol=_,this._onProtocolChange.fire(this._protocols[_].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(_){if(!this._encodings[_])throw new Error(`unknown encoding "${_}"`);this._activeEncoding=_}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(_){if(_.col<0||_.col>=this._bufferService.cols||_.row<0||_.row>=this._bufferService.rows||_.button===4&&_.action===32||_.button===3&&_.action!==32||_.button!==4&&(_.action===2||_.action===3)||(_.col++,_.row++,_.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,_,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(_))return!1;const S=this._encodings[this._activeEncoding](_);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=_,!0}explainEvents(_){return{down:!!(1&_),up:!!(2&_),drag:!!(4&_),move:!!(8&_),wheel:!!(16&_)}}_equalEvents(_,S,k){if(k){if(_.x!==S.x||_.y!==S.y)return!1}else if(_.col!==S.col||_.row!==S.row)return!1;return _.button===S.button&&_.action===S.action&&_.ctrl===S.ctrl&&_.alt===S.alt&&_.shift===S.shift}};r.CoreMouseService=f=c([p(0,u.IBufferService),p(1,u.ICoreService)],f)},6975:function(d,r,o){var c=this&&this.__decorate||function(f,_,S,k){var P,M=arguments.length,w=M<3?_:k===null?k=Object.getOwnPropertyDescriptor(_,S):k;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(f,_,S,k);else for(var T=f.length-1;T>=0;T--)(P=f[T])&&(w=(M<3?P(w):M>3?P(_,S,w):P(_,S))||w);return M>3&&w&&Object.defineProperty(_,S,w),w},p=this&&this.__param||function(f,_){return function(S,k){_(S,k,f)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;const u=o(1439),g=o(8460),m=o(844),y=o(2585),v=Object.freeze({insertMode:!1}),l=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=r.CoreService=class extends m.Disposable{constructor(f,_,S){super(),this._bufferService=f,this._logService=_,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(l)}reset(){this.modes=(0,u.clone)(v),this.decPrivateModes=(0,u.clone)(l)}triggerDataEvent(f,_=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;_&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),_&&this._onUserInput.fire(),this._logService.debug(`sending data "${f}"`,()=>f.split("").map(k=>k.charCodeAt(0))),this._onData.fire(f)}triggerBinaryEvent(f){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${f}"`,()=>f.split("").map(_=>_.charCodeAt(0))),this._onBinary.fire(f))}};r.CoreService=h=c([p(0,y.IBufferService),p(1,y.ILogService),p(2,y.IOptionsService)],h)},9074:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;const c=o(8055),p=o(8460),u=o(844),g=o(6106);let m=0,y=0;class v extends u.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList(f=>f==null?void 0:f.marker.line),this._onDecorationRegistered=this.register(new p.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new p.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,u.toDisposable)(()=>this.reset()))}registerDecoration(f){if(f.marker.isDisposed)return;const _=new l(f);if(_){const S=_.marker.onDispose(()=>_.dispose());_.onDispose(()=>{_&&(this._decorations.delete(_)&&this._onDecorationRemoved.fire(_),S.dispose())}),this._decorations.insert(_),this._onDecorationRegistered.fire(_)}return _}reset(){for(const f of this._decorations.values())f.dispose();this._decorations.clear()}*getDecorationsAtCell(f,_,S){var k,P,M;let w=0,T=0;for(const A of this._decorations.getKeyIterator(_))w=(k=A.options.x)!==null&&k!==void 0?k:0,T=w+((P=A.options.width)!==null&&P!==void 0?P:1),f>=w&&f{var M,w,T;m=(M=P.options.x)!==null&&M!==void 0?M:0,y=m+((w=P.options.width)!==null&&w!==void 0?w:1),f>=m&&f{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;const c=o(2585),p=o(8343);class u{constructor(...m){this._entries=new Map;for(const[y,v]of m)this.set(y,v)}set(m,y){const v=this._entries.get(m);return this._entries.set(m,y),v}forEach(m){for(const[y,v]of this._entries.entries())m(y,v)}has(m){return this._entries.has(m)}get(m){return this._entries.get(m)}}r.ServiceCollection=u,r.InstantiationService=class{constructor(){this._services=new u,this._services.set(c.IInstantiationService,this)}setService(g,m){this._services.set(g,m)}getService(g){return this._services.get(g)}createInstance(g,...m){const y=(0,p.getServiceDependencies)(g).sort((h,f)=>h.index-f.index),v=[];for(const h of y){const f=this._services.get(h.id);if(!f)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${h.id}.`);v.push(f)}const l=y.length>0?y[0].index:m.length;if(m.length!==l)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${l+1} conflicts with ${m.length} static arguments`);return new g(...m,...v)}}},7866:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const u=o(844),g=o(2585),m={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,v=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let h=0;hJSON.stringify(P)).join(", ")})`);const k=_.apply(this,S);return y.trace(`GlyphRenderer#${_.name} return`,k),k}}},7302:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;const c=o(8460),p=o(844),u=o(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:u.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class m extends p.Disposable{constructor(v){super(),this._onOptionChange=this.register(new c.EventEmitter),this.onOptionChange=this._onOptionChange.event;const l=Object.assign({},r.DEFAULT_OPTIONS);for(const h in v)if(h in l)try{const f=v[h];l[h]=this._sanitizeAndValidateOption(h,f)}catch(f){console.error(f)}this.rawOptions=l,this.options=Object.assign({},l),this._setupOptions()}onSpecificOptionChange(v,l){return this.onOptionChange(h=>{h===v&&l(this.rawOptions[v])})}onMultipleOptionChange(v,l){return this.onOptionChange(h=>{v.indexOf(h)!==-1&&l()})}_setupOptions(){const v=h=>{if(!(h in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},l=(h,f)=>{if(!(h in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);f=this._sanitizeAndValidateOption(h,f),this.rawOptions[h]!==f&&(this.rawOptions[h]=f,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const f={get:v.bind(this,h),set:l.bind(this,h)};Object.defineProperty(this.options,h,f)}}_sanitizeAndValidateOption(v,l){switch(v){case"cursorStyle":if(l||(l=r.DEFAULT_OPTIONS[v]),!function(h){return h==="block"||h==="underline"||h==="bar"}(l))throw new Error(`"${l}" is not a valid value for ${v}`);break;case"wordSeparator":l||(l=r.DEFAULT_OPTIONS[v]);break;case"fontWeight":case"fontWeightBold":if(typeof l=="number"&&1<=l&&l<=1e3)break;l=g.includes(l)?l:r.DEFAULT_OPTIONS[v];break;case"cursorWidth":l=Math.floor(l);case"lineHeight":case"tabStopWidth":if(l<1)throw new Error(`${v} cannot be less than 1, value: ${l}`);break;case"minimumContrastRatio":l=Math.max(1,Math.min(21,Math.round(10*l)/10));break;case"scrollback":if((l=Math.min(l,4294967295))<0)throw new Error(`${v} cannot be less than 0, value: ${l}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(l<=0)throw new Error(`${v} cannot be less than or equal to 0, value: ${l}`);break;case"rows":case"cols":if(!l&&l!==0)throw new Error(`${v} must be numeric, value: ${l}`);break;case"windowsPty":l=l??{}}return l}}r.OptionsService=m},2660:function(d,r,o){var c=this&&this.__decorate||function(m,y,v,l){var h,f=arguments.length,_=f<3?y:l===null?l=Object.getOwnPropertyDescriptor(y,v):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(m,y,v,l);else for(var S=m.length-1;S>=0;S--)(h=m[S])&&(_=(f<3?h(_):f>3?h(y,v,_):h(y,v))||_);return f>3&&_&&Object.defineProperty(y,v,_),_},p=this&&this.__param||function(m,y){return function(v,l){y(v,l,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;const u=o(2585);let g=r.OscLinkService=class{constructor(m){this._bufferService=m,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(m){const y=this._bufferService.buffer;if(m.id===void 0){const S=y.addMarker(y.ybase+y.y),k={data:m,id:this._nextId++,lines:[S]};return S.onDispose(()=>this._removeMarkerFromLink(k,S)),this._dataByLinkId.set(k.id,k),k.id}const v=m,l=this._getEntryIdKey(v),h=this._entriesWithId.get(l);if(h)return this.addLineToLink(h.id,y.ybase+y.y),h.id;const f=y.addMarker(y.ybase+y.y),_={id:this._nextId++,key:this._getEntryIdKey(v),data:v,lines:[f]};return f.onDispose(()=>this._removeMarkerFromLink(_,f)),this._entriesWithId.set(_.key,_),this._dataByLinkId.set(_.id,_),_.id}addLineToLink(m,y){const v=this._dataByLinkId.get(m);if(v&&v.lines.every(l=>l.line!==y)){const l=this._bufferService.buffer.addMarker(y);v.lines.push(l),l.onDispose(()=>this._removeMarkerFromLink(v,l))}}getLinkData(m){var y;return(y=this._dataByLinkId.get(m))===null||y===void 0?void 0:y.data}_getEntryIdKey(m){return`${m.id};;${m.uri}`}_removeMarkerFromLink(m,y){const v=m.lines.indexOf(y);v!==-1&&(m.lines.splice(v,1),m.lines.length===0&&(m.data.id!==void 0&&this._entriesWithId.delete(m.key),this._dataByLinkId.delete(m.id)))}};r.OscLinkService=g=c([p(0,u.IBufferService)],g)},8343:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",c="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(p){return p[c]||[]},r.createDecorator=function(p){if(r.serviceRegistry.has(p))return r.serviceRegistry.get(p);const u=function(g,m,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,l,h){l[o]===l?l[c].push({id:v,index:h}):(l[c]=[{id:v,index:h}],l[o]=l)})(u,g,y)};return u.toString=()=>p,r.serviceRegistry.set(p,u),u}},2585:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const c=o(8343);var p;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(r.LogLevelEnum=p={})),r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")},1480:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;const c=o(8460),p=o(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new c.EventEmitter,this.onChange=this._onChange.event;const u=new p.UnicodeV6;this.register(u),this._active=u.version,this._activeProvider=u}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(u){if(!this._providers[u])throw new Error(`unknown Unicode version "${u}"`);this._active=u,this._activeProvider=this._providers[u],this._onChange.fire(u)}register(u){this._providers[u.version]=u}wcwidth(u){return this._activeProvider.wcwidth(u)}getStringCellWidth(u){let g=0;const m=u.length;for(let y=0;y=m)return g+this.wcwidth(v);const l=u.charCodeAt(y);56320<=l&&l<=57343?v=1024*(v-55296)+l-56320+65536:g+=this.wcwidth(l)}g+=this.wcwidth(v)}return g}}}},s={};function i(d){var r=s[d];if(r!==void 0)return r.exports;var o=s[d]={exports:{}};return n[d].call(o.exports,o,o.exports,i),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.Terminal=void 0;const r=i(9042),o=i(3236),c=i(844),p=i(5741),u=i(8285),g=i(7975),m=i(7090),y=["cols","rows"];class v extends c.Disposable{constructor(h){super(),this._core=this.register(new o.Terminal(h)),this._addonManager=this.register(new p.AddonManager),this._publicOptions=Object.assign({},this._core.options);const f=S=>this._core.options[S],_=(S,k)=>{this._checkReadonlyOptions(S),this._core.options[S]=k};for(const S in this._core.options){const k={get:f.bind(this,S),set:_.bind(this,S)};Object.defineProperty(this._publicOptions,S,k)}}_checkReadonlyOptions(h){if(y.includes(h))throw new Error(`Option "${h}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||(this._parser=new g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new m.UnicodeApi(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||(this._buffer=this.register(new u.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let f="none";switch(this._core.coreMouseService.activeProtocol){case"X10":f="x10";break;case"VT200":f="vt200";break;case"DRAG":f="drag";break;case"ANY":f="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:f,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const f in h)this._publicOptions[f]=h[f]}blur(){this._core.blur()}focus(){this._core.focus()}resize(h,f){this._verifyIntegers(h,f),this._core.resize(h,f)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){var f,_,S;return this._checkProposedApi(),this._verifyPositiveIntegers((f=h.x)!==null&&f!==void 0?f:0,(_=h.width)!==null&&_!==void 0?_:0,(S=h.height)!==null&&S!==void 0?S:0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,f,_){this._verifyIntegers(h,f,_),this._core.select(h,f,_)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,f){this._verifyIntegers(h,f),this._core.selectLines(h,f)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,f){this._core.write(h,f)}writeln(h,f){this._core.write(h),this._core.write(`\r +`,f)}paste(h){this._core.paste(h)}refresh(h,f){this._verifyIntegers(h,f),this._core.refresh(h,f)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return r}_verifyIntegers(...h){for(const f of h)if(f===1/0||isNaN(f)||f%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const f of h)if(f&&(f===1/0||isNaN(f)||f%1!=0||f<0))throw new Error("This API only accepts positive integers")}}d.Terminal=v})(),a})())})(Nm);var Um=Nm.exports,Vm={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={};return(()=>{var s=n;Object.defineProperty(s,"__esModule",{value:!0}),s.FitAddon=void 0,s.FitAddon=class{activate(i){this._terminal=i}dispose(){}fit(){const i=this.proposeDimensions();if(!i||!this._terminal||isNaN(i.cols)||isNaN(i.rows))return;const a=this._terminal._core;this._terminal.rows===i.rows&&this._terminal.cols===i.cols||(a._renderService.clear(),this._terminal.resize(i.cols,i.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const i=this._terminal._core,a=i._renderService.dimensions;if(a.css.cell.width===0||a.css.cell.height===0)return;const d=this._terminal.options.scrollback===0?0:i.viewport.scrollBarWidth,r=window.getComputedStyle(this._terminal.element.parentElement),o=parseInt(r.getPropertyValue("height")),c=Math.max(0,parseInt(r.getPropertyValue("width"))),p=window.getComputedStyle(this._terminal.element),u=o-(parseInt(p.getPropertyValue("padding-top"))+parseInt(p.getPropertyValue("padding-bottom"))),g=c-(parseInt(p.getPropertyValue("padding-right"))+parseInt(p.getPropertyValue("padding-left")))-d;return{cols:Math.max(2,Math.floor(g/a.css.cell.width)),rows:Math.max(1,Math.floor(u/a.css.cell.height))}}}})(),n})())})(Vm);var Km=Vm.exports,Wm={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={965:function(d,r,o){var c=this&&this.__decorate||function(M,w,T,A){var E,R=arguments.length,D=R<3?w:A===null?A=Object.getOwnPropertyDescriptor(w,T):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(M,w,T,A);else for(var I=M.length-1;I>=0;I--)(E=M[I])&&(D=(R<3?E(D):R>3?E(w,T,D):E(w,T))||D);return R>3&&D&&Object.defineProperty(w,T,D),D};Object.defineProperty(r,"__esModule",{value:!0}),r.GlyphRenderer=void 0;const p=o(374),u=o(509),g=o(855),m=o(859),y=o(776),v=o(381),l=11,h=l*Float32Array.BYTES_PER_ELEMENT;let f,_=0,S=0,k=0;class P extends m.Disposable{constructor(w,T,A){super(),this._terminal=w,this._gl=T,this._dimensions=A,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const E=this._gl;u.TextureAtlas.maxAtlasPages===void 0&&(u.TextureAtlas.maxAtlasPages=Math.min(32,(0,p.throwIfFalsy)(E.getParameter(E.MAX_TEXTURE_IMAGE_UNITS))),u.TextureAtlas.maxTextureSize=(0,p.throwIfFalsy)(E.getParameter(E.MAX_TEXTURE_SIZE))),this._program=(0,p.throwIfFalsy)((0,v.createProgram)(E,`#version 300 es +layout (location = 0) in vec2 a_unitquad; +layout (location = 1) in vec2 a_cellpos; +layout (location = 2) in vec2 a_offset; +layout (location = 3) in vec2 a_size; +layout (location = 4) in float a_texpage; +layout (location = 5) in vec2 a_texcoord; +layout (location = 6) in vec2 a_texsize; + +uniform mat4 u_projection; +uniform vec2 u_resolution; + +out vec2 v_texcoord; +flat out int v_texpage; + +void main() { + vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size); + gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); + v_texpage = int(a_texpage); + v_texcoord = a_texcoord + a_unitquad * a_texsize; +}`,function(W){let z="";for(let N=1;NE.deleteProgram(this._program))),this._projectionLocation=(0,p.throwIfFalsy)(E.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,p.throwIfFalsy)(E.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,p.throwIfFalsy)(E.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=E.createVertexArray(),E.bindVertexArray(this._vertexArrayObject);const R=new Float32Array([0,0,1,0,0,1,1,1]),D=E.createBuffer();this.register((0,m.toDisposable)(()=>E.deleteBuffer(D))),E.bindBuffer(E.ARRAY_BUFFER,D),E.bufferData(E.ARRAY_BUFFER,R,E.STATIC_DRAW),E.enableVertexAttribArray(0),E.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const I=new Uint8Array([0,1,2,3]),O=E.createBuffer();this.register((0,m.toDisposable)(()=>E.deleteBuffer(O))),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,O),E.bufferData(E.ELEMENT_ARRAY_BUFFER,I,E.STATIC_DRAW),this._attributesBuffer=(0,p.throwIfFalsy)(E.createBuffer()),this.register((0,m.toDisposable)(()=>E.deleteBuffer(this._attributesBuffer))),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.enableVertexAttribArray(2),E.vertexAttribPointer(2,2,E.FLOAT,!1,h,0),E.vertexAttribDivisor(2,1),E.enableVertexAttribArray(3),E.vertexAttribPointer(3,2,E.FLOAT,!1,h,2*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(3,1),E.enableVertexAttribArray(4),E.vertexAttribPointer(4,1,E.FLOAT,!1,h,4*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(4,1),E.enableVertexAttribArray(5),E.vertexAttribPointer(5,2,E.FLOAT,!1,h,5*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(5,1),E.enableVertexAttribArray(6),E.vertexAttribPointer(6,2,E.FLOAT,!1,h,7*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(6,1),E.enableVertexAttribArray(1),E.vertexAttribPointer(1,2,E.FLOAT,!1,h,9*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(1,1),E.useProgram(this._program);const U=new Int32Array(u.TextureAtlas.maxAtlasPages);for(let W=0;WE.deleteTexture(z.texture))),E.activeTexture(E.TEXTURE0+W),E.bindTexture(E.TEXTURE_2D,z.texture),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_S,E.CLAMP_TO_EDGE),E.texParameteri(E.TEXTURE_2D,E.TEXTURE_WRAP_T,E.CLAMP_TO_EDGE),E.texImage2D(E.TEXTURE_2D,0,E.RGBA,1,1,0,E.RGBA,E.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[W]=z}E.enable(E.BLEND),E.blendFunc(E.SRC_ALPHA,E.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(w,T,A,E,R,D,I,O){this._updateCell(this._vertices.attributes,w,T,A,E,R,D,I,O)}_updateCell(w,T,A,E,R,D,I,O,U){_=(A*this._terminal.cols+T)*l,E!==g.NULL_CELL_CODE&&E!==void 0?this._atlas&&(f=O&&O.length>1?this._atlas.getRasterizedGlyphCombinedChar(O,R,D,I,!1):this._atlas.getRasterizedGlyph(E,R,D,I,!1),S=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),R!==U&&f.offset.x>S?(k=f.offset.x-S,w[_]=-(f.offset.x-k)+this._dimensions.device.char.left,w[_+1]=-f.offset.y+this._dimensions.device.char.top,w[_+2]=(f.size.x-k)/this._dimensions.device.canvas.width,w[_+3]=f.size.y/this._dimensions.device.canvas.height,w[_+4]=f.texturePage,w[_+5]=f.texturePositionClipSpace.x+k/this._atlas.pages[f.texturePage].canvas.width,w[_+6]=f.texturePositionClipSpace.y,w[_+7]=f.sizeClipSpace.x-k/this._atlas.pages[f.texturePage].canvas.width,w[_+8]=f.sizeClipSpace.y):(w[_]=-f.offset.x+this._dimensions.device.char.left,w[_+1]=-f.offset.y+this._dimensions.device.char.top,w[_+2]=f.size.x/this._dimensions.device.canvas.width,w[_+3]=f.size.y/this._dimensions.device.canvas.height,w[_+4]=f.texturePage,w[_+5]=f.texturePositionClipSpace.x,w[_+6]=f.texturePositionClipSpace.y,w[_+7]=f.sizeClipSpace.x,w[_+8]=f.sizeClipSpace.y)):w.fill(0,_,_+l-1-2)}clear(){const w=this._terminal,T=w.cols*w.rows*l;this._vertices.count!==T?this._vertices.attributes=new Float32Array(T):this._vertices.attributes.fill(0);let A=0;for(;A{Object.defineProperty(r,"__esModule",{value:!0}),r.RectangleRenderer=void 0;const c=o(374),p=o(859),u=o(310),g=o(381),m=8*Float32Array.BYTES_PER_ELEMENT;class y{constructor(){this.attributes=new Float32Array(160),this.count=0}}let v=0,l=0,h=0,f=0,_=0,S=0,k=0;class P extends p.Disposable{constructor(w,T,A,E){super(),this._terminal=w,this._gl=T,this._dimensions=A,this._themeService=E,this._vertices=new y,this._verticesCursor=new y;const R=this._gl;this._program=(0,c.throwIfFalsy)((0,g.createProgram)(R,`#version 300 es +layout (location = 0) in vec2 a_position; +layout (location = 1) in vec2 a_size; +layout (location = 2) in vec4 a_color; +layout (location = 3) in vec2 a_unitquad; + +uniform mat4 u_projection; + +out vec4 v_color; + +void main() { + vec2 zeroToOne = a_position + (a_unitquad * a_size); + gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0); + v_color = a_color; +}`,`#version 300 es +precision lowp float; + +in vec4 v_color; + +out vec4 outColor; + +void main() { + outColor = v_color; +}`)),this.register((0,p.toDisposable)(()=>R.deleteProgram(this._program))),this._projectionLocation=(0,c.throwIfFalsy)(R.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=R.createVertexArray(),R.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),I=R.createBuffer();this.register((0,p.toDisposable)(()=>R.deleteBuffer(I))),R.bindBuffer(R.ARRAY_BUFFER,I),R.bufferData(R.ARRAY_BUFFER,D,R.STATIC_DRAW),R.enableVertexAttribArray(3),R.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const O=new Uint8Array([0,1,2,3]),U=R.createBuffer();this.register((0,p.toDisposable)(()=>R.deleteBuffer(U))),R.bindBuffer(R.ELEMENT_ARRAY_BUFFER,U),R.bufferData(R.ELEMENT_ARRAY_BUFFER,O,R.STATIC_DRAW),this._attributesBuffer=(0,c.throwIfFalsy)(R.createBuffer()),this.register((0,p.toDisposable)(()=>R.deleteBuffer(this._attributesBuffer))),R.bindBuffer(R.ARRAY_BUFFER,this._attributesBuffer),R.enableVertexAttribArray(0),R.vertexAttribPointer(0,2,R.FLOAT,!1,m,0),R.vertexAttribDivisor(0,1),R.enableVertexAttribArray(1),R.vertexAttribPointer(1,2,R.FLOAT,!1,m,2*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(1,1),R.enableVertexAttribArray(2),R.vertexAttribPointer(2,4,R.FLOAT,!1,m,4*Float32Array.BYTES_PER_ELEMENT),R.vertexAttribDivisor(2,1),this._updateCachedColors(E.colors),this.register(this._themeService.onChangeColors(W=>{this._updateCachedColors(W),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(w){const T=this._gl;T.useProgram(this._program),T.bindVertexArray(this._vertexArrayObject),T.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),T.bindBuffer(T.ARRAY_BUFFER,this._attributesBuffer),T.bufferData(T.ARRAY_BUFFER,w.attributes,T.DYNAMIC_DRAW),T.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,T.UNSIGNED_BYTE,0,w.count)}handleResize(){this._updateViewportRectangle()}setDimensions(w){this._dimensions=w}_updateCachedColors(w){this._bgFloat=this._colorToFloat32Array(w.background),this._cursorFloat=this._colorToFloat32Array(w.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(w){const T=this._terminal,A=this._vertices;let E,R,D,I,O,U,W,z,N,V,q,G=1;for(E=0;E>24&255)/255,_=(v>>16&255)/255,S=(v>>8&255)/255,k=1,this._addRectangle(w.attributes,T,l,h,(D-R)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,f,_,S,k)}_addRectangle(w,T,A,E,R,D,I,O,U,W){w[T]=A/this._dimensions.device.canvas.width,w[T+1]=E/this._dimensions.device.canvas.height,w[T+2]=R/this._dimensions.device.canvas.width,w[T+3]=D/this._dimensions.device.canvas.height,w[T+4]=I,w[T+5]=O,w[T+6]=U,w[T+7]=W}_addRectangleFloat(w,T,A,E,R,D,I){w[T]=A/this._dimensions.device.canvas.width,w[T+1]=E/this._dimensions.device.canvas.height,w[T+2]=R/this._dimensions.device.canvas.width,w[T+3]=D/this._dimensions.device.canvas.height,w[T+4]=I[0],w[T+5]=I[1],w[T+6]=I[2],w[T+7]=I[3]}_colorToFloat32Array(w){return new Float32Array([(w.rgba>>24&255)/255,(w.rgba>>16&255)/255,(w.rgba>>8&255)/255,(255&w.rgba)/255])}}r.RectangleRenderer=P},310:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderModel=r.COMBINED_CHAR_BIT_MASK=r.RENDER_MODEL_EXT_OFFSET=r.RENDER_MODEL_FG_OFFSET=r.RENDER_MODEL_BG_OFFSET=r.RENDER_MODEL_INDICIES_PER_CELL=void 0;const c=o(296);r.RENDER_MODEL_INDICIES_PER_CELL=4,r.RENDER_MODEL_BG_OFFSET=1,r.RENDER_MODEL_FG_OFFSET=2,r.RENDER_MODEL_EXT_OFFSET=3,r.COMBINED_CHAR_BIT_MASK=2147483648,r.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,c.createSelectionRenderModel)()}resize(p,u){const g=p*u*r.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(u))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:function(d,r,o){var c=this&&this.__decorate||function(D,I,O,U){var W,z=arguments.length,N=z<3?I:U===null?U=Object.getOwnPropertyDescriptor(I,O):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(D,I,O,U);else for(var V=D.length-1;V>=0;V--)(W=D[V])&&(N=(z<3?W(N):z>3?W(I,O,N):W(I,O))||N);return z>3&&N&&Object.defineProperty(I,O,N),N};Object.defineProperty(r,"__esModule",{value:!0}),r.JoinedCellData=r.WebglRenderer=void 0;const p=o(820),u=o(274),g=o(627),m=o(457),y=o(56),v=o(374),l=o(345),h=o(859),f=o(147),_=o(782),S=o(855),k=o(776),P=o(965),M=o(742),w=o(310),T=o(733);class A extends h.Disposable{constructor(I,O,U,W,z,N,V,q,G){super(),this._terminal=I,this._characterJoinerService=O,this._charSizeService=U,this._coreBrowserService=W,this._coreService=z,this._decorationService=N,this._optionsService=V,this._themeService=q,this._cursorBlinkStateManager=new h.MutableDisposable,this._charAtlasDisposable=this.register(new h.MutableDisposable),this._model=new w.RenderModel,this._workCell=new _.CellData,this._rectangleRenderer=this.register(new h.MutableDisposable),this._glyphRenderer=this.register(new h.MutableDisposable),this._onChangeTextureAtlas=this.register(new l.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new l.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new l.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new l.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new l.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new u.CellColorResolver(this._terminal,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new T.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier2,this._coreBrowserService,V,this._themeService)],this.dimensions=(0,v.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(V.onOptionChange(()=>this._handleOptionsChanged())),this._canvas=document.createElement("canvas");const te={antialias:!1,depth:!1,preserveDrawingBuffer:G};if(this._gl=this._canvas.getContext("webgl2",te),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextlost",oe=>{console.log("webglcontextlost event received"),oe.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(oe)},3e3)})),this.register((0,p.addDisposableDomListener)(this._canvas,"webglcontextrestored",oe=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,g.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this.register((0,y.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,(oe,ie)=>this._setCanvasDevicePixelDimensions(oe,ie))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,h.toDisposable)(()=>{var oe;for(const ie of this._renderLayers)ie.dispose();(oe=this._canvas.parentElement)===null||oe===void 0||oe.removeChild(this._canvas),(0,g.removeTerminalFromCache)(this._terminal)}))}get textureAtlas(){var I;return(I=this._charAtlas)===null||I===void 0?void 0:I.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(I,O){var U,W,z,N;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const V of this._renderLayers)V.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,(U=this._rectangleRenderer.value)===null||U===void 0||U.setDimensions(this.dimensions),(W=this._rectangleRenderer.value)===null||W===void 0||W.handleResize(),(z=this._glyphRenderer.value)===null||z===void 0||z.setDimensions(this.dimensions),(N=this._glyphRenderer.value)===null||N===void 0||N.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var I;for(const O of this._renderLayers)O.handleBlur(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.pause(),this._requestRedrawViewport()}handleFocus(){var I;for(const O of this._renderLayers)O.handleFocus(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.resume(),this._requestRedrawViewport()}handleSelectionChanged(I,O,U){for(const W of this._renderLayers)W.handleSelectionChanged(this._terminal,I,O,U);this._model.selection.update(this._terminal,I,O,U),this._requestRedrawViewport()}handleCursorMove(){var I;for(const O of this._renderLayers)O.handleCursorMove(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new M.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new P.GlyphRenderer(this._terminal,this._gl,this.dimensions),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var I;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const O=(0,g.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr);this._charAtlas!==O&&(this._onChangeTextureAtlas.fire(O.pages[0].canvas),this._charAtlasDisposable.value=(0,h.getDisposeArrayDisposable)([(0,l.forwardEvent)(O.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,l.forwardEvent)(O.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=O,this._charAtlas.warmUp(),(I=this._glyphRenderer.value)===null||I===void 0||I.setAtlas(this._charAtlas)}_clearModel(I){var O;this._model.clear(),I&&((O=this._glyphRenderer.value)===null||O===void 0||O.clear())}clearTextureAtlas(){var I;(I=this._charAtlas)===null||I===void 0||I.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var I;this._clearModel(!0);for(const O of this._renderLayers)O.reset(this._terminal);(I=this._cursorBlinkStateManager.value)===null||I===void 0||I.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(I){return-1}deregisterCharacterJoiner(I){return!1}renderRows(I,O){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const U of this._renderLayers)U.handleGridChanged(this._terminal,I,O);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(I,O),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new m.CursorBlinkStateManager(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(I,O){const U=this._core;let W,z,N,V,q,G,te,oe,ie,ye,K,J,Q,ce=this._workCell;I=R(I,U.rows-1,0),O=R(O,U.rows-1,0);const Fe=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,Ee=Math.min(this._terminal.buffer.active.cursorX,U.cols-1);let Ye=-1;const Ze=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let ue=!1;for(z=I;z<=O;z++)for(N=z+U.buffer.ydisp,V=U.buffer.lines.get(N),this._model.lineLengths[z]=0,q=this._characterJoinerService.getJoinedCharacters(N),J=0;J0&&J===q[0][0]&&(G=!0,oe=q.shift(),ce=new E(ce,V.translateToString(!0,oe[0],oe[1]),oe[1]-oe[0]),te=oe[1]-1),ie=ce.getChars(),ye=ce.getCode(),K=(z*U.cols+J)*w.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ce,J,N),Ze&&N===Fe&&(J===Ee&&(this._model.cursor={x:Ee,y:this._terminal.buffer.active.cursorY,width:ce.getWidth(),style:this._coreBrowserService.isFocused?U.options.cursorStyle||"block":U.options.cursorInactiveStyle,cursorWidth:U.options.cursorWidth,dpr:this._devicePixelRatio},Ye=Ee+ce.getWidth()-1),J>=Ee&&J<=Ye&&(this._coreBrowserService.isFocused&&(U.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&U.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),ye!==S.NULL_CELL_CODE&&(this._model.lineLengths[z]=J+1),(this._model.cells[K]!==ye||this._model.cells[K+w.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[K+w.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[K+w.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(ue=!0,ie.length>1&&(ye|=w.COMBINED_CHAR_BIT_MASK),this._model.cells[K]=ye,this._model.cells[K+w.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[K+w.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[K+w.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,this._glyphRenderer.value.updateCell(J,z,ye,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,ie,W),G))for(ce=this._workCell,J++;J{Object.defineProperty(r,"__esModule",{value:!0}),r.GLTexture=r.expandFloat32Array=r.createShader=r.createProgram=r.PROJECTION_MATRIX=void 0;const c=o(374);function p(u,g,m){const y=(0,c.throwIfFalsy)(u.createShader(g));if(u.shaderSource(y,m),u.compileShader(y),u.getShaderParameter(y,u.COMPILE_STATUS))return y;console.error(u.getShaderInfoLog(y)),u.deleteShader(y)}r.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),r.createProgram=function(u,g,m){const y=(0,c.throwIfFalsy)(u.createProgram());if(u.attachShader(y,(0,c.throwIfFalsy)(p(u,u.VERTEX_SHADER,g))),u.attachShader(y,(0,c.throwIfFalsy)(p(u,u.FRAGMENT_SHADER,m))),u.linkProgram(y),u.getProgramParameter(y,u.LINK_STATUS))return y;console.error(u.getProgramInfoLog(y)),u.deleteProgram(y)},r.createShader=p,r.expandFloat32Array=function(u,g){const m=Math.min(2*u.length,g),y=new Float32Array(m);for(let v=0;v{Object.defineProperty(r,"__esModule",{value:!0}),r.BaseRenderLayer=void 0;const c=o(627),p=o(237),u=o(374),g=o(859);class m extends g.Disposable{constructor(v,l,h,f,_,S,k,P){super(),this._container=l,this._alpha=_,this._coreBrowserService=S,this._optionsService=k,this._themeService=P,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add(`xterm-${h}-layer`),this._canvas.style.zIndex=f.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors(M=>{this._refreshCharAtlas(v,M),this.reset(v)})),this.register((0,g.toDisposable)(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=(0,u.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(v){}handleFocus(v){}handleCursorMove(v){}handleGridChanged(v,l,h){}handleSelectionChanged(v,l,h,f=!1){}_setTransparency(v,l){if(l===this._alpha)return;const h=this._canvas;this._alpha=l,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,h),this._refreshCharAtlas(v,this._themeService.colors),this.handleGridChanged(v,0,v.rows-1)}_refreshCharAtlas(v,l){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,c.acquireTextureAtlas)(v,this._optionsService.rawOptions,l,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(v,l){this._deviceCellWidth=l.device.cell.width,this._deviceCellHeight=l.device.cell.height,this._deviceCharWidth=l.device.char.width,this._deviceCharHeight=l.device.char.height,this._deviceCharLeft=l.device.char.left,this._deviceCharTop=l.device.char.top,this._canvas.width=l.device.canvas.width,this._canvas.height=l.device.canvas.height,this._canvas.style.width=`${l.css.canvas.width}px`,this._canvas.style.height=`${l.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(v,this._themeService.colors)}_fillBottomLineAtCells(v,l,h=1){this._ctx.fillRect(v*this._deviceCellWidth,(l+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,h*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(v,l,h,f){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,l*this._deviceCellHeight,h*this._deviceCellWidth,f*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,l*this._deviceCellHeight,h*this._deviceCellWidth,f*this._deviceCellHeight))}_fillCharTrueColor(v,l,h,f){this._ctx.font=this._getFont(v,!1,!1),this._ctx.textBaseline=p.TEXT_BASELINE,this._clipCell(h,f,l.getWidth()),this._ctx.fillText(l.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,f*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(v,l,h){this._ctx.beginPath(),this._ctx.rect(v*this._deviceCellWidth,l*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,l,h){return`${h?"italic":""} ${l?v.options.fontWeightBold:v.options.fontWeight} ${v.options.fontSize*this._coreBrowserService.dpr}px ${v.options.fontFamily}`}}r.BaseRenderLayer=m},733:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkRenderLayer=void 0;const c=o(197),p=o(237),u=o(592);class g extends u.BaseRenderLayer{constructor(y,v,l,h,f,_,S){super(l,y,"link",v,!0,f,_,S),this.register(h.onShowLinkUnderline(k=>this._handleShowLinkUnderline(k))),this.register(h.onHideLinkUnderline(k=>this._handleHideLinkUnderline(k)))}resize(y,v){super.resize(y,v),this._state=void 0}reset(y){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===p.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg!==void 0&&(0,c.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let v=y.y1+1;v{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(o,c,p,u){o.addEventListener(c,p,u);let g=!1;return{dispose:()=>{g||(g=!0,o.removeEventListener(c,p,u))}}}},274:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellColorResolver=void 0;let o,c=0,p=0,u=!1,g=!1,m=!1;r.CellColorResolver=class{constructor(y,v,l,h,f){this._terminal=y,this._selectionRenderModel=v,this._decorationService=l,this._coreBrowserService=h,this._themeService=f,this.result={fg:0,bg:0,ext:0}}resolve(y,v,l){this.result.bg=y.bg,this.result.fg=y.fg,this.result.ext=268435456&y.bg?y.extended.ext:0,p=0,c=0,g=!1,u=!1,m=!1,o=this._themeService.colors,this._decorationService.forEachDecorationAtCell(v,l,"bottom",h=>{h.backgroundColorRGB&&(p=h.backgroundColorRGB.rgba>>8&16777215,g=!0),h.foregroundColorRGB&&(c=h.foregroundColorRGB.rgba>>8&16777215,u=!0)}),m=this._selectionRenderModel.isCellSelected(this._terminal,v,l),m&&(p=(this._coreBrowserService.isFocused?o.selectionBackgroundOpaque:o.selectionInactiveBackgroundOpaque).rgba>>8&16777215,g=!0,o.selectionForeground&&(c=o.selectionForeground.rgba>>8&16777215,u=!0)),this._decorationService.forEachDecorationAtCell(v,l,"top",h=>{h.backgroundColorRGB&&(p=h.backgroundColorRGB.rgba>>8&16777215,g=!0),h.foregroundColorRGB&&(c=h.foregroundColorRGB.rgba>>8&16777215,u=!0)}),g&&(p=m?-16777216&y.bg&-134217729|p|50331648:-16777216&y.bg|p|50331648),u&&(c=-16777216&y.fg&-67108865|c|50331648),67108864&this.result.fg&&(g&&!u&&(c=50331648&this.result.bg?-134217728&this.result.fg|67108863&this.result.bg:-134217728&this.result.fg|16777215&o.background.rgba>>8|50331648,u=!0),!g&&u&&(p=50331648&this.result.fg?-67108864&this.result.bg|67108863&this.result.fg:-67108864&this.result.bg|16777215&o.foreground.rgba>>8|50331648,g=!0)),o=void 0,this.result.bg=g?p:this.result.bg,this.result.fg=u?c:this.result.fg}}},627:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeTerminalFromCache=r.acquireTextureAtlas=void 0;const c=o(509),p=o(197),u=[];r.acquireTextureAtlas=function(g,m,y,v,l,h,f,_){const S=(0,p.generateConfig)(v,l,h,f,m,y,_);for(let M=0;M=0){if((0,p.configEquals)(w.config,S))return w.atlas;w.ownedBy.length===1?(w.atlas.dispose(),u.splice(M,1)):w.ownedBy.splice(T,1);break}}for(let M=0;M{Object.defineProperty(r,"__esModule",{value:!0}),r.is256Color=r.configEquals=r.generateConfig=void 0;const c=o(160);r.generateConfig=function(p,u,g,m,y,v,l){const h={foreground:v.foreground,background:v.background,cursor:c.NULL_COLOR,cursorAccent:c.NULL_COLOR,selectionForeground:c.NULL_COLOR,selectionBackgroundTransparent:c.NULL_COLOR,selectionBackgroundOpaque:c.NULL_COLOR,selectionInactiveBackgroundTransparent:c.NULL_COLOR,selectionInactiveBackgroundOpaque:c.NULL_COLOR,ansi:v.ansi.slice(),contrastCache:v.contrastCache,halfContrastCache:v.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:l,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:p,deviceCellHeight:u,deviceCharWidth:g,deviceCharHeight:m,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:h}},r.configEquals=function(p,u){for(let g=0;g{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;const c=o(399);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=c.isFirefox||c.isLegacyEdge?"bottom":"ideographic"},457:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CursorBlinkStateManager=void 0,r.CursorBlinkStateManager=class{constructor(o,c){this._renderCallback=o,this._coreBrowserService=c,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(o=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,c>0)return void this._restartInterval(c)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){const c=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(c)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},600)},o)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}}},860:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tryDrawCustomChar=r.powerlineDefinitions=r.boxDrawingDefinitions=r.blockElementDefinitions=void 0;const c=o(374);r.blockElementDefinitions={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]};const p={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]};r.boxDrawingDefinitions={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(v,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"║":{1:(v,l)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╒":{1:(v,l)=>`M.5,1 L.5,${.5-l} L1,${.5-l} M.5,${.5+l} L1,${.5+l}`},"╓":{1:(v,l)=>`M${.5-v},1 L${.5-v},.5 L1,.5 M${.5+v},.5 L${.5+v},1`},"╔":{1:(v,l)=>`M1,${.5-l} L${.5-v},${.5-l} L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1`},"╕":{1:(v,l)=>`M0,${.5-l} L.5,${.5-l} L.5,1 M0,${.5+l} L.5,${.5+l}`},"╖":{1:(v,l)=>`M${.5+v},1 L${.5+v},.5 L0,.5 M${.5-v},.5 L${.5-v},1`},"╗":{1:(v,l)=>`M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M0,${.5-l} L${.5+v},${.5-l} L${.5+v},1`},"╘":{1:(v,l)=>`M.5,0 L.5,${.5+l} L1,${.5+l} M.5,${.5-l} L1,${.5-l}`},"╙":{1:(v,l)=>`M1,.5 L${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╚":{1:(v,l)=>`M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0 M1,${.5+l} L${.5-v},${.5+l} L${.5-v},0`},"╛":{1:(v,l)=>`M0,${.5+l} L.5,${.5+l} L.5,0 M0,${.5-l} L.5,${.5-l}`},"╜":{1:(v,l)=>`M0,.5 L${.5+v},.5 L${.5+v},0 M${.5-v},.5 L${.5-v},0`},"╝":{1:(v,l)=>`M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0 M0,${.5+l} L${.5+v},${.5+l} L${.5+v},0`},"╞":{1:(v,l)=>`M.5,0 L.5,1 M.5,${.5-l} L1,${.5-l} M.5,${.5+l} L1,${.5+l}`},"╟":{1:(v,l)=>`M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1 M${.5+v},.5 L1,.5`},"╠":{1:(v,l)=>`M${.5-v},0 L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1 M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0`},"╡":{1:(v,l)=>`M.5,0 L.5,1 M0,${.5-l} L.5,${.5-l} M0,${.5+l} L.5,${.5+l}`},"╢":{1:(v,l)=>`M0,.5 L${.5-v},.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╣":{1:(v,l)=>`M${.5+v},0 L${.5+v},1 M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0`},"╤":{1:(v,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l} M.5,${.5+l} L.5,1`},"╥":{1:(v,l)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},1 M${.5+v},.5 L${.5+v},1`},"╦":{1:(v,l)=>`M0,${.5-l} L1,${.5-l} M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1`},"╧":{1:(v,l)=>`M.5,0 L.5,${.5-l} M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"╨":{1:(v,l)=>`M0,.5 L1,.5 M${.5-v},.5 L${.5-v},0 M${.5+v},.5 L${.5+v},0`},"╩":{1:(v,l)=>`M0,${.5+l} L1,${.5+l} M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0 M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0`},"╪":{1:(v,l)=>`M.5,0 L.5,1 M0,${.5-l} L1,${.5-l} M0,${.5+l} L1,${.5+l}`},"╫":{1:(v,l)=>`M0,.5 L1,.5 M${.5-v},0 L${.5-v},1 M${.5+v},0 L${.5+v},1`},"╬":{1:(v,l)=>`M0,${.5+l} L${.5-v},${.5+l} L${.5-v},1 M1,${.5+l} L${.5+v},${.5+l} L${.5+v},1 M0,${.5-l} L${.5-v},${.5-l} L${.5-v},0 M1,${.5-l} L${.5+v},${.5-l} L${.5+v},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(v,l)=>`M.5,1 L.5,${.5+l/.15*.5} C.5,${.5+l/.15*.5},.5,.5,1,.5`},"╮":{1:(v,l)=>`M.5,1 L.5,${.5+l/.15*.5} C.5,${.5+l/.15*.5},.5,.5,0,.5`},"╯":{1:(v,l)=>`M.5,0 L.5,${.5-l/.15*.5} C.5,${.5-l/.15*.5},.5,.5,0,.5`},"╰":{1:(v,l)=>`M.5,0 L.5,${.5-l/.15*.5} C.5,${.5-l/.15*.5},.5,.5,1,.5`}},r.powerlineDefinitions={"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}},r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.powerlineDefinitions[""]=r.powerlineDefinitions[""],r.tryDrawCustomChar=function(v,l,h,f,_,S,k,P){const M=r.blockElementDefinitions[l];if(M)return function(E,R,D,I,O,U){for(let W=0;W7&&parseInt(z.slice(7,9),16)||1;else{if(!z.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${z}" when drawing pattern glyph`);[ie,ye,K,J]=z.substring(5,z.length-1).split(",").map(Q=>parseFloat(Q))}for(let Q=0;Qv.bezierCurveTo(l[0],l[1],l[2],l[3],l[4],l[5]),L:(v,l)=>v.lineTo(l[0],l[1]),M:(v,l)=>v.moveTo(l[0],l[1])};function y(v,l,h,f,_,S,k,P=0,M=0){const w=v.map(T=>parseFloat(T)||parseInt(T));if(w.length<2)throw new Error("Too few arguments for instruction");for(let T=0;T{Object.defineProperty(r,"__esModule",{value:!0}),r.observeDevicePixelDimensions=void 0;const c=o(859);r.observeDevicePixelDimensions=function(p,u,g){let m=new u.ResizeObserver(y=>{const v=y.find(f=>f.target===p);if(!v)return;if(!("devicePixelContentBoxSize"in v))return m==null||m.disconnect(),void(m=void 0);const l=v.devicePixelContentBoxSize[0].inlineSize,h=v.devicePixelContentBoxSize[0].blockSize;l>0&&h>0&&g(l,h)});try{m.observe(p,{box:["device-pixel-content-box"]})}catch{m.disconnect(),m=void 0}return(0,c.toDisposable)(()=>m==null?void 0:m.disconnect())}},374:(d,r)=>{function o(c){return 57508<=c&&c<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.createRenderDimensions=r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(c){if(!c)throw new Error("value must not be falsy");return c},r.isPowerlineGlyph=o,r.isRestrictedPowerlineGlyph=function(c){return 57520<=c&&c<=57527},r.excludeFromContrastRatioDemands=function(c){return o(c)||function(p){return 9472<=p&&p<=9631}(c)},r.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}}},296:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createSelectionRenderModel=void 0;class o{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(p,u,g,m=!1){if(this.selectionStart=u,this.selectionEnd=g,!u||!g||u[0]===g[0]&&u[1]===g[1])return void this.clear();const y=u[1]-p.buffer.active.viewportY,v=g[1]-p.buffer.active.viewportY,l=Math.max(y,0),h=Math.min(v,p.rows-1);l>=p.rows||h<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=m,this.viewportStartRow=y,this.viewportEndRow=v,this.viewportCappedStartRow=l,this.viewportCappedEndRow=h,this.startCol=u[0],this.endCol=g[0])}isCellSelected(p,u,g){return!!this.hasSelection&&(g-=p.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?u>=this.startCol&&g>=this.viewportCappedStartRow&&u=this.viewportCappedStartRow&&u>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g=this.startCol&&u=this.startCol)}}r.createSelectionRenderModel=function(){return new o}},509:function(d,r,o){var c=this&&this.__decorate||function(A,E,R,D){var I,O=arguments.length,U=O<3?E:D===null?D=Object.getOwnPropertyDescriptor(E,R):D;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")U=Reflect.decorate(A,E,R,D);else for(var W=A.length-1;W>=0;W--)(I=A[W])&&(U=(O<3?I(U):O>3?I(E,R,U):I(E,R))||U);return O>3&&U&&Object.defineProperty(E,R,U),U};Object.defineProperty(r,"__esModule",{value:!0}),r.TextureAtlas=void 0;const p=o(237),u=o(860),g=o(374),m=o(160),y=o(345),v=o(485),l=o(385),h=o(147),f=o(855),_=o(776),S={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}};let k;class P{get pages(){return this._pages}constructor(E,R,D){this._document=E,this._config=R,this._unicodeService=D,this._didWarmUp=!1,this._cacheMap=new v.FourKeyMap,this._cacheMapCombined=new v.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new h.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new y.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new y.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=T(E,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,g.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const E of this.pages)E.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const E=new l.IdleTaskQueue;for(let R=33;R<126;R++)E.enqueue(()=>{if(!this._cacheMap.get(R,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT)){const D=this._drawToCache(R,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT);this._cacheMap.set(R,f.DEFAULT_COLOR,f.DEFAULT_COLOR,f.DEFAULT_EXT,D)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const E of this._pages)E.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(P.maxAtlasPages&&this._pages.length>=Math.max(4,P.maxAtlasPages)){const R=this._pages.filter(N=>2*N.canvas.width<=(P.maxTextureSize||4096)).sort((N,V)=>V.canvas.width!==N.canvas.width?V.canvas.width-N.canvas.width:V.percentageUsed-N.percentageUsed);let D=-1,I=0;for(let N=0;NN.glyphs[0].texturePage).sort((N,V)=>N>V?1:-1),W=this.pages.length-O.length,z=this._mergePages(O,W);z.version++;for(let N=U.length-1;N>=0;N--)this._deletePage(U[N]);this.pages.push(z),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(z.canvas)}const E=new M(this._document,this._textureSize);return this._pages.push(E),this._activePages.push(E),this._onAddTextureAtlasCanvas.fire(E.canvas),E}_mergePages(E,R){const D=2*E[0].canvas.width,I=new M(this._document,D,E);for(const[O,U]of E.entries()){const W=O*U.canvas.width%D,z=Math.floor(O/2)*U.canvas.height;I.ctx.drawImage(U.canvas,W,z);for(const V of U.glyphs)V.texturePage=R,V.sizeClipSpace.x=V.size.x/D,V.sizeClipSpace.y=V.size.y/D,V.texturePosition.x+=W,V.texturePosition.y+=z,V.texturePositionClipSpace.x=V.texturePosition.x/D,V.texturePositionClipSpace.y=V.texturePosition.y/D;this._onRemoveTextureAtlasCanvas.fire(U.canvas);const N=this._activePages.indexOf(U);N!==-1&&this._activePages.splice(N,1)}return I}_deletePage(E){this._pages.splice(E,1);for(let R=E;R=this._config.colors.ansi.length)throw new Error("No color found for idx "+E);return this._config.colors.ansi[E]}_getBackgroundColor(E,R,D,I){if(this._config.allowTransparency)return m.NULL_COLOR;let O;switch(E){case 16777216:case 33554432:O=this._getColorFromAnsiIndex(R);break;case 50331648:const U=h.AttributeData.toColorRGB(R);O=m.rgba.toColor(U[0],U[1],U[2]);break;default:O=D?m.color.opaque(this._config.colors.foreground):this._config.colors.background}return O}_getForegroundColor(E,R,D,I,O,U,W,z,N,V){const q=this._getMinimumContrastColor(E,R,D,I,O,U,!1,N,z,V);if(q)return q;let G;switch(O){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&N&&U<8&&(U+=8),G=this._getColorFromAnsiIndex(U);break;case 50331648:const te=h.AttributeData.toColorRGB(U);G=m.rgba.toColor(te[0],te[1],te[2]);break;default:G=W?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(G=m.color.opaque(G)),z&&(G=m.color.multiplyOpacity(G,p.DIM_OPACITY)),G}_resolveBackgroundRgba(E,R,D){switch(E){case 16777216:case 33554432:return this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return D?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(E,R,D,I){switch(E){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&I&&R<8&&(R+=8),this._getColorFromAnsiIndex(R).rgba;case 50331648:return R<<8;default:return D?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(E,R,D,I,O,U,W,z,N,V){if(this._config.minimumContrastRatio===1||V)return;const q=this._getContrastCache(N),G=q.getColor(E,I);if(G!==void 0)return G||void 0;const te=this._resolveBackgroundRgba(R,D,W),oe=this._resolveForegroundRgba(O,U,W,z),ie=m.rgba.ensureContrastRatio(te,oe,this._config.minimumContrastRatio/(N?2:1));if(!ie)return void q.setColor(E,I,null);const ye=m.rgba.toColor(ie>>24&255,ie>>16&255,ie>>8&255);return q.setColor(E,I,ye),ye}_getContrastCache(E){return E?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(E,R,D,I,O=!1){const U=typeof E=="number"?String.fromCharCode(E):E,W=Math.min(this._config.deviceCellWidth*Math.max(U.length,2)+4,this._textureSize);this._tmpCanvas.width=12&&!this._config.allowTransparency&&U!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const kt=this._tmpCtx.measureText(U);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in kt&&kt.actualBoundingBoxDescent>0){this._tmpCtx.save();const Je=new Path2D;Je.rect(x,Re-Math.ceil(be/2),this._config.deviceCellWidth*we,Ve-Re+Math.ceil(be/2)),this._tmpCtx.clip(Je),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=ce.css,this._tmpCtx.strokeText(U,et,et+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(ie){const be=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),Me=be%2==1?.5:0;this._tmpCtx.lineWidth=be,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(et,et+Me),this._tmpCtx.lineTo(et+this._config.deviceCharWidth*we,et+Me),this._tmpCtx.stroke()}if(re||this._tmpCtx.fillText(U,et,et+this._config.deviceCharHeight),U==="_"&&!this._config.allowTransparency){let be=w(this._tmpCtx.getImageData(et,et,this._config.deviceCellWidth,this._config.deviceCellHeight),ce,ue,fe);if(be)for(let Me=1;Me<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=ce.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(U,et,et+this._config.deviceCharHeight-Me),be=w(this._tmpCtx.getImageData(et,et,this._config.deviceCellWidth,this._config.deviceCellHeight),ce,ue,fe),be);Me++);}if(oe){const be=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),Me=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=be,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(et,et+Math.floor(this._config.deviceCharHeight/2)-Me),this._tmpCtx.lineTo(et+this._config.deviceCharWidth*we,et+Math.floor(this._config.deviceCharHeight/2)-Me),this._tmpCtx.stroke()}this._tmpCtx.restore();const De=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Qe;if(Qe=this._config.allowTransparency?function(be){for(let Me=0;Me0)return!1;return!0}(De):w(De,ce,ue,fe),Qe)return S;const We=this._findGlyphBoundingBox(De,this._workBoundingBox,W,Ze,re,et);let ae,_e;for(;;){if(this._activePages.length===0){const be=this._createNewPage();ae=be,_e=be.currentRow,_e.height=We.size.y;break}ae=this._activePages[this._activePages.length-1],_e=ae.currentRow;for(const be of this._activePages)We.size.y<=be.currentRow.height&&(ae=be,_e=be.currentRow);for(let be=this._activePages.length-1;be>=0;be--)for(const Me of this._activePages[be].fixedRows)Me.height<=_e.height&&We.size.y<=Me.height&&(ae=this._activePages[be],_e=Me);if(_e.y+We.size.y>=ae.canvas.height||_e.height>We.size.y+2){let be=!1;if(ae.currentRow.y+ae.currentRow.height+We.size.y>=ae.canvas.height){let Me;for(const x of this._activePages)if(x.currentRow.y+x.currentRow.height+We.size.y=P.maxAtlasPages&&_e.y+We.size.y<=ae.canvas.height&&_e.height>=We.size.y&&_e.x+We.size.x<=ae.canvas.width)be=!0;else{const x=this._createNewPage();ae=x,_e=x.currentRow,_e.height=We.size.y,be=!0}}be||(ae.currentRow.height>0&&ae.fixedRows.push(ae.currentRow),_e={x:0,y:ae.currentRow.y+ae.currentRow.height,height:We.size.y},ae.fixedRows.push(_e),ae.currentRow={x:0,y:_e.y+_e.height,height:0})}if(_e.x+We.size.x<=ae.canvas.width)break;_e===ae.currentRow?(_e.x=0,_e.y+=_e.height,_e.height=0):ae.fixedRows.splice(ae.fixedRows.indexOf(_e),1)}return We.texturePage=this._pages.indexOf(ae),We.texturePosition.x=_e.x,We.texturePosition.y=_e.y,We.texturePositionClipSpace.x=_e.x/ae.canvas.width,We.texturePositionClipSpace.y=_e.y/ae.canvas.height,We.sizeClipSpace.x/=ae.canvas.width,We.sizeClipSpace.y/=ae.canvas.height,_e.height=Math.max(_e.height,We.size.y),_e.x+=We.size.x,ae.ctx.putImageData(De,We.texturePosition.x-this._workBoundingBox.left,We.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,We.size.x,We.size.y),ae.addGlyph(We),ae.version++,We}_findGlyphBoundingBox(E,R,D,I,O,U){R.top=0;const W=I?this._config.deviceCellHeight:this._tmpCanvas.height,z=I?this._config.deviceCellWidth:D;let N=!1;for(let V=0;V=U;V--){for(let q=0;q=0;V--){for(let q=0;q>>24,O=E.rgba>>>16&255,U=E.rgba>>>8&255,W=R.rgba>>>24,z=R.rgba>>>16&255,N=R.rgba>>>8&255,V=Math.floor((Math.abs(I-W)+Math.abs(O-z)+Math.abs(U-N))/12);let q=!0;for(let G=0;G{Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=r.NULL_COLOR=void 0;const c=o(399);let p=0,u=0,g=0,m=0;var y,v,l,h,f;function _(k){const P=k.toString(16);return P.length<2?"0"+P:P}function S(k,P){return k>>0}}(y||(r.channels=y={})),function(k){function P(M,w){return m=Math.round(255*w),[p,u,g]=f.toChannels(M.rgba),{css:y.toCss(p,u,g,m),rgba:y.toRgba(p,u,g,m)}}k.blend=function(M,w){if(m=(255&w.rgba)/255,m===1)return{css:w.css,rgba:w.rgba};const T=w.rgba>>24&255,A=w.rgba>>16&255,E=w.rgba>>8&255,R=M.rgba>>24&255,D=M.rgba>>16&255,I=M.rgba>>8&255;return p=R+Math.round((T-R)*m),u=D+Math.round((A-D)*m),g=I+Math.round((E-I)*m),{css:y.toCss(p,u,g),rgba:y.toRgba(p,u,g)}},k.isOpaque=function(M){return(255&M.rgba)==255},k.ensureContrastRatio=function(M,w,T){const A=f.ensureContrastRatio(M.rgba,w.rgba,T);if(A)return f.toColor(A>>24&255,A>>16&255,A>>8&255)},k.opaque=function(M){const w=(255|M.rgba)>>>0;return[p,u,g]=f.toChannels(w),{css:y.toCss(p,u,g),rgba:w}},k.opacity=P,k.multiplyOpacity=function(M,w){return m=255&M.rgba,P(M,m*w/255)},k.toColorRGB=function(M){return[M.rgba>>24&255,M.rgba>>16&255,M.rgba>>8&255]}}(v||(r.color=v={})),function(k){let P,M;if(!c.isNode){const w=document.createElement("canvas");w.width=1,w.height=1;const T=w.getContext("2d",{willReadFrequently:!0});T&&(P=T,P.globalCompositeOperation="copy",M=P.createLinearGradient(0,0,1,1))}k.toColor=function(w){if(w.match(/#[\da-f]{3,8}/i))switch(w.length){case 4:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),f.toColor(p,u,g);case 5:return p=parseInt(w.slice(1,2).repeat(2),16),u=parseInt(w.slice(2,3).repeat(2),16),g=parseInt(w.slice(3,4).repeat(2),16),m=parseInt(w.slice(4,5).repeat(2),16),f.toColor(p,u,g,m);case 7:return{css:w,rgba:(parseInt(w.slice(1),16)<<8|255)>>>0};case 9:return{css:w,rgba:parseInt(w.slice(1),16)>>>0}}const T=w.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(T)return p=parseInt(T[1]),u=parseInt(T[2]),g=parseInt(T[3]),m=Math.round(255*(T[5]===void 0?1:parseFloat(T[5]))),f.toColor(p,u,g,m);if(!P||!M)throw new Error("css.toColor: Unsupported css format");if(P.fillStyle=M,P.fillStyle=w,typeof P.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(P.fillRect(0,0,1,1),[p,u,g,m]=P.getImageData(0,0,1,1).data,m!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:y.toRgba(p,u,g,m),css:w}}}(l||(r.css=l={})),function(k){function P(M,w,T){const A=M/255,E=w/255,R=T/255;return .2126*(A<=.03928?A/12.92:Math.pow((A+.055)/1.055,2.4))+.7152*(E<=.03928?E/12.92:Math.pow((E+.055)/1.055,2.4))+.0722*(R<=.03928?R/12.92:Math.pow((R+.055)/1.055,2.4))}k.relativeLuminance=function(M){return P(M>>16&255,M>>8&255,255&M)},k.relativeLuminance2=P}(h||(r.rgb=h={})),function(k){function P(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W0||O>0||U>0);)I-=Math.max(0,Math.ceil(.1*I)),O-=Math.max(0,Math.ceil(.1*O)),U-=Math.max(0,Math.ceil(.1*U)),W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));return(I<<24|O<<16|U<<8|255)>>>0}function M(w,T,A){const E=w>>24&255,R=w>>16&255,D=w>>8&255;let I=T>>24&255,O=T>>16&255,U=T>>8&255,W=S(h.relativeLuminance2(I,O,U),h.relativeLuminance2(E,R,D));for(;W>>0}k.ensureContrastRatio=function(w,T,A){const E=h.relativeLuminance(w>>8),R=h.relativeLuminance(T>>8);if(S(E,R)>8));if(US(E,h.relativeLuminance(W>>8))?O:W}return O}const D=M(w,T,A),I=S(E,h.relativeLuminance(D>>8));if(IS(E,h.relativeLuminance(O>>8))?D:O}return D}},k.reduceLuminance=P,k.increaseLuminance=M,k.toChannels=function(w){return[w>>24&255,w>>16&255,w>>8&255,255&w]},k.toColor=function(w,T,A,E){return{css:y.toCss(w,T,A,E),rgba:y.toRgba(w,T,A,E)}}}(f||(r.rgba=f={})),r.toPaddedHex=_,r.contrastRatio=S},345:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(p))}},859:(d,r)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)===null||p===void 0||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}},485:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class o{constructor(){this._data={}}set(p,u,g){this._data[p]||(this._data[p]={}),this._data[p][u]=g}get(p,u){return this._data[p]?this._data[p][u]:void 0}clear(){this._data={}}}r.TwoKeyMap=o,r.FourKeyMap=class{constructor(){this._data=new o}set(c,p,u,g,m){this._data.get(c,p)||this._data.set(c,p,new o),this._data.get(c,p).set(u,g,m)}get(c,p,u,g){var m;return(m=this._data.get(c,p))===null||m===void 0?void 0:m.get(u,g)}clear(){this._data.clear()}}},399:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isChromeOS=r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.getSafariVersion=r.isSafari=r.isLegacyEdge=r.isFirefox=r.isNode=void 0,r.isNode=typeof navigator>"u";const o=r.isNode?"node":navigator.userAgent,c=r.isNode?"node":navigator.platform;r.isFirefox=o.includes("Firefox"),r.isLegacyEdge=o.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(o),r.getSafariVersion=function(){if(!r.isSafari)return 0;const p=o.match(/Version\/(\d+)/);return p===null||p.length<2?0:parseInt(p[1])},r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(c),r.isIpad=c==="iPad",r.isIphone=c==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(c),r.isLinux=c.indexOf("Linux")>=0,r.isChromeOS=/\bCrOS\b/.test(o)},385:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DebouncedIdleTask=r.IdleTaskQueue=r.PriorityTaskQueue=void 0;const c=o(399);class p{constructor(){this._tasks=[],this._i=0}enqueue(m){this._tasks.push(m),this._start()}flush(){for(;this._ih)return l-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(l-y))}ms`),void this._start();l=h}this.clear()}}class u extends p{_requestCallback(m){return setTimeout(()=>m(this._createDeadline(16)))}_cancelCallback(m){clearTimeout(m)}_createDeadline(m){const y=Date.now()+m;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}r.PriorityTaskQueue=u,r.IdleTaskQueue=!c.isNode&&"requestIdleCallback"in window?class extends p{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:u,r.DebouncedIdleTask=class{constructor(){this._queue=new r.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class o{constructor(){this.fg=0,this.bg=0,this.extended=new c}static toColorRGB(u){return[u>>>16&255,u>>>8&255,255&u]}static fromColorRGB(u){return(255&u[0])<<16|(255&u[1])<<8|255&u[2]}clone(){const u=new o;return u.fg=this.fg,u.bg=this.bg,u.extended=this.extended.clone(),u}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}}r.AttributeData=o;class c{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(u){this._ext=u}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(u){this._ext&=-469762049,this._ext|=u<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(u){this._ext&=-67108864,this._ext|=67108863&u}get urlId(){return this._urlId}set urlId(u){this._urlId=u}constructor(u=0,g=0){this._ext=0,this._urlId=0,this._ext=u,this._urlId=g}clone(){return new c(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=c},782:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;const c=o(133),p=o(855),u=o(147);class g extends u.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new u.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const v=new g;return v.setFromCharData(y),v}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,c.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[p.CHAR_DATA_ATTR_INDEX],this.bg=0;let v=!1;if(y[p.CHAR_DATA_CHAR_INDEX].length>2)v=!0;else if(y[p.CHAR_DATA_CHAR_INDEX].length===2){const l=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=l&&l<=56319){const h=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(l-55296)+h-56320+65536|y[p.CHAR_DATA_WIDTH_INDEX]<<22:v=!0}else v=!0}else this.content=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22;v&&(this.combinedData=y[p.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[p.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=g},855:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=0,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},133:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(o){return o>65535?(o-=65536,String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):String.fromCharCode(o)},r.utf32ToString=function(o,c=0,p=o.length){let u="";for(let g=c;g65535?(m-=65536,u+=String.fromCharCode(55296+(m>>10))+String.fromCharCode(m%1024+56320)):u+=String.fromCharCode(m)}return u},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(o,c){const p=o.length;if(!p)return 0;let u=0,g=0;if(this._interim){const m=o.charCodeAt(g++);56320<=m&&m<=57343?c[u++]=1024*(this._interim-55296)+m-56320+65536:(c[u++]=this._interim,c[u++]=m),this._interim=0}for(let m=g;m=p)return this._interim=y,u;const v=o.charCodeAt(m);56320<=v&&v<=57343?c[u++]=1024*(y-55296)+v-56320+65536:(c[u++]=y,c[u++]=v)}else y!==65279&&(c[u++]=y)}return u}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(o,c){const p=o.length;if(!p)return 0;let u,g,m,y,v=0,l=0,h=0;if(this.interim[0]){let S=!1,k=this.interim[0];k&=(224&k)==192?31:(240&k)==224?15:7;let P,M=0;for(;(P=63&this.interim[++M])&&M<4;)k<<=6,k|=P;const w=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,T=w-M;for(;h=p)return 0;if(P=o[h++],(192&P)!=128){h--,S=!0;break}this.interim[M++]=P,k<<=6,k|=63&P}S||(w===2?k<128?h--:c[v++]=k:w===3?k<2048||k>=55296&&k<=57343||k===65279||(c[v++]=k):k<65536||k>1114111||(c[v++]=k)),this.interim.fill(0)}const f=p-4;let _=h;for(;_=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(l=(31&u)<<6|63&g,l<128){_--;continue}c[v++]=l}else if((240&u)==224){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(l=(15&u)<<12|(63&g)<<6|63&m,l<2048||l>=55296&&l<=57343||l===65279)continue;c[v++]=l}else if((248&u)==240){if(_>=p)return this.interim[0]=u,v;if(g=o[_++],(192&g)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,v;if(m=o[_++],(192&m)!=128){_--;continue}if(_>=p)return this.interim[0]=u,this.interim[1]=g,this.interim[2]=m,v;if(y=o[_++],(192&y)!=128){_--;continue}if(l=(7&u)<<18|(63&g)<<12|(63&m)<<6|63&y,l<65536||l>1114111)continue;c[v++]=l}}return v}}},776:function(d,r,o){var c=this&&this.__decorate||function(l,h,f,_){var S,k=arguments.length,P=k<3?h:_===null?_=Object.getOwnPropertyDescriptor(h,f):_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")P=Reflect.decorate(l,h,f,_);else for(var M=l.length-1;M>=0;M--)(S=l[M])&&(P=(k<3?S(P):k>3?S(h,f,P):S(h,f))||P);return k>3&&P&&Object.defineProperty(h,f,P),P},p=this&&this.__param||function(l,h){return function(f,_){h(f,_,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.traceCall=r.setTraceLogger=r.LogService=void 0;const u=o(859),g=o(97),m={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,v=r.LogService=class extends u.Disposable{get logLevel(){return this._logLevel}constructor(l){super(),this._optionsService=l,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel())),y=this}_updateLogLevel(){this._logLevel=m[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let h=0;hJSON.stringify(P)).join(", ")})`);const k=_.apply(this,S);return y.trace(`GlyphRenderer#${_.name} return`,k),k}}},726:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0;const o="di$target",c="di$dependencies";r.serviceRegistry=new Map,r.getServiceDependencies=function(p){return p[c]||[]},r.createDecorator=function(p){if(r.serviceRegistry.has(p))return r.serviceRegistry.get(p);const u=function(g,m,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(v,l,h){l[o]===l?l[c].push({id:v,index:h}):(l[c]=[{id:v,index:h}],l[o]=l)})(u,g,y)};return u.toString=()=>p,r.serviceRegistry.set(p,u),u}},97:(d,r,o)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;const c=o(726);var p;r.IBufferService=(0,c.createDecorator)("BufferService"),r.ICoreMouseService=(0,c.createDecorator)("CoreMouseService"),r.ICoreService=(0,c.createDecorator)("CoreService"),r.ICharsetService=(0,c.createDecorator)("CharsetService"),r.IInstantiationService=(0,c.createDecorator)("InstantiationService"),function(u){u[u.TRACE=0]="TRACE",u[u.DEBUG=1]="DEBUG",u[u.INFO=2]="INFO",u[u.WARN=3]="WARN",u[u.ERROR=4]="ERROR",u[u.OFF=5]="OFF"}(p||(r.LogLevelEnum=p={})),r.ILogService=(0,c.createDecorator)("LogService"),r.IOptionsService=(0,c.createDecorator)("OptionsService"),r.IOscLinkService=(0,c.createDecorator)("OscLinkService"),r.IUnicodeService=(0,c.createDecorator)("UnicodeService"),r.IDecorationService=(0,c.createDecorator)("DecorationService")}},s={};function i(d){var r=s[d];if(r!==void 0)return r.exports;var o=s[d]={exports:{}};return n[d].call(o.exports,o,o.exports,i),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.WebglAddon=void 0;const r=i(345),o=i(859),c=i(399),p=i(666),u=i(776);class g extends o.Disposable{constructor(y){if(c.isSafari&&(0,c.getSafariVersion)()<16)throw new Error("Webgl2 is only supported on Safari 16 and above");super(),this._preserveDrawingBuffer=y,this._onChangeTextureAtlas=this.register(new r.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new r.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new r.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new r.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(y){const v=y._core;if(!y.element)return void this.register(v.onWillOpen(()=>this.activate(y)));this._terminal=y;const l=v.coreService,h=v.optionsService,f=v,_=f._renderService,S=f._characterJoinerService,k=f._charSizeService,P=f._coreBrowserService,M=f._decorationService,w=f._logService,T=f._themeService;(0,u.setTraceLogger)(w),this._renderer=this.register(new p.WebglRenderer(y,S,k,P,l,M,h,T,this._preserveDrawingBuffer)),this.register((0,r.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,r.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,r.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,r.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),_.setRenderer(this._renderer),this.register((0,o.toDisposable)(()=>{const A=this._terminal._core._renderService;A.setRenderer(this._terminal._core._createRenderer()),A.handleResize(y.cols,y.rows)}))}get textureAtlas(){var y;return(y=this._renderer)===null||y===void 0?void 0:y.textureAtlas}clearTextureAtlas(){var y;(y=this._renderer)===null||y===void 0||y.clearTextureAtlas()}}d.WebglAddon=g})(),a})())})(Wm);var U2=Wm.exports,jm={exports:{}};(function(e,t){(function(n,s){e.exports=s()})(self,()=>(()=>{var n={345:(d,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=o=>(this._listeners.push(o),{dispose:()=>{if(!this._disposed){for(let c=0;cc.fire(p))}},859:(d,r)=>{function o(c){for(const p of c)p.dispose();c.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.MutableDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const c of this._disposables)c.dispose();this._disposables.length=0}register(c){return this._disposables.push(c),c}unregister(c){const p=this._disposables.indexOf(c);p!==-1&&this._disposables.splice(p,1)}},r.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(c){var p;this._isDisposed||c===this._value||((p=this._value)===null||p===void 0||p.dispose(),this._value=c)}clear(){this.value=void 0}dispose(){var c;this._isDisposed=!0,(c=this._value)===null||c===void 0||c.dispose(),this._value=void 0}},r.toDisposable=function(c){return{dispose:c}},r.disposeArray=o,r.getDisposeArrayDisposable=function(c){return{dispose:()=>o(c)}}}},s={};function i(d){var r=s[d];if(r!==void 0)return r.exports;var o=s[d]={exports:{}};return n[d](o,o.exports,i),o.exports}var a={};return(()=>{var d=a;Object.defineProperty(d,"__esModule",{value:!0}),d.SearchAddon=void 0;const r=i(345),o=i(859),c=" ~!@#$%^&*()+`-=[]{}|\\;:\"',./<>?";class p extends o.Disposable{constructor(g){var m;super(),this._highlightedLines=new Set,this._highlightDecorations=[],this._selectedDecoration=this.register(new o.MutableDisposable),this._linesCacheTimeoutId=0,this._onDidChangeResults=this.register(new r.EventEmitter),this.onDidChangeResults=this._onDidChangeResults.event,this._highlightLimit=(m=g==null?void 0:g.highlightLimit)!==null&&m!==void 0?m:1e3}activate(g){this._terminal=g,this.register(this._terminal.onWriteParsed(()=>this._updateMatches())),this.register(this._terminal.onResize(()=>this._updateMatches())),this.register((0,o.toDisposable)(()=>this.clearDecorations()))}_updateMatches(){var g;this._highlightTimeout&&window.clearTimeout(this._highlightTimeout),this._cachedSearchTerm&&(!((g=this._lastSearchOptions)===null||g===void 0)&&g.decorations)&&(this._highlightTimeout=setTimeout(()=>{const m=this._cachedSearchTerm;this._cachedSearchTerm=void 0,this.findPrevious(m,Object.assign(Object.assign({},this._lastSearchOptions),{incremental:!0,noScroll:!0}))},200))}clearDecorations(g){this._selectedDecoration.clear(),(0,o.disposeArray)(this._highlightDecorations),this._highlightDecorations=[],this._highlightedLines.clear(),g||(this._cachedSearchTerm=void 0)}findNext(g,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");this._lastSearchOptions=m,m!=null&&m.decorations&&(this._cachedSearchTerm!==void 0&&g===this._cachedSearchTerm||this._highlightAllMatches(g,m));const y=this._findNextAndSelect(g,m);return this._fireResults(m),this._cachedSearchTerm=g,y}_highlightAllMatches(g,m){if(!this._terminal)throw new Error("Cannot use addon until it has been loaded");if(!g||g.length===0)return void this.clearDecorations();m=m||{},this.clearDecorations(!0);const y=[];let v,l=this._find(g,0,0,m);for(;l&&((v==null?void 0:v.row)!==l.row||(v==null?void 0:v.col)!==l.col)&&!(y.length>=this._highlightLimit);)v=l,y.push(v),l=this._find(g,v.col+v.term.length>=this._terminal.cols?v.row+1:v.row,v.col+v.term.length>=this._terminal.cols?0:v.col+1,m);for(const h of y){const f=this._createResultDecoration(h,m.decorations);f&&(this._highlightedLines.add(f.marker.line),this._highlightDecorations.push({decoration:f,match:h,dispose(){f.dispose()}}))}}_find(g,m,y,v){var l;if(!this._terminal||!g||g.length===0)return(l=this._terminal)===null||l===void 0||l.clearSelection(),void this.clearDecorations();if(y>this._terminal.cols)throw new Error(`Invalid col: ${y} to search in terminal of ${this._terminal.cols} cols`);let h;this._initLinesCache();const f={startRow:m,startCol:y};if(h=this._findInLine(g,f,v),!h)for(let _=m+1;_=0&&(_.startRow=k,S=this._findInLine(g,_,m,f),!S);k--);}if(!S&&l!==this._terminal.buffer.active.baseY+this._terminal.rows-1)for(let k=this._terminal.buffer.active.baseY+this._terminal.rows-1;k>=l&&(_.startRow=k,S=this._findInLine(g,_,m,f),!S);k--);return this._selectResult(S,m==null?void 0:m.decorations,m==null?void 0:m.noScroll)}_initLinesCache(){const g=this._terminal;this._linesCache||(this._linesCache=new Array(g.buffer.active.length),this._cursorMoveListener=g.onCursorMove(()=>this._destroyLinesCache()),this._resizeListener=g.onResize(()=>this._destroyLinesCache())),window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=window.setTimeout(()=>this._destroyLinesCache(),15e3)}_destroyLinesCache(){this._linesCache=void 0,this._cursorMoveListener&&(this._cursorMoveListener.dispose(),this._cursorMoveListener=void 0),this._resizeListener&&(this._resizeListener.dispose(),this._resizeListener=void 0),this._linesCacheTimeoutId&&(window.clearTimeout(this._linesCacheTimeoutId),this._linesCacheTimeoutId=0)}_isWholeWord(g,m,y){return(g===0||c.includes(m[g-1]))&&(g+y.length===m.length||c.includes(m[g+y.length]))}_findInLine(g,m,y={},v=!1){var l;const h=this._terminal,f=m.startRow,_=m.startCol,S=h.buffer.active.getLine(f);if(S!=null&&S.isWrapped)return v?void(m.startCol+=h.cols):(m.startRow--,m.startCol+=h.cols,this._findInLine(g,m,y));let k=(l=this._linesCache)===null||l===void 0?void 0:l[f];k||(k=this._translateBufferLineToStringWithWrap(f,!0),this._linesCache&&(this._linesCache[f]=k));const[P,M]=k,w=this._bufferColsToStringOffset(f,_),T=y.caseSensitive?g:g.toLowerCase(),A=y.caseSensitive?P:P.toLowerCase();let E=-1;if(y.regex){const R=RegExp(T,"g");let D;if(v)for(;D=R.exec(A.slice(0,w));)E=R.lastIndex-D[0].length,g=D[0],R.lastIndex-=g.length-1;else D=R.exec(A.slice(w)),D&&D[0].length>0&&(E=w+(R.lastIndex-D[0].length),g=D[0])}else v?w-T.length>=0&&(E=A.lastIndexOf(T,w-T.length)):E=A.indexOf(T,w);if(E>=0){if(y.wholeWord&&!this._isWholeWord(E,A,g))return;let R=0;for(;R=M[R+1];)R++;let D=R;for(;D=M[D+1];)D++;const I=E-M[R],O=E+g.length-M[D],U=this._stringLengthToBufferSize(f+R,I);return{term:g,col:U,row:f+R,size:this._stringLengthToBufferSize(f+D,O)-U+h.cols*(D-R)}}}_stringLengthToBufferSize(g,m){const y=this._terminal.buffer.active.getLine(g);if(!y)return 0;for(let v=0;v1&&(m-=h.length-1);const f=y.getCell(v+1);f&&f.getWidth()===0&&m++}return m}_bufferColsToStringOffset(g,m){const y=this._terminal;let v=g,l=0,h=y.buffer.active.getLine(v);for(;m>0&&h;){for(let f=0;fthis._applyStyles(_,m.activeMatchBorder,!0))),f.push(h.onDispose(()=>(0,o.disposeArray)(f))),this._selectedDecoration.value={decoration:h,match:g,dispose(){h.dispose()}}}}}if(!y&&(g.row>=v.buffer.active.viewportY+v.rows||g.rowthis._applyStyles(f,m.matchBorder,!1))),h.push(l.onDispose(()=>(0,o.disposeArray)(h)))}return l}}d.SearchAddon=p})(),a})())})(jm);var V2=jm.exports;/*! Capacitor: https://capacitorjs.com/ - MIT License */var _o;(function(e){e.Unimplemented="UNIMPLEMENTED",e.Unavailable="UNAVAILABLE"})(_o||(_o={}));class Pi extends Error{constructor(t,n,s){super(t),this.message=t,this.code=n,this.data=s}}const K2=e=>{var t,n;return e!=null&&e.androidBridge?"android":!((n=(t=e==null?void 0:e.webkit)===null||t===void 0?void 0:t.messageHandlers)===null||n===void 0)&&n.bridge?"ios":"web"},W2=e=>{const t=e.CapacitorCustomPlatform||null,n=e.Capacitor||{},s=n.Plugins=n.Plugins||{},i=()=>t!==null?t.name:K2(e),a=()=>i()!=="web",d=u=>{const g=c.get(u);return!!(g!=null&&g.platforms.has(i())||r(u))},r=u=>{var g;return(g=n.PluginHeaders)===null||g===void 0?void 0:g.find(m=>m.name===u)},o=u=>e.console.error(u),c=new Map,p=(u,g={})=>{const m=c.get(u);if(m)return console.warn(`Capacitor plugin "${u}" already registered. Cannot register plugins twice.`),m.proxy;const y=i(),v=r(u);let l;const h=async()=>(!l&&y in g?l=typeof g[y]=="function"?l=await g[y]():l=g[y]:t!==null&&!l&&"web"in g&&(l=typeof g.web=="function"?l=await g.web():l=g.web),l),f=(w,T)=>{var A,E;if(v){const R=v==null?void 0:v.methods.find(D=>T===D.name);if(R)return R.rtype==="promise"?D=>n.nativePromise(u,T.toString(),D):(D,I)=>n.nativeCallback(u,T.toString(),D,I);if(w)return(A=w[T])===null||A===void 0?void 0:A.bind(w)}else{if(w)return(E=w[T])===null||E===void 0?void 0:E.bind(w);throw new Pi(`"${u}" plugin is not implemented on ${y}`,_o.Unimplemented)}},_=w=>{let T;const A=(...E)=>{const R=h().then(D=>{const I=f(D,w);if(I){const O=I(...E);return T=O==null?void 0:O.remove,O}else throw new Pi(`"${u}.${w}()" is not implemented on ${y}`,_o.Unimplemented)});return w==="addListener"&&(R.remove=async()=>T()),R};return A.toString=()=>`${w.toString()}() { [capacitor code] }`,Object.defineProperty(A,"name",{value:w,writable:!1,configurable:!1}),A},S=_("addListener"),k=_("removeListener"),P=(w,T)=>{const A=S({eventName:w},T),E=async()=>{const D=await A;k({eventName:w,callbackId:D},T)},R=new Promise(D=>A.then(()=>D({remove:E})));return R.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await E()},R},M=new Proxy({},{get(w,T){switch(T){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return v?P:S;case"removeListener":return k;default:return _(T)}}});return s[u]=M,c.set(u,{name:u,proxy:M,platforms:new Set([...Object.keys(g),...v?[y]:[]])}),M};return n.convertFileSrc||(n.convertFileSrc=u=>u),n.getPlatform=i,n.handleError=o,n.isNativePlatform=a,n.isPluginAvailable=d,n.registerPlugin=p,n.Exception=Pi,n.DEBUG=!!n.DEBUG,n.isLoggingEnabled=!!n.isLoggingEnabled,n},j2=e=>e.Capacitor=W2(e),qd=j2(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),ka=qd.registerPlugin;class hc{constructor(){this.listeners={},this.retainedEventArguments={},this.windowListeners={}}addListener(t,n){let s=!1;this.listeners[t]||(this.listeners[t]=[],s=!0),this.listeners[t].push(n);const a=this.windowListeners[t];a&&!a.registered&&this.addWindowListener(a),s&&this.sendRetainedArgumentsForEvent(t);const d=async()=>this.removeListener(t,n);return Promise.resolve({remove:d})}async removeAllListeners(){this.listeners={};for(const t in this.windowListeners)this.removeWindowListener(this.windowListeners[t]);this.windowListeners={}}notifyListeners(t,n,s){const i=this.listeners[t];if(!i){if(s){let a=this.retainedEventArguments[t];a||(a=[]),a.push(n),this.retainedEventArguments[t]=a}return}i.forEach(a=>a(n))}hasListeners(t){var n;return!!(!((n=this.listeners[t])===null||n===void 0)&&n.length)}registerWindowListener(t,n){this.windowListeners[n]={registered:!1,windowEventName:t,pluginEventName:n,handler:s=>{this.notifyListeners(n,s)}}}unimplemented(t="not implemented"){return new qd.Exception(t,_o.Unimplemented)}unavailable(t="not available"){return new qd.Exception(t,_o.Unavailable)}async removeListener(t,n){const s=this.listeners[t];if(!s)return;const i=s.indexOf(n);this.listeners[t].splice(i,1),this.listeners[t].length||this.removeWindowListener(this.windowListeners[t])}addWindowListener(t){window.addEventListener(t.windowEventName,t.handler),t.registered=!0}removeWindowListener(t){t&&(window.removeEventListener(t.windowEventName,t.handler),t.registered=!1)}sendRetainedArgumentsForEvent(t){const n=this.retainedEventArguments[t];n&&(delete this.retainedEventArguments[t],n.forEach(s=>{this.notifyListeners(t,s)}))}}const Wf=e=>encodeURIComponent(e).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),jf=e=>e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class q2 extends hc{async getCookies(){const t=document.cookie,n={};return t.split(";").forEach(s=>{if(s.length<=0)return;let[i,a]=s.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");i=jf(i).trim(),a=jf(a).trim(),n[i]=a}),n}async setCookie(t){try{const n=Wf(t.key),s=Wf(t.value),i=t.expires?`; expires=${t.expires.replace("expires=","")}`:"",a=(t.path||"/").replace("path=",""),d=t.url!=null&&t.url.length>0?`domain=${t.url}`:"";document.cookie=`${n}=${s||""}${i}; path=${a}; ${d};`}catch(n){return Promise.reject(n)}}async deleteCookie(t){try{document.cookie=`${t.key}=; Max-Age=0`}catch(n){return Promise.reject(n)}}async clearCookies(){try{const t=document.cookie.split(";")||[];for(const n of t)document.cookie=n.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(t){return Promise.reject(t)}}async clearAllCookies(){try{await this.clearCookies()}catch(t){return Promise.reject(t)}}}ka("CapacitorCookies",{web:()=>new q2});const Y2=async e=>new Promise((t,n)=>{const s=new FileReader;s.onload=()=>{const i=s.result;t(i.indexOf(",")>=0?i.split(",")[1]:i)},s.onerror=i=>n(i),s.readAsDataURL(e)}),G2=(e={})=>{const t=Object.keys(e);return Object.keys(e).map(i=>i.toLocaleLowerCase()).reduce((i,a,d)=>(i[a]=e[t[d]],i),{})},X2=(e,t=!0)=>e?Object.entries(e).reduce((s,i)=>{const[a,d]=i;let r,o;return Array.isArray(d)?(o="",d.forEach(c=>{r=t?encodeURIComponent(c):c,o+=`${a}=${r}&`}),o.slice(0,-1)):(r=t?encodeURIComponent(d):d,o=`${a}=${r}`),`${s}&${o}`},"").substr(1):null,J2=(e,t={})=>{const n=Object.assign({method:e.method||"GET",headers:e.headers},t),i=G2(e.headers)["content-type"]||"";if(typeof e.data=="string")n.body=e.data;else if(i.includes("application/x-www-form-urlencoded")){const a=new URLSearchParams;for(const[d,r]of Object.entries(e.data||{}))a.set(d,r);n.body=a.toString()}else if(i.includes("multipart/form-data")||e.data instanceof FormData){const a=new FormData;if(e.data instanceof FormData)e.data.forEach((r,o)=>{a.append(o,r)});else for(const r of Object.keys(e.data))a.append(r,e.data[r]);n.body=a;const d=new Headers(n.headers);d.delete("content-type"),n.headers=d}else(i.includes("application/json")||typeof e.data=="object")&&(n.body=JSON.stringify(e.data));return n};class Q2 extends hc{async request(t){const n=J2(t,t.webFetchExtra),s=X2(t.params,t.shouldEncodeUrlParams),i=s?`${t.url}?${s}`:t.url,a=await fetch(i,n),d=a.headers.get("content-type")||"";let{responseType:r="text"}=a.ok?t:{};d.includes("application/json")&&(r="json");let o,c;switch(r){case"arraybuffer":case"blob":c=await a.blob(),o=await Y2(c);break;case"json":o=await a.json();break;case"document":case"text":default:o=await a.text()}const p={};return a.headers.forEach((u,g)=>{p[g]=u}),{data:o,headers:p,status:a.status,url:a.url}}async get(t){return this.request(Object.assign(Object.assign({},t),{method:"GET"}))}async post(t){return this.request(Object.assign(Object.assign({},t),{method:"POST"}))}async put(t){return this.request(Object.assign(Object.assign({},t),{method:"PUT"}))}async patch(t){return this.request(Object.assign(Object.assign({},t),{method:"PATCH"}))}async delete(t){return this.request(Object.assign(Object.assign({},t),{method:"DELETE"}))}}ka("CapacitorHttp",{web:()=>new Q2});var qf;(function(e){e.Dark="DARK",e.Light="LIGHT",e.Default="DEFAULT"})(qf||(qf={}));var Yf;(function(e){e.StatusBar="StatusBar",e.NavigationBar="NavigationBar"})(Yf||(Yf={}));class Z2 extends hc{async setStyle(){this.unavailable("not available for web")}async setAnimation(){this.unavailable("not available for web")}async show(){this.unavailable("not available for web")}async hide(){this.unavailable("not available for web")}}ka("SystemBars",{web:()=>new Z2});var Er;(function(e){e.Prompt="PROMPT",e.Camera="CAMERA",e.Photos="PHOTOS"})(Er||(Er={}));var so;(function(e){e.Rear="REAR",e.Front="FRONT"})(so||(so={}));var Yd;(function(e){e.Uri="uri",e.Base64="base64",e.DataUrl="dataUrl"})(Yd||(Yd={}));var Il;(function(e){e[e.Photo=0]="Photo",e[e.Video=1]="Video"})(Il||(Il={}));var oa;(function(e){e[e.Photo=0]="Photo",e[e.Video=1]="Video",e[e.All=2]="All"})(oa||(oa={}));var Gf;(function(e){e[e.JPEG=0]="JPEG",e[e.PNG=1]="PNG"})(Gf||(Gf={}));var Xf;(function(e){e.CameraPermissionDenied="OS-PLUG-CAMR-0003",e.GalleryPermissionDenied="OS-PLUG-CAMR-0005",e.NoCameraAvailable="OS-PLUG-CAMR-0007",e.TakePhotoCancelled="OS-PLUG-CAMR-0006",e.TakePhotoFailed="OS-PLUG-CAMR-0010",e.TakePhotoInvalidArguments="OS-PLUG-CAMR-0014",e.InvalidImageData="OS-PLUG-CAMR-0008",e.EditPhotoFailed="OS-PLUG-CAMR-0009",e.EditPhotoCancelled="OS-PLUG-CAMR-0013",e.EditPhotoEmptyUri="OS-PLUG-CAMR-0024",e.ImageNotFound="OS-PLUG-CAMR-0011",e.ProcessImageFailed="OS-PLUG-CAMR-0012",e.ChooseMediaFailed="OS-PLUG-CAMR-0018",e.ChooseMediaCancelled="OS-PLUG-CAMR-0020",e.MediaPathError="OS-PLUG-CAMR-0021",e.FetchImageFromUriFailed="OS-PLUG-CAMR-0028",e.RecordVideoFailed="OS-PLUG-CAMR-0016",e.RecordVideoCancelled="OS-PLUG-CAMR-0017",e.VideoNotFound="OS-PLUG-CAMR-0025",e.PlayVideoFailed="OS-PLUG-CAMR-0023",e.EncodeResultFailed="OS-PLUG-CAMR-0019",e.FileNotFound="OS-PLUG-CAMR-0027",e.InvalidArgument="OS-PLUG-CAMR-0031",e.GeneralError="OS-PLUG-CAMR-0026"})(Xf||(Xf={}));class eR extends hc{async takePhoto(t){return new Promise(async(n,s)=>{t.webUseInput?this.takePhotoCameraInputExperience(t,n,s):this.takePhotoCameraExperience(t,n,s)})}async recordVideo(t){throw this.unimplemented("recordVideo is not implemented on Web.")}async playVideo(t){throw this.unimplemented("playVideo is not implemented on Web.")}async chooseFromGallery(t){return new Promise(async(n,s)=>{this.galleryInputExperience(t,n,s)})}async editPhoto(t){throw this.unimplemented("editPhoto is not implemented on Web.")}async editURIPhoto(t){throw this.unimplemented("editURIPhoto is not implemented on Web.")}async getPhoto(t){return new Promise(async(n,s)=>{if(t.webUseInput||t.source===Er.Photos)this.fileInputExperience(t,n,s);else if(t.source===Er.Prompt){let i=document.querySelector("pwa-action-sheet");i||(i=document.createElement("pwa-action-sheet"),document.body.appendChild(i)),i.header=t.promptLabelHeader||"Photo",i.cancelable=!1,i.options=[{title:t.promptLabelPhoto||"From Photos"},{title:t.promptLabelPicture||"Take Picture"}],i.addEventListener("onSelection",async a=>{a.detail===0?this.fileInputExperience(t,n,s):this.cameraExperience(t,n,s)})}else this.cameraExperience(t,n,s)})}async pickImages(t){return new Promise(async(n,s)=>{this.multipleFileInputExperience(n,s)})}async cameraExperience(t,n,s){await this._setupPWACameraModal(t.direction,i=>this._getCameraPhoto(i,t),()=>this.fileInputExperience(t,n,s),n,s)}fileInputExperience(t,n,s){let i=document.querySelector("#_capacitor-camera-input");const a=()=>{var d;(d=i.parentNode)===null||d===void 0||d.removeChild(i)};i||(i=document.createElement("input"),i.id="_capacitor-camera-input",i.type="file",i.hidden=!0,document.body.appendChild(i),i.addEventListener("change",d=>{const r=i.files[0];let o="jpeg";if(r.type==="image/png"?o="png":r.type==="image/gif"&&(o="gif"),t.resultType==="dataUrl"||t.resultType==="base64"){const c=new FileReader;c.addEventListener("load",()=>{if(t.resultType==="dataUrl")n({dataUrl:c.result,format:o});else if(t.resultType==="base64"){const p=c.result.split(",")[1];n({base64String:p,format:o})}a()}),c.readAsDataURL(r)}else n({webPath:URL.createObjectURL(r),format:o}),a()}),i.addEventListener("cancel",d=>{s(new Pi("User cancelled photos app")),a()})),i.accept="image/*",i.capture=!0,t.source===Er.Photos||t.source===Er.Prompt?i.removeAttribute("capture"):t.direction===so.Front?i.capture="user":t.direction===so.Rear&&(i.capture="environment"),i.click()}multipleFileInputExperience(t,n){let s=document.querySelector("#_capacitor-camera-input-multiple");const i=()=>{var a;(a=s.parentNode)===null||a===void 0||a.removeChild(s)};s||(s=document.createElement("input"),s.id="_capacitor-camera-input-multiple",s.type="file",s.hidden=!0,s.multiple=!0,document.body.appendChild(s),s.addEventListener("change",a=>{const d=[];for(let r=0;r{n(new Pi("User cancelled photos app")),i()})),s.accept="image/*",s.click()}_getCameraPhoto(t,n){return new Promise((s,i)=>{const a=new FileReader,d=this._getFileFormat(t);n.resultType==="uri"?s({webPath:URL.createObjectURL(t),format:d,saved:!1}):(a.readAsDataURL(t),a.onloadend=()=>{const r=a.result;n.resultType==="dataUrl"?s({dataUrl:r,format:d,saved:!1}):s({base64String:r.split(",")[1],format:d,saved:!1})},a.onerror=r=>{i(r)})})}async takePhotoCameraExperience(t,n,s){await this._setupPWACameraModal(t.cameraDirection,i=>{var a;return this._buildPhotoMediaResult(i,(a=t.includeMetadata)!==null&&a!==void 0?a:!1)},()=>this.takePhotoCameraInputExperience(t,n,s),n,s)}takePhotoCameraInputExperience(t,n,s){const i=this._createFileInput("_capacitor-camera-input-takephoto"),a=()=>{var d;(d=i.parentNode)===null||d===void 0||d.removeChild(i)};i.onchange=async d=>{var r;if(!this._validateFileInput(i,s,a))return;const o=i.files[0];n(await this._buildPhotoMediaResult(o,(r=t.includeMetadata)!==null&&r!==void 0?r:!1)),a()},i.oncancel=()=>{s(new Pi("User cancelled photos app")),a()},i.accept="image/*",t.cameraDirection===so.Front?i.capture="user":i.capture="environment",i.click()}galleryInputExperience(t,n,s){var i,a;const d=this._createFileInput("_capacitor-camera-input-gallery");d.multiple=(i=t.allowMultipleSelection)!==null&&i!==void 0?i:!1;const r=()=>{var c;(c=d.parentNode)===null||c===void 0||c.removeChild(d)};d.onchange=async c=>{var p;if(!this._validateFileInput(d,s,r))return;const u=[];for(let g=0;g{s(new Pi("User cancelled photos app")),r()};const o=(a=t.mediaType)!==null&&a!==void 0?a:oa.Photo;o===oa.Photo?d.accept="image/*":o===oa.Video?d.accept="video/*":d.accept="image/*,video/*",d.click()}_getFileFormat(t){return t.type==="image/png"?"png":t.type==="image/gif"?"gif":t.type.startsWith("video/")?t.type.split("/")[1]:t.type.startsWith("image/")?"jpeg":t.type.split("/")[1]||"jpeg"}async _buildPhotoMediaResult(t,n){const s=this._getFileFormat(t),i=await this._getBase64FromFile(t),a={type:Il.Photo,thumbnail:i,webPath:URL.createObjectURL(t),saved:!1};if(n){const d=await this._getImageResolution(t);a.metadata={format:s,resolution:d,size:t.size,creationDate:"lastModified"in t?new Date(t.lastModified).toISOString():new Date().toISOString()}}return a}_validateFileInput(t,n,s){if(!t.files||t.files.length===0){const i=t.multiple?"No files selected":"No file selected";return n(new Pi(i)),s(),!1}return!0}async _setupPWACameraModal(t,n,s,i,a){if(customElements.get("pwa-camera-modal")){const d=document.createElement("pwa-camera-modal");d.facingMode=t===so.Front?"user":"environment",document.body.appendChild(d);try{await d.componentOnReady(),d.addEventListener("onPhoto",async r=>{const o=r.detail;o===null?a(new Pi("User cancelled photos app")):o instanceof Error?a(o):i(await n(o)),d.dismiss(),document.body.removeChild(d)}),d.present()}catch{s()}}else console.error("Unable to load PWA Element 'pwa-camera-modal'. See the docs: https://capacitorjs.com/docs/web/pwa-elements."),s()}_createFileInput(t){let n=document.querySelector(`#${t}`);return n||(n=document.createElement("input"),n.id=t,n.type="file",n.hidden=!0,document.body.appendChild(n)),n}async _getImageResolution(t){try{const n=await createImageBitmap(t),s=`${n.width}x${n.height}`;return n.close(),s}catch(n){console.warn("Failed to get image resolution:",n);return}}_getBase64FromFile(t){return new Promise((n,s)=>{const i=new FileReader;i.onloadend=()=>{const d=i.result.split(",")[1];n(d)},i.onerror=a=>{s(a)},i.readAsDataURL(t)})}_getVideoMetadata(t){return new Promise(n=>{const s=document.createElement("video");s.preload="metadata",s.muted=!0,s.onloadedmetadata=()=>{const i=Math.min(1,s.duration*.1);s.currentTime=i},s.onseeked=()=>{const i={resolution:`${s.videoWidth}x${s.videoHeight}`,duration:s.duration};try{const a=document.createElement("canvas");a.width=s.videoWidth,a.height=s.videoHeight;const d=a.getContext("2d");d&&(d.drawImage(s,0,0,a.width,a.height),i.thumbnail=a.toDataURL("image/jpeg",.8).split(",")[1])}catch(a){console.warn("Failed to generate video thumbnail:",a)}URL.revokeObjectURL(s.src),n(i)},s.onerror=()=>{URL.revokeObjectURL(s.src),n({})},s.src=URL.createObjectURL(t)})}async checkPermissions(){if(typeof navigator>"u"||!navigator.permissions)throw this.unavailable("Permissions API not available in this browser");try{return{camera:(await window.navigator.permissions.query({name:"camera"})).state,photos:"granted"}}catch{throw this.unavailable("Camera permissions are not available in this browser")}}async requestPermissions(){throw this.unimplemented("Not implemented on web.")}async pickLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}async getLimitedLibraryPhotos(){throw this.unavailable("Not implemented on web.")}}const tR=ka("Camera",{web:()=>new eR});function Wc(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function qm(e){return e.total_bytes<=0?0:Math.max(0,Math.min(100,Math.round(e.bytes/e.total_bytes*100)))}function nR(e){return e.total_bytes<=0?rn("terminal.loadingHistoryBytes",{bytes:Wc(e.bytes)}):rn("terminal.loadingHistoryProgress",{pct:qm(e),bytes:Wc(e.bytes),total:Wc(e.total_bytes)})}function sR(){let e="idle",t=0;return{onProgress(n,s){if(n==="start"){t+=1,e="replaying";return}if(n==="chunk"){e="replaying";return}const i=t;e="draining";const a=()=>{t===i&&(e="idle")};s?s(a):a()},shouldForward:(n=!1)=>n||e==="idle"}}function iR(){var e;return typeof navigator>"u"?"other":(e=navigator.platform)!=null&&e.toLowerCase().includes("mac")?"mac":"other"}function rR(e){return e.code==="KeyC"||e.key.toLowerCase()==="c"}function va(e){if(typeof document>"u")return!1;const t=document.createElement("textarea");t.value=e,t.setAttribute("readonly",""),t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t),t.select();let n=!1;try{n=document.execCommand("copy")}finally{document.body.removeChild(t)}return n}function oR(e,t=iR()){return!rR(e)||e.altKey?!1:t==="mac"?e.metaKey&&!e.ctrlKey&&!e.shiftKey:e.ctrlKey&&e.shiftKey&&!e.metaKey}async function jc(e,t=typeof navigator>"u"?void 0:navigator.clipboard){const n=e.getSelection();return n?t!=null&&t.writeText?(await t.writeText(n),!0):va(n):!1}const Jf='Menlo, Monaco, Consolas, "Liberation Mono", "DejaVu Sans Mono", "PingFang SC", "Microsoft YaHei", "Noto Sans Mono CJK SC", monospace',aR=[{id:"",label:"System default"},{id:"SF Mono",label:"SF Mono"},{id:"JetBrains Mono",label:"JetBrains Mono"},{id:"Fira Code",label:"Fira Code"},{id:"Cascadia Code",label:"Cascadia Code"},{id:"Source Code Pro",label:"Source Code Pro"},{id:"IBM Plex Mono",label:"IBM Plex Mono"}];function Qf(e){const t=e.trim();return t?`${t.startsWith('"')?t:`"${t}"`}, ${Jf}`:Jf}const lR=3e3;function cR(e,t,n,s=lR){return!(n||e-t=n}function pR(e){const t=Math.floor(e/1e3);if(t<60)return`${t}s`;const n=Math.floor(t/60),s=t%60;return`${n}m${s}s`}function Ym(e){let t="";const n=[];for(let s=0;s=128&&i<=159?n.push(i):t+=e[s]}return{cleaned:t,dropped:n}}function Rr(e){switch(e){case"view":case"control":case"full":return e;default:return"full"}}function $l(e,t){return e==="attached"&&Rr(t)!=="view"}function vR(e){return!e.hasSelection||!e.isDriver?!1:$l(e.status,e.permission)}function gR(e,t,n,s,i=window.innerWidth,a=window.innerHeight){return{left:Math.min(Math.max(e,8),Math.max(8,i-n-8)),top:Math.min(Math.max(t,8),Math.max(8,a-s-8))}}function ep(e){const{cleaned:t}=Ym(e);if(!t)return null;const n=t.replace(/\r\n?|\n/g,"\r").replace(/\r+$/,"");return n?n+"\r":null}const qc=new Set,aa={emit(e,t){const n={id:crypto.randomUUID(),file:e,name:t||"clipboard-image"};for(const s of qc)try{s(n)}catch(i){Lt("paste","image bus handler threw",{error:Rt(i)})}},on(e){return qc.add(e),()=>{qc.delete(e)}}};function mR(){var t;if(typeof navigator>"u")return"other";const e=((t=navigator.platform)==null?void 0:t.toLowerCase())??"";return e.includes("mac")?"mac":e.includes("linux")?"linux":"other"}function _R(e,t=mR()){return t!=="mac"&&t!=="linux"||!e.ctrlKey||e.metaKey||e.shiftKey||e.altKey?!1:e.code==="KeyV"||e.key.toLowerCase()==="v"}const yR={"clipboard has no text or image":"terminal.clipboardEmpty","clipboard image too large":"terminal.clipboardImageTooLarge","install xclip, wl-paste, or xsel to paste images":"terminal.clipboardImageToolsMissing"};function bR(e,t){const n=atob(e),s=Uint8Array.from(n,i=>i.charCodeAt(0));return new Blob([s],{type:t})}async function tp(e){if(!$l(e.status,e.remotePermission))return{ok:!1,reasonKey:"terminal.pasteSessionNotWritable"};const t=await(e.getPayload?e.getPayload():US());if(t.kind==="text"&&t.text)return e.term.paste(t.text),{ok:!0,kind:"text"};if(t.kind==="image"&&t.content_type&&t.data_base64){if(Rr(e.remotePermission)==="control")return{ok:!1,reasonKey:"terminal.imagePasteRequiresFull"};const n=bR(t.data_base64,t.content_type),s=t.filename||"clipboard-image";return aa.emit(n,s),await e.conn.sendPasteImage(n,s),{ok:!0,kind:"image"}}if(t.reason){const n=yR[t.reason];return n?{ok:!1,reasonKey:n}:{ok:!1,reason:t.reason}}return{ok:!1,reasonKey:"terminal.clipboardEmpty"}}const Yc=new Set,Gd={emit(e,t){const n={id:crypto.randomUUID(),name:e||"file",size:t};for(const s of Yc)try{s(n)}catch(i){Lt("paste","file bus handler threw",{error:Rt(i)})}},on(e){return Yc.add(e),()=>{Yc.delete(e)}}},wR=/^[A-Za-z0-9_@%+=:,./-]+$/;function SR(e){return e===""?"''":wR.test(e)?e:"'"+e.replace(/'/g,"'\\''")+"'"}const CR=10*1024*1024;async function kR(e){const t=e.maxBytes??CR,n=e.items.find(d=>d.kind==="file"&&d.type.startsWith("image/")),s=n??e.items.find(d=>d.kind==="file");if(!s)return"skipped";const i=s.getAsFile();if(!i)return"skipped";if(i.size>t)return Lt("paste","pasted file too large",{name:i.name,bytes:i.size}),"skipped";if(e.isLocalSession){const d=await e.getLocalPaths();if(d.length>0)return e.paste(d.map(SR).join(" ")),"path-injected"}if(n&&s===n)return await e.conn.sendPasteImage(i,i.name||"clipboard-image"),"image-sent";const a=i.name||"file";return e.onFileToast(a,i.size),await e.conn.sendPasteFile(i,a),"file-sent"}function xR(){return window.go.main.App.GetPasteboardFileURLs()}function RR(){return window.go.main.App.ReceivedFilesClearAll()}function TR(e){return window.go.main.App.ReceivedFilesClearSession(e)}function PR(e,t){return window.go.main.App.ReceivedFilesDelete(e,t)}function ER(){return window.go.main.App.ReceivedFilesList()}function LR(){return window.go.main.App.ReceivedFilesOpenDir()}function DR(e){return window.go.main.App.TranslateOpenAIChat(e)}function Ol(){var e;return typeof navigator>"u"?!1:((e=navigator.platform)==null?void 0:e.toLowerCase().includes("mac"))??!1}function ju(){return Ol()?"Meta":"Control"}const MR="\x1B[I",AR="\x1B[O";function IR(e){return{handle(t){t===AR||t===MR||e.send(t)},dispose(){}}}function $R(e){return e.type!=="keydown"?!1:e.key==="Control"||e.key==="Meta"||e.key==="Alt"||e.key==="Shift"}function OR(e){e.attachCustomKeyEventHandler(t=>!$R(t))}const np=/\b(https?|file):\/\/[^\s\x00-\x1f]+/g,sp=/(^|[\s(){}\[\]<>"'`])(~\/|\/)([^\s\x00-\x1f]*)/g,FR=new Set([".",",",";",":","!","?",'"',"'"]);function ip(e){let t=e.length;for(;t>0;){const n=e[t-1];if(FR.has(n)){t--;continue}if(n===")"||n==="]"){const s=n===")"?"(":"[",i=rp(e.slice(0,t-1),s),a=rp(e.slice(0,t-1),n);if(i<=a){t--;continue}}break}return e.slice(0,t)}function rp(e,t){let n=0;for(let s=0;sdo.start)||t.push({start:d,end:r,text:a,kind:"path"})}return t.sort((s,i)=>s.start-i.start),t}function op(e,t){let n="";const s=[];let i=0;for(let a=0;aBR)return!1}return!0}function HR(e,t){const n=e.text;return e.kind==="http"||e.kind==="file"?n:n.startsWith("~/")||n==="~/"?t?`file://${t.replace(/\/+$/,"")}${n.slice(1)}`:null:`file://${n}`}function NR(e,t,n,s){let i="";const a=[],d=[];let r=0;for(let o=0;o0&&!c.isWrapped)break;r=o+1;for(let p=0;p[p.startCell,p.endCell]);let d=t;for(let p=0;pyl)||c.push({match:p,row:t,startCell:y,endCell:v})}u=m}}return[...i,...c].sort((p,u)=>p.startCell-u.startCell)}function zR(e,t,n,s){const i=[],a=Math.max(0,t-s+1);for(let d=a;d<=t;d++){const r=e.getLine(d);if(!r||r.isWrapped)continue;const o=op(r,n),c=/\((https?|file):\/\//g;let p;for(;(p=c.exec(o.text))!==null;){const u=p.index+1,g=ap(o.text,u),m=o.text.slice(u,g);if(!lp(m))for(const y of UR(o.text,p.index)){const v=[{row:d,mapped:o,start:u,end:g}];let l=m,h=!1;for(let k=d+1;k0&&!/\s/.test(M.text[y-1]))break;const w=ap(M.text,y),T=M.text.slice(y,w);if(v.push({row:k,mapped:M,start:y,end:w}),l+=T,lp(l)){h=!0;break}}if(!h)continue;const f=qu(l).find(k=>k.start===0);if(!f||f.kind==="path"||f.end>=l.length)continue;const _=l.length-f.end,S=v[v.length-1];S.end-=_;for(const k of v)k.row!==t||k.end<=k.start||i.push({match:{...f,start:0,end:f.text.length},row:k.row,startCell:k.mapped.cellStart[k.start],endCell:k.mapped.cellStart[k.end]});break}}}return i}function ap(e,t){let n=t;for(;nn.start===0);return!!t&&t.end=0;a--)if(/\s/.test(e[a])){if(s++,s>=2){n=a+2;break}}else s=0,n=a;const i=[t];for(let a=t-1;a>=n;a--)!/\s/.test(e[a])&&(a===n||/\s/.test(e[a-1]))&&i.push(a);return i}const VR=50;function KR(e){const{term:t,isMac:n,openLink:s,onError:i}=e;let a=null;const d=p=>{a={x:p.clientX,y:p.clientY}},r=t.element;r==null||r.addEventListener("mousedown",d);const o={provideLinks(p,u){const g=t.buffer.active,m=Xm(g,p-1,t.cols,VR);if(m.length===0){u(void 0);return}u(m.map(y=>WR(y.match,y.row+1,y.startCell+1,y.endCell,t,n,()=>a,s,i)))}};let c={dispose(){}};try{c=t.registerLinkProvider(o)}catch(p){Lt("term-link","registerLinkProvider failed",{error:Rt(p)})}return{dispose(){r==null||r.removeEventListener("mousedown",d),c.dispose()}}}function WR(e,t,n,s,i,a,d,r,o){return{range:{start:{x:n,y:t},end:{x:s,y:t}},text:e.text,decorations:{underline:!0,pointerCursor:!0},activate:async c=>{if(Gm(c,d())){c.preventDefault(),c.stopPropagation(),c.stopImmediatePropagation(),i.clearSelection();try{await r(e)}catch(p){Lt("term-link","openLink failed",{error:Rt(p)}),o("terminal.link.openFailed")}}}}}const cp=new WeakSet;function Jm(e){var i,a,d,r;const t=(r=(d=(a=(i=e._core)==null?void 0:i._renderService)==null?void 0:a.dimensions)==null?void 0:d.css)==null?void 0:r.cell;if(t&&typeof t.width=="number"&&typeof t.height=="number"&&t.width>0&&t.height>0)return{width:t.width,height:t.height};cp.has(e)||(cp.add(e),Lt("term","terminalCellCoords: xterm renderer dimensions unavailable, using fontSize estimate. xterm internal API may have changed."));const n=e.options.fontSize??15,s=e.options.lineHeight??1;return{width:n*.6,height:n*s}}function Gc(e,t,n,s,i=Jm){const a=s.getBoundingClientRect();if(e=a.right||t=a.bottom)return null;const{width:d,height:r}=i(n);if(d<=0||r<=0)return null;const o=e-a.left,c=t-a.top+(s.scrollTop??0),p=Math.floor(o/d),u=Math.floor(c/r);return{col:p,row:u}}function jR(e,t){if(t<0)return{start:0,len:0};if(t>=e.length)return{start:e.length,len:0};const n=e[t];if(Yu(n))return{start:t,len:0};const s=qR(n);let i=t;for(;i>0&&dp(e[i-1])===(s?"alnum":"punct");)i--;let a=t+1;for(;a?@[\\]^`{|}~".split(""));function qR(e){return!(Yu(e)||Qm.has(e))}function dp(e){return Yu(e)?"ws":Qm.has(e)?"punct":"alnum"}async function YR(e,t,n){const s=[];for(const i of e)try{const a=i.getMenuItems(t,n);s.push(...a)}catch(a){Us("plugin","context-menu getMenuItems threw",{error:Rt(a)})}return s}const GR={id:"file-explorer",slot:"right-panel",titleKey:"plugins.fileExplorer.title",descriptionKey:"plugins.fileExplorer.description",load:()=>fo(()=>import("./FileExplorer-DTHAXsem.js").then(e=>e.d),__vite__mapDeps([0,1,2])),defaultEnabled:!1};function XR(e){return/[一-鿿]/.test(e)}function JR(e,t){return XR(e)&&t==="zh-CN"?"en":t}class Os extends Error{constructor(t,n,s,i){super(n),this.code=t,this.httpStatus=s,this.providerBody=i,this.name="TranslateError"}}const QR=5,Gu=Au("translatePanel",()=>{const e=H(!1),t=H(""),n=H("zh-CN"),s=H(!1),i=H(null),a=H(null),d=H([]),r=tg(null);let o=null;function c(l){r.value=l}function p(){e.value=!1}async function u(l){if(!r.value){e.value=!0,i.value={code:"unknown",message:rn("plugins.translate.notConfigured")};return}e.value=!0,t.value=l,n.value=JR(l,r.value.defaultTargetLang),y()}async function g(l){n.value=l,await y()}async function m(){await y()}async function y(){if(!r.value)return;i.value=null,a.value=null,s.value=!0,o==null||o.abort();const l=new AbortController;o=l;try{const h=await r.value.provider.translate(t.value,n.value,{signal:l.signal});if(l.signal.aborted)return;a.value=h,d.value=[{source:t.value,target:n.value,translated:h.translated,detectedSrcLang:h.detectedSrcLang,at:Date.now()},...d.value].slice(0,QR)}catch(h){if(h instanceof Os&&h.code==="aborted")return;const f=h instanceof Os?h.code:"unknown",_=h instanceof Error?h.message:String(h);i.value={code:f,message:_}}finally{o===l&&(s.value=!1)}}function v(l){t.value=l.source,n.value=l.target,a.value={translated:l.translated,detectedSrcLang:l.detectedSrcLang},i.value=null,e.value=!0}return{visible:e,source:t,targetLang:n,loading:s,error:i,result:a,history:d,configure:c,openWithSource:u,changeTarget:g,close:p,retry:m,restoreFromHistory:v}}),ZR={getMenuItems(e,t){return!t||!t.trim()?[]:[{id:"translate-selection",label:rn("plugins.translate.selection"),onClick:()=>{Gu().openWithSource(t)}}]}},eT={id:"translate",slot:"context-menu",titleKey:"plugins.translate.title",descriptionKey:"plugins.translate.description",load:async()=>({default:ZR}),defaultEnabled:!1},tT={getMenuItems:()=>[]},nT={id:"desk-widget",slot:"companion-window",titleKey:"plugins.deskWidget.title",descriptionKey:"plugins.deskWidget.description",load:async()=>({default:tT}),defaultEnabled:!1,desktopOnly:!0},Zm=[GR,eT,nT];function e_(e){return Zm.filter(t=>t.slot===e)}let up=null;const Hr=Au("pluginConfig",()=>{const e=H(null);async function t(){const a=dn();if(!a.pluginHost)throw new Error("plugin host unavailable");e.value=await a.pluginHost.getPluginConfig(),up||(up=a.events.on("plugin-config-changed",d=>{e.value=d}))}async function n(a){const d=dn();if(!d.pluginHost)throw new Error("plugin host unavailable");await d.pluginHost.setPluginConfig(a),e.value=a}function s(a){var d;return e.value?a==="file-explorer"?e.value.fileExplorer.enabled:a==="translate"?e.value.translate.enabled:a==="desk-widget"?((d=e.value.widget)==null?void 0:d.enabled)??!1:!1:!1}async function i(a,d){if(!e.value)return;const r=JSON.parse(JSON.stringify(e.value));a==="file-explorer"&&(r.fileExplorer.enabled=d),a==="translate"&&(r.translate.enabled=d),a==="desk-widget"&&r.widget&&(r.widget.enabled=d),await n(r)}return{cfg:e,load:t,save:n,isPluginEnabled:s,setEnabled:i}}),sT=[{id:"aux-up",label:"↑",seq:"\x1B[A"},{id:"aux-down",label:"↓",seq:"\x1B[B"},{id:"aux-left",label:"←",seq:"\x1B[D"},{id:"aux-right",label:"→",seq:"\x1B[C"},{id:"aux-enter",label:"enter",seq:"\r"},{id:"aux-esc",label:"esc",seq:"\x1B"},{id:"aux-tab",label:"tab",seq:" "},{id:"aux-ctrl-c",label:"⌃C",seq:""},{id:"aux-ctrl-d",label:"⌃D",seq:""}];async function iT(e){const t=await e.load();return t.length>0?t:sT}const rT=300,gl=[];let Xu=!1;function oT(){try{const e=window.localStorage.getItem("atterm.debugTouch");return e==="1"||e==="true"}catch{return!1}}function aT(e){Xu=e}function Qa(){return Xu}function _n(e,t={}){if(!Xu)return;const n={t:Date.now(),tag:e,data:t};gl.push(n),gl.length>rT&&gl.shift();try{Js("touch-scroll",e,{data:JSON.stringify(t)})}catch{}}function lT(){try{window.__attermTouchDebug=()=>gl.slice()}catch{}}const cT=Object.freeze([{id:"default-yes",label:"yes",text:"yes"},{id:"default-ok",label:"ok",text:"ok"},{id:"default-continue",label:"continue",text:"continue"},{id:"default-commit",label:"commit",text:"commit"},{id:"default-push",label:"push",text:"push"},{id:"default-release",label:"release",text:"release"},{id:"default-1",label:"1",text:"1"},{id:"default-2",label:"2",text:"2"},{id:"default-3",label:"3",text:"3"}]);async function t_(e){const t=await e.load();return t.length>0?t:cT}function dT(e){if(!e)return null;const t=e.split("+").map(d=>d.trim()).filter(Boolean);if(t.length<2)return null;let n=!1,s=!1,i=!1,a="";for(const d of t){const r=d.toLowerCase();r==="mod"||r==="cmd"||r==="meta"||r==="ctrl"||r==="control"?n=!0:r==="alt"||r==="option"?s=!0:r==="shift"?i=!0:a=d.toLowerCase()}return a?{mod:n,alt:s,shift:i,key:a}:null}function uT(e,t){const n=Ol()?e.metaKey:e.ctrlKey;return t.mod!==n||t.alt!==e.altKey||t.shift!==e.shiftKey?!1:e.key.toLowerCase()===t.key}function hT(e){const{send:t,confirmRequired:n,focused:s,templatesBridge:i}=e,a=H([]),d=H(!1),r=H(null),o=j(()=>r.value!==null);function c(l){t(l.text),window.setTimeout(()=>t("\r"),16)}function p(l){if(!n.value){c(l);return}r.value=l}function u(){r.value=null}function g(){const l=r.value;r.value=null,l&&c(l)}function m(l){if(s())for(const h of a.value){const f=dT(h.hotkey||"");if(f&&uT(l,f)){l.preventDefault(),l.stopPropagation(),c(h);return}}}function y(l){const h=l.currentTarget;if(!h)return;const f=l.deltaY!==0?l.deltaY:l.deltaX;f!==0&&(h.scrollLeft+=f)}async function v(){const[l,h]=await Promise.all([t_(i),i.loadHidden()]);a.value=l,d.value=h}return{templates:a,templatesHidden:d,pendingTemplateConfirm:r,templateConfirmOpen:o,sendTemplate:c,requestTemplateSend:p,cancelTemplateSend:u,confirmTemplateSend:g,onTemplateHotkey:m,onTemplateBarWheel:y,reload:v}}const ml=H(new Set);function fT(){return ml}function hp(e,t){if(!e)return;const n=ml.value.has(e);if(t===n)return;const s=new Set(ml.value);t?s.add(e):s.delete(e),ml.value=s}const n_=Au("fileReveal",()=>{const e=H(null);function t(s){e.value=s}function n(){const s=e.value;return e.value=null,s}return{pending:e,request:t,consume:n}}),pT=["aria-label","aria-expanded","aria-activedescendant","disabled"],vT={class:"trigger-label"},gT={key:0,class:"menu","data-testid":"select-menu",role:"listbox"},mT=["id","aria-selected","onClick","onMouseenter"],_T={class:"option-label"},yT={key:0,class:"option-description"},bT=$e({__name:"SelectDropdown",props:{modelValue:{},options:{},disabled:{type:Boolean},ariaLabel:{}},emits:["update:modelValue"],setup(e,{emit:t}){const n=`select-dropdown-${Math.random().toString(36).slice(2,10)}`;function s(_){return`${n}-opt-${_}`}const i=e,a=t,d=H(!1),r=H(null),o=H(-1),c=j(()=>{const _=i.options.find(S=>S.value===i.modelValue);return _?_.label:""});function p(){return i.options.findIndex(_=>_.value===i.modelValue)}function u(){if(i.disabled)return;d.value=!0;const _=p();o.value=_>=0?_:0}function g(){d.value=!1,o.value=-1}function m(_){g(),_.value!==i.modelValue&&a("update:modelValue",_.value)}function y(_){if(i.options.length===0)return;const S=i.options.length,k=o.value<0?p():o.value,P=k<0?0:k;o.value=(P+_+S)%S}function v(){if(o.value<0)return;const _=i.options[o.value];_&&m(_)}function l(){i.disabled||(d.value?g():u())}function h(_){if(!i.disabled){if(_.key==="Escape"){d.value&&(_.preventDefault(),g());return}if(_.key==="ArrowDown"){_.preventDefault(),d.value?y(1):u();return}if(_.key==="ArrowUp"){_.preventDefault(),d.value?y(-1):u();return}if(_.key==="Home"&&d.value){_.preventDefault(),o.value=0;return}if(_.key==="End"&&d.value){_.preventDefault(),o.value=i.options.length-1;return}if(_.key==="Enter"&&d.value){_.preventDefault(),v();return}}}function f(_){if(!d.value)return;const S=_.target;r.value&&S&&r.value.contains(S)||g()}return yt(d,_=>{_?document.addEventListener("mousedown",f):document.removeEventListener("mousedown",f)}),Vt(()=>{document.removeEventListener("mousedown",f)}),(_,S)=>($(),F("div",{ref_key:"rootRef",ref:r,class:"select-dropdown"},[b("button",{type:"button",class:lt(["trigger",{"trigger-open":d.value}]),"data-testid":"select-trigger","aria-label":_.ariaLabel,"aria-haspopup":"listbox","aria-expanded":d.value?"true":"false","aria-activedescendant":d.value&&o.value>=0?s(o.value):void 0,disabled:_.disabled,onClick:l,onKeydown:h},[b("span",vT,L(c.value),1)],42,pT),d.value?($(),F("ul",gT,[($(!0),F(Oe,null,at(_.options,(k,P)=>($(),F("li",{id:s(P),key:k.value,class:lt(["option",{"option-highlight":P===o.value,"option-selected":k.value===_.modelValue}]),"data-testid":"select-option",role:"option","aria-selected":k.value===_.modelValue?"true":"false",onClick:M=>m(k),onMouseenter:M=>o.value=P},[b("span",_T,L(k.label),1),k.description?($(),F("span",yT,L(k.description),1)):Z("",!0)],42,mT))),128))])):Z("",!0)],512))}}),ts=Ct(bT,[["__scopeId","data-v-65a81c06"]]),wT={class:"sp-seg"},ST=["title"],CT={key:0,class:"sp-actions"},kT=["title","aria-label"],xT=["title","aria-label"],RT=["title","aria-label"],TT={key:1,class:"sp-menu",role:"menu"},PT=["onClick"],ET={class:"sp-lbl"},LT=["title","onClick"],DT=["title","onClick"],MT=["title","onClick"],AT=$e({__name:"ServicePreviewSwitcher",props:{previews:{},activeId:{}},emits:["show-terminal","select","close","add","open-browser","copy"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H(!1),d=H(null),r=j(()=>n.previews.find(y=>y.id===n.activeId)??null),o=j(()=>n.activeId!==null&&r.value!==null);function c(){a.value=!a.value}function p(){a.value=!1}function u(y){s("select",y),p()}function g(){p(),s("add")}function m(y){var v,l;a.value&&!((l=(v=y.target)==null?void 0:v.closest)!=null&&l.call(v,".sp-switcher"))&&p()}return Dt(()=>document.addEventListener("click",m,!0)),Vt(()=>document.removeEventListener("click",m,!0)),(y,v)=>{var l,h,f,_,S;return $(),F("div",{ref_key:"rootRef",ref:d,class:"sp-switcher"},[b("div",wT,[b("button",{type:"button",class:lt({active:!o.value}),onClick:v[0]||(v[0]=k=>s("show-terminal"))},L(C(i)("terminal.preview.terminal")),3),b("button",{type:"button",class:lt(["sp-current",{active:o.value,reconnecting:(l=r.value)==null?void 0:l.reconnecting}]),title:(h=r.value)!=null&&h.reconnecting?C(i)("terminal.preview.reconnecting"):C(i)("terminal.preview.switch"),onClick:c},[b("span",{class:lt(["sp-dot",{reconnecting:(f=r.value)==null?void 0:f.reconnecting}])},null,2),ot(" "+L(C(i)("terminal.preview.previewPort",{port:((_=r.value)==null?void 0:_.port)??((S=y.previews[0])==null?void 0:S.port)??""}))+" ",1),v[4]||(v[4]=b("span",{class:"sp-caret"},"▾",-1))],10,ST)]),o.value?($(),F("div",CT,[b("button",{type:"button",title:C(i)("terminal.preview.openInBrowser"),"aria-label":C(i)("terminal.preview.openInBrowser"),onClick:v[1]||(v[1]=k=>s("open-browser"))},v[5]||(v[5]=[b("span",{class:"sp-ico"},[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b("path",{d:"M8 12h8M12 8l4 4-4 4"})])],-1)]),8,kT),b("button",{type:"button",title:C(i)("terminal.preview.copyURL"),"aria-label":C(i)("terminal.preview.copyURL"),onClick:v[2]||(v[2]=k=>s("copy"))},v[6]||(v[6]=[b("span",{class:"sp-ico"},[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),b("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})])],-1)]),8,xT),b("button",{type:"button",class:"close",title:C(i)("terminal.preview.closeThis"),"aria-label":C(i)("terminal.preview.closeThis"),onClick:v[3]||(v[3]=k=>r.value&&s("close",r.value.id))},"✕",8,RT)])):Z("",!0),a.value?($(),F("div",TT,[($(!0),F(Oe,null,at(y.previews,k=>($(),F("button",{key:k.id,type:"button",class:lt(["sp-item",{active:k.id===y.activeId}]),onClick:P=>u(k.id)},[b("span",{class:lt(["sp-dot",{reconnecting:k.reconnecting}])},null,2),b("span",ET,L(C(i)("terminal.preview.previewPort",{port:k.port})),1),b("span",{class:"sp-mini",title:C(i)("terminal.preview.openInBrowser"),onClick:ut(P=>{u(k.id),s("open-browser")},["stop"])},v[7]||(v[7]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),b("path",{d:"M8 12h8M12 8l4 4-4 4"})],-1)]),8,LT),b("span",{class:"sp-mini",title:C(i)("terminal.preview.copyURL"),onClick:ut(P=>{u(k.id),s("copy")},["stop"])},v[8]||(v[8]=[b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("rect",{x:"9",y:"9",width:"11",height:"11",rx:"2"}),b("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})],-1)]),8,DT),b("span",{class:"sp-x",title:C(i)("terminal.preview.closeThis"),onClick:ut(P=>s("close",k.id),["stop"])},"✕",8,MT)],10,PT))),128)),v[9]||(v[9]=b("div",{class:"sp-sep"},null,-1)),b("button",{type:"button",class:"sp-item sp-add",onClick:g},"+ "+L(C(i)("terminal.preview.newPreview")),1)])):Z("",!0)],512)}}}),IT=Ct(AT,[["__scopeId","data-v-c9d59669"]]),$T=["aria-label"],OT=["disabled"],FT=["disabled"],BT=["aria-label"],HT=$e({__name:"TerminalSelectionPopover",props:{visible:{type:Boolean},x:{},y:{},arrowDir:{},copying:{type:Boolean},sending:{type:Boolean}},emits:["copy","send","cancel"],setup(e){const t=e,{t:n}=$t(),s=j(()=>{const i=`left: ${t.x}px;`;return t.arrowDir==="down"?`${i} bottom: ${t.y}px;`:`${i} top: ${t.y}px;`});return(i,a)=>i.visible?($(),F("div",{key:0,class:lt(["popover",[`arrow-${i.arrowDir}`]]),style:nn(s.value),"data-testid":"selection-popover",role:"group","aria-label":C(n)("mobile.selection.copy")+" / "+C(n)("mobile.selection.send"),onPointerdown:a[3]||(a[3]=ut(()=>{},["stop"])),onPointerup:a[4]||(a[4]=ut(()=>{},["stop"])),onClick:a[5]||(a[5]=ut(()=>{},["stop"]))},[b("button",{type:"button",class:"btn",disabled:i.copying,"data-testid":"selection-popover-copy",onClick:a[0]||(a[0]=d=>i.$emit("copy"))},L(C(n)("mobile.selection.copy")),9,OT),b("button",{type:"button",class:"btn send",disabled:i.sending,"data-testid":"selection-popover-send",onClick:a[1]||(a[1]=d=>i.$emit("send"))},L(C(n)("mobile.selection.send")),9,FT),b("button",{type:"button",class:"btn cancel","aria-label":C(n)("mobile.selection.cancel"),"data-testid":"selection-popover-cancel",onClick:a[2]||(a[2]=d=>i.$emit("cancel"))},"x",8,BT)],46,$T)):Z("",!0)}}),NT=Ct(HT,[["__scopeId","data-v-063a4cb7"]]),zT={key:0,class:"term-search","data-test":"terminal-search"},UT=["placeholder"],VT={class:"term-search-count","data-test":"terminal-search-count"},KT=["title","aria-label","disabled"],WT=["title","aria-label","disabled"],jT=["title","aria-label"],qT=$e({__name:"TerminalSearchBar",props:{open:{type:Boolean},focusSeq:{},resultIndex:{},resultCount:{}},emits:["find","close"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H(""),d=H(null);function r(){cn(()=>{var g,m;(g=d.value)==null||g.focus(),(m=d.value)==null||m.select()})}function o(){a.value&&s("find",a.value,"next",!0)}yt(()=>n.open,g=>{g&&(r(),o())}),yt(()=>n.focusSeq,()=>{n.open&&(r(),o())});function c(){s("find",a.value,"next",!0)}function p(g){s("find",a.value,g,!1)}function u(g){if(g.key==="Escape"){g.preventDefault(),s("close");return}g.key==="Enter"&&(g.preventDefault(),p(g.shiftKey?"prev":"next"))}return(g,m)=>g.open?($(),F("div",zT,[it(b("input",{ref_key:"inputEl",ref:d,"onUpdate:modelValue":m[0]||(m[0]=y=>a.value=y),class:"term-search-input","data-test":"terminal-search-input",type:"text",spellcheck:"false",autocomplete:"off",placeholder:C(i)("terminal.search.placeholder"),onInput:c,onKeydown:u},null,40,UT),[[Pt,a.value]]),b("span",VT,L(g.resultCount>0?g.resultIndex>=0?`${g.resultIndex+1}/${g.resultCount}`:`${g.resultCount}+`:a.value?C(i)("terminal.search.noResults"):""),1),b("button",{class:"term-search-btn","data-test":"terminal-search-prev",title:C(i)("terminal.search.prev"),"aria-label":C(i)("terminal.search.prev"),disabled:g.resultCount===0,onClick:m[1]||(m[1]=y=>p("prev"))},"↑",8,KT),b("button",{class:"term-search-btn","data-test":"terminal-search-next",title:C(i)("terminal.search.next"),"aria-label":C(i)("terminal.search.next"),disabled:g.resultCount===0,onClick:m[2]||(m[2]=y=>p("next"))},"↓",8,WT),b("button",{class:"term-search-btn","data-test":"terminal-search-close",title:C(i)("terminal.search.close"),"aria-label":C(i)("terminal.search.close"),onClick:m[3]||(m[3]=y=>s("close"))},"×",8,jT)])):Z("",!0)}}),YT=Ct(qT,[["__scopeId","data-v-302a13f7"]]),GT=["src","title"],XT={key:0,class:"service-preview-reconnecting",role:"status"},JT={class:"service-preview-controls"},QT={class:"service-preview-mapping-row root-mapping"},ZT=["aria-label","onKeydown"],e5=["onUpdate:modelValue","aria-label"],t5=["onUpdate:modelValue","aria-label"],n5=["title","aria-label","onClick"],s5={class:"service-preview-form-actions"},i5=["disabled"],r5=["disabled"],o5={class:"progress-track","aria-hidden":"true"},a5={key:1},l5={key:2,class:"warn"},c5={key:3,class:"dim"},d5={key:4,class:"bad"},u5={key:3,class:"viewer-overlay","aria-live":"polite"},h5={class:"viewer-overlay-card"},f5={class:"viewer-overlay-title"},p5={key:0,class:"viewer-overlay-host"},v5={class:"viewer-overlay-hint"},g5=["disabled"],m5=["disabled"],_5=["disabled"],y5=["disabled"],b5=["disabled","onClick"],w5=["data-testid","title","onTouchend","onClick"],S5=["title"],C5=["data-testid","disabled","onTouchend","onPointerup"],k5=["disabled"],x5=["disabled"],R5=["disabled"],T5={class:"template-confirm-copy"},P5={class:"template-confirm-label"},E5={class:"template-confirm-text"},L5=["placeholder"],D5=["disabled"],M5=500,fp=8,pp=4,vp=24,A5=3,I5=60,$5=800,O5=500,gp=800,F5=350,B5=900,ji=10,H5=150,N5=150,z5=$e({__name:"TerminalView",props:{endpoint:{},sessionId:{},active:{type:Boolean,default:!0},focused:{type:Boolean,default:!1},avoidTopRightBadge:{type:Boolean,default:!1},sessionLabel:{},expectedCols:{},expectedRows:{},remotePermission:{},theme:{},commandNotifyThresholdSec:{default:10},isLocalSession:{type:Boolean,default:!0},canDetach:{type:Boolean},resizeSuspended:{type:Boolean,default:!1},searchRequestSeq:{default:0},appearance:{default:()=>({fontHead:"",fontSize:13,lineHeight:1,cursorStyle:"block",cursorBlink:!0,scrollback:5e3})}},emits:["toast","detach"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H(null),d=H("connecting"),r=H(null),o=H(!1),c=H(0),p=H(0),u=H(!1),g=H(!1),m=H(null),y=H(null),v=H(null),l=H(!1),h=H(""),f=H(n.isLocalSession??!0),_=H(null),S=H(null),k=H(null),P=H(null),M=H(""),w=H(""),T=H([]),A=H(!1),E=H(!1),R=H(!1),D=j(()=>E.value||R.value),I=j(()=>!D.value),O=H("idle"),U=H({visible:!1,x:0,y:0,arrowDir:"down",copying:!1,sending:!1}),W=dn(),z=n_(),N=H(!1),V=H([]),q=H(null),G=j(()=>q.value!==null),te=j(()=>V.value.find(X=>X.id===q.value)??null);let oe=null;yt(()=>V.value.length>0,X=>hp(n.sessionId,X));const ie=H(!1),ye=H("3000"),K=H([]),J=H("127.0.0.1"),Q=[{value:"127.0.0.1",label:"127.0.0.1 (IPv4)"},{value:"localhost",label:"localhost"},{value:"::1",label:"::1 (IPv6)"}],ce=H(null),Fe=j(()=>`#service-preview-controls-${n.sessionId}`),Ee=j(()=>`atterm.service-preview.${n.sessionId}`);function Ye(){var X;try{const ne=localStorage.getItem(Ee.value);if(!ne)return;const Ne=JSON.parse(ne);typeof Ne.port=="string"&&(ye.value=Ne.port),(Ne.host==="localhost"||Ne.host==="127.0.0.1"||Ne.host==="::1")&&(J.value=Ne.host),((X=W.servicePreview)==null?void 0:X.supportsMappings)!==!1&&Array.isArray(Ne.mappings)&&(K.value=Ne.mappings.filter(pt=>typeof pt.port=="string"&&typeof pt.pathPrefix=="string").slice(0,7).map(pt=>({port:pt.port,pathPrefix:pt.pathPrefix})))}catch{}}function Ze(){try{localStorage.setItem(Ee.value,JSON.stringify({port:ye.value,host:J.value,mappings:K.value}))}catch{}}let ue=null,et=null,re=null,we=null;const fe=H(!1),De=H(0),Qe=H(-1),We=H(0);let ae=null,_e=null,be=!0,Me=null;const x=sR(),Re=Ut("atterm:pluginInputSenders",null),Ge=Ut("atterm:pluginSessionConnections",null),Ve=Ut("atterm:pluginContext",null),kt=H([]),Je=H(null);let wt=null,tt=null,mt="",se=null,de=null,Le=null,Ae=null,ct=null,ve=null,Be=null,me=null,rt=0,At=0,St=0,xe=-1/0,je=0,ft=0,Tt=[],qt=[],zt=null,Yt=!1;function Qt(){var X,ne;return{selMode:O.value,imeFocused:E.value,softKeyboardOpen:D.value,softKeyboardOpening:R.value,keyboardWanted:A.value,userScrolledDuringKeyboardCycle:Yt,scrollTop:(Ae==null?void 0:Ae.scrollTop)??null,scrollHeight:(Ae==null?void 0:Ae.scrollHeight)??null,clientHeight:(Ae==null?void 0:Ae.clientHeight)??null,activeEl:((X=document.activeElement)==null?void 0:X.className)||((ne=document.activeElement)==null?void 0:ne.tagName)||null}}const xn=[80,180,360,700],$n=[60,180,360];let Xt=null,Gt=null;function Rn(){return be&&ue!==null&&a.value!==null}const Zt=j(()=>$l(d.value,n.remotePermission)),on=j(()=>vR({hasSelection:u.value,status:d.value,permission:n.remotePermission,isDriver:f.value})),Ot=j(()=>d.value==="attached"&&f.value&&!n.resizeSuspended&&Rr(n.remotePermission)!=="view"),Hn=j(()=>!W.caps.wailsBindings&&!W.caps.localPty&&T.value.length>0),Tn=j(()=>f.value&&$l(d.value,n.remotePermission)),bn=j(()=>Tn.value&&Rr(n.remotePermission)==="full"),fn=j(()=>!!(W.servicePreview&&!n.isLocalSession&&f.value&&d.value==="attached"&&Rr(n.remotePermission)==="full")),ss=j(()=>{var X;return((X=W.servicePreview)==null?void 0:X.supportsMappings)!==!1}),Nn=j(()=>G.value?0:(Th.value?0:1)+(Hn.value?1:0)),ke=j(()=>`${Nn.value*30}px`),nt=j(()=>Hn.value?"30px":"0");function gt(){f.value&&(ue==null||ue.focus())}function It(X){X.reconnectTimer!==null&&(window.clearTimeout(X.reconnectTimer),X.reconnectTimer=null),X.reconnecting=!1}async function pn(X,ne){var Ke;const Ne=(Ke=W.servicePreview)==null?void 0:Ke.rebind;if(!Ne)return;const pt=[500,1e3,2e3,4e3,8e3],Et=V.value.find(vt=>vt.id===X);if(Et){Et.reconnecting=!0;for(let vt=0;;vt++){const st=V.value.find(Kt=>Kt.id===X);if(!be||!st||ne<0||ne>=st.ports.length){st&&It(st);return}if(!ae||!fn.value){await Nt(X);return}try{const Kt=await ae.openService(st.ports[ne],st.host);if(!be||!V.value.includes(st)){ae.closeService(Kt.serviceId),It(st);return}await Ne({gatewayId:X,mappingIndex:ne,serviceId:Kt.serviceId,clientTicket:Kt.clientTicket,clientToHostKey:Kt.clientToHostKey,hostToClientKey:Kt.hostToClientKey}),st.serviceIds[ne]=Kt.serviceId,It(st);return}catch(Kt){const rs=Rt(Kt);if(rs.includes("preview_gone")||rs.includes("relay is not connected")){await Nt(X);return}const qs=pt[Math.min(vt,pt.length-1)];await new Promise(Wr=>{st.reconnectTimer=window.setTimeout(Wr,qs)})}}}}async function Nt(X){var pt,Et;const ne=V.value.findIndex(Ke=>Ke.id===X);if(ne<0)return;const[Ne]=V.value.splice(ne,1);It(Ne),q.value===X&&(q.value=((pt=V.value[0])==null?void 0:pt.id)??null);for(const Ke of Ne.serviceIds)ae==null||ae.closeService(Ke);try{await((Et=W.servicePreview)==null?void 0:Et.stop(Ne.id))}catch(Ke){Js("service-preview","stop failed",{error:Rt(Ke)})}await cn(),G.value||js()}async function Pn(){const X=V.value.slice();for(const ne of X)await Nt(ne.id)}function is(){if(!N.value){if(!W.servicePreview){s("toast",i("terminal.preview.desktopOnly"));return}if(d.value!=="attached"){s("toast",i("terminal.preview.requiresConnection"));return}if(!f.value){s("toast",i("terminal.preview.requiresDriver"));return}if(Rr(n.remotePermission)!=="full"){s("toast",i("terminal.preview.requiresFullPermission"));return}n.isLocalSession||(ie.value=!0,cn(()=>{var X,ne;(X=ce.value)==null||X.focus(),(ne=ce.value)==null||ne.select()}))}}function On(X,ne){const Ne=X.trim();if(ne)return Ne===""||Ne==="/"?"":null;if(!Ne.startsWith("/")||Ne.includes("?")||Ne.includes("#"))return null;const pt=Ne.replace(/\/+$/,""),Et=pt.split("/");return pt===""||Et.slice(1).some(Ke=>Ke===""||Ke==="."||Ke==="..")?null:pt}function us(){ie.value=!1,gt()}function Vs(X){(X==="localhost"||X==="127.0.0.1"||X==="::1")&&(J.value=X)}async function Ks(){if(!fn.value||!ae||!W.servicePreview||N.value)return;const X=[{port:ye.value.trim(),pathPrefix:""},...K.value.map(vt=>({port:vt.port.trim(),pathPrefix:vt.pathPrefix.trim()}))],ne=X.map(vt=>Number(vt.port));if(ne.some(vt=>!Number.isInteger(vt)||vt<1||vt>65535)){s("toast",i("terminal.preview.invalidPort")),cn(()=>{var vt;return(vt=ce.value)==null?void 0:vt.select()});return}const Ne=X.map((vt,st)=>On(vt.pathPrefix,st===0));if(Ne.some(vt=>vt===null)||new Set(Ne).size!==Ne.length){s("toast",i("terminal.preview.invalidPathPrefix"));return}const pt=Ne;K.value.forEach((vt,st)=>{vt.pathPrefix=pt[st+1]});const Et=V.value.find(vt=>vt.port===ne[0]&&vt.host===J.value);if(Et){q.value=Et.id,ie.value=!1;return}N.value=!0;const Ke=[];try{for(const st of ne){const Kt=await ae.openService(st,J.value);if(Ke.push(Kt),!be||!fn.value)throw ae.closeService(Kt.serviceId),new Error(i("terminal.preview.noLongerAllowed"))}const vt=await W.servicePreview.start({mappings:Ke.map((st,Kt)=>({serviceId:st.serviceId,clientTicket:st.clientTicket,clientToHostKey:st.clientToHostKey,hostToClientKey:st.hostToClientKey,port:ne[Kt],pathPrefix:pt[Kt]||void 0}))});if(Ze(),!be||!fn.value){for(const st of Ke)ae.closeService(st.serviceId);throw await W.servicePreview.stop(vt.id),new Error(i("terminal.preview.noLongerAllowed"))}V.value.push({id:vt.id,url:vt.url,port:ne[0],serviceIds:Ke.map(st=>st.serviceId),ports:ne,prefixes:pt,host:J.value,reconnecting:!1,reconnectTimer:null}),q.value=vt.id,ie.value=!1}catch(vt){for(const st of Ke)ae==null||ae.closeService(st.serviceId);s("toast",i("terminal.preview.openFailed",{error:Rt(vt)}))}finally{N.value=!1}}function fi(X){V.value.some(ne=>ne.id===X)&&(q.value=X)}function Ss(){q.value=null,cn(()=>js())}async function ei(){var ne;const X=(ne=te.value)==null?void 0:ne.url;if(X)try{await W.system.openExternalURL(X)}catch(Ne){Lt("service-preview","open external browser failed",{error:Rt(Ne)}),s("toast",i("terminal.preview.browserOpenFailed"))}}async function Oi(){var ne,Ne;const X=(ne=te.value)==null?void 0:ne.url;if(X)try{if((Ne=navigator.clipboard)!=null&&Ne.writeText)await navigator.clipboard.writeText(X);else if(!va(X))throw new Error("clipboard unavailable");s("toast",i("terminal.preview.urlCopied"))}catch(pt){Lt("service-preview","copy preview URL failed",{error:Rt(pt)}),s("toast",i("terminal.preview.copyFailed"))}}function pi(){(W.caps.wailsBindings||W.caps.localPty||A.value)&>()}function pr(){ue&&(ue.options.disableStdin=!f.value),Le&&(Le.readOnly=!f.value,Le.tabIndex=f.value?0:-1,f.value||(gi(),R.value=!1,A.value=!1,document.activeElement===Le&&(Le.blur(),ue==null||ue.blur())))}function vr(){const X=ue==null?void 0:ue.buffer.active;return X?{viewportY:X.viewportY,atBottom:X.viewportY>=X.baseY}:null}function vi(X){if(_n("applyScrollPosition:entry",{scrollPosition:X,...Qt()}),!!X&&!(!ue||!be)){if(Yt){_n("applyScrollPosition:bailUserScrolled");return}X.atBottom?(_n("applyScrollPosition:scrollToBottom"),ue.scrollToBottom()):(_n("applyScrollPosition:scrollToLine",{line:X.viewportY}),ue.scrollToLine(X.viewportY))}}function Fi(){_n("onViewportUserScrollIntent",{...Qt()}),Yt=!0,Cs(),zt=null}function gr(X){var ne;_n("onTermTouchMoveForRestoreCancel",{touches:X.touches.length,y:(ne=X.touches[0])==null?void 0:ne.pageY,...Qt()}),Fi()}function Cs(){for(const X of qt)window.clearTimeout(X);qt=[]}function gi(){for(const X of Tt)window.clearTimeout(X);Tt=[]}function Bi(){vi(zt)}function mi(X){if(!X)return;Cs(),zt=X;const ne=xn[xn.length-1];requestAnimationFrame(()=>{requestAnimationFrame(()=>{Bi()})});for(const Ne of xn)qt.push(window.setTimeout(()=>{Bi(),Ne===ne&&(zt=null,qt=[])},Ne))}function _i(){var ne,Ne;const X=vr();gi(),R.value=!1,A.value=!1,Le==null||Le.blur(),ue==null||ue.blur(),(Ne=(ne=W.system).hideSoftKeyboard)==null||Ne.call(ne),Yt=!1,mi(X)}function Ms(){if(_n("scrollToBottomForKeyboardOpen:entry",{...Qt()}),!!ue){if(Yt){_n("scrollToBottomForKeyboardOpen:bailUserScrolled");return}ue.scrollToBottom(),mi({viewportY:ue.buffer.active.baseY,atBottom:!0})}}function mr(){f.value&&(Yt=!1,A.value=!0,yi(),Ms(),gt())}function yi(){gi(),R.value=!0;for(const X of $n)Tt.push(window.setTimeout(()=>{A.value&&(E.value||gt(),Ms())},X));Tt.push(window.setTimeout(()=>{R.value=!1,E.value||(A.value=!1),Tt=[]},B5))}function En(){St=Date.now()}function ks(X){if(!Gt)return 0;const ne=X.clientX-Gt.startX,Ne=X.clientY-Gt.startY;return ne*ne+Ne*Ne}function Wn(X){En();const ne=X.touches[0];Gt=ne?{startX:ne.clientX,startY:ne.clientY,cancelled:!1,scrollTarget:null,startScrollLeft:0}:null}function xs(X){if(Wn(X),!Gt)return;const ne=X.currentTarget instanceof Element?X.currentTarget.closest(".aux-key-scroll"):null;ne instanceof HTMLElement&&(Gt.scrollTarget=ne,Gt.startScrollLeft=ne.scrollLeft)}function jn(X){if(!Gt)return;const ne=X.touches[0];if(!ne)return;const Ne=Gt.scrollTarget;Ne&&(Ne.scrollLeft=Gt.startScrollLeft+Gt.startX-ne.clientX),ks(ne)>ji*ji&&(Gt.cancelled=!0)}function zn(){Gt=null}function bi(X){const ne=X.changedTouches[0],Ne=Gt!==null&&!Gt.cancelled&&(!ne||ks(ne)<=ji*ji);return Gt=null,Ne}function hs(X,ne){En(),bi(X)&&(X.preventDefault(),je=Date.now()+gp,ne())}function Rs(X){Date.now()ji*ji&&(Xt.cancelled=!0)}function Ni(X){X&&X.stopPropagation(),Xt=null}function zi(X){!Xt||Xt.pointerId!==X.pointerId||Ni(X)}function le(X){if(!Xt||Xt.pointerId!==X.pointerId)return!1;if(X.preventDefault(),X.stopPropagation(),Date.now()-ftvt.kind==="file"))return;X.preventDefault(),X.stopPropagation();const pt=ue,Et=ae;if(!(!pt||!Et))try{await kR({items:ne,isLocalSession:n.isLocalSession??!0,conn:{sendPasteImage:(vt,st)=>(aa.emit(vt,st),Et.sendPasteImage(vt,st)),sendPasteFile:(vt,st)=>Et.sendPasteFile(vt,st)},paste:vt=>pt.paste(vt),getLocalPaths:async()=>{try{return await xR()??[]}catch(vt){return Lt("term","GetPasteboardFileURLs failed",{error:Rt(vt)}),[]}},onFileToast:(vt,st)=>Gd.emit(vt,st)})}catch(vt){Lt("term","paste dispatch failed",{error:Rt(vt)})}}function Yn(X){if(W.caps.wailsBindings||W.caps.localPty||X.inputType!=="insertText"||X.isComposing)return;const ne=X.data;if(!ne||!Tn.value)return;X.stopImmediatePropagation(),ae==null||ae.sendInput(ne);const Ne=X.target;Ne&&"value"in Ne&&(Ne.value="")}function As(X){if(_n("onImeFocus",{keyboardWanted:A.value,isDriver:f.value}),E.value=!0,f.value){A.value&&Ms();return}const ne=X.target;ne==null||ne.blur(),ue==null||ue.blur()}function _r(){if(_n("onImeBlur",{keyboardWanted:A.value}),E.value=!1,A.value&&Nr()){yi();return}A.value&&R.value||(A.value=!1)}function kc(X){return!(W.caps.wailsBindings||W.caps.localPty||X.pointerType==="mouse")}function La(X){return W.caps.wailsBindings||W.caps.localPty?!1:X.touches.length>0}function xc(X){return!(W.caps.wailsBindings||W.caps.localPty||!D.value||X.pointerType==="mouse")}function Da(X){var pt,Et;_n("onTermPointerDown:entry",{pointerType:X.pointerType,y:X.clientY,target:((pt=X.target)==null?void 0:pt.className)||((Et=X.target)==null?void 0:Et.tagName)||null,...Qt()});const ne=xc(X),Ne=kc(X);if(_n("onTermPointerDown:decision",{shouldHideKeyboard:ne,shouldBlockFocus:Ne}),(ne||Ne)&&(At=Date.now()),E.value&&Le&&document.activeElement===Le){ne&&(X.preventDefault(),X.stopPropagation(),_i(),wi(X));return}if(ne){X.preventDefault(),X.stopPropagation(),_i(),wi(X);return}Ne&&(X.preventDefault(),X.stopPropagation()),wi(X)}function Rc(X){var ne,Ne,pt;if(_n("onTermTouchStart:entry",{touches:X.touches.length,y:(ne=X.touches[0])==null?void 0:ne.pageY,target:((Ne=X.target)==null?void 0:Ne.className)||((pt=X.target)==null?void 0:pt.tagName)||null,...Qt()}),!La(X)){_n("onTermTouchStart:earlyReturn:!shouldBlockTerminalTouchFocus");return}if(At=Date.now(),!D.value){_n("onTermTouchStart:earlyReturn:!softKeyboardOpen");return}_n("onTermTouchStart:hideKeyboardBranch",{...Qt()}),X.preventDefault(),_i()}function Ma(X){X.button===0&&(se={x:X.clientX,y:X.clientY}),!(W.caps.wailsBindings||W.caps.localPty)&&(Date.now()-At>$5||(X.preventDefault(),X.stopPropagation()))}function ti(X){X.stopPropagation()}function yr(){ct&&(clearTimeout(ct),ct=null)}function Vr(X){var pt,Et;if(Ae&&document.contains(Ae))return Ae;const ne=X==null?void 0:X.target;return Ae=((pt=ne==null?void 0:ne.closest)==null?void 0:pt.call(ne,".xterm-viewport"))??((Et=a.value)==null?void 0:Et.querySelector(".xterm-viewport"))??null,Ae}function Ws(){if(ue){try{ue.clearSelection()}catch{}pr()}Ae&&(Ae.style.touchAction="pan-y"),U.value.visible=!1,O.value="idle",yr(),ve=null,Be=null,br()}function Tc(X){if(!ue||!Ae)return null;const{width:ne,height:Ne}=Jm(ue);if(!ne||!Ne)return null;const pt=Ae.getBoundingClientRect(),Et=Ae.scrollTop??0,Ke=pt.left+X.start.x*ne,vt=pt.top+X.start.y*Ne-Et,st=X.start.y===X.end.y?(X.end.x-X.start.x)*ne:pt.width,Kt=(X.end.y-X.start.y+1)*Ne;return{x:Ke,y:vt,width:st,height:Kt}}function Aa(){var Et;if(!ue)return;const X=(Et=ue.getSelectionPosition)==null?void 0:Et.call(ue);if(!X){U.value.visible=!1;return}const ne=Tc(X);if(!ne){U.value.visible=!1;return}const pt=ne.y-6-28>=8;U.value.arrowDir=pt?"down":"up",U.value.x=ne.x+ne.width/2,U.value.y=pt?window.innerHeight-ne.y+6:ne.y+ne.height+6,U.value.visible=!0}function wi(X){if(_n("onSelectionPointerDown:entry",{pointerType:X.pointerType,isPrimary:X.isPrimary,y:X.clientY,...Qt()}),!Tn.value||!ue){_n("onSelectionPointerDown:earlyReturn");return}(O.value==="selecting"||O.value==="dragging")&&Ws();const ne=Vr(X);ne&&(ve={x:X.clientX,y:X.clientY},O.value="pressing",yr(),ct=setTimeout(()=>{var Ke;if(ct=null,O.value!=="pressing"||!ve||!ue)return;const Ne=Gc(ve.x,ve.y,ue,ne);if(!Ne){O.value="idle";return}let pt="";try{pt=((Ke=ue.buffer.active.getLine(Ne.row))==null?void 0:Ke.translateToString(!0))??""}catch{pt=""}const Et=jR(pt,Ne.col);if(Et.len===0){O.value="idle";return}try{ue.select(Et.start,Ne.row,Et.len)}catch{O.value="idle";return}ue.options.disableStdin=!0,ne.style.touchAction="none",O.value="selecting",Be={start:Et.start,end:Et.start+Et.len-1,row:Ne.row},Aa()},M5))}function Ia(X){if(Qa()&&O.value!=="idle"&&_n("onSelectionPointerMove",{selMode:O.value,y:X.clientY}),O.value==="pressing"&&ve){const vt=X.clientX-ve.x,st=X.clientY-ve.y;vt*vt+st*st>fp*fp&&(yr(),O.value="idle",ve=null);return}if(O.value!=="selecting"&&O.value!=="dragging"||!ue||!Ae||!Be||!ve)return;if(O.value==="selecting"){const vt=X.clientX-ve.x,st=X.clientY-ve.y;if(vt*vt+st*st{try{ue==null||ue.scrollLines(X*A5)}catch{}},I5))}function br(){me&&(clearInterval(me),me=null),rt=0}function Oo(X){var pt,Et;if(Ec(X)&&_i(),Eh.value){const Ke=X.target;(pt=Ke==null?void 0:Ke.closest)!=null&&pt.call(Ke,".template-confirm-panel, .template-bar")||Dc()}if(O.value==="idle")return;const ne=X.target,Ne=Ae??((Et=a.value)==null?void 0:Et.querySelector(".xterm-viewport"));ne&&(Ne!=null&&Ne.contains(ne))||ne&&typeof ne.closest=="function"&&ne.closest('[data-testid="selection-popover"]')||Ws()}function Ba(X){return X instanceof Element?!!X.closest(".template-bar, .aux-key-bar, .template-confirm-panel, .paste-confirm-panel"):!1}function Ec(X){return W.caps.wailsBindings||W.caps.localPty||!D.value||X.pointerType==="mouse"?!1:!Ba(X.target)}async function Lc(){if(!ue||U.value.copying){Ws();return}U.value.copying=!0;let X=!1;try{X=await jc(ue)}catch(ne){Lt("term","selection copy failed",{error:Rt(ne)})}finally{U.value.copying=!1}s("toast",i(X?"mobile.selection.copied":"mobile.selection.copyFailed")),Ws()}function Fo(){if(!ue||!ae||U.value.sending){Ws();return}U.value.sending=!0;try{const X=ep(ue.getSelection());X&&ae.sendInput(X)}finally{U.value.sending=!1,Ws()}}function Jn(){o.value=!1,kt.value=[],Je.value=null}async function Kr(X){if(!ue)return;const ne=gR(X.clientX,X.clientY,H5,N5,window.innerWidth,window.innerHeight),Ne=ue.getSelection();if(u.value=!!Ne,c.value=ne.left,p.value=ne.top,kt.value=[],Je.value=za(X),o.value=!0,Ve){const pt=Hr(),Et=[];for(const Ke of e_("context-menu"))if(pt.isPluginEnabled(Ke.id))try{const vt=await Ke.load();Et.push(vt.default)}catch(vt){Us("term","failed to load context-menu plugin",{plugin:Ke.id,error:Rt(vt)})}kt.value=await YR(Et,Ve,Ne)}}function Bo(X){var Ne;if(!o.value)return;const ne=X.target;ne instanceof Node&&((Ne=m.value)!=null&&Ne.contains(ne))||Jn()}function Ha(X){X.key==="Escape"&&Jn()}function Na(){const X=ue==null?void 0:ue.element;return(X==null?void 0:X.querySelector(".xterm-rows"))??(X==null?void 0:X.querySelector(".xterm-screen"))??a.value}function za(X){var Ke;if(!ue)return null;const ne=Na();if(!ne)return null;const Ne=Gc(X.clientX,X.clientY,ue,ne);if(!Ne)return null;const pt=ue.buffer.active.viewportY+Ne.row;return((Ke=Xm(ue.buffer.active,pt,ue.cols,50).find(vt=>Ne.col>=vt.startCell&&Ne.col0&&ne>0&&(ue.cols!==X||ue.rows!==ne)&&ue.resize(X,ne)}function Ho(){if(!ue||!a.value)return;const X=a.value.getBoundingClientRect();if(!(X.width<2||X.height<2)){Ui();try{ue.refresh(0,ue.rows-1)}catch{}}}function Ua(){if(Jn(),!ue||!ae)return;const X=ep(ue.getSelection());X!==null&&ae.sendInput(X)}function Va(){Jn(),ue&&ue.clear()}function Ka(){Jn(),!(!ue||!ae||!Ot.value)&&(ae.sendResize(ue.cols,ue.rows),P.value={cols:ue.cols,rows:ue.rows},S.value=ue.cols,k.value=ue.rows)}function js(){if(!f.value||!et||!a.value)return;const X=a.value.getBoundingClientRect();if(!(X.width<2||X.height<2)){try{et.fit()}catch{}if(ue&&a.value){const ne=a.value.getBoundingClientRect();ue.rows{ue===ne&&ne.scrollToBottom(),X==null||X()})}async function eb(){var Ke,vt;if(ue)return;ue=new Um.Terminal({fontFamily:Qf(n.appearance.fontHead),fontSize:n.appearance.fontSize,lineHeight:n.appearance.lineHeight,cursorStyle:n.appearance.cursorStyle,cursorBlink:n.appearance.cursorBlink,scrollback:n.appearance.scrollback,theme:n.theme,convertEol:!1,disableStdin:!f.value,allowProposedApi:!0}),we={fontHead:n.appearance.fontHead,fontSize:n.appearance.fontSize,lineHeight:n.appearance.lineHeight},et=new Km.FitAddon,ue.loadAddon(et),re=new V2.SearchAddon,ue.loadAddon(re),re.onDidChangeResults(({resultIndex:st,resultCount:Kt})=>{Qe.value=st,We.value=Kt}),ue.open(a.value),OR(ue);let X=!0;try{X=await bm()}catch{X=!1}if(!Rn())return;if(X)try{const st=new U2.WebglAddon;st.onContextLoss(()=>st.dispose()),ue.loadAddon(st)}catch(st){Lt("term","WebGL renderer unavailable, falling back to DOM",{error:Rt(st)})}const ne=a.value;de=ne,ne.addEventListener("keydown",Te,{capture:!0}),ne.addEventListener("keydown",Wt,{capture:!0}),document.addEventListener("keydown",ge,{capture:!0}),ne.addEventListener("paste",qn,{capture:!0}),ne.addEventListener("pointermove",Ia),ne.addEventListener("pointerup",$a),ne.addEventListener("pointercancel",Oa),Ae=((Ke=ue.element)==null?void 0:Ke.querySelector(".xterm-viewport"))??null;try{const st=ue._core,Kt=st==null?void 0:st._viewport;Kt&&(Kt.handleTouchStart=()=>{},Kt.handleTouchMove=()=>!0)}catch(st){Lt("term","disable xterm touch scroll failed",{error:Rt(st)})}if(aT(oT()),lT(),_n("ensureTerm:done",{debugEnabled:Qa(),hasViewport:!!Ae,hasXterm:!!ue.element,xtermChildren:ue.element?Array.from(ue.element.children).map(st=>st.className):[],...Qt()}),Qa()&&ue.element){const st=ue.element;st.addEventListener("touchstart",Kt=>{var qs;const rs=Kt;_n("observer:xterm.touchstart",{touches:rs.touches.length,y:(qs=rs.touches[0])==null?void 0:qs.pageY,defaultPrevented:rs.defaultPrevented})},{passive:!0,capture:!1}),st.addEventListener("touchmove",Kt=>{var Wr;const rs=Kt,qs=(Ae==null?void 0:Ae.scrollTop)??null;_n("observer:xterm.touchmove:before",{touches:rs.touches.length,y:(Wr=rs.touches[0])==null?void 0:Wr.pageY,scrollTopBefore:qs,defaultPrevented:rs.defaultPrevented}),queueMicrotask(()=>{const Bh=(Ae==null?void 0:Ae.scrollTop)??null;_n("observer:xterm.touchmove:after",{scrollTopAfter:Bh,diff:(Bh??0)-(qs??0)})})},{passive:!0,capture:!1}),st.addEventListener("touchend",()=>_n("observer:xterm.touchend"),{passive:!0}),st.addEventListener("touchcancel",()=>_n("observer:xterm.touchcancel"),{passive:!0})}Ae==null||Ae.addEventListener("touchmove",ti,{passive:!0}),Ae==null||Ae.addEventListener("scroll",Fa),Qa()&&Ae&&Ae.addEventListener("scroll",()=>{_n("viewport.scroll",{scrollTop:Ae==null?void 0:Ae.scrollTop,selMode:O.value})},{passive:!0}),Ae==null||Ae.addEventListener("wheel",Fi,{passive:!0}),ne.addEventListener("touchmove",gr,{passive:!0}),Le=((vt=ue.element)==null?void 0:vt.querySelector("textarea"))??null,pr(),Le==null||Le.addEventListener("input",Yn,{capture:!0}),Le==null||Le.addEventListener("focus",As),Le==null||Le.addEventListener("blur",_r),js(),Me=IR({send:st=>ae==null?void 0:ae.sendInput(st)});let Ne=!1;ue.attachCustomKeyEventHandler(st=>(st.type==="keydown"&&(Ne=!0),!0)),ue.onData(st=>{const Kt=Ne;if(Ne=!1,!x.shouldForward(Kt))return;const{cleaned:rs,dropped:qs}=Ym(st);qs.length>0&&Lt("term","dropped C1 control chars from terminal input",{droppedCodepoints:qs.map(Wr=>"U+"+Wr.toString(16).toUpperCase().padStart(4,"0")).join(","),originalLength:st.length,cleanedLength:rs.length}),rs&&(Me==null||Me.handle(rs))}),ue.onResize(({cols:st,rows:Kt})=>{f.value&&(n.resizeSuspended||(ae==null||ae.sendResize(st,Kt),P.value={cols:st,rows:Kt},S.value=st,k.value=Kt))});let pt=0;ue.onBell(()=>{const st=typeof document<"u"&&document.hasFocus();cR(Date.now(),pt,st)&&(pt=Date.now(),Lf("AT Term",i("terminal.bellNotification",{session:n.sessionLabel||"session"}),{session_id:n.sessionId,kind:"bell"}))});const Et=new uR;try{ue.parser.registerOscHandler(133,st=>{const Kt=Et.onOsc133(st,Date.now());if(!Kt)return!1;const rs=typeof document<"u"&&document.hasFocus();return fR(Kt,{focused:rs,thresholdSec:n.commandNotifyThresholdSec??10,isLocal:n.isLocalSession??!0})&&(Lf("AT Term",i("terminal.commandFinishedNotification",{exitCode:Kt.exitCode,elapsed:pR(Kt.elapsedMs),session:n.sessionLabel||"session"}),{session_id:n.sessionId,kind:"command_finished"}),xS(n.sessionId,Kt.exitCode,Kt.elapsedMs,n.sessionLabel||"session")),!1})}catch(st){Lt("term","OSC 133 handler registration failed",{error:Rt(st)})}try{mt=await Fu()}catch{mt=""}Rn()&&(tt=KR({term:ue,isMac:Ol(),openLink:st=>Ie(st),onError:st=>s("toast",i(st))}),wt=new ResizeObserver(()=>{js(),Bi()}),wt.observe(a.value))}const tb={matchBackground:"#3a3f4b",matchBorder:"#5a6272",matchOverviewRuler:"#5a6272",activeMatchBackground:"#d19a66",activeMatchBorder:"#d19a66",activeMatchColorOverviewRuler:"#d19a66"};function nb(X,ne,Ne){if(!re)return;if(!X){re.clearDecorations(),Qe.value=-1,We.value=0;return}const pt={incremental:Ne,decorations:tb};ne==="next"?re.findNext(X,pt):re.findPrevious(X,pt)}function sb(){fe.value=!1,re==null||re.clearDecorations(),Qe.value=-1,We.value=0,gt()}yt(()=>n.searchRequestSeq,()=>{n.focused&&(fe.value=!0,De.value++)});function Rh(){if(ue){if(ae){ae.attach();return}ae=Ru(new Gg(n.endpoint,n.sessionId,{onOutput:X=>ue==null?void 0:ue.write(X),onClose:X=>{ue==null||ue.write(`\r +\x1B[33m${i("terminal.sessionEndedBanner",{exitCode:X.exit_code})}\x1B[0m\r +`)},onStatus:X=>{d.value=X,X!=="attached"&&V.value.length&&Pn()},onReplayProgress:X=>{r.value=X.phase==="end"?null:X,X.phase==="start"||X.phase==="chunk"?x.onProgress(X.phase):x.onProgress("end",ne=>Zy(ne))},onMeta:X=>{typeof(X==null?void 0:X.cols)=="number"&&(S.value=X.cols),typeof(X==null?void 0:X.rows)=="number"&&(k.value=X.rows),Ui()},onDriverChange:(X,ne,Ne)=>{const pt=f.value;f.value=ne,M.value=ne?"":Ne,pr(),Ui(),ne&&(n.active||n.focused)&&cn(pi),!ne&&(n.active||n.focused)&&cn(()=>{var Et;return(Et=_.value)==null?void 0:Et.focus()}),!ne&&V.value.length&&Pn(),pt!==ne&&s("toast",i(ne?"terminal.driverNow":"terminal.viewerNow"))}},{clientName:w.value,remote:!n.isLocalSession})),ae.attach(),Ge==null||Ge.set(n.sessionId,ae),_e=X=>ae==null?void 0:ae.sendInput(X),Re==null||Re.set(n.sessionId,_e),ue&&(n.expectedCols!==ue.cols||n.expectedRows!==ue.rows)&&(ae.sendResize(ue.cols,ue.rows),P.value={cols:ue.cols,rows:ue.rows})}}const{templates:ib,templatesHidden:Th,pendingTemplateConfirm:Ph,templateConfirmOpen:Eh,requestTemplateSend:Lh,cancelTemplateSend:Dc,confirmTemplateSend:Dh,onTemplateHotkey:Mh,onTemplateBarWheel:Wa,reload:rb}=hT({send:X=>ae==null?void 0:ae.sendInput(X),confirmRequired:j(()=>!(W.caps.wailsBindings||W.caps.localPty)),focused:()=>n.focused,templatesBridge:W.templates});function ob(X,ne){le(ne)&&Tn.value&&(ae==null||ae.sendInput(X),A.value&>())}function ab(X,ne){hs(ne,()=>{Tn.value&&(ft=Date.now(),ae==null||ae.sendInput(X),A.value&>())})}async function Ah(){var X,ne;if(Tn.value){h.value="",l.value=!0;try{h.value=await(((ne=(X=navigator.clipboard)==null?void 0:X.readText)==null?void 0:ne.call(X))??Promise.resolve(""))}catch{h.value=""}}}function Mc(){l.value=!1,h.value=""}function Ih(){!Tn.value||!h.value||(ae==null||ae.sendInput(h.value),Mc())}function $h(){var X;bn.value&&(y.value&&(y.value.value=""),(X=y.value)==null||X.click())}async function lb(X){var Et;if(!bn.value)return;const ne=X.currentTarget,Ne=(Et=ne==null?void 0:ne.files)==null?void 0:Et[0];if(!Ne)return;const pt=Ne.name||"file";try{await(ae==null?void 0:ae.sendPasteFile(Ne,pt)),Gd.emit(pt,Ne.size)}catch(Ke){Lt("term","failed to send picked file",{error:Rt(Ke)}),s("toast",(Ke==null?void 0:Ke.message)??i("terminal.pasteFailed"))}finally{ne&&(ne.value="")}}function Oh(){var X;if(bn.value){if(W.caps.capacitor){db();return}v.value&&(v.value.value=""),(X=v.value)==null||X.click()}}function cb(X,ne,Ne){const pt=atob(X),Et=new Uint8Array(pt.length);for(let Ke=0;Ke{var X;if(Ye(),window.addEventListener("atterm:open-service-preview",Fh),await eb(),!!be){try{const ne=await cm();ne!=null&&ne.host&&(w.value=ne.host)}catch{}be&&(n.active&&Rh(),ja(),zo=W.events.on("quickTemplates:changed",ja),Uo=W.events.on("mobile:shortcutsChanged",ja),Vo=W.events.on("prefs:changed",ja),(X=W.servicePreview)!=null&&X.rebind&&(oe=W.events.on("service-preview:pipe-dead",ne=>{const Ne=ne;!Ne||!Ne.gateway_id||!V.value.some(pt=>pt.id===Ne.gateway_id)||pn(Ne.gateway_id,typeof Ne.mapping_index=="number"?Ne.mapping_index:0)})),document.addEventListener("mousedown",Bo),document.addEventListener("pointerdown",Oo,{capture:!0}),document.addEventListener("keydown",Ha),document.addEventListener("keydown",Mh,!0),requestAnimationFrame(()=>{be&&(js(),requestAnimationFrame(()=>{be&&Ho()}))}))}}),Vt(()=>{be=!1,Pn(),wt==null||wt.disconnect(),wt=null,gi(),R.value=!1,Cs(),zt=null,zo==null||zo(),zo=null,Uo==null||Uo(),Uo=null,Vo==null||Vo(),Vo=null,oe==null||oe(),oe=null,hp(n.sessionId,!1),document.removeEventListener("mousedown",Bo),document.removeEventListener("pointerdown",Oo,{capture:!0}),document.removeEventListener("keydown",Ha),document.removeEventListener("keydown",Mh,!0),window.removeEventListener("atterm:open-service-preview",Fh),de==null||de.removeEventListener("keydown",Te,{capture:!0}),de==null||de.removeEventListener("keydown",Wt,{capture:!0}),document.removeEventListener("keydown",ge,{capture:!0}),de==null||de.removeEventListener("paste",qn,{capture:!0}),de==null||de.removeEventListener("pointermove",Ia),de==null||de.removeEventListener("pointerup",$a),de==null||de.removeEventListener("pointercancel",Oa),de==null||de.removeEventListener("touchmove",gr),de=null,Ae==null||Ae.removeEventListener("touchmove",ti),Ae==null||Ae.removeEventListener("scroll",Fa),Ae==null||Ae.removeEventListener("wheel",Fi),Ae=null,Le==null||Le.removeEventListener("input",Yn,{capture:!0}),Le==null||Le.removeEventListener("focus",As),Le==null||Le.removeEventListener("blur",_r),Le=null,(Re==null?void 0:Re.get(n.sessionId))===_e&&(Re==null||Re.delete(n.sessionId)),_e=null,(Ge==null?void 0:Ge.get(n.sessionId))===ae&&(Ge==null||Ge.delete(n.sessionId)),Me==null||Me.dispose(),Me=null,Ws(),tt==null||tt.dispose(),tt=null,ae==null||ae.detach(),ae=null;try{ue==null||ue.dispose()}catch(X){Js("term","xterm dispose race (safe to ignore)",{error:Rt(X)})}ue=null,et=null}),yt(()=>n.active,X=>{X?(ae?ae.attach():Rh(),cn(()=>{pi(),requestAnimationFrame(()=>{!be||!n.active||Ho()})})):(ae==null||ae.suspend(),Jn())}),yt(()=>n.remotePermission,()=>{Rr(n.remotePermission)!=="full"&&V.value.length&&Pn()}),yt(()=>n.focused,X=>{X&&cn(()=>{pi()})}),yt(()=>n.theme,X=>{ue&&(ue.options.theme=X)}),yt(()=>n.appearance,X=>No(X)),yt(d,X=>{X!=="attached"&&Jn()}),yt(()=>n.resizeSuspended,(X,ne)=>{ne&&!X&&cn(()=>{ue&&ae&&(ae.sendResize(ue.cols,ue.rows),P.value={cols:ue.cols,rows:ue.rows})})}),(X,ne)=>{var Ne,pt,Et;return $(),F("div",{class:lt(["term-view",{focused:X.focused}])},[it(b("div",{ref_key:"termContainer",ref:a,class:"term",style:nn({bottom:ke.value}),onContextmenu:ut(Kr,["prevent"]),onMouseupCapture:Se,onTouchstartCapture:Rc,onPointerdownCapture:Da,onMousedownCapture:Ma},null,36),[[ms,!G.value]]),($(!0),F(Oe,null,at(V.value,Ke=>it(($(),F("iframe",{key:Ke.id,class:"service-preview-frame",src:Ke.url,title:C(i)("terminal.preview.frameTitle",{port:Ke.port}),sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-downloads",allow:"clipboard-read; clipboard-write"},null,8,GT)),[[ms,q.value===Ke.id]])),128)),(Ne=te.value)!=null&&Ne.reconnecting?($(),F("div",XT,[ne[26]||(ne[26]=b("span",{class:"service-preview-reconnecting-spinner","aria-hidden":"true"},null,-1)),b("span",null,L(C(i)("terminal.preview.reconnecting")),1)])):Z("",!0),V.value.length||ie.value?($(),bt(Sl,{key:1,to:Fe.value},[b("div",JT,[V.value.length?($(),bt(IT,{key:0,previews:V.value,"active-id":q.value,onShowTerminal:Ss,onSelect:fi,onClose:Nt,onAdd:is,onOpenBrowser:ei,onCopy:Oi},null,8,["previews","active-id"])):Z("",!0),ie.value&&fn.value?($(),F("form",{key:1,class:lt(["service-preview-port-form",{"as-popover":V.value.length>0}]),onSubmit:ut(Ks,["prevent"])},[Pe(ts,{class:"service-preview-host","model-value":J.value,options:Q,"aria-label":C(i)("terminal.preview.targetHost"),"onUpdate:modelValue":Vs},null,8,["model-value","aria-label"]),b("div",QT,[it(b("input",{ref_key:"previewPortInput",ref:ce,"onUpdate:modelValue":ne[0]||(ne[0]=Ke=>ye.value=Ke),"data-testid":"service-preview-port",type:"text",inputmode:"numeric",pattern:"[0-9]*","aria-label":C(i)("terminal.preview.portPrompt"),onKeydown:Xn(ut(us,["prevent","stop"]),["esc"])},null,40,ZT),[[Pt,ye.value]]),ne[27]||(ne[27]=b("span",{class:"service-preview-path"},"/",-1))]),($(!0),F(Oe,null,at(K.value,(Ke,vt)=>($(),F("div",{key:vt,class:"service-preview-mapping-row"},[it(b("input",{"onUpdate:modelValue":st=>Ke.port=st,type:"text",inputmode:"numeric",pattern:"[0-9]*","aria-label":C(i)("terminal.preview.additionalPort")},null,8,e5),[[Pt,Ke.port]]),it(b("input",{"onUpdate:modelValue":st=>Ke.pathPrefix=st,type:"text",placeholder:"/api","aria-label":C(i)("terminal.preview.pathPrefix")},null,8,t5),[[Pt,Ke.pathPrefix]]),b("button",{type:"button",class:"preview-action",title:C(i)("terminal.preview.removeMapping"),"aria-label":C(i)("terminal.preview.removeMapping"),onClick:st=>K.value.splice(vt,1)},"×",8,n5)]))),128)),b("div",s5,[ss.value&&K.value.length<7?($(),F("button",{key:0,type:"button",class:"preview-add-mapping",onClick:ne[1]||(ne[1]=Ke=>K.value.push({port:"",pathPrefix:"/api"}))},"+ "+L(C(i)("terminal.preview.addMapping")),1)):Z("",!0),ne[28]||(ne[28]=b("span",{class:"service-preview-form-spacer"},null,-1)),b("button",{type:"submit",disabled:N.value},L(N.value?C(i)("terminal.preview.opening"):C(i)("terminal.preview.open")),9,i5),b("button",{type:"button",disabled:N.value,onClick:us},L(C(i)("common.cancel")),9,r5)])],34)):Z("",!0)])],8,["to"])):Z("",!0),Pe(NT,{visible:U.value.visible,x:U.value.x,y:U.value.y,"arrow-dir":U.value.arrowDir,copying:U.value.copying,sending:U.value.sending,onCopy:Lc,onSend:Fo,onCancel:Ws},null,8,["visible","x","y","arrow-dir","copying","sending"]),X.active&&(d.value!=="attached"||r.value)?($(),F("div",{key:2,class:lt(["overlay",{"avoid-top-right-badge":X.avoidTopRightBadge}])},[r.value?($(),F(Oe,{key:0},[b("span",null,L(C(nR)(r.value)),1),b("div",o5,[b("div",{class:"progress-fill",style:nn({width:`${C(qm)(r.value)}%`})},null,4)])],64)):d.value==="connecting"?($(),F("span",a5,L(C(i)("terminal.connecting")),1)):d.value==="reconnecting"?($(),F("span",l5,L(C(i)("terminal.reconnecting")),1)):d.value==="ended"?($(),F("span",c5,L(C(i)("terminal.ended")),1)):d.value==="error"?($(),F("span",d5,L(C(i)("terminal.connectionError")),1)):Z("",!0)],2)):Z("",!0),Pe(YT,{open:fe.value,"focus-seq":De.value,"result-index":Qe.value,"result-count":We.value,onFind:nb,onClose:sb},null,8,["open","focus-seq","result-index","result-count"]),f.value?Z("",!0):($(),F("div",u5,[b("div",h5,[b("div",f5,L(C(i)("terminal.remoteHasTakenControl")),1),M.value?($(),F("div",p5,L(C(i)("terminal.byHost",{host:M.value})),1)):Z("",!0),b("div",v5,L(C(i)("terminal.pressSpaceToTakeBack")),1),b("button",{ref_key:"takeControlBtnRef",ref:_,class:"viewer-overlay-btn","data-testid":"take-control",onClick:pe},L(C(i)("terminal.takeControl")),513)])])),($(),bt(Sl,{to:"body"},[o.value?($(),F("div",{key:0,ref_key:"menuRef",ref:m,class:"term-context-menu",style:nn({left:`${c.value}px`,top:`${p.value}px`}),onMousedown:ne[3]||(ne[3]=ut(()=>{},["stop"])),onClick:ne[4]||(ne[4]=ut(()=>{},["stop"]))},[Je.value?($(),F("button",{key:0,class:"term-context-item",onClick:ee},L(C(i)("terminal.contextMenu.openLink")),1)):Z("",!0),Je.value?($(),F("button",{key:1,class:"term-context-item",onClick:_t},L(C(i)("terminal.contextMenu.copyLink")),1)):Z("",!0),b("button",{class:"term-context-item",disabled:!u.value,onClick:Bt},L(C(i)("common.copy")),9,g5),b("button",{class:"term-context-item",disabled:!Zt.value||g.value,onClick:tn},L(C(i)("common.paste")),9,m5),b("button",{class:"term-context-item",disabled:!on.value,onClick:Ua},L(C(i)("terminal.sendSelection")),9,_5),b("button",{class:"term-context-item",onClick:Va},L(C(i)("terminal.clearBuffer")),1),b("button",{class:"term-context-item",disabled:!Ot.value,onClick:Ka},L(C(i)("terminal.resize")),9,y5),X.canDetach?($(),F("button",{key:2,class:"term-context-item","data-test":"term-detach",onClick:ne[2]||(ne[2]=Ke=>{s("detach"),Jn()})},L(C(i)("terminal.detachToTab")),1)):Z("",!0),($(!0),F(Oe,null,at(kt.value,Ke=>($(),F("button",{key:Ke.id,class:"term-context-item",disabled:Ke.disabled,onClick:vt=>{Ke.onClick(),Jn()}},L(Ke.label),9,b5))),128))],36)):Z("",!0)])),!C(Th)&&!G.value?($(),F("div",{key:4,class:"template-bar","data-testid":"template-bar",style:nn({bottom:nt.value}),onPointerdownCapture:En,onWheelPassive:ne[5]||(ne[5]=(...Ke)=>C(Wa)&&C(Wa)(...Ke))},[($(!0),F(Oe,null,at(C(ib),Ke=>($(),F("button",{key:Ke.id,class:"template-btn","data-testid":`template-btn-${Ke.id}`,title:Ke.hotkey||"",tabindex:"-1",onTouchstart:Wn,onTouchmove:jn,onTouchcancel:zn,onTouchend:vt=>hs(vt,()=>C(Lh)(Ke)),onPointerdown:En,onClick:vt=>Rs(()=>C(Lh)(Ke))},L(Ke.label),41,w5))),128))],36)):Z("",!0),Hn.value&&!G.value?($(),F("div",{key:5,class:"aux-key-bar","data-testid":"terminal-aux-key-bar",onPointerdownCapture:En},[b("input",{ref_key:"filePicker",ref:y,class:"file-picker-input","data-testid":"terminal-file-input",type:"file",onChange:lb},null,544),b("input",{ref_key:"imagePicker",ref:v,class:"file-picker-input","data-testid":"terminal-image-input",type:"file",accept:"image/*",onChange:ub},null,544),b("button",{type:"button",class:"aux-key-btn keyboard-toggle-btn","data-testid":"terminal-hide-keyboard",tabindex:"-1",title:I.value?"Show keyboard":"Hide keyboard",onTouchstart:ut(xs,["prevent","stop"]),onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[6]||(ne[6]=ut(Ke=>hs(Ke,Hi),["stop"])),onPointerdown:ut(En,["stop"]),onClick:ne[7]||(ne[7]=ut(Ke=>Rs(Hi),["prevent","stop"]))},L(I.value?"打开键盘 ⌃":"折叠键盘 ⌄"),41,S5),b("div",{class:"aux-key-scroll","data-testid":"terminal-aux-key-scroll",onWheelPassive:ne[14]||(ne[14]=(...Ke)=>C(Wa)&&C(Wa)(...Ke))},[($(!0),F(Oe,null,at(T.value,Ke=>($(),F("button",{key:Ke.id,type:"button",class:"aux-key-btn","data-testid":`terminal-aux-key-${Ke.id}`,disabled:!Tn.value,tabindex:"-1",onTouchstart:ut(xs,["prevent"]),onTouchmove:jn,onTouchcancel:zn,onTouchend:vt=>ab(Ke.seq,vt),onPointerdown:Ur,onPointermove:$o,onPointercancel:zi,onPointerup:vt=>ob(Ke.seq,vt)},L(Ke.label),41,C5))),128)),b("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-pick-image",disabled:!bn.value,onTouchstart:ut(xs,["prevent"]),onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[8]||(ne[8]=Ke=>hs(Ke,Oh)),onPointerdown:En,onClick:ne[9]||(ne[9]=Ke=>Rs(Oh))},L(C(i)("terminal.pickImage")),41,k5),b("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-paste-confirm-open",disabled:!Tn.value,onTouchstart:ut(xs,["prevent"]),onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[10]||(ne[10]=Ke=>hs(Ke,Ah)),onPointerdown:En,onClick:ne[11]||(ne[11]=Ke=>Rs(Ah))},L(C(i)("mobile.pasteClipboard")),41,x5),b("button",{type:"button",class:"aux-key-btn","data-testid":"terminal-pick-file",disabled:!bn.value,onTouchstart:ut(xs,["prevent"]),onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[12]||(ne[12]=Ke=>hs(Ke,$h)),onPointerdown:En,onClick:ne[13]||(ne[13]=Ke=>Rs($h))},L(C(i)("terminal.pickFile")),41,R5)],32)],32)):Z("",!0),C(Eh)?($(),F("div",{key:6,class:"template-confirm-panel","data-testid":"template-confirm-panel",onPointerdownCapture:En,onClick:ne[19]||(ne[19]=ut(()=>{},["stop"]))},[b("div",T5,[b("div",P5,L((pt=C(Ph))==null?void 0:pt.label),1),b("div",E5,L((Et=C(Ph))==null?void 0:Et.text),1)]),b("button",{type:"button",class:"template-confirm-btn","data-testid":"template-confirm-cancel",tabindex:"-1",onTouchstart:Wn,onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[15]||(ne[15]=Ke=>hs(Ke,C(Dc))),onPointerdown:En,onClick:ne[16]||(ne[16]=Ke=>Rs(C(Dc)))},L(C(i)("common.cancel")),33),b("button",{type:"button",class:"template-confirm-btn primary","data-testid":"template-confirm-send",tabindex:"-1",onTouchstart:Wn,onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[17]||(ne[17]=Ke=>hs(Ke,C(Dh))),onPointerdown:En,onClick:ne[18]||(ne[18]=Ke=>Rs(C(Dh)))},"发送",32)],32)):Z("",!0),l.value?($(),F("div",{key:7,class:"paste-confirm-panel","data-testid":"terminal-paste-confirm-panel",onPointerdownCapture:En,onClick:ne[25]||(ne[25]=ut(()=>{},["stop"]))},[it(b("textarea",{"onUpdate:modelValue":ne[20]||(ne[20]=Ke=>h.value=Ke),class:"paste-confirm-input",placeholder:C(i)("mobile.pastePreview"),rows:"2"},null,8,L5),[[Pt,h.value]]),b("button",{type:"button",class:"paste-confirm-btn","data-testid":"terminal-paste-cancel",tabindex:"-1",onTouchstart:Wn,onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[21]||(ne[21]=Ke=>hs(Ke,Mc)),onPointerdown:En,onClick:ne[22]||(ne[22]=Ke=>Rs(Mc))},L(C(i)("common.cancel")),33),b("button",{type:"button",class:"paste-confirm-btn primary","data-testid":"terminal-paste-confirm",disabled:!Tn.value||!h.value,tabindex:"-1",onTouchstart:Wn,onTouchmove:jn,onTouchcancel:zn,onTouchend:ne[23]||(ne[23]=Ke=>hs(Ke,Ih)),onPointerdown:En,onClick:ne[24]||(ne[24]=Ke=>Rs(Ih))},L(C(i)("mobile.pasteConfirm")),41,D5)],32)):Z("",!0)],2)}}}),U5=Ct(z5,[["__scopeId","data-v-acf7d666"]]),Ju={single:1,vertical:2,horizontal:2,grid2x2:4},V5=Object.freeze({sessionId:null,remote:!1}),mp=.1,_p=.9,Ts=.5;function Fl(e){return Number.isFinite(e)?e_p?_p:e:Ts}const Tr=()=>({...V5});function yp(e,t,n,s,i,a){if(e==="single")return{layout:s==="vertical"?"vertical":"horizontal",panes:[{...t[0]},Tr()],activePaneIdx:1,newPaneIdx:1,colRatio:i,rowRatio:a};if(e==="vertical"){const r=n===0?2:3;return{layout:"grid2x2",panes:[{...t[0]},{...t[1]},Tr(),Tr()],activePaneIdx:r,newPaneIdx:r,colRatio:i,rowRatio:a}}if(e==="horizontal"){const r=n===0?1:3;return{layout:"grid2x2",panes:[{...t[0]},Tr(),{...t[1]},Tr()],activePaneIdx:r,newPaneIdx:r,colRatio:i,rowRatio:a}}const d=t.findIndex(r=>r.sessionId===null);return d===-1?{layout:"grid2x2",panes:t.map(r=>({...r})),activePaneIdx:n,newPaneIdx:-1,noop:!0,colRatio:i,rowRatio:a}:{layout:"grid2x2",panes:t.map(r=>({...r})),activePaneIdx:d,newPaneIdx:d,colRatio:i,rowRatio:a}}function K5(e,t,n,s,i){if(e==="single")return{layout:"single",panes:t.map(o=>({...o})),activePaneIdx:0,closeTab:!0,colRatio:s,rowRatio:i};if(e==="vertical"||e==="horizontal")return{layout:"single",panes:[{...t[n===0?1:0]}],activePaneIdx:0,colRatio:s,rowRatio:i};const a=t.map((o,c)=>c===n?Tr():{...o}),d=a.map((o,c)=>o.sessionId!==null?c:-1).filter(o=>o>=0),r=d.length;return r>=3?{layout:"grid2x2",panes:a,activePaneIdx:d[0],colRatio:s,rowRatio:i}:r===2?W5(a,d,s,i):r===1?{layout:"single",panes:[{...a[d[0]]}],activePaneIdx:0,colRatio:s,rowRatio:i}:{layout:"single",panes:[Tr()],activePaneIdx:0,closeTab:!0,colRatio:s,rowRatio:i}}function W5(e,t,n,s){const[i,a]=t;return{layout:i===0&&a===2||i===1&&a===3?"horizontal":"vertical",panes:[{...e[i]},{...e[a]}],activePaneIdx:0,colRatio:n,rowRatio:s}}const j5={single:{0:{}},vertical:{0:{right:1},1:{left:0}},horizontal:{0:{down:1},1:{up:0}},grid2x2:{0:{right:1,down:2},1:{left:0,down:3},2:{up:0,right:3},3:{up:1,left:2}}};function q5(e,t,n){var i,a;const s=(a=(i=j5[e])==null?void 0:i[t])==null?void 0:a[n];return typeof s=="number"?s:null}function Cr(e,t){for(const n of e){const s=n.panes.findIndex(i=>i.sessionId===t);if(s>=0)return{tabId:n.id,paneIdx:s}}return null}const Y5=["aria-orientation"],G5=$e({__name:"PaneSplitter",props:{orientation:{},ratio:{},containerRect:{type:Function}},emits:["update:ratio","commit","reset"],setup(e,{emit:t}){const n=e,s=t,i=H(null);let a=null,d=0,r=0,o="";function c(y){if(y.button!==0)return;const v=i.value;if(v){a=y.pointerId,r=n.ratio,d=n.orientation==="col"?y.clientX:y.clientY;try{v.setPointerCapture(y.pointerId)}catch{}typeof document<"u"&&(o=document.body.style.cursor,document.body.style.cursor=n.orientation==="col"?"col-resize":"row-resize"),y.preventDefault()}}function p(y){if(a!==y.pointerId)return;const v=n.containerRect();if(!v)return;const l=n.orientation==="col"?v.width:v.height;if(l<=0)return;const f=((n.orientation==="col"?y.clientX:y.clientY)-d)/l;s("update:ratio",Fl(r+f))}function u(y){if(a!==y.pointerId)return;const v=i.value;try{v==null||v.releasePointerCapture(y.pointerId)}catch{}a=null,typeof document<"u"&&(document.body.style.cursor=o,o=""),s("commit")}function g(){s("reset")}Vt(()=>{if(a!==null&&i.value){try{i.value.releasePointerCapture(a)}catch{}typeof document<"u"&&(document.body.style.cursor=o)}});const m=j(()=>{const y=Fl(n.ratio)*100;return n.orientation==="col"?{left:`calc(${y}% - 3px)`}:{top:`calc(${y}% - 3px)`}});return(y,v)=>($(),F("div",{ref_key:"rootEl",ref:i,class:lt(["pane-splitter",y.orientation]),style:nn(m.value),role:"separator","aria-orientation":y.orientation==="col"?"vertical":"horizontal",onPointerdown:c,onPointermove:p,onPointerup:u,onPointercancel:u,onDblclick:g},null,46,Y5))}}),bp=Ct(G5,[["__scopeId","data-v-442ddd17"]]),X5=["onMousedown","onDragover","onDragleave","onDrop"],J5={class:"term-host"},Q5={key:1,class:"empty"},Z5={class:"cell-controls"},eP=["title"],tP=["id"],nP=["title"],sP=["title","aria-label","onClick"],iP={key:1,class:"who"},rP={key:2,class:"who dim"},oP={class:"sid"},aP=["title","onDragstart"],lP=["title","onClick"],cP=$e({__name:"PaneGrid",props:{tab:{},endpointFor:{type:Function},sessionInfoFor:{type:Function},viewerCountFor:{type:Function},active:{type:Boolean},terminalTheme:{},commandNotifyThresholdSec:{},searchRequestSeq:{},appearance:{},servicePreviewAvailable:{type:Boolean}},emits:["set-active-pane","close-pane","drop-session","detach-session","toast","update:col-ratio","update:row-ratio"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=fT();yt(a,async()=>{var I;await cn(),(I=o.value)==null||I.querySelectorAll(".cell-controls").forEach(O=>{const U=O.style.display;O.style.display="none",O.offsetHeight,O.style.display=U})});const d={single:["a"],vertical:["a","b"],horizontal:["a","b"],grid2x2:["a","b","c","d"]},r=j(()=>d[n.tab.layout]),o=H(null),c=H(!1),p=H(null);function u(I,O){var U;Ll((U=I.dataTransfer)==null?void 0:U.types)&&(I.preventDefault(),I.dataTransfer&&(I.dataTransfer.dropEffect="move"),p.value=O)}function g(I,O){const U=I.relatedTarget;U&&I.currentTarget instanceof Node&&I.currentTarget.contains(U)||p.value===O&&(p.value=null)}function m(I,O){var W,z;if(p.value=null,!Ll((W=I.dataTransfer)==null?void 0:W.types))return;I.preventDefault();const U=Am()||(((z=I.dataTransfer)==null?void 0:z.getData(pa))??"");U&&s("drop-session",{paneIdx:O,sessionId:U})}function y(I,O){O.sessionId&&(Mm(O.sessionId),I.dataTransfer&&(I.dataTransfer.setData(pa,O.sessionId),I.dataTransfer.effectAllowed="move"))}function v(){no()}function l(){var I;return((I=o.value)==null?void 0:I.getBoundingClientRect())??null}const h=j(()=>{const I=Fl(n.tab.colRatio),O=Fl(n.tab.rowRatio),U=I.toFixed(4),W=(1-I).toFixed(4),z=O.toFixed(4),N=(1-O).toFixed(4);switch(n.tab.layout){case"single":return{};case"vertical":return{gridTemplate:`"a b" / ${U}fr ${W}fr`};case"horizontal":return{gridTemplate:`"a" ${z}fr "b" ${N}fr / 1fr`};case"grid2x2":return{gridTemplate:`"a b" ${z}fr "c d" ${N}fr / ${U}fr ${W}fr`}}return{}}),f=j(()=>n.tab.layout==="vertical"||n.tab.layout==="grid2x2"),_=j(()=>n.tab.layout==="horizontal"||n.tab.layout==="grid2x2");function S(I){s("update:col-ratio",I)}function k(I){s("update:row-ratio",I)}function P(){s("update:col-ratio",Ts)}function M(){s("update:row-ratio",Ts)}function w(){c.value=!0}function T(){c.value=!1}function A(I){I!==n.tab.activePaneIdx&&s("set-active-pane",I)}function E(I,O){return I.sessionId??`empty-${O}`}function R(I){if(!I)return"";const O=I.user||"",U=I.host||"";return O&&U?`${O}@${U}`:U||O||""}function D(I){I.sessionId&&window.dispatchEvent(new CustomEvent("atterm:open-service-preview",{detail:{sessionId:I.sessionId}}))}return(I,O)=>($(),F("div",{ref_key:"gridRoot",ref:o,class:lt(["pane-grid",I.tab.layout]),style:nn(h.value)},[($(!0),F(Oe,null,at(I.tab.panes,(U,W)=>{var z,N,V,q,G,te;return $(),F("div",{key:E(U,W),class:lt(["cell",{"drop-target":p.value===W}]),style:nn({gridArea:r.value[W]}),"data-test":"pane-cell",onMousedown:oe=>A(W),onDragover:oe=>u(oe,W),onDragleave:oe=>g(oe,W),onDrop:oe=>m(oe,W)},[b("div",J5,[U.sessionId&&I.endpointFor(U)?($(),bt(U5,{key:0,endpoint:I.endpointFor(U),"session-id":U.sessionId,active:I.active,focused:I.active&&W===I.tab.activePaneIdx,"expected-cols":(z=I.sessionInfoFor(U))==null?void 0:z.cols,"expected-rows":(N=I.sessionInfoFor(U))==null?void 0:N.rows,"remote-permission":(V=I.sessionInfoFor(U))==null?void 0:V.remote_permission,"session-label":C(dR)(I.sessionInfoFor(U)),"avoid-top-right-badge":U.remote||(((q=I.viewerCountFor)==null?void 0:q.call(I,U.sessionId))??0)>0,theme:I.terminalTheme,"is-local-session":!U.remote,"command-notify-threshold-sec":I.commandNotifyThresholdSec,"resize-suspended":c.value,"search-request-seq":I.searchRequestSeq,"can-detach":I.tab.layout!=="single",appearance:I.appearance,onToast:O[0]||(O[0]=oe=>s("toast",oe)),onDetach:oe=>U.sessionId&&s("detach-session",U.sessionId)},null,8,["endpoint","session-id","active","focused","expected-cols","expected-rows","remote-permission","session-label","avoid-top-right-badge","theme","is-local-session","command-notify-threshold-sec","resize-suspended","search-request-seq","can-detach","appearance","onDetach"])):($(),F("div",Q5,L(C(i)("terminal.emptyPaneHint")),1))]),b("div",Z5,[U.sessionId&&!U.remote&&(((G=I.viewerCountFor)==null?void 0:G.call(I,U.sessionId))??0)>0?($(),F("div",{key:0,class:"viewers-badge",title:C(i)("terminal.remoteViewerWatching",{count:I.viewerCountFor(U.sessionId)})},[O[4]||(O[4]=b("svg",{xmlns:"http://www.w3.org/2000/svg",width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2.2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},[b("path",{d:"M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7Z"}),b("circle",{cx:"12",cy:"12",r:"3"})],-1)),b("span",null,L(I.viewerCountFor(U.sessionId)),1)],8,eP)):Z("",!0),U.sessionId&&U.remote&&I.servicePreviewAvailable?($(),F("span",{key:1,class:"service-preview-controls-slot",id:`service-preview-controls-${U.sessionId}`,"aria-live":"polite"},null,8,tP)):Z("",!0),U.sessionId&&U.remote?($(),F("div",{key:2,class:"remote-badge",title:((te=I.sessionInfoFor(U))!=null&&te.host_id?C(i)("sessions.hostIdTitle",{hostId:I.sessionInfoFor(U).host_id??""})+` +`:"")+C(i)("sessions.sessionTitle",{sessionId:U.sessionId})},[I.servicePreviewAvailable?($(),F("button",{key:0,type:"button",class:"remote-preview-trigger","data-testid":"remote-preview-trigger",title:C(i)("terminal.preview.open"),"aria-label":C(i)("terminal.preview.open"),onMousedown:O[1]||(O[1]=ut(()=>{},["stop"])),onClick:ut(oe=>D(U),["stop"])},O[5]||(O[5]=[_b('',1)]),40,sP)):Z("",!0),R(I.sessionInfoFor(U))?($(),F("span",iP,L(R(I.sessionInfoFor(U))),1)):($(),F("span",rP,L(C(i)("terminal.remote")),1)),b("span",oP,L(U.sessionId.slice(0,8)),1)],8,nP)):Z("",!0),U.sessionId&&I.tab.layout!=="single"?($(),F("span",{key:3,class:"pane-grip","data-test":"pane-grip",draggable:"true",title:C(i)("terminal.dragPaneOut"),onMousedown:O[2]||(O[2]=ut(()=>{},["stop"])),onDragstart:oe=>y(oe,U),onDragend:v},"⠿",40,aP)):Z("",!0),I.tab.layout!=="single"?($(),F("button",{key:4,type:"button",class:"close-pane",title:C(i)("terminal.closePaneTitle"),onMousedown:O[3]||(O[3]=ut(()=>{},["stop"])),onClick:ut(oe=>s("close-pane",W),["stop"])},"×",40,lP)):Z("",!0)])],46,X5)}),128)),f.value?($(),bt(bp,{key:0,orientation:"col",ratio:I.tab.colRatio,"container-rect":l,onPointerdown:w,"onUpdate:ratio":S,onCommit:T,onReset:P},null,8,["ratio"])):Z("",!0),_.value?($(),bt(bp,{key:1,orientation:"row",ratio:I.tab.rowRatio,"container-rect":l,onPointerdown:w,"onUpdate:ratio":k,onCommit:T,onReset:M},null,8,["ratio"])):Z("",!0)],6))}}),dP=Ct(cP,[["__scopeId","data-v-76c1e407"]]);let Bl=[];const s_=new WeakMap;function uP(){Bl.forEach(e=>e(...s_.get(e))),Bl=[]}function Hl(e,...t){s_.set(e,t),!Bl.includes(e)&&Bl.push(e)===1&&requestAnimationFrame(uP)}function ws(e,t){let{target:n}=e;for(;n;){if(n.dataset&&n.dataset[t]!==void 0)return!0;n=n.parentElement}return!1}function hP(e){const t=H(!!e.value);if(t.value)return Ld(t);const n=yt(e,s=>{s&&(t.value=!0,n())});return Ld(t)}function fP(){return ng()!==null}const pP=typeof window<"u";let ho,la;const vP=()=>{var e,t;ho=pP?(t=(e=document)===null||e===void 0?void 0:e.fonts)===null||t===void 0?void 0:t.ready:void 0,la=!1,ho!==void 0?ho.then(()=>{la=!0}):la=!0};vP();function gP(e){if(la)return;let t=!1;Dt(()=>{la||ho==null||ho.then(()=>{t||e()})}),Vt(()=>{t=!0})}function Qu(e,t){return j(()=>{for(const n of t)if(e[n]!==void 0)return e[n];return e[t[t.length-1]]})}function Zu(e={},t){const n=na({ctrl:!1,command:!1,win:!1,shift:!1,tab:!1}),{keydown:s,keyup:i}=e,a=o=>{switch(o.key){case"Control":n.ctrl=!0;break;case"Meta":n.command=!0,n.win=!0;break;case"Shift":n.shift=!0;break;case"Tab":n.tab=!0;break}s!==void 0&&Object.keys(s).forEach(c=>{if(c!==o.key)return;const p=s[c];if(typeof p=="function")p(o);else{const{stop:u=!1,prevent:g=!1}=p;u&&o.stopPropagation(),g&&o.preventDefault(),p.handler(o)}})},d=o=>{switch(o.key){case"Control":n.ctrl=!1;break;case"Meta":n.command=!1,n.win=!1;break;case"Shift":n.shift=!1;break;case"Tab":n.tab=!1;break}i!==void 0&&Object.keys(i).forEach(c=>{if(c!==o.key)return;const p=i[c];if(typeof p=="function")p(o);else{const{stop:u=!1,prevent:g=!1}=p;u&&o.stopPropagation(),g&&o.preventDefault(),p.handler(o)}})},r=()=>{(t===void 0||t.value)&&(Kn("keydown",document,a),Kn("keyup",document,d)),t!==void 0&&yt(t,o=>{o?(Kn("keydown",document,a),Kn("keyup",document,d)):(Fn("keydown",document,a),Fn("keyup",document,d))})};return fP()?(yb(r),Vt(()=>{(t===void 0||t.value)&&(Fn("keydown",document,a),Fn("keyup",document,d))})):r(),Ld(n)}const eh=ds("n-internal-select-menu"),i_=ds("n-internal-select-menu-body"),th=ds("n-drawer-body"),nh=ds("n-modal-body"),fc=ds("n-popover-body"),r_="__disabled__";function cs(e){const t=Ut(nh,null),n=Ut(th,null),s=Ut(fc,null),i=Ut(i_,null),a=H();if(typeof document<"u"){a.value=document.fullscreenElement;const d=()=>{a.value=document.fullscreenElement};Dt(()=>{Kn("fullscreenchange",document,d)}),Vt(()=>{Fn("fullscreenchange",document,d)})}return en(()=>{var d;const{to:r}=e;return r!==void 0?r===!1?r_:r===!0?a.value||"body":r:t!=null&&t.value?(d=t.value.$el)!==null&&d!==void 0?d:t.value:n!=null&&n.value?n.value:s!=null&&s.value?s.value:i!=null&&i.value?i.value:r??(a.value||"body")})}cs.tdkey=r_;cs.propTo={type:[String,Object,Boolean],default:void 0};function mP(e,t,n){const s=H(e.value);let i=null;return yt(e,a=>{i!==null&&window.clearTimeout(i),a===!0?n&&!n.value?s.value=!0:i=window.setTimeout(()=>{s.value=!0},t):s.value=!1}),s}function Xd(e,t,n="default"){const s=t[n];if(s===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);return s()}function Jd(e,t=!0,n=[]){return e.forEach(s=>{if(s!==null){if(typeof s!="object"){(typeof s=="string"||typeof s=="number")&&n.push(ot(String(s)));return}if(Array.isArray(s)){Jd(s,t,n);return}if(s.type===Oe){if(s.children===null)return;Array.isArray(s.children)&&Jd(s.children,t,n)}else s.type!==bb&&n.push(s)}}),n}function wp(e,t,n="default"){const s=t[n];if(s===void 0)throw new Error(`[vueuc/${e}]: slot[${n}] is empty.`);const i=Jd(s());if(i.length===1)return i[0];throw new Error(`[vueuc/${e}]: slot[${n}] should have exactly one child.`)}let qi=null;function o_(){if(qi===null&&(qi=document.getElementById("v-binder-view-measurer"),qi===null)){qi=document.createElement("div"),qi.id="v-binder-view-measurer";const{style:e}=qi;e.position="fixed",e.left="0",e.right="0",e.top="0",e.bottom="0",e.pointerEvents="none",e.visibility="hidden",document.body.appendChild(qi)}return qi.getBoundingClientRect()}function _P(e,t){const n=o_();return{top:t,left:e,height:0,width:0,right:n.width-e,bottom:n.height-t}}function Xc(e){const t=e.getBoundingClientRect(),n=o_();return{left:t.left-n.left,top:t.top-n.top,bottom:n.height+n.top-t.bottom,right:n.width+n.left-t.right,width:t.width,height:t.height}}function yP(e){return e.nodeType===9?null:e.parentNode}function a_(e){if(e===null)return null;const t=yP(e);if(t===null)return null;if(t.nodeType===9)return document;if(t.nodeType===1){const{overflow:n,overflowX:s,overflowY:i}=getComputedStyle(t);if(/(auto|scroll|overlay)/.test(n+i+s))return t}return a_(t)}const Eo=$e({name:"Binder",props:{syncTargetWithParent:Boolean,syncTarget:{type:Boolean,default:!0}},setup(e){var t;kn("VBinder",(t=ng())===null||t===void 0?void 0:t.proxy);const n=Ut("VBinder",null),s=H(null),i=h=>{s.value=h,n&&e.syncTargetWithParent&&n.setTargetRef(h)};let a=[];const d=()=>{let h=s.value;for(;h=a_(h),h!==null;)a.push(h);for(const f of a)Kn("scroll",f,u,!0)},r=()=>{for(const h of a)Fn("scroll",h,u,!0);a=[]},o=new Set,c=h=>{o.size===0&&d(),o.has(h)||o.add(h)},p=h=>{o.has(h)&&o.delete(h),o.size===0&&r()},u=()=>{Hl(g)},g=()=>{o.forEach(h=>h())},m=new Set,y=h=>{m.size===0&&Kn("resize",window,l),m.has(h)||m.add(h)},v=h=>{m.has(h)&&m.delete(h),m.size===0&&Fn("resize",window,l)},l=()=>{m.forEach(h=>h())};return Vt(()=>{Fn("resize",window,l),r()}),{targetRef:s,setTargetRef:i,addScrollListener:c,removeScrollListener:p,addResizeListener:y,removeResizeListener:v}},render(){return Xd("binder",this.$slots)}}),Lo=$e({name:"Target",setup(){const{setTargetRef:e,syncTarget:t}=Ut("VBinder");return{syncTarget:t,setTargetDirective:{mounted:e,updated:e}}},render(){const{syncTarget:e,setTargetDirective:t}=this;return e?it(wp("follower",this.$slots),[[t]]):wp("follower",this.$slots)}}),qr="@@mmoContext",bP={mounted(e,{value:t}){e[qr]={handler:void 0},typeof t=="function"&&(e[qr].handler=t,Kn("mousemoveoutside",e,t))},updated(e,{value:t}){const n=e[qr];typeof t=="function"?n.handler?n.handler!==t&&(Fn("mousemoveoutside",e,n.handler),n.handler=t,Kn("mousemoveoutside",e,t)):(e[qr].handler=t,Kn("mousemoveoutside",e,t)):n.handler&&(Fn("mousemoveoutside",e,n.handler),n.handler=void 0)},unmounted(e){const{handler:t}=e[qr];t&&Fn("mousemoveoutside",e,t),e[qr].handler=void 0}},Yr="@@coContext",$r={mounted(e,{value:t,modifiers:n}){e[Yr]={handler:void 0},typeof t=="function"&&(e[Yr].handler=t,Kn("clickoutside",e,t,{capture:n.capture}))},updated(e,{value:t,modifiers:n}){const s=e[Yr];typeof t=="function"?s.handler?s.handler!==t&&(Fn("clickoutside",e,s.handler,{capture:n.capture}),s.handler=t,Kn("clickoutside",e,t,{capture:n.capture})):(e[Yr].handler=t,Kn("clickoutside",e,t,{capture:n.capture})):s.handler&&(Fn("clickoutside",e,s.handler,{capture:n.capture}),s.handler=void 0)},unmounted(e,{modifiers:t}){const{handler:n}=e[Yr];n&&Fn("clickoutside",e,n,{capture:t.capture}),e[Yr].handler=void 0}};function wP(e,t){console.error(`[vdirs/${e}]: ${t}`)}class SP{constructor(){this.elementZIndex=new Map,this.nextZIndex=2e3}get elementCount(){return this.elementZIndex.size}ensureZIndex(t,n){const{elementZIndex:s}=this;if(n!==void 0){t.style.zIndex=`${n}`,s.delete(t);return}const{nextZIndex:i}=this;s.has(t)&&s.get(t)+1===this.nextZIndex||(t.style.zIndex=`${i}`,s.set(t,i),this.nextZIndex=i+1,this.squashState())}unregister(t,n){const{elementZIndex:s}=this;s.has(t)?s.delete(t):n===void 0&&wP("z-index-manager/unregister-element","Element not found when unregistering."),this.squashState()}squashState(){const{elementCount:t}=this;t||(this.nextZIndex=2e3),this.nextZIndex-t>2500&&this.rearrange()}rearrange(){const t=Array.from(this.elementZIndex.entries());t.sort((n,s)=>n[1]-s[1]),this.nextZIndex=2e3,t.forEach(n=>{const s=n[0],i=this.nextZIndex++;`${i}`!==s.style.zIndex&&(s.style.zIndex=`${i}`)})}}const Jc=new SP,Gr="@@ziContext",l_={mounted(e,t){const{value:n={}}=t,{zIndex:s,enabled:i}=n;e[Gr]={enabled:!!i,initialized:!1},i&&(Jc.ensureZIndex(e,s),e[Gr].initialized=!0)},updated(e,t){const{value:n={}}=t,{zIndex:s,enabled:i}=n,a=e[Gr].enabled;i&&!a&&(Jc.ensureZIndex(e,s),e[Gr].initialized=!0),e[Gr].enabled=!!i},unmounted(e,t){if(!e[Gr].initialized)return;const{value:n={}}=t,{zIndex:s}=n;Jc.unregister(e,s)}},{c:nr}=wb(),sh="vueuc-style";function Sp(e){return e&-e}class c_{constructor(t,n){this.l=t,this.min=n;const s=new Array(t+1);for(let i=0;ii)throw new Error("[FinweckTree.sum]: `i` is larger than length.");let a=t*s;for(;t>0;)a+=n[t],t-=Sp(t);return a}getBound(t){let n=0,s=this.l;for(;s>n;){const i=Math.floor((n+s)/2),a=this.sum(i);if(a>t){s=i;continue}else if(a{const{to:t}=e;return t??"body"})}},render(){return this.showTeleport?this.disabled?Xd("lazy-teleport",this.$slots):B(Sl,{disabled:this.disabled,to:this.mergedTo},Xd("lazy-teleport",this.$slots)):null}}),Za={top:"bottom",bottom:"top",left:"right",right:"left"},kp={start:"end",center:"center",end:"start"},Qc={top:"height",bottom:"height",left:"width",right:"width"},kP={"bottom-start":"top left",bottom:"top center","bottom-end":"top right","top-start":"bottom left",top:"bottom center","top-end":"bottom right","right-start":"top left",right:"center left","right-end":"bottom left","left-start":"top right",left:"center right","left-end":"bottom right"},xP={"bottom-start":"bottom left",bottom:"bottom center","bottom-end":"bottom right","top-start":"top left",top:"top center","top-end":"top right","right-start":"top right",right:"center right","right-end":"bottom right","left-start":"top left",left:"center left","left-end":"bottom left"},RP={"bottom-start":"right","bottom-end":"left","top-start":"right","top-end":"left","right-start":"bottom","right-end":"top","left-start":"bottom","left-end":"top"},xp={top:!0,bottom:!1,left:!0,right:!1},Rp={top:"end",bottom:"start",left:"end",right:"start"};function TP(e,t,n,s,i,a){if(!i||a)return{placement:e,top:0,left:0};const[d,r]=e.split("-");let o=r??"center",c={top:0,left:0};const p=(m,y,v)=>{let l=0,h=0;const f=n[m]-t[y]-t[m];return f>0&&s&&(v?h=xp[y]?f:-f:l=xp[y]?f:-f),{left:l,top:h}},u=d==="left"||d==="right";if(o!=="center"){const m=RP[e],y=Za[m],v=Qc[m];if(n[v]>t[v]){if(t[m]+t[v]t[y]&&(o=kp[r])}else{const m=d==="bottom"||d==="top"?"left":"top",y=Za[m],v=Qc[m],l=(n[v]-t[v])/2;(t[m]t[y]?(o=Rp[m],c=p(v,m,u)):(o=Rp[y],c=p(v,y,u)))}let g=d;return t[d] *",{pointerEvents:"all"})])]),Do=$e({name:"Follower",inheritAttrs:!1,props:{show:Boolean,enabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom"},syncTrigger:{type:Array,default:["resize","scroll"]},to:[String,Object],flip:{type:Boolean,default:!0},internalShift:Boolean,x:Number,y:Number,width:String,minWidth:String,containerClass:String,teleportDisabled:Boolean,zindexable:{type:Boolean,default:!0},zIndex:Number,overlap:Boolean},setup(e){const t=Ut("VBinder"),n=en(()=>e.enabled!==void 0?e.enabled:e.show),s=H(null),i=H(null),a=()=>{const{syncTrigger:g}=e;g.includes("scroll")&&t.addScrollListener(o),g.includes("resize")&&t.addResizeListener(o)},d=()=>{t.removeScrollListener(o),t.removeResizeListener(o)};Dt(()=>{n.value&&(o(),a())});const r=Tu();LP.mount({id:"vueuc/binder",head:!0,anchorMetaName:sh,ssr:r}),Vt(()=>{d()}),gP(()=>{n.value&&o()});const o=()=>{if(!n.value)return;const g=s.value;if(g===null)return;const m=t.targetRef,{x:y,y:v,overlap:l}=e,h=y!==void 0&&v!==void 0?_P(y,v):Xc(m);g.style.setProperty("--v-target-width",`${Math.round(h.width)}px`),g.style.setProperty("--v-target-height",`${Math.round(h.height)}px`);const{width:f,minWidth:_,placement:S,internalShift:k,flip:P}=e;g.setAttribute("v-placement",S),l?g.setAttribute("v-overlap",""):g.removeAttribute("v-overlap");const{style:M}=g;f==="target"?M.width=`${h.width}px`:f!==void 0?M.width=f:M.width="",_==="target"?M.minWidth=`${h.width}px`:_!==void 0?M.minWidth=_:M.minWidth="";const w=Xc(g),T=Xc(i.value),{left:A,top:E,placement:R}=TP(S,h,w,k,P,l),D=PP(R,l),{left:I,top:O,transform:U}=EP(R,T,h,E,A,l);g.setAttribute("v-placement",R),g.style.setProperty("--v-offset-left",`${Math.round(A)}px`),g.style.setProperty("--v-offset-top",`${Math.round(E)}px`),g.style.transform=`translateX(${I}) translateY(${O}) ${U}`,g.style.setProperty("--v-transform-origin",D),g.style.transformOrigin=D};yt(n,g=>{g?(a(),c()):d()});const c=()=>{cn().then(o).catch(g=>console.error(g))};["placement","x","y","internalShift","flip","width","overlap","minWidth"].forEach(g=>{yt(dt(e,g),o)}),["teleportDisabled"].forEach(g=>{yt(dt(e,g),c)}),yt(dt(e,"syncTrigger"),g=>{g.includes("resize")?t.addResizeListener(o):t.removeResizeListener(o),g.includes("scroll")?t.addScrollListener(o):t.removeScrollListener(o)});const p=ba(),u=en(()=>{const{to:g}=e;if(g!==void 0)return g;p.value});return{VBinder:t,mergedEnabled:n,offsetContainerRef:i,followerRef:s,mergedTo:u,syncPosition:o}},render(){return B(CP,{show:this.show,to:this.mergedTo,disabled:this.teleportDisabled},{default:()=>{var e,t;const n=B("div",{class:["v-binder-follower-container",this.containerClass],ref:"offsetContainerRef"},[B("div",{class:"v-binder-follower-content",ref:"followerRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))]);return this.zindexable?it(n,[[l_,{enabled:this.mergedEnabled,zIndex:this.zIndex}]]):n}})}});let el;function DP(){return typeof document>"u"?!1:(el===void 0&&("matchMedia"in window?el=window.matchMedia("(pointer:coarse)").matches:el=!1),el)}let Zc;function Tp(){return typeof document>"u"?1:(Zc===void 0&&(Zc="chrome"in window?window.devicePixelRatio:1),Zc)}const d_="VVirtualListXScroll";function MP({columnsRef:e,renderColRef:t,renderItemWithColsRef:n}){const s=H(0),i=H(0),a=j(()=>{const c=e.value;if(c.length===0)return null;const p=new c_(c.length,0);return c.forEach((u,g)=>{p.add(g,u.width)}),p}),d=en(()=>{const c=a.value;return c!==null?Math.max(c.getBound(i.value)-1,0):0}),r=c=>{const p=a.value;return p!==null?p.sum(c):0},o=en(()=>{const c=a.value;return c!==null?Math.min(c.getBound(i.value+s.value)+1,e.value.length-1):0});return kn(d_,{startIndexRef:d,endIndexRef:o,columnsRef:e,renderColRef:t,renderItemWithColsRef:n,getLeft:r}),{listWidthRef:s,scrollLeftRef:i}}const Pp=$e({name:"VirtualListRow",props:{index:{type:Number,required:!0},item:{type:Object,required:!0}},setup(){const{startIndexRef:e,endIndexRef:t,columnsRef:n,getLeft:s,renderColRef:i,renderItemWithColsRef:a}=Ut(d_);return{startIndex:e,endIndex:t,columns:n,renderCol:i,renderItemWithCols:a,getLeft:s}},render(){const{startIndex:e,endIndex:t,columns:n,renderCol:s,renderItemWithCols:i,getLeft:a,item:d}=this;if(i!=null)return i({itemIndex:this.index,startColIndex:e,endColIndex:t,allColumns:n,item:d,getLeft:a});if(s!=null){const r=[];for(let o=e;o<=t;++o){const c=n[o];r.push(s({column:c,left:a(o),item:d}))}return r}return null}}),AP=nr(".v-vl",{maxHeight:"inherit",height:"100%",overflow:"auto",minWidth:"1px"},[nr("&:not(.v-vl--show-scrollbar)",{scrollbarWidth:"none"},[nr("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",{width:0,height:0,display:"none"})])]),yo=$e({name:"VirtualList",inheritAttrs:!1,props:{showScrollbar:{type:Boolean,default:!0},columns:{type:Array,default:()=>[]},renderCol:Function,renderItemWithCols:Function,items:{type:Array,default:()=>[]},itemSize:{type:Number,required:!0},itemResizable:Boolean,itemsStyle:[String,Object],visibleItemsTag:{type:[String,Object],default:"div"},visibleItemsProps:Object,ignoreItemResize:Boolean,onScroll:Function,onWheel:Function,onResize:Function,defaultScrollKey:[Number,String],defaultScrollIndex:Number,keyField:{type:String,default:"key"},paddingTop:{type:[Number,String],default:0},paddingBottom:{type:[Number,String],default:0}},setup(e){const t=Tu();AP.mount({id:"vueuc/virtual-list",head:!0,anchorMetaName:sh,ssr:t}),Dt(()=>{const{defaultScrollIndex:D,defaultScrollKey:I}=e;D!=null?l({index:D}):I!=null&&l({key:I})});let n=!1,s=!1;Sb(()=>{if(n=!1,!s){s=!0;return}l({top:m.value,left:d.value})}),sg(()=>{n=!0,s||(s=!0)});const i=en(()=>{if(e.renderCol==null&&e.renderItemWithCols==null||e.columns.length===0)return;let D=0;return e.columns.forEach(I=>{D+=I.width}),D}),a=j(()=>{const D=new Map,{keyField:I}=e;return e.items.forEach((O,U)=>{D.set(O[I],U)}),D}),{scrollLeftRef:d,listWidthRef:r}=MP({columnsRef:dt(e,"columns"),renderColRef:dt(e,"renderCol"),renderItemWithColsRef:dt(e,"renderItemWithCols")}),o=H(null),c=H(void 0),p=new Map,u=j(()=>{const{items:D,itemSize:I,keyField:O}=e,U=new c_(D.length,I);return D.forEach((W,z)=>{const N=W[O],V=p.get(N);V!==void 0&&U.add(z,V)}),U}),g=H(0),m=H(0),y=en(()=>Math.max(u.value.getBound(m.value-oo(e.paddingTop))-1,0)),v=j(()=>{const{value:D}=c;if(D===void 0)return[];const{items:I,itemSize:O}=e,U=y.value,W=Math.min(U+Math.ceil(D/O+1),I.length-1),z=[];for(let N=U;N<=W;++N)z.push(I[N]);return z}),l=(D,I)=>{if(typeof D=="number"){S(D,I,"auto");return}const{left:O,top:U,index:W,key:z,position:N,behavior:V,debounce:q=!0}=D;if(O!==void 0||U!==void 0)S(O,U,V);else if(W!==void 0)_(W,V,q);else if(z!==void 0){const G=a.value.get(z);G!==void 0&&_(G,V,q)}else N==="bottom"?S(0,Number.MAX_SAFE_INTEGER,V):N==="top"&&S(0,0,V)};let h,f=null;function _(D,I,O){const{value:U}=u,W=U.sum(D)+oo(e.paddingTop);if(!O)o.value.scrollTo({left:0,top:W,behavior:I});else{h=D,f!==null&&window.clearTimeout(f),f=window.setTimeout(()=>{h=void 0,f=null},16);const{scrollTop:z,offsetHeight:N}=o.value;if(W>z){const V=U.get(D);W+V<=z+N||o.value.scrollTo({left:0,top:W+V-N,behavior:I})}else o.value.scrollTo({left:0,top:W,behavior:I})}}function S(D,I,O){o.value.scrollTo({left:D,top:I,behavior:O})}function k(D,I){var O,U,W;if(n||e.ignoreItemResize||R(I.target))return;const{value:z}=u,N=a.value.get(D),V=z.get(N),q=(W=(U=(O=I.borderBoxSize)===null||O===void 0?void 0:O[0])===null||U===void 0?void 0:U.blockSize)!==null&&W!==void 0?W:I.contentRect.height;if(q===V)return;q-e.itemSize===0?p.delete(D):p.set(D,q-e.itemSize);const te=q-V;if(te===0)return;z.add(N,te);const oe=o.value;if(oe!=null){if(h===void 0){const ie=z.sum(N);oe.scrollTop>ie&&oe.scrollBy(0,te)}else if(Noe.scrollTop+oe.offsetHeight&&oe.scrollBy(0,te)}E()}g.value++}const P=!DP();let M=!1;function w(D){var I;(I=e.onScroll)===null||I===void 0||I.call(e,D),(!P||!M)&&E()}function T(D){var I;if((I=e.onWheel)===null||I===void 0||I.call(e,D),P){const O=o.value;if(O!=null){if(D.deltaX===0&&(O.scrollTop===0&&D.deltaY<=0||O.scrollTop+O.offsetHeight>=O.scrollHeight&&D.deltaY>=0))return;D.preventDefault(),O.scrollTop+=D.deltaY/Tp(),O.scrollLeft+=D.deltaX/Tp(),E(),M=!0,Hl(()=>{M=!1})}}}function A(D){if(n||R(D.target))return;if(e.renderCol==null&&e.renderItemWithCols==null){if(D.contentRect.height===c.value)return}else if(D.contentRect.height===c.value&&D.contentRect.width===r.value)return;c.value=D.contentRect.height,r.value=D.contentRect.width;const{onResize:I}=e;I!==void 0&&I(D)}function E(){const{value:D}=o;D!=null&&(m.value=D.scrollTop,d.value=D.scrollLeft)}function R(D){let I=D;for(;I!==null;){if(I.style.display==="none")return!0;I=I.parentElement}return!1}return{listHeight:c,listStyle:{overflow:"auto"},keyToIndex:a,itemsStyle:j(()=>{const{itemResizable:D}=e,I=Gn(u.value.sum());return g.value,[e.itemsStyle,{boxSizing:"content-box",width:Gn(i.value),height:D?"":I,minHeight:D?I:"",paddingTop:Gn(e.paddingTop),paddingBottom:Gn(e.paddingBottom)}]}),visibleItemsStyle:j(()=>(g.value,{transform:`translateY(${Gn(u.value.sum(y.value))})`})),viewportItems:v,listElRef:o,itemsElRef:H(null),scrollTo:l,handleListResize:A,handleListScroll:w,handleListWheel:T,handleItemResize:k}},render(){const{itemResizable:e,keyField:t,keyToIndex:n,visibleItemsTag:s}=this;return B(Dd,{onResize:this.handleListResize},{default:()=>{var i,a;return B("div",or(this.$attrs,{class:["v-vl",this.showScrollbar&&"v-vl--show-scrollbar"],onScroll:this.handleListScroll,onWheel:this.handleListWheel,ref:"listElRef"}),[this.items.length!==0?B("div",{ref:"itemsElRef",class:"v-vl-items",style:this.itemsStyle},[B(s,Object.assign({class:"v-vl-visible-items",style:this.visibleItemsStyle},this.visibleItemsProps),{default:()=>{const{renderCol:d,renderItemWithCols:r}=this;return this.viewportItems.map(o=>{const c=o[t],p=n.get(c),u=d!=null?B(Pp,{index:p,item:o}):void 0,g=r!=null?B(Pp,{index:p,item:o}):void 0,m=this.$slots.default({item:o,renderedCols:u,renderedItemWithCols:g,index:p})[0];return e?B(Dd,{key:c,onResize:y=>this.handleItemResize(c,y)},{default:()=>m}):(m.key=c,m)})}})]):(a=(i=this.$slots).empty)===null||a===void 0?void 0:a.call(i)])}})}}),Ci="v-hidden",IP=nr("[v-hidden]",{display:"none!important"}),Ep=$e({name:"Overflow",props:{getCounter:Function,getTail:Function,updateCounter:Function,onUpdateCount:Function,onUpdateOverflow:Function},setup(e,{slots:t}){const n=H(null),s=H(null);function i(d){const{value:r}=n,{getCounter:o,getTail:c}=e;let p;if(o!==void 0?p=o():p=s.value,!r||!p)return;p.hasAttribute(Ci)&&p.removeAttribute(Ci);const{children:u}=r;if(d.showAllItemsBeforeCalculate)for(const _ of u)_.hasAttribute(Ci)&&_.removeAttribute(Ci);const g=r.offsetWidth,m=[],y=t.tail?c==null?void 0:c():null;let v=y?y.offsetWidth:0,l=!1;const h=r.children.length-(t.tail?1:0);for(let _=0;_g){const{updateCounter:P}=e;for(let M=_;M>=0;--M){const w=h-1-M;P!==void 0?P(w):p.textContent=`${w}`;const T=p.offsetWidth;if(v-=m[M],v+T<=g||M===0){l=!0,_=M-1,y&&(_===-1?(y.style.maxWidth=`${g-T}px`,y.style.boxSizing="border-box"):y.style.maxWidth="");const{onUpdateCount:A}=e;A&&A(w);break}}}}const{onUpdateOverflow:f}=e;l?f!==void 0&&f(!0):(f!==void 0&&f(!1),p.setAttribute(Ci,""))}const a=Tu();return IP.mount({id:"vueuc/overflow",head:!0,anchorMetaName:sh,ssr:a}),Dt(()=>i({showAllItemsBeforeCalculate:!1})),{selfRef:n,counterRef:s,sync:i}},render(){const{$slots:e}=this;return cn(()=>this.sync({showAllItemsBeforeCalculate:!1})),B("div",{class:"v-overflow",ref:"selfRef"},[ig(e,"default"),e.counter?e.counter():B("span",{style:{display:"inline-block"},ref:"counterRef"}),e.tail?e.tail():null])}});function u_(e){return e instanceof HTMLElement}function h_(e){for(let t=0;t=0;t--){const n=e.childNodes[t];if(u_(n)&&(p_(n)||f_(n)))return!0}return!1}function p_(e){if(!$P(e))return!1;try{e.focus({preventScroll:!0})}catch{}return document.activeElement===e}function $P(e){if(e.tabIndex>0||e.tabIndex===0&&e.getAttribute("tabIndex")!==null)return!0;if(e.getAttribute("disabled"))return!1;switch(e.nodeName){case"A":return!!e.href&&e.rel!=="ignore";case"INPUT":return e.type!=="hidden"&&e.type!=="file";case"SELECT":case"TEXTAREA":return!0;default:return!1}}let Xo=[];const OP=$e({name:"FocusTrap",props:{disabled:Boolean,active:Boolean,autoFocus:{type:Boolean,default:!0},onEsc:Function,initialFocusTo:[String,Function],finalFocusTo:[String,Function],returnFocusOnDeactivated:{type:Boolean,default:!0}},setup(e){const t=Pu(),n=H(null),s=H(null);let i=!1,a=!1;const d=typeof document>"u"?null:document.activeElement;function r(){return Xo[Xo.length-1]===t}function o(l){var h;l.code==="Escape"&&r()&&((h=e.onEsc)===null||h===void 0||h.call(e,l))}Dt(()=>{yt(()=>e.active,l=>{l?(u(),Kn("keydown",document,o)):(Fn("keydown",document,o),i&&g())},{immediate:!0})}),Vt(()=>{Fn("keydown",document,o),i&&g()});function c(l){if(!a&&r()){const h=p();if(h===null||h.contains(Ar(l)))return;m("first")}}function p(){const l=n.value;if(l===null)return null;let h=l;for(;h=h.nextSibling,!(h===null||h instanceof Element&&h.tagName==="DIV"););return h}function u(){var l;if(!e.disabled){if(Xo.push(t),e.autoFocus){const{initialFocusTo:h}=e;h===void 0?m("first"):(l=Cp(h))===null||l===void 0||l.focus({preventScroll:!0})}i=!0,document.addEventListener("focus",c,!0)}}function g(){var l;if(e.disabled||(document.removeEventListener("focus",c,!0),Xo=Xo.filter(f=>f!==t),r()))return;const{finalFocusTo:h}=e;h!==void 0?(l=Cp(h))===null||l===void 0||l.focus({preventScroll:!0}):e.returnFocusOnDeactivated&&d instanceof HTMLElement&&(a=!0,d.focus({preventScroll:!0}),a=!1)}function m(l){if(r()&&e.active){const h=n.value,f=s.value;if(h!==null&&f!==null){const _=p();if(_==null||_===f){a=!0,h.focus({preventScroll:!0}),a=!1;return}a=!0;const S=l==="first"?h_(_):f_(_);a=!1,S||(a=!0,h.focus({preventScroll:!0}),a=!1)}}}function y(l){if(a)return;const h=p();h!==null&&(l.relatedTarget!==null&&h.contains(l.relatedTarget)?m("last"):m("first"))}function v(l){a||(l.relatedTarget!==null&&l.relatedTarget===n.value?m("last"):m("first"))}return{focusableStartRef:n,focusableEndRef:s,focusableStyle:"position: absolute; height: 0; width: 0;",handleStartFocus:y,handleEndFocus:v}},render(){const{default:e}=this.$slots;if(e===void 0)return null;if(this.disabled)return e();const{active:t,focusableStyle:n}=this;return B(Oe,null,[B("div",{"aria-hidden":"true",tabindex:t?"0":"-1",ref:"focusableStartRef",style:n,onFocus:this.handleStartFocus}),e(),B("div",{"aria-hidden":"true",style:n,ref:"focusableEndRef",tabindex:t?"0":"-1",onFocus:this.handleEndFocus})])}});function v_(e,t){t&&(Dt(()=>{const{value:n}=e;n&&Ac.registerHandler(n,t)}),yt(e,(n,s)=>{s&&Ac.unregisterHandler(s)},{deep:!1}),Vt(()=>{const{value:n}=e;n&&Ac.unregisterHandler(n)}))}function FP(e,t){if(!e)return;const n=document.createElement("a");n.href=e,t!==void 0&&(n.download=t),document.body.appendChild(n),n.click(),document.body.removeChild(n)}let ed;function BP(){return ed===void 0&&(ed=navigator.userAgent.includes("Node.js")||navigator.userAgent.includes("jsdom")),ed}const HP=new WeakSet;function ga(e){HP.add(e)}function Lp(e){switch(typeof e){case"string":return e||void 0;case"number":return String(e);default:return}}function Dp(e){switch(e){case"tiny":return"mini";case"small":return"tiny";case"medium":return"small";case"large":return"medium";case"huge":return"large"}throw new Error(`${e} has no smaller size.`)}function g_(e){return t=>{t?e.value=t.$el:e.value=null}}function Mp(e,t="default",n=void 0){const s=e[t];if(!s)return Ir("getFirstSlotVNode",`slot[${t}] is empty`),null;const i=Cg(s(n));return i.length===1?i[0]:(Ir("getFirstSlotVNode",`slot[${t}] should have exactly one child`),null)}function pc(e,t=[],n){const s={};return t.forEach(i=>{s[i]=e[i]}),Object.assign(s,n)}function ca(e){const t=e.filter(n=>n!==void 0);if(t.length!==0)return t.length===1?t[0]:n=>{e.forEach(s=>{s&&s(n)})}}var Qd=ec(tc,"WeakMap"),NP=Cb(Object.keys,Object),zP=Object.prototype,UP=zP.hasOwnProperty;function VP(e){if(!kb(e))return NP(e);var t=[];for(var n in Object(e))UP.call(e,n)&&n!="constructor"&&t.push(n);return t}function ih(e){return Eu(e)?xb(e):VP(e)}function KP(e,t){for(var n=-1,s=t.length,i=e.length;++nr))return!1;var c=a.get(e),p=a.get(t);if(c&&p)return c==t&&p==e;var u=-1,g=!0,m=n&cE?new Nl:void 0;for(a.set(e,t),a.set(t,e);++uB("svg",{width:"28px",height:"28px",viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},B("g",{"fill-rule":"nonzero"},B("path",{d:"M21.75,3 C23.5449254,3 25,4.45507456 25,6.25 L25,21.75 C25,23.5449254 23.5449254,25 21.75,25 L6.25,25 C4.45507456,25 3,23.5449254 3,21.75 L3,6.25 C3,4.45507456 4.45507456,3 6.25,3 L21.75,3 Z M23.5,9.503 L4.5,9.503 L4.5,21.75 C4.5,22.7164983 5.28350169,23.5 6.25,23.5 L21.75,23.5 C22.7164983,23.5 23.5,22.7164983 23.5,21.75 L23.5,9.503 Z M21.75,4.5 L6.25,4.5 C5.28350169,4.5 4.5,5.28350169 4.5,6.25 L4.5,8.003 L23.5,8.003 L23.5,6.25 C23.5,5.28350169 22.7164983,4.5 21.75,4.5 Z"}))))),nL=$e({name:"Empty",render(){return B("svg",{viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B("path",{d:"M26 7.5C26 11.0899 23.0899 14 19.5 14C15.9101 14 13 11.0899 13 7.5C13 3.91015 15.9101 1 19.5 1C23.0899 1 26 3.91015 26 7.5ZM16.8536 4.14645C16.6583 3.95118 16.3417 3.95118 16.1464 4.14645C15.9512 4.34171 15.9512 4.65829 16.1464 4.85355L18.7929 7.5L16.1464 10.1464C15.9512 10.3417 15.9512 10.6583 16.1464 10.8536C16.3417 11.0488 16.6583 11.0488 16.8536 10.8536L19.5 8.20711L22.1464 10.8536C22.3417 11.0488 22.6583 11.0488 22.8536 10.8536C23.0488 10.6583 23.0488 10.3417 22.8536 10.1464L20.2071 7.5L22.8536 4.85355C23.0488 4.65829 23.0488 4.34171 22.8536 4.14645C22.6583 3.95118 22.3417 3.95118 22.1464 4.14645L19.5 6.79289L16.8536 4.14645Z",fill:"currentColor"}),B("path",{d:"M25 22.75V12.5991C24.5572 13.0765 24.053 13.4961 23.5 13.8454V16H17.5L17.3982 16.0068C17.0322 16.0565 16.75 16.3703 16.75 16.75C16.75 18.2688 15.5188 19.5 14 19.5C12.4812 19.5 11.25 18.2688 11.25 16.75L11.2432 16.6482C11.1935 16.2822 10.8797 16 10.5 16H4.5V7.25C4.5 6.2835 5.2835 5.5 6.25 5.5H12.2696C12.4146 4.97463 12.6153 4.47237 12.865 4H6.25C4.45507 4 3 5.45507 3 7.25V22.75C3 24.5449 4.45507 26 6.25 26H21.75C23.5449 26 25 24.5449 25 22.75ZM4.5 22.75V17.5H9.81597L9.85751 17.7041C10.2905 19.5919 11.9808 21 14 21L14.215 20.9947C16.2095 20.8953 17.842 19.4209 18.184 17.5H23.5V22.75C23.5 23.7165 22.7165 24.5 21.75 24.5H6.25C5.2835 24.5 4.5 23.7165 4.5 22.75Z",fill:"currentColor"}))}}),lr=$e({name:"FastBackward",render(){return B("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M8.73171,16.7949 C9.03264,17.0795 9.50733,17.0663 9.79196,16.7654 C10.0766,16.4644 10.0634,15.9897 9.76243,15.7051 L4.52339,10.75 L17.2471,10.75 C17.6613,10.75 17.9971,10.4142 17.9971,10 C17.9971,9.58579 17.6613,9.25 17.2471,9.25 L4.52112,9.25 L9.76243,4.29275 C10.0634,4.00812 10.0766,3.53343 9.79196,3.2325 C9.50733,2.93156 9.03264,2.91834 8.73171,3.20297 L2.31449,9.27241 C2.14819,9.4297 2.04819,9.62981 2.01448,9.8386 C2.00308,9.89058 1.99707,9.94459 1.99707,10 C1.99707,10.0576 2.00356,10.1137 2.01585,10.1675 C2.05084,10.3733 2.15039,10.5702 2.31449,10.7254 L8.73171,16.7949 Z"}))))}}),cr=$e({name:"FastForward",render(){return B("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))}}),sL=$e({name:"Filter",render(){return B("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},B("g",{"fill-rule":"nonzero"},B("path",{d:"M17,19 C17.5522847,19 18,19.4477153 18,20 C18,20.5522847 17.5522847,21 17,21 L11,21 C10.4477153,21 10,20.5522847 10,20 C10,19.4477153 10.4477153,19 11,19 L17,19 Z M21,13 C21.5522847,13 22,13.4477153 22,14 C22,14.5522847 21.5522847,15 21,15 L7,15 C6.44771525,15 6,14.5522847 6,14 C6,13.4477153 6.44771525,13 7,13 L21,13 Z M24,7 C24.5522847,7 25,7.44771525 25,8 C25,8.55228475 24.5522847,9 24,9 L4,9 C3.44771525,9 3,8.55228475 3,8 C3,7.44771525 3.44771525,7 4,7 L24,7 Z"}))))}}),dr=$e({name:"Forward",render(){return B("svg",{viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg"},B("path",{d:"M7.73271 4.20694C8.03263 3.92125 8.50737 3.93279 8.79306 4.23271L13.7944 9.48318C14.0703 9.77285 14.0703 10.2281 13.7944 10.5178L8.79306 15.7682C8.50737 16.0681 8.03263 16.0797 7.73271 15.794C7.43279 15.5083 7.42125 15.0336 7.70694 14.7336L12.2155 10.0005L7.70694 5.26729C7.42125 4.96737 7.43279 4.49264 7.73271 4.20694Z",fill:"currentColor"}))}}),Wp=$e({name:"More",render(){return B("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M4,7 C4.55228,7 5,7.44772 5,8 C5,8.55229 4.55228,9 4,9 C3.44772,9 3,8.55229 3,8 C3,7.44772 3.44772,7 4,7 Z M8,7 C8.55229,7 9,7.44772 9,8 C9,8.55229 8.55229,9 8,9 C7.44772,9 7,8.55229 7,8 C7,7.44772 7.44772,7 8,7 Z M12,7 C12.5523,7 13,7.44772 13,8 C13,8.55229 12.5523,9 12,9 C11.4477,9 11,8.55229 11,8 C11,7.44772 11.4477,7 12,7 Z"}))))}}),iL=$e({name:"Remove",render(){return B("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},B("line",{x1:"400",y1:"256",x2:"112",y2:"256",style:` + fill: none; + stroke: currentColor; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 32px; + `}))}}),rL=Du("time",()=>B("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},B("path",{d:"M256,64C150,64,64,150,64,256s86,192,192,192,192-86,192-192S362,64,256,64Z",style:` + fill: none; + stroke: currentColor; + stroke-miterlimit: 10; + stroke-width: 32px; + `}),B("polyline",{points:"256 128 256 272 352 272",style:` + fill: none; + stroke: currentColor; + stroke-linecap: round; + stroke-linejoin: round; + stroke-width: 32px; + `}))),oL=Du("to",()=>B("svg",{viewBox:"0 0 20 20",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},B("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},B("g",{fill:"currentColor","fill-rule":"nonzero"},B("path",{d:"M11.2654,3.20511 C10.9644,2.92049 10.4897,2.93371 10.2051,3.23464 C9.92049,3.53558 9.93371,4.01027 10.2346,4.29489 L15.4737,9.25 L2.75,9.25 C2.33579,9.25 2,9.58579 2,10.0000012 C2,10.4142 2.33579,10.75 2.75,10.75 L15.476,10.75 L10.2346,15.7073 C9.93371,15.9919 9.92049,16.4666 10.2051,16.7675 C10.4897,17.0684 10.9644,17.0817 11.2654,16.797 L17.6826,10.7276 C17.8489,10.5703 17.9489,10.3702 17.9826,10.1614 C17.994,10.1094 18,10.0554 18,10.0000012 C18,9.94241 17.9935,9.88633 17.9812,9.83246 C17.9462,9.62667 17.8467,9.42976 17.6826,9.27455 L11.2654,3.20511 Z"}))))),hr=$e({props:{onFocus:Function,onBlur:Function},setup(e){return()=>B("div",{style:"width: 0; height: 0",tabindex:0,onFocus:e.onFocus,onBlur:e.onBlur})}});function jp(e){return Array.isArray(e)?e:[e]}const nu={STOP:"STOP"};function w_(e,t){const n=t(e);e.children!==void 0&&n!==nu.STOP&&e.children.forEach(s=>w_(s,t))}function aL(e,t={}){const{preserveGroup:n=!1}=t,s=[],i=n?d=>{d.isLeaf||(s.push(d.key),a(d.children))}:d=>{d.isLeaf||(d.isGroup||s.push(d.key),a(d.children))};function a(d){d.forEach(i)}return a(e),s}function lL(e,t){const{isLeaf:n}=e;return n!==void 0?n:!t(e)}function cL(e){return e.children}function dL(e){return e.key}function uL(){return!1}function hL(e,t){const{isLeaf:n}=e;return!(n===!1&&!Array.isArray(t(e)))}function fL(e){return e.disabled===!0}function pL(e,t){return e.isLeaf===!1&&!Array.isArray(t(e))}function nd(e){var t;return e==null?[]:Array.isArray(e)?e:(t=e.checkedKeys)!==null&&t!==void 0?t:[]}function sd(e){var t;return e==null||Array.isArray(e)?[]:(t=e.indeterminateKeys)!==null&&t!==void 0?t:[]}function vL(e,t){const n=new Set(e);return t.forEach(s=>{n.has(s)||n.add(s)}),Array.from(n)}function gL(e,t){const n=new Set(e);return t.forEach(s=>{n.has(s)&&n.delete(s)}),Array.from(n)}function mL(e){return(e==null?void 0:e.type)==="group"}function _L(e){const t=new Map;return e.forEach((n,s)=>{t.set(n.key,s)}),n=>{var s;return(s=t.get(n))!==null&&s!==void 0?s:null}}class yL extends Error{constructor(){super(),this.message="SubtreeNotLoadedError: checking a subtree whose required nodes are not fully loaded."}}function bL(e,t,n,s){return zl(t.concat(e),n,s,!1)}function wL(e,t){const n=new Set;return e.forEach(s=>{const i=t.treeNodeMap.get(s);if(i!==void 0){let a=i.parent;for(;a!==null&&!(a.disabled||n.has(a.key));)n.add(a.key),a=a.parent}}),n}function SL(e,t,n,s){const i=zl(t,n,s,!1),a=zl(e,n,s,!0),d=wL(e,n),r=[];return i.forEach(o=>{(a.has(o)||d.has(o))&&r.push(o)}),r.forEach(o=>i.delete(o)),i}function id(e,t){const{checkedKeys:n,keysToCheck:s,keysToUncheck:i,indeterminateKeys:a,cascade:d,leafOnly:r,checkStrategy:o,allowNotLoaded:c}=e;if(!d)return s!==void 0?{checkedKeys:vL(n,s),indeterminateKeys:Array.from(a)}:i!==void 0?{checkedKeys:gL(n,i),indeterminateKeys:Array.from(a)}:{checkedKeys:Array.from(n),indeterminateKeys:Array.from(a)};const{levelTreeNodeMap:p}=t;let u;i!==void 0?u=SL(i,n,t,c):s!==void 0?u=bL(s,n,t,c):u=zl(n,t,c,!1);const g=o==="parent",m=o==="child"||r,y=u,v=new Set,l=Math.max.apply(null,Array.from(p.keys()));for(let h=l;h>=0;h-=1){const f=h===0,_=p.get(h);for(const S of _){if(S.isLeaf)continue;const{key:k,shallowLoaded:P}=S;if(m&&P&&S.children.forEach(A=>{!A.disabled&&!A.isLeaf&&A.shallowLoaded&&y.has(A.key)&&y.delete(A.key)}),S.disabled||!P)continue;let M=!0,w=!1,T=!0;for(const A of S.children){const E=A.key;if(!A.disabled){if(T&&(T=!1),y.has(E))w=!0;else if(v.has(E)){w=!0,M=!1;break}else if(M=!1,w)break}}M&&!T?(g&&S.children.forEach(A=>{!A.disabled&&y.has(A.key)&&y.delete(A.key)}),y.add(k)):w&&v.add(k),f&&m&&y.has(k)&&y.delete(k)}}return{checkedKeys:Array.from(y),indeterminateKeys:Array.from(v)}}function zl(e,t,n,s){const{treeNodeMap:i,getChildren:a}=t,d=new Set,r=new Set(e);return e.forEach(o=>{const c=i.get(o);c!==void 0&&w_(c,p=>{if(p.disabled)return nu.STOP;const{key:u}=p;if(!d.has(u)&&(d.add(u),r.add(u),pL(p.rawNode,a))){if(s)return nu.STOP;if(!n)throw new yL}})}),r}function CL(e,{includeGroup:t=!1,includeSelf:n=!0},s){var i;const a=s.treeNodeMap;let d=e==null?null:(i=a.get(e))!==null&&i!==void 0?i:null;const r={keyPath:[],treeNodePath:[],treeNode:d};if(d!=null&&d.ignored)return r.treeNode=null,r;for(;d;)!d.ignored&&(t||!d.isGroup)&&r.treeNodePath.push(d),d=d.parent;return r.treeNodePath.reverse(),n||r.treeNodePath.pop(),r.keyPath=r.treeNodePath.map(o=>o.key),r}function kL(e){if(e.length===0)return null;const t=e[0];return t.isGroup||t.ignored||t.disabled?t.getNext():t}function xL(e,t){const n=e.siblings,s=n.length,{index:i}=e;return t?n[(i+1)%s]:i===n.length-1?null:n[i+1]}function qp(e,t,{loop:n=!1,includeDisabled:s=!1}={}){const i=t==="prev"?RL:xL,a={reverse:t==="prev"};let d=!1,r=null;function o(c){if(c!==null){if(c===e){if(!d)d=!0;else if(!e.disabled&&!e.isGroup){r=e;return}}else if((!c.disabled||s)&&!c.ignored&&!c.isGroup){r=c;return}if(c.isGroup){const p=oh(c,a);p!==null?r=p:o(i(c,n))}else{const p=i(c,!1);if(p!==null)o(p);else{const u=TL(c);u!=null&&u.isGroup?o(i(u,n)):n&&o(i(c,!0))}}}}return o(e),r}function RL(e,t){const n=e.siblings,s=n.length,{index:i}=e;return t?n[(i-1+s)%s]:i===0?null:n[i-1]}function TL(e){return e.parent}function oh(e,t={}){const{reverse:n=!1}=t,{children:s}=e;if(s){const{length:i}=s,a=n?i-1:0,d=n?-1:i,r=n?-1:1;for(let o=a;o!==d;o+=r){const c=s[o];if(!c.disabled&&!c.ignored)if(c.isGroup){const p=oh(c,t);if(p!==null)return p}else return c}}return null}const PL={getChild(){return this.ignored?null:oh(this)},getParent(){const{parent:e}=this;return e!=null&&e.isGroup?e.getParent():e},getNext(e={}){return qp(this,"next",e)},getPrev(e={}){return qp(this,"prev",e)}};function EL(e,t){const n=t?new Set(t):void 0,s=[];function i(a){a.forEach(d=>{s.push(d),!(d.isLeaf||!d.children||d.ignored)&&(d.isGroup||n===void 0||n.has(d.key))&&i(d.children)})}return i(e),s}function LL(e,t){const n=e.key;for(;t;){if(t.key===n)return!0;t=t.parent}return!1}function S_(e,t,n,s,i,a=null,d=0){const r=[];return e.forEach((o,c)=>{var p;const u=Object.create(s);if(u.rawNode=o,u.siblings=r,u.level=d,u.index=c,u.isFirstChild=c===0,u.isLastChild=c+1===e.length,u.parent=a,!u.ignored){const g=i(o);Array.isArray(g)&&(u.children=S_(g,t,n,s,i,u,d+1))}r.push(u),t.set(u.key,u),n.has(d)||n.set(d,[]),(p=n.get(d))===null||p===void 0||p.push(u)}),r}function vc(e,t={}){var n;const s=new Map,i=new Map,{getDisabled:a=fL,getIgnored:d=uL,getIsGroup:r=mL,getKey:o=dL}=t,c=(n=t.getChildren)!==null&&n!==void 0?n:cL,p=t.ignoreEmptyChildren?S=>{const k=c(S);return Array.isArray(k)?k.length?k:null:k}:c,u=Object.assign({get key(){return o(this.rawNode)},get disabled(){return a(this.rawNode)},get isGroup(){return r(this.rawNode)},get isLeaf(){return lL(this.rawNode,p)},get shallowLoaded(){return hL(this.rawNode,p)},get ignored(){return d(this.rawNode)},contains(S){return LL(this,S)}},PL),g=S_(e,s,i,u,p);function m(S){if(S==null)return null;const k=s.get(S);return k&&!k.isGroup&&!k.ignored?k:null}function y(S){if(S==null)return null;const k=s.get(S);return k&&!k.ignored?k:null}function v(S,k){const P=y(S);return P?P.getPrev(k):null}function l(S,k){const P=y(S);return P?P.getNext(k):null}function h(S){const k=y(S);return k?k.getParent():null}function f(S){const k=y(S);return k?k.getChild():null}const _={treeNodes:g,treeNodeMap:s,levelTreeNodeMap:i,maxLevel:Math.max(...i.keys()),getChildren:p,getFlattenedNodes(S){return EL(g,S)},getNode:m,getPrev:v,getNext:l,getParent:h,getChild:f,getFirstAvailableNode(){return kL(g)},getPath(S,k={}){return CL(S,k,_)},getCheckedKeys(S,k={}){const{cascade:P=!0,leafOnly:M=!1,checkStrategy:w="all",allowNotLoaded:T=!1}=k;return id({checkedKeys:nd(S),indeterminateKeys:sd(S),cascade:P,leafOnly:M,checkStrategy:w,allowNotLoaded:T},_)},check(S,k,P={}){const{cascade:M=!0,leafOnly:w=!1,checkStrategy:T="all",allowNotLoaded:A=!1}=P;return id({checkedKeys:nd(k),indeterminateKeys:sd(k),keysToCheck:S==null?[]:jp(S),cascade:M,leafOnly:w,checkStrategy:T,allowNotLoaded:A},_)},uncheck(S,k,P={}){const{cascade:M=!0,leafOnly:w=!1,checkStrategy:T="all",allowNotLoaded:A=!1}=P;return id({checkedKeys:nd(k),indeterminateKeys:sd(k),keysToUncheck:S==null?[]:jp(S),cascade:M,leafOnly:w,checkStrategy:T,allowNotLoaded:A},_)},getNonLeafKeys(S={}){return aL(g,S)}};return _}const DL=Ce("empty",` + display: flex; + flex-direction: column; + align-items: center; + font-size: var(--n-font-size); +`,[qe("icon",` + width: var(--n-icon-size); + height: var(--n-icon-size); + font-size: var(--n-icon-size); + line-height: var(--n-icon-size); + color: var(--n-icon-color); + transition: + color .3s var(--n-bezier); + `,[ze("+",[qe("description",` + margin-top: 8px; + `)])]),qe("description",` + transition: color .3s var(--n-bezier); + color: var(--n-text-color); + `),qe("extra",` + text-align: center; + transition: color .3s var(--n-bezier); + margin-top: 12px; + color: var(--n-extra-text-color); + `)]),ML=Object.assign(Object.assign({},Ht.props),{description:String,showDescription:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},size:{type:String,default:"medium"},renderIcon:Function}),C_=$e({name:"Empty",props:ML,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n,mergedComponentPropsRef:s}=mn(e),i=Ht("Empty","-empty",DL,Bb,e,t),{localeRef:a}=Qs("Empty"),d=j(()=>{var p,u,g;return(p=e.description)!==null&&p!==void 0?p:(g=(u=s==null?void 0:s.value)===null||u===void 0?void 0:u.Empty)===null||g===void 0?void 0:g.description}),r=j(()=>{var p,u;return((u=(p=s==null?void 0:s.value)===null||p===void 0?void 0:p.Empty)===null||u===void 0?void 0:u.renderIcon)||(()=>B(nL,null))}),o=j(()=>{const{size:p}=e,{common:{cubicBezierEaseInOut:u},self:{[Mt("iconSize",p)]:g,[Mt("fontSize",p)]:m,textColor:y,iconColor:v,extraTextColor:l}}=i.value;return{"--n-icon-size":g,"--n-font-size":m,"--n-bezier":u,"--n-text-color":y,"--n-icon-color":v,"--n-extra-text-color":l}}),c=n?Bn("empty",j(()=>{let p="";const{size:u}=e;return p+=u[0],p}),o,e):void 0;return{mergedClsPrefix:t,mergedRenderIcon:r,localizedDescription:j(()=>d.value||a.value.description),cssVars:n?void 0:o,themeClass:c==null?void 0:c.themeClass,onRender:c==null?void 0:c.onRender}},render(){const{$slots:e,mergedClsPrefix:t,onRender:n}=this;return n==null||n(),B("div",{class:[`${t}-empty`,this.themeClass],style:this.cssVars},this.showIcon?B("div",{class:`${t}-empty__icon`},e.icon?e.icon():B(Vn,{clsPrefix:t},{default:this.mergedRenderIcon})):null,this.showDescription?B("div",{class:`${t}-empty__description`},e.default?e.default():this.localizedDescription):null,e.extra?B("div",{class:`${t}-empty__extra`},e.extra()):null)}}),Yp=$e({name:"NBaseSelectGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{renderLabelRef:e,renderOptionRef:t,labelFieldRef:n,nodePropsRef:s}=Ut(eh);return{labelField:n,nodeProps:s,renderLabel:e,renderOption:t}},render(){const{clsPrefix:e,renderLabel:t,renderOption:n,nodeProps:s,tmNode:{rawNode:i}}=this,a=s==null?void 0:s(i),d=t?t(i,!1):li(i[this.labelField],i,!1),r=B("div",Object.assign({},a,{class:[`${e}-base-select-group-header`,a==null?void 0:a.class]}),d);return i.render?i.render({node:r,option:i}):n?n({node:r,option:i,selected:!1}):r}});function AL(e,t){return B(ys,{name:"fade-in-scale-up-transition"},{default:()=>e?B(Vn,{clsPrefix:t,class:`${t}-base-select-option__check`},{default:()=>B(tL)}):null})}const Gp=$e({name:"NBaseSelectOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(e){const{valueRef:t,pendingTmNodeRef:n,multipleRef:s,valueSetRef:i,renderLabelRef:a,renderOptionRef:d,labelFieldRef:r,valueFieldRef:o,showCheckmarkRef:c,nodePropsRef:p,handleOptionClick:u,handleOptionMouseEnter:g}=Ut(eh),m=en(()=>{const{value:h}=n;return h?e.tmNode.key===h.key:!1});function y(h){const{tmNode:f}=e;f.disabled||u(h,f)}function v(h){const{tmNode:f}=e;f.disabled||g(h,f)}function l(h){const{tmNode:f}=e,{value:_}=m;f.disabled||_||g(h,f)}return{multiple:s,isGrouped:en(()=>{const{tmNode:h}=e,{parent:f}=h;return f&&f.rawNode.type==="group"}),showCheckmark:c,nodeProps:p,isPending:m,isSelected:en(()=>{const{value:h}=t,{value:f}=s;if(h===null)return!1;const _=e.tmNode.rawNode[o.value];if(f){const{value:S}=i;return S.has(_)}else return h===_}),labelField:r,renderLabel:a,renderOption:d,handleMouseMove:l,handleMouseEnter:v,handleClick:y}},render(){const{clsPrefix:e,tmNode:{rawNode:t},isSelected:n,isPending:s,isGrouped:i,showCheckmark:a,nodeProps:d,renderOption:r,renderLabel:o,handleClick:c,handleMouseEnter:p,handleMouseMove:u}=this,g=AL(n,e),m=o?[o(t,n),a&&g]:[li(t[this.labelField],t,n),a&&g],y=d==null?void 0:d(t),v=B("div",Object.assign({},y,{class:[`${e}-base-select-option`,t.class,y==null?void 0:y.class,{[`${e}-base-select-option--disabled`]:t.disabled,[`${e}-base-select-option--selected`]:n,[`${e}-base-select-option--grouped`]:i,[`${e}-base-select-option--pending`]:s,[`${e}-base-select-option--show-checkmark`]:a}],style:[(y==null?void 0:y.style)||"",t.style||""],onClick:ca([c,y==null?void 0:y.onClick]),onMouseenter:ca([p,y==null?void 0:y.onMouseenter]),onMousemove:ca([u,y==null?void 0:y.onMousemove])}),B("div",{class:`${e}-base-select-option__content`},m));return t.render?t.render({node:v,option:t,selected:n}):r?r({node:v,option:t,selected:n}):v}}),{cubicBezierEaseIn:Xp,cubicBezierEaseOut:Jp}=Hb;function Mo({transformOrigin:e="inherit",duration:t=".2s",enterScale:n=".9",originalTransform:s="",originalTransition:i=""}={}){return[ze("&.fade-in-scale-up-transition-leave-active",{transformOrigin:e,transition:`opacity ${t} ${Xp}, transform ${t} ${Xp} ${i&&`,${i}`}`}),ze("&.fade-in-scale-up-transition-enter-active",{transformOrigin:e,transition:`opacity ${t} ${Jp}, transform ${t} ${Jp} ${i&&`,${i}`}`}),ze("&.fade-in-scale-up-transition-enter-from, &.fade-in-scale-up-transition-leave-to",{opacity:0,transform:`${s} scale(${n})`}),ze("&.fade-in-scale-up-transition-leave-from, &.fade-in-scale-up-transition-enter-to",{opacity:1,transform:`${s} scale(1)`})]}const IL=Ce("base-select-menu",` + line-height: 1.5; + outline: none; + z-index: 0; + position: relative; + border-radius: var(--n-border-radius); + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + background-color: var(--n-color); +`,[Ce("scrollbar",` + max-height: var(--n-height); + `),Ce("virtual-list",` + max-height: var(--n-height); + `),Ce("base-select-option",` + min-height: var(--n-option-height); + font-size: var(--n-option-font-size); + display: flex; + align-items: center; + `,[qe("content",` + z-index: 1; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; + `)]),Ce("base-select-group-header",` + min-height: var(--n-option-height); + font-size: .93em; + display: flex; + align-items: center; + `),Ce("base-select-menu-option-wrapper",` + position: relative; + width: 100%; + `),qe("loading, empty",` + display: flex; + padding: 12px 32px; + flex: 1; + justify-content: center; + `),qe("loading",` + color: var(--n-loading-color); + font-size: var(--n-loading-size); + `),qe("header",` + padding: 8px var(--n-option-padding-left); + font-size: var(--n-option-font-size); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + border-bottom: 1px solid var(--n-action-divider-color); + color: var(--n-action-text-color); + `),qe("action",` + padding: 8px var(--n-option-padding-left); + font-size: var(--n-option-font-size); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier); + border-top: 1px solid var(--n-action-divider-color); + color: var(--n-action-text-color); + `),Ce("base-select-group-header",` + position: relative; + cursor: default; + padding: var(--n-option-padding); + color: var(--n-group-header-text-color); + `),Ce("base-select-option",` + cursor: pointer; + position: relative; + padding: var(--n-option-padding); + transition: + color .3s var(--n-bezier), + opacity .3s var(--n-bezier); + box-sizing: border-box; + color: var(--n-option-text-color); + opacity: 1; + `,[Ue("show-checkmark",` + padding-right: calc(var(--n-option-padding-right) + 20px); + `),ze("&::before",` + content: ""; + position: absolute; + left: 4px; + right: 4px; + top: 0; + bottom: 0; + border-radius: var(--n-border-radius); + transition: background-color .3s var(--n-bezier); + `),ze("&:active",` + color: var(--n-option-text-color-pressed); + `),Ue("grouped",` + padding-left: calc(var(--n-option-padding-left) * 1.5); + `),Ue("pending",[ze("&::before",` + background-color: var(--n-option-color-pending); + `)]),Ue("selected",` + color: var(--n-option-text-color-active); + `,[ze("&::before",` + background-color: var(--n-option-color-active); + `),Ue("pending",[ze("&::before",` + background-color: var(--n-option-color-active-pending); + `)])]),Ue("disabled",` + cursor: not-allowed; + `,[Cn("selected",` + color: var(--n-option-text-color-disabled); + `),Ue("selected",` + opacity: var(--n-option-opacity-disabled); + `)]),qe("check",` + font-size: 16px; + position: absolute; + right: calc(var(--n-option-padding-right) - 4px); + top: calc(50% - 7px); + color: var(--n-option-check-color); + transition: color .3s var(--n-bezier); + `,[Mo({enterScale:"0.5"})])])]),k_=$e({name:"InternalSelectMenu",props:Object.assign(Object.assign({},Ht.props),{clsPrefix:{type:String,required:!0},scrollable:{type:Boolean,default:!0},treeMate:{type:Object,required:!0},multiple:Boolean,size:{type:String,default:"medium"},value:{type:[String,Number,Array],default:null},autoPending:Boolean,virtualScroll:{type:Boolean,default:!0},show:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},loading:Boolean,focusable:Boolean,renderLabel:Function,renderOption:Function,nodeProps:Function,showCheckmark:{type:Boolean,default:!0},onMousedown:Function,onScroll:Function,onFocus:Function,onBlur:Function,onKeyup:Function,onKeydown:Function,onTabOut:Function,onMouseenter:Function,onMouseleave:Function,onResize:Function,resetMenuOnOptionsChange:{type:Boolean,default:!0},inlineThemeDisabled:Boolean,onToggle:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=mn(e),s=ui("InternalSelectMenu",n,t),i=Ht("InternalSelectMenu","-internal-select-menu",IL,Nb,e,dt(e,"clsPrefix")),a=H(null),d=H(null),r=H(null),o=j(()=>e.treeMate.getFlattenedNodes()),c=j(()=>_L(o.value)),p=H(null);function u(){const{treeMate:G}=e;let te=null;const{value:oe}=e;oe===null?te=G.getFirstAvailableNode():(e.multiple?te=G.getNode((oe||[])[(oe||[]).length-1]):te=G.getNode(oe),(!te||te.disabled)&&(te=G.getFirstAvailableNode())),I(te||null)}function g(){const{value:G}=p;G&&!e.treeMate.getNode(G.key)&&(p.value=null)}let m;yt(()=>e.show,G=>{G?m=yt(()=>e.treeMate,()=>{e.resetMenuOnOptionsChange?(e.autoPending?u():g(),cn(O)):g()},{immediate:!0}):m==null||m()},{immediate:!0}),Vt(()=>{m==null||m()});const y=j(()=>oo(i.value.self[Mt("optionHeight",e.size)])),v=j(()=>ao(i.value.self[Mt("padding",e.size)])),l=j(()=>e.multiple&&Array.isArray(e.value)?new Set(e.value):new Set),h=j(()=>{const G=o.value;return G&&G.length===0});function f(G){const{onToggle:te}=e;te&&te(G)}function _(G){const{onScroll:te}=e;te&&te(G)}function S(G){var te;(te=r.value)===null||te===void 0||te.sync(),_(G)}function k(){var G;(G=r.value)===null||G===void 0||G.sync()}function P(){const{value:G}=p;return G||null}function M(G,te){te.disabled||I(te,!1)}function w(G,te){te.disabled||f(te)}function T(G){var te;ws(G,"action")||(te=e.onKeyup)===null||te===void 0||te.call(e,G)}function A(G){var te;ws(G,"action")||(te=e.onKeydown)===null||te===void 0||te.call(e,G)}function E(G){var te;(te=e.onMousedown)===null||te===void 0||te.call(e,G),!e.focusable&&G.preventDefault()}function R(){const{value:G}=p;G&&I(G.getNext({loop:!0}),!0)}function D(){const{value:G}=p;G&&I(G.getPrev({loop:!0}),!0)}function I(G,te=!1){p.value=G,te&&O()}function O(){var G,te;const oe=p.value;if(!oe)return;const ie=c.value(oe.key);ie!==null&&(e.virtualScroll?(G=d.value)===null||G===void 0||G.scrollTo({index:ie}):(te=r.value)===null||te===void 0||te.scrollTo({index:ie,elSize:y.value}))}function U(G){var te,oe;!((te=a.value)===null||te===void 0)&&te.contains(G.target)&&((oe=e.onFocus)===null||oe===void 0||oe.call(e,G))}function W(G){var te,oe;!((te=a.value)===null||te===void 0)&&te.contains(G.relatedTarget)||(oe=e.onBlur)===null||oe===void 0||oe.call(e,G)}kn(eh,{handleOptionMouseEnter:M,handleOptionClick:w,valueSetRef:l,pendingTmNodeRef:p,nodePropsRef:dt(e,"nodeProps"),showCheckmarkRef:dt(e,"showCheckmark"),multipleRef:dt(e,"multiple"),valueRef:dt(e,"value"),renderLabelRef:dt(e,"renderLabel"),renderOptionRef:dt(e,"renderOption"),labelFieldRef:dt(e,"labelField"),valueFieldRef:dt(e,"valueField")}),kn(i_,a),Dt(()=>{const{value:G}=r;G&&G.sync()});const z=j(()=>{const{size:G}=e,{common:{cubicBezierEaseInOut:te},self:{height:oe,borderRadius:ie,color:ye,groupHeaderTextColor:K,actionDividerColor:J,optionTextColorPressed:Q,optionTextColor:ce,optionTextColorDisabled:Fe,optionTextColorActive:Ee,optionOpacityDisabled:Ye,optionCheckColor:Ze,actionTextColor:ue,optionColorPending:et,optionColorActive:re,loadingColor:we,loadingSize:fe,optionColorActivePending:De,[Mt("optionFontSize",G)]:Qe,[Mt("optionHeight",G)]:We,[Mt("optionPadding",G)]:ae}}=i.value;return{"--n-height":oe,"--n-action-divider-color":J,"--n-action-text-color":ue,"--n-bezier":te,"--n-border-radius":ie,"--n-color":ye,"--n-option-font-size":Qe,"--n-group-header-text-color":K,"--n-option-check-color":Ze,"--n-option-color-pending":et,"--n-option-color-active":re,"--n-option-color-active-pending":De,"--n-option-height":We,"--n-option-opacity-disabled":Ye,"--n-option-text-color":ce,"--n-option-text-color-active":Ee,"--n-option-text-color-disabled":Fe,"--n-option-text-color-pressed":Q,"--n-option-padding":ae,"--n-option-padding-left":ao(ae,"left"),"--n-option-padding-right":ao(ae,"right"),"--n-loading-color":we,"--n-loading-size":fe}}),{inlineThemeDisabled:N}=e,V=N?Bn("internal-select-menu",j(()=>e.size[0]),z,e):void 0,q={selfRef:a,next:R,prev:D,getPendingTmNode:P};return v_(a,e.onResize),Object.assign({mergedTheme:i,mergedClsPrefix:t,rtlEnabled:s,virtualListRef:d,scrollbarRef:r,itemSize:y,padding:v,flattenedNodes:o,empty:h,virtualListContainer(){const{value:G}=d;return G==null?void 0:G.listElRef},virtualListContent(){const{value:G}=d;return G==null?void 0:G.itemsElRef},doScroll:_,handleFocusin:U,handleFocusout:W,handleKeyUp:T,handleKeyDown:A,handleMouseDown:E,handleVirtualListResize:k,handleVirtualListScroll:S,cssVars:N?void 0:z,themeClass:V==null?void 0:V.themeClass,onRender:V==null?void 0:V.onRender},q)},render(){const{$slots:e,virtualScroll:t,clsPrefix:n,mergedTheme:s,themeClass:i,onRender:a}=this;return a==null||a(),B("div",{ref:"selfRef",tabindex:this.focusable?0:-1,class:[`${n}-base-select-menu`,this.rtlEnabled&&`${n}-base-select-menu--rtl`,i,this.multiple&&`${n}-base-select-menu--multiple`],style:this.cssVars,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onKeyup:this.handleKeyUp,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},Ns(e.header,d=>d&&B("div",{class:`${n}-base-select-menu__header`,"data-header":!0,key:"header"},d)),this.loading?B("div",{class:`${n}-base-select-menu__loading`},B(nc,{clsPrefix:n,strokeWidth:20})):this.empty?B("div",{class:`${n}-base-select-menu__empty`,"data-empty":!0},Jt(e.empty,()=>[B(C_,{theme:s.peers.Empty,themeOverrides:s.peerOverrides.Empty,size:this.size})])):B(Es,{ref:"scrollbarRef",theme:s.peers.Scrollbar,themeOverrides:s.peerOverrides.Scrollbar,scrollable:this.scrollable,container:t?this.virtualListContainer:void 0,content:t?this.virtualListContent:void 0,onScroll:t?void 0:this.doScroll},{default:()=>t?B(yo,{ref:"virtualListRef",class:`${n}-virtual-list`,items:this.flattenedNodes,itemSize:this.itemSize,showScrollbar:!1,paddingTop:this.padding.top,paddingBottom:this.padding.bottom,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemResizable:!0},{default:({item:d})=>d.isGroup?B(Yp,{key:d.key,clsPrefix:n,tmNode:d}):d.ignored?null:B(Gp,{clsPrefix:n,key:d.key,tmNode:d})}):B("div",{class:`${n}-base-select-menu-option-wrapper`,style:{paddingTop:this.padding.top,paddingBottom:this.padding.bottom}},this.flattenedNodes.map(d=>d.isGroup?B(Yp,{key:d.key,clsPrefix:n,tmNode:d}):B(Gp,{clsPrefix:n,key:d.key,tmNode:d})))}),Ns(e.action,d=>d&&[B("div",{class:`${n}-base-select-menu__action`,"data-action":!0,key:"action"},d),B(hr,{onFocus:this.onTabOut,key:"focus-detector"})]))}}),rd={top:"bottom",bottom:"top",left:"right",right:"left"},Un="var(--n-arrow-height) * 1.414",$L=ze([Ce("popover",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + position: relative; + font-size: var(--n-font-size); + color: var(--n-text-color); + box-shadow: var(--n-box-shadow); + word-break: break-word; + `,[ze(">",[Ce("scrollbar",` + height: inherit; + max-height: inherit; + `)]),Cn("raw",` + background-color: var(--n-color); + border-radius: var(--n-border-radius); + `,[Cn("scrollable",[Cn("show-header-or-footer","padding: var(--n-padding);")])]),qe("header",` + padding: var(--n-padding); + border-bottom: 1px solid var(--n-divider-color); + transition: border-color .3s var(--n-bezier); + `),qe("footer",` + padding: var(--n-padding); + border-top: 1px solid var(--n-divider-color); + transition: border-color .3s var(--n-bezier); + `),Ue("scrollable, show-header-or-footer",[qe("content",` + padding: var(--n-padding); + `)])]),Ce("popover-shared",` + transform-origin: inherit; + `,[Ce("popover-arrow-wrapper",` + position: absolute; + overflow: hidden; + pointer-events: none; + `,[Ce("popover-arrow",` + transition: background-color .3s var(--n-bezier); + position: absolute; + display: block; + width: calc(${Un}); + height: calc(${Un}); + box-shadow: 0 0 8px 0 rgba(0, 0, 0, .12); + transform: rotate(45deg); + background-color: var(--n-color); + pointer-events: all; + `)]),ze("&.popover-transition-enter-from, &.popover-transition-leave-to",` + opacity: 0; + transform: scale(.85); + `),ze("&.popover-transition-enter-to, &.popover-transition-leave-from",` + transform: scale(1); + opacity: 1; + `),ze("&.popover-transition-enter-active",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + opacity .15s var(--n-bezier-ease-out), + transform .15s var(--n-bezier-ease-out); + `),ze("&.popover-transition-leave-active",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + opacity .15s var(--n-bezier-ease-in), + transform .15s var(--n-bezier-ease-in); + `)]),Is("top-start",` + top: calc(${Un} / -2); + left: calc(${ki("top-start")} - var(--v-offset-left)); + `),Is("top",` + top: calc(${Un} / -2); + transform: translateX(calc(${Un} / -2)) rotate(45deg); + left: 50%; + `),Is("top-end",` + top: calc(${Un} / -2); + right: calc(${ki("top-end")} + var(--v-offset-left)); + `),Is("bottom-start",` + bottom: calc(${Un} / -2); + left: calc(${ki("bottom-start")} - var(--v-offset-left)); + `),Is("bottom",` + bottom: calc(${Un} / -2); + transform: translateX(calc(${Un} / -2)) rotate(45deg); + left: 50%; + `),Is("bottom-end",` + bottom: calc(${Un} / -2); + right: calc(${ki("bottom-end")} + var(--v-offset-left)); + `),Is("left-start",` + left: calc(${Un} / -2); + top: calc(${ki("left-start")} - var(--v-offset-top)); + `),Is("left",` + left: calc(${Un} / -2); + transform: translateY(calc(${Un} / -2)) rotate(45deg); + top: 50%; + `),Is("left-end",` + left: calc(${Un} / -2); + bottom: calc(${ki("left-end")} + var(--v-offset-top)); + `),Is("right-start",` + right: calc(${Un} / -2); + top: calc(${ki("right-start")} - var(--v-offset-top)); + `),Is("right",` + right: calc(${Un} / -2); + transform: translateY(calc(${Un} / -2)) rotate(45deg); + top: 50%; + `),Is("right-end",` + right: calc(${Un} / -2); + bottom: calc(${ki("right-end")} + var(--v-offset-top)); + `),...QE({top:["right-start","left-start"],right:["top-end","bottom-end"],bottom:["right-end","left-end"],left:["top-start","bottom-start"]},(e,t)=>{const n=["right","left"].includes(t),s=n?"width":"height";return e.map(i=>{const a=i.split("-")[1]==="end",r=`calc((${`var(--v-target-${s}, 0px)`} - ${Un}) / 2)`,o=ki(i);return ze(`[v-placement="${i}"] >`,[Ce("popover-shared",[Ue("center-arrow",[Ce("popover-arrow",`${t}: calc(max(${r}, ${o}) ${a?"+":"-"} var(--v-offset-${n?"left":"top"}));`)])])])})})]);function ki(e){return["top","bottom"].includes(e.split("-")[0])?"var(--n-arrow-offset)":"var(--n-arrow-offset-vertical)"}function Is(e,t){const n=e.split("-")[0],s=["top","bottom"].includes(n)?"height: var(--n-space-arrow);":"width: var(--n-space-arrow);";return ze(`[v-placement="${e}"] >`,[Ce("popover-shared",` + margin-${rd[n]}: var(--n-space); + `,[Ue("show-arrow",` + margin-${rd[n]}: var(--n-space-arrow); + `),Ue("overlap",` + margin: 0; + `),zb("popover-arrow-wrapper",` + right: 0; + left: 0; + top: 0; + bottom: 0; + ${n}: 100%; + ${rd[n]}: auto; + ${s} + `,[Ce("popover-arrow",t)])])])}const x_=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,show:Boolean,trigger:String,showArrow:Boolean,delay:Number,duration:Number,raw:Boolean,arrowPointToCenter:Boolean,arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],displayDirective:String,x:Number,y:Number,flip:Boolean,overlap:Boolean,placement:String,width:[Number,String],keepAliveOnHover:Boolean,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],internalDeactivateImmediately:Boolean,animated:Boolean,onClickoutside:Function,internalTrapFocus:Boolean,internalOnAfterLeave:Function,minWidth:Number,maxWidth:Number});function R_({arrowClass:e,arrowStyle:t,arrowWrapperClass:n,arrowWrapperStyle:s,clsPrefix:i}){return B("div",{key:"__popover-arrow__",style:s,class:[`${i}-popover-arrow-wrapper`,n]},B("div",{class:[`${i}-popover-arrow`,e],style:t}))}const OL=$e({name:"PopoverBody",inheritAttrs:!1,props:x_,setup(e,{slots:t,attrs:n}){const{namespaceRef:s,mergedClsPrefixRef:i,inlineThemeDisabled:a}=mn(e),d=Ht("Popover","-popover",$L,Ub,e,i),r=H(null),o=Ut("NPopover"),c=H(null),p=H(e.show),u=H(!1);zs(()=>{const{show:M}=e;M&&!BP()&&!e.internalDeactivateImmediately&&(u.value=!0)});const g=j(()=>{const{trigger:M,onClickoutside:w}=e,T=[],{positionManuallyRef:{value:A}}=o;return A||(M==="click"&&!w&&T.push([$r,S,void 0,{capture:!0}]),M==="hover"&&T.push([bP,_])),w&&T.push([$r,S,void 0,{capture:!0}]),(e.displayDirective==="show"||e.animated&&u.value)&&T.push([ms,e.show]),T}),m=j(()=>{const{common:{cubicBezierEaseInOut:M,cubicBezierEaseIn:w,cubicBezierEaseOut:T},self:{space:A,spaceArrow:E,padding:R,fontSize:D,textColor:I,dividerColor:O,color:U,boxShadow:W,borderRadius:z,arrowHeight:N,arrowOffset:V,arrowOffsetVertical:q}}=d.value;return{"--n-box-shadow":W,"--n-bezier":M,"--n-bezier-ease-in":w,"--n-bezier-ease-out":T,"--n-font-size":D,"--n-text-color":I,"--n-color":U,"--n-divider-color":O,"--n-border-radius":z,"--n-arrow-height":N,"--n-arrow-offset":V,"--n-arrow-offset-vertical":q,"--n-padding":R,"--n-space":A,"--n-space-arrow":E}}),y=j(()=>{const M=e.width==="trigger"?void 0:ls(e.width),w=[];M&&w.push({width:M});const{maxWidth:T,minWidth:A}=e;return T&&w.push({maxWidth:ls(T)}),A&&w.push({maxWidth:ls(A)}),a||w.push(m.value),w}),v=a?Bn("popover",void 0,m,e):void 0;o.setBodyInstance({syncPosition:l}),Vt(()=>{o.setBodyInstance(null)}),yt(dt(e,"show"),M=>{e.animated||(M?p.value=!0:p.value=!1)});function l(){var M;(M=r.value)===null||M===void 0||M.syncPosition()}function h(M){e.trigger==="hover"&&e.keepAliveOnHover&&e.show&&o.handleMouseEnter(M)}function f(M){e.trigger==="hover"&&e.keepAliveOnHover&&o.handleMouseLeave(M)}function _(M){e.trigger==="hover"&&!k().contains(Ar(M))&&o.handleMouseMoveOutside(M)}function S(M){(e.trigger==="click"&&!k().contains(Ar(M))||e.onClickoutside)&&o.handleClickOutside(M)}function k(){return o.getTriggerElement()}kn(fc,c),kn(th,null),kn(nh,null);function P(){if(v==null||v.onRender(),!(e.displayDirective==="show"||e.show||e.animated&&u.value))return null;let w;const T=o.internalRenderBodyRef.value,{value:A}=i;if(T)w=T([`${A}-popover-shared`,v==null?void 0:v.themeClass.value,e.overlap&&`${A}-popover-shared--overlap`,e.showArrow&&`${A}-popover-shared--show-arrow`,e.arrowPointToCenter&&`${A}-popover-shared--center-arrow`],c,y.value,h,f);else{const{value:E}=o.extraClassRef,{internalTrapFocus:R}=e,D=!Vh(t.header)||!Vh(t.footer),I=()=>{var O,U;const W=D?B(Oe,null,Ns(t.header,V=>V?B("div",{class:[`${A}-popover__header`,e.headerClass],style:e.headerStyle},V):null),Ns(t.default,V=>V?B("div",{class:[`${A}-popover__content`,e.contentClass],style:e.contentStyle},t):null),Ns(t.footer,V=>V?B("div",{class:[`${A}-popover__footer`,e.footerClass],style:e.footerStyle},V):null)):e.scrollable?(O=t.default)===null||O===void 0?void 0:O.call(t):B("div",{class:[`${A}-popover__content`,e.contentClass],style:e.contentStyle},t),z=e.scrollable?B(ag,{contentClass:D?void 0:`${A}-popover__content ${(U=e.contentClass)!==null&&U!==void 0?U:""}`,contentStyle:D?void 0:e.contentStyle},{default:()=>W}):W,N=e.showArrow?R_({arrowClass:e.arrowClass,arrowStyle:e.arrowStyle,arrowWrapperClass:e.arrowWrapperClass,arrowWrapperStyle:e.arrowWrapperStyle,clsPrefix:A}):null;return[z,N]};w=B("div",or({class:[`${A}-popover`,`${A}-popover-shared`,v==null?void 0:v.themeClass.value,E.map(O=>`${A}-${O}`),{[`${A}-popover--scrollable`]:e.scrollable,[`${A}-popover--show-header-or-footer`]:D,[`${A}-popover--raw`]:e.raw,[`${A}-popover-shared--overlap`]:e.overlap,[`${A}-popover-shared--show-arrow`]:e.showArrow,[`${A}-popover-shared--center-arrow`]:e.arrowPointToCenter}],ref:c,style:y.value,onKeydown:o.handleKeydown,onMouseenter:h,onMouseleave:f},n),R?B(OP,{active:e.show,autoFocus:!0},{default:I}):I())}return it(w,g.value)}return{displayed:u,namespace:s,isMounted:o.isMountedRef,zIndex:o.zIndexRef,followerRef:r,adjustedTo:cs(e),followerEnabled:p,renderContentNode:P}},render(){return B(Do,{ref:"followerRef",zIndex:this.zIndex,show:this.show,enabled:this.followerEnabled,to:this.adjustedTo,x:this.x,y:this.y,flip:this.flip,placement:this.placement,containerClass:this.namespace,overlap:this.overlap,width:this.width==="trigger"?"target":void 0,teleportDisabled:this.adjustedTo===cs.tdkey},{default:()=>this.animated?B(ys,{name:"popover-transition",appear:this.isMounted,onEnter:()=>{this.followerEnabled=!0},onAfterLeave:()=>{var e;(e=this.internalOnAfterLeave)===null||e===void 0||e.call(this),this.followerEnabled=!1,this.displayed=!1}},{default:this.renderContentNode}):this.renderContentNode()})}}),FL=Object.keys(x_),BL={focus:["onFocus","onBlur"],click:["onClick"],hover:["onMouseenter","onMouseleave"],manual:[],nested:["onFocus","onBlur","onMouseenter","onMouseleave","onClick"]};function HL(e,t,n){BL[t].forEach(s=>{e.props?e.props=Object.assign({},e.props):e.props={};const i=e.props[s],a=n[s];i?e.props[s]=(...d)=>{i(...d),a(...d)}:e.props[s]=a})}const Or={show:{type:Boolean,default:void 0},defaultShow:Boolean,showArrow:{type:Boolean,default:!0},trigger:{type:String,default:"hover"},delay:{type:Number,default:100},duration:{type:Number,default:100},raw:Boolean,placement:{type:String,default:"top"},x:Number,y:Number,arrowPointToCenter:Boolean,disabled:Boolean,getDisabled:Function,displayDirective:{type:String,default:"if"},arrowClass:String,arrowStyle:[String,Object],arrowWrapperClass:String,arrowWrapperStyle:[String,Object],flip:{type:Boolean,default:!0},animated:{type:Boolean,default:!0},width:{type:[Number,String],default:void 0},overlap:Boolean,keepAliveOnHover:{type:Boolean,default:!0},zIndex:Number,to:cs.propTo,scrollable:Boolean,contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],footerClass:String,footerStyle:[Object,String],onClickoutside:Function,"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],internalDeactivateImmediately:Boolean,internalSyncTargetWithParent:Boolean,internalInheritedEventHandlers:{type:Array,default:()=>[]},internalTrapFocus:Boolean,internalExtraClass:{type:Array,default:()=>[]},onShow:[Function,Array],onHide:[Function,Array],arrow:{type:Boolean,default:void 0},minWidth:Number,maxWidth:Number},NL=Object.assign(Object.assign(Object.assign({},Ht.props),Or),{internalOnAfterLeave:Function,internalRenderBody:Function}),Ao=$e({name:"Popover",inheritAttrs:!1,props:NL,__popover__:!0,setup(e){const t=ba(),n=H(null),s=j(()=>e.show),i=H(e.defaultShow),a=ns(s,i),d=en(()=>e.disabled?!1:a.value),r=()=>{if(e.disabled)return!0;const{getDisabled:O}=e;return!!(O!=null&&O())},o=()=>r()?!1:a.value,c=Qu(e,["arrow","showArrow"]),p=j(()=>e.overlap?!1:c.value);let u=null;const g=H(null),m=H(null),y=en(()=>e.x!==void 0&&e.y!==void 0);function v(O){const{"onUpdate:show":U,onUpdateShow:W,onShow:z,onHide:N}=e;i.value=O,U&&Xe(U,O),W&&Xe(W,O),O&&z&&Xe(z,!0),O&&N&&Xe(N,!1)}function l(){u&&u.syncPosition()}function h(){const{value:O}=g;O&&(window.clearTimeout(O),g.value=null)}function f(){const{value:O}=m;O&&(window.clearTimeout(O),m.value=null)}function _(){const O=r();if(e.trigger==="focus"&&!O){if(o())return;v(!0)}}function S(){const O=r();if(e.trigger==="focus"&&!O){if(!o())return;v(!1)}}function k(){const O=r();if(e.trigger==="hover"&&!O){if(f(),g.value!==null||o())return;const U=()=>{v(!0),g.value=null},{delay:W}=e;W===0?U():g.value=window.setTimeout(U,W)}}function P(){const O=r();if(e.trigger==="hover"&&!O){if(h(),m.value!==null||!o())return;const U=()=>{v(!1),m.value=null},{duration:W}=e;W===0?U():m.value=window.setTimeout(U,W)}}function M(){P()}function w(O){var U;o()&&(e.trigger==="click"&&(h(),f(),v(!1)),(U=e.onClickoutside)===null||U===void 0||U.call(e,O))}function T(){if(e.trigger==="click"&&!r()){h(),f();const O=!o();v(O)}}function A(O){e.internalTrapFocus&&O.key==="Escape"&&(h(),f(),v(!1))}function E(O){i.value=O}function R(){var O;return(O=n.value)===null||O===void 0?void 0:O.targetRef}function D(O){u=O}return kn("NPopover",{getTriggerElement:R,handleKeydown:A,handleMouseEnter:k,handleMouseLeave:P,handleClickOutside:w,handleMouseMoveOutside:M,setBodyInstance:D,positionManuallyRef:y,isMountedRef:t,zIndexRef:dt(e,"zIndex"),extraClassRef:dt(e,"internalExtraClass"),internalRenderBodyRef:dt(e,"internalRenderBody")}),zs(()=>{a.value&&r()&&v(!1)}),{binderInstRef:n,positionManually:y,mergedShowConsideringDisabledProp:d,uncontrolledShow:i,mergedShowArrow:p,getMergedShow:o,setShow:E,handleClick:T,handleMouseEnter:k,handleMouseLeave:P,handleFocus:_,handleBlur:S,syncPosition:l}},render(){var e;const{positionManually:t,$slots:n}=this;let s,i=!1;if(!t&&(n.activator?s=Mp(n,"activator"):s=Mp(n,"trigger"),s)){s=Vb(s),s=s.type===Kb?B("span",[s]):s;const a={onClick:this.handleClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onFocus:this.handleFocus,onBlur:this.handleBlur};if(!((e=s.type)===null||e===void 0)&&e.__popover__)i=!0,s.props||(s.props={internalSyncTargetWithParent:!0,internalInheritedEventHandlers:[]}),s.props.internalSyncTargetWithParent=!0,s.props.internalInheritedEventHandlers?s.props.internalInheritedEventHandlers=[a,...s.props.internalInheritedEventHandlers]:s.props.internalInheritedEventHandlers=[a];else{const{internalInheritedEventHandlers:d}=this,r=[a,...d],o={onBlur:c=>{r.forEach(p=>{p.onBlur(c)})},onFocus:c=>{r.forEach(p=>{p.onFocus(c)})},onClick:c=>{r.forEach(p=>{p.onClick(c)})},onMouseenter:c=>{r.forEach(p=>{p.onMouseenter(c)})},onMouseleave:c=>{r.forEach(p=>{p.onMouseleave(c)})}};HL(s,d?"nested":t?"manual":this.trigger,o)}}return B(Eo,{ref:"binderInstRef",syncTarget:!i,syncTargetWithParent:this.internalSyncTargetWithParent},{default:()=>{this.mergedShowConsideringDisabledProp;const a=this.getMergedShow();return[this.internalTrapFocus&&a?it(B("div",{style:{position:"fixed",top:0,right:0,bottom:0,left:0}}),[[l_,{enabled:a,zIndex:this.zIndex}]]):null,t?null:B(Lo,null,{default:()=>s}),B(OL,pc(this.$props,FL,Object.assign(Object.assign({},this.$attrs),{showArrow:this.mergedShowArrow,show:a})),{default:()=>{var d,r;return(r=(d=this.$slots).default)===null||r===void 0?void 0:r.call(d)},header:()=>{var d,r;return(r=(d=this.$slots).header)===null||r===void 0?void 0:r.call(d)},footer:()=>{var d,r;return(r=(d=this.$slots).footer)===null||r===void 0?void 0:r.call(d)}})]}})}});function zL(e){const{textColor2:t,primaryColorHover:n,primaryColorPressed:s,primaryColor:i,infoColor:a,successColor:d,warningColor:r,errorColor:o,baseColor:c,borderColor:p,opacityDisabled:u,tagColor:g,closeIconColor:m,closeIconColorHover:y,closeIconColorPressed:v,borderRadiusSmall:l,fontSizeMini:h,fontSizeTiny:f,fontSizeSmall:_,fontSizeMedium:S,heightMini:k,heightTiny:P,heightSmall:M,heightMedium:w,closeColorHover:T,closeColorPressed:A,buttonColor2Hover:E,buttonColor2Pressed:R,fontWeightStrong:D}=e;return Object.assign(Object.assign({},Wb),{closeBorderRadius:l,heightTiny:k,heightSmall:P,heightMedium:M,heightLarge:w,borderRadius:l,opacityDisabled:u,fontSizeTiny:h,fontSizeSmall:f,fontSizeMedium:_,fontSizeLarge:S,fontWeightStrong:D,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:E,colorPressedCheckable:R,colorChecked:i,colorCheckedHover:n,colorCheckedPressed:s,border:`1px solid ${p}`,textColor:t,color:g,colorBordered:"rgb(250, 250, 252)",closeIconColor:m,closeIconColorHover:y,closeIconColorPressed:v,closeColorHover:T,closeColorPressed:A,borderPrimary:`1px solid ${wn(i,{alpha:.3})}`,textColorPrimary:i,colorPrimary:wn(i,{alpha:.12}),colorBorderedPrimary:wn(i,{alpha:.1}),closeIconColorPrimary:i,closeIconColorHoverPrimary:i,closeIconColorPressedPrimary:i,closeColorHoverPrimary:wn(i,{alpha:.12}),closeColorPressedPrimary:wn(i,{alpha:.18}),borderInfo:`1px solid ${wn(a,{alpha:.3})}`,textColorInfo:a,colorInfo:wn(a,{alpha:.12}),colorBorderedInfo:wn(a,{alpha:.1}),closeIconColorInfo:a,closeIconColorHoverInfo:a,closeIconColorPressedInfo:a,closeColorHoverInfo:wn(a,{alpha:.12}),closeColorPressedInfo:wn(a,{alpha:.18}),borderSuccess:`1px solid ${wn(d,{alpha:.3})}`,textColorSuccess:d,colorSuccess:wn(d,{alpha:.12}),colorBorderedSuccess:wn(d,{alpha:.1}),closeIconColorSuccess:d,closeIconColorHoverSuccess:d,closeIconColorPressedSuccess:d,closeColorHoverSuccess:wn(d,{alpha:.12}),closeColorPressedSuccess:wn(d,{alpha:.18}),borderWarning:`1px solid ${wn(r,{alpha:.35})}`,textColorWarning:r,colorWarning:wn(r,{alpha:.15}),colorBorderedWarning:wn(r,{alpha:.12}),closeIconColorWarning:r,closeIconColorHoverWarning:r,closeIconColorPressedWarning:r,closeColorHoverWarning:wn(r,{alpha:.12}),closeColorPressedWarning:wn(r,{alpha:.18}),borderError:`1px solid ${wn(o,{alpha:.23})}`,textColorError:o,colorError:wn(o,{alpha:.1}),colorBorderedError:wn(o,{alpha:.08}),closeIconColorError:o,closeIconColorHoverError:o,closeIconColorPressedError:o,closeColorHoverError:wn(o,{alpha:.12}),closeColorPressedError:wn(o,{alpha:.18})})}const UL={common:lg,self:zL},VL={color:Object,type:{type:String,default:"default"},round:Boolean,size:{type:String,default:"medium"},closable:Boolean,disabled:{type:Boolean,default:void 0}},KL=Ce("tag",` + --n-close-margin: var(--n-close-margin-top) var(--n-close-margin-right) var(--n-close-margin-bottom) var(--n-close-margin-left); + white-space: nowrap; + position: relative; + box-sizing: border-box; + cursor: default; + display: inline-flex; + align-items: center; + flex-wrap: nowrap; + padding: var(--n-padding); + border-radius: var(--n-border-radius); + color: var(--n-text-color); + background-color: var(--n-color); + transition: + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + opacity .3s var(--n-bezier); + line-height: 1; + height: var(--n-height); + font-size: var(--n-font-size); +`,[Ue("strong",` + font-weight: var(--n-font-weight-strong); + `),qe("border",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; + border: var(--n-border); + transition: border-color .3s var(--n-bezier); + `),qe("icon",` + display: flex; + margin: 0 4px 0 0; + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + font-size: var(--n-avatar-size-override); + `),qe("avatar",` + display: flex; + margin: 0 6px 0 0; + `),qe("close",` + margin: var(--n-close-margin); + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `),Ue("round",` + padding: 0 calc(var(--n-height) / 3); + border-radius: calc(var(--n-height) / 2); + `,[qe("icon",` + margin: 0 4px 0 calc((var(--n-height) - 8px) / -2); + `),qe("avatar",` + margin: 0 6px 0 calc((var(--n-height) - 8px) / -2); + `),Ue("closable",` + padding: 0 calc(var(--n-height) / 4) 0 calc(var(--n-height) / 3); + `)]),Ue("icon, avatar",[Ue("round",` + padding: 0 calc(var(--n-height) / 3) 0 calc(var(--n-height) / 2); + `)]),Ue("disabled",` + cursor: not-allowed !important; + opacity: var(--n-opacity-disabled); + `),Ue("checkable",` + cursor: pointer; + box-shadow: none; + color: var(--n-text-color-checkable); + background-color: var(--n-color-checkable); + `,[Cn("disabled",[ze("&:hover","background-color: var(--n-color-hover-checkable);",[Cn("checked","color: var(--n-text-color-hover-checkable);")]),ze("&:active","background-color: var(--n-color-pressed-checkable);",[Cn("checked","color: var(--n-text-color-pressed-checkable);")])]),Ue("checked",` + color: var(--n-text-color-checked); + background-color: var(--n-color-checked); + `,[Cn("disabled",[ze("&:hover","background-color: var(--n-color-checked-hover);"),ze("&:active","background-color: var(--n-color-checked-pressed);")])])])]),WL=Object.assign(Object.assign(Object.assign({},Ht.props),VL),{bordered:{type:Boolean,default:void 0},checked:Boolean,checkable:Boolean,strong:Boolean,triggerClickOnClose:Boolean,onClose:[Array,Function],onMouseenter:Function,onMouseleave:Function,"onUpdate:checked":Function,onUpdateChecked:Function,internalCloseFocusable:{type:Boolean,default:!0},internalCloseIsButtonTag:{type:Boolean,default:!0},onCheckedChange:Function}),jL=ds("n-tag"),Mr=$e({name:"Tag",props:WL,setup(e){const t=H(null),{mergedBorderedRef:n,mergedClsPrefixRef:s,inlineThemeDisabled:i,mergedRtlRef:a}=mn(e),d=Ht("Tag","-tag",KL,UL,e,s);kn(jL,{roundRef:dt(e,"round")});function r(){if(!e.disabled&&e.checkable){const{checked:m,onCheckedChange:y,onUpdateChecked:v,"onUpdate:checked":l}=e;v&&v(!m),l&&l(!m),y&&y(!m)}}function o(m){if(e.triggerClickOnClose||m.stopPropagation(),!e.disabled){const{onClose:y}=e;y&&Xe(y,m)}}const c={setTextContent(m){const{value:y}=t;y&&(y.textContent=m)}},p=ui("Tag",a,s),u=j(()=>{const{type:m,size:y,color:{color:v,textColor:l}={}}=e,{common:{cubicBezierEaseInOut:h},self:{padding:f,closeMargin:_,borderRadius:S,opacityDisabled:k,textColorCheckable:P,textColorHoverCheckable:M,textColorPressedCheckable:w,textColorChecked:T,colorCheckable:A,colorHoverCheckable:E,colorPressedCheckable:R,colorChecked:D,colorCheckedHover:I,colorCheckedPressed:O,closeBorderRadius:U,fontWeightStrong:W,[Mt("colorBordered",m)]:z,[Mt("closeSize",y)]:N,[Mt("closeIconSize",y)]:V,[Mt("fontSize",y)]:q,[Mt("height",y)]:G,[Mt("color",m)]:te,[Mt("textColor",m)]:oe,[Mt("border",m)]:ie,[Mt("closeIconColor",m)]:ye,[Mt("closeIconColorHover",m)]:K,[Mt("closeIconColorPressed",m)]:J,[Mt("closeColorHover",m)]:Q,[Mt("closeColorPressed",m)]:ce}}=d.value,Fe=ao(_);return{"--n-font-weight-strong":W,"--n-avatar-size-override":`calc(${G} - 8px)`,"--n-bezier":h,"--n-border-radius":S,"--n-border":ie,"--n-close-icon-size":V,"--n-close-color-pressed":ce,"--n-close-color-hover":Q,"--n-close-border-radius":U,"--n-close-icon-color":ye,"--n-close-icon-color-hover":K,"--n-close-icon-color-pressed":J,"--n-close-icon-color-disabled":ye,"--n-close-margin-top":Fe.top,"--n-close-margin-right":Fe.right,"--n-close-margin-bottom":Fe.bottom,"--n-close-margin-left":Fe.left,"--n-close-size":N,"--n-color":v||(n.value?z:te),"--n-color-checkable":A,"--n-color-checked":D,"--n-color-checked-hover":I,"--n-color-checked-pressed":O,"--n-color-hover-checkable":E,"--n-color-pressed-checkable":R,"--n-font-size":q,"--n-height":G,"--n-opacity-disabled":k,"--n-padding":f,"--n-text-color":l||oe,"--n-text-color-checkable":P,"--n-text-color-checked":T,"--n-text-color-hover-checkable":M,"--n-text-color-pressed-checkable":w}}),g=i?Bn("tag",j(()=>{let m="";const{type:y,size:v,color:{color:l,textColor:h}={}}=e;return m+=y[0],m+=v[0],l&&(m+=`a${Kh(l)}`),h&&(m+=`b${Kh(h)}`),n.value&&(m+="c"),m}),u,e):void 0;return Object.assign(Object.assign({},c),{rtlEnabled:p,mergedClsPrefix:s,contentRef:t,mergedBordered:n,handleClick:r,handleCloseClick:o,cssVars:i?void 0:u,themeClass:g==null?void 0:g.themeClass,onRender:g==null?void 0:g.onRender})},render(){var e,t;const{mergedClsPrefix:n,rtlEnabled:s,closable:i,color:{borderColor:a}={},round:d,onRender:r,$slots:o}=this;r==null||r();const c=Ns(o.avatar,u=>u&&B("div",{class:`${n}-tag__avatar`},u)),p=Ns(o.icon,u=>u&&B("div",{class:`${n}-tag__icon`},u));return B("div",{class:[`${n}-tag`,this.themeClass,{[`${n}-tag--rtl`]:s,[`${n}-tag--strong`]:this.strong,[`${n}-tag--disabled`]:this.disabled,[`${n}-tag--checkable`]:this.checkable,[`${n}-tag--checked`]:this.checkable&&this.checked,[`${n}-tag--round`]:d,[`${n}-tag--avatar`]:c,[`${n}-tag--icon`]:p,[`${n}-tag--closable`]:i}],style:this.cssVars,onClick:this.handleClick,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave},p||c,B("span",{class:`${n}-tag__content`,ref:"contentRef"},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)),!this.checkable&&i?B(jb,{clsPrefix:n,class:`${n}-tag__close`,disabled:this.disabled,onClick:this.handleCloseClick,focusable:this.internalCloseFocusable,round:d,isButtonTag:this.internalCloseIsButtonTag,absolute:!0}):null,!this.checkable&&this.mergedBordered?B("div",{class:`${n}-tag__border`,style:{borderColor:a}}):null)}}),qL=ze([Ce("base-selection",` + --n-padding-single: var(--n-padding-single-top) var(--n-padding-single-right) var(--n-padding-single-bottom) var(--n-padding-single-left); + --n-padding-multiple: var(--n-padding-multiple-top) var(--n-padding-multiple-right) var(--n-padding-multiple-bottom) var(--n-padding-multiple-left); + position: relative; + z-index: auto; + box-shadow: none; + width: 100%; + max-width: 100%; + display: inline-block; + vertical-align: bottom; + border-radius: var(--n-border-radius); + min-height: var(--n-height); + line-height: 1.5; + font-size: var(--n-font-size); + `,[Ce("base-loading",` + color: var(--n-loading-color); + `),Ce("base-selection-tags","min-height: var(--n-height);"),qe("border, state-border",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + pointer-events: none; + border: var(--n-border); + border-radius: inherit; + transition: + box-shadow .3s var(--n-bezier), + border-color .3s var(--n-bezier); + `),qe("state-border",` + z-index: 1; + border-color: #0000; + `),Ce("base-suffix",` + cursor: pointer; + position: absolute; + top: 50%; + transform: translateY(-50%); + right: 10px; + `,[qe("arrow",` + font-size: var(--n-arrow-size); + color: var(--n-arrow-color); + transition: color .3s var(--n-bezier); + `)]),Ce("base-selection-overlay",` + display: flex; + align-items: center; + white-space: nowrap; + pointer-events: none; + position: absolute; + top: 0; + right: 0; + bottom: 0; + left: 0; + padding: var(--n-padding-single); + transition: color .3s var(--n-bezier); + `,[qe("wrapper",` + flex-basis: 0; + flex-grow: 1; + overflow: hidden; + text-overflow: ellipsis; + `)]),Ce("base-selection-placeholder",` + color: var(--n-placeholder-color); + `,[qe("inner",` + max-width: 100%; + overflow: hidden; + `)]),Ce("base-selection-tags",` + cursor: pointer; + outline: none; + box-sizing: border-box; + position: relative; + z-index: auto; + display: flex; + padding: var(--n-padding-multiple); + flex-wrap: wrap; + align-items: center; + width: 100%; + vertical-align: bottom; + background-color: var(--n-color); + border-radius: inherit; + transition: + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + `),Ce("base-selection-label",` + height: var(--n-height); + display: inline-flex; + width: 100%; + vertical-align: bottom; + cursor: pointer; + outline: none; + z-index: auto; + box-sizing: border-box; + position: relative; + transition: + color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + border-radius: inherit; + background-color: var(--n-color); + align-items: center; + `,[Ce("base-selection-input",` + font-size: inherit; + line-height: inherit; + outline: none; + cursor: pointer; + box-sizing: border-box; + border:none; + width: 100%; + padding: var(--n-padding-single); + background-color: #0000; + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + caret-color: var(--n-caret-color); + `,[qe("content",` + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + `)]),qe("render-label",` + color: var(--n-text-color); + `)]),Cn("disabled",[ze("&:hover",[qe("state-border",` + box-shadow: var(--n-box-shadow-hover); + border: var(--n-border-hover); + `)]),Ue("focus",[qe("state-border",` + box-shadow: var(--n-box-shadow-focus); + border: var(--n-border-focus); + `)]),Ue("active",[qe("state-border",` + box-shadow: var(--n-box-shadow-active); + border: var(--n-border-active); + `),Ce("base-selection-label","background-color: var(--n-color-active);"),Ce("base-selection-tags","background-color: var(--n-color-active);")])]),Ue("disabled","cursor: not-allowed;",[qe("arrow",` + color: var(--n-arrow-color-disabled); + `),Ce("base-selection-label",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `,[Ce("base-selection-input",` + cursor: not-allowed; + color: var(--n-text-color-disabled); + `),qe("render-label",` + color: var(--n-text-color-disabled); + `)]),Ce("base-selection-tags",` + cursor: not-allowed; + background-color: var(--n-color-disabled); + `),Ce("base-selection-placeholder",` + cursor: not-allowed; + color: var(--n-placeholder-color-disabled); + `)]),Ce("base-selection-input-tag",` + height: calc(var(--n-height) - 6px); + line-height: calc(var(--n-height) - 6px); + outline: none; + display: none; + position: relative; + margin-bottom: 3px; + max-width: 100%; + vertical-align: bottom; + `,[qe("input",` + font-size: inherit; + font-family: inherit; + min-width: 1px; + padding: 0; + background-color: #0000; + outline: none; + border: none; + max-width: 100%; + overflow: hidden; + width: 1em; + line-height: inherit; + cursor: pointer; + color: var(--n-text-color); + caret-color: var(--n-caret-color); + `),qe("mirror",` + position: absolute; + left: 0; + top: 0; + white-space: pre; + visibility: hidden; + user-select: none; + -webkit-user-select: none; + opacity: 0; + `)]),["warning","error"].map(e=>Ue(`${e}-status`,[qe("state-border",`border: var(--n-border-${e});`),Cn("disabled",[ze("&:hover",[qe("state-border",` + box-shadow: var(--n-box-shadow-hover-${e}); + border: var(--n-border-hover-${e}); + `)]),Ue("active",[qe("state-border",` + box-shadow: var(--n-box-shadow-active-${e}); + border: var(--n-border-active-${e}); + `),Ce("base-selection-label",`background-color: var(--n-color-active-${e});`),Ce("base-selection-tags",`background-color: var(--n-color-active-${e});`)]),Ue("focus",[qe("state-border",` + box-shadow: var(--n-box-shadow-focus-${e}); + border: var(--n-border-focus-${e}); + `)])])]))]),Ce("base-selection-popover",` + margin-bottom: -3px; + display: flex; + flex-wrap: wrap; + margin-right: -8px; + `),Ce("base-selection-tag-wrapper",` + max-width: 100%; + display: inline-flex; + padding: 0 7px 3px 0; + `,[ze("&:last-child","padding-right: 0;"),Ce("tag",` + font-size: 14px; + max-width: 100%; + `,[qe("content",` + line-height: 1.25; + text-overflow: ellipsis; + overflow: hidden; + `)])])]),YL=$e({name:"InternalSelection",props:Object.assign(Object.assign({},Ht.props),{clsPrefix:{type:String,required:!0},bordered:{type:Boolean,default:void 0},active:Boolean,pattern:{type:String,default:""},placeholder:String,selectedOption:{type:Object,default:null},selectedOptions:{type:Array,default:null},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},multiple:Boolean,filterable:Boolean,clearable:Boolean,disabled:Boolean,size:{type:String,default:"medium"},loading:Boolean,autofocus:Boolean,showArrow:{type:Boolean,default:!0},inputProps:Object,focused:Boolean,renderTag:Function,onKeydown:Function,onClick:Function,onBlur:Function,onFocus:Function,onDeleteOption:Function,maxTagCount:[String,Number],ellipsisTagPopoverProps:Object,onClear:Function,onPatternInput:Function,onPatternFocus:Function,onPatternBlur:Function,renderLabel:Function,status:String,inlineThemeDisabled:Boolean,ignoreComposition:{type:Boolean,default:!0},onResize:Function}),setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=mn(e),s=ui("InternalSelection",n,t),i=H(null),a=H(null),d=H(null),r=H(null),o=H(null),c=H(null),p=H(null),u=H(null),g=H(null),m=H(null),y=H(!1),v=H(!1),l=H(!1),h=Ht("InternalSelection","-internal-selection",qL,Gb,e,dt(e,"clsPrefix")),f=j(()=>e.clearable&&!e.disabled&&(l.value||e.active)),_=j(()=>e.selectedOption?e.renderTag?e.renderTag({option:e.selectedOption,handleClose:()=>{}}):e.renderLabel?e.renderLabel(e.selectedOption,!0):li(e.selectedOption[e.labelField],e.selectedOption,!0):e.placeholder),S=j(()=>{const _e=e.selectedOption;if(_e)return _e[e.labelField]}),k=j(()=>e.multiple?!!(Array.isArray(e.selectedOptions)&&e.selectedOptions.length):e.selectedOption!==null);function P(){var _e;const{value:be}=i;if(be){const{value:Me}=a;Me&&(Me.style.width=`${be.offsetWidth}px`,e.maxTagCount!=="responsive"&&((_e=g.value)===null||_e===void 0||_e.sync({showAllItemsBeforeCalculate:!1})))}}function M(){const{value:_e}=m;_e&&(_e.style.display="none")}function w(){const{value:_e}=m;_e&&(_e.style.display="inline-block")}yt(dt(e,"active"),_e=>{_e||M()}),yt(dt(e,"pattern"),()=>{e.multiple&&cn(P)});function T(_e){const{onFocus:be}=e;be&&be(_e)}function A(_e){const{onBlur:be}=e;be&&be(_e)}function E(_e){const{onDeleteOption:be}=e;be&&be(_e)}function R(_e){const{onClear:be}=e;be&&be(_e)}function D(_e){const{onPatternInput:be}=e;be&&be(_e)}function I(_e){var be;(!_e.relatedTarget||!(!((be=d.value)===null||be===void 0)&&be.contains(_e.relatedTarget)))&&T(_e)}function O(_e){var be;!((be=d.value)===null||be===void 0)&&be.contains(_e.relatedTarget)||A(_e)}function U(_e){R(_e)}function W(){l.value=!0}function z(){l.value=!1}function N(_e){!e.active||!e.filterable||_e.target!==a.value&&_e.preventDefault()}function V(_e){E(_e)}const q=H(!1);function G(_e){if(_e.key==="Backspace"&&!q.value&&!e.pattern.length){const{selectedOptions:be}=e;be!=null&&be.length&&V(be[be.length-1])}}let te=null;function oe(_e){const{value:be}=i;if(be){const Me=_e.target.value;be.textContent=Me,P()}e.ignoreComposition&&q.value?te=_e:D(_e)}function ie(){q.value=!0}function ye(){q.value=!1,e.ignoreComposition&&D(te),te=null}function K(_e){var be;v.value=!0,(be=e.onPatternFocus)===null||be===void 0||be.call(e,_e)}function J(_e){var be;v.value=!1,(be=e.onPatternBlur)===null||be===void 0||be.call(e,_e)}function Q(){var _e,be;if(e.filterable)v.value=!1,(_e=c.value)===null||_e===void 0||_e.blur(),(be=a.value)===null||be===void 0||be.blur();else if(e.multiple){const{value:Me}=r;Me==null||Me.blur()}else{const{value:Me}=o;Me==null||Me.blur()}}function ce(){var _e,be,Me;e.filterable?(v.value=!1,(_e=c.value)===null||_e===void 0||_e.focus()):e.multiple?(be=r.value)===null||be===void 0||be.focus():(Me=o.value)===null||Me===void 0||Me.focus()}function Fe(){const{value:_e}=a;_e&&(w(),_e.focus())}function Ee(){const{value:_e}=a;_e&&_e.blur()}function Ye(_e){const{value:be}=p;be&&be.setTextContent(`+${_e}`)}function Ze(){const{value:_e}=u;return _e}function ue(){return a.value}let et=null;function re(){et!==null&&window.clearTimeout(et)}function we(){e.active||(re(),et=window.setTimeout(()=>{k.value&&(y.value=!0)},100))}function fe(){re()}function De(_e){_e||(re(),y.value=!1)}yt(k,_e=>{_e||(y.value=!1)}),Dt(()=>{zs(()=>{const _e=c.value;_e&&(e.disabled?_e.removeAttribute("tabindex"):_e.tabIndex=v.value?-1:0)})}),v_(d,e.onResize);const{inlineThemeDisabled:Qe}=e,We=j(()=>{const{size:_e}=e,{common:{cubicBezierEaseInOut:be},self:{fontWeight:Me,borderRadius:x,color:Re,placeholderColor:Ge,textColor:Ve,paddingSingle:kt,paddingMultiple:Je,caretColor:wt,colorDisabled:tt,textColorDisabled:mt,placeholderColorDisabled:se,colorActive:de,boxShadowFocus:Le,boxShadowActive:Ae,boxShadowHover:ct,border:ve,borderFocus:Be,borderHover:me,borderActive:rt,arrowColor:At,arrowColorDisabled:St,loadingColor:xe,colorActiveWarning:je,boxShadowFocusWarning:ft,boxShadowActiveWarning:Tt,boxShadowHoverWarning:qt,borderWarning:zt,borderFocusWarning:Yt,borderHoverWarning:Qt,borderActiveWarning:xn,colorActiveError:$n,boxShadowFocusError:Xt,boxShadowActiveError:Gt,boxShadowHoverError:Rn,borderError:Zt,borderFocusError:on,borderHoverError:Ot,borderActiveError:Hn,clearColor:Tn,clearColorHover:bn,clearColorPressed:fn,clearSize:ss,arrowSize:Nn,[Mt("height",_e)]:ke,[Mt("fontSize",_e)]:nt}}=h.value,gt=ao(kt),It=ao(Je);return{"--n-bezier":be,"--n-border":ve,"--n-border-active":rt,"--n-border-focus":Be,"--n-border-hover":me,"--n-border-radius":x,"--n-box-shadow-active":Ae,"--n-box-shadow-focus":Le,"--n-box-shadow-hover":ct,"--n-caret-color":wt,"--n-color":Re,"--n-color-active":de,"--n-color-disabled":tt,"--n-font-size":nt,"--n-height":ke,"--n-padding-single-top":gt.top,"--n-padding-multiple-top":It.top,"--n-padding-single-right":gt.right,"--n-padding-multiple-right":It.right,"--n-padding-single-left":gt.left,"--n-padding-multiple-left":It.left,"--n-padding-single-bottom":gt.bottom,"--n-padding-multiple-bottom":It.bottom,"--n-placeholder-color":Ge,"--n-placeholder-color-disabled":se,"--n-text-color":Ve,"--n-text-color-disabled":mt,"--n-arrow-color":At,"--n-arrow-color-disabled":St,"--n-loading-color":xe,"--n-color-active-warning":je,"--n-box-shadow-focus-warning":ft,"--n-box-shadow-active-warning":Tt,"--n-box-shadow-hover-warning":qt,"--n-border-warning":zt,"--n-border-focus-warning":Yt,"--n-border-hover-warning":Qt,"--n-border-active-warning":xn,"--n-color-active-error":$n,"--n-box-shadow-focus-error":Xt,"--n-box-shadow-active-error":Gt,"--n-box-shadow-hover-error":Rn,"--n-border-error":Zt,"--n-border-focus-error":on,"--n-border-hover-error":Ot,"--n-border-active-error":Hn,"--n-clear-size":ss,"--n-clear-color":Tn,"--n-clear-color-hover":bn,"--n-clear-color-pressed":fn,"--n-arrow-size":Nn,"--n-font-weight":Me}}),ae=Qe?Bn("internal-selection",j(()=>e.size[0]),We,e):void 0;return{mergedTheme:h,mergedClearable:f,mergedClsPrefix:t,rtlEnabled:s,patternInputFocused:v,filterablePlaceholder:_,label:S,selected:k,showTagsPanel:y,isComposing:q,counterRef:p,counterWrapperRef:u,patternInputMirrorRef:i,patternInputRef:a,selfRef:d,multipleElRef:r,singleElRef:o,patternInputWrapperRef:c,overflowRef:g,inputTagElRef:m,handleMouseDown:N,handleFocusin:I,handleClear:U,handleMouseEnter:W,handleMouseLeave:z,handleDeleteOption:V,handlePatternKeyDown:G,handlePatternInputInput:oe,handlePatternInputBlur:J,handlePatternInputFocus:K,handleMouseEnterCounter:we,handleMouseLeaveCounter:fe,handleFocusout:O,handleCompositionEnd:ye,handleCompositionStart:ie,onPopoverUpdateShow:De,focus:ce,focusInput:Fe,blur:Q,blurInput:Ee,updateCounter:Ye,getCounter:Ze,getTail:ue,renderLabel:e.renderLabel,cssVars:Qe?void 0:We,themeClass:ae==null?void 0:ae.themeClass,onRender:ae==null?void 0:ae.onRender}},render(){const{status:e,multiple:t,size:n,disabled:s,filterable:i,maxTagCount:a,bordered:d,clsPrefix:r,ellipsisTagPopoverProps:o,onRender:c,renderTag:p,renderLabel:u}=this;c==null||c();const g=a==="responsive",m=typeof a=="number",y=g||m,v=B(qb,null,{default:()=>B(Yb,{clsPrefix:r,loading:this.loading,showArrow:this.showArrow,showClear:this.mergedClearable&&this.selected,onClear:this.handleClear},{default:()=>{var h,f;return(f=(h=this.$slots).arrow)===null||f===void 0?void 0:f.call(h)}})});let l;if(t){const{labelField:h}=this,f=D=>B("div",{class:`${r}-base-selection-tag-wrapper`,key:D.value},p?p({option:D,handleClose:()=>{this.handleDeleteOption(D)}}):B(Mr,{size:n,closable:!D.disabled,disabled:s,onClose:()=>{this.handleDeleteOption(D)},internalCloseIsButtonTag:!1,internalCloseFocusable:!1},{default:()=>u?u(D,!0):li(D[h],D,!0)})),_=()=>(m?this.selectedOptions.slice(0,a):this.selectedOptions).map(f),S=i?B("div",{class:`${r}-base-selection-input-tag`,ref:"inputTagElRef",key:"__input-tag__"},B("input",Object.assign({},this.inputProps,{ref:"patternInputRef",tabindex:-1,disabled:s,value:this.pattern,autofocus:this.autofocus,class:`${r}-base-selection-input-tag__input`,onBlur:this.handlePatternInputBlur,onFocus:this.handlePatternInputFocus,onKeydown:this.handlePatternKeyDown,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),B("span",{ref:"patternInputMirrorRef",class:`${r}-base-selection-input-tag__mirror`},this.pattern)):null,k=g?()=>B("div",{class:`${r}-base-selection-tag-wrapper`,ref:"counterWrapperRef"},B(Mr,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,onMouseleave:this.handleMouseLeaveCounter,disabled:s})):void 0;let P;if(m){const D=this.selectedOptions.length-a;D>0&&(P=B("div",{class:`${r}-base-selection-tag-wrapper`,key:"__counter__"},B(Mr,{size:n,ref:"counterRef",onMouseenter:this.handleMouseEnterCounter,disabled:s},{default:()=>`+${D}`})))}const M=g?i?B(Ep,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,getTail:this.getTail,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:_,counter:k,tail:()=>S}):B(Ep,{ref:"overflowRef",updateCounter:this.updateCounter,getCounter:this.getCounter,style:{width:"100%",display:"flex",overflow:"hidden"}},{default:_,counter:k}):m&&P?_().concat(P):_(),w=y?()=>B("div",{class:`${r}-base-selection-popover`},g?_():this.selectedOptions.map(f)):void 0,T=y?Object.assign({show:this.showTagsPanel,trigger:"hover",overlap:!0,placement:"top",width:"trigger",onUpdateShow:this.onPopoverUpdateShow,theme:this.mergedTheme.peers.Popover,themeOverrides:this.mergedTheme.peerOverrides.Popover},o):null,E=(this.selected?!1:this.active?!this.pattern&&!this.isComposing:!0)?B("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`},B("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)):null,R=i?B("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-tags`},M,g?null:S,v):B("div",{ref:"multipleElRef",class:`${r}-base-selection-tags`,tabindex:s?void 0:0},M,v);l=B(Oe,null,y?B(Ao,Object.assign({},T,{scrollable:!0,style:"max-height: calc(var(--v-target-height) * 6.6);"}),{trigger:()=>R,default:w}):R,E)}else if(i){const h=this.pattern||this.isComposing,f=this.active?!h:!this.selected,_=this.active?!1:this.selected;l=B("div",{ref:"patternInputWrapperRef",class:`${r}-base-selection-label`,title:this.patternInputFocused?void 0:Lp(this.label)},B("input",Object.assign({},this.inputProps,{ref:"patternInputRef",class:`${r}-base-selection-input`,value:this.active?this.pattern:"",placeholder:"",readonly:s,disabled:s,tabindex:-1,autofocus:this.autofocus,onFocus:this.handlePatternInputFocus,onBlur:this.handlePatternInputBlur,onInput:this.handlePatternInputInput,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd})),_?B("div",{class:`${r}-base-selection-label__render-label ${r}-base-selection-overlay`,key:"input"},B("div",{class:`${r}-base-selection-overlay__wrapper`},p?p({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):li(this.label,this.selectedOption,!0))):null,f?B("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},B("div",{class:`${r}-base-selection-overlay__wrapper`},this.filterablePlaceholder)):null,v)}else l=B("div",{ref:"singleElRef",class:`${r}-base-selection-label`,tabindex:this.disabled?void 0:0},this.label!==void 0?B("div",{class:`${r}-base-selection-input`,title:Lp(this.label),key:"input"},B("div",{class:`${r}-base-selection-input__content`},p?p({option:this.selectedOption,handleClose:()=>{}}):u?u(this.selectedOption,!0):li(this.label,this.selectedOption,!0))):B("div",{class:`${r}-base-selection-placeholder ${r}-base-selection-overlay`,key:"placeholder"},B("div",{class:`${r}-base-selection-placeholder__inner`},this.placeholder)),v);return B("div",{ref:"selfRef",class:[`${r}-base-selection`,this.rtlEnabled&&`${r}-base-selection--rtl`,this.themeClass,e&&`${r}-base-selection--${e}-status`,{[`${r}-base-selection--active`]:this.active,[`${r}-base-selection--selected`]:this.selected||this.active&&this.pattern,[`${r}-base-selection--disabled`]:this.disabled,[`${r}-base-selection--multiple`]:this.multiple,[`${r}-base-selection--focus`]:this.focused}],style:this.cssVars,onClick:this.onClick,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onKeydown:this.onKeydown,onFocusin:this.handleFocusin,onFocusout:this.handleFocusout,onMousedown:this.handleMouseDown},l,d?B("div",{class:`${r}-base-selection__border`}):null,d?B("div",{class:`${r}-base-selection__state-border`}):null)}});function Ul(e){return e.type==="group"}function T_(e){return e.type==="ignored"}function od(e,t){try{return!!(1+t.toString().toLowerCase().indexOf(e.trim().toLowerCase()))}catch{return!1}}function P_(e,t){return{getIsGroup:Ul,getIgnored:T_,getKey(s){return Ul(s)?s.name||s.key||"key-required":s[e]},getChildren(s){return s[t]}}}function GL(e,t,n,s){if(!t)return e;function i(a){if(!Array.isArray(a))return[];const d=[];for(const r of a)if(Ul(r)){const o=i(r[s]);o.length&&d.push(Object.assign({},r,{[s]:o}))}else{if(T_(r))continue;t(n,r)&&d.push(r)}return d}return i(e)}function XL(e,t,n){const s=new Map;return e.forEach(i=>{Ul(i)?i[n].forEach(a=>{s.set(a[t],a)}):s.set(i[t],i)}),s}function un(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function io(e,t){const n=Ft(e);return isNaN(t)?un(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function Zn(e,t){const n=Ft(e);if(isNaN(t))return un(e,NaN);if(!t)return n;const s=n.getDate(),i=un(e,n.getTime());i.setMonth(n.getMonth()+t+1,0);const a=i.getDate();return s>=a?i:(n.setFullYear(i.getFullYear(),i.getMonth(),s),n)}const E_=6048e5,JL=864e5,QL=6e4,ZL=36e5,eD=1e3;function bo(e){return $i(e,{weekStartsOn:1})}function L_(e){const t=Ft(e),n=t.getFullYear(),s=un(e,0);s.setFullYear(n+1,0,4),s.setHours(0,0,0,0);const i=bo(s),a=un(e,0);a.setFullYear(n,0,4),a.setHours(0,0,0,0);const d=bo(a);return t.getTime()>=i.getTime()?n+1:t.getTime()>=d.getTime()?n:n-1}function wo(e){const t=Ft(e);return t.setHours(0,0,0,0),t}function Vl(e){const t=Ft(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function tD(e,t){const n=wo(e),s=wo(t),i=+n-Vl(n),a=+s-Vl(s);return Math.round((i-a)/JL)}function nD(e){const t=L_(e),n=un(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),bo(n)}function sD(e,t){const n=t*3;return Zn(e,n)}function su(e,t){return Zn(e,t*12)}function iD(e,t){const n=wo(e),s=wo(t);return+n==+s}function rD(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function Hs(e){if(!rD(e)&&typeof e!="number")return!1;const t=Ft(e);return!isNaN(Number(t))}function oD(e){const t=Ft(e);return Math.trunc(t.getMonth()/3)+1}function aD(e){const t=Ft(e);return t.setSeconds(0,0),t}function ma(e){const t=Ft(e),n=t.getMonth(),s=n-n%3;return t.setMonth(s,1),t.setHours(0,0,0,0),t}function Ri(e){const t=Ft(e);return t.setDate(1),t.setHours(0,0,0,0),t}function xa(e){const t=Ft(e),n=un(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function lD(e){const t=Ft(e);return tD(t,xa(t))+1}function D_(e){const t=Ft(e),n=+bo(t)-+nD(t);return Math.round(n/E_)+1}function ah(e,t){var p,u,g,m;const n=Ft(e),s=n.getFullYear(),i=wa(),a=(t==null?void 0:t.firstWeekContainsDate)??((u=(p=t==null?void 0:t.locale)==null?void 0:p.options)==null?void 0:u.firstWeekContainsDate)??i.firstWeekContainsDate??((m=(g=i.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??1,d=un(e,0);d.setFullYear(s+1,0,a),d.setHours(0,0,0,0);const r=$i(d,t),o=un(e,0);o.setFullYear(s,0,a),o.setHours(0,0,0,0);const c=$i(o,t);return n.getTime()>=r.getTime()?s+1:n.getTime()>=c.getTime()?s:s-1}function cD(e,t){var r,o,c,p;const n=wa(),s=(t==null?void 0:t.firstWeekContainsDate)??((o=(r=t==null?void 0:t.locale)==null?void 0:r.options)==null?void 0:o.firstWeekContainsDate)??n.firstWeekContainsDate??((p=(c=n.locale)==null?void 0:c.options)==null?void 0:p.firstWeekContainsDate)??1,i=ah(e,t),a=un(e,0);return a.setFullYear(i,0,s),a.setHours(0,0,0,0),$i(a,t)}function M_(e,t){const n=Ft(e),s=+$i(n,t)-+cD(n,t);return Math.round(s/E_)+1}function an(e,t){const n=e<0?"-":"",s=Math.abs(e).toString().padStart(t,"0");return n+s}const Yi={y(e,t){const n=e.getFullYear(),s=n>0?n:1-n;return an(t==="yy"?s%100:s,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):an(n+1,2)},d(e,t){return an(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return an(e.getHours()%12||12,t.length)},H(e,t){return an(e.getHours(),t.length)},m(e,t){return an(e.getMinutes(),t.length)},s(e,t){return an(e.getSeconds(),t.length)},S(e,t){const n=t.length,s=e.getMilliseconds(),i=Math.trunc(s*Math.pow(10,n-3));return an(i,t.length)}},Xr={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Qp={G:function(e,t,n){const s=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(s,{width:"abbreviated"});case"GGGGG":return n.era(s,{width:"narrow"});case"GGGG":default:return n.era(s,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const s=e.getFullYear(),i=s>0?s:1-s;return n.ordinalNumber(i,{unit:"year"})}return Yi.y(e,t)},Y:function(e,t,n,s){const i=ah(e,s),a=i>0?i:1-i;if(t==="YY"){const d=a%100;return an(d,2)}return t==="Yo"?n.ordinalNumber(a,{unit:"year"}):an(a,t.length)},R:function(e,t){const n=L_(e);return an(n,t.length)},u:function(e,t){const n=e.getFullYear();return an(n,t.length)},Q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(s);case"QQ":return an(s,2);case"Qo":return n.ordinalNumber(s,{unit:"quarter"});case"QQQ":return n.quarter(s,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(s,{width:"wide",context:"formatting"})}},q:function(e,t,n){const s=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(s);case"qq":return an(s,2);case"qo":return n.ordinalNumber(s,{unit:"quarter"});case"qqq":return n.quarter(s,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(s,{width:"wide",context:"standalone"})}},M:function(e,t,n){const s=e.getMonth();switch(t){case"M":case"MM":return Yi.M(e,t);case"Mo":return n.ordinalNumber(s+1,{unit:"month"});case"MMM":return n.month(s,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(s,{width:"wide",context:"formatting"})}},L:function(e,t,n){const s=e.getMonth();switch(t){case"L":return String(s+1);case"LL":return an(s+1,2);case"Lo":return n.ordinalNumber(s+1,{unit:"month"});case"LLL":return n.month(s,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(s,{width:"wide",context:"standalone"})}},w:function(e,t,n,s){const i=M_(e,s);return t==="wo"?n.ordinalNumber(i,{unit:"week"}):an(i,t.length)},I:function(e,t,n){const s=D_(e);return t==="Io"?n.ordinalNumber(s,{unit:"week"}):an(s,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Yi.d(e,t)},D:function(e,t,n){const s=lD(e);return t==="Do"?n.ordinalNumber(s,{unit:"dayOfYear"}):an(s,t.length)},E:function(e,t,n){const s=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(s,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(s,{width:"short",context:"formatting"});case"EEEE":default:return n.day(s,{width:"wide",context:"formatting"})}},e:function(e,t,n,s){const i=e.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(t){case"e":return String(a);case"ee":return an(a,2);case"eo":return n.ordinalNumber(a,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});case"eeee":default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,s){const i=e.getDay(),a=(i-s.weekStartsOn+8)%7||7;switch(t){case"c":return String(a);case"cc":return an(a,t.length);case"co":return n.ordinalNumber(a,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});case"cccc":default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){const s=e.getDay(),i=s===0?7:s;switch(t){case"i":return String(i);case"ii":return an(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(s,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(s,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(s,{width:"short",context:"formatting"});case"iiii":default:return n.day(s,{width:"wide",context:"formatting"})}},a:function(e,t,n){const i=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},b:function(e,t,n){const s=e.getHours();let i;switch(s===12?i=Xr.noon:s===0?i=Xr.midnight:i=s/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},B:function(e,t,n){const s=e.getHours();let i;switch(s>=17?i=Xr.evening:s>=12?i=Xr.afternoon:s>=4?i=Xr.morning:i=Xr.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(i,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(i,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(i,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let s=e.getHours()%12;return s===0&&(s=12),n.ordinalNumber(s,{unit:"hour"})}return Yi.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Yi.H(e,t)},K:function(e,t,n){const s=e.getHours()%12;return t==="Ko"?n.ordinalNumber(s,{unit:"hour"}):an(s,t.length)},k:function(e,t,n){let s=e.getHours();return s===0&&(s=24),t==="ko"?n.ordinalNumber(s,{unit:"hour"}):an(s,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Yi.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Yi.s(e,t)},S:function(e,t){return Yi.S(e,t)},X:function(e,t,n){const s=e.getTimezoneOffset();if(s===0)return"Z";switch(t){case"X":return ev(s);case"XXXX":case"XX":return xr(s);case"XXXXX":case"XXX":default:return xr(s,":")}},x:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"x":return ev(s);case"xxxx":case"xx":return xr(s);case"xxxxx":case"xxx":default:return xr(s,":")}},O:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Zp(s,":");case"OOOO":default:return"GMT"+xr(s,":")}},z:function(e,t,n){const s=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Zp(s,":");case"zzzz":default:return"GMT"+xr(s,":")}},t:function(e,t,n){const s=Math.trunc(e.getTime()/1e3);return an(s,t.length)},T:function(e,t,n){const s=e.getTime();return an(s,t.length)}};function Zp(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=Math.trunc(s/60),a=s%60;return a===0?n+String(i):n+String(i)+t+an(a,2)}function ev(e,t){return e%60===0?(e>0?"-":"+")+an(Math.abs(e)/60,2):xr(e,t)}function xr(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=an(Math.trunc(s/60),2),a=an(s%60,2);return n+i+t+a}const tv=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},A_=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},dD=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],s=n[1],i=n[2];if(!i)return tv(e,t);let a;switch(s){case"P":a=t.dateTime({width:"short"});break;case"PP":a=t.dateTime({width:"medium"});break;case"PPP":a=t.dateTime({width:"long"});break;case"PPPP":default:a=t.dateTime({width:"full"});break}return a.replace("{{date}}",tv(s,t)).replace("{{time}}",A_(i,t))},iu={p:A_,P:dD},uD=/^D+$/,hD=/^Y+$/,fD=["D","DD","YY","YYYY"];function I_(e){return uD.test(e)}function $_(e){return hD.test(e)}function ru(e,t,n){const s=pD(e,t,n);if(console.warn(s),fD.includes(e))throw new RangeError(s)}function pD(e,t,n){const s=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${s} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const vD=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,gD=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,mD=/^'([^]*?)'?$/,_D=/''/g,yD=/[a-zA-Z]/;function ln(e,t,n){var p,u,g,m,y,v,l,h;const s=wa(),i=(n==null?void 0:n.locale)??s.locale??cg,a=(n==null?void 0:n.firstWeekContainsDate)??((u=(p=n==null?void 0:n.locale)==null?void 0:p.options)==null?void 0:u.firstWeekContainsDate)??s.firstWeekContainsDate??((m=(g=s.locale)==null?void 0:g.options)==null?void 0:m.firstWeekContainsDate)??1,d=(n==null?void 0:n.weekStartsOn)??((v=(y=n==null?void 0:n.locale)==null?void 0:y.options)==null?void 0:v.weekStartsOn)??s.weekStartsOn??((h=(l=s.locale)==null?void 0:l.options)==null?void 0:h.weekStartsOn)??0,r=Ft(e);if(!Hs(r))throw new RangeError("Invalid time value");let o=t.match(gD).map(f=>{const _=f[0];if(_==="p"||_==="P"){const S=iu[_];return S(f,i.formatLong)}return f}).join("").match(vD).map(f=>{if(f==="''")return{isToken:!1,value:"'"};const _=f[0];if(_==="'")return{isToken:!1,value:bD(f)};if(Qp[_])return{isToken:!0,value:f};if(_.match(yD))throw new RangeError("Format string contains an unescaped latin alphabet character `"+_+"`");return{isToken:!1,value:f}});i.localize.preprocessor&&(o=i.localize.preprocessor(r,o));const c={firstWeekContainsDate:a,weekStartsOn:d,locale:i};return o.map(f=>{if(!f.isToken)return f.value;const _=f.value;(!(n!=null&&n.useAdditionalWeekYearTokens)&&$_(_)||!(n!=null&&n.useAdditionalDayOfYearTokens)&&I_(_))&&ru(_,t,String(e));const S=Qp[_[0]];return S(r,_,i.localize,c)}).join("")}function bD(e){const t=e.match(mD);return t?t[1].replace(_D,"'"):e}function Fs(e){return Ft(e).getDate()}function wD(e){return Ft(e).getDay()}function SD(e){const t=Ft(e),n=t.getFullYear(),s=t.getMonth(),i=un(e,0);return i.setFullYear(n,s+1,0),i.setHours(0,0,0,0),i.getDate()}function O_(){return Object.assign({},wa())}function Zi(e){return Ft(e).getHours()}function CD(e){let n=Ft(e).getDay();return n===0&&(n=7),n}function kD(e){return Ft(e).getMilliseconds()}function Kl(e){return Ft(e).getMinutes()}function yn(e){return Ft(e).getMonth()}function Wl(e){return Ft(e).getSeconds()}function ht(e){return Ft(e).getTime()}function Ln(e){return Ft(e).getFullYear()}function xD(e,t){const n=t instanceof Date?un(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const RD=10;class F_{constructor(){Y(this,"subPriority",0)}validate(t,n){return!0}}class TD extends F_{constructor(t,n,s,i,a){super(),this.value=t,this.validateValue=n,this.setValue=s,this.priority=i,a&&(this.subPriority=a)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,s){return this.setValue(t,n,this.value,s)}}class PD extends F_{constructor(){super(...arguments);Y(this,"priority",RD);Y(this,"subPriority",-1)}set(n,s){return s.timestampIsSet?n:un(n,xD(n,Date))}}class sn{run(t,n,s,i){const a=this.parse(t,n,s,i);return a?{setter:new TD(a.value,this.validate,this.set,this.priority,this.subPriority),rest:a.rest}:null}validate(t,n,s){return!0}}class ED extends sn{constructor(){super(...arguments);Y(this,"priority",140);Y(this,"incompatibleTokens",["R","u","t","T"])}parse(n,s,i){switch(s){case"G":case"GG":case"GGG":return i.era(n,{width:"abbreviated"})||i.era(n,{width:"narrow"});case"GGGGG":return i.era(n,{width:"narrow"});case"GGGG":default:return i.era(n,{width:"wide"})||i.era(n,{width:"abbreviated"})||i.era(n,{width:"narrow"})}}set(n,s,i){return s.era=i,n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}}const An={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},oi={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function In(e,t){return e&&{value:t(e.value),rest:e.rest}}function Dn(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function ai(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const s=n[1]==="+"?1:-1,i=n[2]?parseInt(n[2],10):0,a=n[3]?parseInt(n[3],10):0,d=n[5]?parseInt(n[5],10):0;return{value:s*(i*ZL+a*QL+d*eD),rest:t.slice(n[0].length)}}function B_(e){return Dn(An.anyDigitsSigned,e)}function Mn(e,t){switch(e){case 1:return Dn(An.singleDigit,t);case 2:return Dn(An.twoDigits,t);case 3:return Dn(An.threeDigits,t);case 4:return Dn(An.fourDigits,t);default:return Dn(new RegExp("^\\d{1,"+e+"}"),t)}}function jl(e,t){switch(e){case 1:return Dn(An.singleDigitSigned,t);case 2:return Dn(An.twoDigitsSigned,t);case 3:return Dn(An.threeDigitsSigned,t);case 4:return Dn(An.fourDigitsSigned,t);default:return Dn(new RegExp("^-?\\d{1,"+e+"}"),t)}}function lh(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function H_(e,t){const n=t>0,s=n?t:1-t;let i;if(s<=50)i=e||100;else{const a=s+50,d=Math.trunc(a/100)*100,r=e>=a%100;i=e+d-(r?100:0)}return n?i:1-i}function N_(e){return e%400===0||e%4===0&&e%100!==0}class LD extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(n,s,i){const a=d=>({year:d,isTwoDigitYear:s==="yy"});switch(s){case"y":return In(Mn(4,n),a);case"yo":return In(i.ordinalNumber(n,{unit:"year"}),a);default:return In(Mn(s.length,n),a)}}validate(n,s){return s.isTwoDigitYear||s.year>0}set(n,s,i){const a=n.getFullYear();if(i.isTwoDigitYear){const r=H_(i.year,a);return n.setFullYear(r,0,1),n.setHours(0,0,0,0),n}const d=!("era"in s)||s.era===1?i.year:1-i.year;return n.setFullYear(d,0,1),n.setHours(0,0,0,0),n}}class DD extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(n,s,i){const a=d=>({year:d,isTwoDigitYear:s==="YY"});switch(s){case"Y":return In(Mn(4,n),a);case"Yo":return In(i.ordinalNumber(n,{unit:"year"}),a);default:return In(Mn(s.length,n),a)}}validate(n,s){return s.isTwoDigitYear||s.year>0}set(n,s,i,a){const d=ah(n,a);if(i.isTwoDigitYear){const o=H_(i.year,d);return n.setFullYear(o,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),$i(n,a)}const r=!("era"in s)||s.era===1?i.year:1-i.year;return n.setFullYear(r,0,a.firstWeekContainsDate),n.setHours(0,0,0,0),$i(n,a)}}class MD extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(n,s){return jl(s==="R"?4:s.length,n)}set(n,s,i){const a=un(n,0);return a.setFullYear(i,0,4),a.setHours(0,0,0,0),bo(a)}}class AD extends sn{constructor(){super(...arguments);Y(this,"priority",130);Y(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(n,s){return jl(s==="u"?4:s.length,n)}set(n,s,i){return n.setFullYear(i,0,1),n.setHours(0,0,0,0),n}}class ID extends sn{constructor(){super(...arguments);Y(this,"priority",120);Y(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"Q":case"QQ":return Mn(s.length,n);case"Qo":return i.ordinalNumber(n,{unit:"quarter"});case"QQQ":return i.quarter(n,{width:"abbreviated",context:"formatting"})||i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQQ":return i.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return i.quarter(n,{width:"wide",context:"formatting"})||i.quarter(n,{width:"abbreviated",context:"formatting"})||i.quarter(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=1&&s<=4}set(n,s,i){return n.setMonth((i-1)*3,1),n.setHours(0,0,0,0),n}}class $D extends sn{constructor(){super(...arguments);Y(this,"priority",120);Y(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"q":case"qq":return Mn(s.length,n);case"qo":return i.ordinalNumber(n,{unit:"quarter"});case"qqq":return i.quarter(n,{width:"abbreviated",context:"standalone"})||i.quarter(n,{width:"narrow",context:"standalone"});case"qqqqq":return i.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return i.quarter(n,{width:"wide",context:"standalone"})||i.quarter(n,{width:"abbreviated",context:"standalone"})||i.quarter(n,{width:"narrow",context:"standalone"})}}validate(n,s){return s>=1&&s<=4}set(n,s,i){return n.setMonth((i-1)*3,1),n.setHours(0,0,0,0),n}}class OD extends sn{constructor(){super(...arguments);Y(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);Y(this,"priority",110)}parse(n,s,i){const a=d=>d-1;switch(s){case"M":return In(Dn(An.month,n),a);case"MM":return In(Mn(2,n),a);case"Mo":return In(i.ordinalNumber(n,{unit:"month"}),a);case"MMM":return i.month(n,{width:"abbreviated",context:"formatting"})||i.month(n,{width:"narrow",context:"formatting"});case"MMMMM":return i.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return i.month(n,{width:"wide",context:"formatting"})||i.month(n,{width:"abbreviated",context:"formatting"})||i.month(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=0&&s<=11}set(n,s,i){return n.setMonth(i,1),n.setHours(0,0,0,0),n}}class FD extends sn{constructor(){super(...arguments);Y(this,"priority",110);Y(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(n,s,i){const a=d=>d-1;switch(s){case"L":return In(Dn(An.month,n),a);case"LL":return In(Mn(2,n),a);case"Lo":return In(i.ordinalNumber(n,{unit:"month"}),a);case"LLL":return i.month(n,{width:"abbreviated",context:"standalone"})||i.month(n,{width:"narrow",context:"standalone"});case"LLLLL":return i.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return i.month(n,{width:"wide",context:"standalone"})||i.month(n,{width:"abbreviated",context:"standalone"})||i.month(n,{width:"narrow",context:"standalone"})}}validate(n,s){return s>=0&&s<=11}set(n,s,i){return n.setMonth(i,1),n.setHours(0,0,0,0),n}}function BD(e,t,n){const s=Ft(e),i=M_(s,n)-t;return s.setDate(s.getDate()-i*7),s}class HD extends sn{constructor(){super(...arguments);Y(this,"priority",100);Y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(n,s,i){switch(s){case"w":return Dn(An.week,n);case"wo":return i.ordinalNumber(n,{unit:"week"});default:return Mn(s.length,n)}}validate(n,s){return s>=1&&s<=53}set(n,s,i,a){return $i(BD(n,i,a),a)}}function ND(e,t){const n=Ft(e),s=D_(n)-t;return n.setDate(n.getDate()-s*7),n}class zD extends sn{constructor(){super(...arguments);Y(this,"priority",100);Y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(n,s,i){switch(s){case"I":return Dn(An.week,n);case"Io":return i.ordinalNumber(n,{unit:"week"});default:return Mn(s.length,n)}}validate(n,s){return s>=1&&s<=53}set(n,s,i){return bo(ND(n,i))}}const UD=[31,28,31,30,31,30,31,31,30,31,30,31],VD=[31,29,31,30,31,30,31,31,30,31,30,31];class KD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"subPriority",1);Y(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"d":return Dn(An.date,n);case"do":return i.ordinalNumber(n,{unit:"date"});default:return Mn(s.length,n)}}validate(n,s){const i=n.getFullYear(),a=N_(i),d=n.getMonth();return a?s>=1&&s<=VD[d]:s>=1&&s<=UD[d]}set(n,s,i){return n.setDate(i),n.setHours(0,0,0,0),n}}class WD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"subpriority",1);Y(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(n,s,i){switch(s){case"D":case"DD":return Dn(An.dayOfYear,n);case"Do":return i.ordinalNumber(n,{unit:"date"});default:return Mn(s.length,n)}}validate(n,s){const i=n.getFullYear();return N_(i)?s>=1&&s<=366:s>=1&&s<=365}set(n,s,i){return n.setMonth(0,i),n.setHours(0,0,0,0),n}}function ch(e,t,n){var u,g,m,y;const s=wa(),i=(n==null?void 0:n.weekStartsOn)??((g=(u=n==null?void 0:n.locale)==null?void 0:u.options)==null?void 0:g.weekStartsOn)??s.weekStartsOn??((y=(m=s.locale)==null?void 0:m.options)==null?void 0:y.weekStartsOn)??0,a=Ft(e),d=a.getDay(),o=(t%7+7)%7,c=7-i,p=t<0||t>6?t-(d+c)%7:(o+c)%7-(d+c)%7;return io(a,p)}class jD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(n,s,i){switch(s){case"E":case"EE":case"EEE":return i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"EEEEE":return i.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"EEEE":default:return i.day(n,{width:"wide",context:"formatting"})||i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=0&&s<=6}set(n,s,i,a){return n=ch(n,i,a),n.setHours(0,0,0,0),n}}class qD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(n,s,i,a){const d=r=>{const o=Math.floor((r-1)/7)*7;return(r+a.weekStartsOn+6)%7+o};switch(s){case"e":case"ee":return In(Mn(s.length,n),d);case"eo":return In(i.ordinalNumber(n,{unit:"day"}),d);case"eee":return i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"eeeee":return i.day(n,{width:"narrow",context:"formatting"});case"eeeeee":return i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"});case"eeee":default:return i.day(n,{width:"wide",context:"formatting"})||i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"})}}validate(n,s){return s>=0&&s<=6}set(n,s,i,a){return n=ch(n,i,a),n.setHours(0,0,0,0),n}}class YD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(n,s,i,a){const d=r=>{const o=Math.floor((r-1)/7)*7;return(r+a.weekStartsOn+6)%7+o};switch(s){case"c":case"cc":return In(Mn(s.length,n),d);case"co":return In(i.ordinalNumber(n,{unit:"day"}),d);case"ccc":return i.day(n,{width:"abbreviated",context:"standalone"})||i.day(n,{width:"short",context:"standalone"})||i.day(n,{width:"narrow",context:"standalone"});case"ccccc":return i.day(n,{width:"narrow",context:"standalone"});case"cccccc":return i.day(n,{width:"short",context:"standalone"})||i.day(n,{width:"narrow",context:"standalone"});case"cccc":default:return i.day(n,{width:"wide",context:"standalone"})||i.day(n,{width:"abbreviated",context:"standalone"})||i.day(n,{width:"short",context:"standalone"})||i.day(n,{width:"narrow",context:"standalone"})}}validate(n,s){return s>=0&&s<=6}set(n,s,i,a){return n=ch(n,i,a),n.setHours(0,0,0,0),n}}function GD(e,t){const n=Ft(e),s=CD(n),i=t-s;return io(n,i)}class XD extends sn{constructor(){super(...arguments);Y(this,"priority",90);Y(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(n,s,i){const a=d=>d===0?7:d;switch(s){case"i":case"ii":return Mn(s.length,n);case"io":return i.ordinalNumber(n,{unit:"day"});case"iii":return In(i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"}),a);case"iiiii":return In(i.day(n,{width:"narrow",context:"formatting"}),a);case"iiiiii":return In(i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"}),a);case"iiii":default:return In(i.day(n,{width:"wide",context:"formatting"})||i.day(n,{width:"abbreviated",context:"formatting"})||i.day(n,{width:"short",context:"formatting"})||i.day(n,{width:"narrow",context:"formatting"}),a)}}validate(n,s){return s>=1&&s<=7}set(n,s,i){return n=GD(n,i),n.setHours(0,0,0,0),n}}class JD extends sn{constructor(){super(...arguments);Y(this,"priority",80);Y(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(n,s,i){switch(s){case"a":case"aa":case"aaa":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaaa":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"aaaa":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})||i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,s,i){return n.setHours(lh(i),0,0,0),n}}class QD extends sn{constructor(){super(...arguments);Y(this,"priority",80);Y(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(n,s,i){switch(s){case"b":case"bb":case"bbb":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbbb":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"bbbb":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})||i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,s,i){return n.setHours(lh(i),0,0,0),n}}class ZD extends sn{constructor(){super(...arguments);Y(this,"priority",80);Y(this,"incompatibleTokens",["a","b","t","T"])}parse(n,s,i){switch(s){case"B":case"BB":case"BBB":return i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBBB":return i.dayPeriod(n,{width:"narrow",context:"formatting"});case"BBBB":default:return i.dayPeriod(n,{width:"wide",context:"formatting"})||i.dayPeriod(n,{width:"abbreviated",context:"formatting"})||i.dayPeriod(n,{width:"narrow",context:"formatting"})}}set(n,s,i){return n.setHours(lh(i),0,0,0),n}}class eM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["H","K","k","t","T"])}parse(n,s,i){switch(s){case"h":return Dn(An.hour12h,n);case"ho":return i.ordinalNumber(n,{unit:"hour"});default:return Mn(s.length,n)}}validate(n,s){return s>=1&&s<=12}set(n,s,i){const a=n.getHours()>=12;return a&&i<12?n.setHours(i+12,0,0,0):!a&&i===12?n.setHours(0,0,0,0):n.setHours(i,0,0,0),n}}class tM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(n,s,i){switch(s){case"H":return Dn(An.hour23h,n);case"Ho":return i.ordinalNumber(n,{unit:"hour"});default:return Mn(s.length,n)}}validate(n,s){return s>=0&&s<=23}set(n,s,i){return n.setHours(i,0,0,0),n}}class nM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["h","H","k","t","T"])}parse(n,s,i){switch(s){case"K":return Dn(An.hour11h,n);case"Ko":return i.ordinalNumber(n,{unit:"hour"});default:return Mn(s.length,n)}}validate(n,s){return s>=0&&s<=11}set(n,s,i){return n.getHours()>=12&&i<12?n.setHours(i+12,0,0,0):n.setHours(i,0,0,0),n}}class sM extends sn{constructor(){super(...arguments);Y(this,"priority",70);Y(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(n,s,i){switch(s){case"k":return Dn(An.hour24h,n);case"ko":return i.ordinalNumber(n,{unit:"hour"});default:return Mn(s.length,n)}}validate(n,s){return s>=1&&s<=24}set(n,s,i){const a=i<=24?i%24:i;return n.setHours(a,0,0,0),n}}class iM extends sn{constructor(){super(...arguments);Y(this,"priority",60);Y(this,"incompatibleTokens",["t","T"])}parse(n,s,i){switch(s){case"m":return Dn(An.minute,n);case"mo":return i.ordinalNumber(n,{unit:"minute"});default:return Mn(s.length,n)}}validate(n,s){return s>=0&&s<=59}set(n,s,i){return n.setMinutes(i,0,0),n}}class rM extends sn{constructor(){super(...arguments);Y(this,"priority",50);Y(this,"incompatibleTokens",["t","T"])}parse(n,s,i){switch(s){case"s":return Dn(An.second,n);case"so":return i.ordinalNumber(n,{unit:"second"});default:return Mn(s.length,n)}}validate(n,s){return s>=0&&s<=59}set(n,s,i){return n.setSeconds(i,0),n}}class oM extends sn{constructor(){super(...arguments);Y(this,"priority",30);Y(this,"incompatibleTokens",["t","T"])}parse(n,s){const i=a=>Math.trunc(a*Math.pow(10,-s.length+3));return In(Mn(s.length,n),i)}set(n,s,i){return n.setMilliseconds(i),n}}class aM extends sn{constructor(){super(...arguments);Y(this,"priority",10);Y(this,"incompatibleTokens",["t","T","x"])}parse(n,s){switch(s){case"X":return ai(oi.basicOptionalMinutes,n);case"XX":return ai(oi.basic,n);case"XXXX":return ai(oi.basicOptionalSeconds,n);case"XXXXX":return ai(oi.extendedOptionalSeconds,n);case"XXX":default:return ai(oi.extended,n)}}set(n,s,i){return s.timestampIsSet?n:un(n,n.getTime()-Vl(n)-i)}}class lM extends sn{constructor(){super(...arguments);Y(this,"priority",10);Y(this,"incompatibleTokens",["t","T","X"])}parse(n,s){switch(s){case"x":return ai(oi.basicOptionalMinutes,n);case"xx":return ai(oi.basic,n);case"xxxx":return ai(oi.basicOptionalSeconds,n);case"xxxxx":return ai(oi.extendedOptionalSeconds,n);case"xxx":default:return ai(oi.extended,n)}}set(n,s,i){return s.timestampIsSet?n:un(n,n.getTime()-Vl(n)-i)}}class cM extends sn{constructor(){super(...arguments);Y(this,"priority",40);Y(this,"incompatibleTokens","*")}parse(n){return B_(n)}set(n,s,i){return[un(n,i*1e3),{timestampIsSet:!0}]}}class dM extends sn{constructor(){super(...arguments);Y(this,"priority",20);Y(this,"incompatibleTokens","*")}parse(n){return B_(n)}set(n,s,i){return[un(n,i),{timestampIsSet:!0}]}}const uM={G:new ED,y:new LD,Y:new DD,R:new MD,u:new AD,Q:new ID,q:new $D,M:new OD,L:new FD,w:new HD,I:new zD,d:new KD,D:new WD,E:new jD,e:new qD,c:new YD,i:new XD,a:new JD,b:new QD,B:new ZD,h:new eM,H:new tM,K:new nM,k:new sM,m:new iM,s:new rM,S:new oM,X:new aM,x:new lM,t:new cM,T:new dM},hM=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,fM=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,pM=/^'([^]*?)'?$/,vM=/''/g,gM=/\S/,mM=/[a-zA-Z]/;function _M(e,t,n,s){var v,l,h,f,_,S,k,P;const i=O_(),a=(s==null?void 0:s.locale)??i.locale??cg,d=(s==null?void 0:s.firstWeekContainsDate)??((l=(v=s==null?void 0:s.locale)==null?void 0:v.options)==null?void 0:l.firstWeekContainsDate)??i.firstWeekContainsDate??((f=(h=i.locale)==null?void 0:h.options)==null?void 0:f.firstWeekContainsDate)??1,r=(s==null?void 0:s.weekStartsOn)??((S=(_=s==null?void 0:s.locale)==null?void 0:_.options)==null?void 0:S.weekStartsOn)??i.weekStartsOn??((P=(k=i.locale)==null?void 0:k.options)==null?void 0:P.weekStartsOn)??0;if(t==="")return e===""?Ft(n):un(n,NaN);const o={firstWeekContainsDate:d,weekStartsOn:r,locale:a},c=[new PD],p=t.match(fM).map(M=>{const w=M[0];if(w in iu){const T=iu[w];return T(M,a.formatLong)}return M}).join("").match(hM),u=[];for(let M of p){!(s!=null&&s.useAdditionalWeekYearTokens)&&$_(M)&&ru(M,t,e),!(s!=null&&s.useAdditionalDayOfYearTokens)&&I_(M)&&ru(M,t,e);const w=M[0],T=uM[w];if(T){const{incompatibleTokens:A}=T;if(Array.isArray(A)){const R=u.find(D=>A.includes(D.token)||D.token===w);if(R)throw new RangeError(`The format string mustn't contain \`${R.fullToken}\` and \`${M}\` at the same time`)}else if(T.incompatibleTokens==="*"&&u.length>0)throw new RangeError(`The format string mustn't contain \`${M}\` and any other token at the same time`);u.push({token:w,fullToken:M});const E=T.run(e,M,a.match,o);if(!E)return un(n,NaN);c.push(E.setter),e=E.rest}else{if(w.match(mM))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");if(M==="''"?M="'":w==="'"&&(M=yM(M)),e.indexOf(M)===0)e=e.slice(M.length);else return un(n,NaN)}}if(e.length>0&&gM.test(e))return un(n,NaN);const g=c.map(M=>M.priority).sort((M,w)=>w-M).filter((M,w,T)=>T.indexOf(M)===w).map(M=>c.filter(w=>w.priority===M).sort((w,T)=>T.subPriority-w.subPriority)).map(M=>M[0]);let m=Ft(n);if(isNaN(m.getTime()))return un(n,NaN);const y={};for(const M of g){if(!M.validate(m,o))return un(n,NaN);const w=M.set(m,y,o);Array.isArray(w)?(m=w[0],Object.assign(y,w[1])):m=w}return un(n,m)}function yM(e){return e.match(pM)[1].replace(vM,"'")}function bM(e){const t=Ft(e);return t.setMinutes(0,0,0),t}function Ra(e,t){const n=Ft(e),s=Ft(t);return n.getFullYear()===s.getFullYear()&&n.getMonth()===s.getMonth()}function z_(e,t){const n=ma(e),s=ma(t);return+n==+s}function dh(e){const t=Ft(e);return t.setMilliseconds(0),t}function U_(e,t){const n=Ft(e),s=Ft(t);return n.getFullYear()===s.getFullYear()}function uh(e,t){const n=Ft(e),s=n.getFullYear(),i=n.getDate(),a=un(e,0);a.setFullYear(s,t,15),a.setHours(0,0,0,0);const d=SD(a);return n.setMonth(t,Math.min(i,d)),n}function es(e,t){let n=Ft(e);return isNaN(+n)?un(e,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=uh(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function kr(e,t){const n=Ft(e);return n.setHours(t),n}function ad(e,t){const n=Ft(e);return n.setMinutes(t),n}function wM(e,t){const n=Ft(e),s=Math.trunc(n.getMonth()/3)+1,i=t-s;return uh(n,n.getMonth()+i*3)}function ld(e,t){const n=Ft(e);return n.setSeconds(t),n}function ou(e,t){const n=Ft(e);return isNaN(+n)?un(e,NaN):(n.setFullYear(t),n)}const SM={date:iD,month:Ra,year:U_,quarter:z_};function CM(e){return(t,n)=>{const s=(e+1)%7;return Xb(t,n,{weekStartsOn:s})}}function ps(e,t,n,s=0){return(n==="week"?CM(s):SM[n])(e,t)}function cd(e,t,n,s,i,a){return i==="date"?kM(e,t,n,s):xM(e,t,n,s,a)}function kM(e,t,n,s){let i=!1,a=!1,d=!1;Array.isArray(n)&&(n[0]e.value),r=ns(d,a),o=j(()=>{var u;return((u=r.value)===null||u===void 0?void 0:u.length)||0}),c=j(()=>Array.isArray(r.value)?new Set(r.value):new Set);function p(u,g){const{nTriggerFormInput:m,nTriggerFormChange:y}=n,{onChange:v,"onUpdate:value":l,onUpdateValue:h}=e;if(Array.isArray(r.value)){const f=Array.from(r.value),_=f.findIndex(S=>S===g);u?~_||(f.push(g),h&&Xe(h,f,{actionType:"check",value:g}),l&&Xe(l,f,{actionType:"check",value:g}),m(),y(),a.value=f,v&&Xe(v,f)):~_&&(f.splice(_,1),h&&Xe(h,f,{actionType:"uncheck",value:g}),l&&Xe(l,f,{actionType:"uncheck",value:g}),v&&Xe(v,f),a.value=f,m(),y())}else u?(h&&Xe(h,[g],{actionType:"check",value:g}),l&&Xe(l,[g],{actionType:"check",value:g}),v&&Xe(v,[g]),a.value=[g],m(),y()):(h&&Xe(h,[],{actionType:"uncheck",value:g}),l&&Xe(l,[],{actionType:"uncheck",value:g}),v&&Xe(v,[]),a.value=[],m(),y())}return kn(j_,{checkedCountRef:o,maxRef:dt(e,"max"),minRef:dt(e,"min"),valueSetRef:c,disabledRef:i,mergedSizeRef:s,toggleCheckbox:p}),{mergedClsPrefix:t}},render(){return B("div",{class:`${this.mergedClsPrefix}-checkbox-group`,role:"group"},this.$slots)}}),DM=()=>B("svg",{viewBox:"0 0 64 64",class:"check-icon"},B("path",{d:"M50.42,16.76L22.34,39.45l-8.1-11.46c-1.12-1.58-3.3-1.96-4.88-0.84c-1.58,1.12-1.95,3.3-0.84,4.88l10.26,14.51 c0.56,0.79,1.42,1.31,2.38,1.45c0.16,0.02,0.32,0.03,0.48,0.03c0.8,0,1.57-0.27,2.2-0.78l30.99-25.03c1.5-1.21,1.74-3.42,0.52-4.92 C54.13,15.78,51.93,15.55,50.42,16.76z"})),MM=()=>B("svg",{viewBox:"0 0 100 100",class:"line-icon"},B("path",{d:"M80.2,55.5H21.4c-2.8,0-5.1-2.5-5.1-5.5l0,0c0-3,2.3-5.5,5.1-5.5h58.7c2.8,0,5.1,2.5,5.1,5.5l0,0C85.2,53.1,82.9,55.5,80.2,55.5z"})),AM=ze([Ce("checkbox",` + font-size: var(--n-font-size); + outline: none; + cursor: pointer; + display: inline-flex; + flex-wrap: nowrap; + align-items: flex-start; + word-break: break-word; + line-height: var(--n-size); + --n-merged-color-table: var(--n-color-table); + `,[Ue("show-label","line-height: var(--n-label-line-height);"),ze("&:hover",[Ce("checkbox-box",[qe("border","border: var(--n-border-checked);")])]),ze("&:focus:not(:active)",[Ce("checkbox-box",[qe("border",` + border: var(--n-border-focus); + box-shadow: var(--n-box-shadow-focus); + `)])]),Ue("inside-table",[Ce("checkbox-box",` + background-color: var(--n-merged-color-table); + `)]),Ue("checked",[Ce("checkbox-box",` + background-color: var(--n-color-checked); + `,[Ce("checkbox-icon",[ze(".check-icon",` + opacity: 1; + transform: scale(1); + `)])])]),Ue("indeterminate",[Ce("checkbox-box",[Ce("checkbox-icon",[ze(".check-icon",` + opacity: 0; + transform: scale(.5); + `),ze(".line-icon",` + opacity: 1; + transform: scale(1); + `)])])]),Ue("checked, indeterminate",[ze("&:focus:not(:active)",[Ce("checkbox-box",[qe("border",` + border: var(--n-border-checked); + box-shadow: var(--n-box-shadow-focus); + `)])]),Ce("checkbox-box",` + background-color: var(--n-color-checked); + border-left: 0; + border-top: 0; + `,[qe("border",{border:"var(--n-border-checked)"})])]),Ue("disabled",{cursor:"not-allowed"},[Ue("checked",[Ce("checkbox-box",` + background-color: var(--n-color-disabled-checked); + `,[qe("border",{border:"var(--n-border-disabled-checked)"}),Ce("checkbox-icon",[ze(".check-icon, .line-icon",{fill:"var(--n-check-mark-color-disabled-checked)"})])])]),Ce("checkbox-box",` + background-color: var(--n-color-disabled); + `,[qe("border",` + border: var(--n-border-disabled); + `),Ce("checkbox-icon",[ze(".check-icon, .line-icon",` + fill: var(--n-check-mark-color-disabled); + `)])]),qe("label",` + color: var(--n-text-color-disabled); + `)]),Ce("checkbox-box-wrapper",` + position: relative; + width: var(--n-size); + flex-shrink: 0; + flex-grow: 0; + user-select: none; + -webkit-user-select: none; + `),Ce("checkbox-box",` + position: absolute; + left: 0; + top: 50%; + transform: translateY(-50%); + height: var(--n-size); + width: var(--n-size); + display: inline-block; + box-sizing: border-box; + border-radius: var(--n-border-radius); + background-color: var(--n-color); + transition: background-color 0.3s var(--n-bezier); + `,[qe("border",` + transition: + border-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + border-radius: inherit; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border: var(--n-border); + `),Ce("checkbox-icon",` + display: flex; + align-items: center; + justify-content: center; + position: absolute; + left: 1px; + right: 1px; + top: 1px; + bottom: 1px; + `,[ze(".check-icon, .line-icon",` + width: 100%; + fill: var(--n-check-mark-color); + opacity: 0; + transform: scale(0.5); + transform-origin: center; + transition: + fill 0.3s var(--n-bezier), + transform 0.3s var(--n-bezier), + opacity 0.3s var(--n-bezier), + border-color 0.3s var(--n-bezier); + `),Qr({left:"1px",top:"1px"})])]),qe("label",` + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + user-select: none; + -webkit-user-select: none; + padding: var(--n-label-padding); + font-weight: var(--n-label-font-weight); + `,[ze("&:empty",{display:"none"})])]),dg(Ce("checkbox",` + --n-merged-color-table: var(--n-color-table-modal); + `)),ug(Ce("checkbox",` + --n-merged-color-table: var(--n-color-table-popover); + `))]),IM=Object.assign(Object.assign({},Ht.props),{size:String,checked:{type:[Boolean,String,Number],default:void 0},defaultChecked:{type:[Boolean,String,Number],default:!1},value:[String,Number],disabled:{type:Boolean,default:void 0},indeterminate:Boolean,label:String,focusable:{type:Boolean,default:!0},checkedValue:{type:[Boolean,String,Number],default:!0},uncheckedValue:{type:[Boolean,String,Number],default:!1},"onUpdate:checked":[Function,Array],onUpdateChecked:[Function,Array],privateInsideTable:Boolean,onChange:[Function,Array]}),hh=$e({name:"Checkbox",props:IM,setup(e){const t=Ut(j_,null),n=H(null),{mergedClsPrefixRef:s,inlineThemeDisabled:i,mergedRtlRef:a}=mn(e),d=H(e.defaultChecked),r=dt(e,"checked"),o=ns(r,d),c=en(()=>{if(t){const P=t.valueSetRef.value;return P&&e.value!==void 0?P.has(e.value):!1}else return o.value===e.checkedValue}),p=ur(e,{mergedSize(P){const{size:M}=e;if(M!==void 0)return M;if(t){const{value:w}=t.mergedSizeRef;if(w!==void 0)return w}if(P){const{mergedSize:w}=P;if(w!==void 0)return w.value}return"medium"},mergedDisabled(P){const{disabled:M}=e;if(M!==void 0)return M;if(t){if(t.disabledRef.value)return!0;const{maxRef:{value:w},checkedCountRef:T}=t;if(w!==void 0&&T.value>=w&&!c.value)return!0;const{minRef:{value:A}}=t;if(A!==void 0&&T.value<=A&&c.value)return!0}return P?P.disabled.value:!1}}),{mergedDisabledRef:u,mergedSizeRef:g}=p,m=Ht("Checkbox","-checkbox",AM,Jb,e,s);function y(P){if(t&&e.value!==void 0)t.toggleCheckbox(!c.value,e.value);else{const{onChange:M,"onUpdate:checked":w,onUpdateChecked:T}=e,{nTriggerFormInput:A,nTriggerFormChange:E}=p,R=c.value?e.uncheckedValue:e.checkedValue;w&&Xe(w,R,P),T&&Xe(T,R,P),M&&Xe(M,R,P),A(),E(),d.value=R}}function v(P){u.value||y(P)}function l(P){if(!u.value)switch(P.key){case" ":case"Enter":y(P)}}function h(P){switch(P.key){case" ":P.preventDefault()}}const f={focus:()=>{var P;(P=n.value)===null||P===void 0||P.focus()},blur:()=>{var P;(P=n.value)===null||P===void 0||P.blur()}},_=ui("Checkbox",a,s),S=j(()=>{const{value:P}=g,{common:{cubicBezierEaseInOut:M},self:{borderRadius:w,color:T,colorChecked:A,colorDisabled:E,colorTableHeader:R,colorTableHeaderModal:D,colorTableHeaderPopover:I,checkMarkColor:O,checkMarkColorDisabled:U,border:W,borderFocus:z,borderDisabled:N,borderChecked:V,boxShadowFocus:q,textColor:G,textColorDisabled:te,checkMarkColorDisabledChecked:oe,colorDisabledChecked:ie,borderDisabledChecked:ye,labelPadding:K,labelLineHeight:J,labelFontWeight:Q,[Mt("fontSize",P)]:ce,[Mt("size",P)]:Fe}}=m.value;return{"--n-label-line-height":J,"--n-label-font-weight":Q,"--n-size":Fe,"--n-bezier":M,"--n-border-radius":w,"--n-border":W,"--n-border-checked":V,"--n-border-focus":z,"--n-border-disabled":N,"--n-border-disabled-checked":ye,"--n-box-shadow-focus":q,"--n-color":T,"--n-color-checked":A,"--n-color-table":R,"--n-color-table-modal":D,"--n-color-table-popover":I,"--n-color-disabled":E,"--n-color-disabled-checked":ie,"--n-text-color":G,"--n-text-color-disabled":te,"--n-check-mark-color":O,"--n-check-mark-color-disabled":U,"--n-check-mark-color-disabled-checked":oe,"--n-font-size":ce,"--n-label-padding":K}}),k=i?Bn("checkbox",j(()=>g.value[0]),S,e):void 0;return Object.assign(p,f,{rtlEnabled:_,selfRef:n,mergedClsPrefix:s,mergedDisabled:u,renderedChecked:c,mergedTheme:m,labelId:Pu(),handleClick:v,handleKeyUp:l,handleKeyDown:h,cssVars:i?void 0:S,themeClass:k==null?void 0:k.themeClass,onRender:k==null?void 0:k.onRender})},render(){var e;const{$slots:t,renderedChecked:n,mergedDisabled:s,indeterminate:i,privateInsideTable:a,cssVars:d,labelId:r,label:o,mergedClsPrefix:c,focusable:p,handleKeyUp:u,handleKeyDown:g,handleClick:m}=this;(e=this.onRender)===null||e===void 0||e.call(this);const y=Ns(t.default,v=>o||v?B("span",{class:`${c}-checkbox__label`,id:r},o||v):null);return B("div",{ref:"selfRef",class:[`${c}-checkbox`,this.themeClass,this.rtlEnabled&&`${c}-checkbox--rtl`,n&&`${c}-checkbox--checked`,s&&`${c}-checkbox--disabled`,i&&`${c}-checkbox--indeterminate`,a&&`${c}-checkbox--inside-table`,y&&`${c}-checkbox--show-label`],tabindex:s||!p?void 0:0,role:"checkbox","aria-checked":i?"mixed":n,"aria-labelledby":r,style:d,onKeyup:u,onKeydown:g,onClick:m,onMousedown:()=>{Kn("selectstart",window,v=>{v.preventDefault()},{once:!0})}},B("div",{class:`${c}-checkbox-box-wrapper`}," ",B("div",{class:`${c}-checkbox-box`},B(hg,null,{default:()=>this.indeterminate?B("div",{key:"indeterminate",class:`${c}-checkbox-icon`},MM()):B("div",{key:"check",class:`${c}-checkbox-icon`},DM())}),B("div",{class:`${c}-checkbox-box__border`}))),y)}}),q_=ds("n-popselect"),$M=Ce("popselect-menu",` + box-shadow: var(--n-menu-box-shadow); +`),fh={multiple:Boolean,value:{type:[String,Number,Array],default:null},cancelable:Boolean,options:{type:Array,default:()=>[]},size:{type:String,default:"medium"},scrollable:Boolean,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onMouseenter:Function,onMouseleave:Function,renderLabel:Function,showCheckmark:{type:Boolean,default:void 0},nodeProps:Function,virtualScroll:Boolean,onChange:[Function,Array]},nv=pg(fh),OM=$e({name:"PopselectPanel",props:fh,setup(e){const t=Ut(q_),{mergedClsPrefixRef:n,inlineThemeDisabled:s}=mn(e),i=Ht("Popselect","-pop-select",$M,fg,t.props,n),a=j(()=>vc(e.options,P_("value","children")));function d(g,m){const{onUpdateValue:y,"onUpdate:value":v,onChange:l}=e;y&&Xe(y,g,m),v&&Xe(v,g,m),l&&Xe(l,g,m)}function r(g){c(g.key)}function o(g){!ws(g,"action")&&!ws(g,"empty")&&!ws(g,"header")&&g.preventDefault()}function c(g){const{value:{getNode:m}}=a;if(e.multiple)if(Array.isArray(e.value)){const y=[],v=[];let l=!0;e.value.forEach(h=>{if(h===g){l=!1;return}const f=m(h);f&&(y.push(f.key),v.push(f.rawNode))}),l&&(y.push(g),v.push(m(g).rawNode)),d(y,v)}else{const y=m(g);y&&d([g],[y.rawNode])}else if(e.value===g&&e.cancelable)d(null,null);else{const y=m(g);y&&d(g,y.rawNode);const{"onUpdate:show":v,onUpdateShow:l}=t.props;v&&Xe(v,!1),l&&Xe(l,!1),t.setShow(!1)}cn(()=>{t.syncPosition()})}yt(dt(e,"options"),()=>{cn(()=>{t.syncPosition()})});const p=j(()=>{const{self:{menuBoxShadow:g}}=i.value;return{"--n-menu-box-shadow":g}}),u=s?Bn("select",void 0,p,t.props):void 0;return{mergedTheme:t.mergedThemeRef,mergedClsPrefix:n,treeMate:a,handleToggle:r,handleMenuMousedown:o,cssVars:s?void 0:p,themeClass:u==null?void 0:u.themeClass,onRender:u==null?void 0:u.onRender}},render(){var e;return(e=this.onRender)===null||e===void 0||e.call(this),B(k_,{clsPrefix:this.mergedClsPrefix,focusable:!0,nodeProps:this.nodeProps,class:[`${this.mergedClsPrefix}-popselect-menu`,this.themeClass],style:this.cssVars,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,multiple:this.multiple,treeMate:this.treeMate,size:this.size,value:this.value,virtualScroll:this.virtualScroll,scrollable:this.scrollable,renderLabel:this.renderLabel,onToggle:this.handleToggle,onMouseenter:this.onMouseenter,onMouseleave:this.onMouseenter,onMousedown:this.handleMenuMousedown,showCheckmark:this.showCheckmark},{header:()=>{var t,n;return((n=(t=this.$slots).header)===null||n===void 0?void 0:n.call(t))||[]},action:()=>{var t,n;return((n=(t=this.$slots).action)===null||n===void 0?void 0:n.call(t))||[]},empty:()=>{var t,n;return((n=(t=this.$slots).empty)===null||n===void 0?void 0:n.call(t))||[]}})}}),FM=Object.assign(Object.assign(Object.assign(Object.assign({},Ht.props),Mu(Or,["showArrow","arrow"])),{placement:Object.assign(Object.assign({},Or.placement),{default:"bottom"}),trigger:{type:String,default:"hover"}}),fh),BM=$e({name:"Popselect",props:FM,inheritAttrs:!1,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=mn(e),n=Ht("Popselect","-popselect",void 0,fg,e,t),s=H(null);function i(){var r;(r=s.value)===null||r===void 0||r.syncPosition()}function a(r){var o;(o=s.value)===null||o===void 0||o.setShow(r)}return kn(q_,{props:e,mergedThemeRef:n,syncPosition:i,setShow:a}),Object.assign(Object.assign({},{syncPosition:i,setShow:a}),{popoverInstRef:s,mergedTheme:n})},render(){const{mergedTheme:e}=this,t={theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:{padding:"0"},ref:"popoverInstRef",internalRenderBody:(n,s,i,a,d)=>{const{$attrs:r}=this;return B(OM,Object.assign({},r,{class:[r.class,n],style:[r.style,...i]},pc(this.$props,nv),{ref:g_(s),onMouseenter:ca([a,r.onMouseenter]),onMouseleave:ca([d,r.onMouseleave])}),{header:()=>{var o,c;return(c=(o=this.$slots).header)===null||c===void 0?void 0:c.call(o)},action:()=>{var o,c;return(c=(o=this.$slots).action)===null||c===void 0?void 0:c.call(o)},empty:()=>{var o,c;return(c=(o=this.$slots).empty)===null||c===void 0?void 0:c.call(o)}})}};return B(Ao,Object.assign({},Mu(this.$props,nv),t,{internalDeactivateImmediately:!0}),{trigger:()=>{var n,s;return(s=(n=this.$slots).default)===null||s===void 0?void 0:s.call(n)}})}}),HM=ze([Ce("select",` + z-index: auto; + outline: none; + width: 100%; + position: relative; + font-weight: var(--n-font-weight); + `),Ce("select-menu",` + margin: 4px 0; + box-shadow: var(--n-menu-box-shadow); + `,[Mo({originalTransition:"background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier)"})])]),NM=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,clearFilterAfterSelect:{type:Boolean,default:!0},options:{type:Array,default:()=>[]},defaultValue:{type:[String,Number,Array],default:null},keyboard:{type:Boolean,default:!0},value:[String,Number,Array],placeholder:String,menuProps:Object,multiple:Boolean,size:String,menuSize:{type:String},filterable:Boolean,disabled:{type:Boolean,default:void 0},remote:Boolean,loading:Boolean,filter:Function,placement:{type:String,default:"bottom-start"},widthMode:{type:String,default:"trigger"},tag:Boolean,onCreate:Function,fallbackOption:{type:[Function,Boolean],default:void 0},show:{type:Boolean,default:void 0},showArrow:{type:Boolean,default:!0},maxTagCount:[Number,String],ellipsisTagPopoverProps:Object,consistentMenuWidth:{type:Boolean,default:!0},virtualScroll:{type:Boolean,default:!0},labelField:{type:String,default:"label"},valueField:{type:String,default:"value"},childrenField:{type:String,default:"children"},renderLabel:Function,renderOption:Function,renderTag:Function,"onUpdate:value":[Function,Array],inputProps:Object,nodeProps:Function,ignoreComposition:{type:Boolean,default:!0},showOnFocus:Boolean,onUpdateValue:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onFocus:[Function,Array],onScroll:[Function,Array],onSearch:[Function,Array],onUpdateShow:[Function,Array],"onUpdate:show":[Function,Array],displayDirective:{type:String,default:"show"},resetMenuOnOptionsChange:{type:Boolean,default:!0},status:String,showCheckmark:{type:Boolean,default:!0},onChange:[Function,Array],items:Array}),Y_=$e({name:"Select",props:NM,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:n,namespaceRef:s,inlineThemeDisabled:i}=mn(e),a=Ht("Select","-select",HM,Qb,e,t),d=H(e.defaultValue),r=dt(e,"value"),o=ns(r,d),c=H(!1),p=H(""),u=Qu(e,["items","options"]),g=H([]),m=H([]),y=j(()=>m.value.concat(g.value).concat(u.value)),v=j(()=>{const{filter:se}=e;if(se)return se;const{labelField:de,valueField:Le}=e;return(Ae,ct)=>{if(!ct)return!1;const ve=ct[de];if(typeof ve=="string")return od(Ae,ve);const Be=ct[Le];return typeof Be=="string"?od(Ae,Be):typeof Be=="number"?od(Ae,String(Be)):!1}}),l=j(()=>{if(e.remote)return u.value;{const{value:se}=y,{value:de}=p;return!de.length||!e.filterable?se:GL(se,v.value,de,e.childrenField)}}),h=j(()=>{const{valueField:se,childrenField:de}=e,Le=P_(se,de);return vc(l.value,Le)}),f=j(()=>XL(y.value,e.valueField,e.childrenField)),_=H(!1),S=ns(dt(e,"show"),_),k=H(null),P=H(null),M=H(null),{localeRef:w}=Qs("Select"),T=j(()=>{var se;return(se=e.placeholder)!==null&&se!==void 0?se:w.value.placeholder}),A=[],E=H(new Map),R=j(()=>{const{fallbackOption:se}=e;if(se===void 0){const{labelField:de,valueField:Le}=e;return Ae=>({[de]:String(Ae),[Le]:Ae})}return se===!1?!1:de=>Object.assign(se(de),{value:de})});function D(se){const de=e.remote,{value:Le}=E,{value:Ae}=f,{value:ct}=R,ve=[];return se.forEach(Be=>{if(Ae.has(Be))ve.push(Ae.get(Be));else if(de&&Le.has(Be))ve.push(Le.get(Be));else if(ct){const me=ct(Be);me&&ve.push(me)}}),ve}const I=j(()=>{if(e.multiple){const{value:se}=o;return Array.isArray(se)?D(se):[]}return null}),O=j(()=>{const{value:se}=o;return!e.multiple&&!Array.isArray(se)?se===null?null:D([se])[0]||null:null}),U=ur(e),{mergedSizeRef:W,mergedDisabledRef:z,mergedStatusRef:N}=U;function V(se,de){const{onChange:Le,"onUpdate:value":Ae,onUpdateValue:ct}=e,{nTriggerFormChange:ve,nTriggerFormInput:Be}=U;Le&&Xe(Le,se,de),ct&&Xe(ct,se,de),Ae&&Xe(Ae,se,de),d.value=se,ve(),Be()}function q(se){const{onBlur:de}=e,{nTriggerFormBlur:Le}=U;de&&Xe(de,se),Le()}function G(){const{onClear:se}=e;se&&Xe(se)}function te(se){const{onFocus:de,showOnFocus:Le}=e,{nTriggerFormFocus:Ae}=U;de&&Xe(de,se),Ae(),Le&&J()}function oe(se){const{onSearch:de}=e;de&&Xe(de,se)}function ie(se){const{onScroll:de}=e;de&&Xe(de,se)}function ye(){var se;const{remote:de,multiple:Le}=e;if(de){const{value:Ae}=E;if(Le){const{valueField:ct}=e;(se=I.value)===null||se===void 0||se.forEach(ve=>{Ae.set(ve[ct],ve)})}else{const ct=O.value;ct&&Ae.set(ct[e.valueField],ct)}}}function K(se){const{onUpdateShow:de,"onUpdate:show":Le}=e;de&&Xe(de,se),Le&&Xe(Le,se),_.value=se}function J(){z.value||(K(!0),_.value=!0,e.filterable&&kt())}function Q(){K(!1)}function ce(){p.value="",m.value=A}const Fe=H(!1);function Ee(){e.filterable&&(Fe.value=!0)}function Ye(){e.filterable&&(Fe.value=!1,S.value||ce())}function Ze(){z.value||(S.value?e.filterable?kt():Q():J())}function ue(se){var de,Le;!((Le=(de=M.value)===null||de===void 0?void 0:de.selfRef)===null||Le===void 0)&&Le.contains(se.relatedTarget)||(c.value=!1,q(se),Q())}function et(se){te(se),c.value=!0}function re(){c.value=!0}function we(se){var de;!((de=k.value)===null||de===void 0)&&de.$el.contains(se.relatedTarget)||(c.value=!1,q(se),Q())}function fe(){var se;(se=k.value)===null||se===void 0||se.focus(),Q()}function De(se){var de;S.value&&(!((de=k.value)===null||de===void 0)&&de.$el.contains(Ar(se))||Q())}function Qe(se){if(!Array.isArray(se))return[];if(R.value)return Array.from(se);{const{remote:de}=e,{value:Le}=f;if(de){const{value:Ae}=E;return se.filter(ct=>Le.has(ct)||Ae.has(ct))}else return se.filter(Ae=>Le.has(Ae))}}function We(se){ae(se.rawNode)}function ae(se){if(z.value)return;const{tag:de,remote:Le,clearFilterAfterSelect:Ae,valueField:ct}=e;if(de&&!Le){const{value:ve}=m,Be=ve[0]||null;if(Be){const me=g.value;me.length?me.push(Be):g.value=[Be],m.value=A}}if(Le&&E.value.set(se[ct],se),e.multiple){const ve=Qe(o.value),Be=ve.findIndex(me=>me===se[ct]);if(~Be){if(ve.splice(Be,1),de&&!Le){const me=_e(se[ct]);~me&&(g.value.splice(me,1),Ae&&(p.value=""))}}else ve.push(se[ct]),Ae&&(p.value="");V(ve,D(ve))}else{if(de&&!Le){const ve=_e(se[ct]);~ve?g.value=[g.value[ve]]:g.value=A}Ve(),Q(),V(se[ct],se)}}function _e(se){return g.value.findIndex(Le=>Le[e.valueField]===se)}function be(se){S.value||J();const{value:de}=se.target;p.value=de;const{tag:Le,remote:Ae}=e;if(oe(de),Le&&!Ae){if(!de){m.value=A;return}const{onCreate:ct}=e,ve=ct?ct(de):{[e.labelField]:de,[e.valueField]:de},{valueField:Be,labelField:me}=e;u.value.some(rt=>rt[Be]===ve[Be]||rt[me]===ve[me])||g.value.some(rt=>rt[Be]===ve[Be]||rt[me]===ve[me])?m.value=A:m.value=[ve]}}function Me(se){se.stopPropagation();const{multiple:de}=e;!de&&e.filterable&&Q(),G(),de?V([],[]):V(null,null)}function x(se){!ws(se,"action")&&!ws(se,"empty")&&!ws(se,"header")&&se.preventDefault()}function Re(se){ie(se)}function Ge(se){var de,Le,Ae,ct,ve;if(!e.keyboard){se.preventDefault();return}switch(se.key){case" ":if(e.filterable)break;se.preventDefault();case"Enter":if(!(!((de=k.value)===null||de===void 0)&&de.isComposing)){if(S.value){const Be=(Le=M.value)===null||Le===void 0?void 0:Le.getPendingTmNode();Be?We(Be):e.filterable||(Q(),Ve())}else if(J(),e.tag&&Fe.value){const Be=m.value[0];if(Be){const me=Be[e.valueField],{value:rt}=o;e.multiple&&Array.isArray(rt)&&rt.includes(me)||ae(Be)}}}se.preventDefault();break;case"ArrowUp":if(se.preventDefault(),e.loading)return;S.value&&((Ae=M.value)===null||Ae===void 0||Ae.prev());break;case"ArrowDown":if(se.preventDefault(),e.loading)return;S.value?(ct=M.value)===null||ct===void 0||ct.next():J();break;case"Escape":S.value&&(ga(se),Q()),(ve=k.value)===null||ve===void 0||ve.focus();break}}function Ve(){var se;(se=k.value)===null||se===void 0||se.focus()}function kt(){var se;(se=k.value)===null||se===void 0||se.focusInput()}function Je(){var se;S.value&&((se=P.value)===null||se===void 0||se.syncPosition())}ye(),yt(dt(e,"options"),ye);const wt={focus:()=>{var se;(se=k.value)===null||se===void 0||se.focus()},focusInput:()=>{var se;(se=k.value)===null||se===void 0||se.focusInput()},blur:()=>{var se;(se=k.value)===null||se===void 0||se.blur()},blurInput:()=>{var se;(se=k.value)===null||se===void 0||se.blurInput()}},tt=j(()=>{const{self:{menuBoxShadow:se}}=a.value;return{"--n-menu-box-shadow":se}}),mt=i?Bn("select",void 0,tt,e):void 0;return Object.assign(Object.assign({},wt),{mergedStatus:N,mergedClsPrefix:t,mergedBordered:n,namespace:s,treeMate:h,isMounted:ba(),triggerRef:k,menuRef:M,pattern:p,uncontrolledShow:_,mergedShow:S,adjustedTo:cs(e),uncontrolledValue:d,mergedValue:o,followerRef:P,localizedPlaceholder:T,selectedOption:O,selectedOptions:I,mergedSize:W,mergedDisabled:z,focused:c,activeWithoutMenuOpen:Fe,inlineThemeDisabled:i,onTriggerInputFocus:Ee,onTriggerInputBlur:Ye,handleTriggerOrMenuResize:Je,handleMenuFocus:re,handleMenuBlur:we,handleMenuTabOut:fe,handleTriggerClick:Ze,handleToggle:We,handleDeleteOption:ae,handlePatternInput:be,handleClear:Me,handleTriggerBlur:ue,handleTriggerFocus:et,handleKeydown:Ge,handleMenuAfterLeave:ce,handleMenuClickOutside:De,handleMenuScroll:Re,handleMenuKeydown:Ge,handleMenuMousedown:x,mergedTheme:a,cssVars:i?void 0:tt,themeClass:mt==null?void 0:mt.themeClass,onRender:mt==null?void 0:mt.onRender})},render(){return B("div",{class:`${this.mergedClsPrefix}-select`},B(Eo,null,{default:()=>[B(Lo,null,{default:()=>B(YL,{ref:"triggerRef",inlineThemeDisabled:this.inlineThemeDisabled,status:this.mergedStatus,inputProps:this.inputProps,clsPrefix:this.mergedClsPrefix,showArrow:this.showArrow,maxTagCount:this.maxTagCount,ellipsisTagPopoverProps:this.ellipsisTagPopoverProps,bordered:this.mergedBordered,active:this.activeWithoutMenuOpen||this.mergedShow,pattern:this.pattern,placeholder:this.localizedPlaceholder,selectedOption:this.selectedOption,selectedOptions:this.selectedOptions,multiple:this.multiple,renderTag:this.renderTag,renderLabel:this.renderLabel,filterable:this.filterable,clearable:this.clearable,disabled:this.mergedDisabled,size:this.mergedSize,theme:this.mergedTheme.peers.InternalSelection,labelField:this.labelField,valueField:this.valueField,themeOverrides:this.mergedTheme.peerOverrides.InternalSelection,loading:this.loading,focused:this.focused,onClick:this.handleTriggerClick,onDeleteOption:this.handleDeleteOption,onPatternInput:this.handlePatternInput,onClear:this.handleClear,onBlur:this.handleTriggerBlur,onFocus:this.handleTriggerFocus,onKeydown:this.handleKeydown,onPatternBlur:this.onTriggerInputBlur,onPatternFocus:this.onTriggerInputFocus,onResize:this.handleTriggerOrMenuResize,ignoreComposition:this.ignoreComposition},{arrow:()=>{var e,t;return[(t=(e=this.$slots).arrow)===null||t===void 0?void 0:t.call(e)]}})}),B(Do,{ref:"followerRef",show:this.mergedShow,to:this.adjustedTo,teleportDisabled:this.adjustedTo===cs.tdkey,containerClass:this.namespace,width:this.consistentMenuWidth?"target":void 0,minWidth:"target",placement:this.placement},{default:()=>B(ys,{name:"fade-in-scale-up-transition",appear:this.isMounted,onAfterLeave:this.handleMenuAfterLeave},{default:()=>{var e,t,n;return this.mergedShow||this.displayDirective==="show"?((e=this.onRender)===null||e===void 0||e.call(this),it(B(k_,Object.assign({},this.menuProps,{ref:"menuRef",onResize:this.handleTriggerOrMenuResize,inlineThemeDisabled:this.inlineThemeDisabled,virtualScroll:this.consistentMenuWidth&&this.virtualScroll,class:[`${this.mergedClsPrefix}-select-menu`,this.themeClass,(t=this.menuProps)===null||t===void 0?void 0:t.class],clsPrefix:this.mergedClsPrefix,focusable:!0,labelField:this.labelField,valueField:this.valueField,autoPending:!0,nodeProps:this.nodeProps,theme:this.mergedTheme.peers.InternalSelectMenu,themeOverrides:this.mergedTheme.peerOverrides.InternalSelectMenu,treeMate:this.treeMate,multiple:this.multiple,size:this.menuSize,renderOption:this.renderOption,renderLabel:this.renderLabel,value:this.mergedValue,style:[(n=this.menuProps)===null||n===void 0?void 0:n.style,this.cssVars],onToggle:this.handleToggle,onScroll:this.handleMenuScroll,onFocus:this.handleMenuFocus,onBlur:this.handleMenuBlur,onKeydown:this.handleMenuKeydown,onTabOut:this.handleMenuTabOut,onMousedown:this.handleMenuMousedown,show:this.mergedShow,showCheckmark:this.showCheckmark,resetMenuOnOptionsChange:this.resetMenuOnOptionsChange}),{empty:()=>{var s,i;return[(i=(s=this.$slots).empty)===null||i===void 0?void 0:i.call(s)]},header:()=>{var s,i;return[(i=(s=this.$slots).header)===null||i===void 0?void 0:i.call(s)]},action:()=>{var s,i;return[(i=(s=this.$slots).action)===null||i===void 0?void 0:i.call(s)]}}),this.displayDirective==="show"?[[ms,this.mergedShow],[$r,this.handleMenuClickOutside,void 0,{capture:!0}]]:[[$r,this.handleMenuClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),sv=` + background: var(--n-item-color-hover); + color: var(--n-item-text-color-hover); + border: var(--n-item-border-hover); +`,iv=[Ue("button",` + background: var(--n-button-color-hover); + border: var(--n-button-border-hover); + color: var(--n-button-icon-color-hover); + `)],zM=Ce("pagination",` + display: flex; + vertical-align: middle; + font-size: var(--n-item-font-size); + flex-wrap: nowrap; +`,[Ce("pagination-prefix",` + display: flex; + align-items: center; + margin: var(--n-prefix-margin); + `),Ce("pagination-suffix",` + display: flex; + align-items: center; + margin: var(--n-suffix-margin); + `),ze("> *:not(:first-child)",` + margin: var(--n-item-margin); + `),Ce("select",` + width: var(--n-select-width); + `),ze("&.transition-disabled",[Ce("pagination-item","transition: none!important;")]),Ce("pagination-quick-jumper",` + white-space: nowrap; + display: flex; + color: var(--n-jumper-text-color); + transition: color .3s var(--n-bezier); + align-items: center; + font-size: var(--n-jumper-font-size); + `,[Ce("input",` + margin: var(--n-input-margin); + width: var(--n-input-width); + `)]),Ce("pagination-item",` + position: relative; + cursor: pointer; + user-select: none; + -webkit-user-select: none; + display: flex; + align-items: center; + justify-content: center; + box-sizing: border-box; + min-width: var(--n-item-size); + height: var(--n-item-size); + padding: var(--n-item-padding); + background-color: var(--n-item-color); + color: var(--n-item-text-color); + border-radius: var(--n-item-border-radius); + border: var(--n-item-border); + fill: var(--n-button-icon-color); + transition: + color .3s var(--n-bezier), + border-color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + fill .3s var(--n-bezier); + `,[Ue("button",` + background: var(--n-button-color); + color: var(--n-button-icon-color); + border: var(--n-button-border); + padding: 0; + `,[Ce("base-icon",` + font-size: var(--n-button-icon-size); + `)]),Cn("disabled",[Ue("hover",sv,iv),ze("&:hover",sv,iv),ze("&:active",` + background: var(--n-item-color-pressed); + color: var(--n-item-text-color-pressed); + border: var(--n-item-border-pressed); + `,[Ue("button",` + background: var(--n-button-color-pressed); + border: var(--n-button-border-pressed); + color: var(--n-button-icon-color-pressed); + `)]),Ue("active",` + background: var(--n-item-color-active); + color: var(--n-item-text-color-active); + border: var(--n-item-border-active); + `,[ze("&:hover",` + background: var(--n-item-color-active-hover); + `)])]),Ue("disabled",` + cursor: not-allowed; + color: var(--n-item-text-color-disabled); + `,[Ue("active, button",` + background-color: var(--n-item-color-disabled); + border: var(--n-item-border-disabled); + `)])]),Ue("disabled",` + cursor: not-allowed; + `,[Ce("pagination-quick-jumper",` + color: var(--n-jumper-text-color-disabled); + `)]),Ue("simple",` + display: flex; + align-items: center; + flex-wrap: nowrap; + `,[Ce("pagination-quick-jumper",[Ce("input",` + margin: 0; + `)])])]);function G_(e){var t;if(!e)return 10;const{defaultPageSize:n}=e;if(n!==void 0)return n;const s=(t=e.pageSizes)===null||t===void 0?void 0:t[0];return typeof s=="number"?s:(s==null?void 0:s.value)||10}function UM(e,t,n,s){let i=!1,a=!1,d=1,r=t;if(t===1)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:r,fastBackwardTo:d,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1}]};if(t===2)return{hasFastBackward:!1,hasFastForward:!1,fastForwardTo:r,fastBackwardTo:d,items:[{type:"page",label:1,active:e===1,mayBeFastBackward:!1,mayBeFastForward:!1},{type:"page",label:2,active:e===2,mayBeFastBackward:!0,mayBeFastForward:!1}]};const o=1,c=t;let p=e,u=e;const g=(n-5)/2;u+=Math.ceil(g),u=Math.min(Math.max(u,o+n-3),c-2),p-=Math.floor(g),p=Math.max(Math.min(p,c-n+3),o+2);let m=!1,y=!1;p>o+2&&(m=!0),u=o+1&&v.push({type:"page",label:o+1,mayBeFastBackward:!0,mayBeFastForward:!1,active:e===o+1});for(let l=p;l<=u;++l)v.push({type:"page",label:l,mayBeFastBackward:!1,mayBeFastForward:!1,active:e===l});return y?(a=!0,r=u+1,v.push({type:"fast-forward",active:!1,label:void 0,options:s?rv(u+1,c-1):null})):u===c-2&&v[v.length-1].label!==c-1&&v.push({type:"page",mayBeFastForward:!0,mayBeFastBackward:!1,label:c-1,active:e===c-1}),v[v.length-1].label!==c&&v.push({type:"page",mayBeFastForward:!1,mayBeFastBackward:!1,label:c,active:e===c}),{hasFastBackward:i,hasFastForward:a,fastBackwardTo:d,fastForwardTo:r,items:v}}function rv(e,t){const n=[];for(let s=e;s<=t;++s)n.push({label:`${s}`,value:s});return n}const VM=Object.assign(Object.assign({},Ht.props),{simple:Boolean,page:Number,defaultPage:{type:Number,default:1},itemCount:Number,pageCount:Number,defaultPageCount:{type:Number,default:1},showSizePicker:Boolean,pageSize:Number,defaultPageSize:Number,pageSizes:{type:Array,default(){return[10]}},showQuickJumper:Boolean,size:{type:String,default:"medium"},disabled:Boolean,pageSlot:{type:Number,default:9},selectProps:Object,prev:Function,next:Function,goto:Function,prefix:Function,suffix:Function,label:Function,displayOrder:{type:Array,default:["pages","size-picker","quick-jumper"]},to:cs.propTo,showQuickJumpDropdown:{type:Boolean,default:!0},"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],onPageSizeChange:[Function,Array],onChange:[Function,Array]}),KM=$e({name:"Pagination",props:VM,setup(e){const{mergedComponentPropsRef:t,mergedClsPrefixRef:n,inlineThemeDisabled:s,mergedRtlRef:i}=mn(e),a=Ht("Pagination","-pagination",zM,Zb,e,n),{localeRef:d}=Qs("Pagination"),r=H(null),o=H(e.defaultPage),c=H(G_(e)),p=ns(dt(e,"page"),o),u=ns(dt(e,"pageSize"),c),g=j(()=>{const{itemCount:Q}=e;if(Q!==void 0)return Math.max(1,Math.ceil(Q/u.value));const{pageCount:ce}=e;return ce!==void 0?Math.max(ce,1):1}),m=H("");zs(()=>{e.simple,m.value=String(p.value)});const y=H(!1),v=H(!1),l=H(!1),h=H(!1),f=()=>{e.disabled||(y.value=!0,O())},_=()=>{e.disabled||(y.value=!1,O())},S=()=>{v.value=!0,O()},k=()=>{v.value=!1,O()},P=Q=>{U(Q)},M=j(()=>UM(p.value,g.value,e.pageSlot,e.showQuickJumpDropdown));zs(()=>{M.value.hasFastBackward?M.value.hasFastForward||(y.value=!1,l.value=!1):(v.value=!1,h.value=!1)});const w=j(()=>{const Q=d.value.selectionSuffix;return e.pageSizes.map(ce=>typeof ce=="number"?{label:`${ce} / ${Q}`,value:ce}:ce)}),T=j(()=>{var Q,ce;return((ce=(Q=t==null?void 0:t.value)===null||Q===void 0?void 0:Q.Pagination)===null||ce===void 0?void 0:ce.inputSize)||Dp(e.size)}),A=j(()=>{var Q,ce;return((ce=(Q=t==null?void 0:t.value)===null||Q===void 0?void 0:Q.Pagination)===null||ce===void 0?void 0:ce.selectSize)||Dp(e.size)}),E=j(()=>(p.value-1)*u.value),R=j(()=>{const Q=p.value*u.value-1,{itemCount:ce}=e;return ce!==void 0&&Q>ce-1?ce-1:Q}),D=j(()=>{const{itemCount:Q}=e;return Q!==void 0?Q:(e.pageCount||1)*u.value}),I=ui("Pagination",i,n);function O(){cn(()=>{var Q;const{value:ce}=r;ce&&(ce.classList.add("transition-disabled"),(Q=r.value)===null||Q===void 0||Q.offsetWidth,ce.classList.remove("transition-disabled"))})}function U(Q){if(Q===p.value)return;const{"onUpdate:page":ce,onUpdatePage:Fe,onChange:Ee,simple:Ye}=e;ce&&Xe(ce,Q),Fe&&Xe(Fe,Q),Ee&&Xe(Ee,Q),o.value=Q,Ye&&(m.value=String(Q))}function W(Q){if(Q===u.value)return;const{"onUpdate:pageSize":ce,onUpdatePageSize:Fe,onPageSizeChange:Ee}=e;ce&&Xe(ce,Q),Fe&&Xe(Fe,Q),Ee&&Xe(Ee,Q),c.value=Q,g.value{p.value,u.value,O()});const K=j(()=>{const{size:Q}=e,{self:{buttonBorder:ce,buttonBorderHover:Fe,buttonBorderPressed:Ee,buttonIconColor:Ye,buttonIconColorHover:Ze,buttonIconColorPressed:ue,itemTextColor:et,itemTextColorHover:re,itemTextColorPressed:we,itemTextColorActive:fe,itemTextColorDisabled:De,itemColor:Qe,itemColorHover:We,itemColorPressed:ae,itemColorActive:_e,itemColorActiveHover:be,itemColorDisabled:Me,itemBorder:x,itemBorderHover:Re,itemBorderPressed:Ge,itemBorderActive:Ve,itemBorderDisabled:kt,itemBorderRadius:Je,jumperTextColor:wt,jumperTextColorDisabled:tt,buttonColor:mt,buttonColorHover:se,buttonColorPressed:de,[Mt("itemPadding",Q)]:Le,[Mt("itemMargin",Q)]:Ae,[Mt("inputWidth",Q)]:ct,[Mt("selectWidth",Q)]:ve,[Mt("inputMargin",Q)]:Be,[Mt("selectMargin",Q)]:me,[Mt("jumperFontSize",Q)]:rt,[Mt("prefixMargin",Q)]:At,[Mt("suffixMargin",Q)]:St,[Mt("itemSize",Q)]:xe,[Mt("buttonIconSize",Q)]:je,[Mt("itemFontSize",Q)]:ft,[`${Mt("itemMargin",Q)}Rtl`]:Tt,[`${Mt("inputMargin",Q)}Rtl`]:qt},common:{cubicBezierEaseInOut:zt}}=a.value;return{"--n-prefix-margin":At,"--n-suffix-margin":St,"--n-item-font-size":ft,"--n-select-width":ve,"--n-select-margin":me,"--n-input-width":ct,"--n-input-margin":Be,"--n-input-margin-rtl":qt,"--n-item-size":xe,"--n-item-text-color":et,"--n-item-text-color-disabled":De,"--n-item-text-color-hover":re,"--n-item-text-color-active":fe,"--n-item-text-color-pressed":we,"--n-item-color":Qe,"--n-item-color-hover":We,"--n-item-color-disabled":Me,"--n-item-color-active":_e,"--n-item-color-active-hover":be,"--n-item-color-pressed":ae,"--n-item-border":x,"--n-item-border-hover":Re,"--n-item-border-disabled":kt,"--n-item-border-active":Ve,"--n-item-border-pressed":Ge,"--n-item-padding":Le,"--n-item-border-radius":Je,"--n-bezier":zt,"--n-jumper-font-size":rt,"--n-jumper-text-color":wt,"--n-jumper-text-color-disabled":tt,"--n-item-margin":Ae,"--n-item-margin-rtl":Tt,"--n-button-icon-size":je,"--n-button-icon-color":Ye,"--n-button-icon-color-hover":Ze,"--n-button-icon-color-pressed":ue,"--n-button-color-hover":se,"--n-button-color":mt,"--n-button-color-pressed":de,"--n-button-border":ce,"--n-button-border-hover":Fe,"--n-button-border-pressed":Ee}}),J=s?Bn("pagination",j(()=>{let Q="";const{size:ce}=e;return Q+=ce[0],Q}),K,e):void 0;return{rtlEnabled:I,mergedClsPrefix:n,locale:d,selfRef:r,mergedPage:p,pageItems:j(()=>M.value.items),mergedItemCount:D,jumperValue:m,pageSizeOptions:w,mergedPageSize:u,inputSize:T,selectSize:A,mergedTheme:a,mergedPageCount:g,startIndex:E,endIndex:R,showFastForwardMenu:l,showFastBackwardMenu:h,fastForwardActive:y,fastBackwardActive:v,handleMenuSelect:P,handleFastForwardMouseenter:f,handleFastForwardMouseleave:_,handleFastBackwardMouseenter:S,handleFastBackwardMouseleave:k,handleJumperInput:ye,handleBackwardClick:N,handleForwardClick:z,handlePageItemClick:ie,handleSizePickerChange:G,handleQuickJumperChange:oe,cssVars:s?void 0:K,themeClass:J==null?void 0:J.themeClass,onRender:J==null?void 0:J.onRender}},render(){const{$slots:e,mergedClsPrefix:t,disabled:n,cssVars:s,mergedPage:i,mergedPageCount:a,pageItems:d,showSizePicker:r,showQuickJumper:o,mergedTheme:c,locale:p,inputSize:u,selectSize:g,mergedPageSize:m,pageSizeOptions:y,jumperValue:v,simple:l,prev:h,next:f,prefix:_,suffix:S,label:k,goto:P,handleJumperInput:M,handleSizePickerChange:w,handleBackwardClick:T,handlePageItemClick:A,handleForwardClick:E,handleQuickJumperChange:R,onRender:D}=this;D==null||D();const I=e.prefix||_,O=e.suffix||S,U=h||e.prev,W=f||e.next,z=k||e.label;return B("div",{ref:"selfRef",class:[`${t}-pagination`,this.themeClass,this.rtlEnabled&&`${t}-pagination--rtl`,n&&`${t}-pagination--disabled`,l&&`${t}-pagination--simple`],style:s},I?B("div",{class:`${t}-pagination-prefix`},I({page:i,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null,this.displayOrder.map(N=>{switch(N){case"pages":return B(Oe,null,B("div",{class:[`${t}-pagination-item`,!U&&`${t}-pagination-item--button`,(i<=1||i>a||n)&&`${t}-pagination-item--disabled`],onClick:T},U?U({page:i,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount}):B(Vn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(dr,null):B(ar,null)})),l?B(Oe,null,B("div",{class:`${t}-pagination-quick-jumper`},B(Ls,{value:v,onUpdateValue:M,size:u,placeholder:"",disabled:n,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:R}))," /"," ",a):d.map((V,q)=>{let G,te,oe;const{type:ie}=V;switch(ie){case"page":const K=V.label;z?G=z({type:"page",node:K,active:V.active}):G=K;break;case"fast-forward":const J=this.fastForwardActive?B(Vn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(lr,null):B(cr,null)}):B(Vn,{clsPrefix:t},{default:()=>B(Wp,null)});z?G=z({type:"fast-forward",node:J,active:this.fastForwardActive||this.showFastForwardMenu}):G=J,te=this.handleFastForwardMouseenter,oe=this.handleFastForwardMouseleave;break;case"fast-backward":const Q=this.fastBackwardActive?B(Vn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(cr,null):B(lr,null)}):B(Vn,{clsPrefix:t},{default:()=>B(Wp,null)});z?G=z({type:"fast-backward",node:Q,active:this.fastBackwardActive||this.showFastBackwardMenu}):G=Q,te=this.handleFastBackwardMouseenter,oe=this.handleFastBackwardMouseleave;break}const ye=B("div",{key:q,class:[`${t}-pagination-item`,V.active&&`${t}-pagination-item--active`,ie!=="page"&&(ie==="fast-backward"&&this.showFastBackwardMenu||ie==="fast-forward"&&this.showFastForwardMenu)&&`${t}-pagination-item--hover`,n&&`${t}-pagination-item--disabled`,ie==="page"&&`${t}-pagination-item--clickable`],onClick:()=>{A(V)},onMouseenter:te,onMouseleave:oe},G);if(ie==="page"&&!V.mayBeFastBackward&&!V.mayBeFastForward)return ye;{const K=V.type==="page"?V.mayBeFastBackward?"fast-backward":"fast-forward":V.type;return V.type!=="page"&&!V.options?ye:B(BM,{to:this.to,key:K,disabled:n,trigger:"hover",virtualScroll:!0,style:{width:"60px"},theme:c.peers.Popselect,themeOverrides:c.peerOverrides.Popselect,builtinThemeOverrides:{peers:{InternalSelectMenu:{height:"calc(var(--n-option-height) * 4.6)"}}},nodeProps:()=>({style:{justifyContent:"center"}}),show:ie==="page"?!1:ie==="fast-backward"?this.showFastBackwardMenu:this.showFastForwardMenu,onUpdateShow:J=>{ie!=="page"&&(J?ie==="fast-backward"?this.showFastBackwardMenu=J:this.showFastForwardMenu=J:(this.showFastBackwardMenu=!1,this.showFastForwardMenu=!1))},options:V.type!=="page"&&V.options?V.options:[],onUpdateValue:this.handleMenuSelect,scrollable:!0,showCheckmark:!1},{default:()=>ye})}}),B("div",{class:[`${t}-pagination-item`,!W&&`${t}-pagination-item--button`,{[`${t}-pagination-item--disabled`]:i<1||i>=a||n}],onClick:E},W?W({page:i,pageSize:m,pageCount:a,itemCount:this.mergedItemCount,startIndex:this.startIndex,endIndex:this.endIndex}):B(Vn,{clsPrefix:t},{default:()=>this.rtlEnabled?B(ar,null):B(dr,null)})));case"size-picker":return!l&&r?B(Y_,Object.assign({consistentMenuWidth:!1,placeholder:"",showCheckmark:!1,to:this.to},this.selectProps,{size:g,options:y,value:m,disabled:n,theme:c.peers.Select,themeOverrides:c.peerOverrides.Select,onUpdateValue:w})):null;case"quick-jumper":return!l&&o?B("div",{class:`${t}-pagination-quick-jumper`},P?P():Jt(this.$slots.goto,()=>[p.goto]),B(Ls,{value:v,onUpdateValue:M,size:u,placeholder:"",disabled:n,theme:c.peers.Input,themeOverrides:c.peerOverrides.Input,onChange:R})):null;default:return null}}),O?B("div",{class:`${t}-pagination-suffix`},O({page:i,pageSize:m,pageCount:a,startIndex:this.startIndex,endIndex:this.endIndex,itemCount:this.mergedItemCount})):null)}}),WM=Object.assign(Object.assign({},Ht.props),{onUnstableColumnResize:Function,pagination:{type:[Object,Boolean],default:!1},paginateSinglePage:{type:Boolean,default:!0},minHeight:[Number,String],maxHeight:[Number,String],columns:{type:Array,default:()=>[]},rowClassName:[String,Function],rowProps:Function,rowKey:Function,summary:[Function],data:{type:Array,default:()=>[]},loading:Boolean,bordered:{type:Boolean,default:void 0},bottomBordered:{type:Boolean,default:void 0},striped:Boolean,scrollX:[Number,String],defaultCheckedRowKeys:{type:Array,default:()=>[]},checkedRowKeys:Array,singleLine:{type:Boolean,default:!0},singleColumn:Boolean,size:{type:String,default:"medium"},remote:Boolean,defaultExpandedRowKeys:{type:Array,default:[]},defaultExpandAll:Boolean,expandedRowKeys:Array,stickyExpandedRows:Boolean,virtualScroll:Boolean,virtualScrollX:Boolean,virtualScrollHeader:Boolean,headerHeight:{type:Number,default:28},heightForRow:Function,minRowHeight:{type:Number,default:28},tableLayout:{type:String,default:"auto"},allowCheckingNotLoaded:Boolean,cascade:{type:Boolean,default:!0},childrenKey:{type:String,default:"children"},indent:{type:Number,default:16},flexHeight:Boolean,summaryPlacement:{type:String,default:"bottom"},paginationBehaviorOnFilter:{type:String,default:"current"},filterIconPopoverProps:Object,scrollbarProps:Object,renderCell:Function,renderExpandIcon:Function,spinProps:{type:Object,default:{}},getCsvCell:Function,getCsvHeader:Function,onLoad:Function,"onUpdate:page":[Function,Array],onUpdatePage:[Function,Array],"onUpdate:pageSize":[Function,Array],onUpdatePageSize:[Function,Array],"onUpdate:sorter":[Function,Array],onUpdateSorter:[Function,Array],"onUpdate:filters":[Function,Array],onUpdateFilters:[Function,Array],"onUpdate:checkedRowKeys":[Function,Array],onUpdateCheckedRowKeys:[Function,Array],"onUpdate:expandedRowKeys":[Function,Array],onUpdateExpandedRowKeys:[Function,Array],onScroll:Function,onPageChange:[Function,Array],onPageSizeChange:[Function,Array],onSorterChange:[Function,Array],onFiltersChange:[Function,Array],onCheckedRowKeysChange:[Function,Array]}),Zs=ds("n-data-table"),X_=40,J_=40;function ov(e){if(e.type==="selection")return e.width===void 0?X_:oo(e.width);if(e.type==="expand")return e.width===void 0?J_:oo(e.width);if(!("children"in e))return typeof e.width=="string"?oo(e.width):e.width}function jM(e){var t,n;if(e.type==="selection")return ls((t=e.width)!==null&&t!==void 0?t:X_);if(e.type==="expand")return ls((n=e.width)!==null&&n!==void 0?n:J_);if(!("children"in e))return ls(e.width)}function Gs(e){return e.type==="selection"?"__n_selection__":e.type==="expand"?"__n_expand__":e.key}function av(e){return e&&(typeof e=="object"?Object.assign({},e):e)}function qM(e){return e==="ascend"?1:e==="descend"?-1:0}function YM(e,t,n){return n!==void 0&&(e=Math.min(e,typeof n=="number"?n:Number.parseFloat(n))),t!==void 0&&(e=Math.max(e,typeof t=="number"?t:Number.parseFloat(t))),e}function GM(e,t){if(t!==void 0)return{width:t,minWidth:t,maxWidth:t};const n=jM(e),{minWidth:s,maxWidth:i}=e;return{width:n,minWidth:ls(s)||n,maxWidth:ls(i)}}function XM(e,t,n){return typeof n=="function"?n(e,t):n||""}function dd(e){return e.filterOptionValues!==void 0||e.filterOptionValue===void 0&&e.defaultFilterOptionValues!==void 0}function ud(e){return"children"in e?!1:!!e.sorter}function Q_(e){return"children"in e&&e.children.length?!1:!!e.resizable}function lv(e){return"children"in e?!1:!!e.filter&&(!!e.filterOptions||!!e.renderFilterMenu)}function cv(e){if(e){if(e==="descend")return"ascend"}else return"descend";return!1}function JM(e,t){return e.sorter===void 0?null:t===null||t.columnKey!==e.key?{columnKey:e.key,sorter:e.sorter,order:cv(!1)}:Object.assign(Object.assign({},t),{order:cv(t.order)})}function Z_(e,t){return t.find(n=>n.columnKey===e.key&&n.order)!==void 0}function QM(e){return typeof e=="string"?e.replace(/,/g,"\\,"):e==null?"":`${e}`.replace(/,/g,"\\,")}function ZM(e,t,n,s){const i=e.filter(r=>r.type!=="expand"&&r.type!=="selection"&&r.allowExport!==!1),a=i.map(r=>s?s(r):r.title).join(","),d=t.map(r=>i.map(o=>n?n(r[o.key],r,o):QM(r[o.key])).join(","));return[a,...d].join(` +`)}const e3=$e({name:"DataTableBodyCheckbox",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,mergedInderminateRowKeySetRef:n}=Ut(Zs);return()=>{const{rowKey:s}=e;return B(hh,{privateInsideTable:!0,disabled:e.disabled,indeterminate:n.value.has(s),checked:t.value.has(s),onUpdateChecked:e.onUpdateChecked})}}}),t3=Ce("radio",` + line-height: var(--n-label-line-height); + outline: none; + position: relative; + user-select: none; + -webkit-user-select: none; + display: inline-flex; + align-items: flex-start; + flex-wrap: nowrap; + font-size: var(--n-font-size); + word-break: break-word; +`,[Ue("checked",[qe("dot",` + background-color: var(--n-color-active); + `)]),qe("dot-wrapper",` + position: relative; + flex-shrink: 0; + flex-grow: 0; + width: var(--n-radio-size); + `),Ce("radio-input",` + position: absolute; + border: 0; + border-radius: inherit; + left: 0; + right: 0; + top: 0; + bottom: 0; + opacity: 0; + z-index: 1; + cursor: pointer; + `),qe("dot",` + position: absolute; + top: 50%; + left: 0; + transform: translateY(-50%); + height: var(--n-radio-size); + width: var(--n-radio-size); + background: var(--n-color); + box-shadow: var(--n-box-shadow); + border-radius: 50%; + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); + `,[ze("&::before",` + content: ""; + opacity: 0; + position: absolute; + left: 4px; + top: 4px; + height: calc(100% - 8px); + width: calc(100% - 8px); + border-radius: 50%; + transform: scale(.8); + background: var(--n-dot-color-active); + transition: + opacity .3s var(--n-bezier), + background-color .3s var(--n-bezier), + transform .3s var(--n-bezier); + `),Ue("checked",{boxShadow:"var(--n-box-shadow-active)"},[ze("&::before",` + opacity: 1; + transform: scale(1); + `)])]),qe("label",` + color: var(--n-text-color); + padding: var(--n-label-padding); + font-weight: var(--n-label-font-weight); + display: inline-block; + transition: color .3s var(--n-bezier); + `),Cn("disabled",` + cursor: pointer; + `,[ze("&:hover",[qe("dot",{boxShadow:"var(--n-box-shadow-hover)"})]),Ue("focus",[ze("&:not(:active)",[qe("dot",{boxShadow:"var(--n-box-shadow-focus)"})])])]),Ue("disabled",` + cursor: not-allowed; + `,[qe("dot",{boxShadow:"var(--n-box-shadow-disabled)",backgroundColor:"var(--n-color-disabled)"},[ze("&::before",{backgroundColor:"var(--n-dot-color-disabled)"}),Ue("checked",` + opacity: 1; + `)]),qe("label",{color:"var(--n-text-color-disabled)"}),Ce("radio-input",` + cursor: not-allowed; + `)])]),n3={name:String,value:{type:[String,Number,Boolean],default:"on"},checked:{type:Boolean,default:void 0},defaultChecked:Boolean,disabled:{type:Boolean,default:void 0},label:String,size:String,onUpdateChecked:[Function,Array],"onUpdate:checked":[Function,Array],checkedValue:{type:Boolean,default:void 0}},ey=ds("n-radio-group");function s3(e){const t=Ut(ey,null),n=ur(e,{mergedSize(f){const{size:_}=e;if(_!==void 0)return _;if(t){const{mergedSizeRef:{value:S}}=t;if(S!==void 0)return S}return f?f.mergedSize.value:"medium"},mergedDisabled(f){return!!(e.disabled||t!=null&&t.disabledRef.value||f!=null&&f.disabled.value)}}),{mergedSizeRef:s,mergedDisabledRef:i}=n,a=H(null),d=H(null),r=H(e.defaultChecked),o=dt(e,"checked"),c=ns(o,r),p=en(()=>t?t.valueRef.value===e.value:c.value),u=en(()=>{const{name:f}=e;if(f!==void 0)return f;if(t)return t.nameRef.value}),g=H(!1);function m(){if(t){const{doUpdateValue:f}=t,{value:_}=e;Xe(f,_)}else{const{onUpdateChecked:f,"onUpdate:checked":_}=e,{nTriggerFormInput:S,nTriggerFormChange:k}=n;f&&Xe(f,!0),_&&Xe(_,!0),S(),k(),r.value=!0}}function y(){i.value||p.value||m()}function v(){y(),a.value&&(a.value.checked=p.value)}function l(){g.value=!1}function h(){g.value=!0}return{mergedClsPrefix:t?t.mergedClsPrefixRef:mn(e).mergedClsPrefixRef,inputRef:a,labelRef:d,mergedName:u,mergedDisabled:i,renderSafeChecked:p,focus:g,mergedSize:s,handleRadioInputChange:v,handleRadioInputBlur:l,handleRadioInputFocus:h}}const i3=Object.assign(Object.assign({},Ht.props),n3),ty=$e({name:"Radio",props:i3,setup(e){const t=s3(e),n=Ht("Radio","-radio",t3,vg,e,t.mergedClsPrefix),s=j(()=>{const{mergedSize:{value:c}}=t,{common:{cubicBezierEaseInOut:p},self:{boxShadow:u,boxShadowActive:g,boxShadowDisabled:m,boxShadowFocus:y,boxShadowHover:v,color:l,colorDisabled:h,colorActive:f,textColor:_,textColorDisabled:S,dotColorActive:k,dotColorDisabled:P,labelPadding:M,labelLineHeight:w,labelFontWeight:T,[Mt("fontSize",c)]:A,[Mt("radioSize",c)]:E}}=n.value;return{"--n-bezier":p,"--n-label-line-height":w,"--n-label-font-weight":T,"--n-box-shadow":u,"--n-box-shadow-active":g,"--n-box-shadow-disabled":m,"--n-box-shadow-focus":y,"--n-box-shadow-hover":v,"--n-color":l,"--n-color-active":f,"--n-color-disabled":h,"--n-dot-color-active":k,"--n-dot-color-disabled":P,"--n-font-size":A,"--n-radio-size":E,"--n-text-color":_,"--n-text-color-disabled":S,"--n-label-padding":M}}),{inlineThemeDisabled:i,mergedClsPrefixRef:a,mergedRtlRef:d}=mn(e),r=ui("Radio",d,a),o=i?Bn("radio",j(()=>t.mergedSize.value[0]),s,e):void 0;return Object.assign(t,{rtlEnabled:r,cssVars:i?void 0:s,themeClass:o==null?void 0:o.themeClass,onRender:o==null?void 0:o.onRender})},render(){const{$slots:e,mergedClsPrefix:t,onRender:n,label:s}=this;return n==null||n(),B("label",{class:[`${t}-radio`,this.themeClass,this.rtlEnabled&&`${t}-radio--rtl`,this.mergedDisabled&&`${t}-radio--disabled`,this.renderSafeChecked&&`${t}-radio--checked`,this.focus&&`${t}-radio--focus`],style:this.cssVars},B("input",{ref:"inputRef",type:"radio",class:`${t}-radio-input`,value:this.value,name:this.mergedName,checked:this.renderSafeChecked,disabled:this.mergedDisabled,onChange:this.handleRadioInputChange,onFocus:this.handleRadioInputFocus,onBlur:this.handleRadioInputBlur}),B("div",{class:`${t}-radio__dot-wrapper`}," ",B("div",{class:[`${t}-radio__dot`,this.renderSafeChecked&&`${t}-radio__dot--checked`]})),Ns(e.default,i=>!i&&!s?null:B("div",{ref:"labelRef",class:`${t}-radio__label`},i||s)))}}),r3=Ce("radio-group",` + display: inline-block; + font-size: var(--n-font-size); +`,[qe("splitor",` + display: inline-block; + vertical-align: bottom; + width: 1px; + transition: + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier); + background: var(--n-button-border-color); + `,[Ue("checked",{backgroundColor:"var(--n-button-border-color-active)"}),Ue("disabled",{opacity:"var(--n-opacity-disabled)"})]),Ue("button-group",` + white-space: nowrap; + height: var(--n-height); + line-height: var(--n-height); + `,[Ce("radio-button",{height:"var(--n-height)",lineHeight:"var(--n-height)"}),qe("splitor",{height:"var(--n-height)"})]),Ce("radio-button",` + vertical-align: bottom; + outline: none; + position: relative; + user-select: none; + -webkit-user-select: none; + display: inline-block; + box-sizing: border-box; + padding-left: 14px; + padding-right: 14px; + white-space: nowrap; + transition: + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier), + border-color .3s var(--n-bezier), + color .3s var(--n-bezier); + background: var(--n-button-color); + color: var(--n-button-text-color); + border-top: 1px solid var(--n-button-border-color); + border-bottom: 1px solid var(--n-button-border-color); + `,[Ce("radio-input",` + pointer-events: none; + position: absolute; + border: 0; + border-radius: inherit; + left: 0; + right: 0; + top: 0; + bottom: 0; + opacity: 0; + z-index: 1; + `),qe("state-border",` + z-index: 1; + pointer-events: none; + position: absolute; + box-shadow: var(--n-button-box-shadow); + transition: box-shadow .3s var(--n-bezier); + left: -1px; + bottom: -1px; + right: -1px; + top: -1px; + `),ze("&:first-child",` + border-top-left-radius: var(--n-button-border-radius); + border-bottom-left-radius: var(--n-button-border-radius); + border-left: 1px solid var(--n-button-border-color); + `,[qe("state-border",` + border-top-left-radius: var(--n-button-border-radius); + border-bottom-left-radius: var(--n-button-border-radius); + `)]),ze("&:last-child",` + border-top-right-radius: var(--n-button-border-radius); + border-bottom-right-radius: var(--n-button-border-radius); + border-right: 1px solid var(--n-button-border-color); + `,[qe("state-border",` + border-top-right-radius: var(--n-button-border-radius); + border-bottom-right-radius: var(--n-button-border-radius); + `)]),Cn("disabled",` + cursor: pointer; + `,[ze("&:hover",[qe("state-border",` + transition: box-shadow .3s var(--n-bezier); + box-shadow: var(--n-button-box-shadow-hover); + `),Cn("checked",{color:"var(--n-button-text-color-hover)"})]),Ue("focus",[ze("&:not(:active)",[qe("state-border",{boxShadow:"var(--n-button-box-shadow-focus)"})])])]),Ue("checked",` + background: var(--n-button-color-active); + color: var(--n-button-text-color-active); + border-color: var(--n-button-border-color-active); + `),Ue("disabled",` + cursor: not-allowed; + opacity: var(--n-opacity-disabled); + `)])]);function o3(e,t,n){var s;const i=[];let a=!1;for(let d=0;d{const{value:k}=n,{common:{cubicBezierEaseInOut:P},self:{buttonBorderColor:M,buttonBorderColorActive:w,buttonBorderRadius:T,buttonBoxShadow:A,buttonBoxShadowFocus:E,buttonBoxShadowHover:R,buttonColor:D,buttonColorActive:I,buttonTextColor:O,buttonTextColorActive:U,buttonTextColorHover:W,opacityDisabled:z,[Mt("buttonHeight",k)]:N,[Mt("fontSize",k)]:V}}=u.value;return{"--n-font-size":V,"--n-bezier":P,"--n-button-border-color":M,"--n-button-border-color-active":w,"--n-button-border-radius":T,"--n-button-box-shadow":A,"--n-button-box-shadow-focus":E,"--n-button-box-shadow-hover":R,"--n-button-color":D,"--n-button-color-active":I,"--n-button-text-color":O,"--n-button-text-color-hover":W,"--n-button-text-color-active":U,"--n-height":N,"--n-opacity-disabled":z}}),S=c?Bn("radio-group",j(()=>n.value[0]),_,e):void 0;return{selfElRef:t,rtlEnabled:f,mergedClsPrefix:o,mergedValue:y,handleFocusout:h,handleFocusin:l,cssVars:c?void 0:_,themeClass:S==null?void 0:S.themeClass,onRender:S==null?void 0:S.onRender}},render(){var e;const{mergedValue:t,mergedClsPrefix:n,handleFocusin:s,handleFocusout:i}=this,{children:a,isButtonGroup:d}=o3(Cg(I0(this)),t,n);return(e=this.onRender)===null||e===void 0||e.call(this),B("div",{onFocusin:s,onFocusout:i,ref:"selfElRef",class:[`${n}-radio-group`,this.rtlEnabled&&`${n}-radio-group--rtl`,this.themeClass,d&&`${n}-radio-group--button-group`],style:this.cssVars},a)}}),c3=$e({name:"DataTableBodyRadio",props:{rowKey:{type:[String,Number],required:!0},disabled:{type:Boolean,required:!0},onUpdateChecked:{type:Function,required:!0}},setup(e){const{mergedCheckedRowKeySetRef:t,componentId:n}=Ut(Zs);return()=>{const{rowKey:s}=e;return B(ty,{name:n,disabled:e.disabled,checked:t.value.has(s),onUpdateChecked:e.onUpdateChecked})}}}),d3=Object.assign(Object.assign({},Or),Ht.props),u3=$e({name:"Tooltip",props:d3,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=mn(e),n=Ht("Tooltip","-tooltip",void 0,e0,e,t),s=H(null);return Object.assign(Object.assign({},{syncPosition(){s.value.syncPosition()},setShow(a){s.value.setShow(a)}}),{popoverRef:s,mergedTheme:n,popoverThemeOverrides:j(()=>n.value.self)})},render(){const{mergedTheme:e,internalExtraClass:t}=this;return B(Ao,Object.assign(Object.assign({},this.$props),{theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,builtinThemeOverrides:this.popoverThemeOverrides,internalExtraClass:t.concat("tooltip"),ref:"popoverRef"}),this.$slots)}}),ny=Ce("ellipsis",{overflow:"hidden"},[Cn("line-clamp",` + white-space: nowrap; + display: inline-block; + vertical-align: bottom; + max-width: 100%; + `),Ue("line-clamp",` + display: -webkit-inline-box; + -webkit-box-orient: vertical; + `),Ue("cursor-pointer",` + cursor: pointer; + `)]);function uu(e){return`${e}-ellipsis--line-clamp`}function hu(e,t){return`${e}-ellipsis--cursor-${t}`}const sy=Object.assign(Object.assign({},Ht.props),{expandTrigger:String,lineClamp:[Number,String],tooltip:{type:[Boolean,Object],default:!0}}),ph=$e({name:"Ellipsis",inheritAttrs:!1,props:sy,setup(e,{slots:t,attrs:n}){const s=gg(),i=Ht("Ellipsis","-ellipsis",ny,t0,e,s),a=H(null),d=H(null),r=H(null),o=H(!1),c=j(()=>{const{lineClamp:l}=e,{value:h}=o;return l!==void 0?{textOverflow:"","-webkit-line-clamp":h?"":l}:{textOverflow:h?"":"ellipsis","-webkit-line-clamp":""}});function p(){let l=!1;const{value:h}=o;if(h)return!0;const{value:f}=a;if(f){const{lineClamp:_}=e;if(m(f),_!==void 0)l=f.scrollHeight<=f.offsetHeight;else{const{value:S}=d;S&&(l=S.getBoundingClientRect().width<=f.getBoundingClientRect().width)}y(f,l)}return l}const u=j(()=>e.expandTrigger==="click"?()=>{var l;const{value:h}=o;h&&((l=r.value)===null||l===void 0||l.setShow(!1)),o.value=!h}:void 0);sg(()=>{var l;e.tooltip&&((l=r.value)===null||l===void 0||l.setShow(!1))});const g=()=>B("span",Object.assign({},or(n,{class:[`${s.value}-ellipsis`,e.lineClamp!==void 0?uu(s.value):void 0,e.expandTrigger==="click"?hu(s.value,"pointer"):void 0],style:c.value}),{ref:"triggerRef",onClick:u.value,onMouseenter:e.expandTrigger==="click"?p:void 0}),e.lineClamp?t:B("span",{ref:"triggerInnerRef"},t));function m(l){if(!l)return;const h=c.value,f=uu(s.value);e.lineClamp!==void 0?v(l,f,"add"):v(l,f,"remove");for(const _ in h)l.style[_]!==h[_]&&(l.style[_]=h[_])}function y(l,h){const f=hu(s.value,"pointer");e.expandTrigger==="click"&&!h?v(l,f,"add"):v(l,f,"remove")}function v(l,h,f){f==="add"?l.classList.contains(h)||l.classList.add(h):l.classList.contains(h)&&l.classList.remove(h)}return{mergedTheme:i,triggerRef:a,triggerInnerRef:d,tooltipRef:r,handleClick:u,renderTrigger:g,getTooltipDisabled:p}},render(){var e;const{tooltip:t,renderTrigger:n,$slots:s}=this;if(t){const{mergedTheme:i}=this;return B(u3,Object.assign({ref:"tooltipRef",placement:"top"},t,{getDisabled:this.getTooltipDisabled,theme:i.peers.Tooltip,themeOverrides:i.peerOverrides.Tooltip}),{trigger:n,default:(e=s.tooltip)!==null&&e!==void 0?e:s.default})}else return n()}}),h3=$e({name:"PerformantEllipsis",props:sy,inheritAttrs:!1,setup(e,{attrs:t,slots:n}){const s=H(!1),i=gg();return n0("-ellipsis",ny,i),{mouseEntered:s,renderTrigger:()=>{const{lineClamp:d}=e,r=i.value;return B("span",Object.assign({},or(t,{class:[`${r}-ellipsis`,d!==void 0?uu(r):void 0,e.expandTrigger==="click"?hu(r,"pointer"):void 0],style:d===void 0?{textOverflow:"ellipsis"}:{"-webkit-line-clamp":d}}),{onMouseenter:()=>{s.value=!0}}),d?n:B("span",null,n))}}},render(){return this.mouseEntered?B(ph,or({},this.$attrs,this.$props),this.$slots):this.renderTrigger()}}),f3=$e({name:"DataTableCell",props:{clsPrefix:{type:String,required:!0},row:{type:Object,required:!0},index:{type:Number,required:!0},column:{type:Object,required:!0},isSummary:Boolean,mergedTheme:{type:Object,required:!0},renderCell:Function},render(){var e;const{isSummary:t,column:n,row:s,renderCell:i}=this;let a;const{render:d,key:r,ellipsis:o}=n;if(d&&!t?a=d(s,this.index):t?a=(e=s[r])===null||e===void 0?void 0:e.value:a=i?i(Ad(s,r),s,n):Ad(s,r),o)if(typeof o=="object"){const{mergedTheme:c}=this;return n.ellipsisComponent==="performant-ellipsis"?B(h3,Object.assign({},o,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a}):B(ph,Object.assign({},o,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>a})}else return B("span",{class:`${this.clsPrefix}-data-table-td__ellipsis`},a);return a}}),dv=$e({name:"DataTableExpandTrigger",props:{clsPrefix:{type:String,required:!0},expanded:Boolean,loading:Boolean,onClick:{type:Function,required:!0},renderExpandIcon:{type:Function},rowData:{type:Object,required:!0}},render(){const{clsPrefix:e}=this;return B("div",{class:[`${e}-data-table-expand-trigger`,this.expanded&&`${e}-data-table-expand-trigger--expanded`],onClick:this.onClick,onMousedown:t=>{t.preventDefault()}},B(hg,null,{default:()=>this.loading?B(nc,{key:"loading",clsPrefix:this.clsPrefix,radius:85,strokeWidth:15,scale:.88}):this.renderExpandIcon?this.renderExpandIcon({expanded:this.expanded,rowData:this.rowData}):B(Vn,{clsPrefix:e,key:"base-icon"},{default:()=>B(b_,null)})}))}}),p3=$e({name:"DataTableFilterMenu",props:{column:{type:Object,required:!0},radioGroupName:{type:String,required:!0},multiple:{type:Boolean,required:!0},value:{type:[Array,String,Number],default:null},options:{type:Array,required:!0},onConfirm:{type:Function,required:!0},onClear:{type:Function,required:!0},onChange:{type:Function,required:!0}},setup(e){const{mergedClsPrefixRef:t,mergedRtlRef:n}=mn(e),s=ui("DataTable",n,t),{mergedClsPrefixRef:i,mergedThemeRef:a,localeRef:d}=Ut(Zs),r=H(e.value),o=j(()=>{const{value:y}=r;return Array.isArray(y)?y:null}),c=j(()=>{const{value:y}=r;return dd(e.column)?Array.isArray(y)&&y.length&&y[0]||null:Array.isArray(y)?null:y});function p(y){e.onChange(y)}function u(y){e.multiple&&Array.isArray(y)?r.value=y:dd(e.column)&&!Array.isArray(y)?r.value=[y]:r.value=y}function g(){p(r.value),e.onConfirm()}function m(){e.multiple||dd(e.column)?p([]):p(null),e.onClear()}return{mergedClsPrefix:i,rtlEnabled:s,mergedTheme:a,locale:d,checkboxGroupValue:o,radioGroupValue:c,handleChange:u,handleConfirmClick:g,handleClearClick:m}},render(){const{mergedTheme:e,locale:t,mergedClsPrefix:n}=this;return B("div",{class:[`${n}-data-table-filter-menu`,this.rtlEnabled&&`${n}-data-table-filter-menu--rtl`]},B(Es,null,{default:()=>{const{checkboxGroupValue:s,handleChange:i}=this;return this.multiple?B(LM,{value:s,class:`${n}-data-table-filter-menu__group`,onUpdateValue:i},{default:()=>this.options.map(a=>B(hh,{key:a.value,theme:e.peers.Checkbox,themeOverrides:e.peerOverrides.Checkbox,value:a.value},{default:()=>a.label}))}):B(l3,{name:this.radioGroupName,class:`${n}-data-table-filter-menu__group`,value:this.radioGroupValue,onUpdateValue:this.handleChange},{default:()=>this.options.map(a=>B(ty,{key:a.value,value:a.value,theme:e.peers.Radio,themeOverrides:e.peerOverrides.Radio},{default:()=>a.label}))})}}),B("div",{class:`${n}-data-table-filter-menu__action`},B(gn,{size:"tiny",theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,onClick:this.handleClearClick},{default:()=>t.clear}),B(gn,{theme:e.peers.Button,themeOverrides:e.peerOverrides.Button,type:"primary",size:"tiny",onClick:this.handleConfirmClick},{default:()=>t.confirm})))}}),v3=$e({name:"DataTableRenderFilter",props:{render:{type:Function,required:!0},active:{type:Boolean,default:!1},show:{type:Boolean,default:!1}},render(){const{render:e,active:t,show:n}=this;return e({active:t,show:n})}});function g3(e,t,n){const s=Object.assign({},e);return s[t]=n,s}const m3=$e({name:"DataTableFilterButton",props:{column:{type:Object,required:!0},options:{type:Array,default:()=>[]}},setup(e){const{mergedComponentPropsRef:t}=mn(),{mergedThemeRef:n,mergedClsPrefixRef:s,mergedFilterStateRef:i,filterMenuCssVarsRef:a,paginationBehaviorOnFilterRef:d,doUpdatePage:r,doUpdateFilters:o,filterIconPopoverPropsRef:c}=Ut(Zs),p=H(!1),u=i,g=j(()=>e.column.filterMultiple!==!1),m=j(()=>{const _=u.value[e.column.key];if(_===void 0){const{value:S}=g;return S?[]:null}return _}),y=j(()=>{const{value:_}=m;return Array.isArray(_)?_.length>0:_!==null}),v=j(()=>{var _,S;return((S=(_=t==null?void 0:t.value)===null||_===void 0?void 0:_.DataTable)===null||S===void 0?void 0:S.renderFilter)||e.column.renderFilter});function l(_){const S=g3(u.value,e.column.key,_);o(S,e.column),d.value==="first"&&r(1)}function h(){p.value=!1}function f(){p.value=!1}return{mergedTheme:n,mergedClsPrefix:s,active:y,showPopover:p,mergedRenderFilter:v,filterIconPopoverProps:c,filterMultiple:g,mergedFilterValue:m,filterMenuCssVars:a,handleFilterChange:l,handleFilterMenuConfirm:f,handleFilterMenuCancel:h}},render(){const{mergedTheme:e,mergedClsPrefix:t,handleFilterMenuCancel:n,filterIconPopoverProps:s}=this;return B(Ao,Object.assign({show:this.showPopover,onUpdateShow:i=>this.showPopover=i,trigger:"click",theme:e.peers.Popover,themeOverrides:e.peerOverrides.Popover,placement:"bottom"},s,{style:{padding:0}}),{trigger:()=>{const{mergedRenderFilter:i}=this;if(i)return B(v3,{"data-data-table-filter":!0,render:i,active:this.active,show:this.showPopover});const{renderFilterIcon:a}=this.column;return B("div",{"data-data-table-filter":!0,class:[`${t}-data-table-filter`,{[`${t}-data-table-filter--active`]:this.active,[`${t}-data-table-filter--show`]:this.showPopover}]},a?a({active:this.active,show:this.showPopover}):B(Vn,{clsPrefix:t},{default:()=>B(sL,null)}))},default:()=>{const{renderFilterMenu:i}=this.column;return i?i({hide:n}):B(p3,{style:this.filterMenuCssVars,radioGroupName:String(this.column.key),multiple:this.filterMultiple,value:this.mergedFilterValue,options:this.options,column:this.column,onChange:this.handleFilterChange,onClear:this.handleFilterMenuCancel,onConfirm:this.handleFilterMenuConfirm})}})}}),_3=$e({name:"ColumnResizeButton",props:{onResizeStart:Function,onResize:Function,onResizeEnd:Function},setup(e){const{mergedClsPrefixRef:t}=Ut(Zs),n=H(!1);let s=0;function i(o){return o.clientX}function a(o){var c;o.preventDefault();const p=n.value;s=i(o),n.value=!0,p||(Kn("mousemove",window,d),Kn("mouseup",window,r),(c=e.onResizeStart)===null||c===void 0||c.call(e))}function d(o){var c;(c=e.onResize)===null||c===void 0||c.call(e,i(o)-s)}function r(){var o;n.value=!1,(o=e.onResizeEnd)===null||o===void 0||o.call(e),Fn("mousemove",window,d),Fn("mouseup",window,r)}return Vt(()=>{Fn("mousemove",window,d),Fn("mouseup",window,r)}),{mergedClsPrefix:t,active:n,handleMousedown:a}},render(){const{mergedClsPrefix:e}=this;return B("span",{"data-data-table-resizable":!0,class:[`${e}-data-table-resize-button`,this.active&&`${e}-data-table-resize-button--active`],onMousedown:this.handleMousedown})}}),y3=$e({name:"DataTableRenderSorter",props:{render:{type:Function,required:!0},order:{type:[String,Boolean],default:!1}},render(){const{render:e,order:t}=this;return e({order:t})}}),b3=$e({name:"SortIcon",props:{column:{type:Object,required:!0}},setup(e){const{mergedComponentPropsRef:t}=mn(),{mergedSortStateRef:n,mergedClsPrefixRef:s}=Ut(Zs),i=j(()=>n.value.find(o=>o.columnKey===e.column.key)),a=j(()=>i.value!==void 0),d=j(()=>{const{value:o}=i;return o&&a.value?o.order:!1}),r=j(()=>{var o,c;return((c=(o=t==null?void 0:t.value)===null||o===void 0?void 0:o.DataTable)===null||c===void 0?void 0:c.renderSorter)||e.column.renderSorter});return{mergedClsPrefix:s,active:a,mergedSortOrder:d,mergedRenderSorter:r}},render(){const{mergedRenderSorter:e,mergedSortOrder:t,mergedClsPrefix:n}=this,{renderSorterIcon:s}=this.column;return e?B(y3,{render:e,order:t}):B("span",{class:[`${n}-data-table-sorter`,t==="ascend"&&`${n}-data-table-sorter--asc`,t==="descend"&&`${n}-data-table-sorter--desc`]},s?s({order:t}):B(Vn,{clsPrefix:n},{default:()=>B(eL,null)}))}}),vh=ds("n-dropdown-menu"),gc=ds("n-dropdown"),uv=ds("n-dropdown-option"),iy=$e({name:"DropdownDivider",props:{clsPrefix:{type:String,required:!0}},render(){return B("div",{class:`${this.clsPrefix}-dropdown-divider`})}}),w3=$e({name:"DropdownGroupHeader",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0}},setup(){const{showIconRef:e,hasSubmenuRef:t}=Ut(vh),{renderLabelRef:n,labelFieldRef:s,nodePropsRef:i,renderOptionRef:a}=Ut(gc);return{labelField:s,showIcon:e,hasSubmenu:t,renderLabel:n,nodeProps:i,renderOption:a}},render(){var e;const{clsPrefix:t,hasSubmenu:n,showIcon:s,nodeProps:i,renderLabel:a,renderOption:d}=this,{rawNode:r}=this.tmNode,o=B("div",Object.assign({class:`${t}-dropdown-option`},i==null?void 0:i(r)),B("div",{class:`${t}-dropdown-option-body ${t}-dropdown-option-body--group`},B("div",{"data-dropdown-option":!0,class:[`${t}-dropdown-option-body__prefix`,s&&`${t}-dropdown-option-body__prefix--show-icon`]},li(r.icon)),B("div",{class:`${t}-dropdown-option-body__label`,"data-dropdown-option":!0},a?a(r):li((e=r.title)!==null&&e!==void 0?e:r[this.labelField])),B("div",{class:[`${t}-dropdown-option-body__suffix`,n&&`${t}-dropdown-option-body__suffix--has-submenu`],"data-dropdown-option":!0})));return d?d({node:o,option:r}):o}}),S3=Ce("icon",` + height: 1em; + width: 1em; + line-height: 1em; + text-align: center; + display: inline-block; + position: relative; + fill: currentColor; + transform: translateZ(0); +`,[Ue("color-transition",{transition:"color .3s var(--n-bezier)"}),Ue("depth",{color:"var(--n-color)"},[ze("svg",{opacity:"var(--n-opacity)",transition:"opacity .3s var(--n-bezier)"})]),ze("svg",{height:"1em",width:"1em"})]),C3=Object.assign(Object.assign({},Ht.props),{depth:[String,Number],size:[Number,String],color:String,component:[Object,Function]}),k3=$e({_n_icon__:!0,name:"Icon",inheritAttrs:!1,props:C3,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=mn(e),s=Ht("Icon","-icon",S3,s0,e,t),i=j(()=>{const{depth:d}=e,{common:{cubicBezierEaseInOut:r},self:o}=s.value;if(d!==void 0){const{color:c,[`opacity${d}Depth`]:p}=o;return{"--n-bezier":r,"--n-color":c,"--n-opacity":p}}return{"--n-bezier":r,"--n-color":"","--n-opacity":""}}),a=n?Bn("icon",j(()=>`${e.depth||"d"}`),i,e):void 0;return{mergedClsPrefix:t,mergedStyle:j(()=>{const{size:d,color:r}=e;return{fontSize:ls(d),color:r}}),cssVars:n?void 0:i,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e;const{$parent:t,depth:n,mergedClsPrefix:s,component:i,onRender:a,themeClass:d}=this;return!((e=t==null?void 0:t.$options)===null||e===void 0)&&e._n_icon__&&Ir("icon","don't wrap `n-icon` inside `n-icon`"),a==null||a(),B("i",or(this.$attrs,{role:"img",class:[`${s}-icon`,d,{[`${s}-icon--depth`]:n,[`${s}-icon--color-transition`]:n!==void 0}],style:[this.cssVars,this.mergedStyle]}),i?B(i):this.$slots)}});function fu(e,t){return e.type==="submenu"||e.type===void 0&&e[t]!==void 0}function x3(e){return e.type==="group"}function ry(e){return e.type==="divider"}function R3(e){return e.type==="render"}const oy=$e({name:"DropdownOption",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null},placement:{type:String,default:"right-start"},props:Object,scrollable:Boolean},setup(e){const t=Ut(gc),{hoverKeyRef:n,keyboardKeyRef:s,lastToggledSubmenuKeyRef:i,pendingKeyPathRef:a,activeKeyPathRef:d,animatedRef:r,mergedShowRef:o,renderLabelRef:c,renderIconRef:p,labelFieldRef:u,childrenFieldRef:g,renderOptionRef:m,nodePropsRef:y,menuPropsRef:v}=t,l=Ut(uv,null),h=Ut(vh),f=Ut(fc),_=j(()=>e.tmNode.rawNode),S=j(()=>{const{value:W}=g;return fu(e.tmNode.rawNode,W)}),k=j(()=>{const{disabled:W}=e.tmNode;return W}),P=j(()=>{if(!S.value)return!1;const{key:W,disabled:z}=e.tmNode;if(z)return!1;const{value:N}=n,{value:V}=s,{value:q}=i,{value:G}=a;return N!==null?G.includes(W):V!==null?G.includes(W)&&G[G.length-1]!==W:q!==null?G.includes(W):!1}),M=j(()=>s.value===null&&!r.value),w=mP(P,300,M),T=j(()=>!!(l!=null&&l.enteringSubmenuRef.value)),A=H(!1);kn(uv,{enteringSubmenuRef:A});function E(){A.value=!0}function R(){A.value=!1}function D(){const{parentKey:W,tmNode:z}=e;z.disabled||o.value&&(i.value=W,s.value=null,n.value=z.key)}function I(){const{tmNode:W}=e;W.disabled||o.value&&n.value!==W.key&&D()}function O(W){if(e.tmNode.disabled||!o.value)return;const{relatedTarget:z}=W;z&&!ws({target:z},"dropdownOption")&&!ws({target:z},"scrollbarRail")&&(n.value=null)}function U(){const{value:W}=S,{tmNode:z}=e;o.value&&!W&&!z.disabled&&(t.doSelect(z.key,z.rawNode),t.doUpdateShow(!1))}return{labelField:u,renderLabel:c,renderIcon:p,siblingHasIcon:h.showIconRef,siblingHasSubmenu:h.hasSubmenuRef,menuProps:v,popoverBody:f,animated:r,mergedShowSubmenu:j(()=>w.value&&!T.value),rawNode:_,hasSubmenu:S,pending:en(()=>{const{value:W}=a,{key:z}=e.tmNode;return W.includes(z)}),childActive:en(()=>{const{value:W}=d,{key:z}=e.tmNode,N=W.findIndex(V=>z===V);return N===-1?!1:N{const{value:W}=d,{key:z}=e.tmNode,N=W.findIndex(V=>z===V);return N===-1?!1:N===W.length-1}),mergedDisabled:k,renderOption:m,nodeProps:y,handleClick:U,handleMouseMove:I,handleMouseEnter:D,handleMouseLeave:O,handleSubmenuBeforeEnter:E,handleSubmenuAfterEnter:R}},render(){var e,t;const{animated:n,rawNode:s,mergedShowSubmenu:i,clsPrefix:a,siblingHasIcon:d,siblingHasSubmenu:r,renderLabel:o,renderIcon:c,renderOption:p,nodeProps:u,props:g,scrollable:m}=this;let y=null;if(i){const f=(e=this.menuProps)===null||e===void 0?void 0:e.call(this,s,s.children);y=B(ay,Object.assign({},f,{clsPrefix:a,scrollable:this.scrollable,tmNodes:this.tmNode.children,parentKey:this.tmNode.key}))}const v={class:[`${a}-dropdown-option-body`,this.pending&&`${a}-dropdown-option-body--pending`,this.active&&`${a}-dropdown-option-body--active`,this.childActive&&`${a}-dropdown-option-body--child-active`,this.mergedDisabled&&`${a}-dropdown-option-body--disabled`],onMousemove:this.handleMouseMove,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onClick:this.handleClick},l=u==null?void 0:u(s),h=B("div",Object.assign({class:[`${a}-dropdown-option`,l==null?void 0:l.class],"data-dropdown-option":!0},l),B("div",or(v,g),[B("div",{class:[`${a}-dropdown-option-body__prefix`,d&&`${a}-dropdown-option-body__prefix--show-icon`]},[c?c(s):li(s.icon)]),B("div",{"data-dropdown-option":!0,class:`${a}-dropdown-option-body__label`},o?o(s):li((t=s[this.labelField])!==null&&t!==void 0?t:s.title)),B("div",{"data-dropdown-option":!0,class:[`${a}-dropdown-option-body__suffix`,r&&`${a}-dropdown-option-body__suffix--has-submenu`]},this.hasSubmenu?B(k3,null,{default:()=>B(b_,null)}):null)]),this.hasSubmenu?B(Eo,null,{default:()=>[B(Lo,null,{default:()=>B("div",{class:`${a}-dropdown-offset-container`},B(Do,{show:this.mergedShowSubmenu,placement:this.placement,to:m&&this.popoverBody||void 0,teleportDisabled:!m},{default:()=>B("div",{class:`${a}-dropdown-menu-wrapper`},n?B(ys,{onBeforeEnter:this.handleSubmenuBeforeEnter,onAfterEnter:this.handleSubmenuAfterEnter,name:"fade-in-scale-up-transition",appear:!0},{default:()=>y}):y)}))})]}):null);return p?p({node:h,option:s}):h}}),T3=$e({name:"NDropdownGroup",props:{clsPrefix:{type:String,required:!0},tmNode:{type:Object,required:!0},parentKey:{type:[String,Number],default:null}},render(){const{tmNode:e,parentKey:t,clsPrefix:n}=this,{children:s}=e;return B(Oe,null,B(w3,{clsPrefix:n,tmNode:e,key:e.key}),s==null?void 0:s.map(i=>{const{rawNode:a}=i;return a.show===!1?null:ry(a)?B(iy,{clsPrefix:n,key:i.key}):i.isGroup?(Ir("dropdown","`group` node is not allowed to be put in `group` node."),null):B(oy,{clsPrefix:n,tmNode:i,parentKey:t,key:i.key})}))}}),P3=$e({name:"DropdownRenderOption",props:{tmNode:{type:Object,required:!0}},render(){const{rawNode:{render:e,props:t}}=this.tmNode;return B("div",t,[e==null?void 0:e()])}}),ay=$e({name:"DropdownMenu",props:{scrollable:Boolean,showArrow:Boolean,arrowStyle:[String,Object],clsPrefix:{type:String,required:!0},tmNodes:{type:Array,default:()=>[]},parentKey:{type:[String,Number],default:null}},setup(e){const{renderIconRef:t,childrenFieldRef:n}=Ut(gc);kn(vh,{showIconRef:j(()=>{const i=t.value;return e.tmNodes.some(a=>{var d;if(a.isGroup)return(d=a.children)===null||d===void 0?void 0:d.some(({rawNode:o})=>i?i(o):o.icon);const{rawNode:r}=a;return i?i(r):r.icon})}),hasSubmenuRef:j(()=>{const{value:i}=n;return e.tmNodes.some(a=>{var d;if(a.isGroup)return(d=a.children)===null||d===void 0?void 0:d.some(({rawNode:o})=>fu(o,i));const{rawNode:r}=a;return fu(r,i)})})});const s=H(null);return kn(nh,null),kn(th,null),kn(fc,s),{bodyRef:s}},render(){const{parentKey:e,clsPrefix:t,scrollable:n}=this,s=this.tmNodes.map(i=>{const{rawNode:a}=i;return a.show===!1?null:R3(a)?B(P3,{tmNode:i,key:i.key}):ry(a)?B(iy,{clsPrefix:t,key:i.key}):x3(a)?B(T3,{clsPrefix:t,tmNode:i,parentKey:e,key:i.key}):B(oy,{clsPrefix:t,tmNode:i,parentKey:e,key:i.key,props:a.props,scrollable:n})});return B("div",{class:[`${t}-dropdown-menu`,n&&`${t}-dropdown-menu--scrollable`],ref:"bodyRef"},n?B(ag,{contentClass:`${t}-dropdown-menu__content`},{default:()=>s}):s,this.showArrow?R_({clsPrefix:t,arrowStyle:this.arrowStyle,arrowClass:void 0,arrowWrapperClass:void 0,arrowWrapperStyle:void 0}):null)}}),E3=Ce("dropdown-menu",` + transform-origin: var(--v-transform-origin); + background-color: var(--n-color); + border-radius: var(--n-border-radius); + box-shadow: var(--n-box-shadow); + position: relative; + transition: + background-color .3s var(--n-bezier), + box-shadow .3s var(--n-bezier); +`,[Mo(),Ce("dropdown-option",` + position: relative; + `,[ze("a",` + text-decoration: none; + color: inherit; + outline: none; + `,[ze("&::before",` + content: ""; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `)]),Ce("dropdown-option-body",` + display: flex; + cursor: pointer; + position: relative; + height: var(--n-option-height); + line-height: var(--n-option-height); + font-size: var(--n-font-size); + color: var(--n-option-text-color); + transition: color .3s var(--n-bezier); + `,[ze("&::before",` + content: ""; + position: absolute; + top: 0; + bottom: 0; + left: 4px; + right: 4px; + transition: background-color .3s var(--n-bezier); + border-radius: var(--n-border-radius); + `),Cn("disabled",[Ue("pending",` + color: var(--n-option-text-color-hover); + `,[qe("prefix, suffix",` + color: var(--n-option-text-color-hover); + `),ze("&::before","background-color: var(--n-option-color-hover);")]),Ue("active",` + color: var(--n-option-text-color-active); + `,[qe("prefix, suffix",` + color: var(--n-option-text-color-active); + `),ze("&::before","background-color: var(--n-option-color-active);")]),Ue("child-active",` + color: var(--n-option-text-color-child-active); + `,[qe("prefix, suffix",` + color: var(--n-option-text-color-child-active); + `)])]),Ue("disabled",` + cursor: not-allowed; + opacity: var(--n-option-opacity-disabled); + `),Ue("group",` + font-size: calc(var(--n-font-size) - 1px); + color: var(--n-group-header-text-color); + `,[qe("prefix",` + width: calc(var(--n-option-prefix-width) / 2); + `,[Ue("show-icon",` + width: calc(var(--n-option-icon-prefix-width) / 2); + `)])]),qe("prefix",` + width: var(--n-option-prefix-width); + display: flex; + justify-content: center; + align-items: center; + color: var(--n-prefix-color); + transition: color .3s var(--n-bezier); + z-index: 1; + `,[Ue("show-icon",` + width: var(--n-option-icon-prefix-width); + `),Ce("icon",` + font-size: var(--n-option-icon-size); + `)]),qe("label",` + white-space: nowrap; + flex: 1; + z-index: 1; + `),qe("suffix",` + box-sizing: border-box; + flex-grow: 0; + flex-shrink: 0; + display: flex; + justify-content: flex-end; + align-items: center; + min-width: var(--n-option-suffix-width); + padding: 0 8px; + transition: color .3s var(--n-bezier); + color: var(--n-suffix-color); + z-index: 1; + `,[Ue("has-submenu",` + width: var(--n-option-icon-suffix-width); + `),Ce("icon",` + font-size: var(--n-option-icon-size); + `)]),Ce("dropdown-menu","pointer-events: all;")]),Ce("dropdown-offset-container",` + pointer-events: none; + position: absolute; + left: 0; + right: 0; + top: -4px; + bottom: -4px; + `)]),Ce("dropdown-divider",` + transition: background-color .3s var(--n-bezier); + background-color: var(--n-divider-color); + height: 1px; + margin: 4px 0; + `),Ce("dropdown-menu-wrapper",` + transform-origin: var(--v-transform-origin); + width: fit-content; + `),ze(">",[Ce("scrollbar",` + height: inherit; + max-height: inherit; + `)]),Cn("scrollable",` + padding: var(--n-padding); + `),Ue("scrollable",[qe("content",` + padding: var(--n-padding); + `)])]),L3={animated:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},size:{type:String,default:"medium"},inverted:Boolean,placement:{type:String,default:"bottom"},onSelect:[Function,Array],options:{type:Array,default:()=>[]},menuProps:Function,showArrow:Boolean,renderLabel:Function,renderIcon:Function,renderOption:Function,nodeProps:Function,labelField:{type:String,default:"label"},keyField:{type:String,default:"key"},childrenField:{type:String,default:"children"},value:[String,Number]},D3=Object.keys(Or),M3=Object.assign(Object.assign(Object.assign({},Or),L3),Ht.props),A3=$e({name:"Dropdown",inheritAttrs:!1,props:M3,setup(e){const t=H(!1),n=ns(dt(e,"show"),t),s=j(()=>{const{keyField:R,childrenField:D}=e;return vc(e.options,{getKey(I){return I[R]},getDisabled(I){return I.disabled===!0},getIgnored(I){return I.type==="divider"||I.type==="render"},getChildren(I){return I[D]}})}),i=j(()=>s.value.treeNodes),a=H(null),d=H(null),r=H(null),o=j(()=>{var R,D,I;return(I=(D=(R=a.value)!==null&&R!==void 0?R:d.value)!==null&&D!==void 0?D:r.value)!==null&&I!==void 0?I:null}),c=j(()=>s.value.getPath(o.value).keyPath),p=j(()=>s.value.getPath(e.value).keyPath),u=en(()=>e.keyboard&&n.value);Zu({keydown:{ArrowUp:{prevent:!0,handler:k},ArrowRight:{prevent:!0,handler:S},ArrowDown:{prevent:!0,handler:P},ArrowLeft:{prevent:!0,handler:_},Enter:{prevent:!0,handler:M},Escape:f}},u);const{mergedClsPrefixRef:g,inlineThemeDisabled:m}=mn(e),y=Ht("Dropdown","-dropdown",E3,i0,e,g);kn(gc,{labelFieldRef:dt(e,"labelField"),childrenFieldRef:dt(e,"childrenField"),renderLabelRef:dt(e,"renderLabel"),renderIconRef:dt(e,"renderIcon"),hoverKeyRef:a,keyboardKeyRef:d,lastToggledSubmenuKeyRef:r,pendingKeyPathRef:c,activeKeyPathRef:p,animatedRef:dt(e,"animated"),mergedShowRef:n,nodePropsRef:dt(e,"nodeProps"),renderOptionRef:dt(e,"renderOption"),menuPropsRef:dt(e,"menuProps"),doSelect:v,doUpdateShow:l}),yt(n,R=>{!e.animated&&!R&&h()});function v(R,D){const{onSelect:I}=e;I&&Xe(I,R,D)}function l(R){const{"onUpdate:show":D,onUpdateShow:I}=e;D&&Xe(D,R),I&&Xe(I,R),t.value=R}function h(){a.value=null,d.value=null,r.value=null}function f(){l(!1)}function _(){T("left")}function S(){T("right")}function k(){T("up")}function P(){T("down")}function M(){const R=w();R!=null&&R.isLeaf&&n.value&&(v(R.key,R.rawNode),l(!1))}function w(){var R;const{value:D}=s,{value:I}=o;return!D||I===null?null:(R=D.getNode(I))!==null&&R!==void 0?R:null}function T(R){const{value:D}=o,{value:{getFirstAvailableNode:I}}=s;let O=null;if(D===null){const U=I();U!==null&&(O=U.key)}else{const U=w();if(U){let W;switch(R){case"down":W=U.getNext();break;case"up":W=U.getPrev();break;case"right":W=U.getChild();break;case"left":W=U.getParent();break}W&&(O=W.key)}}O!==null&&(a.value=null,d.value=O)}const A=j(()=>{const{size:R,inverted:D}=e,{common:{cubicBezierEaseInOut:I},self:O}=y.value,{padding:U,dividerColor:W,borderRadius:z,optionOpacityDisabled:N,[Mt("optionIconSuffixWidth",R)]:V,[Mt("optionSuffixWidth",R)]:q,[Mt("optionIconPrefixWidth",R)]:G,[Mt("optionPrefixWidth",R)]:te,[Mt("fontSize",R)]:oe,[Mt("optionHeight",R)]:ie,[Mt("optionIconSize",R)]:ye}=O,K={"--n-bezier":I,"--n-font-size":oe,"--n-padding":U,"--n-border-radius":z,"--n-option-height":ie,"--n-option-prefix-width":te,"--n-option-icon-prefix-width":G,"--n-option-suffix-width":q,"--n-option-icon-suffix-width":V,"--n-option-icon-size":ye,"--n-divider-color":W,"--n-option-opacity-disabled":N};return D?(K["--n-color"]=O.colorInverted,K["--n-option-color-hover"]=O.optionColorHoverInverted,K["--n-option-color-active"]=O.optionColorActiveInverted,K["--n-option-text-color"]=O.optionTextColorInverted,K["--n-option-text-color-hover"]=O.optionTextColorHoverInverted,K["--n-option-text-color-active"]=O.optionTextColorActiveInverted,K["--n-option-text-color-child-active"]=O.optionTextColorChildActiveInverted,K["--n-prefix-color"]=O.prefixColorInverted,K["--n-suffix-color"]=O.suffixColorInverted,K["--n-group-header-text-color"]=O.groupHeaderTextColorInverted):(K["--n-color"]=O.color,K["--n-option-color-hover"]=O.optionColorHover,K["--n-option-color-active"]=O.optionColorActive,K["--n-option-text-color"]=O.optionTextColor,K["--n-option-text-color-hover"]=O.optionTextColorHover,K["--n-option-text-color-active"]=O.optionTextColorActive,K["--n-option-text-color-child-active"]=O.optionTextColorChildActive,K["--n-prefix-color"]=O.prefixColor,K["--n-suffix-color"]=O.suffixColor,K["--n-group-header-text-color"]=O.groupHeaderTextColor),K}),E=m?Bn("dropdown",j(()=>`${e.size[0]}${e.inverted?"i":""}`),A,e):void 0;return{mergedClsPrefix:g,mergedTheme:y,tmNodes:i,mergedShow:n,handleAfterLeave:()=>{e.animated&&h()},doUpdateShow:l,cssVars:m?void 0:A,themeClass:E==null?void 0:E.themeClass,onRender:E==null?void 0:E.onRender}},render(){const e=(s,i,a,d,r)=>{var o;const{mergedClsPrefix:c,menuProps:p}=this;(o=this.onRender)===null||o===void 0||o.call(this);const u=(p==null?void 0:p(void 0,this.tmNodes.map(m=>m.rawNode)))||{},g={ref:g_(i),class:[s,`${c}-dropdown`,this.themeClass],clsPrefix:c,tmNodes:this.tmNodes,style:[...a,this.cssVars],showArrow:this.showArrow,arrowStyle:this.arrowStyle,scrollable:this.scrollable,onMouseenter:d,onMouseleave:r};return B(ay,or(this.$attrs,g,u))},{mergedTheme:t}=this,n={show:this.mergedShow,theme:t.peers.Popover,themeOverrides:t.peerOverrides.Popover,internalOnAfterLeave:this.handleAfterLeave,internalRenderBody:e,onUpdateShow:this.doUpdateShow,"onUpdate:show":void 0};return B(Ao,Object.assign({},pc(this.$props,D3),n),{trigger:()=>{var s,i;return(i=(s=this.$slots).default)===null||i===void 0?void 0:i.call(s)}})}}),ly="_n_all__",cy="_n_none__";function I3(e,t,n,s){return e?i=>{for(const a of e)switch(i){case ly:n(!0);return;case cy:s(!0);return;default:if(typeof a=="object"&&a.key===i){a.onSelect(t.value);return}}}:()=>{}}function $3(e,t){return e?e.map(n=>{switch(n){case"all":return{label:t.checkTableAll,key:ly};case"none":return{label:t.uncheckTableAll,key:cy};default:return n}}):[]}const O3=$e({name:"DataTableSelectionMenu",props:{clsPrefix:{type:String,required:!0}},setup(e){const{props:t,localeRef:n,checkOptionsRef:s,rawPaginatedDataRef:i,doCheckAll:a,doUncheckAll:d}=Ut(Zs),r=j(()=>I3(s.value,i,a,d)),o=j(()=>$3(s.value,n.value));return()=>{var c,p,u,g;const{clsPrefix:m}=e;return B(A3,{theme:(p=(c=t.theme)===null||c===void 0?void 0:c.peers)===null||p===void 0?void 0:p.Dropdown,themeOverrides:(g=(u=t.themeOverrides)===null||u===void 0?void 0:u.peers)===null||g===void 0?void 0:g.Dropdown,options:o.value,onSelect:r.value},{default:()=>B(Vn,{clsPrefix:m,class:`${m}-data-table-check-extra`},{default:()=>B(r0,null)})})}}});function hd(e){return typeof e.title=="function"?e.title(e):e.title}const F3=$e({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},width:String},render(){const{clsPrefix:e,id:t,cols:n,width:s}=this;return B("table",{style:{tableLayout:"fixed",width:s},class:`${e}-data-table-table`},B("colgroup",null,n.map(i=>B("col",{key:i.key,style:i.style}))),B("thead",{"data-n-id":t,class:`${e}-data-table-thead`},this.$slots))}}),dy=$e({name:"DataTableHeader",props:{discrete:{type:Boolean,default:!0}},setup(){const{mergedClsPrefixRef:e,scrollXRef:t,fixedColumnLeftMapRef:n,fixedColumnRightMapRef:s,mergedCurrentPageRef:i,allRowsCheckedRef:a,someRowsCheckedRef:d,rowsRef:r,colsRef:o,mergedThemeRef:c,checkOptionsRef:p,mergedSortStateRef:u,componentId:g,mergedTableLayoutRef:m,headerCheckboxDisabledRef:y,virtualScrollHeaderRef:v,headerHeightRef:l,onUnstableColumnResize:h,doUpdateResizableWidth:f,handleTableHeaderScroll:_,deriveNextSorter:S,doUncheckAll:k,doCheckAll:P}=Ut(Zs),M=H(),w=H({});function T(O){const U=w.value[O];return U==null?void 0:U.getBoundingClientRect().width}function A(){a.value?k():P()}function E(O,U){if(ws(O,"dataTableFilter")||ws(O,"dataTableResizable")||!ud(U))return;const W=u.value.find(N=>N.columnKey===U.key)||null,z=JM(U,W);S(z)}const R=new Map;function D(O){R.set(O.key,T(O.key))}function I(O,U){const W=R.get(O.key);if(W===void 0)return;const z=W+U,N=YM(z,O.minWidth,O.maxWidth);h(z,N,O,T),f(O,N)}return{cellElsRef:w,componentId:g,mergedSortState:u,mergedClsPrefix:e,scrollX:t,fixedColumnLeftMap:n,fixedColumnRightMap:s,currentPage:i,allRowsChecked:a,someRowsChecked:d,rows:r,cols:o,mergedTheme:c,checkOptions:p,mergedTableLayout:m,headerCheckboxDisabled:y,headerHeight:l,virtualScrollHeader:v,virtualListRef:M,handleCheckboxUpdateChecked:A,handleColHeaderClick:E,handleTableHeaderScroll:_,handleColumnResizeStart:D,handleColumnResize:I}},render(){const{cellElsRef:e,mergedClsPrefix:t,fixedColumnLeftMap:n,fixedColumnRightMap:s,currentPage:i,allRowsChecked:a,someRowsChecked:d,rows:r,cols:o,mergedTheme:c,checkOptions:p,componentId:u,discrete:g,mergedTableLayout:m,headerCheckboxDisabled:y,mergedSortState:v,virtualScrollHeader:l,handleColHeaderClick:h,handleCheckboxUpdateChecked:f,handleColumnResizeStart:_,handleColumnResize:S}=this,k=(T,A,E)=>T.map(({column:R,colIndex:D,colSpan:I,rowSpan:O,isLast:U})=>{var W,z;const N=Gs(R),{ellipsis:V}=R,q=()=>R.type==="selection"?R.multiple!==!1?B(Oe,null,B(hh,{key:i,privateInsideTable:!0,checked:a,indeterminate:d,disabled:y,onUpdateChecked:f}),p?B(O3,{clsPrefix:t}):null):null:B(Oe,null,B("div",{class:`${t}-data-table-th__title-wrapper`},B("div",{class:`${t}-data-table-th__title`},V===!0||V&&!V.tooltip?B("div",{class:`${t}-data-table-th__ellipsis`},hd(R)):V&&typeof V=="object"?B(ph,Object.assign({},V,{theme:c.peers.Ellipsis,themeOverrides:c.peerOverrides.Ellipsis}),{default:()=>hd(R)}):hd(R)),ud(R)?B(b3,{column:R}):null),lv(R)?B(m3,{column:R,options:R.filterOptions}):null,Q_(R)?B(_3,{onResizeStart:()=>{_(R)},onResize:ie=>{S(R,ie)}}):null),G=N in n,te=N in s,oe=A&&!R.fixed?"div":"th";return B(oe,{ref:ie=>e[N]=ie,key:N,style:[A&&!R.fixed?{position:"absolute",left:Gn(A(D)),top:0,bottom:0}:{left:Gn((W=n[N])===null||W===void 0?void 0:W.start),right:Gn((z=s[N])===null||z===void 0?void 0:z.start)},{width:Gn(R.width),textAlign:R.titleAlign||R.align,height:E}],colspan:I,rowspan:O,"data-col-key":N,class:[`${t}-data-table-th`,(G||te)&&`${t}-data-table-th--fixed-${G?"left":"right"}`,{[`${t}-data-table-th--sorting`]:Z_(R,v),[`${t}-data-table-th--filterable`]:lv(R),[`${t}-data-table-th--sortable`]:ud(R),[`${t}-data-table-th--selection`]:R.type==="selection",[`${t}-data-table-th--last`]:U},R.className],onClick:R.type!=="selection"&&R.type!=="expand"&&!("children"in R)?ie=>{h(ie,R)}:void 0},q())});if(l){const{headerHeight:T}=this;let A=0,E=0;return o.forEach(R=>{R.column.fixed==="left"?A++:R.column.fixed==="right"&&E++}),B(yo,{ref:"virtualListRef",class:`${t}-data-table-base-table-header`,style:{height:Gn(T)},onScroll:this.handleTableHeaderScroll,columns:o,itemSize:T,showScrollbar:!1,items:[{}],itemResizable:!1,visibleItemsTag:F3,visibleItemsProps:{clsPrefix:t,id:u,cols:o,width:ls(this.scrollX)},renderItemWithCols:({startColIndex:R,endColIndex:D,getLeft:I})=>{const O=o.map((W,z)=>({column:W.column,isLast:z===o.length-1,colIndex:W.index,colSpan:1,rowSpan:1})).filter(({column:W},z)=>!!(R<=z&&z<=D||W.fixed)),U=k(O,I,Gn(T));return U.splice(A,0,B("th",{colspan:o.length-A-E,style:{pointerEvents:"none",visibility:"hidden",height:0}})),B("tr",{style:{position:"relative"}},U)}},{default:({renderedItemWithCols:R})=>R})}const P=B("thead",{class:`${t}-data-table-thead`,"data-n-id":u},r.map(T=>B("tr",{class:`${t}-data-table-tr`},k(T,null,void 0))));if(!g)return P;const{handleTableHeaderScroll:M,scrollX:w}=this;return B("div",{class:`${t}-data-table-base-table-header`,onScroll:M},B("table",{class:`${t}-data-table-table`,style:{minWidth:ls(w),tableLayout:m}},B("colgroup",null,o.map(T=>B("col",{key:T.key,style:T.style}))),P))}});function B3(e,t){const n=[];function s(i,a){i.forEach(d=>{d.children&&t.has(d.key)?(n.push({tmNode:d,striped:!1,key:d.key,index:a}),s(d.children,a)):n.push({key:d.key,tmNode:d,striped:!1,index:a})})}return e.forEach(i=>{n.push(i);const{children:a}=i.tmNode;a&&t.has(i.key)&&s(a,i.index)}),n}const H3=$e({props:{clsPrefix:{type:String,required:!0},id:{type:String,required:!0},cols:{type:Array,required:!0},onMouseenter:Function,onMouseleave:Function},render(){const{clsPrefix:e,id:t,cols:n,onMouseenter:s,onMouseleave:i}=this;return B("table",{style:{tableLayout:"fixed"},class:`${e}-data-table-table`,onMouseenter:s,onMouseleave:i},B("colgroup",null,n.map(a=>B("col",{key:a.key,style:a.style}))),B("tbody",{"data-n-id":t,class:`${e}-data-table-tbody`},this.$slots))}}),N3=$e({name:"DataTableBody",props:{onResize:Function,showHeader:Boolean,flexHeight:Boolean,bodyStyle:Object},setup(e){const{slots:t,bodyWidthRef:n,mergedExpandedRowKeysRef:s,mergedClsPrefixRef:i,mergedThemeRef:a,scrollXRef:d,colsRef:r,paginatedDataRef:o,rawPaginatedDataRef:c,fixedColumnLeftMapRef:p,fixedColumnRightMapRef:u,mergedCurrentPageRef:g,rowClassNameRef:m,leftActiveFixedColKeyRef:y,leftActiveFixedChildrenColKeysRef:v,rightActiveFixedColKeyRef:l,rightActiveFixedChildrenColKeysRef:h,renderExpandRef:f,hoverKeyRef:_,summaryRef:S,mergedSortStateRef:k,virtualScrollRef:P,virtualScrollXRef:M,heightForRowRef:w,minRowHeightRef:T,componentId:A,mergedTableLayoutRef:E,childTriggerColIndexRef:R,indentRef:D,rowPropsRef:I,maxHeightRef:O,stripedRef:U,loadingRef:W,onLoadRef:z,loadingKeySetRef:N,expandableRef:V,stickyExpandedRowsRef:q,renderExpandIconRef:G,summaryPlacementRef:te,treeMateRef:oe,scrollbarPropsRef:ie,setHeaderScrollLeft:ye,doUpdateExpandedRowKeys:K,handleTableBodyScroll:J,doCheck:Q,doUncheck:ce,renderCell:Fe}=Ut(Zs),Ee=Ut(o0),Ye=H(null),Ze=H(null),ue=H(null),et=en(()=>o.value.length===0),re=en(()=>e.showHeader||!et.value),we=en(()=>e.showHeader||et.value);let fe="";const De=j(()=>new Set(s.value));function Qe(tt){var mt;return(mt=oe.value.getNode(tt))===null||mt===void 0?void 0:mt.rawNode}function We(tt,mt,se){const de=Qe(tt.key);if(!de){Ir("data-table",`fail to get row data with key ${tt.key}`);return}if(se){const Le=o.value.findIndex(Ae=>Ae.key===fe);if(Le!==-1){const Ae=o.value.findIndex(me=>me.key===tt.key),ct=Math.min(Le,Ae),ve=Math.max(Le,Ae),Be=[];o.value.slice(ct,ve+1).forEach(me=>{me.disabled||Be.push(me.key)}),mt?Q(Be,!1,de):ce(Be,de),fe=tt.key;return}}mt?Q(tt.key,!1,de):ce(tt.key,de),fe=tt.key}function ae(tt){const mt=Qe(tt.key);if(!mt){Ir("data-table",`fail to get row data with key ${tt.key}`);return}Q(tt.key,!0,mt)}function _e(){if(!re.value){const{value:mt}=ue;return mt||null}if(P.value)return x();const{value:tt}=Ye;return tt?tt.containerRef:null}function be(tt,mt){var se;if(N.value.has(tt))return;const{value:de}=s,Le=de.indexOf(tt),Ae=Array.from(de);~Le?(Ae.splice(Le,1),K(Ae)):mt&&!mt.isLeaf&&!mt.shallowLoaded?(N.value.add(tt),(se=z.value)===null||se===void 0||se.call(z,mt.rawNode).then(()=>{const{value:ct}=s,ve=Array.from(ct);~ve.indexOf(tt)||ve.push(tt),K(ve)}).finally(()=>{N.value.delete(tt)})):(Ae.push(tt),K(Ae))}function Me(){_.value=null}function x(){const{value:tt}=Ze;return(tt==null?void 0:tt.listElRef)||null}function Re(){const{value:tt}=Ze;return(tt==null?void 0:tt.itemsElRef)||null}function Ge(tt){var mt;J(tt),(mt=Ye.value)===null||mt===void 0||mt.sync()}function Ve(tt){var mt;const{onResize:se}=e;se&&se(tt),(mt=Ye.value)===null||mt===void 0||mt.sync()}const kt={getScrollContainer:_e,scrollTo(tt,mt){var se,de;P.value?(se=Ze.value)===null||se===void 0||se.scrollTo(tt,mt):(de=Ye.value)===null||de===void 0||de.scrollTo(tt,mt)}},Je=ze([({props:tt})=>{const mt=de=>de===null?null:ze(`[data-n-id="${tt.componentId}"] [data-col-key="${de}"]::after`,{boxShadow:"var(--n-box-shadow-after)"}),se=de=>de===null?null:ze(`[data-n-id="${tt.componentId}"] [data-col-key="${de}"]::before`,{boxShadow:"var(--n-box-shadow-before)"});return ze([mt(tt.leftActiveFixedColKey),se(tt.rightActiveFixedColKey),tt.leftActiveFixedChildrenColKeys.map(de=>mt(de)),tt.rightActiveFixedChildrenColKeys.map(de=>se(de))])}]);let wt=!1;return zs(()=>{const{value:tt}=y,{value:mt}=v,{value:se}=l,{value:de}=h;if(!wt&&tt===null&&se===null)return;const Le={leftActiveFixedColKey:tt,leftActiveFixedChildrenColKeys:mt,rightActiveFixedColKey:se,rightActiveFixedChildrenColKeys:de,componentId:A};Je.mount({id:`n-${A}`,force:!0,props:Le,anchorMetaName:a0,parent:Ee==null?void 0:Ee.styleMountTarget}),wt=!0}),sc(()=>{Je.unmount({id:`n-${A}`,parent:Ee==null?void 0:Ee.styleMountTarget})}),Object.assign({bodyWidth:n,summaryPlacement:te,dataTableSlots:t,componentId:A,scrollbarInstRef:Ye,virtualListRef:Ze,emptyElRef:ue,summary:S,mergedClsPrefix:i,mergedTheme:a,scrollX:d,cols:r,loading:W,bodyShowHeaderOnly:we,shouldDisplaySomeTablePart:re,empty:et,paginatedDataAndInfo:j(()=>{const{value:tt}=U;let mt=!1;return{data:o.value.map(tt?(de,Le)=>(de.isLeaf||(mt=!0),{tmNode:de,key:de.key,striped:Le%2===1,index:Le}):(de,Le)=>(de.isLeaf||(mt=!0),{tmNode:de,key:de.key,striped:!1,index:Le})),hasChildren:mt}}),rawPaginatedData:c,fixedColumnLeftMap:p,fixedColumnRightMap:u,currentPage:g,rowClassName:m,renderExpand:f,mergedExpandedRowKeySet:De,hoverKey:_,mergedSortState:k,virtualScroll:P,virtualScrollX:M,heightForRow:w,minRowHeight:T,mergedTableLayout:E,childTriggerColIndex:R,indent:D,rowProps:I,maxHeight:O,loadingKeySet:N,expandable:V,stickyExpandedRows:q,renderExpandIcon:G,scrollbarProps:ie,setHeaderScrollLeft:ye,handleVirtualListScroll:Ge,handleVirtualListResize:Ve,handleMouseleaveTable:Me,virtualListContainer:x,virtualListContent:Re,handleTableBodyScroll:J,handleCheckboxUpdateChecked:We,handleRadioUpdateChecked:ae,handleUpdateExpanded:be,renderCell:Fe},kt)},render(){const{mergedTheme:e,scrollX:t,mergedClsPrefix:n,virtualScroll:s,maxHeight:i,mergedTableLayout:a,flexHeight:d,loadingKeySet:r,onResize:o,setHeaderScrollLeft:c}=this,p=t!==void 0||i!==void 0||d,u=!p&&a==="auto",g=t!==void 0||u,m={minWidth:ls(t)||"100%"};t&&(m.width="100%");const y=B(Es,Object.assign({},this.scrollbarProps,{ref:"scrollbarInstRef",scrollable:p||u,class:`${n}-data-table-base-table-body`,style:this.empty?void 0:this.bodyStyle,theme:e.peers.Scrollbar,themeOverrides:e.peerOverrides.Scrollbar,contentStyle:m,container:s?this.virtualListContainer:void 0,content:s?this.virtualListContent:void 0,horizontalRailStyle:{zIndex:3},verticalRailStyle:{zIndex:3},xScrollable:g,onScroll:s?void 0:this.handleTableBodyScroll,internalOnUpdateScrollLeft:c,onResize:o}),{default:()=>{const v={},l={},{cols:h,paginatedDataAndInfo:f,mergedTheme:_,fixedColumnLeftMap:S,fixedColumnRightMap:k,currentPage:P,rowClassName:M,mergedSortState:w,mergedExpandedRowKeySet:T,stickyExpandedRows:A,componentId:E,childTriggerColIndex:R,expandable:D,rowProps:I,handleMouseleaveTable:O,renderExpand:U,summary:W,handleCheckboxUpdateChecked:z,handleRadioUpdateChecked:N,handleUpdateExpanded:V,heightForRow:q,minRowHeight:G,virtualScrollX:te}=this,{length:oe}=h;let ie;const{data:ye,hasChildren:K}=f,J=K?B3(ye,T):ye;if(W){const fe=W(this.rawPaginatedData);if(Array.isArray(fe)){const De=fe.map((Qe,We)=>({isSummaryRow:!0,key:`__n_summary__${We}`,tmNode:{rawNode:Qe,disabled:!0},index:-1}));ie=this.summaryPlacement==="top"?[...De,...J]:[...J,...De]}else{const De={isSummaryRow:!0,key:"__n_summary__",tmNode:{rawNode:fe,disabled:!0},index:-1};ie=this.summaryPlacement==="top"?[De,...J]:[...J,De]}}else ie=J;const Q=K?{width:Gn(this.indent)}:void 0,ce=[];ie.forEach(fe=>{U&&T.has(fe.key)&&(!D||D(fe.tmNode.rawNode))?ce.push(fe,{isExpandedRow:!0,key:`${fe.key}-expand`,tmNode:fe.tmNode,index:fe.index}):ce.push(fe)});const{length:Fe}=ce,Ee={};ye.forEach(({tmNode:fe},De)=>{Ee[De]=fe.key});const Ye=A?this.bodyWidth:null,Ze=Ye===null?void 0:`${Ye}px`,ue=this.virtualScrollX?"div":"td";let et=0,re=0;te&&h.forEach(fe=>{fe.column.fixed==="left"?et++:fe.column.fixed==="right"&&re++});const we=({rowInfo:fe,displayedRowIndex:De,isVirtual:Qe,isVirtualX:We,startColIndex:ae,endColIndex:_e,getLeft:be})=>{const{index:Me}=fe;if("isExpandedRow"in fe){const{tmNode:{key:Ae,rawNode:ct}}=fe;return B("tr",{class:`${n}-data-table-tr ${n}-data-table-tr--expanded`,key:`${Ae}__expand`},B("td",{class:[`${n}-data-table-td`,`${n}-data-table-td--last-col`,De+1===Fe&&`${n}-data-table-td--last-row`],colspan:oe},A?B("div",{class:`${n}-data-table-expand`,style:{width:Ze}},U(ct,Me)):U(ct,Me)))}const x="isSummaryRow"in fe,Re=!x&&fe.striped,{tmNode:Ge,key:Ve}=fe,{rawNode:kt}=Ge,Je=T.has(Ve),wt=I?I(kt,Me):void 0,tt=typeof M=="string"?M:XM(kt,Me,M),mt=We?h.filter((Ae,ct)=>!!(ae<=ct&&ct<=_e||Ae.column.fixed)):h,se=We?Gn((q==null?void 0:q(kt,Me))||G):void 0,de=mt.map(Ae=>{var ct,ve,Be,me,rt;const At=Ae.index;if(De in v){const Zt=v[De],on=Zt.indexOf(At);if(~on)return Zt.splice(on,1),null}const{column:St}=Ae,xe=Gs(Ae),{rowSpan:je,colSpan:ft}=St,Tt=x?((ct=fe.tmNode.rawNode[xe])===null||ct===void 0?void 0:ct.colSpan)||1:ft?ft(kt,Me):1,qt=x?((ve=fe.tmNode.rawNode[xe])===null||ve===void 0?void 0:ve.rowSpan)||1:je?je(kt,Me):1,zt=At+Tt===oe,Yt=De+qt===Fe,Qt=qt>1;if(Qt&&(l[De]={[At]:[]}),Tt>1||Qt)for(let Zt=De;Zt{V(Ve,fe.tmNode)}})]:null,St.type==="selection"?x?null:St.multiple===!1?B(c3,{key:P,rowKey:Ve,disabled:fe.tmNode.disabled,onUpdateChecked:()=>{N(fe.tmNode)}}):B(e3,{key:P,rowKey:Ve,disabled:fe.tmNode.disabled,onUpdateChecked:(Zt,on)=>{z(fe.tmNode,Zt,on.shiftKey)}}):St.type==="expand"?x?null:!St.expandable||!((rt=St.expandable)===null||rt===void 0)&&rt.call(St,kt)?B(dv,{clsPrefix:n,rowData:kt,expanded:Je,renderExpandIcon:this.renderExpandIcon,onClick:()=>{V(Ve,null)}}):null:B(f3,{clsPrefix:n,index:Me,row:kt,column:St,isSummary:x,mergedTheme:_,renderCell:this.renderCell}))});return We&&et&&re&&de.splice(et,0,B("td",{colspan:h.length-et-re,style:{pointerEvents:"none",visibility:"hidden",height:0}})),B("tr",Object.assign({},wt,{onMouseenter:Ae=>{var ct;this.hoverKey=Ve,(ct=wt==null?void 0:wt.onMouseenter)===null||ct===void 0||ct.call(wt,Ae)},key:Ve,class:[`${n}-data-table-tr`,x&&`${n}-data-table-tr--summary`,Re&&`${n}-data-table-tr--striped`,Je&&`${n}-data-table-tr--expanded`,tt,wt==null?void 0:wt.class],style:[wt==null?void 0:wt.style,We&&{height:se}]}),de)};return s?B(yo,{ref:"virtualListRef",items:ce,itemSize:this.minRowHeight,visibleItemsTag:H3,visibleItemsProps:{clsPrefix:n,id:E,cols:h,onMouseleave:O},showScrollbar:!1,onResize:this.handleVirtualListResize,onScroll:this.handleVirtualListScroll,itemsStyle:m,itemResizable:!te,columns:h,renderItemWithCols:te?({itemIndex:fe,item:De,startColIndex:Qe,endColIndex:We,getLeft:ae})=>we({displayedRowIndex:fe,isVirtual:!0,isVirtualX:!0,rowInfo:De,startColIndex:Qe,endColIndex:We,getLeft:ae}):void 0},{default:({item:fe,index:De,renderedItemWithCols:Qe})=>Qe||we({rowInfo:fe,displayedRowIndex:De,isVirtual:!0,isVirtualX:!1,startColIndex:0,endColIndex:0,getLeft(We){return 0}})}):B("table",{class:`${n}-data-table-table`,onMouseleave:O,style:{tableLayout:this.mergedTableLayout}},B("colgroup",null,h.map(fe=>B("col",{key:fe.key,style:fe.style}))),this.showHeader?B(dy,{discrete:!1}):null,this.empty?null:B("tbody",{"data-n-id":E,class:`${n}-data-table-tbody`},ce.map((fe,De)=>we({rowInfo:fe,displayedRowIndex:De,isVirtual:!1,isVirtualX:!1,startColIndex:-1,endColIndex:-1,getLeft(Qe){return-1}}))))}});if(this.empty){const v=()=>B("div",{class:[`${n}-data-table-empty`,this.loading&&`${n}-data-table-empty--hide`],style:this.bodyStyle,ref:"emptyElRef"},Jt(this.dataTableSlots.empty,()=>[B(C_,{theme:this.mergedTheme.peers.Empty,themeOverrides:this.mergedTheme.peerOverrides.Empty})]));return this.shouldDisplaySomeTablePart?B(Oe,null,y,v()):B(Dd,{onResize:this.onResize},{default:v})}return y}}),z3=$e({name:"MainTable",setup(){const{mergedClsPrefixRef:e,rightFixedColumnsRef:t,leftFixedColumnsRef:n,bodyWidthRef:s,maxHeightRef:i,minHeightRef:a,flexHeightRef:d,virtualScrollHeaderRef:r,syncScrollState:o}=Ut(Zs),c=H(null),p=H(null),u=H(null),g=H(!(n.value.length||t.value.length)),m=j(()=>({maxHeight:ls(i.value),minHeight:ls(a.value)}));function y(f){s.value=f.contentRect.width,o(),g.value||(g.value=!0)}function v(){var f;const{value:_}=c;return _?r.value?((f=_.virtualListRef)===null||f===void 0?void 0:f.listElRef)||null:_.$el:null}function l(){const{value:f}=p;return f?f.getScrollContainer():null}const h={getBodyElement:l,getHeaderElement:v,scrollTo(f,_){var S;(S=p.value)===null||S===void 0||S.scrollTo(f,_)}};return zs(()=>{const{value:f}=u;if(!f)return;const _=`${e.value}-data-table-base-table--transition-disabled`;g.value?setTimeout(()=>{f.classList.remove(_)},0):f.classList.add(_)}),Object.assign({maxHeight:i,mergedClsPrefix:e,selfElRef:u,headerInstRef:c,bodyInstRef:p,bodyStyle:m,flexHeight:d,handleBodyResize:y},h)},render(){const{mergedClsPrefix:e,maxHeight:t,flexHeight:n}=this,s=t===void 0&&!n;return B("div",{class:`${e}-data-table-base-table`,ref:"selfElRef"},s?null:B(dy,{ref:"headerInstRef"}),B(N3,{ref:"bodyInstRef",bodyStyle:this.bodyStyle,showHeader:s,flexHeight:n,onResize:this.handleBodyResize}))}}),hv=V3(),U3=ze([Ce("data-table",` + width: 100%; + font-size: var(--n-font-size); + display: flex; + flex-direction: column; + position: relative; + --n-merged-th-color: var(--n-th-color); + --n-merged-td-color: var(--n-td-color); + --n-merged-border-color: var(--n-border-color); + --n-merged-th-color-sorting: var(--n-th-color-sorting); + --n-merged-td-color-hover: var(--n-td-color-hover); + --n-merged-td-color-sorting: var(--n-td-color-sorting); + --n-merged-td-color-striped: var(--n-td-color-striped); + `,[Ce("data-table-wrapper",` + flex-grow: 1; + display: flex; + flex-direction: column; + `),Ue("flex-height",[ze(">",[Ce("data-table-wrapper",[ze(">",[Ce("data-table-base-table",` + display: flex; + flex-direction: column; + flex-grow: 1; + `,[ze(">",[Ce("data-table-base-table-body","flex-basis: 0;",[ze("&:last-child","flex-grow: 1;")])])])])])])]),ze(">",[Ce("data-table-loading-wrapper",` + color: var(--n-loading-color); + font-size: var(--n-loading-size); + position: absolute; + left: 50%; + top: 50%; + transform: translateX(-50%) translateY(-50%); + transition: color .3s var(--n-bezier); + display: flex; + align-items: center; + justify-content: center; + `,[Mo({originalTransform:"translateX(-50%) translateY(-50%)"})])]),Ce("data-table-expand-placeholder",` + margin-right: 8px; + display: inline-block; + width: 16px; + height: 1px; + `),Ce("data-table-indent",` + display: inline-block; + height: 1px; + `),Ce("data-table-expand-trigger",` + display: inline-flex; + margin-right: 8px; + cursor: pointer; + font-size: 16px; + vertical-align: -0.2em; + position: relative; + width: 16px; + height: 16px; + color: var(--n-td-text-color); + transition: color .3s var(--n-bezier); + `,[Ue("expanded",[Ce("icon","transform: rotate(90deg);",[Qr({originalTransform:"rotate(90deg)"})]),Ce("base-icon","transform: rotate(90deg);",[Qr({originalTransform:"rotate(90deg)"})])]),Ce("base-loading",` + color: var(--n-loading-color); + transition: color .3s var(--n-bezier); + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `,[Qr()]),Ce("icon",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `,[Qr()]),Ce("base-icon",` + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + `,[Qr()])]),Ce("data-table-thead",` + transition: background-color .3s var(--n-bezier); + background-color: var(--n-merged-th-color); + `),Ce("data-table-tr",` + position: relative; + box-sizing: border-box; + background-clip: padding-box; + transition: background-color .3s var(--n-bezier); + `,[Ce("data-table-expand",` + position: sticky; + left: 0; + overflow: hidden; + margin: calc(var(--n-th-padding) * -1); + padding: var(--n-th-padding); + box-sizing: border-box; + `),Ue("striped","background-color: var(--n-merged-td-color-striped);",[Ce("data-table-td","background-color: var(--n-merged-td-color-striped);")]),Cn("summary",[ze("&:hover","background-color: var(--n-merged-td-color-hover);",[ze(">",[Ce("data-table-td","background-color: var(--n-merged-td-color-hover);")])])])]),Ce("data-table-th",` + padding: var(--n-th-padding); + position: relative; + text-align: start; + box-sizing: border-box; + background-color: var(--n-merged-th-color); + border-color: var(--n-merged-border-color); + border-bottom: 1px solid var(--n-merged-border-color); + color: var(--n-th-text-color); + transition: + border-color .3s var(--n-bezier), + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + font-weight: var(--n-th-font-weight); + `,[Ue("filterable",` + padding-right: 36px; + `,[Ue("sortable",` + padding-right: calc(var(--n-th-padding) + 36px); + `)]),hv,Ue("selection",` + padding: 0; + text-align: center; + line-height: 0; + z-index: 3; + `),qe("title-wrapper",` + display: flex; + align-items: center; + flex-wrap: nowrap; + max-width: 100%; + `,[qe("title",` + flex: 1; + min-width: 0; + `)]),qe("ellipsis",` + display: inline-block; + vertical-align: bottom; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + max-width: 100%; + `),Ue("hover",` + background-color: var(--n-merged-th-color-hover); + `),Ue("sorting",` + background-color: var(--n-merged-th-color-sorting); + `),Ue("sortable",` + cursor: pointer; + `,[qe("ellipsis",` + max-width: calc(100% - 18px); + `),ze("&:hover",` + background-color: var(--n-merged-th-color-hover); + `)]),Ce("data-table-sorter",` + height: var(--n-sorter-size); + width: var(--n-sorter-size); + margin-left: 4px; + position: relative; + display: inline-flex; + align-items: center; + justify-content: center; + vertical-align: -0.2em; + color: var(--n-th-icon-color); + transition: color .3s var(--n-bezier); + `,[Ce("base-icon","transition: transform .3s var(--n-bezier)"),Ue("desc",[Ce("base-icon",` + transform: rotate(0deg); + `)]),Ue("asc",[Ce("base-icon",` + transform: rotate(-180deg); + `)]),Ue("asc, desc",` + color: var(--n-th-icon-color-active); + `)]),Ce("data-table-resize-button",` + width: var(--n-resizable-container-size); + position: absolute; + top: 0; + right: calc(var(--n-resizable-container-size) / 2); + bottom: 0; + cursor: col-resize; + user-select: none; + `,[ze("&::after",` + width: var(--n-resizable-size); + height: 50%; + position: absolute; + top: 50%; + left: calc(var(--n-resizable-container-size) / 2); + bottom: 0; + background-color: var(--n-merged-border-color); + transform: translateY(-50%); + transition: background-color .3s var(--n-bezier); + z-index: 1; + content: ''; + `),Ue("active",[ze("&::after",` + background-color: var(--n-th-icon-color-active); + `)]),ze("&:hover::after",` + background-color: var(--n-th-icon-color-active); + `)]),Ce("data-table-filter",` + position: absolute; + z-index: auto; + right: 0; + width: 36px; + top: 0; + bottom: 0; + cursor: pointer; + display: flex; + justify-content: center; + align-items: center; + transition: + background-color .3s var(--n-bezier), + color .3s var(--n-bezier); + font-size: var(--n-filter-size); + color: var(--n-th-icon-color); + `,[ze("&:hover",` + background-color: var(--n-th-button-color-hover); + `),Ue("show",` + background-color: var(--n-th-button-color-hover); + `),Ue("active",` + background-color: var(--n-th-button-color-hover); + color: var(--n-th-icon-color-active); + `)])]),Ce("data-table-td",` + padding: var(--n-td-padding); + text-align: start; + box-sizing: border-box; + border: none; + background-color: var(--n-merged-td-color); + color: var(--n-td-text-color); + border-bottom: 1px solid var(--n-merged-border-color); + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier), + border-color .3s var(--n-bezier), + color .3s var(--n-bezier); + `,[Ue("expand",[Ce("data-table-expand-trigger",` + margin-right: 0; + `)]),Ue("last-row",` + border-bottom: 0 solid var(--n-merged-border-color); + `,[ze("&::after",` + bottom: 0 !important; + `),ze("&::before",` + bottom: 0 !important; + `)]),Ue("summary",` + background-color: var(--n-merged-th-color); + `),Ue("hover",` + background-color: var(--n-merged-td-color-hover); + `),Ue("sorting",` + background-color: var(--n-merged-td-color-sorting); + `),qe("ellipsis",` + display: inline-block; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + max-width: 100%; + vertical-align: bottom; + max-width: calc(100% - var(--indent-offset, -1.5) * 16px - 24px); + `),Ue("selection, expand",` + text-align: center; + padding: 0; + line-height: 0; + `),hv]),Ce("data-table-empty",` + box-sizing: border-box; + padding: var(--n-empty-padding); + flex-grow: 1; + flex-shrink: 0; + opacity: 1; + display: flex; + align-items: center; + justify-content: center; + transition: opacity .3s var(--n-bezier); + `,[Ue("hide",` + opacity: 0; + `)]),qe("pagination",` + margin: var(--n-pagination-margin); + display: flex; + justify-content: flex-end; + `),Ce("data-table-wrapper",` + position: relative; + opacity: 1; + transition: opacity .3s var(--n-bezier), border-color .3s var(--n-bezier); + border-top-left-radius: var(--n-border-radius); + border-top-right-radius: var(--n-border-radius); + line-height: var(--n-line-height); + `),Ue("loading",[Ce("data-table-wrapper",` + opacity: var(--n-opacity-loading); + pointer-events: none; + `)]),Ue("single-column",[Ce("data-table-td",` + border-bottom: 0 solid var(--n-merged-border-color); + `,[ze("&::after, &::before",` + bottom: 0 !important; + `)])]),Cn("single-line",[Ce("data-table-th",` + border-right: 1px solid var(--n-merged-border-color); + `,[Ue("last",` + border-right: 0 solid var(--n-merged-border-color); + `)]),Ce("data-table-td",` + border-right: 1px solid var(--n-merged-border-color); + `,[Ue("last-col",` + border-right: 0 solid var(--n-merged-border-color); + `)])]),Ue("bordered",[Ce("data-table-wrapper",` + border: 1px solid var(--n-merged-border-color); + border-bottom-left-radius: var(--n-border-radius); + border-bottom-right-radius: var(--n-border-radius); + overflow: hidden; + `)]),Ce("data-table-base-table",[Ue("transition-disabled",[Ce("data-table-th",[ze("&::after, &::before","transition: none;")]),Ce("data-table-td",[ze("&::after, &::before","transition: none;")])])]),Ue("bottom-bordered",[Ce("data-table-td",[Ue("last-row",` + border-bottom: 1px solid var(--n-merged-border-color); + `)])]),Ce("data-table-table",` + font-variant-numeric: tabular-nums; + width: 100%; + word-break: break-word; + transition: background-color .3s var(--n-bezier); + border-collapse: separate; + border-spacing: 0; + background-color: var(--n-merged-td-color); + `),Ce("data-table-base-table-header",` + border-top-left-radius: calc(var(--n-border-radius) - 1px); + border-top-right-radius: calc(var(--n-border-radius) - 1px); + z-index: 3; + overflow: scroll; + flex-shrink: 0; + transition: border-color .3s var(--n-bezier); + scrollbar-width: none; + `,[ze("&::-webkit-scrollbar, &::-webkit-scrollbar-track-piece, &::-webkit-scrollbar-thumb",` + display: none; + width: 0; + height: 0; + `)]),Ce("data-table-check-extra",` + transition: color .3s var(--n-bezier); + color: var(--n-th-icon-color); + position: absolute; + font-size: 14px; + right: -4px; + top: 50%; + transform: translateY(-50%); + z-index: 1; + `)]),Ce("data-table-filter-menu",[Ce("scrollbar",` + max-height: 240px; + `),qe("group",` + display: flex; + flex-direction: column; + padding: 12px 12px 0 12px; + `,[Ce("checkbox",` + margin-bottom: 12px; + margin-right: 0; + `),Ce("radio",` + margin-bottom: 12px; + margin-right: 0; + `)]),qe("action",` + padding: var(--n-action-padding); + display: flex; + flex-wrap: nowrap; + justify-content: space-evenly; + border-top: 1px solid var(--n-action-divider-color); + `,[Ce("button",[ze("&:not(:last-child)",` + margin: var(--n-action-button-margin); + `),ze("&:last-child",` + margin-right: 0; + `)])]),Ce("divider",` + margin: 0 !important; + `)]),dg(Ce("data-table",` + --n-merged-th-color: var(--n-th-color-modal); + --n-merged-td-color: var(--n-td-color-modal); + --n-merged-border-color: var(--n-border-color-modal); + --n-merged-th-color-hover: var(--n-th-color-hover-modal); + --n-merged-td-color-hover: var(--n-td-color-hover-modal); + --n-merged-th-color-sorting: var(--n-th-color-hover-modal); + --n-merged-td-color-sorting: var(--n-td-color-hover-modal); + --n-merged-td-color-striped: var(--n-td-color-striped-modal); + `)),ug(Ce("data-table",` + --n-merged-th-color: var(--n-th-color-popover); + --n-merged-td-color: var(--n-td-color-popover); + --n-merged-border-color: var(--n-border-color-popover); + --n-merged-th-color-hover: var(--n-th-color-hover-popover); + --n-merged-td-color-hover: var(--n-td-color-hover-popover); + --n-merged-th-color-sorting: var(--n-th-color-hover-popover); + --n-merged-td-color-sorting: var(--n-td-color-hover-popover); + --n-merged-td-color-striped: var(--n-td-color-striped-popover); + `))]);function V3(){return[Ue("fixed-left",` + left: 0; + position: sticky; + z-index: 2; + `,[ze("&::after",` + pointer-events: none; + content: ""; + width: 36px; + display: inline-block; + position: absolute; + top: 0; + bottom: -1px; + transition: box-shadow .2s var(--n-bezier); + right: -36px; + `)]),Ue("fixed-right",` + right: 0; + position: sticky; + z-index: 1; + `,[ze("&::before",` + pointer-events: none; + content: ""; + width: 36px; + display: inline-block; + position: absolute; + top: 0; + bottom: -1px; + transition: box-shadow .2s var(--n-bezier); + left: -36px; + `)])]}function K3(e,t){const{paginatedDataRef:n,treeMateRef:s,selectionColumnRef:i}=t,a=H(e.defaultCheckedRowKeys),d=j(()=>{var k;const{checkedRowKeys:P}=e,M=P===void 0?a.value:P;return((k=i.value)===null||k===void 0?void 0:k.multiple)===!1?{checkedKeys:M.slice(0,1),indeterminateKeys:[]}:s.value.getCheckedKeys(M,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded})}),r=j(()=>d.value.checkedKeys),o=j(()=>d.value.indeterminateKeys),c=j(()=>new Set(r.value)),p=j(()=>new Set(o.value)),u=j(()=>{const{value:k}=c;return n.value.reduce((P,M)=>{const{key:w,disabled:T}=M;return P+(!T&&k.has(w)?1:0)},0)}),g=j(()=>n.value.filter(k=>k.disabled).length),m=j(()=>{const{length:k}=n.value,{value:P}=p;return u.value>0&&u.valueP.has(M.key))}),y=j(()=>{const{length:k}=n.value;return u.value!==0&&u.value===k-g.value}),v=j(()=>n.value.length===0);function l(k,P,M){const{"onUpdate:checkedRowKeys":w,onUpdateCheckedRowKeys:T,onCheckedRowKeysChange:A}=e,E=[],{value:{getNode:R}}=s;k.forEach(D=>{var I;const O=(I=R(D))===null||I===void 0?void 0:I.rawNode;E.push(O)}),w&&Xe(w,k,E,{row:P,action:M}),T&&Xe(T,k,E,{row:P,action:M}),A&&Xe(A,k,E,{row:P,action:M}),a.value=k}function h(k,P=!1,M){if(!e.loading){if(P){l(Array.isArray(k)?k.slice(0,1):[k],M,"check");return}l(s.value.check(k,r.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,M,"check")}}function f(k,P){e.loading||l(s.value.uncheck(k,r.value,{cascade:e.cascade,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,P,"uncheck")}function _(k=!1){const{value:P}=i;if(!P||e.loading)return;const M=[];(k?s.value.treeNodes:n.value).forEach(w=>{w.disabled||M.push(w.key)}),l(s.value.check(M,r.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"checkAll")}function S(k=!1){const{value:P}=i;if(!P||e.loading)return;const M=[];(k?s.value.treeNodes:n.value).forEach(w=>{w.disabled||M.push(w.key)}),l(s.value.uncheck(M,r.value,{cascade:!0,allowNotLoaded:e.allowCheckingNotLoaded}).checkedKeys,void 0,"uncheckAll")}return{mergedCheckedRowKeySetRef:c,mergedCheckedRowKeysRef:r,mergedInderminateRowKeySetRef:p,someRowsCheckedRef:m,allRowsCheckedRef:y,headerCheckboxDisabledRef:v,doUpdateCheckedRowKeys:l,doCheckAll:_,doUncheckAll:S,doCheck:h,doUncheck:f}}function W3(e,t){const n=en(()=>{for(const c of e.columns)if(c.type==="expand")return c.renderExpand}),s=en(()=>{let c;for(const p of e.columns)if(p.type==="expand"){c=p.expandable;break}return c}),i=H(e.defaultExpandAll?n!=null&&n.value?(()=>{const c=[];return t.value.treeNodes.forEach(p=>{var u;!((u=s.value)===null||u===void 0)&&u.call(s,p.rawNode)&&c.push(p.key)}),c})():t.value.getNonLeafKeys():e.defaultExpandedRowKeys),a=dt(e,"expandedRowKeys"),d=dt(e,"stickyExpandedRows"),r=ns(a,i);function o(c){const{onUpdateExpandedRowKeys:p,"onUpdate:expandedRowKeys":u}=e;p&&Xe(p,c),u&&Xe(u,c),i.value=c}return{stickyExpandedRowsRef:d,mergedExpandedRowKeysRef:r,renderExpandRef:n,expandableRef:s,doUpdateExpandedRowKeys:o}}function j3(e,t){const n=[],s=[],i=[],a=new WeakMap;let d=-1,r=0,o=!1;function c(g,m){m>d&&(n[m]=[],d=m),g.forEach((y,v)=>{if("children"in y)c(y.children,m+1);else{const l="key"in y?y.key:void 0;s.push({key:Gs(y),style:GM(y,l!==void 0?ls(t(l)):void 0),column:y,index:v,width:y.width===void 0?128:Number(y.width)}),r+=1,o||(o=!!y.ellipsis),i.push(y)}})}c(e,0);let p=0;function u(g,m){let y=0;g.forEach(v=>{var l;if("children"in v){const h=p,f={column:v,colIndex:p,colSpan:0,rowSpan:1,isLast:!1};u(v.children,m+1),v.children.forEach(_=>{var S,k;f.colSpan+=(k=(S=a.get(_))===null||S===void 0?void 0:S.colSpan)!==null&&k!==void 0?k:0}),h+f.colSpan===r&&(f.isLast=!0),a.set(v,f),n[m].push(f)}else{if(p1&&(y=p+h);const f=p+h===r,_={column:v,colSpan:h,colIndex:p,rowSpan:d-m+1,isLast:f};a.set(v,_),n[m].push(_),p+=1}})}return u(e,0),{hasEllipsis:o,rows:n,cols:s,dataRelatedCols:i}}function q3(e,t){const n=j(()=>j3(e.columns,t));return{rowsRef:j(()=>n.value.rows),colsRef:j(()=>n.value.cols),hasEllipsisRef:j(()=>n.value.hasEllipsis),dataRelatedColsRef:j(()=>n.value.dataRelatedCols)}}function Y3(){const e=H({});function t(i){return e.value[i]}function n(i,a){Q_(i)&&"key"in i&&(e.value[i.key]=a)}function s(){e.value={}}return{getResizableWidth:t,doUpdateResizableWidth:n,clearResizableWidth:s}}function G3(e,{mainTableInstRef:t,mergedCurrentPageRef:n,bodyWidthRef:s}){let i=0;const a=H(),d=H(null),r=H([]),o=H(null),c=H([]),p=j(()=>ls(e.scrollX)),u=j(()=>e.columns.filter(T=>T.fixed==="left")),g=j(()=>e.columns.filter(T=>T.fixed==="right")),m=j(()=>{const T={};let A=0;function E(R){R.forEach(D=>{const I={start:A,end:0};T[Gs(D)]=I,"children"in D?(E(D.children),I.end=A):(A+=ov(D)||0,I.end=A)})}return E(u.value),T}),y=j(()=>{const T={};let A=0;function E(R){for(let D=R.length-1;D>=0;--D){const I=R[D],O={start:A,end:0};T[Gs(I)]=O,"children"in I?(E(I.children),O.end=A):(A+=ov(I)||0,O.end=A)}}return E(g.value),T});function v(){var T,A;const{value:E}=u;let R=0;const{value:D}=m;let I=null;for(let O=0;O(((T=D[U])===null||T===void 0?void 0:T.start)||0)-R)I=U,R=((A=D[U])===null||A===void 0?void 0:A.end)||0;else break}d.value=I}function l(){r.value=[];let T=e.columns.find(A=>Gs(A)===d.value);for(;T&&"children"in T;){const A=T.children.length;if(A===0)break;const E=T.children[A-1];r.value.push(Gs(E)),T=E}}function h(){var T,A;const{value:E}=g,R=Number(e.scrollX),{value:D}=s;if(D===null)return;let I=0,O=null;const{value:U}=y;for(let W=E.length-1;W>=0;--W){const z=Gs(E[W]);if(Math.round(i+(((T=U[z])===null||T===void 0?void 0:T.start)||0)+D-I)Gs(A)===o.value);for(;T&&"children"in T&&T.children.length;){const A=T.children[0];c.value.push(Gs(A)),T=A}}function _(){const T=t.value?t.value.getHeaderElement():null,A=t.value?t.value.getBodyElement():null;return{header:T,body:A}}function S(){const{body:T}=_();T&&(T.scrollTop=0)}function k(){a.value!=="body"?Hl(M):a.value=void 0}function P(T){var A;(A=e.onScroll)===null||A===void 0||A.call(e,T),a.value!=="head"?Hl(M):a.value=void 0}function M(){const{header:T,body:A}=_();if(!A)return;const{value:E}=s;if(E!==null){if(e.maxHeight||e.flexHeight){if(!T)return;const R=i-T.scrollLeft;a.value=R!==0?"head":"body",a.value==="head"?(i=T.scrollLeft,A.scrollLeft=i):(i=A.scrollLeft,T.scrollLeft=i)}else i=A.scrollLeft;v(),l(),h(),f()}}function w(T){const{header:A}=_();A&&(A.scrollLeft=T,M())}return yt(n,()=>{S()}),{styleScrollXRef:p,fixedColumnLeftMapRef:m,fixedColumnRightMapRef:y,leftFixedColumnsRef:u,rightFixedColumnsRef:g,leftActiveFixedColKeyRef:d,leftActiveFixedChildrenColKeysRef:r,rightActiveFixedColKeyRef:o,rightActiveFixedChildrenColKeysRef:c,syncScrollState:M,handleTableBodyScroll:P,handleTableHeaderScroll:k,setHeaderScrollLeft:w}}function nl(e){return typeof e=="object"&&typeof e.multiple=="number"?e.multiple:!1}function X3(e,t){return t&&(e===void 0||e==="default"||typeof e=="object"&&e.compare==="default")?J3(t):typeof e=="function"?e:e&&typeof e=="object"&&e.compare&&e.compare!=="default"?e.compare:!1}function J3(e){return(t,n)=>{const s=t[e],i=n[e];return s==null?i==null?0:-1:i==null?1:typeof s=="number"&&typeof i=="number"?s-i:typeof s=="string"&&typeof i=="string"?s.localeCompare(i):0}}function Q3(e,{dataRelatedColsRef:t,filteredDataRef:n}){const s=[];t.value.forEach(m=>{var y;m.sorter!==void 0&&g(s,{columnKey:m.key,sorter:m.sorter,order:(y=m.defaultSortOrder)!==null&&y!==void 0?y:!1})});const i=H(s),a=j(()=>{const m=t.value.filter(l=>l.type!=="selection"&&l.sorter!==void 0&&(l.sortOrder==="ascend"||l.sortOrder==="descend"||l.sortOrder===!1)),y=m.filter(l=>l.sortOrder!==!1);if(y.length)return y.map(l=>({columnKey:l.key,order:l.sortOrder,sorter:l.sorter}));if(m.length)return[];const{value:v}=i;return Array.isArray(v)?v:v?[v]:[]}),d=j(()=>{const m=a.value.slice().sort((y,v)=>{const l=nl(y.sorter)||0;return(nl(v.sorter)||0)-l});return m.length?n.value.slice().sort((v,l)=>{let h=0;return m.some(f=>{const{columnKey:_,sorter:S,order:k}=f,P=X3(S,_);return P&&k&&(h=P(v.rawNode,l.rawNode),h!==0)?(h=h*qM(k),!0):!1}),h}):n.value});function r(m){let y=a.value.slice();return m&&nl(m.sorter)!==!1?(y=y.filter(v=>nl(v.sorter)!==!1),g(y,m),y):m||null}function o(m){const y=r(m);c(y)}function c(m){const{"onUpdate:sorter":y,onUpdateSorter:v,onSorterChange:l}=e;y&&Xe(y,m),v&&Xe(v,m),l&&Xe(l,m),i.value=m}function p(m,y="ascend"){if(!m)u();else{const v=t.value.find(h=>h.type!=="selection"&&h.type!=="expand"&&h.key===m);if(!(v!=null&&v.sorter))return;const l=v.sorter;o({columnKey:m,sorter:l,order:y})}}function u(){c(null)}function g(m,y){const v=m.findIndex(l=>(y==null?void 0:y.columnKey)&&l.columnKey===y.columnKey);v!==void 0&&v>=0?m[v]=y:m.push(y)}return{clearSorter:u,sort:p,sortedDataRef:d,mergedSortStateRef:a,deriveNextSorter:o}}function Z3(e,{dataRelatedColsRef:t}){const n=j(()=>{const q=G=>{for(let te=0;te{const{childrenKey:q}=e;return vc(e.data,{ignoreEmptyChildren:!0,getKey:e.rowKey,getChildren:G=>G[q],getDisabled:G=>{var te,oe;return!!(!((oe=(te=n.value)===null||te===void 0?void 0:te.disabled)===null||oe===void 0)&&oe.call(te,G))}})}),i=en(()=>{const{columns:q}=e,{length:G}=q;let te=null;for(let oe=0;oe{const q=t.value.filter(oe=>oe.filterOptionValues!==void 0||oe.filterOptionValue!==void 0),G={};return q.forEach(oe=>{var ie;oe.type==="selection"||oe.type==="expand"||(oe.filterOptionValues===void 0?G[oe.key]=(ie=oe.filterOptionValue)!==null&&ie!==void 0?ie:null:G[oe.key]=oe.filterOptionValues)}),Object.assign(av(a.value),G)}),p=j(()=>{const q=c.value,{columns:G}=e;function te(ye){return(K,J)=>!!~String(J[ye]).indexOf(String(K))}const{value:{treeNodes:oe}}=s,ie=[];return G.forEach(ye=>{ye.type==="selection"||ye.type==="expand"||"children"in ye||ie.push([ye.key,ye])}),oe?oe.filter(ye=>{const{rawNode:K}=ye;for(const[J,Q]of ie){let ce=q[J];if(ce==null||(Array.isArray(ce)||(ce=[ce]),!ce.length))continue;const Fe=Q.filter==="default"?te(J):Q.filter;if(Q&&typeof Fe=="function")if(Q.filterMode==="and"){if(ce.some(Ee=>!Fe(Ee,K)))return!1}else{if(ce.some(Ee=>Fe(Ee,K)))continue;return!1}}return!0}):[]}),{sortedDataRef:u,deriveNextSorter:g,mergedSortStateRef:m,sort:y,clearSorter:v}=Q3(e,{dataRelatedColsRef:t,filteredDataRef:p});t.value.forEach(q=>{var G;if(q.filter){const te=q.defaultFilterOptionValues;q.filterMultiple?a.value[q.key]=te||[]:te!==void 0?a.value[q.key]=te===null?[]:te:a.value[q.key]=(G=q.defaultFilterOptionValue)!==null&&G!==void 0?G:null}});const l=j(()=>{const{pagination:q}=e;if(q!==!1)return q.page}),h=j(()=>{const{pagination:q}=e;if(q!==!1)return q.pageSize}),f=ns(l,r),_=ns(h,o),S=en(()=>{const q=f.value;return e.remote?q:Math.max(1,Math.min(Math.ceil(p.value.length/_.value),q))}),k=j(()=>{const{pagination:q}=e;if(q){const{pageCount:G}=q;if(G!==void 0)return G}}),P=j(()=>{if(e.remote)return s.value.treeNodes;if(!e.pagination)return u.value;const q=_.value,G=(S.value-1)*q;return u.value.slice(G,G+q)}),M=j(()=>P.value.map(q=>q.rawNode));function w(q){const{pagination:G}=e;if(G){const{onChange:te,"onUpdate:page":oe,onUpdatePage:ie}=G;te&&Xe(te,q),ie&&Xe(ie,q),oe&&Xe(oe,q),R(q)}}function T(q){const{pagination:G}=e;if(G){const{onPageSizeChange:te,"onUpdate:pageSize":oe,onUpdatePageSize:ie}=G;te&&Xe(te,q),ie&&Xe(ie,q),oe&&Xe(oe,q),D(q)}}const A=j(()=>{if(e.remote){const{pagination:q}=e;if(q){const{itemCount:G}=q;if(G!==void 0)return G}return}return p.value.length}),E=j(()=>Object.assign(Object.assign({},e.pagination),{onChange:void 0,onUpdatePage:void 0,onUpdatePageSize:void 0,onPageSizeChange:void 0,"onUpdate:page":w,"onUpdate:pageSize":T,page:S.value,pageSize:_.value,pageCount:A.value===void 0?k.value:void 0,itemCount:A.value}));function R(q){const{"onUpdate:page":G,onPageChange:te,onUpdatePage:oe}=e;oe&&Xe(oe,q),G&&Xe(G,q),te&&Xe(te,q),r.value=q}function D(q){const{"onUpdate:pageSize":G,onPageSizeChange:te,onUpdatePageSize:oe}=e;te&&Xe(te,q),oe&&Xe(oe,q),G&&Xe(G,q),o.value=q}function I(q,G){const{onUpdateFilters:te,"onUpdate:filters":oe,onFiltersChange:ie}=e;te&&Xe(te,q,G),oe&&Xe(oe,q,G),ie&&Xe(ie,q,G),a.value=q}function O(q,G,te,oe){var ie;(ie=e.onUnstableColumnResize)===null||ie===void 0||ie.call(e,q,G,te,oe)}function U(q){R(q)}function W(){z()}function z(){N({})}function N(q){V(q)}function V(q){q?q&&(a.value=av(q)):a.value={}}return{treeMateRef:s,mergedCurrentPageRef:S,mergedPaginationRef:E,paginatedDataRef:P,rawPaginatedDataRef:M,mergedFilterStateRef:c,mergedSortStateRef:m,hoverKeyRef:H(null),selectionColumnRef:n,childTriggerColIndexRef:i,doUpdateFilters:I,deriveNextSorter:g,doUpdatePageSize:D,doUpdatePage:R,onUnstableColumnResize:O,filter:V,filters:N,clearFilter:W,clearFilters:z,clearSorter:v,page:U,sort:y}}const uy=$e({name:"DataTable",alias:["AdvancedTable"],props:WM,setup(e,{slots:t}){const{mergedBorderedRef:n,mergedClsPrefixRef:s,inlineThemeDisabled:i,mergedRtlRef:a}=mn(e),d=ui("DataTable",a,s),r=j(()=>{const{bottomBordered:se}=e;return n.value?!1:se!==void 0?se:!0}),o=Ht("DataTable","-data-table",U3,c0,e,s),c=H(null),p=H(null),{getResizableWidth:u,clearResizableWidth:g,doUpdateResizableWidth:m}=Y3(),{rowsRef:y,colsRef:v,dataRelatedColsRef:l,hasEllipsisRef:h}=q3(e,u),{treeMateRef:f,mergedCurrentPageRef:_,paginatedDataRef:S,rawPaginatedDataRef:k,selectionColumnRef:P,hoverKeyRef:M,mergedPaginationRef:w,mergedFilterStateRef:T,mergedSortStateRef:A,childTriggerColIndexRef:E,doUpdatePage:R,doUpdateFilters:D,onUnstableColumnResize:I,deriveNextSorter:O,filter:U,filters:W,clearFilter:z,clearFilters:N,clearSorter:V,page:q,sort:G}=Z3(e,{dataRelatedColsRef:l}),te=se=>{const{fileName:de="data.csv",keepOriginalData:Le=!1}=se||{},Ae=Le?e.data:k.value,ct=ZM(e.columns,Ae,e.getCsvCell,e.getCsvHeader),ve=new Blob([ct],{type:"text/csv;charset=utf-8"}),Be=URL.createObjectURL(ve);FP(Be,de.endsWith(".csv")?de:`${de}.csv`),URL.revokeObjectURL(Be)},{doCheckAll:oe,doUncheckAll:ie,doCheck:ye,doUncheck:K,headerCheckboxDisabledRef:J,someRowsCheckedRef:Q,allRowsCheckedRef:ce,mergedCheckedRowKeySetRef:Fe,mergedInderminateRowKeySetRef:Ee}=K3(e,{selectionColumnRef:P,treeMateRef:f,paginatedDataRef:S}),{stickyExpandedRowsRef:Ye,mergedExpandedRowKeysRef:Ze,renderExpandRef:ue,expandableRef:et,doUpdateExpandedRowKeys:re}=W3(e,f),{handleTableBodyScroll:we,handleTableHeaderScroll:fe,syncScrollState:De,setHeaderScrollLeft:Qe,leftActiveFixedColKeyRef:We,leftActiveFixedChildrenColKeysRef:ae,rightActiveFixedColKeyRef:_e,rightActiveFixedChildrenColKeysRef:be,leftFixedColumnsRef:Me,rightFixedColumnsRef:x,fixedColumnLeftMapRef:Re,fixedColumnRightMapRef:Ge}=G3(e,{bodyWidthRef:c,mainTableInstRef:p,mergedCurrentPageRef:_}),{localeRef:Ve}=Qs("DataTable"),kt=j(()=>e.virtualScroll||e.flexHeight||e.maxHeight!==void 0||h.value?"fixed":e.tableLayout);kn(Zs,{props:e,treeMateRef:f,renderExpandIconRef:dt(e,"renderExpandIcon"),loadingKeySetRef:H(new Set),slots:t,indentRef:dt(e,"indent"),childTriggerColIndexRef:E,bodyWidthRef:c,componentId:Pu(),hoverKeyRef:M,mergedClsPrefixRef:s,mergedThemeRef:o,scrollXRef:j(()=>e.scrollX),rowsRef:y,colsRef:v,paginatedDataRef:S,leftActiveFixedColKeyRef:We,leftActiveFixedChildrenColKeysRef:ae,rightActiveFixedColKeyRef:_e,rightActiveFixedChildrenColKeysRef:be,leftFixedColumnsRef:Me,rightFixedColumnsRef:x,fixedColumnLeftMapRef:Re,fixedColumnRightMapRef:Ge,mergedCurrentPageRef:_,someRowsCheckedRef:Q,allRowsCheckedRef:ce,mergedSortStateRef:A,mergedFilterStateRef:T,loadingRef:dt(e,"loading"),rowClassNameRef:dt(e,"rowClassName"),mergedCheckedRowKeySetRef:Fe,mergedExpandedRowKeysRef:Ze,mergedInderminateRowKeySetRef:Ee,localeRef:Ve,expandableRef:et,stickyExpandedRowsRef:Ye,rowKeyRef:dt(e,"rowKey"),renderExpandRef:ue,summaryRef:dt(e,"summary"),virtualScrollRef:dt(e,"virtualScroll"),virtualScrollXRef:dt(e,"virtualScrollX"),heightForRowRef:dt(e,"heightForRow"),minRowHeightRef:dt(e,"minRowHeight"),virtualScrollHeaderRef:dt(e,"virtualScrollHeader"),headerHeightRef:dt(e,"headerHeight"),rowPropsRef:dt(e,"rowProps"),stripedRef:dt(e,"striped"),checkOptionsRef:j(()=>{const{value:se}=P;return se==null?void 0:se.options}),rawPaginatedDataRef:k,filterMenuCssVarsRef:j(()=>{const{self:{actionDividerColor:se,actionPadding:de,actionButtonMargin:Le}}=o.value;return{"--n-action-padding":de,"--n-action-button-margin":Le,"--n-action-divider-color":se}}),onLoadRef:dt(e,"onLoad"),mergedTableLayoutRef:kt,maxHeightRef:dt(e,"maxHeight"),minHeightRef:dt(e,"minHeight"),flexHeightRef:dt(e,"flexHeight"),headerCheckboxDisabledRef:J,paginationBehaviorOnFilterRef:dt(e,"paginationBehaviorOnFilter"),summaryPlacementRef:dt(e,"summaryPlacement"),filterIconPopoverPropsRef:dt(e,"filterIconPopoverProps"),scrollbarPropsRef:dt(e,"scrollbarProps"),syncScrollState:De,doUpdatePage:R,doUpdateFilters:D,getResizableWidth:u,onUnstableColumnResize:I,clearResizableWidth:g,doUpdateResizableWidth:m,deriveNextSorter:O,doCheck:ye,doUncheck:K,doCheckAll:oe,doUncheckAll:ie,doUpdateExpandedRowKeys:re,handleTableHeaderScroll:fe,handleTableBodyScroll:we,setHeaderScrollLeft:Qe,renderCell:dt(e,"renderCell")});const Je={filter:U,filters:W,clearFilters:N,clearSorter:V,page:q,sort:G,clearFilter:z,downloadCsv:te,scrollTo:(se,de)=>{var Le;(Le=p.value)===null||Le===void 0||Le.scrollTo(se,de)}},wt=j(()=>{const{size:se}=e,{common:{cubicBezierEaseInOut:de},self:{borderColor:Le,tdColorHover:Ae,tdColorSorting:ct,tdColorSortingModal:ve,tdColorSortingPopover:Be,thColorSorting:me,thColorSortingModal:rt,thColorSortingPopover:At,thColor:St,thColorHover:xe,tdColor:je,tdTextColor:ft,thTextColor:Tt,thFontWeight:qt,thButtonColorHover:zt,thIconColor:Yt,thIconColorActive:Qt,filterSize:xn,borderRadius:$n,lineHeight:Xt,tdColorModal:Gt,thColorModal:Rn,borderColorModal:Zt,thColorHoverModal:on,tdColorHoverModal:Ot,borderColorPopover:Hn,thColorPopover:Tn,tdColorPopover:bn,tdColorHoverPopover:fn,thColorHoverPopover:ss,paginationMargin:Nn,emptyPadding:ke,boxShadowAfter:nt,boxShadowBefore:gt,sorterSize:It,resizableContainerSize:pn,resizableSize:Nt,loadingColor:Pn,loadingSize:is,opacityLoading:On,tdColorStriped:us,tdColorStripedModal:Vs,tdColorStripedPopover:Ks,[Mt("fontSize",se)]:fi,[Mt("thPadding",se)]:Ss,[Mt("tdPadding",se)]:ei}}=o.value;return{"--n-font-size":fi,"--n-th-padding":Ss,"--n-td-padding":ei,"--n-bezier":de,"--n-border-radius":$n,"--n-line-height":Xt,"--n-border-color":Le,"--n-border-color-modal":Zt,"--n-border-color-popover":Hn,"--n-th-color":St,"--n-th-color-hover":xe,"--n-th-color-modal":Rn,"--n-th-color-hover-modal":on,"--n-th-color-popover":Tn,"--n-th-color-hover-popover":ss,"--n-td-color":je,"--n-td-color-hover":Ae,"--n-td-color-modal":Gt,"--n-td-color-hover-modal":Ot,"--n-td-color-popover":bn,"--n-td-color-hover-popover":fn,"--n-th-text-color":Tt,"--n-td-text-color":ft,"--n-th-font-weight":qt,"--n-th-button-color-hover":zt,"--n-th-icon-color":Yt,"--n-th-icon-color-active":Qt,"--n-filter-size":xn,"--n-pagination-margin":Nn,"--n-empty-padding":ke,"--n-box-shadow-before":gt,"--n-box-shadow-after":nt,"--n-sorter-size":It,"--n-resizable-container-size":pn,"--n-resizable-size":Nt,"--n-loading-size":is,"--n-loading-color":Pn,"--n-opacity-loading":On,"--n-td-color-striped":us,"--n-td-color-striped-modal":Vs,"--n-td-color-striped-popover":Ks,"n-td-color-sorting":ct,"n-td-color-sorting-modal":ve,"n-td-color-sorting-popover":Be,"n-th-color-sorting":me,"n-th-color-sorting-modal":rt,"n-th-color-sorting-popover":At}}),tt=i?Bn("data-table",j(()=>e.size[0]),wt,e):void 0,mt=j(()=>{if(!e.pagination)return!1;if(e.paginateSinglePage)return!0;const se=w.value,{pageCount:de}=se;return de!==void 0?de>1:se.itemCount&&se.pageSize&&se.itemCount>se.pageSize});return Object.assign({mainTableInstRef:p,mergedClsPrefix:s,rtlEnabled:d,mergedTheme:o,paginatedData:S,mergedBordered:n,mergedBottomBordered:r,mergedPagination:w,mergedShowPagination:mt,cssVars:i?void 0:wt,themeClass:tt==null?void 0:tt.themeClass,onRender:tt==null?void 0:tt.onRender},Je)},render(){const{mergedClsPrefix:e,themeClass:t,onRender:n,$slots:s,spinProps:i}=this;return n==null||n(),B("div",{class:[`${e}-data-table`,this.rtlEnabled&&`${e}-data-table--rtl`,t,{[`${e}-data-table--bordered`]:this.mergedBordered,[`${e}-data-table--bottom-bordered`]:this.mergedBottomBordered,[`${e}-data-table--single-line`]:this.singleLine,[`${e}-data-table--single-column`]:this.singleColumn,[`${e}-data-table--loading`]:this.loading,[`${e}-data-table--flex-height`]:this.flexHeight}],style:this.cssVars},B("div",{class:`${e}-data-table-wrapper`},B(z3,{ref:"mainTableInstRef"})),this.mergedShowPagination?B("div",{class:`${e}-data-table__pagination`},B(KM,Object.assign({theme:this.mergedTheme.peers.Pagination,themeOverrides:this.mergedTheme.peerOverrides.Pagination,disabled:this.loading},this.mergedPagination))):null,B(ys,{name:"fade-in-scale-up-transition"},{default:()=>this.loading?B("div",{class:`${e}-data-table-loading-wrapper`},Jt(s.loading,()=>[B(nc,Object.assign({clsPrefix:e,strokeWidth:20},i))])):null}))}}),mc=ds("n-date-picker"),Fr=40,eA="HH:mm:ss",hy={active:Boolean,dateFormat:String,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,required:!0},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},timerPickerFormat:{type:String,value:eA},value:{type:[Array,Number],default:null},shortcuts:Object,defaultTime:[Number,String,Array],inputReadonly:Boolean,onClear:Function,onConfirm:Function,onClose:Function,onTabOut:Function,onKeydown:Function,actions:Array,onUpdateValue:{type:Function,required:!0},themeClass:String,onRender:Function,panel:Boolean,onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function};function fy(e){const{dateLocaleRef:t,timePickerSizeRef:n,timePickerPropsRef:s,localeRef:i,mergedClsPrefixRef:a,mergedThemeRef:d}=Ut(mc),r=j(()=>({locale:t.value.locale})),o=H(null),c=Zu();function p(){const{onClear:R}=e;R&&R()}function u(){const{onConfirm:R,value:D}=e;R&&R(D)}function g(R,D){const{onUpdateValue:I}=e;I(R,D)}function m(R=!1){const{onClose:D}=e;D&&D(R)}function y(){const{onTabOut:R}=e;R&&R()}function v(){g(null,!0),m(!0),p()}function l(){y()}function h(){(e.active||e.panel)&&cn(()=>{const{value:R}=o;if(!R)return;const D=R.querySelectorAll("[data-n-date]");D.forEach(I=>{I.classList.add("transition-disabled")}),R.offsetWidth,D.forEach(I=>{I.classList.remove("transition-disabled")})})}function f(R){R.key==="Tab"&&R.target===o.value&&c.shift&&(R.preventDefault(),y())}function _(R){const{value:D}=o;c.tab&&R.target===D&&(D!=null&&D.contains(R.relatedTarget))&&y()}let S=null,k=!1;function P(){S=e.value,k=!0}function M(){k=!1}function w(){k&&(g(S,!1),k=!1)}function T(R){return typeof R=="function"?R():R}const A=H(!1);function E(){A.value=!A.value}return{mergedTheme:d,mergedClsPrefix:a,dateFnsOptions:r,timePickerSize:n,timePickerProps:s,selfRef:o,locale:i,doConfirm:u,doClose:m,doUpdateValue:g,doTabOut:y,handleClearClick:v,handleFocusDetectorFocus:l,disableTransitionOneTick:h,handlePanelKeyDown:f,handlePanelFocus:_,cachePendingValue:P,clearPendingValue:M,restorePendingValue:w,getShortcutValue:T,handleShortcutMouseleave:w,showMonthYearPanel:A,handleOpenQuickSelectMonthPanel:E}}const gh=Object.assign(Object.assign({},hy),{defaultCalendarStartTime:Number,actions:{type:Array,default:()=>["now","clear","confirm"]}});function mh(e,t){var n;const s=fy(e),{isValueInvalidRef:i,isDateDisabledRef:a,isDateInvalidRef:d,isTimeInvalidRef:r,isDateTimeInvalidRef:o,isHourDisabledRef:c,isMinuteDisabledRef:p,isSecondDisabledRef:u,localeRef:g,firstDayOfWeekRef:m,datePickerSlots:y,yearFormatRef:v,monthFormatRef:l,quarterFormatRef:h,yearRangeRef:f}=Ut(mc),_={isValueInvalid:i,isDateDisabled:a,isDateInvalid:d,isTimeInvalid:r,isDateTimeInvalid:o,isHourDisabled:c,isMinuteDisabled:p,isSecondDisabled:u},S=j(()=>e.dateFormat||g.value.dateFormat),k=j(()=>e.calendarDayFormat||g.value.dayFormat),P=H(e.value===null||Array.isArray(e.value)?"":ln(e.value,S.value)),M=H(e.value===null||Array.isArray(e.value)?(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Date.now():e.value),w=H(null),T=H(null),A=H(null),E=H(Date.now()),R=j(()=>{var x;return au(M.value,e.value,E.value,(x=m.value)!==null&&x!==void 0?x:g.value.firstDayOfWeek,!1,t==="week")}),D=j(()=>{const{value:x}=e;return lu(M.value,Array.isArray(x)?null:x,E.value,{monthFormat:l.value})}),I=j(()=>{const{value:x}=e;return du(Array.isArray(x)?null:x,E.value,{yearFormat:v.value},f)}),O=j(()=>{const{value:x}=e;return cu(M.value,Array.isArray(x)?null:x,E.value,{quarterFormat:h.value})}),U=j(()=>R.value.slice(0,7).map(x=>{const{ts:Re}=x;return ln(Re,k.value,s.dateFnsOptions.value)})),W=j(()=>ln(M.value,e.calendarHeaderMonthFormat||g.value.monthFormat,s.dateFnsOptions.value)),z=j(()=>ln(M.value,e.calendarHeaderYearFormat||g.value.yearFormat,s.dateFnsOptions.value)),N=j(()=>{var x;return(x=e.calendarHeaderMonthBeforeYear)!==null&&x!==void 0?x:g.value.monthBeforeYear});yt(M,(x,Re)=>{(t==="date"||t==="datetime")&&(Ra(x,Re)||s.disableTransitionOneTick())}),yt(j(()=>e.value),x=>{x!==null&&!Array.isArray(x)?(P.value=ln(x,S.value,s.dateFnsOptions.value),M.value=x):P.value=""});function V(x){var Re;if(t==="datetime")return ht(dh(x));if(t==="month")return ht(Ri(x));if(t==="year")return ht(xa(x));if(t==="quarter")return ht(ma(x));if(t==="week"){const Ge=(((Re=m.value)!==null&&Re!==void 0?Re:g.value.firstDayOfWeek)+1)%7;return ht($i(x,{weekStartsOn:Ge}))}return ht(wo(x))}function q(x,Re){const{isDateDisabled:{value:Ge}}=_;return Ge?Ge(x,Re):!1}function G(x){const Re=_s(x,S.value,new Date,s.dateFnsOptions.value);if(Hs(Re)){if(e.value===null)s.doUpdateValue(ht(V(Date.now())),e.panel);else if(!Array.isArray(e.value)){const Ge=es(e.value,{year:Ln(Re),month:yn(Re),date:Fs(Re)});s.doUpdateValue(ht(V(ht(Ge))),e.panel)}}else P.value=x}function te(){const x=_s(P.value,S.value,new Date,s.dateFnsOptions.value);if(Hs(x)){if(e.value===null)s.doUpdateValue(ht(V(Date.now())),!1);else if(!Array.isArray(e.value)){const Re=es(e.value,{year:Ln(x),month:yn(x),date:Fs(x)});s.doUpdateValue(ht(V(ht(Re))),!1)}}else Ee()}function oe(){s.doUpdateValue(null,!0),P.value="",s.doClose(!0),s.handleClearClick()}function ie(){s.doUpdateValue(ht(V(Date.now())),!0);const x=Date.now();M.value=x,s.doClose(!0),e.panel&&(t==="month"||t==="quarter"||t==="year")&&(s.disableTransitionOneTick(),be(x))}const ye=H(null);function K(x){x.type==="date"&&t==="week"&&(ye.value=V(ht(x.ts)))}function J(x){return x.type==="date"&&t==="week"?V(ht(x.ts))===ye.value:!1}function Q(x){if(q(x.ts,x.type==="date"?{type:"date",year:x.dateObject.year,month:x.dateObject.month,date:x.dateObject.date}:x.type==="month"?{type:"month",year:x.dateObject.year,month:x.dateObject.month}:x.type==="year"?{type:"year",year:x.dateObject.year}:{type:"quarter",year:x.dateObject.year,quarter:x.dateObject.quarter}))return;let Re;if(e.value!==null&&!Array.isArray(e.value)?Re=e.value:Re=Date.now(),t==="datetime"&&e.defaultTime!==null&&!Array.isArray(e.defaultTime)){const Ge=_l(e.defaultTime);Ge&&(Re=ht(es(Re,Ge)))}switch(Re=ht(x.type==="quarter"&&x.dateObject.quarter?wM(ou(Re,x.dateObject.year),x.dateObject.quarter):es(Re,x.dateObject)),s.doUpdateValue(V(Re),e.panel||t==="date"||t==="week"||t==="year"),t){case"date":case"week":s.doClose();break;case"year":e.panel&&s.disableTransitionOneTick(),s.doClose();break;case"month":s.disableTransitionOneTick(),be(Re);break;case"quarter":s.disableTransitionOneTick(),be(Re);break}}function ce(x,Re){let Ge;e.value!==null&&!Array.isArray(e.value)?Ge=e.value:Ge=Date.now(),Ge=ht(x.type==="month"?uh(Ge,x.dateObject.month):ou(Ge,x.dateObject.year)),Re(Ge),be(Ge)}function Fe(x){M.value=x}function Ee(x){if(e.value===null||Array.isArray(e.value)){P.value="";return}x===void 0&&(x=e.value),P.value=ln(x,S.value,s.dateFnsOptions.value)}function Ye(){_.isDateInvalid.value||_.isTimeInvalid.value||(s.doConfirm(),Ze())}function Ze(){e.active&&s.doClose()}function ue(){var x;M.value=ht(su(M.value,1)),(x=e.onNextYear)===null||x===void 0||x.call(e)}function et(){var x;M.value=ht(su(M.value,-1)),(x=e.onPrevYear)===null||x===void 0||x.call(e)}function re(){var x;M.value=ht(Zn(M.value,1)),(x=e.onNextMonth)===null||x===void 0||x.call(e)}function we(){var x;M.value=ht(Zn(M.value,-1)),(x=e.onPrevMonth)===null||x===void 0||x.call(e)}function fe(){const{value:x}=w;return(x==null?void 0:x.listElRef)||null}function De(){const{value:x}=w;return(x==null?void 0:x.itemsElRef)||null}function Qe(){var x;(x=T.value)===null||x===void 0||x.sync()}function We(x){x!==null&&s.doUpdateValue(x,e.panel)}function ae(x){s.cachePendingValue();const Re=s.getShortcutValue(x);typeof Re=="number"&&s.doUpdateValue(Re,!1)}function _e(x){const Re=s.getShortcutValue(x);typeof Re=="number"&&(s.doUpdateValue(Re,e.panel),s.clearPendingValue(),Ye())}function be(x){const{value:Re}=e;if(A.value){const Ge=yn(x===void 0?Re===null?Date.now():Re:x);A.value.scrollTo({top:Ge*Fr})}if(w.value){const Ge=Ln(x===void 0?Re===null?Date.now():Re:x)-f.value[0];w.value.scrollTo({top:Ge*Fr})}}const Me={monthScrollbarRef:A,yearScrollbarRef:T,yearVlRef:w};return Object.assign(Object.assign(Object.assign(Object.assign({dateArray:R,monthArray:D,yearArray:I,quarterArray:O,calendarYear:z,calendarMonth:W,weekdays:U,calendarMonthBeforeYear:N,mergedIsDateDisabled:q,nextYear:ue,prevYear:et,nextMonth:re,prevMonth:we,handleNowClick:ie,handleConfirmClick:Ye,handleSingleShortcutMouseenter:ae,handleSingleShortcutClick:_e},_),s),Me),{handleDateClick:Q,handleDateInputBlur:te,handleDateInput:G,handleDateMouseEnter:K,isWeekHovered:J,handleTimePickerChange:We,clearSelectedDateTime:oe,virtualListContainer:fe,virtualListContent:De,handleVirtualListScroll:Qe,timePickerSize:s.timePickerSize,dateInputValue:P,datePickerSlots:y,handleQuickMonthClick:ce,justifyColumnsScrollState:be,calendarValue:M,onUpdateCalendarValue:Fe})}const py=$e({name:"MonthPanel",props:Object.assign(Object.assign({},gh),{type:{type:String,required:!0},useAsQuickJump:Boolean}),setup(e){const t=mh(e,e.type),{dateLocaleRef:n}=Qs("DatePicker"),s=d=>{switch(d.type){case"year":return K_(d.dateObject.year,d.yearFormat,n.value.locale);case"month":return V_(d.dateObject.month,d.monthFormat,n.value.locale);case"quarter":return W_(d.dateObject.quarter,d.quarterFormat,n.value.locale)}},{useAsQuickJump:i}=e,a=(d,r,o)=>{const{mergedIsDateDisabled:c,handleDateClick:p,handleQuickMonthClick:u}=t;return B("div",{"data-n-date":!0,key:r,class:[`${o}-date-panel-month-calendar__picker-col-item`,d.isCurrent&&`${o}-date-panel-month-calendar__picker-col-item--current`,d.selected&&`${o}-date-panel-month-calendar__picker-col-item--selected`,!i&&c(d.ts,d.type==="year"?{type:"year",year:d.dateObject.year}:d.type==="month"?{type:"month",year:d.dateObject.year,month:d.dateObject.month}:d.type==="quarter"?{type:"month",year:d.dateObject.year,month:d.dateObject.quarter}:null)&&`${o}-date-panel-month-calendar__picker-col-item--disabled`],onClick:()=>{i?u(d,g=>{e.onUpdateValue(g,!1)}):p(d)}},s(d))};return Dt(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:a})},render(){const{mergedClsPrefix:e,mergedTheme:t,shortcuts:n,actions:s,renderItem:i,type:a,onRender:d}=this;return d==null||d(),B("div",{ref:"selfRef",tabindex:0,class:[`${e}-date-panel`,`${e}-date-panel--month`,!this.panel&&`${e}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},B("div",{class:`${e}-date-panel-month-calendar`},B(Es,{ref:"yearScrollbarRef",class:`${e}-date-panel-month-calendar__picker-col`,theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar,container:this.virtualListContainer,content:this.virtualListContent,horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>B(yo,{ref:"yearVlRef",items:this.yearArray,itemSize:Fr,showScrollbar:!1,keyField:"ts",onScroll:this.handleVirtualListScroll,paddingBottom:4},{default:({item:r,index:o})=>i(r,o,e)})}),a==="month"||a==="quarter"?B("div",{class:`${e}-date-panel-month-calendar__picker-col`},B(Es,{ref:"monthScrollbarRef",theme:t.peers.Scrollbar,themeOverrides:t.peerOverrides.Scrollbar},{default:()=>[(a==="month"?this.monthArray:this.quarterArray).map((r,o)=>i(r,o,e)),B("div",{class:`${e}-date-panel-${a}-calendar__padding`})]})):null),this.datePickerSlots.footer?B("div",{class:`${e}-date-panel-footer`},{default:this.datePickerSlots.footer}):null,s!=null&&s.length||n?B("div",{class:`${e}-date-panel-actions`},B("div",{class:`${e}-date-panel-actions__prefix`},n&&Object.keys(n).map(r=>{const o=n[r];return Array.isArray(o)?null:B(di,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(o)},onClick:()=>{this.handleSingleShortcutClick(o)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>r})})),B("div",{class:`${e}-date-panel-actions__suffix`},s!=null&&s.includes("clear")?bs(this.$slots.now,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,s!=null&&s.includes("now")?bs(this.$slots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[B(gn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,s!=null&&s.includes("confirm")?bs(this.$slots.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[B(gn,{theme:t.peers.Button,themeOverrides:t.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(hr,{onFocus:this.handleFocusDetectorFocus}))}}),So=$e({props:{mergedClsPrefix:{type:String,required:!0},value:Number,monthBeforeYear:{type:Boolean,required:!0},monthYearSeparator:{type:String,required:!0},calendarMonth:{type:String,required:!0},calendarYear:{type:String,required:!0},onUpdateValue:{type:Function,required:!0}},setup(){const e=H(null),t=H(null),n=H(!1);function s(a){var d;n.value&&!(!((d=e.value)===null||d===void 0)&&d.contains(Ar(a)))&&(n.value=!1)}function i(){n.value=!n.value}return{show:n,triggerRef:e,monthPanelRef:t,handleHeaderClick:i,handleClickOutside:s}},render(){const{handleClickOutside:e,mergedClsPrefix:t}=this;return B("div",{class:`${t}-date-panel-month__month-year`,ref:"triggerRef"},B(Eo,null,{default:()=>[B(Lo,null,{default:()=>B("div",{class:[`${t}-date-panel-month__text`,this.show&&`${t}-date-panel-month__text--active`],onClick:this.handleHeaderClick},this.monthBeforeYear?[this.calendarMonth,this.monthYearSeparator,this.calendarYear]:[this.calendarYear,this.monthYearSeparator,this.calendarMonth])}),B(Do,{show:this.show,teleportDisabled:!0},{default:()=>B(ys,{name:"fade-in-scale-up-transition",appear:!0},{default:()=>this.show?it(B(py,{ref:"monthPanelRef",onUpdateValue:this.onUpdateValue,actions:[],calendarHeaderMonthYearSeparator:this.monthYearSeparator,type:"month",key:"month",useAsQuickJump:!0,value:this.value}),[[$r,e,void 0,{capture:!0}]]):null})})]}))}}),tA=$e({name:"DatePanel",props:Object.assign(Object.assign({},gh),{type:{type:String,required:!0}}),setup(e){return mh(e,e.type)},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,onRender:d,$slots:r,type:o}=this;return d==null||d(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--${o}`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onFocus:this.handlePanelFocus,onKeydown:this.handlePanelKeyDown},B("div",{class:`${s}-date-panel-calendar`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.prevYear},Jt(r["prev-year"],()=>[B(lr,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.prevMonth},Jt(r["prev-month"],()=>[B(ar,null)])),B(So,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:s,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.nextMonth},Jt(r["next-month"],()=>[B(dr,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.nextYear},Jt(r["next-year"],()=>[B(cr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(c=>B("div",{key:c,class:`${s}-date-panel-weekdays__day`},c))),B("div",{class:`${s}-date-panel-dates`},this.dateArray.map((c,p)=>B("div",{"data-n-date":!0,key:p,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--current`]:c.isCurrentDate,[`${s}-date-panel-date--selected`]:c.selected,[`${s}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${s}-date-panel-date--disabled`]:this.mergedIsDateDisabled(c.ts,{type:"date",year:c.dateObject.year,month:c.dateObject.month,date:c.dateObject.date}),[`${s}-date-panel-date--week-hovered`]:this.isWeekHovered(c),[`${s}-date-panel-date--week-selected`]:c.inSelectedWeek}],onClick:()=>{this.handleDateClick(c)},onMouseenter:()=>{this.handleDateMouseEnter(c)}},B("div",{class:`${s}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const p=a[c];return Array.isArray(p)?null:B(di,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(p)},onClick:()=>{this.handleSingleShortcutClick(p)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c})})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?bs(this.$slots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?bs(this.$slots.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null)):null,B(hr,{onFocus:this.handleFocusDetectorFocus}))}}),_h=Object.assign(Object.assign({},hy),{defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,actions:{type:Array,default:()=>["clear","confirm"]}});function yh(e,t){var n,s;const{isDateDisabledRef:i,isStartHourDisabledRef:a,isEndHourDisabledRef:d,isStartMinuteDisabledRef:r,isEndMinuteDisabledRef:o,isStartSecondDisabledRef:c,isEndSecondDisabledRef:p,isStartDateInvalidRef:u,isEndDateInvalidRef:g,isStartTimeInvalidRef:m,isEndTimeInvalidRef:y,isStartValueInvalidRef:v,isEndValueInvalidRef:l,isRangeInvalidRef:h,localeRef:f,rangesRef:_,closeOnSelectRef:S,updateValueOnCloseRef:k,firstDayOfWeekRef:P,datePickerSlots:M,monthFormatRef:w,yearFormatRef:T,quarterFormatRef:A,yearRangeRef:E}=Ut(mc),R={isDateDisabled:i,isStartHourDisabled:a,isEndHourDisabled:d,isStartMinuteDisabled:r,isEndMinuteDisabled:o,isStartSecondDisabled:c,isEndSecondDisabled:p,isStartDateInvalid:u,isEndDateInvalid:g,isStartTimeInvalid:m,isEndTimeInvalid:y,isStartValueInvalid:v,isEndValueInvalid:l,isRangeInvalid:h},D=fy(e),I=H(null),O=H(null),U=H(null),W=H(null),z=H(null),N=H(null),V=H(null),q=H(null),{value:G}=e,te=(n=e.defaultCalendarStartTime)!==null&&n!==void 0?n:Array.isArray(G)&&typeof G[0]=="number"?G[0]:Date.now(),oe=H(te),ie=H((s=e.defaultCalendarEndTime)!==null&&s!==void 0?s:Array.isArray(G)&&typeof G[1]=="number"?G[1]:ht(Zn(te,1)));Je(!0);const ye=H(Date.now()),K=H(!1),J=H(0),Q=j(()=>e.dateFormat||f.value.dateFormat),ce=j(()=>e.calendarDayFormat||f.value.dayFormat),Fe=H(Array.isArray(G)?ln(G[0],Q.value,D.dateFnsOptions.value):""),Ee=H(Array.isArray(G)?ln(G[1],Q.value,D.dateFnsOptions.value):""),Ye=j(()=>K.value?"end":"start"),Ze=j(()=>{var ke;return au(oe.value,e.value,ye.value,(ke=P.value)!==null&&ke!==void 0?ke:f.value.firstDayOfWeek)}),ue=j(()=>{var ke;return au(ie.value,e.value,ye.value,(ke=P.value)!==null&&ke!==void 0?ke:f.value.firstDayOfWeek)}),et=j(()=>Ze.value.slice(0,7).map(ke=>{const{ts:nt}=ke;return ln(nt,ce.value,D.dateFnsOptions.value)})),re=j(()=>ln(oe.value,e.calendarHeaderMonthFormat||f.value.monthFormat,D.dateFnsOptions.value)),we=j(()=>ln(ie.value,e.calendarHeaderMonthFormat||f.value.monthFormat,D.dateFnsOptions.value)),fe=j(()=>ln(oe.value,e.calendarHeaderYearFormat||f.value.yearFormat,D.dateFnsOptions.value)),De=j(()=>ln(ie.value,e.calendarHeaderYearFormat||f.value.yearFormat,D.dateFnsOptions.value)),Qe=j(()=>{const{value:ke}=e;return Array.isArray(ke)?ke[0]:null}),We=j(()=>{const{value:ke}=e;return Array.isArray(ke)?ke[1]:null}),ae=j(()=>{const{shortcuts:ke}=e;return ke||_.value}),_e=j(()=>du(Jr(e.value,"start"),ye.value,{yearFormat:T.value},E)),be=j(()=>du(Jr(e.value,"end"),ye.value,{yearFormat:T.value},E)),Me=j(()=>{const ke=Jr(e.value,"start");return cu(ke??Date.now(),ke,ye.value,{quarterFormat:A.value})}),x=j(()=>{const ke=Jr(e.value,"end");return cu(ke??Date.now(),ke,ye.value,{quarterFormat:A.value})}),Re=j(()=>{const ke=Jr(e.value,"start");return lu(ke??Date.now(),ke,ye.value,{monthFormat:w.value})}),Ge=j(()=>{const ke=Jr(e.value,"end");return lu(ke??Date.now(),ke,ye.value,{monthFormat:w.value})}),Ve=j(()=>{var ke;return(ke=e.calendarHeaderMonthBeforeYear)!==null&&ke!==void 0?ke:f.value.monthBeforeYear});yt(j(()=>e.value),ke=>{if(ke!==null&&Array.isArray(ke)){const[nt,gt]=ke;Fe.value=ln(nt,Q.value,D.dateFnsOptions.value),Ee.value=ln(gt,Q.value,D.dateFnsOptions.value),K.value||rt(ke)}else Fe.value="",Ee.value=""});function kt(ke,nt){(t==="daterange"||t==="datetimerange")&&(Ln(ke)!==Ln(nt)||yn(ke)!==yn(nt))&&D.disableTransitionOneTick()}yt(oe,kt),yt(ie,kt);function Je(ke){const nt=Ri(oe.value),gt=Ri(ie.value);(e.bindCalendarMonths||nt>=gt)&&(ke?ie.value=ht(Zn(nt,1)):oe.value=ht(Zn(gt,-1)))}function wt(){oe.value=ht(Zn(oe.value,12)),Je(!0)}function tt(){oe.value=ht(Zn(oe.value,-12)),Je(!0)}function mt(){oe.value=ht(Zn(oe.value,1)),Je(!0)}function se(){oe.value=ht(Zn(oe.value,-1)),Je(!0)}function de(){ie.value=ht(Zn(ie.value,12)),Je(!1)}function Le(){ie.value=ht(Zn(ie.value,-12)),Je(!1)}function Ae(){ie.value=ht(Zn(ie.value,1)),Je(!1)}function ct(){ie.value=ht(Zn(ie.value,-1)),Je(!1)}function ve(ke){oe.value=ke,Je(!0)}function Be(ke){ie.value=ke,Je(!1)}function me(ke){const nt=i.value;if(!nt)return!1;if(!Array.isArray(e.value)||Ye.value==="start")return nt(ke,"start",null);{const{value:gt}=J;return ke=J.value?qt(J.value,ke.ts,"wipPreview"):qt(ke.ts,J.value,"wipPreview")}}function xe(){h.value||(D.doConfirm(),je())}function je(){K.value=!1,e.active&&D.doClose()}function ft(ke){typeof ke!="number"&&(ke=ht(ke)),e.value===null?D.doUpdateValue([ke,ke],e.panel):Array.isArray(e.value)&&D.doUpdateValue([ke,Math.max(e.value[1],ke)],e.panel)}function Tt(ke){typeof ke!="number"&&(ke=ht(ke)),e.value===null?D.doUpdateValue([ke,ke],e.panel):Array.isArray(e.value)&&D.doUpdateValue([Math.min(e.value[0],ke),ke],e.panel)}function qt(ke,nt,gt){if(typeof ke!="number"&&(ke=ht(ke)),gt!=="shortcutPreview"){let It,pn;if(t==="datetimerange"){const{defaultTime:Nt}=e;Array.isArray(Nt)?(It=_l(Nt[0]),pn=_l(Nt[1])):(It=_l(Nt),pn=It)}It&&(ke=ht(es(ke,It))),pn&&(nt=ht(es(nt,pn)))}D.doUpdateValue([ke,nt],e.panel&>==="done")}function zt(ke){return ht(t==="datetimerange"?dh(ke):t==="monthrange"?Ri(ke):wo(ke))}function Yt(ke){const nt=_s(ke,Q.value,new Date,D.dateFnsOptions.value);if(Hs(nt))if(e.value){if(Array.isArray(e.value)){const gt=es(e.value[0],{year:Ln(nt),month:yn(nt),date:Fs(nt)});ft(zt(ht(gt)))}}else{const gt=es(new Date,{year:Ln(nt),month:yn(nt),date:Fs(nt)});ft(zt(ht(gt)))}else Fe.value=ke}function Qt(ke){const nt=_s(ke,Q.value,new Date,D.dateFnsOptions.value);if(Hs(nt)){if(e.value===null){const gt=es(new Date,{year:Ln(nt),month:yn(nt),date:Fs(nt)});Tt(zt(ht(gt)))}else if(Array.isArray(e.value)){const gt=es(e.value[1],{year:Ln(nt),month:yn(nt),date:Fs(nt)});Tt(zt(ht(gt)))}}else Ee.value=ke}function xn(){const ke=_s(Fe.value,Q.value,new Date,D.dateFnsOptions.value),{value:nt}=e;if(Hs(ke)){if(nt===null){const gt=es(new Date,{year:Ln(ke),month:yn(ke),date:Fs(ke)});ft(zt(ht(gt)))}else if(Array.isArray(nt)){const gt=es(nt[0],{year:Ln(ke),month:yn(ke),date:Fs(ke)});ft(zt(ht(gt)))}}else Xt()}function $n(){const ke=_s(Ee.value,Q.value,new Date,D.dateFnsOptions.value),{value:nt}=e;if(Hs(ke)){if(nt===null){const gt=es(new Date,{year:Ln(ke),month:yn(ke),date:Fs(ke)});Tt(zt(ht(gt)))}else if(Array.isArray(nt)){const gt=es(nt[1],{year:Ln(ke),month:yn(ke),date:Fs(ke)});Tt(zt(ht(gt)))}}else Xt()}function Xt(ke){const{value:nt}=e;if(nt===null||!Array.isArray(nt)){Fe.value="",Ee.value="";return}ke===void 0&&(ke=nt),Fe.value=ln(ke[0],Q.value,D.dateFnsOptions.value),Ee.value=ln(ke[1],Q.value,D.dateFnsOptions.value)}function Gt(ke){ke!==null&&ft(ke)}function Rn(ke){ke!==null&&Tt(ke)}function Zt(ke){D.cachePendingValue();const nt=D.getShortcutValue(ke);Array.isArray(nt)&&qt(nt[0],nt[1],"shortcutPreview")}function on(ke){const nt=D.getShortcutValue(ke);Array.isArray(nt)&&(qt(nt[0],nt[1],"done"),D.clearPendingValue(),xe())}function Ot(ke,nt){const gt=ke===void 0?e.value:ke;if(ke===void 0||nt==="start"){if(V.value){const It=Array.isArray(gt)?yn(gt[0]):yn(Date.now());V.value.scrollTo({debounce:!1,index:It,elSize:Fr})}if(z.value){const It=(Array.isArray(gt)?Ln(gt[0]):Ln(Date.now()))-E.value[0];z.value.scrollTo({index:It,debounce:!1})}}if(ke===void 0||nt==="end"){if(q.value){const It=Array.isArray(gt)?yn(gt[1]):yn(Date.now());q.value.scrollTo({debounce:!1,index:It,elSize:Fr})}if(N.value){const It=(Array.isArray(gt)?Ln(gt[1]):Ln(Date.now()))-E.value[0];N.value.scrollTo({index:It,debounce:!1})}}}function Hn(ke,nt){const{value:gt}=e,It=!Array.isArray(gt),pn=ke.type==="year"&&t!=="yearrange"?It?es(ke.ts,{month:yn(t==="quarterrange"?ma(new Date):new Date)}).valueOf():es(ke.ts,{month:yn(t==="quarterrange"?ma(gt[nt==="start"?0:1]):gt[nt==="start"?0:1])}).valueOf():ke.ts;if(It){const is=zt(pn),On=[is,is];D.doUpdateValue(On,e.panel),Ot(On,"start"),Ot(On,"end"),D.disableTransitionOneTick();return}const Nt=[gt[0],gt[1]];let Pn=!1;switch(nt==="start"?(Nt[0]=zt(pn),Nt[0]>Nt[1]&&(Nt[1]=Nt[0],Pn=!0)):(Nt[1]=zt(pn),Nt[0]>Nt[1]&&(Nt[0]=Nt[1],Pn=!0)),D.doUpdateValue(Nt,e.panel),t){case"monthrange":case"quarterrange":D.disableTransitionOneTick(),Pn?(Ot(Nt,"start"),Ot(Nt,"end")):Ot(Nt,nt);break;case"yearrange":D.disableTransitionOneTick(),Ot(Nt,"start"),Ot(Nt,"end")}}function Tn(){var ke;(ke=U.value)===null||ke===void 0||ke.sync()}function bn(){var ke;(ke=W.value)===null||ke===void 0||ke.sync()}function fn(ke){var nt,gt;return ke==="start"?((nt=z.value)===null||nt===void 0?void 0:nt.listElRef)||null:((gt=N.value)===null||gt===void 0?void 0:gt.listElRef)||null}function ss(ke){var nt,gt;return ke==="start"?((nt=z.value)===null||nt===void 0?void 0:nt.itemsElRef)||null:((gt=N.value)===null||gt===void 0?void 0:gt.itemsElRef)||null}const Nn={startYearVlRef:z,endYearVlRef:N,startMonthScrollbarRef:V,endMonthScrollbarRef:q,startYearScrollbarRef:U,endYearScrollbarRef:W};return Object.assign(Object.assign(Object.assign(Object.assign({startDatesElRef:I,endDatesElRef:O,handleDateClick:At,handleColItemClick:Hn,handleDateMouseEnter:St,handleConfirmClick:xe,startCalendarPrevYear:tt,startCalendarPrevMonth:se,startCalendarNextYear:wt,startCalendarNextMonth:mt,endCalendarPrevYear:Le,endCalendarPrevMonth:ct,endCalendarNextMonth:Ae,endCalendarNextYear:de,mergedIsDateDisabled:me,changeStartEndTime:qt,ranges:_,calendarMonthBeforeYear:Ve,startCalendarMonth:re,startCalendarYear:fe,endCalendarMonth:we,endCalendarYear:De,weekdays:et,startDateArray:Ze,endDateArray:ue,startYearArray:_e,startMonthArray:Re,startQuarterArray:Me,endYearArray:be,endMonthArray:Ge,endQuarterArray:x,isSelecting:K,handleRangeShortcutMouseenter:Zt,handleRangeShortcutClick:on},D),R),Nn),{startDateDisplayString:Fe,endDateInput:Ee,timePickerSize:D.timePickerSize,startTimeValue:Qe,endTimeValue:We,datePickerSlots:M,shortcuts:ae,startCalendarDateTime:oe,endCalendarDateTime:ie,justifyColumnsScrollState:Ot,handleFocusDetectorFocus:D.handleFocusDetectorFocus,handleStartTimePickerChange:Gt,handleEndTimePickerChange:Rn,handleStartDateInput:Yt,handleStartDateInputBlur:xn,handleEndDateInput:Qt,handleEndDateInputBlur:$n,handleStartYearVlScroll:Tn,handleEndYearVlScroll:bn,virtualListContainer:fn,virtualListContent:ss,onUpdateStartCalendarValue:ve,onUpdateEndCalendarValue:Be})}const nA=$e({name:"DateRangePanel",props:_h,setup(e){return yh(e,"daterange")},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,onRender:d,$slots:r}=this;return d==null||d(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--daterange`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{ref:"startDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--start`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},Jt(r["prev-year"],()=>[B(lr,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},Jt(r["prev-month"],()=>[B(ar,null)])),B(So,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:s,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.startCalendarNextMonth},Jt(r["next-month"],()=>[B(dr,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},Jt(r["next-year"],()=>[B(cr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(o=>B("div",{key:o,class:`${s}-date-panel-weekdays__day`},o))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.startDateArray.map((o,c)=>B("div",{"data-n-date":!0,key:c,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!o.inCurrentMonth,[`${s}-date-panel-date--current`]:o.isCurrentDate,[`${s}-date-panel-date--selected`]:o.selected,[`${s}-date-panel-date--covered`]:o.inSpan,[`${s}-date-panel-date--start`]:o.startOfSpan,[`${s}-date-panel-date--end`]:o.endOfSpan,[`${s}-date-panel-date--disabled`]:this.mergedIsDateDisabled(o.ts)}],onClick:()=>{this.handleDateClick(o)},onMouseenter:()=>{this.handleDateMouseEnter(o)}},B("div",{class:`${s}-date-panel-date__trigger`}),o.dateObject.date,o.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)))),B("div",{class:`${s}-date-panel__vertical-divider`}),B("div",{ref:"endDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--end`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},Jt(r["prev-year"],()=>[B(lr,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},Jt(r["prev-month"],()=>[B(ar,null)])),B(So,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:s,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.endCalendarNextMonth},Jt(r["next-month"],()=>[B(dr,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},Jt(r["next-year"],()=>[B(cr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(o=>B("div",{key:o,class:`${s}-date-panel-weekdays__day`},o))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.endDateArray.map((o,c)=>B("div",{"data-n-date":!0,key:c,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!o.inCurrentMonth,[`${s}-date-panel-date--current`]:o.isCurrentDate,[`${s}-date-panel-date--selected`]:o.selected,[`${s}-date-panel-date--covered`]:o.inSpan,[`${s}-date-panel-date--start`]:o.startOfSpan,[`${s}-date-panel-date--end`]:o.endOfSpan,[`${s}-date-panel-date--disabled`]:this.mergedIsDateDisabled(o.ts)}],onClick:()=>{this.handleDateClick(o)},onMouseenter:()=>{this.handleDateMouseEnter(o)}},B("div",{class:`${s}-date-panel-date__trigger`}),o.dateObject.date,o.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(o=>{const c=a[o];return Array.isArray(c)||typeof c=="function"?B(di,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(c)},onClick:()=>{this.handleRangeShortcutClick(c)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>o}):null})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?bs(r.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?bs(r.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(hr,{onFocus:this.handleFocusDetectorFocus}))}});function fv(e,t,n){const s=O_(),i=rA(e,n.timeZone,n.locale??s.locale);return"formatToParts"in i?sA(i,t):iA(i,t)}function sA(e,t){const n=e.formatToParts(t);for(let s=n.length-1;s>=0;--s)if(n[s].type==="timeZoneName")return n[s].value}function iA(e,t){const n=e.format(t).replace(/\u200E/g,""),s=/ [\w-+ ]+$/.exec(n);return s?s[0].substr(1):""}function rA(e,t,n){return new Intl.DateTimeFormat(n?[n.code,"en-US"]:void 0,{timeZone:t,timeZoneName:e})}function oA(e,t){const n=uA(t);return"formatToParts"in n?lA(n,e):cA(n,e)}const aA={year:0,month:1,day:2,hour:3,minute:4,second:5};function lA(e,t){try{const n=e.formatToParts(t),s=[];for(let i=0;i=0?a:1e3+a,s-i}function pA(e,t,n){let i=e.getTime()-t;const a=pu(new Date(i),n);if(t===a)return t;i-=a-t;const d=pu(new Date(i),n);return a===d?a:Math.max(a,d)}function gv(e,t){return-23<=e&&e<=23&&(t==null||0<=t&&t<=59)}const mv={};function vA(e){if(mv[e])return!0;try{return new Intl.DateTimeFormat(void 0,{timeZone:e}),mv[e]=!0,!0}catch{return!1}}const gA=60*1e3,mA={X:function(e,t,n){const s=vd(n.timeZone,e);if(s===0)return"Z";switch(t){case"X":return _v(s);case"XXXX":case"XX":return eo(s);case"XXXXX":case"XXX":default:return eo(s,":")}},x:function(e,t,n){const s=vd(n.timeZone,e);switch(t){case"x":return _v(s);case"xxxx":case"xx":return eo(s);case"xxxxx":case"xxx":default:return eo(s,":")}},O:function(e,t,n){const s=vd(n.timeZone,e);switch(t){case"O":case"OO":case"OOO":return"GMT"+_A(s,":");case"OOOO":default:return"GMT"+eo(s,":")}},z:function(e,t,n){switch(t){case"z":case"zz":case"zzz":return fv("short",e,n);case"zzzz":default:return fv("long",e,n)}}};function vd(e,t){const n=e?bh(e,t,!0)/gA:(t==null?void 0:t.getTimezoneOffset())??0;if(Number.isNaN(n))throw new RangeError("Invalid time zone specified: "+e);return n}function ql(e,t){const n=e<0?"-":"";let s=Math.abs(e).toString();for(;s.length0?"-":"+",s=Math.abs(e),i=ql(Math.floor(s/60),2),a=ql(Math.floor(s%60),2);return n+i+t+a}function _v(e,t){return e%60===0?(e>0?"-":"+")+ql(Math.abs(e)/60,2):eo(e,t)}function _A(e,t=""){const n=e>0?"-":"+",s=Math.abs(e),i=Math.floor(s/60),a=s%60;return a===0?n+String(i):n+String(i)+t+ql(a,2)}function yv(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),+e-+t}const yA=/(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/,gd=36e5,bv=6e4,bA=2,vs={dateTimePattern:/^([0-9W+-]+)(T| )(.*)/,datePattern:/^([0-9W+-]+)(.*)/,YY:/^(\d{2})$/,YYY:[/^([+-]\d{2})$/,/^([+-]\d{3})$/,/^([+-]\d{4})$/],YYYY:/^(\d{4})/,YYYYY:[/^([+-]\d{4})/,/^([+-]\d{5})/,/^([+-]\d{6})/],MM:/^-(\d{2})$/,DDD:/^-?(\d{3})$/,MMDD:/^-?(\d{2})-?(\d{2})$/,Www:/^-?W(\d{2})$/,WwwD:/^-?W(\d{2})-?(\d{1})$/,HH:/^(\d{2}([.,]\d*)?)$/,HHMM:/^(\d{2}):?(\d{2}([.,]\d*)?)$/,HHMMSS:/^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,timeZone:yA};function gy(e,t={}){if(arguments.length<1)throw new TypeError("1 argument required, but only "+arguments.length+" present");if(e===null)return new Date(NaN);const n=t.additionalDigits==null?bA:Number(t.additionalDigits);if(n!==2&&n!==1&&n!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]")return new Date(e.getTime());if(typeof e=="number"||Object.prototype.toString.call(e)==="[object Number]")return new Date(e);if(Object.prototype.toString.call(e)!=="[object String]")return new Date(NaN);const s=wA(e),{year:i,restDateString:a}=SA(s.date,n),d=CA(a,i);if(d===null||isNaN(d.getTime()))return new Date(NaN);if(d){const r=d.getTime();let o=0,c;if(s.time&&(o=kA(s.time),o===null||isNaN(o)))return new Date(NaN);if(s.timeZone||t.timeZone){if(c=bh(s.timeZone||t.timeZone,new Date(r+o)),isNaN(c))return new Date(NaN)}else c=yv(new Date(r+o)),c=yv(new Date(r+o+c));return new Date(r+o+c)}else return new Date(NaN)}function wA(e){const t={};let n=vs.dateTimePattern.exec(e),s;if(n?(t.date=n[1],s=n[3]):(n=vs.datePattern.exec(e),n?(t.date=n[1],s=n[2]):(t.date=null,s=e)),s){const i=vs.timeZone.exec(s);i?(t.time=s.replace(i[1],""),t.timeZone=i[1].trim()):t.time=s}return t}function SA(e,t){if(e){const n=vs.YYY[t],s=vs.YYYYY[t];let i=vs.YYYY.exec(e)||s.exec(e);if(i){const a=i[1];return{year:parseInt(a,10),restDateString:e.slice(a.length)}}if(i=vs.YY.exec(e)||n.exec(e),i){const a=i[1];return{year:parseInt(a,10)*100,restDateString:e.slice(a.length)}}}return{year:null}}function CA(e,t){if(t===null)return null;let n,s,i;if(!e||!e.length)return n=new Date(0),n.setUTCFullYear(t),n;let a=vs.MM.exec(e);if(a)return n=new Date(0),s=parseInt(a[1],10)-1,Sv(t,s)?(n.setUTCFullYear(t,s),n):new Date(NaN);if(a=vs.DDD.exec(e),a){n=new Date(0);const d=parseInt(a[1],10);return TA(t,d)?(n.setUTCFullYear(t,0,d),n):new Date(NaN)}if(a=vs.MMDD.exec(e),a){n=new Date(0),s=parseInt(a[1],10)-1;const d=parseInt(a[2],10);return Sv(t,s,d)?(n.setUTCFullYear(t,s,d),n):new Date(NaN)}if(a=vs.Www.exec(e),a)return i=parseInt(a[1],10)-1,Cv(i)?wv(t,i):new Date(NaN);if(a=vs.WwwD.exec(e),a){i=parseInt(a[1],10)-1;const d=parseInt(a[2],10)-1;return Cv(i,d)?wv(t,i,d):new Date(NaN)}return null}function kA(e){let t,n,s=vs.HH.exec(e);if(s)return t=parseFloat(s[1].replace(",",".")),md(t)?t%24*gd:NaN;if(s=vs.HHMM.exec(e),s)return t=parseInt(s[1],10),n=parseFloat(s[2].replace(",",".")),md(t,n)?t%24*gd+n*bv:NaN;if(s=vs.HHMMSS.exec(e),s){t=parseInt(s[1],10),n=parseInt(s[2],10);const i=parseFloat(s[3].replace(",","."));return md(t,n,i)?t%24*gd+n*bv+i*1e3:NaN}return null}function wv(e,t,n){t=t||0,n=n||0;const s=new Date(0);s.setUTCFullYear(e,0,4);const i=s.getUTCDay()||7,a=t*7+n+1-i;return s.setUTCDate(s.getUTCDate()+a),s}const xA=[31,28,31,30,31,30,31,31,30,31,30,31],RA=[31,29,31,30,31,30,31,31,30,31,30,31];function my(e){return e%400===0||e%4===0&&e%100!==0}function Sv(e,t,n){if(t<0||t>11)return!1;if(n!=null){if(n<1)return!1;const s=my(e);if(s&&n>RA[t]||!s&&n>xA[t])return!1}return!0}function TA(e,t){if(t<1)return!1;const n=my(e);return!(n&&t>366||!n&&t>365)}function Cv(e,t){return!(e<0||e>52||t!=null&&(t<0||t>6))}function md(e,t,n){return!(e<0||e>=25||t!=null&&(t<0||t>=60)||n!=null&&(n<0||n>=60))}const PA=/([xXOz]+)|''|'(''|[^'])+('|$)/g;function EA(e,t,n={}){t=String(t);const s=t.match(PA);if(s){const i=gy(n.originalDate||e,n);t=s.reduce(function(a,d){if(d[0]==="'")return a;const r=a.indexOf(d),o=a[r-1]==="'",c=a.replace(d,"'"+mA[d[0]](i,d,n)+"'");return o?c.substring(0,r-1)+c.substring(r+1):c},t)}return ln(e,t,n)}function LA(e,t,n){e=gy(e,n);const s=bh(t,e,!0),i=new Date(e.getTime()-s),a=new Date(0);return a.setFullYear(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate()),a.setHours(i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds(),i.getUTCMilliseconds()),a}function DA(e,t,n,s){return s={...s,timeZone:t,originalDate:e},EA(LA(e,t,{timeZone:s.timeZone}),n,s)}const _y=ds("n-time-picker"),sl=$e({name:"TimePickerPanelCol",props:{clsPrefix:{type:String,required:!0},data:{type:Array,required:!0},activeValue:{type:[Number,String],default:null},onItemClick:Function},render(){const{activeValue:e,onItemClick:t,clsPrefix:n}=this;return this.data.map(s=>{const{label:i,disabled:a,value:d}=s,r=e===d;return B("div",{key:i,"data-active":r?"":null,class:[`${n}-time-picker-col__item`,r&&`${n}-time-picker-col__item--active`,a&&`${n}-time-picker-col__item--disabled`],onClick:t&&!a?()=>{t(d)}:void 0},i)})}}),Zo={amHours:["00","01","02","03","04","05","06","07","08","09","10","11"],pmHours:["12","01","02","03","04","05","06","07","08","09","10","11"],hours:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23"],minutes:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"],seconds:["00","01","02","03","04","05","06","07","08","09","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","25","26","27","28","29","30","31","32","33","34","35","36","37","38","39","40","41","42","43","44","45","46","47","48","49","50","51","52","53","54","55","56","57","58","59"],period:["AM","PM"]};function _d(e){return`00${e}`.slice(-2)}function ea(e,t,n){return Array.isArray(t)?(n==="am"?t.filter(s=>s<12):n==="pm"?t.filter(s=>s>=12).map(s=>s===12?12:s-12):t).map(s=>_d(s)):typeof t=="number"?n==="am"?e.filter(s=>{const i=Number(s);return i<12&&i%t===0}):n==="pm"?e.filter(s=>{const i=Number(s);return i>=12&&i%t===0}).map(s=>{const i=Number(s);return _d(i===12?12:i-12)}):e.filter(s=>Number(s)%t===0):n==="am"?e.filter(s=>Number(s)<12):n==="pm"?e.map(s=>Number(s)).filter(s=>Number(s)>=12).map(s=>_d(s===12?12:s-12)):e}function il(e,t,n){return n?typeof n=="number"?e%n===0:n.includes(e):!0}function MA(e,t,n){const s=ea(Zo[t],n).map(Number);let i,a;for(let d=0;de){a=r;break}i=r}return i===void 0?(a||mg("time-picker","Please set 'hours' or 'minutes' or 'seconds' props"),a):a===void 0||a-e>e-i?i:a}function AA(e){return Zi(e)<12?"am":"pm"}const IA={actions:{type:Array,default:()=>["now","confirm"]},showHour:{type:Boolean,default:!0},showMinute:{type:Boolean,default:!0},showSecond:{type:Boolean,default:!0},showPeriod:{type:Boolean,default:!0},isHourInvalid:Boolean,isMinuteInvalid:Boolean,isSecondInvalid:Boolean,isAmPmInvalid:Boolean,isValueInvalid:Boolean,hourValue:{type:Number,default:null},minuteValue:{type:Number,default:null},secondValue:{type:Number,default:null},amPmValue:{type:String,default:null},isHourDisabled:Function,isMinuteDisabled:Function,isSecondDisabled:Function,onHourClick:{type:Function,required:!0},onMinuteClick:{type:Function,required:!0},onSecondClick:{type:Function,required:!0},onAmPmClick:{type:Function,required:!0},onNowClick:Function,clearText:String,nowText:String,confirmText:String,transitionDisabled:Boolean,onClearClick:Function,onConfirmClick:Function,onFocusin:Function,onFocusout:Function,onFocusDetectorFocus:Function,onKeydown:Function,hours:[Number,Array],minutes:[Number,Array],seconds:[Number,Array],use12Hours:Boolean},$A=$e({name:"TimePickerPanel",props:IA,setup(e){const{mergedThemeRef:t,mergedClsPrefixRef:n}=Ut(_y),s=j(()=>{const{isHourDisabled:r,hours:o,use12Hours:c,amPmValue:p}=e;if(c){const u=p??AA(Date.now());return ea(Zo.hours,o,u).map(g=>{const m=Number(g),y=u==="pm"&&m!==12?m+12:m;return{label:g,value:y,disabled:r?r(y):!1}})}else return ea(Zo.hours,o).map(u=>({label:u,value:Number(u),disabled:r?r(Number(u)):!1}))}),i=j(()=>{const{isMinuteDisabled:r,minutes:o}=e;return ea(Zo.minutes,o).map(c=>({label:c,value:Number(c),disabled:r?r(Number(c),e.hourValue):!1}))}),a=j(()=>{const{isSecondDisabled:r,seconds:o}=e;return ea(Zo.seconds,o).map(c=>({label:c,value:Number(c),disabled:r?r(Number(c),e.minuteValue,e.hourValue):!1}))}),d=j(()=>{const{isHourDisabled:r}=e;let o=!0,c=!0;for(let p=0;p<12;++p)if(!(r!=null&&r(p))){o=!1;break}for(let p=12;p<24;++p)if(!(r!=null&&r(p))){c=!1;break}return[{label:"AM",value:"am",disabled:o},{label:"PM",value:"pm",disabled:c}]});return{mergedTheme:t,mergedClsPrefix:n,hours:s,minutes:i,seconds:a,amPm:d,hourScrollRef:H(null),minuteScrollRef:H(null),secondScrollRef:H(null),amPmScrollRef:H(null)}},render(){var e,t,n,s;const{mergedClsPrefix:i,mergedTheme:a}=this;return B("div",{tabindex:0,class:`${i}-time-picker-panel`,onFocusin:this.onFocusin,onFocusout:this.onFocusout,onKeydown:this.onKeydown},B("div",{class:`${i}-time-picker-cols`},this.showHour?B("div",{class:[`${i}-time-picker-col`,this.isHourInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},B(Es,{ref:"hourScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(sl,{clsPrefix:i,data:this.hours,activeValue:this.hourValue,onItemClick:this.onHourClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null,this.showMinute?B("div",{class:[`${i}-time-picker-col`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`,this.isMinuteInvalid&&`${i}-time-picker-col--invalid`]},B(Es,{ref:"minuteScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(sl,{clsPrefix:i,data:this.minutes,activeValue:this.minuteValue,onItemClick:this.onMinuteClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null,this.showSecond?B("div",{class:[`${i}-time-picker-col`,this.isSecondInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},B(Es,{ref:"secondScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(sl,{clsPrefix:i,data:this.seconds,activeValue:this.secondValue,onItemClick:this.onSecondClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null,this.use12Hours?B("div",{class:[`${i}-time-picker-col`,this.isAmPmInvalid&&`${i}-time-picker-col--invalid`,this.transitionDisabled&&`${i}-time-picker-col--transition-disabled`]},B(Es,{ref:"amPmScrollRef",theme:a.peers.Scrollbar,themeOverrides:a.peerOverrides.Scrollbar},{default:()=>[B(sl,{clsPrefix:i,data:this.amPm,activeValue:this.amPmValue,onItemClick:this.onAmPmClick}),B("div",{class:`${i}-time-picker-col__padding`})]})):null),!((e=this.actions)===null||e===void 0)&&e.length?B("div",{class:`${i}-time-picker-actions`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.onClearClick},{default:()=>this.clearText}):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?B(gn,{size:"tiny",theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,onClick:this.onNowClick},{default:()=>this.nowText}):null,!((s=this.actions)===null||s===void 0)&&s.includes("confirm")?B(gn,{size:"tiny",type:"primary",class:`${i}-time-picker-actions__confirm`,theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,disabled:this.isValueInvalid,onClick:this.onConfirmClick},{default:()=>this.confirmText}):null):null,B(hr,{onFocus:this.onFocusDetectorFocus}))}}),OA=ze([Ce("time-picker",` + z-index: auto; + position: relative; + `,[Ce("time-picker-icon",` + color: var(--n-icon-color-override); + transition: color .3s var(--n-bezier); + `),Ue("disabled",[Ce("time-picker-icon",` + color: var(--n-icon-color-disabled-override); + `)])]),Ce("time-picker-panel",` + transition: + box-shadow .3s var(--n-bezier), + background-color .3s var(--n-bezier); + outline: none; + font-size: var(--n-item-font-size); + border-radius: var(--n-border-radius); + margin: 4px 0; + min-width: 104px; + overflow: hidden; + background-color: var(--n-panel-color); + box-shadow: var(--n-panel-box-shadow); + `,[Mo(),Ce("time-picker-actions",` + padding: var(--n-panel-action-padding); + align-items: center; + display: flex; + justify-content: space-evenly; + `),Ce("time-picker-cols",` + height: calc(var(--n-item-height) * 6); + display: flex; + position: relative; + transition: border-color .3s var(--n-bezier); + border-bottom: 1px solid var(--n-panel-divider-color); + `),Ce("time-picker-col",` + flex-grow: 1; + min-width: var(--n-item-width); + height: calc(var(--n-item-height) * 6); + flex-direction: column; + transition: box-shadow .3s var(--n-bezier); + `,[Ue("transition-disabled",[qe("item","transition: none;",[ze("&::before","transition: none;")])]),qe("padding",` + height: calc(var(--n-item-height) * 5); + `),ze("&:first-child","min-width: calc(var(--n-item-width) + 4px);",[qe("item",[ze("&::before","left: 4px;")])]),qe("item",` + cursor: pointer; + height: var(--n-item-height); + display: flex; + align-items: center; + justify-content: center; + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier), + opacity .3s var(--n-bezier), + text-decoration-color .3s var(--n-bezier); + background: #0000; + text-decoration-color: #0000; + color: var(--n-item-text-color); + z-index: 0; + box-sizing: border-box; + padding-top: 4px; + position: relative; + `,[ze("&::before",` + content: ""; + transition: background-color .3s var(--n-bezier); + z-index: -1; + position: absolute; + left: 0; + right: 4px; + top: 4px; + bottom: 0; + border-radius: var(--n-item-border-radius); + `),Cn("disabled",[ze("&:hover::before",` + background-color: var(--n-item-color-hover); + `)]),Ue("active",` + color: var(--n-item-text-color-active); + `,[ze("&::before",` + background-color: var(--n-item-color-hover); + `)]),Ue("disabled",` + opacity: var(--n-item-opacity-disabled); + cursor: not-allowed; + `)]),Ue("invalid",[qe("item",[Ue("active",` + text-decoration: line-through; + text-decoration-color: var(--n-item-text-color-active); + `)])])])])]);function yd(e,t){return e===void 0?!0:Array.isArray(e)?e.every(n=>n>=0&&n<=t):e>=0&&e<=t}const FA=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,bordered:{type:Boolean,default:void 0},actions:Array,defaultValue:{type:Number,default:null},defaultFormattedValue:String,placeholder:String,placement:{type:String,default:"bottom-start"},value:Number,format:{type:String,default:"HH:mm:ss"},valueFormat:String,formattedValue:String,isHourDisabled:Function,size:String,isMinuteDisabled:Function,isSecondDisabled:Function,inputReadonly:Boolean,clearable:Boolean,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:formattedValue":[Function,Array],onBlur:[Function,Array],onConfirm:[Function,Array],onClear:Function,onFocus:[Function,Array],timeZone:String,showIcon:{type:Boolean,default:!0},disabled:{type:Boolean,default:void 0},show:{type:Boolean,default:void 0},hours:{type:[Number,Array],validator:e=>yd(e,23)},minutes:{type:[Number,Array],validator:e=>yd(e,59)},seconds:{type:[Number,Array],validator:e=>yd(e,59)},use12Hours:Boolean,stateful:{type:Boolean,default:!0},onChange:[Function,Array]}),vu=$e({name:"TimePicker",props:FA,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,namespaceRef:s,inlineThemeDisabled:i}=mn(e),{localeRef:a,dateLocaleRef:d}=Qs("TimePicker"),r=ur(e),{mergedSizeRef:o,mergedDisabledRef:c,mergedStatusRef:p}=r,u=Ht("TimePicker","-time-picker",OA,d0,e,n),g=Zu(),m=H(null),y=H(null),v=j(()=>({locale:d.value.locale}));function l(xe){return xe===null?null:_s(xe,e.valueFormat||e.format,new Date,v.value).getTime()}const{defaultValue:h,defaultFormattedValue:f}=e,_=H(f!==void 0?l(f):h),S=j(()=>{const{formattedValue:xe}=e;if(xe!==void 0)return l(xe);const{value:je}=e;return je!==void 0?je:_.value}),k=j(()=>{const{timeZone:xe}=e;return xe?(je,ft,Tt)=>DA(je,xe,ft,Tt):(je,ft,Tt)=>ln(je,ft,Tt)}),P=H("");yt(()=>e.timeZone,()=>{const xe=S.value;P.value=xe===null?"":k.value(xe,e.format,v.value)},{immediate:!0});const M=H(!1),w=dt(e,"show"),T=ns(w,M),A=H(S.value),E=H(!1),R=j(()=>a.value.clear),D=j(()=>a.value.now),I=j(()=>e.placeholder!==void 0?e.placeholder:a.value.placeholder),O=j(()=>a.value.negativeText),U=j(()=>a.value.positiveText),W=j(()=>/H|h|K|k/.test(e.format)),z=j(()=>e.format.includes("m")),N=j(()=>e.format.includes("s")),V=j(()=>{const{value:xe}=S;return xe===null?null:Number(k.value(xe,"HH",v.value))}),q=j(()=>{const{value:xe}=S;return xe===null?null:Number(k.value(xe,"mm",v.value))}),G=j(()=>{const{value:xe}=S;return xe===null?null:Number(k.value(xe,"ss",v.value))}),te=j(()=>{const{isHourDisabled:xe}=e;return V.value===null?!1:il(V.value,"hours",e.hours)?xe?xe(V.value):!1:!0}),oe=j(()=>{const{value:xe}=q,{value:je}=V;if(xe===null||je===null)return!1;if(!il(xe,"minutes",e.minutes))return!0;const{isMinuteDisabled:ft}=e;return ft?ft(xe,je):!1}),ie=j(()=>{const{value:xe}=q,{value:je}=V,{value:ft}=G;if(ft===null||xe===null||je===null)return!1;if(!il(ft,"seconds",e.seconds))return!0;const{isSecondDisabled:Tt}=e;return Tt?Tt(ft,xe,je):!1}),ye=j(()=>te.value||oe.value||ie.value),K=j(()=>e.format.length+4),J=j(()=>{const{value:xe}=S;return xe===null?null:Zi(xe)<12?"am":"pm"});function Q(xe,je){const{onUpdateFormattedValue:ft,"onUpdate:formattedValue":Tt}=e;ft&&Xe(ft,xe,je),Tt&&Xe(Tt,xe,je)}function ce(xe){return xe===null?null:k.value(xe,e.valueFormat||e.format)}function Fe(xe){const{onUpdateValue:je,"onUpdate:value":ft,onChange:Tt}=e,{nTriggerFormChange:qt,nTriggerFormInput:zt}=r,Yt=ce(xe);je&&Xe(je,xe,Yt),ft&&Xe(ft,xe,Yt),Tt&&Xe(Tt,xe,Yt),Q(Yt,xe),_.value=xe,qt(),zt()}function Ee(xe){const{onFocus:je}=e,{nTriggerFormFocus:ft}=r;je&&Xe(je,xe),ft()}function Ye(xe){const{onBlur:je}=e,{nTriggerFormBlur:ft}=r;je&&Xe(je,xe),ft()}function Ze(){const{onConfirm:xe}=e;xe&&Xe(xe,S.value,ce(S.value))}function ue(xe){var je;xe.stopPropagation(),Fe(null),Me(null),(je=e.onClear)===null||je===void 0||je.call(e)}function et(){se({returnFocus:!0})}function re(){Fe(null),Me(null),se({returnFocus:!0})}function we(xe){xe.key==="Escape"&&T.value&&ga(xe)}function fe(xe){var je;switch(xe.key){case"Escape":T.value&&(ga(xe),se({returnFocus:!0}));break;case"Tab":g.shift&&xe.target===((je=y.value)===null||je===void 0?void 0:je.$el)&&(xe.preventDefault(),se({returnFocus:!0}));break}}function De(){E.value=!0,cn(()=>{E.value=!1})}function Qe(xe){c.value||ws(xe,"clear")||T.value||tt()}function We(xe){typeof xe!="string"&&(S.value===null?Fe(ht(kr(bM(new Date),xe))):Fe(ht(kr(S.value,xe))))}function ae(xe){typeof xe!="string"&&(S.value===null?Fe(ht(ad(aD(new Date),xe))):Fe(ht(ad(S.value,xe))))}function _e(xe){typeof xe!="string"&&(S.value===null?Fe(ht(ld(dh(new Date),xe))):Fe(ht(ld(S.value,xe))))}function be(xe){const{value:je}=S;if(je===null){const ft=new Date,Tt=Zi(ft);xe==="pm"&&Tt<12?Fe(ht(kr(ft,Tt+12))):xe==="am"&&Tt>=12&&Fe(ht(kr(ft,Tt-12))),Fe(ht(ft))}else{const ft=Zi(je);xe==="pm"&&ft<12?Fe(ht(kr(je,ft+12))):xe==="am"&&ft>=12&&Fe(ht(kr(je,ft-12)))}}function Me(xe){xe===void 0&&(xe=S.value),xe===null?P.value="":P.value=k.value(xe,e.format,v.value)}function x(xe){wt(xe)||Ee(xe)}function Re(xe){var je;if(!wt(xe))if(T.value){const ft=(je=y.value)===null||je===void 0?void 0:je.$el;ft!=null&&ft.contains(xe.relatedTarget)||(Me(),Ye(xe),se({returnFocus:!1}))}else Me(),Ye(xe)}function Ge(){c.value||T.value||tt()}function Ve(){c.value||(Me(),se({returnFocus:!1}))}function kt(){if(!y.value)return;const{hourScrollRef:xe,minuteScrollRef:je,secondScrollRef:ft,amPmScrollRef:Tt}=y.value;[xe,je,ft,Tt].forEach(qt=>{var zt;if(!qt)return;const Yt=(zt=qt.contentRef)===null||zt===void 0?void 0:zt.querySelector("[data-active]");Yt&&qt.scrollTo({top:Yt.offsetTop})})}function Je(xe){M.value=xe;const{onUpdateShow:je,"onUpdate:show":ft}=e;je&&Xe(je,xe),ft&&Xe(ft,xe)}function wt(xe){var je,ft,Tt;return!!(!((ft=(je=m.value)===null||je===void 0?void 0:je.wrapperElRef)===null||ft===void 0)&&ft.contains(xe.relatedTarget)||!((Tt=y.value)===null||Tt===void 0)&&Tt.$el.contains(xe.relatedTarget))}function tt(){A.value=S.value,Je(!0),cn(kt)}function mt(xe){var je,ft;T.value&&!(!((ft=(je=m.value)===null||je===void 0?void 0:je.wrapperElRef)===null||ft===void 0)&&ft.contains(Ar(xe)))&&se({returnFocus:!1})}function se({returnFocus:xe}){var je;T.value&&(Je(!1),xe&&((je=m.value)===null||je===void 0||je.focus()))}function de(xe){if(xe===""){Fe(null);return}const je=_s(xe,e.format,new Date,v.value);if(P.value=xe,Hs(je)){const{value:ft}=S;if(ft!==null){const Tt=es(ft,{hours:Zi(je),minutes:Kl(je),seconds:Wl(je),milliseconds:kD(je)});Fe(ht(Tt))}else Fe(ht(je))}}function Le(){Fe(A.value),Je(!1)}function Ae(){const xe=new Date,je={hours:Zi,minutes:Kl,seconds:Wl},[ft,Tt,qt]=["hours","minutes","seconds"].map(Yt=>!e[Yt]||il(je[Yt](xe),Yt,e[Yt])?je[Yt](xe):MA(je[Yt](xe),Yt,e[Yt])),zt=ld(ad(kr(S.value?S.value:ht(xe),ft),Tt),qt);Fe(ht(zt))}function ct(){Me(),Ze(),se({returnFocus:!0})}function ve(xe){wt(xe)||(Me(),Ye(xe),se({returnFocus:!1}))}yt(S,xe=>{Me(xe),De(),cn(kt)}),yt(T,()=>{ye.value&&Fe(A.value)}),kn(_y,{mergedThemeRef:u,mergedClsPrefixRef:n});const Be={focus:()=>{var xe;(xe=m.value)===null||xe===void 0||xe.focus()},blur:()=>{var xe;(xe=m.value)===null||xe===void 0||xe.blur()}},me=j(()=>{const{common:{cubicBezierEaseInOut:xe},self:{iconColor:je,iconColorDisabled:ft}}=u.value;return{"--n-icon-color-override":je,"--n-icon-color-disabled-override":ft,"--n-bezier":xe}}),rt=i?Bn("time-picker-trigger",void 0,me,e):void 0,At=j(()=>{const{self:{panelColor:xe,itemTextColor:je,itemTextColorActive:ft,itemColorHover:Tt,panelDividerColor:qt,panelBoxShadow:zt,itemOpacityDisabled:Yt,borderRadius:Qt,itemFontSize:xn,itemWidth:$n,itemHeight:Xt,panelActionPadding:Gt,itemBorderRadius:Rn},common:{cubicBezierEaseInOut:Zt}}=u.value;return{"--n-bezier":Zt,"--n-border-radius":Qt,"--n-item-color-hover":Tt,"--n-item-font-size":xn,"--n-item-height":Xt,"--n-item-opacity-disabled":Yt,"--n-item-text-color":je,"--n-item-text-color-active":ft,"--n-item-width":$n,"--n-panel-action-padding":Gt,"--n-panel-box-shadow":zt,"--n-panel-color":xe,"--n-panel-divider-color":qt,"--n-item-border-radius":Rn}}),St=i?Bn("time-picker",void 0,At,e):void 0;return{focus:Be.focus,blur:Be.blur,mergedStatus:p,mergedBordered:t,mergedClsPrefix:n,namespace:s,uncontrolledValue:_,mergedValue:S,isMounted:ba(),inputInstRef:m,panelInstRef:y,adjustedTo:cs(e),mergedShow:T,localizedClear:R,localizedNow:D,localizedPlaceholder:I,localizedNegativeText:O,localizedPositiveText:U,hourInFormat:W,minuteInFormat:z,secondInFormat:N,mergedAttrSize:K,displayTimeString:P,mergedSize:o,mergedDisabled:c,isValueInvalid:ye,isHourInvalid:te,isMinuteInvalid:oe,isSecondInvalid:ie,transitionDisabled:E,hourValue:V,minuteValue:q,secondValue:G,amPmValue:J,handleInputKeydown:we,handleTimeInputFocus:x,handleTimeInputBlur:Re,handleNowClick:Ae,handleConfirmClick:ct,handleTimeInputUpdateValue:de,handleMenuFocusOut:ve,handleCancelClick:Le,handleClickOutside:mt,handleTimeInputActivate:Ge,handleTimeInputDeactivate:Ve,handleHourClick:We,handleMinuteClick:ae,handleSecondClick:_e,handleAmPmClick:be,handleTimeInputClear:ue,handleFocusDetectorFocus:et,handleMenuKeydown:fe,handleTriggerClick:Qe,mergedTheme:u,triggerCssVars:i?void 0:me,triggerThemeClass:rt==null?void 0:rt.themeClass,triggerOnRender:rt==null?void 0:rt.onRender,cssVars:i?void 0:At,themeClass:St==null?void 0:St.themeClass,onRender:St==null?void 0:St.onRender,clearSelectedValue:re}},render(){const{mergedClsPrefix:e,$slots:t,triggerOnRender:n}=this;return n==null||n(),B("div",{class:[`${e}-time-picker`,this.triggerThemeClass],style:this.triggerCssVars},B(Eo,null,{default:()=>[B(Lo,null,{default:()=>B(Ls,{ref:"inputInstRef",status:this.mergedStatus,value:this.displayTimeString,bordered:this.mergedBordered,passivelyActivated:!0,attrSize:this.mergedAttrSize,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,stateful:this.stateful,size:this.mergedSize,placeholder:this.localizedPlaceholder,clearable:this.clearable,disabled:this.mergedDisabled,textDecoration:this.isValueInvalid?"line-through":void 0,onFocus:this.handleTimeInputFocus,onBlur:this.handleTimeInputBlur,onActivate:this.handleTimeInputActivate,onDeactivate:this.handleTimeInputDeactivate,onUpdateValue:this.handleTimeInputUpdateValue,onClear:this.handleTimeInputClear,internalDeactivateOnEnter:!0,internalForceFocus:this.mergedShow,readonly:this.inputReadonly||this.mergedDisabled,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown},this.showIcon?{[this.clearable?"clear-icon-placeholder":"suffix"]:()=>B(Vn,{clsPrefix:e,class:`${e}-time-picker-icon`},{default:()=>t.icon?t.icon():B(rL,null)})}:null)}),B(Do,{teleportDisabled:this.adjustedTo===cs.tdkey,show:this.mergedShow,to:this.adjustedTo,containerClass:this.namespace,placement:this.placement},{default:()=>B(ys,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>{var s;return this.mergedShow?((s=this.onRender)===null||s===void 0||s.call(this),it(B($A,{ref:"panelInstRef",actions:this.actions,class:this.themeClass,style:this.cssVars,seconds:this.seconds,minutes:this.minutes,hours:this.hours,transitionDisabled:this.transitionDisabled,hourValue:this.hourValue,showHour:this.hourInFormat,isHourInvalid:this.isHourInvalid,isHourDisabled:this.isHourDisabled,minuteValue:this.minuteValue,showMinute:this.minuteInFormat,isMinuteInvalid:this.isMinuteInvalid,isMinuteDisabled:this.isMinuteDisabled,secondValue:this.secondValue,amPmValue:this.amPmValue,showSecond:this.secondInFormat,isSecondInvalid:this.isSecondInvalid,isSecondDisabled:this.isSecondDisabled,isValueInvalid:this.isValueInvalid,clearText:this.localizedClear,nowText:this.localizedNow,confirmText:this.localizedPositiveText,use12Hours:this.use12Hours,onFocusout:this.handleMenuFocusOut,onKeydown:this.handleMenuKeydown,onHourClick:this.handleHourClick,onMinuteClick:this.handleMinuteClick,onSecondClick:this.handleSecondClick,onAmPmClick:this.handleAmPmClick,onNowClick:this.handleNowClick,onConfirmClick:this.handleConfirmClick,onClearClick:this.clearSelectedValue,onFocusDetectorFocus:this.handleFocusDetectorFocus}),[[$r,this.handleClickOutside,void 0,{capture:!0}]])):null}})})]}))}}),BA=$e({name:"DateTimePanel",props:gh,setup(e){return mh(e,"datetime")},render(){var e,t,n,s;const{mergedClsPrefix:i,mergedTheme:a,shortcuts:d,timePickerProps:r,onRender:o,$slots:c}=this;return o==null||o(),B("div",{ref:"selfRef",tabindex:0,class:[`${i}-date-panel`,`${i}-date-panel--datetime`,!this.panel&&`${i}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{class:`${i}-date-panel-header`},B(Ls,{value:this.dateInputValue,theme:a.peers.Input,themeOverrides:a.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${i}-date-panel-date-input`,textDecoration:this.isDateInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleDateInputBlur,onUpdateValue:this.handleDateInput}),B(vu,Object.assign({size:this.timePickerSize,placeholder:this.locale.selectTime,format:this.timerPickerFormat},Array.isArray(r)?void 0:r,{showIcon:!1,to:!1,theme:a.peers.TimePicker,themeOverrides:a.peerOverrides.TimePicker,value:Array.isArray(this.value)?null:this.value,isHourDisabled:this.isHourDisabled,isMinuteDisabled:this.isMinuteDisabled,isSecondDisabled:this.isSecondDisabled,onUpdateValue:this.handleTimePickerChange,stateful:!1}))),B("div",{class:`${i}-date-panel-calendar`},B("div",{class:`${i}-date-panel-month`},B("div",{class:`${i}-date-panel-month__fast-prev`,onClick:this.prevYear},Jt(c["prev-year"],()=>[B(lr,null)])),B("div",{class:`${i}-date-panel-month__prev`,onClick:this.prevMonth},Jt(c["prev-month"],()=>[B(ar,null)])),B(So,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.calendarValue,onUpdateValue:this.onUpdateCalendarValue,mergedClsPrefix:i,calendarMonth:this.calendarMonth,calendarYear:this.calendarYear}),B("div",{class:`${i}-date-panel-month__next`,onClick:this.nextMonth},Jt(c["next-month"],()=>[B(dr,null)])),B("div",{class:`${i}-date-panel-month__fast-next`,onClick:this.nextYear},Jt(c["next-year"],()=>[B(cr,null)]))),B("div",{class:`${i}-date-panel-weekdays`},this.weekdays.map(p=>B("div",{key:p,class:`${i}-date-panel-weekdays__day`},p))),B("div",{class:`${i}-date-panel-dates`},this.dateArray.map((p,u)=>B("div",{"data-n-date":!0,key:u,class:[`${i}-date-panel-date`,{[`${i}-date-panel-date--current`]:p.isCurrentDate,[`${i}-date-panel-date--selected`]:p.selected,[`${i}-date-panel-date--excluded`]:!p.inCurrentMonth,[`${i}-date-panel-date--disabled`]:this.mergedIsDateDisabled(p.ts,{type:"date",year:p.dateObject.year,month:p.dateObject.month,date:p.dateObject.date})}],onClick:()=>{this.handleDateClick(p)}},B("div",{class:`${i}-date-panel-date__trigger`}),p.dateObject.date,p.isCurrentDate?B("div",{class:`${i}-date-panel-date__sup`}):null)))),this.datePickerSlots.footer?B("div",{class:`${i}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||d?B("div",{class:`${i}-date-panel-actions`},B("div",{class:`${i}-date-panel-actions__prefix`},d&&Object.keys(d).map(p=>{const u=d[p];return Array.isArray(u)?null:B(di,{size:"tiny",onMouseenter:()=>{this.handleSingleShortcutMouseenter(u)},onClick:()=>{this.handleSingleShortcutClick(u)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>p})})),B("div",{class:`${i}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?bs(this.$slots.clear,{onClear:this.clearSelectedDateTime,text:this.locale.clear},()=>[B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.clearSelectedDateTime},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("now")?bs(c.now,{onNow:this.handleNowClick,text:this.locale.now},()=>[B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",onClick:this.handleNowClick},{default:()=>this.locale.now})]):null,!((s=this.actions)===null||s===void 0)&&s.includes("confirm")?bs(c.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isDateInvalid,text:this.locale.confirm},()=>[B(gn,{theme:a.peers.Button,themeOverrides:a.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isDateInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(hr,{onFocus:this.handleFocusDetectorFocus}))}}),HA=$e({name:"DateTimeRangePanel",props:_h,setup(e){return yh(e,"datetimerange")},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,timePickerProps:d,onRender:r,$slots:o}=this;return r==null||r(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--datetimerange`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{class:`${s}-date-panel-header`},B(Ls,{value:this.startDateDisplayString,theme:i.peers.Input,themeOverrides:i.peerOverrides.Input,size:this.timePickerSize,stateful:!1,readonly:this.inputReadonly,class:`${s}-date-panel-date-input`,textDecoration:this.isStartValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleStartDateInputBlur,onUpdateValue:this.handleStartDateInput}),B(vu,Object.assign({placeholder:this.locale.selectTime,format:this.timerPickerFormat,size:this.timePickerSize},Array.isArray(d)?d[0]:d,{value:this.startTimeValue,to:!1,showIcon:!1,disabled:this.isSelecting,theme:i.peers.TimePicker,themeOverrides:i.peerOverrides.TimePicker,stateful:!1,isHourDisabled:this.isStartHourDisabled,isMinuteDisabled:this.isStartMinuteDisabled,isSecondDisabled:this.isStartSecondDisabled,onUpdateValue:this.handleStartTimePickerChange})),B(Ls,{value:this.endDateInput,theme:i.peers.Input,themeOverrides:i.peerOverrides.Input,stateful:!1,size:this.timePickerSize,readonly:this.inputReadonly,class:`${s}-date-panel-date-input`,textDecoration:this.isEndValueInvalid?"line-through":"",placeholder:this.locale.selectDate,onBlur:this.handleEndDateInputBlur,onUpdateValue:this.handleEndDateInput}),B(vu,Object.assign({placeholder:this.locale.selectTime,format:this.timerPickerFormat,size:this.timePickerSize},Array.isArray(d)?d[1]:d,{disabled:this.isSelecting,showIcon:!1,theme:i.peers.TimePicker,themeOverrides:i.peerOverrides.TimePicker,to:!1,stateful:!1,value:this.endTimeValue,isHourDisabled:this.isEndHourDisabled,isMinuteDisabled:this.isEndMinuteDisabled,isSecondDisabled:this.isEndSecondDisabled,onUpdateValue:this.handleEndTimePickerChange}))),B("div",{ref:"startDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--start`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.startCalendarPrevYear},Jt(o["prev-year"],()=>[B(lr,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.startCalendarPrevMonth},Jt(o["prev-month"],()=>[B(ar,null)])),B(So,{monthYearSeparator:this.calendarHeaderMonthYearSeparator,monthBeforeYear:this.calendarMonthBeforeYear,value:this.startCalendarDateTime,onUpdateValue:this.onUpdateStartCalendarValue,mergedClsPrefix:s,calendarMonth:this.startCalendarMonth,calendarYear:this.startCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.startCalendarNextMonth},Jt(o["next-month"],()=>[B(dr,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.startCalendarNextYear},Jt(o["next-year"],()=>[B(cr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(c=>B("div",{key:c,class:`${s}-date-panel-weekdays__day`},c))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.startDateArray.map((c,p)=>{const u=this.mergedIsDateDisabled(c.ts);return B("div",{"data-n-date":!0,key:p,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${s}-date-panel-date--current`]:c.isCurrentDate,[`${s}-date-panel-date--selected`]:c.selected,[`${s}-date-panel-date--covered`]:c.inSpan,[`${s}-date-panel-date--start`]:c.startOfSpan,[`${s}-date-panel-date--end`]:c.endOfSpan,[`${s}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},B("div",{class:`${s}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)}))),B("div",{class:`${s}-date-panel__vertical-divider`}),B("div",{ref:"endDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--end`},B("div",{class:`${s}-date-panel-month`},B("div",{class:`${s}-date-panel-month__fast-prev`,onClick:this.endCalendarPrevYear},Jt(o["prev-year"],()=>[B(lr,null)])),B("div",{class:`${s}-date-panel-month__prev`,onClick:this.endCalendarPrevMonth},Jt(o["prev-month"],()=>[B(ar,null)])),B(So,{monthBeforeYear:this.calendarMonthBeforeYear,value:this.endCalendarDateTime,onUpdateValue:this.onUpdateEndCalendarValue,mergedClsPrefix:s,monthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarMonth:this.endCalendarMonth,calendarYear:this.endCalendarYear}),B("div",{class:`${s}-date-panel-month__next`,onClick:this.endCalendarNextMonth},Jt(o["next-month"],()=>[B(dr,null)])),B("div",{class:`${s}-date-panel-month__fast-next`,onClick:this.endCalendarNextYear},Jt(o["next-year"],()=>[B(cr,null)]))),B("div",{class:`${s}-date-panel-weekdays`},this.weekdays.map(c=>B("div",{key:c,class:`${s}-date-panel-weekdays__day`},c))),B("div",{class:`${s}-date-panel__divider`}),B("div",{class:`${s}-date-panel-dates`},this.endDateArray.map((c,p)=>{const u=this.mergedIsDateDisabled(c.ts);return B("div",{"data-n-date":!0,key:p,class:[`${s}-date-panel-date`,{[`${s}-date-panel-date--excluded`]:!c.inCurrentMonth,[`${s}-date-panel-date--current`]:c.isCurrentDate,[`${s}-date-panel-date--selected`]:c.selected,[`${s}-date-panel-date--covered`]:c.inSpan,[`${s}-date-panel-date--start`]:c.startOfSpan,[`${s}-date-panel-date--end`]:c.endOfSpan,[`${s}-date-panel-date--disabled`]:u}],onClick:u?void 0:()=>{this.handleDateClick(c)},onMouseenter:u?void 0:()=>{this.handleDateMouseEnter(c)}},B("div",{class:`${s}-date-panel-date__trigger`}),c.dateObject.date,c.isCurrentDate?B("div",{class:`${s}-date-panel-date__sup`}):null)}))),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},this.datePickerSlots.footer()):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const p=a[c];return Array.isArray(p)||typeof p=="function"?B(di,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(p)},onClick:()=>{this.handleRangeShortcutClick(p)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?bs(o.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?bs(o.confirm,{onConfirm:this.handleConfirmClick,disabled:this.isRangeInvalid||this.isSelecting,text:this.locale.confirm},()=>[B(gn,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid||this.isSelecting,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(hr,{onFocus:this.handleFocusDetectorFocus}))}}),NA=$e({name:"MonthRangePanel",props:Object.assign(Object.assign({},_h),{type:{type:String,required:!0}}),setup(e){const t=yh(e,e.type),{dateLocaleRef:n}=Qs("DatePicker"),s=(i,a,d,r)=>{const{handleColItemClick:o}=t;return B("div",{"data-n-date":!0,key:a,class:[`${d}-date-panel-month-calendar__picker-col-item`,i.isCurrent&&`${d}-date-panel-month-calendar__picker-col-item--current`,i.selected&&`${d}-date-panel-month-calendar__picker-col-item--selected`,!1],onClick:()=>{o(i,r)}},i.type==="month"?V_(i.dateObject.month,i.monthFormat,n.value.locale):i.type==="quarter"?W_(i.dateObject.quarter,i.quarterFormat,n.value.locale):K_(i.dateObject.year,i.yearFormat,n.value.locale))};return Dt(()=>{t.justifyColumnsScrollState()}),Object.assign(Object.assign({},t),{renderItem:s})},render(){var e,t,n;const{mergedClsPrefix:s,mergedTheme:i,shortcuts:a,type:d,renderItem:r,onRender:o}=this;return o==null||o(),B("div",{ref:"selfRef",tabindex:0,class:[`${s}-date-panel`,`${s}-date-panel--daterange`,!this.panel&&`${s}-date-panel--shadow`,this.themeClass],onKeydown:this.handlePanelKeyDown,onFocus:this.handlePanelFocus},B("div",{ref:"startDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--start`},B("div",{class:`${s}-date-panel-month-calendar`},B(Es,{ref:"startYearScrollbarRef",class:`${s}-date-panel-month-calendar__picker-col`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("start"),content:()=>this.virtualListContent("start"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>B(yo,{ref:"startYearVlRef",items:this.startYearArray,itemSize:Fr,showScrollbar:!1,keyField:"ts",onScroll:this.handleStartYearVlScroll,paddingBottom:4},{default:({item:c,index:p})=>r(c,p,s,"start")})}),d==="monthrange"||d==="quarterrange"?B("div",{class:`${s}-date-panel-month-calendar__picker-col`},B(Es,{ref:"startMonthScrollbarRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar},{default:()=>[(d==="monthrange"?this.startMonthArray:this.startQuarterArray).map((c,p)=>r(c,p,s,"start")),d==="monthrange"&&B("div",{class:`${s}-date-panel-month-calendar__padding`})]})):null)),B("div",{class:`${s}-date-panel__vertical-divider`}),B("div",{ref:"endDatesElRef",class:`${s}-date-panel-calendar ${s}-date-panel-calendar--end`},B("div",{class:`${s}-date-panel-month-calendar`},B(Es,{ref:"endYearScrollbarRef",class:`${s}-date-panel-month-calendar__picker-col`,theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar,container:()=>this.virtualListContainer("end"),content:()=>this.virtualListContent("end"),horizontalRailStyle:{zIndex:1},verticalRailStyle:{zIndex:1}},{default:()=>B(yo,{ref:"endYearVlRef",items:this.endYearArray,itemSize:Fr,showScrollbar:!1,keyField:"ts",onScroll:this.handleEndYearVlScroll,paddingBottom:4},{default:({item:c,index:p})=>r(c,p,s,"end")})}),d==="monthrange"||d==="quarterrange"?B("div",{class:`${s}-date-panel-month-calendar__picker-col`},B(Es,{ref:"endMonthScrollbarRef",theme:i.peers.Scrollbar,themeOverrides:i.peerOverrides.Scrollbar},{default:()=>[(d==="monthrange"?this.endMonthArray:this.endQuarterArray).map((c,p)=>r(c,p,s,"end")),d==="monthrange"&&B("div",{class:`${s}-date-panel-month-calendar__padding`})]})):null)),this.datePickerSlots.footer?B("div",{class:`${s}-date-panel-footer`},ig(this.datePickerSlots,"footer")):null,!((e=this.actions)===null||e===void 0)&&e.length||a?B("div",{class:`${s}-date-panel-actions`},B("div",{class:`${s}-date-panel-actions__prefix`},a&&Object.keys(a).map(c=>{const p=a[c];return Array.isArray(p)||typeof p=="function"?B(di,{size:"tiny",onMouseenter:()=>{this.handleRangeShortcutMouseenter(p)},onClick:()=>{this.handleRangeShortcutClick(p)},onMouseleave:()=>{this.handleShortcutMouseleave()}},{default:()=>c}):null})),B("div",{class:`${s}-date-panel-actions__suffix`},!((t=this.actions)===null||t===void 0)&&t.includes("clear")?bs(this.$slots.clear,{onClear:this.handleClearClick,text:this.locale.clear},()=>[B(di,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",onClick:this.handleClearClick},{default:()=>this.locale.clear})]):null,!((n=this.actions)===null||n===void 0)&&n.includes("confirm")?bs(this.$slots.confirm,{disabled:this.isRangeInvalid,onConfirm:this.handleConfirmClick,text:this.locale.confirm},()=>[B(di,{theme:i.peers.Button,themeOverrides:i.peerOverrides.Button,size:"tiny",type:"primary",disabled:this.isRangeInvalid,onClick:this.handleConfirmClick},{default:()=>this.locale.confirm})]):null)):null,B(hr,{onFocus:this.handleFocusDetectorFocus}))}}),zA=Object.assign(Object.assign({},Ht.props),{to:cs.propTo,bordered:{type:Boolean,default:void 0},clearable:Boolean,updateValueOnClose:Boolean,calendarDayFormat:String,calendarHeaderYearFormat:String,calendarHeaderMonthFormat:String,calendarHeaderMonthYearSeparator:{type:String,default:" "},calendarHeaderMonthBeforeYear:{type:Boolean,default:void 0},defaultValue:[Number,Array],defaultFormattedValue:[String,Array],defaultTime:[Number,String,Array],disabled:{type:Boolean,default:void 0},placement:{type:String,default:"bottom-start"},value:[Number,Array],formattedValue:[String,Array],size:String,type:{type:String,default:"date"},valueFormat:String,separator:String,placeholder:String,startPlaceholder:String,endPlaceholder:String,format:String,dateFormat:String,timerPickerFormat:String,actions:Array,shortcuts:Object,isDateDisabled:Function,isTimeDisabled:Function,show:{type:Boolean,default:void 0},panel:Boolean,ranges:Object,firstDayOfWeek:Number,inputReadonly:Boolean,closeOnSelect:Boolean,status:String,timePickerProps:[Object,Array],onClear:Function,onConfirm:Function,defaultCalendarStartTime:Number,defaultCalendarEndTime:Number,bindCalendarMonths:Boolean,monthFormat:{type:String,default:"M"},yearFormat:{type:String,default:"y"},quarterFormat:{type:String,default:"'Q'Q"},yearRange:{type:Array,default:()=>[1901,2100]},"onUpdate:show":[Function,Array],onUpdateShow:[Function,Array],"onUpdate:formattedValue":[Function,Array],onUpdateFormattedValue:[Function,Array],"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onNextMonth:Function,onPrevMonth:Function,onNextYear:Function,onPrevYear:Function,onChange:[Function,Array]}),UA=ze([Ce("date-picker",` + position: relative; + z-index: auto; + `,[Ce("date-picker-icon",` + color: var(--n-icon-color-override); + transition: color .3s var(--n-bezier); + `),Ce("icon",` + color: var(--n-icon-color-override); + transition: color .3s var(--n-bezier); + `),Ue("disabled",[Ce("date-picker-icon",` + color: var(--n-icon-color-disabled-override); + `),Ce("icon",` + color: var(--n-icon-color-disabled-override); + `)])]),Ce("date-panel",` + width: fit-content; + outline: none; + margin: 4px 0; + display: grid; + grid-template-columns: 0fr; + border-radius: var(--n-panel-border-radius); + background-color: var(--n-panel-color); + color: var(--n-panel-text-color); + user-select: none; + `,[Mo(),Ue("shadow",` + box-shadow: var(--n-panel-box-shadow); + `),Ce("date-panel-calendar",{padding:"var(--n-calendar-left-padding)",display:"grid",gridTemplateColumns:"1fr",gridArea:"left-calendar"},[Ue("end",{padding:"var(--n-calendar-right-padding)",gridArea:"right-calendar"})]),Ce("date-panel-month-calendar",{display:"flex",gridArea:"left-calendar"},[qe("picker-col",` + min-width: var(--n-scroll-item-width); + height: calc(var(--n-scroll-item-height) * 6); + user-select: none; + -webkit-user-select: none; + `,[ze("&:first-child",` + min-width: calc(var(--n-scroll-item-width) + 4px); + `,[qe("picker-col-item",[ze("&::before","left: 4px;")])]),qe("padding",` + height: calc(var(--n-scroll-item-height) * 5) + `)]),qe("picker-col-item",` + z-index: 0; + cursor: pointer; + height: var(--n-scroll-item-height); + box-sizing: border-box; + padding-top: 4px; + display: flex; + align-items: center; + justify-content: center; + position: relative; + transition: + color .3s var(--n-bezier), + background-color .3s var(--n-bezier); + background: #0000; + color: var(--n-item-text-color); + `,[ze("&::before",` + z-index: -1; + content: ""; + position: absolute; + left: 0; + right: 4px; + top: 4px; + bottom: 0; + border-radius: var(--n-scroll-item-border-radius); + transition: + background-color .3s var(--n-bezier); + `),Cn("disabled",[ze("&:hover::before",` + background-color: var(--n-item-color-hover); + `),Ue("selected",` + color: var(--n-item-color-active); + `,[ze("&::before","background-color: var(--n-item-color-hover);")])]),Ue("disabled",` + color: var(--n-item-text-color-disabled); + cursor: not-allowed; + `,[Ue("selected",[ze("&::before",` + background-color: var(--n-item-color-disabled); + `)])])])]),Ue("date",{gridTemplateAreas:` + "left-calendar" + "footer" + "action" + `}),Ue("week",{gridTemplateAreas:` + "left-calendar" + "footer" + "action" + `}),Ue("daterange",{gridTemplateAreas:` + "left-calendar divider right-calendar" + "footer footer footer" + "action action action" + `}),Ue("datetime",{gridTemplateAreas:` + "header" + "left-calendar" + "footer" + "action" + `}),Ue("datetimerange",{gridTemplateAreas:` + "header header header" + "left-calendar divider right-calendar" + "footer footer footer" + "action action action" + `}),Ue("month",{gridTemplateAreas:` + "left-calendar" + "footer" + "action" + `}),Ce("date-panel-footer",{gridArea:"footer"}),Ce("date-panel-actions",{gridArea:"action"}),Ce("date-panel-header",{gridArea:"header"}),Ce("date-panel-header",` + box-sizing: border-box; + width: 100%; + align-items: center; + padding: var(--n-panel-header-padding); + display: flex; + justify-content: space-between; + border-bottom: 1px solid var(--n-panel-header-divider-color); + `,[ze(">",[ze("*:not(:last-child)",{marginRight:"10px"}),ze("*",{flex:1,width:0}),Ce("time-picker",{zIndex:1})])]),Ce("date-panel-month",` + box-sizing: border-box; + display: grid; + grid-template-columns: var(--n-calendar-title-grid-template-columns); + align-items: center; + justify-items: center; + padding: var(--n-calendar-title-padding); + height: var(--n-calendar-title-height); + `,[qe("prev, next, fast-prev, fast-next",` + line-height: 0; + cursor: pointer; + width: var(--n-arrow-size); + height: var(--n-arrow-size); + color: var(--n-arrow-color); + `),qe("month-year",` + user-select: none; + -webkit-user-select: none; + flex-grow: 1; + position: relative; + `,[qe("text",` + font-size: var(--n-calendar-title-font-size); + line-height: var(--n-calendar-title-font-size); + font-weight: var(--n-calendar-title-font-weight); + padding: 6px 8px; + text-align: center; + color: var(--n-calendar-title-text-color); + cursor: pointer; + transition: background-color .3s var(--n-bezier); + border-radius: var(--n-panel-border-radius); + `,[Ue("active",` + background-color: var(--n-calendar-title-color-hover); + `),ze("&:hover",` + background-color: var(--n-calendar-title-color-hover); + `)])])]),Ce("date-panel-weekdays",` + display: grid; + margin: auto; + grid-template-columns: repeat(7, var(--n-item-cell-width)); + grid-template-rows: repeat(1, var(--n-item-cell-height)); + align-items: center; + justify-items: center; + margin-bottom: 4px; + border-bottom: 1px solid var(--n-calendar-days-divider-color); + `,[qe("day",` + white-space: nowrap; + user-select: none; + -webkit-user-select: none; + line-height: 15px; + width: var(--n-item-size); + text-align: center; + font-size: var(--n-calendar-days-font-size); + color: var(--n-item-text-color); + display: flex; + align-items: center; + justify-content: center; + `)]),Ce("date-panel-dates",` + margin: auto; + display: grid; + grid-template-columns: repeat(7, var(--n-item-cell-width)); + grid-template-rows: repeat(6, var(--n-item-cell-height)); + align-items: center; + justify-items: center; + flex-wrap: wrap; + `,[Ce("date-panel-date",` + user-select: none; + -webkit-user-select: none; + position: relative; + width: var(--n-item-size); + height: var(--n-item-size); + line-height: var(--n-item-size); + text-align: center; + font-size: var(--n-item-font-size); + border-radius: var(--n-item-border-radius); + z-index: 0; + cursor: pointer; + transition: + background-color .2s var(--n-bezier), + color .2s var(--n-bezier); + `,[qe("trigger",` + position: absolute; + left: calc(var(--n-item-size) / 2 - var(--n-item-cell-width) / 2); + top: calc(var(--n-item-size) / 2 - var(--n-item-cell-height) / 2); + width: var(--n-item-cell-width); + height: var(--n-item-cell-height); + `),Ue("current",[qe("sup",` + position: absolute; + top: 2px; + right: 2px; + content: ""; + height: 4px; + width: 4px; + border-radius: 2px; + background-color: var(--n-item-color-active); + transition: + background-color .2s var(--n-bezier); + `)]),ze("&::after",` + content: ""; + z-index: -1; + position: absolute; + left: 0; + right: 0; + top: 0; + bottom: 0; + border-radius: inherit; + transition: background-color .3s var(--n-bezier); + `),Ue("covered, start, end",[Cn("excluded",[ze("&::before",` + content: ""; + z-index: -2; + position: absolute; + left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + top: 0; + bottom: 0; + background-color: var(--n-item-color-included); + `),ze("&:nth-child(7n + 1)::before",{borderTopLeftRadius:"var(--n-item-border-radius)",borderBottomLeftRadius:"var(--n-item-border-radius)"}),ze("&:nth-child(7n + 7)::before",{borderTopRightRadius:"var(--n-item-border-radius)",borderBottomRightRadius:"var(--n-item-border-radius)"})])]),Ue("selected",{color:"var(--n-item-text-color-active)"},[ze("&::after",{backgroundColor:"var(--n-item-color-active)"}),Ue("start",[ze("&::before",{left:"50%"})]),Ue("end",[ze("&::before",{right:"50%"})]),qe("sup",{backgroundColor:"var(--n-panel-color)"})]),Ue("excluded",{color:"var(--n-item-text-color-disabled)"},[Ue("selected",[ze("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),Ue("disabled",{cursor:"not-allowed",color:"var(--n-item-text-color-disabled)"},[Ue("covered",[ze("&::before",{backgroundColor:"var(--n-item-color-disabled)"})]),Ue("selected",[ze("&::before",{backgroundColor:"var(--n-item-color-disabled)"}),ze("&::after",{backgroundColor:"var(--n-item-color-disabled)"})])]),Ue("week-hovered",[ze("&::before",` + background-color: var(--n-item-color-included); + `),ze("&:nth-child(7n + 1)::before",` + border-top-left-radius: var(--n-item-border-radius); + border-bottom-left-radius: var(--n-item-border-radius); + `),ze("&:nth-child(7n + 7)::before",` + border-top-right-radius: var(--n-item-border-radius); + border-bottom-right-radius: var(--n-item-border-radius); + `)]),Ue("week-selected",` + color: var(--n-item-text-color-active) + `,[ze("&::before",` + background-color: var(--n-item-color-active); + `),ze("&:nth-child(7n + 1)::before",` + border-top-left-radius: var(--n-item-border-radius); + border-bottom-left-radius: var(--n-item-border-radius); + `),ze("&:nth-child(7n + 7)::before",` + border-top-right-radius: var(--n-item-border-radius); + border-bottom-right-radius: var(--n-item-border-radius); + `)])])]),Cn("week",[Ce("date-panel-dates",[Ce("date-panel-date",[Cn("disabled",[Cn("selected",[ze("&:hover",` + background-color: var(--n-item-color-hover); + `)])])])])]),Ue("week",[Ce("date-panel-dates",[Ce("date-panel-date",[ze("&::before",` + content: ""; + z-index: -2; + position: absolute; + left: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + right: calc((var(--n-item-size) - var(--n-item-cell-width)) / 2); + top: 0; + bottom: 0; + transition: background-color .3s var(--n-bezier); + `)])])]),qe("vertical-divider",` + grid-area: divider; + height: 100%; + width: 1px; + background-color: var(--n-calendar-divider-color); + `),Ce("date-panel-footer",` + border-top: 1px solid var(--n-panel-action-divider-color); + padding: var(--n-panel-extra-footer-padding); + `),Ce("date-panel-actions",` + flex: 1; + padding: var(--n-panel-action-padding); + display: flex; + align-items: center; + justify-content: space-between; + border-top: 1px solid var(--n-panel-action-divider-color); + `,[qe("prefix, suffix",` + display: flex; + margin-bottom: -8px; + `),qe("suffix",` + align-self: flex-end; + `),qe("prefix",` + flex-wrap: wrap; + `),Ce("button",` + margin-bottom: 8px; + `,[ze("&:not(:last-child)",` + margin-right: 8px; + `)])])]),ze("[data-n-date].transition-disabled",{transition:"none !important"},[ze("&::before, &::after",{transition:"none !important"})])]);function VA(e,t){const n=j(()=>{const{isTimeDisabled:p}=e,{value:u}=t;if(!(u===null||Array.isArray(u)))return p==null?void 0:p(u)}),s=j(()=>{var p;return(p=n.value)===null||p===void 0?void 0:p.isHourDisabled}),i=j(()=>{var p;return(p=n.value)===null||p===void 0?void 0:p.isMinuteDisabled}),a=j(()=>{var p;return(p=n.value)===null||p===void 0?void 0:p.isSecondDisabled}),d=j(()=>{const{type:p,isDateDisabled:u}=e,{value:g}=t;return g===null||Array.isArray(g)||!["date","datetime"].includes(p)||!u?!1:u(g,{type:"input"})}),r=j(()=>{const{type:p}=e,{value:u}=t;if(u===null||p==="datetime"||Array.isArray(u))return!1;const g=new Date(u),m=g.getHours(),y=g.getMinutes(),v=g.getMinutes();return(s.value?s.value(m):!1)||(i.value?i.value(y,m):!1)||(a.value?a.value(v,y,m):!1)}),o=j(()=>d.value||r.value);return{isValueInvalidRef:j(()=>{const{type:p}=e;return p==="date"?d.value:p==="datetime"?o.value:!1}),isDateInvalidRef:d,isTimeInvalidRef:r,isDateTimeInvalidRef:o,isHourDisabledRef:s,isMinuteDisabledRef:i,isSecondDisabledRef:a}}function KA(e,t){const n=j(()=>{const{isTimeDisabled:u}=e,{value:g}=t;return!Array.isArray(g)||!u?[void 0,void 0]:[u==null?void 0:u(g[0],"start",g),u==null?void 0:u(g[1],"end",g)]}),s={isStartHourDisabledRef:j(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isHourDisabled}),isEndHourDisabledRef:j(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isHourDisabled}),isStartMinuteDisabledRef:j(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isMinuteDisabled}),isEndMinuteDisabledRef:j(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isMinuteDisabled}),isStartSecondDisabledRef:j(()=>{var u;return(u=n.value[0])===null||u===void 0?void 0:u.isSecondDisabled}),isEndSecondDisabledRef:j(()=>{var u;return(u=n.value[1])===null||u===void 0?void 0:u.isSecondDisabled})},i=j(()=>{const{type:u,isDateDisabled:g}=e,{value:m}=t;return m===null||!Array.isArray(m)||!["daterange","datetimerange"].includes(u)||!g?!1:g(m[0],"start",m)}),a=j(()=>{const{type:u,isDateDisabled:g}=e,{value:m}=t;return m===null||!Array.isArray(m)||!["daterange","datetimerange"].includes(u)||!g?!1:g(m[1],"end",m)}),d=j(()=>{const{type:u}=e,{value:g}=t;if(g===null||!Array.isArray(g)||u!=="datetimerange")return!1;const m=Zi(g[0]),y=Kl(g[0]),v=Wl(g[0]),{isStartHourDisabledRef:l,isStartMinuteDisabledRef:h,isStartSecondDisabledRef:f}=s;return(l.value?l.value(m):!1)||(h.value?h.value(y,m):!1)||(f.value?f.value(v,y,m):!1)}),r=j(()=>{const{type:u}=e,{value:g}=t;if(g===null||!Array.isArray(g)||u!=="datetimerange")return!1;const m=Zi(g[1]),y=Kl(g[1]),v=Wl(g[1]),{isEndHourDisabledRef:l,isEndMinuteDisabledRef:h,isEndSecondDisabledRef:f}=s;return(l.value?l.value(m):!1)||(h.value?h.value(y,m):!1)||(f.value?f.value(v,y,m):!1)}),o=j(()=>i.value||d.value),c=j(()=>a.value||r.value),p=j(()=>o.value||c.value);return Object.assign(Object.assign({},s),{isStartDateInvalidRef:i,isEndDateInvalidRef:a,isStartTimeInvalidRef:d,isEndTimeInvalidRef:r,isStartValueInvalidRef:o,isEndValueInvalidRef:c,isRangeInvalidRef:p})}const WA=$e({name:"DatePicker",props:zA,setup(e,{slots:t}){var n;const{localeRef:s,dateLocaleRef:i}=Qs("DatePicker"),a=ur(e),{mergedSizeRef:d,mergedDisabledRef:r,mergedStatusRef:o}=a,{mergedComponentPropsRef:c,mergedClsPrefixRef:p,mergedBorderedRef:u,namespaceRef:g,inlineThemeDisabled:m}=mn(e),y=H(null),v=H(null),l=H(null),h=H(!1),f=dt(e,"show"),_=ns(f,h),S=j(()=>({locale:i.value.locale,useAdditionalWeekYearTokens:!0})),k=j(()=>{const{format:ve}=e;if(ve)return ve;switch(e.type){case"date":case"daterange":return s.value.dateFormat;case"datetime":case"datetimerange":return s.value.dateTimeFormat;case"year":case"yearrange":return s.value.yearTypeFormat;case"month":case"monthrange":return s.value.monthTypeFormat;case"quarter":case"quarterrange":return s.value.quarterFormat;case"week":return s.value.weekFormat}}),P=j(()=>{var ve;return(ve=e.valueFormat)!==null&&ve!==void 0?ve:k.value});function M(ve){if(ve===null)return null;const{value:Be}=P,{value:me}=S;return Array.isArray(ve)?[_s(ve[0],Be,new Date,me).getTime(),_s(ve[1],Be,new Date,me).getTime()]:_s(ve,Be,new Date,me).getTime()}const{defaultFormattedValue:w,defaultValue:T}=e,A=H((n=w!==void 0?M(w):T)!==null&&n!==void 0?n:null),E=j(()=>{const{formattedValue:ve}=e;return ve!==void 0?M(ve):e.value}),R=ns(E,A),D=H(null);zs(()=>{D.value=R.value});const I=H(""),O=H(""),U=H(""),W=Ht("DatePicker","-date-picker",UA,u0,e,p),z=j(()=>{var ve,Be;return((Be=(ve=c==null?void 0:c.value)===null||ve===void 0?void 0:ve.DatePicker)===null||Be===void 0?void 0:Be.timePickerSize)||"small"}),N=j(()=>["daterange","datetimerange","monthrange","quarterrange","yearrange"].includes(e.type)),V=j(()=>{const{placeholder:ve}=e;if(ve===void 0){const{type:Be}=e;switch(Be){case"date":return s.value.datePlaceholder;case"datetime":return s.value.datetimePlaceholder;case"month":return s.value.monthPlaceholder;case"year":return s.value.yearPlaceholder;case"quarter":return s.value.quarterPlaceholder;case"week":return s.value.weekPlaceholder;default:return""}}else return ve}),q=j(()=>e.startPlaceholder===void 0?e.type==="daterange"?s.value.startDatePlaceholder:e.type==="datetimerange"?s.value.startDatetimePlaceholder:e.type==="monthrange"?s.value.startMonthPlaceholder:"":e.startPlaceholder),G=j(()=>e.endPlaceholder===void 0?e.type==="daterange"?s.value.endDatePlaceholder:e.type==="datetimerange"?s.value.endDatetimePlaceholder:e.type==="monthrange"?s.value.endMonthPlaceholder:"":e.endPlaceholder),te=j(()=>{const{actions:ve,type:Be,clearable:me}=e;if(ve===null)return[];if(ve!==void 0)return ve;const rt=me?["clear"]:[];switch(Be){case"date":case"week":return rt.push("now"),rt;case"datetime":return rt.push("now","confirm"),rt;case"daterange":return rt.push("confirm"),rt;case"datetimerange":return rt.push("confirm"),rt;case"month":return rt.push("now","confirm"),rt;case"year":return rt.push("now"),rt;case"quarter":return rt.push("now","confirm"),rt;case"monthrange":case"yearrange":case"quarterrange":return rt.push("confirm"),rt;default:{Ir("date-picker","The type is wrong, n-date-picker's type only supports `date`, `datetime`, `daterange` and `datetimerange`.");break}}});function oe(ve){if(ve===null)return null;if(Array.isArray(ve)){const{value:Be}=P,{value:me}=S;return[ln(ve[0],Be,me),ln(ve[1],Be,S.value)]}else return ln(ve,P.value,S.value)}function ie(ve){D.value=ve}function ye(ve,Be){const{"onUpdate:formattedValue":me,onUpdateFormattedValue:rt}=e;me&&Xe(me,ve,Be),rt&&Xe(rt,ve,Be)}function K(ve,Be){const{"onUpdate:value":me,onUpdateValue:rt,onChange:At}=e,{nTriggerFormChange:St,nTriggerFormInput:xe}=a,je=oe(ve);Be.doConfirm&&Q(ve,je),rt&&Xe(rt,ve,je),me&&Xe(me,ve,je),At&&Xe(At,ve,je),A.value=ve,ye(je,ve),St(),xe()}function J(){const{onClear:ve}=e;ve==null||ve()}function Q(ve,Be){const{onConfirm:me}=e;me&&me(ve,Be)}function ce(ve){const{onFocus:Be}=e,{nTriggerFormFocus:me}=a;Be&&Xe(Be,ve),me()}function Fe(ve){const{onBlur:Be}=e,{nTriggerFormBlur:me}=a;Be&&Xe(Be,ve),me()}function Ee(ve){const{"onUpdate:show":Be,onUpdateShow:me}=e;Be&&Xe(Be,ve),me&&Xe(me,ve),h.value=ve}function Ye(ve){ve.key==="Escape"&&_.value&&(ga(ve),wt({returnFocus:!0}))}function Ze(ve){ve.key==="Escape"&&_.value&&ga(ve)}function ue(){var ve;Ee(!1),(ve=l.value)===null||ve===void 0||ve.deactivate(),J()}function et(){var ve;(ve=l.value)===null||ve===void 0||ve.deactivate(),J()}function re(){wt({returnFocus:!0})}function we(ve){var Be;_.value&&!(!((Be=v.value)===null||Be===void 0)&&Be.contains(Ar(ve)))&&wt({returnFocus:!1})}function fe(ve){wt({returnFocus:!0,disableUpdateOnClose:ve})}function De(ve,Be){Be?K(ve,{doConfirm:!1}):ie(ve)}function Qe(){const ve=D.value;K(Array.isArray(ve)?[ve[0],ve[1]]:ve,{doConfirm:!0})}function We(){const{value:ve}=D;N.value?(Array.isArray(ve)||ve===null)&&_e(ve):Array.isArray(ve)||ae(ve)}function ae(ve){ve===null?I.value="":I.value=ln(ve,k.value,S.value)}function _e(ve){if(ve===null)O.value="",U.value="";else{const Be=S.value;O.value=ln(ve[0],k.value,Be),U.value=ln(ve[1],k.value,Be)}}function be(){_.value||Je()}function Me(ve){var Be;!((Be=y.value)===null||Be===void 0)&&Be.$el.contains(ve.relatedTarget)||(Fe(ve),We(),wt({returnFocus:!1}))}function x(){r.value||(We(),wt({returnFocus:!1}))}function Re(ve){if(ve===""){K(null,{doConfirm:!1}),D.value=null,I.value="";return}const Be=_s(ve,k.value,new Date,S.value);Hs(Be)?(K(ht(Be),{doConfirm:!1}),We()):I.value=ve}function Ge(ve,{source:Be}){if(ve[0]===""&&ve[1]===""){K(null,{doConfirm:!1}),D.value=null,O.value="",U.value="";return}const[me,rt]=ve,At=_s(me,k.value,new Date,S.value),St=_s(rt,k.value,new Date,S.value);if(Hs(At)&&Hs(St)){let xe=ht(At),je=ht(St);St{We()}),We(),yt(_,ve=>{ve||(D.value=R.value)});const tt=VA(e,D),mt=KA(e,D);kn(mc,Object.assign(Object.assign(Object.assign({mergedClsPrefixRef:p,mergedThemeRef:W,timePickerSizeRef:z,localeRef:s,dateLocaleRef:i,firstDayOfWeekRef:dt(e,"firstDayOfWeek"),isDateDisabledRef:dt(e,"isDateDisabled"),rangesRef:dt(e,"ranges"),timePickerPropsRef:dt(e,"timePickerProps"),closeOnSelectRef:dt(e,"closeOnSelect"),updateValueOnCloseRef:dt(e,"updateValueOnClose"),monthFormatRef:dt(e,"monthFormat"),yearFormatRef:dt(e,"yearFormat"),quarterFormatRef:dt(e,"quarterFormat"),yearRangeRef:dt(e,"yearRange")},tt),mt),{datePickerSlots:t}));const se={focus:()=>{var ve;(ve=l.value)===null||ve===void 0||ve.focus()},blur:()=>{var ve;(ve=l.value)===null||ve===void 0||ve.blur()}},de=j(()=>{const{common:{cubicBezierEaseInOut:ve},self:{iconColor:Be,iconColorDisabled:me}}=W.value;return{"--n-bezier":ve,"--n-icon-color-override":Be,"--n-icon-color-disabled-override":me}}),Le=m?Bn("date-picker-trigger",void 0,de,e):void 0,Ae=j(()=>{const{type:ve}=e,{common:{cubicBezierEaseInOut:Be},self:{calendarTitleFontSize:me,calendarDaysFontSize:rt,itemFontSize:At,itemTextColor:St,itemColorDisabled:xe,itemColorIncluded:je,itemColorHover:ft,itemColorActive:Tt,itemBorderRadius:qt,itemTextColorDisabled:zt,itemTextColorActive:Yt,panelColor:Qt,panelTextColor:xn,arrowColor:$n,calendarTitleTextColor:Xt,panelActionDividerColor:Gt,panelHeaderDividerColor:Rn,calendarDaysDividerColor:Zt,panelBoxShadow:on,panelBorderRadius:Ot,calendarTitleFontWeight:Hn,panelExtraFooterPadding:Tn,panelActionPadding:bn,itemSize:fn,itemCellWidth:ss,itemCellHeight:Nn,scrollItemWidth:ke,scrollItemHeight:nt,calendarTitlePadding:gt,calendarTitleHeight:It,calendarDaysHeight:pn,calendarDaysTextColor:Nt,arrowSize:Pn,panelHeaderPadding:is,calendarDividerColor:On,calendarTitleGridTempateColumns:us,iconColor:Vs,iconColorDisabled:Ks,scrollItemBorderRadius:fi,calendarTitleColorHover:Ss,[Mt("calendarLeftPadding",ve)]:ei,[Mt("calendarRightPadding",ve)]:Oi}}=W.value;return{"--n-bezier":Be,"--n-panel-border-radius":Ot,"--n-panel-color":Qt,"--n-panel-box-shadow":on,"--n-panel-text-color":xn,"--n-panel-header-padding":is,"--n-panel-header-divider-color":Rn,"--n-calendar-left-padding":ei,"--n-calendar-right-padding":Oi,"--n-calendar-title-color-hover":Ss,"--n-calendar-title-height":It,"--n-calendar-title-padding":gt,"--n-calendar-title-font-size":me,"--n-calendar-title-font-weight":Hn,"--n-calendar-title-text-color":Xt,"--n-calendar-title-grid-template-columns":us,"--n-calendar-days-height":pn,"--n-calendar-days-divider-color":Zt,"--n-calendar-days-font-size":rt,"--n-calendar-days-text-color":Nt,"--n-calendar-divider-color":On,"--n-panel-action-padding":bn,"--n-panel-extra-footer-padding":Tn,"--n-panel-action-divider-color":Gt,"--n-item-font-size":At,"--n-item-border-radius":qt,"--n-item-size":fn,"--n-item-cell-width":ss,"--n-item-cell-height":Nn,"--n-item-text-color":St,"--n-item-color-included":je,"--n-item-color-disabled":xe,"--n-item-color-hover":ft,"--n-item-color-active":Tt,"--n-item-text-color-disabled":zt,"--n-item-text-color-active":Yt,"--n-scroll-item-width":ke,"--n-scroll-item-height":nt,"--n-scroll-item-border-radius":fi,"--n-arrow-size":Pn,"--n-arrow-color":$n,"--n-icon-color":Vs,"--n-icon-color-disabled":Ks}}),ct=m?Bn("date-picker",j(()=>e.type),Ae,e):void 0;return Object.assign(Object.assign({},se),{mergedStatus:o,mergedClsPrefix:p,mergedBordered:u,namespace:g,uncontrolledValue:A,pendingValue:D,panelInstRef:y,triggerElRef:v,inputInstRef:l,isMounted:ba(),displayTime:I,displayStartTime:O,displayEndTime:U,mergedShow:_,adjustedTo:cs(e),isRange:N,localizedStartPlaceholder:q,localizedEndPlaceholder:G,mergedSize:d,mergedDisabled:r,localizedPlacehoder:V,isValueInvalid:tt.isValueInvalidRef,isStartValueInvalid:mt.isStartValueInvalidRef,isEndValueInvalid:mt.isEndValueInvalidRef,handleInputKeydown:Ze,handleClickOutside:we,handleKeydown:Ye,handleClear:ue,handlePanelClear:et,handleTriggerClick:Ve,handleInputActivate:be,handleInputDeactivate:x,handleInputFocus:kt,handleInputBlur:Me,handlePanelTabOut:re,handlePanelClose:fe,handleRangeUpdateValue:Ge,handleSingleUpdateValue:Re,handlePanelUpdateValue:De,handlePanelConfirm:Qe,mergedTheme:W,actions:te,triggerCssVars:m?void 0:de,triggerThemeClass:Le==null?void 0:Le.themeClass,triggerOnRender:Le==null?void 0:Le.onRender,cssVars:m?void 0:Ae,themeClass:ct==null?void 0:ct.themeClass,onRender:ct==null?void 0:ct.onRender,onNextMonth:e.onNextMonth,onPrevMonth:e.onPrevMonth,onNextYear:e.onNextYear,onPrevYear:e.onPrevYear})},render(){const{clearable:e,triggerOnRender:t,mergedClsPrefix:n,$slots:s}=this,i={onUpdateValue:this.handlePanelUpdateValue,onTabOut:this.handlePanelTabOut,onClose:this.handlePanelClose,onClear:this.handlePanelClear,onKeydown:this.handleKeydown,onConfirm:this.handlePanelConfirm,ref:"panelInstRef",value:this.pendingValue,active:this.mergedShow,actions:this.actions,shortcuts:this.shortcuts,style:this.cssVars,defaultTime:this.defaultTime,themeClass:this.themeClass,panel:this.panel,inputReadonly:this.inputReadonly||this.mergedDisabled,onRender:this.onRender,onNextMonth:this.onNextMonth,onPrevMonth:this.onPrevMonth,onNextYear:this.onNextYear,onPrevYear:this.onPrevYear,timerPickerFormat:this.timerPickerFormat,dateFormat:this.dateFormat,calendarDayFormat:this.calendarDayFormat,calendarHeaderYearFormat:this.calendarHeaderYearFormat,calendarHeaderMonthFormat:this.calendarHeaderMonthFormat,calendarHeaderMonthYearSeparator:this.calendarHeaderMonthYearSeparator,calendarHeaderMonthBeforeYear:this.calendarHeaderMonthBeforeYear},a=()=>{const{type:r}=this;return r==="datetime"?B(BA,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime}),s):r==="daterange"?B(nA,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),s):r==="datetimerange"?B(HA,Object.assign({},i,{defaultCalendarStartTime:this.defaultCalendarStartTime,defaultCalendarEndTime:this.defaultCalendarEndTime,bindCalendarMonths:this.bindCalendarMonths}),s):r==="month"||r==="year"||r==="quarter"?B(py,Object.assign({},i,{type:r,key:r})):r==="monthrange"||r==="yearrange"||r==="quarterrange"?B(NA,Object.assign({},i,{type:r})):B(tA,Object.assign({},i,{type:r,defaultCalendarStartTime:this.defaultCalendarStartTime}),s)};if(this.panel)return a();t==null||t();const d={bordered:this.mergedBordered,size:this.mergedSize,passivelyActivated:!0,disabled:this.mergedDisabled,readonly:this.inputReadonly||this.mergedDisabled,clearable:e,onClear:this.handleClear,onClick:this.handleTriggerClick,onKeydown:this.handleInputKeydown,onActivate:this.handleInputActivate,onDeactivate:this.handleInputDeactivate,onFocus:this.handleInputFocus,onBlur:this.handleInputBlur};return B("div",{ref:"triggerElRef",class:[`${n}-date-picker`,this.mergedDisabled&&`${n}-date-picker--disabled`,this.isRange&&`${n}-date-picker--range`,this.triggerThemeClass],style:this.triggerCssVars,onKeydown:this.handleKeydown},B(Eo,null,{default:()=>[B(Lo,null,{default:()=>this.isRange?B(Ls,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:[this.displayStartTime,this.displayEndTime],placeholder:[this.localizedStartPlaceholder,this.localizedEndPlaceholder],textDecoration:[this.isStartValueInvalid?"line-through":"",this.isEndValueInvalid?"line-through":""],pair:!0,onUpdateValue:this.handleRangeUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},d),{separator:()=>this.separator===void 0?Jt(s.separator,()=>[B(Vn,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>B(oL,null)})]):this.separator,[e?"clear-icon-placeholder":"suffix"]:()=>Jt(s["date-icon"],()=>[B(Vn,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>B(Kp,null)})])}):B(Ls,Object.assign({ref:"inputInstRef",status:this.mergedStatus,value:this.displayTime,placeholder:this.localizedPlacehoder,textDecoration:this.isValueInvalid&&!this.isRange?"line-through":"",onUpdateValue:this.handleSingleUpdateValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,internalForceFocus:this.mergedShow,internalDeactivateOnEnter:!0},d),{[e?"clear-icon-placeholder":"suffix"]:()=>B(Vn,{clsPrefix:n,class:`${n}-date-picker-icon`},{default:()=>Jt(s["date-icon"],()=>[B(Kp,null)])})})}),B(Do,{show:this.mergedShow,containerClass:this.namespace,to:this.adjustedTo,teleportDisabled:this.adjustedTo===cs.tdkey,placement:this.placement},{default:()=>B(ys,{name:"fade-in-scale-up-transition",appear:this.isMounted},{default:()=>this.mergedShow?it(a(),[[$r,this.handleClickOutside,void 0,{capture:!0}]]):null})})]}))}});function Ta(){const e=Ut(h0,null);return e===null&&mg("use-message","No outer founded. See prerequisite in https://www.naiveui.com/en-US/os-theme/components/message for more details. If you want to use `useMessage` outside setup, please check https://www.naiveui.com/zh-CN/os-theme/components/message#Q-&-A."),e}function jA(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}const qA=f0({name:"InputNumber",common:lg,peers:{Button:v0,Input:p0},self:jA}),YA=ze([Ce("input-number-suffix",` + display: inline-block; + margin-right: 10px; + `),Ce("input-number-prefix",` + display: inline-block; + margin-left: 10px; + `)]);function GA(e){return e==null||typeof e=="string"&&e.trim()===""?null:Number(e)}function XA(e){return e.includes(".")&&(/^(-)?\d+.*(\.|0)$/.test(e)||/^-?\d*$/.test(e))||e==="-"||e==="-0"}function bd(e){return e==null?!0:!Number.isNaN(e)}function kv(e,t){return typeof e!="number"?"":t===void 0?String(e):e.toFixed(t)}function wd(e){if(e===null)return null;if(typeof e=="number")return e;{const t=Number(e);return Number.isNaN(t)?null:t}}const xv=800,Rv=100,JA=Object.assign(Object.assign({},Ht.props),{autofocus:Boolean,loading:{type:Boolean,default:void 0},placeholder:String,defaultValue:{type:Number,default:null},value:Number,step:{type:[Number,String],default:1},min:[Number,String],max:[Number,String],size:String,disabled:{type:Boolean,default:void 0},validator:Function,bordered:{type:Boolean,default:void 0},showButton:{type:Boolean,default:!0},buttonPlacement:{type:String,default:"right"},inputProps:Object,readonly:Boolean,clearable:Boolean,keyboard:{type:Object,default:{}},updateValueOnInput:{type:Boolean,default:!0},round:{type:Boolean,default:void 0},parse:Function,format:Function,precision:Number,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClear:[Function,Array],onChange:[Function,Array]}),gu=$e({name:"InputNumber",props:JA,setup(e){const{mergedBorderedRef:t,mergedClsPrefixRef:n,mergedRtlRef:s}=mn(e),i=Ht("InputNumber","-input-number",YA,qA,e,n),{localeRef:a}=Qs("InputNumber"),d=ur(e),{mergedSizeRef:r,mergedDisabledRef:o,mergedStatusRef:c}=d,p=H(null),u=H(null),g=H(null),m=H(e.defaultValue),y=dt(e,"value"),v=ns(y,m),l=H(""),h=re=>{const we=String(re).split(".")[1];return we?we.length:0},f=re=>{const we=[e.min,e.max,e.step,re].map(fe=>fe===void 0?0:h(fe));return Math.max(...we)},_=en(()=>{const{placeholder:re}=e;return re!==void 0?re:a.value.placeholder}),S=en(()=>{const re=wd(e.step);return re!==null?re===0?1:Math.abs(re):1}),k=en(()=>{const re=wd(e.min);return re!==null?re:null}),P=en(()=>{const re=wd(e.max);return re!==null?re:null}),M=()=>{const{value:re}=v;if(bd(re)){const{format:we,precision:fe}=e;we?l.value=we(re):re===null||fe===void 0||h(re)>fe?l.value=kv(re,void 0):l.value=kv(re,fe)}else l.value=String(re)};M();const w=re=>{const{value:we}=v;if(re===we){M();return}const{"onUpdate:value":fe,onUpdateValue:De,onChange:Qe}=e,{nTriggerFormInput:We,nTriggerFormChange:ae}=d;Qe&&Xe(Qe,re),De&&Xe(De,re),fe&&Xe(fe,re),m.value=re,We(),ae()},T=({offset:re,doUpdateIfValid:we,fixPrecision:fe,isInputing:De})=>{const{value:Qe}=l;if(De&&XA(Qe))return!1;const We=(e.parse||GA)(Qe);if(We===null)return we&&w(null),null;if(bd(We)){const ae=h(We),{precision:_e}=e;if(_e!==void 0&&_eMe){if(!we||De)return!1;be=Me}if(x!==null&&beT({offset:0,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})===!1),E=en(()=>{const{value:re}=v;if(e.validator&&re===null)return!1;const{value:we}=S;return T({offset:-we,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1}),R=en(()=>{const{value:re}=v;if(e.validator&&re===null)return!1;const{value:we}=S;return T({offset:+we,doUpdateIfValid:!1,isInputing:!1,fixPrecision:!1})!==!1});function D(re){const{onFocus:we}=e,{nTriggerFormFocus:fe}=d;we&&Xe(we,re),fe()}function I(re){var we,fe;if(re.target===((we=p.value)===null||we===void 0?void 0:we.wrapperElRef))return;const De=T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0});if(De!==!1){const ae=(fe=p.value)===null||fe===void 0?void 0:fe.inputElRef;ae&&(ae.value=String(De||"")),v.value===De&&M()}else M();const{onBlur:Qe}=e,{nTriggerFormBlur:We}=d;Qe&&Xe(Qe,re),We(),cn(()=>{M()})}function O(re){const{onClear:we}=e;we&&Xe(we,re)}function U(){const{value:re}=R;if(!re){J();return}const{value:we}=v;if(we===null)e.validator||w(V());else{const{value:fe}=S;T({offset:fe,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}function W(){const{value:re}=E;if(!re){ye();return}const{value:we}=v;if(we===null)e.validator||w(V());else{const{value:fe}=S;T({offset:-fe,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})}}const z=D,N=I;function V(){if(e.validator)return null;const{value:re}=k,{value:we}=P;return re!==null?Math.max(0,re):we!==null?Math.min(0,we):0}function q(re){O(re),w(null)}function G(re){var we,fe,De;!((we=g.value)===null||we===void 0)&&we.$el.contains(re.target)&&re.preventDefault(),!((fe=u.value)===null||fe===void 0)&&fe.$el.contains(re.target)&&re.preventDefault(),(De=p.value)===null||De===void 0||De.activate()}let te=null,oe=null,ie=null;function ye(){ie&&(window.clearTimeout(ie),ie=null),te&&(window.clearInterval(te),te=null)}let K=null;function J(){K&&(window.clearTimeout(K),K=null),oe&&(window.clearInterval(oe),oe=null)}function Q(){ye(),ie=window.setTimeout(()=>{te=window.setInterval(()=>{W()},Rv)},xv),Kn("mouseup",document,ye,{once:!0})}function ce(){J(),K=window.setTimeout(()=>{oe=window.setInterval(()=>{U()},Rv)},xv),Kn("mouseup",document,J,{once:!0})}const Fe=()=>{oe||U()},Ee=()=>{te||W()};function Ye(re){var we,fe;if(re.key==="Enter"){if(re.target===((we=p.value)===null||we===void 0?void 0:we.wrapperElRef))return;T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&((fe=p.value)===null||fe===void 0||fe.deactivate())}else if(re.key==="ArrowUp"){if(!R.value||e.keyboard.ArrowUp===!1)return;re.preventDefault(),T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&U()}else if(re.key==="ArrowDown"){if(!E.value||e.keyboard.ArrowDown===!1)return;re.preventDefault(),T({offset:0,doUpdateIfValid:!0,isInputing:!1,fixPrecision:!0})!==!1&&W()}}function Ze(re){l.value=re,e.updateValueOnInput&&!e.format&&!e.parse&&e.precision===void 0&&T({offset:0,doUpdateIfValid:!0,isInputing:!0,fixPrecision:!1})}yt(v,()=>{M()});const ue={focus:()=>{var re;return(re=p.value)===null||re===void 0?void 0:re.focus()},blur:()=>{var re;return(re=p.value)===null||re===void 0?void 0:re.blur()},select:()=>{var re;return(re=p.value)===null||re===void 0?void 0:re.select()}},et=ui("InputNumber",s,n);return Object.assign(Object.assign({},ue),{rtlEnabled:et,inputInstRef:p,minusButtonInstRef:u,addButtonInstRef:g,mergedClsPrefix:n,mergedBordered:t,uncontrolledValue:m,mergedValue:v,mergedPlaceholder:_,displayedValueInvalid:A,mergedSize:r,mergedDisabled:o,displayedValue:l,addable:R,minusable:E,mergedStatus:c,handleFocus:z,handleBlur:N,handleClear:q,handleMouseDown:G,handleAddClick:Fe,handleMinusClick:Ee,handleAddMousedown:ce,handleMinusMousedown:Q,handleKeyDown:Ye,handleUpdateDisplayedValue:Ze,mergedTheme:i,inputThemeOverrides:{paddingSmall:"0 8px 0 10px",paddingMedium:"0 8px 0 12px",paddingLarge:"0 8px 0 14px"},buttonThemeOverrides:j(()=>{const{self:{iconColorDisabled:re}}=i.value,[we,fe,De,Qe]=g0(re);return{textColorTextDisabled:`rgb(${we}, ${fe}, ${De})`,opacityDisabled:`${Qe}`}})})},render(){const{mergedClsPrefix:e,$slots:t}=this,n=()=>B(di,{text:!0,disabled:!this.minusable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleMinusClick,onMousedown:this.handleMinusMousedown,ref:"minusButtonInstRef"},{icon:()=>Jt(t["minus-icon"],()=>[B(Vn,{clsPrefix:e},{default:()=>B(iL,null)})])}),s=()=>B(di,{text:!0,disabled:!this.addable||this.mergedDisabled||this.readonly,focusable:!1,theme:this.mergedTheme.peers.Button,themeOverrides:this.mergedTheme.peerOverrides.Button,builtinThemeOverrides:this.buttonThemeOverrides,onClick:this.handleAddClick,onMousedown:this.handleAddMousedown,ref:"addButtonInstRef"},{icon:()=>Jt(t["add-icon"],()=>[B(Vn,{clsPrefix:e},{default:()=>B(ZE,null)})])});return B("div",{class:[`${e}-input-number`,this.rtlEnabled&&`${e}-input-number--rtl`]},B(Ls,{ref:"inputInstRef",autofocus:this.autofocus,status:this.mergedStatus,bordered:this.mergedBordered,loading:this.loading,value:this.displayedValue,onUpdateValue:this.handleUpdateDisplayedValue,theme:this.mergedTheme.peers.Input,themeOverrides:this.mergedTheme.peerOverrides.Input,builtinThemeOverrides:this.inputThemeOverrides,size:this.mergedSize,placeholder:this.mergedPlaceholder,disabled:this.mergedDisabled,readonly:this.readonly,round:this.round,textDecoration:this.displayedValueInvalid?"line-through":void 0,onFocus:this.handleFocus,onBlur:this.handleBlur,onKeydown:this.handleKeyDown,onMousedown:this.handleMouseDown,onClear:this.handleClear,clearable:this.clearable,inputProps:this.inputProps,internalLoadingBeforeSuffix:!0},{prefix:()=>{var i;return this.showButton&&this.buttonPlacement==="both"?[n(),Ns(t.prefix,a=>a?B("span",{class:`${e}-input-number-prefix`},a):null)]:(i=t.prefix)===null||i===void 0?void 0:i.call(t)},suffix:()=>{var i;return this.showButton?[Ns(t.suffix,a=>a?B("span",{class:`${e}-input-number-suffix`},a):null),this.buttonPlacement==="right"?n():null,s()]:(i=t.suffix)===null||i===void 0?void 0:i.call(t)}}))}}),yy=ds("n-popconfirm"),by={positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},onPositiveClick:{type:Function,required:!0},onNegativeClick:{type:Function,required:!0}},Tv=pg(by),QA=$e({name:"NPopconfirmPanel",props:by,setup(e){const{localeRef:t}=Qs("Popconfirm"),{inlineThemeDisabled:n}=mn(),{mergedClsPrefixRef:s,mergedThemeRef:i,props:a}=Ut(yy),d=j(()=>{const{common:{cubicBezierEaseInOut:o},self:{fontSize:c,iconSize:p,iconColor:u}}=i.value;return{"--n-bezier":o,"--n-font-size":c,"--n-icon-size":p,"--n-icon-color":u}}),r=n?Bn("popconfirm-panel",void 0,d,a):void 0;return Object.assign(Object.assign({},Qs("Popconfirm")),{mergedClsPrefix:s,cssVars:n?void 0:d,localizedPositiveText:j(()=>e.positiveText||t.value.positiveText),localizedNegativeText:j(()=>e.negativeText||t.value.negativeText),positiveButtonProps:dt(a,"positiveButtonProps"),negativeButtonProps:dt(a,"negativeButtonProps"),handlePositiveClick(o){e.onPositiveClick(o)},handleNegativeClick(o){e.onNegativeClick(o)},themeClass:r==null?void 0:r.themeClass,onRender:r==null?void 0:r.onRender})},render(){var e;const{mergedClsPrefix:t,showIcon:n,$slots:s}=this,i=Jt(s.action,()=>this.negativeText===null&&this.positiveText===null?[]:[this.negativeText!==null&&B(gn,Object.assign({size:"small",onClick:this.handleNegativeClick},this.negativeButtonProps),{default:()=>this.localizedNegativeText}),this.positiveText!==null&&B(gn,Object.assign({size:"small",type:"primary",onClick:this.handlePositiveClick},this.positiveButtonProps),{default:()=>this.localizedPositiveText})]);return(e=this.onRender)===null||e===void 0||e.call(this),B("div",{class:[`${t}-popconfirm__panel`,this.themeClass],style:this.cssVars},Ns(s.default,a=>n||a?B("div",{class:`${t}-popconfirm__body`},n?B("div",{class:`${t}-popconfirm__icon`},Jt(s.icon,()=>[B(Vn,{clsPrefix:t},{default:()=>B(m0,null)})])):null,a):null),i?B("div",{class:[`${t}-popconfirm__action`]},i):null)}}),ZA=Ce("popconfirm",[qe("body",` + font-size: var(--n-font-size); + display: flex; + align-items: center; + flex-wrap: nowrap; + position: relative; + `,[qe("icon",` + display: flex; + font-size: var(--n-icon-size); + color: var(--n-icon-color); + transition: color .3s var(--n-bezier); + margin: 0 8px 0 0; + `)]),qe("action",` + display: flex; + justify-content: flex-end; + `,[ze("&:not(:first-child)","margin-top: 8px"),Ce("button",[ze("&:not(:last-child)","margin-right: 8px;")])])]),eI=Object.assign(Object.assign(Object.assign({},Ht.props),Or),{positiveText:String,negativeText:String,showIcon:{type:Boolean,default:!0},trigger:{type:String,default:"click"},positiveButtonProps:Object,negativeButtonProps:Object,onPositiveClick:Function,onNegativeClick:Function}),rl=$e({name:"Popconfirm",props:eI,__popover__:!0,setup(e){const{mergedClsPrefixRef:t}=mn(),n=Ht("Popconfirm","-popconfirm",ZA,_0,e,t),s=H(null);function i(r){var o;if(!(!((o=s.value)===null||o===void 0)&&o.getMergedShow()))return;const{onPositiveClick:c,"onUpdate:show":p}=e;Promise.resolve(c?c(r):!0).then(u=>{var g;u!==!1&&((g=s.value)===null||g===void 0||g.setShow(!1),p&&Xe(p,!1))})}function a(r){var o;if(!(!((o=s.value)===null||o===void 0)&&o.getMergedShow()))return;const{onNegativeClick:c,"onUpdate:show":p}=e;Promise.resolve(c?c(r):!0).then(u=>{var g;u!==!1&&((g=s.value)===null||g===void 0||g.setShow(!1),p&&Xe(p,!1))})}return kn(yy,{mergedThemeRef:n,mergedClsPrefixRef:t,props:e}),{setShow(r){var o;(o=s.value)===null||o===void 0||o.setShow(r)},syncPosition(){var r;(r=s.value)===null||r===void 0||r.syncPosition()},mergedTheme:n,popoverInstRef:s,handlePositiveClick:i,handleNegativeClick:a}},render(){const{$slots:e,$props:t,mergedTheme:n}=this;return B(Ao,Mu(t,Tv,{theme:n.peers.Popover,themeOverrides:n.peerOverrides.Popover,internalExtraClass:["popconfirm"],ref:"popoverInstRef"}),{trigger:e.activator||e.trigger,default:()=>{const s=pc(t,Tv);return B(QA,Object.assign(Object.assign({},s),{onPositiveClick:this.handlePositiveClick,onNegativeClick:this.handleNegativeClick}),e)}})}}),tI=ze([ze("@keyframes spin-rotate",` + from { + transform: rotate(0); + } + to { + transform: rotate(360deg); + } + `),Ce("spin-container",` + position: relative; + `,[Ce("spin-body",` + position: absolute; + top: 50%; + left: 50%; + transform: translateX(-50%) translateY(-50%); + `,[y0()])]),Ce("spin-body",` + display: inline-flex; + align-items: center; + justify-content: center; + flex-direction: column; + `),Ce("spin",` + display: inline-flex; + height: var(--n-size); + width: var(--n-size); + font-size: var(--n-size); + color: var(--n-color); + `,[Ue("rotate",` + animation: spin-rotate 2s linear infinite; + `)]),Ce("spin-description",` + display: inline-block; + font-size: var(--n-font-size); + color: var(--n-text-color); + transition: color .3s var(--n-bezier); + margin-top: 8px; + `),Ce("spin-content",` + opacity: 1; + transition: opacity .3s var(--n-bezier); + pointer-events: all; + `,[Ue("spinning",` + user-select: none; + -webkit-user-select: none; + pointer-events: none; + opacity: var(--n-opacity-spinning); + `)])]),nI={small:20,medium:18,large:16},sI=Object.assign(Object.assign({},Ht.props),{contentClass:String,contentStyle:[Object,String],description:String,stroke:String,size:{type:[String,Number],default:"medium"},show:{type:Boolean,default:!0},strokeWidth:Number,rotate:{type:Boolean,default:!0},spinning:{type:Boolean,validator:()=>!0,default:void 0},delay:Number}),iI=$e({name:"Spin",props:sI,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:n}=mn(e),s=Ht("Spin","-spin",tI,b0,e,t),i=j(()=>{const{size:o}=e,{common:{cubicBezierEaseInOut:c},self:p}=s.value,{opacitySpinning:u,color:g,textColor:m}=p,y=typeof o=="number"?Gn(o):p[Mt("size",o)];return{"--n-bezier":c,"--n-opacity-spinning":u,"--n-size":y,"--n-color":g,"--n-text-color":m}}),a=n?Bn("spin",j(()=>{const{size:o}=e;return typeof o=="number"?String(o):o[0]}),i,e):void 0,d=Qu(e,["spinning","show"]),r=H(!1);return zs(o=>{let c;if(d.value){const{delay:p}=e;if(p){c=window.setTimeout(()=>{r.value=!0},p),o(()=>{clearTimeout(c)});return}}r.value=d.value}),{mergedClsPrefix:t,active:r,mergedStrokeWidth:j(()=>{const{strokeWidth:o}=e;if(o!==void 0)return o;const{size:c}=e;return nI[typeof c=="number"?"medium":c]}),cssVars:n?void 0:i,themeClass:a==null?void 0:a.themeClass,onRender:a==null?void 0:a.onRender}},render(){var e,t;const{$slots:n,mergedClsPrefix:s,description:i}=this,a=n.icon&&this.rotate,d=(i||n.description)&&B("div",{class:`${s}-spin-description`},i||((e=n.description)===null||e===void 0?void 0:e.call(n))),r=n.icon?B("div",{class:[`${s}-spin-body`,this.themeClass]},B("div",{class:[`${s}-spin`,a&&`${s}-spin--rotate`],style:n.default?"":this.cssVars},n.icon()),d):B("div",{class:[`${s}-spin-body`,this.themeClass]},B(nc,{clsPrefix:s,style:n.default?"":this.cssVars,stroke:this.stroke,"stroke-width":this.mergedStrokeWidth,class:`${s}-spin`}),d);return(t=this.onRender)===null||t===void 0||t.call(this),n.default?B("div",{class:[`${s}-spin-container`,this.themeClass],style:this.cssVars},B("div",{class:[`${s}-spin-content`,this.active&&`${s}-spin-content--spinning`,this.contentClass],style:this.contentStyle},n),B(ys,{name:"fade-in-transition"},{default:()=>this.active?r:null})):r}});async function rI(){const{data:e}=await vn("/admin/api/users");return e}async function oI(e){const{data:t}=await vn(`/admin/api/users/${encodeURIComponent(e)}/reset-password`,{method:"POST"});return t}async function aI(e){await vn(`/admin/api/users/${encodeURIComponent(e)}/disable`,{method:"POST"})}async function lI(e){await vn(`/admin/api/users/${encodeURIComponent(e)}/admin`,{method:"POST"})}async function cI(e){await vn(`/admin/api/users/${encodeURIComponent(e)}/admin`,{method:"DELETE"})}async function dI(){const{data:e}=await vn("/admin/api/invitations");return e}async function uI(e){const{data:t}=await vn("/admin/api/invitations",{method:"POST",body:JSON.stringify(e)});return t&&typeof t=="object"&&"invites"in t?t.invites:[t]}async function hI(){const{data:e}=await vn("/admin/api/config");return e}async function fI(e){const{data:t}=await vn("/admin/api/config",{method:"PUT",body:JSON.stringify(e)});return t}async function pI(){const{data:e}=await vn("/admin/api/feishu");return e}async function vI(e){const{data:t}=await vn("/admin/api/feishu",{method:"PUT",body:JSON.stringify(e)});return t}async function gI(){const{data:e}=await vn("/admin/api/feishu/generate-key",{method:"POST"});return e.encrypt_key}async function mI(e){const t=new URLSearchParams;e.view&&t.set("view",e.view),e.bucket&&t.set("bucket",e.bucket),e.from&&t.set("from",e.from),e.to&&t.set("to",e.to);const{data:n}=await vn(`/admin/api/traffic?${t.toString()}`);return n}async function _I(){const{data:e}=await vn("/admin/api/health");return e}const yI={class:"field"},bI={class:"field-label"},wI={class:"field"},SI={class:"field-label"},CI={class:"field"},kI={class:"field-label"},xI={class:"secret-msg"},RI={class:"secret-display"},TI={key:0,class:"empty"},PI=$e({__name:"Invitations",setup(e){const t=H([]),n=H(!0),s=H(!1),i=H(""),a=H(1),d=H(null),r=H([]),o=Ta(),{t:c}=Po(),p={"data-testid":"invite-note",autocomplete:"off"},u={"data-testid":"invite-count"},g={"data-testid":"invite-expires"};function m(h){return _g(h)}const y=j(()=>[{title:c("admin.invitationsTab.prefix"),key:"code_prefix",render:h=>B("code",{},h.code_prefix)},{title:c("admin.invitationsTab.note"),key:"note"},{title:c("admin.created"),key:"created_at",render:h=>m(h.created_at)},{title:c("admin.invitationsTab.expires"),key:"expires_at",render:h=>m(h.expires_at)},{title:c("admin.invitationsTab.consumed"),key:"consumed_at",render:h=>h.consumed_at?B("span",{},`${m(h.consumed_at)}${h.consumed_by?" · "+h.consumed_by:""}`):B(Mr,{size:"small",type:"default"},{default:()=>c("admin.invitationsTab.unused")})}]);async function v(){n.value=!0;try{t.value=await dI()}catch(h){h instanceof Xs&&o.error(c("admin.invitationsTab.loadFailed"))}finally{n.value=!1}}async function l(h){if(h.preventDefault(),!s.value){s.value=!0;try{const f=Math.max(1,Math.min(50,Math.round(a.value||1))),_=i.value.trim(),S={count:f};_&&(S.note=_),d.value!=null&&(S.expires_at=new Date(d.value).toISOString());const k=await uI(S);r.value=k,i.value="",d.value=null,a.value=1,await v()}catch(f){f instanceof Xs&&o.error(c("admin.invitationsTab.createFailed",{code:f.code}))}finally{s.value=!1}}}return Dt(v),(h,f)=>($(),bt(C(ic),{title:C(c)("admin.invitations"),bordered:!1},{default:jt(()=>[b("form",{onSubmit:l,autocomplete:"off",class:"create-form"},[Pe(C(Bs),{wrap:!1,align:"end"},{default:jt(()=>[b("div",yI,[b("label",bI,L(C(c)("admin.invitationsTab.note")),1),Pe(C(Ls),{value:i.value,"onUpdate:value":f[0]||(f[0]=_=>i.value=_),type:"text",placeholder:C(c)("common.optional"),"input-props":p},null,8,["value","placeholder"])]),b("div",wI,[b("label",SI,L(C(c)("admin.invitationsTab.count")),1),Pe(C(gu),{value:a.value,"onUpdate:value":f[1]||(f[1]=_=>a.value=_),min:1,max:50,"input-props":u},null,8,["value"])]),b("div",CI,[b("label",kI,L(C(c)("admin.invitationsTab.expires")),1),Pe(C(WA),{value:d.value,"onUpdate:value":f[2]||(f[2]=_=>d.value=_),type:"datetime",clearable:"",placeholder:C(c)("common.optional"),"input-props":g},null,8,["value","placeholder"])]),Pe(C(gn),{type:"primary","attr-type":"submit",loading:s.value,disabled:s.value},{default:jt(()=>[ot(L(C(c)("common.create")),1)]),_:1},8,["loading","disabled"])]),_:1})],32),($(!0),F(Oe,null,at(r.value,(_,S)=>($(),bt(C(kg),{key:S,type:"success","show-icon":!1,class:"secret-alert"},{default:jt(()=>[b("div",xI,L(C(c)("admin.invitationsTab.copyNow",{note:_.note?` (${_.note})`:""})),1),b("code",RI,L(_.plaintext),1)]),_:2},1024))),128)),Pe(C(uy),{columns:y.value,data:t.value,loading:n.value,size:"small",bordered:!1,pagination:!1},null,8,["columns","data","loading"]),!n.value&&t.value.length===0?($(),F("p",TI,L(C(c)("admin.invitationsTab.empty")),1)):Z("",!0)]),_:1},8,["title"]))}}),EI=Ct(PI,[["__scopeId","data-v-b7ce3097"]]),LI={class:"secret-msg"},DI={class:"secret-display"},MI={key:0,class:"form-error",role:"alert"},AI=$e({__name:"Users",setup(e){const t=H([]),n=H(!0),s=H(""),i=H([]);Ta();const{t:a}=Po();function d(l){return _g(l)}function r(l){if(l instanceof Xs){if(l.code==="last_admin")return a("admin.errors.lastAdmin");if(l.code==="cannot_demote_self")return a("admin.errors.cannotDemoteSelf")}return a("admin.errors.actionFailed")}async function o(){n.value=!0,s.value="";try{t.value=await rI()}catch(l){l instanceof Xs&&(s.value=a("admin.loadUsersFailed"))}finally{n.value=!1}}async function c(l){s.value="";try{await lI(l),await o()}catch(h){s.value=r(h)}}async function p(l){s.value="";try{await cI(l),await o()}catch(h){s.value=r(h)}}async function u(l,h){s.value="",i.value=[];try{const{plaintext:f}=await oI(l);i.value=[{label:a("admin.temporaryPasswordFor",{email:h}),plaintext:f}],await o()}catch(f){s.value=r(f)}}async function g(l){s.value="";try{await aI(l),await o()}catch(h){s.value=r(h)}}function m(l){return l.disabled_at?B(Mr,{size:"small",type:"error"},{default:()=>a("admin.disabled",{when:d(l.disabled_at)})}):l.is_admin?B(Mr,{size:"small",type:"success"},{default:()=>a("admin.userStatus.admin")}):B(Mr,{size:"small",type:"default"},{default:()=>a("admin.userStatus.active")})}function y(l){if(l.disabled_at)return null;const h=l.is_admin?B(rl,{onPositiveClick:()=>p(l.id)},{trigger:()=>B(gn,{size:"small","data-testid":`demote-${l.id}`},{default:()=>a("admin.demote")}),default:()=>a("admin.demoteConfirm")}):B(rl,{onPositiveClick:()=>c(l.id)},{trigger:()=>B(gn,{size:"small","data-testid":`promote-${l.id}`},{default:()=>a("admin.promote")}),default:()=>a("admin.promoteConfirm")}),f=B(rl,{onPositiveClick:()=>u(l.id,l.email)},{trigger:()=>B(gn,{size:"small","data-testid":`reset-${l.id}`},{default:()=>a("admin.resetPassword")}),default:()=>a("admin.resetPasswordConfirm")}),_=B(rl,{onPositiveClick:()=>g(l.id)},{trigger:()=>B(gn,{size:"small",type:"error","data-testid":`disable-${l.id}`},{default:()=>a("admin.disable")}),default:()=>a("admin.disableConfirm")});return B(Bs,{},{default:()=>[h,f,_]})}const v=j(()=>[{title:a("admin.email"),key:"email"},{title:a("admin.id"),key:"id",render:l=>B("code",{},l.id)},{title:a("admin.created"),key:"created_at",render:l=>d(l.created_at)},{title:a("admin.status"),key:"status",render:m},{title:a("admin.actions"),key:"actions",render:y}]);return Dt(o),(l,h)=>($(),bt(C(ic),{title:C(a)("admin.users"),bordered:!1},{default:jt(()=>[($(!0),F(Oe,null,at(i.value,(f,_)=>($(),bt(C(kg),{key:_,type:"success","show-icon":!1,class:"secret-alert"},{default:jt(()=>[b("div",LI,L(C(a)("admin.secretCopyOnce",{label:f.label})),1),b("code",DI,L(f.plaintext),1)]),_:2},1024))),128)),Pe(C(uy),{columns:v.value,data:t.value,loading:n.value,size:"small",bordered:!1,pagination:!1},null,8,["columns","data","loading"]),s.value?($(),F("p",MI,L(s.value),1)):Z("",!0)]),_:1},8,["title"]))}}),II=Ct(AI,[["__scopeId","data-v-b54d534a"]]),$I={class:"hint"},OI={class:"muted"},FI={class:"muted"},BI={class:"muted"},HI={class:"warn"},NI={class:"muted"},zI={class:"muted version"},UI={key:1,class:"form-error",role:"alert"},VI=$e({__name:"Config",setup(e){const t=H(null),n=H(0),s=H(0),i=H(!1),a=H(!1),d=H(""),r=H(!0),o=H(!1),c=H(""),p=Ta(),{t:u}=Po();function g(S){return S.split(` +`).map(k=>k.trim()).filter(Boolean)}function m(S,k){return S<0?u("admin.config.effectiveDisabled"):S===0?u("admin.config.effective",{value:k}):u("admin.config.effective",{value:S})}const y=j(()=>t.value?m(n.value,t.value.default_rate_limit_per_minute):""),v=j(()=>t.value?m(s.value,t.value.default_max_connections_per_key):"");async function l(){r.value=!0,c.value="";try{const S=await hI();t.value=S,n.value=S.rate_limit_per_minute,s.value=S.max_connections_per_key,i.value=S.debug,a.value=S.debug_payload,d.value=(S.allowed_origins??[]).join(` +`)}catch(S){S instanceof Xs&&(c.value=u("admin.config.loadFailed"))}finally{r.value=!1}}async function h(){if(!(!t.value||o.value)){c.value="",o.value=!0;try{const S=await fI({rate_limit_per_minute:Math.round(n.value),max_connections_per_key:Math.round(s.value),debug:i.value,debug_payload:a.value,allowed_origins:g(d.value)});t.value=S,n.value=S.rate_limit_per_minute,s.value=S.max_connections_per_key,i.value=S.debug,a.value=S.debug_payload,d.value=(S.allowed_origins??[]).join(` +`),p.success(u("setup.saved"))}catch(S){S instanceof Xs&&(c.value=u("admin.config.saveFailed"))}finally{o.value=!1}}}const f={"data-testid":"cfg-rate"},_={"data-testid":"cfg-conn"};return Dt(l),(S,k)=>($(),bt(C(ic),{title:C(u)("admin.config.runtimeLimits"),bordered:!1},{default:jt(()=>[b("p",$I,L(C(u)("admin.config.hint")),1),t.value?($(),bt(C(yg),{key:0,"label-placement":"top","require-mark-placement":"right-hanging"},{default:jt(()=>[Pe(C(Ji),{label:C(u)("admin.config.rateLimit"),"show-feedback":!1},{default:jt(()=>[Pe(C(Bs),{wrap:!1,align:"center"},{default:jt(()=>[Pe(C(gu),{value:n.value,"onUpdate:value":k[0]||(k[0]=P=>n.value=P),"show-button":!1,"input-props":f},null,8,["value"]),b("span",OI,L(y.value),1)]),_:1})]),_:1},8,["label"]),Pe(C(Ji),{label:C(u)("admin.config.maxConnections"),"show-feedback":!1},{default:jt(()=>[Pe(C(Bs),{wrap:!1,align:"center"},{default:jt(()=>[Pe(C(gu),{value:s.value,"onUpdate:value":k[1]||(k[1]=P=>s.value=P),"show-button":!1,"input-props":_},null,8,["value"]),b("span",FI,L(v.value),1)]),_:1})]),_:1},8,["label"]),Pe(C(Ji),{label:C(u)("admin.config.debug"),"show-feedback":!1},{default:jt(()=>[Pe(C(Bs),{align:"center",size:8},{default:jt(()=>[Pe(C(Cl),{value:i.value,"onUpdate:value":k[2]||(k[2]=P=>i.value=P),"data-testid":"cfg-debug"},null,8,["value"]),b("span",BI,L(C(u)("admin.config.debugHint")),1)]),_:1})]),_:1},8,["label"]),Pe(C(Ji),{label:C(u)("admin.config.debugPayload"),"show-feedback":!1},{default:jt(()=>[Pe(C(Bs),{align:"center",size:8},{default:jt(()=>[Pe(C(Cl),{value:a.value,"onUpdate:value":k[3]||(k[3]=P=>a.value=P),"data-testid":"cfg-debug-payload"},null,8,["value"]),b("span",HI,L(C(u)("admin.config.debugPayloadWarn")),1)]),_:1})]),_:1},8,["label"]),Pe(C(Ji),{label:C(u)("admin.config.allowedOrigins"),"show-feedback":!1},{default:jt(()=>[Pe(C(Bs),{vertical:"",size:4,style:{width:"100%"}},{default:jt(()=>[Pe(C(Ls),{value:d.value,"onUpdate:value":k[4]||(k[4]=P=>d.value=P),type:"textarea",placeholder:C(u)("admin.config.allowedOriginsPlaceholder"),autosize:{minRows:3,maxRows:10},"input-props":{"data-testid":"cfg-origins"}},null,8,["value","placeholder"]),b("span",NI,L(C(u)("admin.config.allowedOriginsHint")),1)]),_:1})]),_:1},8,["label"]),Pe(C(Bs),{class:"actions",align:"center"},{default:jt(()=>[Pe(C(gn),{type:"primary",loading:o.value,disabled:o.value,"data-testid":"cfg-save",onClick:h},{default:jt(()=>[ot(L(C(u)("common.save")),1)]),_:1},8,["loading","disabled"]),b("span",zI,[ot(L(C(u)("common.version"))+": ",1),b("code",null,L(t.value.version),1)])]),_:1})]),_:1})):Z("",!0),c.value?($(),F("p",UI,L(c.value),1)):Z("",!0)]),_:1},8,["title"]))}}),KI=Ct(VI,[["__scopeId","data-v-be878b2d"]]),WI={class:"hint"},jI={key:0,class:"warn"},qI={class:"muted"},YI={class:"muted"},GI={key:1,class:"form-error",role:"alert"},XI=$e({__name:"FeishuConfig",setup(e){const t=H(null),n=H(!1),s=H(""),i=H(""),a=H(!1),d=H(!0),r=H(!1),o=H(""),c=Ta(),{t:p}=Po();async function u(){d.value=!0,o.value="";try{const v=await pI();g(v)}catch(v){v instanceof Xs&&(o.value=p("admin.feishuConfig.loadFailed"))}finally{d.value=!1}}function g(v){t.value=v,n.value=v.enabled,s.value=v.base_url,i.value="",a.value=!1}async function m(){o.value="";try{i.value=await gI(),c.info(p("admin.feishuConfig.keyGenerated"))}catch(v){v instanceof Xs&&(o.value=p("admin.feishuConfig.saveFailed"))}}async function y(){if(!r.value){o.value="",r.value=!0;try{const v={enabled:n.value},l=i.value.trim();l&&(v.encrypt_key=l);const h=s.value.trim();h&&(v.base_url=h),a.value&&(v.force=!0);const f=await vI(v);g(f),c.success(p("setup.saved"))}catch(v){v instanceof Xs&&(o.value=v.status===409?p("admin.feishuConfig.rotateConflict"):p("admin.feishuConfig.saveFailed"))}finally{r.value=!1}}}return Dt(u),(v,l)=>($(),bt(C(ic),{title:C(p)("admin.feishuConfig.title"),bordered:!1},{default:jt(()=>[b("p",WI,L(C(p)("admin.feishuConfig.description")),1),t.value?($(),bt(C(yg),{key:0,"label-placement":"top"},{default:jt(()=>[Pe(C(Ji),{label:C(p)("admin.feishuConfig.enabled"),"show-feedback":!1},{default:jt(()=>[Pe(C(Cl),{value:n.value,"onUpdate:value":l[0]||(l[0]=h=>n.value=h),"data-testid":"feishu-enabled"},null,8,["value"])]),_:1},8,["label"]),Pe(C(Ji),{label:C(p)("admin.feishuConfig.encryptKey"),"show-feedback":!1},{default:jt(()=>[Pe(C(Bs),{vertical:"",size:6,style:{width:"100%"}},{default:jt(()=>[Pe(C(Bs),{wrap:!1,align:"center",style:{width:"100%"}},{default:jt(()=>[Pe(C(Ls),{value:i.value,"onUpdate:value":l[1]||(l[1]=h=>i.value=h),type:"password","show-password-on":"click",placeholder:t.value.key_set?C(p)("admin.feishuConfig.keyKeepPlaceholder",{last4:t.value.key_last4??""}):C(p)("admin.feishuConfig.keyEmptyPlaceholder"),"data-testid":"feishu-key"},null,8,["value","placeholder"]),Pe(C(gn),{tertiary:"","data-testid":"feishu-generate",onClick:m},{default:jt(()=>[ot(L(C(p)("admin.feishuConfig.generate")),1)]),_:1})]),_:1}),i.value?($(),F("span",jI,L(C(p)("admin.feishuConfig.keyCopyOnce")),1)):Z("",!0),i.value&&t.value.key_set?($(),bt(C(Bs),{key:1,align:"center",size:8},{default:jt(()=>[Pe(C(Cl),{value:a.value,"onUpdate:value":l[2]||(l[2]=h=>a.value=h),size:"small","data-testid":"feishu-force"},null,8,["value"]),b("span",qI,L(C(p)("admin.feishuConfig.forceRotate")),1)]),_:1})):Z("",!0)]),_:1})]),_:1},8,["label"]),Pe(C(Ji),{label:C(p)("admin.feishuConfig.baseUrl"),"show-feedback":!1},{default:jt(()=>[Pe(C(Ls),{value:s.value,"onUpdate:value":l[3]||(l[3]=h=>s.value=h),placeholder:"https://open.feishu.cn","data-testid":"feishu-base"},null,8,["value"])]),_:1},8,["label"]),Pe(C(Bs),{class:"actions",align:"center"},{default:jt(()=>[Pe(C(gn),{type:"primary",loading:r.value,disabled:r.value,"data-testid":"feishu-save",onClick:y},{default:jt(()=>[ot(L(C(p)("common.save")),1)]),_:1},8,["loading","disabled"]),b("span",YI,L(t.value.running?C(p)("admin.feishuConfig.statusRunning"):C(p)("admin.feishuConfig.statusStopped")),1)]),_:1})]),_:1})):Z("",!0),o.value?($(),F("p",GI,L(o.value),1)):Z("",!0)]),_:1},8,["title"]))}}),JI=Ct(XI,[["__scopeId","data-v-b32379d1"]]),Yl={terminal:"#58a6ff",state:"#39c5cf",filesystem:"#bc8cff",service:"#db6d28",control:"#d29922",other:"#8b949e"},Pv=["#58a6ff","#39c5cf","#bc8cff","#db6d28","#d29922","#3fb950","#f85149","#79c0ff"];function QI(e){return new Date(`${e}T00:00:00Z`)}function wy(e){return e.toISOString().slice(0,10)}function yl(e,t){const n=QI(e);return n.setUTCDate(n.getUTCDate()+t),wy(n)}function Ev(e,t){const n=[];for(let s=e;s<=t;s=yl(s,1))n.push(s);return n}function Lv(e,t=new Date){const n=wy(t),s=yl(n,-(e-1)),i=yl(s,-e);return{from:i,currentFrom:s,to:n,days:Ev(s,n),previousDays:Ev(i,yl(s,-1))}}function mu(e){const t=new Map;for(const n of e)t.set(n.user_id,n.email||n.user_id);return[...t].map(([n,s])=>({id:n,email:s})).sort((n,s)=>n.email.localeCompare(s.email))}function Dv(e,t,n){return e.filter(s=>t.has(s.user_id)&&!!s.day&&n.has(s.day))}function _c(e,t){return t==="bytes"?e.bytes:e.frames}function Ps(e,t){return e.reduce((n,s)=>n+_c(s,t),0)}function ta(e,t){return t===0?e===0?0:null:(e-t)/t*100}function ZI(e,t,n){const s=new Set(n.days),i=new Set(n.previousDays),d=mu(e).filter(o=>t.has(o.id)).map(o=>{const c=e.filter(y=>y.user_id===o.id),p=c.filter(y=>!!y.day&&s.has(y.day)),u=c.filter(y=>!!y.day&&i.has(y.day)),g=Ps(p,"bytes"),m=Ps(u,"bytes");return{id:o.id,email:o.email,bytes:g,frames:Ps(p,"frames"),outbound:Ps(p.filter(y=>y.direction===1),"bytes"),inbound:Ps(p.filter(y=>y.direction===0),"bytes"),previousBytes:m,trend:ta(g,m),share:0,activeDays:new Set(p.map(y=>y.day)).size}}),r=d.reduce((o,c)=>o+c.bytes,0);for(const o of d)o.share=r?o.bytes/r*100:0;return d.sort((o,c)=>c.bytes-o.bytes||o.email.localeCompare(c.email))}function e$(e){const t=new Map;for(const s of e){const i=s.category||"other",a=t.get(i)||{key:i,label:i,color:Yl[i]||Yl.other,bytes:0,frames:0,outbound:0,inbound:0};a.bytes+=s.bytes,a.frames+=s.frames,s.direction===1?a.outbound+=s.bytes:a.inbound+=s.bytes,t.set(i,a)}const n=[...t.values()].reduce((s,i)=>s+i.bytes,0);return[...t.values()].map(s=>({...s,share:n?s.bytes/n*100:0})).sort((s,i)=>i.bytes-s.bytes)}function t$(e,t){if(t==="group"){const s=e.category||"other";return{key:s,label:s,category:s}}const n=e.frame_type_name||String(e.frame_type??"?");return{key:String(e.frame_type??n),label:n,category:e.category||"other"}}function n$(e,t,n,s,i,a){const d=new Map(t.map((o,c)=>[o,c])),r=new Map;for(const o of e){const c=o.day?d.get(o.day):void 0;if(c===void 0||s==="out"&&o.direction!==1||s==="in"&&o.direction!==0)continue;const p=t$(o,n),u=a?`${o.user_id}:${p.key}`:p.key;let g=r.get(u);g||(g={key:u,label:p.label,userID:a?o.user_id:void 0,userLabel:a?o.email||o.user_id:void 0,category:p.category,color:n==="group"?Yl[p.category]||Yl.other:Pv[r.size%Pv.length],values:Array(t.length).fill(0),total:0},r.set(u,g));const m=_c(o,i);g.values[c]+=m,g.total+=m}return[...r.values()].sort((o,c)=>c.total-o.total)}function s$(e,t,n){const s=new Map(t.map((d,r)=>[d,r])),i=Array(t.length).fill(0),a=Array(t.length).fill(0);for(const d of e){const r=d.day?s.get(d.day):void 0;r!==void 0&&((d.direction===1?a:i)[r]+=_c(d,n))}return{inbound:i,outbound:a}}function Mv(e,t,n){const s=Array(t.length).fill(0),i=new Map(t.map((a,d)=>[a,d]));for(const a of e){const d=a.day?i.get(a.day):void 0;d!==void 0&&(s[d]+=_c(a,n))}return s}const i$={class:"traffic-dashboard"},r$={class:"traffic-titlebar"},o$=["aria-label","title","disabled"],a$={class:"scope-section platform-section"},l$={class:"scope-heading"},c$={class:"platform-strip","data-test":"platform-status"},d$={class:"platform-cell platform-health"},u$={class:"platform-cell"},h$={class:"platform-cell"},f$={class:"platform-cell"},p$={class:"scope-section user-section"},v$={class:"user-heading"},g$={class:"filterbar"},m$=["aria-label"],_$=["data-test","onClick"],y$={key:0},b$={key:1},w$={key:2},S$=["aria-label"],C$={class:"selector-head"},k$={class:"search-box"},x$=["placeholder"],R$={class:"selector-options"},T$=["checked","onChange"],P$=["data-test","onClick"],E$={key:0},L$={class:"selector-foot"},D$={key:0,class:"selection-empty","data-test":"traffic-selection-empty"},M$={key:0,class:"selection-banner"},A$=["aria-label"],I$={class:"kpi-strip"},$$={class:"timeline-panel"},O$={class:"panel-head timeline-head"},F$={class:"timeline-controls"},B$={class:"segmented"},H$={key:0},N$={class:"segmented"},z$=["onClick"],U$={class:"segmented"},V$={class:"chart-meta"},K$={key:0,class:"chart-empty"},W$={key:1,class:"svg-chart","data-test":"direction-chart"},j$=["aria-label"],q$={class:"grid-lines"},Y$=["y1","y2"],G$=["points"],X$=["points"],J$=["x"],Q$={class:"legend"},Z$={key:2,class:"matrix-chart","data-test":"matrix-chart"},e4=["title"],t4={class:"matrix-cells"},n4=["title"],s4={key:3,class:"bar-chart","data-test":"stacked-chart"},i4={class:"bar-stack"},r4=["title"],o4={key:4,class:"series-legend"},a4={key:5,class:"timeline-table-wrap"},l4={class:"timeline-table"},c4={class:"lower-grid"},d4={class:"flat-panel category-panel"},u4={class:"panel-head"},h4={class:"category-list"},f4=["onClick"],p4={class:"category-name"},v4={class:"meter"},g4={class:"category-value"},m4={class:"flat-panel user-table-panel"},_4={class:"panel-head table-panel-head"},y4={class:"data-table-wrap"},b4={class:"data-table","data-test":"traffic-user-table"},w4={class:"share"},S4=["aria-label","data-test","onClick"],C4={class:"diagnostics"},k4={class:"panel-head"},x4={class:"diagnostic-grid"},R4={class:"diagnostic-block"},T4=["title"],P4=["title"],E4={class:"diagnostic-block"},L4={class:"density-list"},D4={class:"user-drawer"},M4={class:"drawer-head"},A4=["aria-label"],I4={class:"drawer-kpis"},$4={class:"drawer-bars"},O4=["title"],F4=$e({__name:"Traffic",setup(e){const{t}=Po(),n=Ta(),s=H([]),i=H(null),a=H(!1),d=H(7),r=H("bytes"),o=H("group"),c=H("all"),p=H([]),u=H(!1),g=H(!1),m=H(""),y=H(null),v=H("all"),l=H(null),h=H(null),f=j(()=>Lv(d.value)),_=j(()=>mu(s.value)),S=j(()=>new Set(p.value)),k=j(()=>Dv(s.value,S.value,new Set(f.value.days))),P=j(()=>Dv(s.value,S.value,new Set(f.value.previousDays))),M=j(()=>_.value.filter(se=>S.value.has(se.id))),w=j(()=>{const se=m.value.trim().toLowerCase();return _.value.filter(de=>!se||de.email.toLowerCase().includes(se)||de.id.toLowerCase().includes(se))}),T=j(()=>_.value.length>0&&p.value.length===_.value.length),A=j(()=>Ps(k.value,"bytes")),E=j(()=>Ps(k.value,"frames")),R=j(()=>Ps(k.value.filter(se=>se.direction===1),"bytes")),D=j(()=>Ps(k.value.filter(se=>se.direction===0),"bytes")),I=j(()=>Ps(P.value,"bytes")),O=j(()=>Ps(P.value,"frames")),U=j(()=>Ps(P.value.filter(se=>se.direction===1),"bytes")),W=j(()=>Ps(P.value.filter(se=>se.direction===0),"bytes")),z=j(()=>[{key:"total",label:t("admin.traffic.kpiTotal"),value:x(A.value),trend:ta(A.value,I.value)},{key:"out",label:t("admin.traffic.kpiOutbound"),value:x(R.value),trend:ta(R.value,U.value)},{key:"in",label:t("admin.traffic.kpiInbound"),value:x(D.value),trend:ta(D.value,W.value)},{key:"frames",label:t("admin.traffic.kpiFrames"),value:Re(E.value),trend:ta(E.value,O.value)}]),N=j(()=>e$(k.value)),V=j(()=>o.value==="direction"?[]:n$(k.value,f.value.days,o.value,c.value,r.value,M.value.length>1)),q=j(()=>s$(k.value,f.value.days,r.value)),G=j(()=>Math.max(1,...V.value.flatMap(se=>se.values),...q.value.inbound,...q.value.outbound)),te=j(()=>Math.max(1,...f.value.days.map((se,de)=>V.value.reduce((Le,Ae)=>Le+Ae.values[de],0)))),oe=j(()=>V.value.slice(0,28)),ie=j(()=>M.value.length>1&&o.value!=="direction"),ye=j(()=>{const se=v.value==="all"?s.value:s.value.filter(de=>(de.category||"other")===v.value);return ZI(se,S.value,f.value)}),K=j(()=>ye.value.map(se=>({label:`${se.email} · ${se.id}`,value:se.id}))),J=j(()=>y.value?ye.value.filter(se=>se.id===y.value):ye.value),Q=j(()=>J.value.find(se=>se.id===l.value)||null),ce=j(()=>k.value.filter(se=>se.user_id===l.value)),Fe=j(()=>Mv(ce.value,f.value.days,"bytes")),Ee=j(()=>Math.max(1,...Fe.value)),Ye=j(()=>{const se=new Map;for(const de of ce.value){const Le=de.frame_type_name||String(de.frame_type??"?"),Ae=se.get(Le)||{name:Le,category:de.category||"other",bytes:0,frames:0};Ae.bytes+=de.bytes,Ae.frames+=de.frames,se.set(Le,Ae)}return[...se.values()].sort((de,Le)=>Le.bytes-de.bytes).slice(0,8)}),Ze=j(()=>J.value.slice(0,12).map(se=>{const de=k.value.filter(Le=>Le.user_id===se.id);return{user:se,values:Mv(de,f.value.days,"bytes")}})),ue=j(()=>Math.max(1,...Ze.value.flatMap(se=>se.values))),et=j(()=>N.value.map(se=>({...se,density:se.frames?se.bytes/se.frames:0})).sort((se,de)=>de.density-se.density)),re=j(()=>Math.max(1,...et.value.map(se=>se.density)));async function we(){a.value=!0;const se=Lv(d.value);try{const[de,Le]=await Promise.allSettled([mI({view:"detail",bucket:"day",from:se.from,to:se.to}),_I()]);if(de.status==="rejected")throw de.reason;const Ae=de.value,ct=Le.status==="fulfilled"?Le.value:null;s.value=Ae.rows,i.value=ct;const ve=mu(Ae.rows).map(Be=>Be.id);if(!u.value)p.value=ve,u.value=!0;else{const Be=new Set(ve);p.value=p.value.filter(me=>Be.has(me))}}catch(de){de instanceof Xs&&n.error(t("admin.traffic.loadFailed")),s.value=[]}finally{a.value=!1}}function fe(se){d.value!==se&&(d.value=se,v.value="all",we())}function De(se){o.value=se}function Qe(se){p.value=S.value.has(se)?p.value.filter(de=>de!==se):[...p.value,se]}function We(se){p.value=[se]}function ae(){p.value=_.value.map(se=>se.id)}function _e(){p.value=[]}function be(se){var de;g.value&&!((de=h.value)!=null&&de.contains(se.target))&&(g.value=!1)}function Me(se){return se===null?t("admin.traffic.trendNew"):Math.abs(se)<.05?t("admin.traffic.trendFlat"):`${se>0?"+":""}${se.toFixed(1)}%`}function x(se){const de=["B","KB","MB","GB","TB"];let Le=se,Ae=0;for(;Le>=1024&&Ae=100?0:Le>=10?1:2)} ${de[Ae]}`}function Re(se){return new Intl.NumberFormat(void 0,{notation:se>=1e4?"compact":"standard",maximumFractionDigits:1}).format(se)}function Ge(se){return r.value==="bytes"?x(se):Re(se)}function Ve(se){const de=t(`admin.traffic.categories.${se}`);return de===`admin.traffic.categories.${se}`?se:de}function kt(se){return se.slice(5).replace("-","/")}function Je(se){const de=Math.max(1,se.length-1);return se.map((Le,Ae)=>`${64+Ae/de*904},${276-Le/G.value*224}`).join(" ")}function wt(se){return`rgba(88, 166, 255, ${se===0?.06:.18+se/G.value*.72})`}function tt(se){return`rgba(57, 197, 207, ${se===0?.05:.18+se/ue.value*.72})`}async function mt(se){l.value=se,await cn()}return Dt(()=>{document.addEventListener("pointerdown",be),we()}),Vt(()=>document.removeEventListener("pointerdown",be)),(se,de)=>($(),F("div",i$,[b("div",r$,[b("div",null,[b("h1",null,L(C(t)("admin.traffic.title")),1),b("p",null,L(C(t)("admin.traffic.timezone")),1)]),b("button",{class:"icon-button",type:"button","aria-label":C(t)("admin.traffic.refresh"),title:C(t)("admin.traffic.refresh"),disabled:a.value,"data-test":"traffic-refresh",onClick:we},[Pe(C(Dg),{class:lt({spinning:a.value})},null,8,["class"])],8,o$)]),Pe(C(iI),{show:a.value},{default:jt(()=>{var Le,Ae,ct,ve,Be;return[b("section",a$,[b("div",l$,[b("div",null,[b("span",null,L(C(t)("admin.traffic.platformScope")),1),b("h2",null,L(C(t)("admin.traffic.platformStatus")),1)]),b("small",null,[Pe(C(gw)),ot(L(C(t)("admin.traffic.globalRealtime")),1)])]),b("div",c$,[b("div",d$,[b("span",null,[Pe(C(Jh)),ot(L(C(t)("admin.traffic.relayStatus")),1)]),b("strong",null,L(i.value?C(t)("admin.traffic.online"):C(t)("admin.traffic.unknown")),1),b("small",null,L(((Le=i.value)==null?void 0:Le.version)||"-"),1)]),b("div",u$,[b("span",null,[Pe(C(to)),ot(L(C(t)("admin.traffic.activeSessions")),1)]),b("strong",null,L(((Ae=i.value)==null?void 0:Ae.active_sessions)??"-"),1),b("small",null,L(C(t)("admin.traffic.liveValue")),1)]),b("div",h$,[b("span",null,[Pe(C(ul)),ot(L(C(t)("admin.traffic.relayInstances")),1)]),b("strong",null,L(((ct=i.value)==null?void 0:ct.relay_instances)??"-"),1),b("small",null,L(C(t)("admin.traffic.liveInstances")),1)]),b("div",f$,[b("span",null,[Pe(C(fw)),ot(L(C(t)("admin.traffic.activeUplinks")),1)]),b("strong",null,L(((ve=i.value)==null?void 0:ve.active_uplinks)??"-"),1),b("small",null,L(C(t)("admin.traffic.flushEvery",{seconds:((Be=i.value)==null?void 0:Be.traffic_flush_interval_seconds)??60})),1)])])]),b("section",p$,[b("div",v$,[b("div",null,[b("span",null,L(C(t)("admin.traffic.userScope")),1),b("h2",null,L(C(t)("admin.traffic.userAnalysis")),1)]),b("div",g$,[b("div",{class:"segmented",role:"group","aria-label":C(t)("admin.traffic.range")},[($(),F(Oe,null,at([7,30,90],me=>b("button",{key:me,type:"button",class:lt({active:d.value===me}),"data-test":`range-${me}`,onClick:rt=>fe(me)},L(C(t)("admin.traffic.days",{days:me})),11,_$)),64))],8,m$),b("div",{ref_key:"selectorRoot",ref:h,class:"user-selector"},[b("button",{class:lt(["selector-trigger",{active:g.value}]),type:"button","data-test":"user-filter-trigger",onClick:de[0]||(de[0]=me=>g.value=!g.value)},[Pe(C(Fc)),T.value?($(),F("span",y$,L(C(t)("admin.traffic.allUsers")),1)):M.value.length===1?($(),F("span",b$,L(M.value[0].email),1)):($(),F("span",w$,L(C(t)("admin.traffic.selectedUsers",{selected:M.value.length,total:_.value.length})),1)),Pe(C(lw))],2),g.value?($(),F("div",{key:0,class:"selector-popover",role:"dialog","aria-label":C(t)("admin.traffic.filterUsers")},[b("div",C$,[b("div",null,[b("strong",null,L(C(t)("admin.traffic.filterUsers")),1),b("span",null,L(C(t)("admin.traffic.selectedCount",{selected:M.value.length,total:_.value.length})),1)]),b("button",{type:"button","data-test":"toggle-all-users",onClick:de[1]||(de[1]=me=>T.value?_e():ae())},L(T.value?C(t)("admin.traffic.clearAll"):C(t)("admin.traffic.selectAll")),1)]),b("label",k$,[Pe(C(Mg)),it(b("input",{"onUpdate:modelValue":de[2]||(de[2]=me=>m.value=me),placeholder:C(t)("admin.traffic.searchUsers")},null,8,x$),[[Pt,m.value]])]),b("div",R$,[($(!0),F(Oe,null,at(w.value,me=>($(),F("div",{key:me.id,class:"selector-option"},[b("label",null,[b("input",{type:"checkbox",checked:S.value.has(me.id),onChange:rt=>Qe(me.id)},null,40,T$),b("span",null,[b("strong",null,L(me.email),1),b("small",null,L(me.id),1)])]),b("button",{type:"button","data-test":`only-${me.id}`,onClick:rt=>We(me.id)},L(C(t)("admin.traffic.only")),9,P$)]))),128)),w.value.length?Z("",!0):($(),F("p",E$,L(C(t)("admin.traffic.noUserMatch")),1))]),b("div",L$,[b("button",{type:"button","data-test":"restore-users",onClick:ae},L(C(t)("admin.traffic.restoreAll")),1),b("button",{class:"primary",type:"button",onClick:de[3]||(de[3]=me=>g.value=!1)},L(C(t)("admin.traffic.done")),1)])],8,S$)):Z("",!0)],512)])]),M.value.length?($(),F(Oe,{key:1},[T.value?Z("",!0):($(),F("div",M$,[Pe(C(Fc)),b("strong",null,L(C(t)("admin.traffic.selectedUserCount",{count:M.value.length})),1),b("span",null,L(M.value.slice(0,3).map(me=>me.email).join(", ")),1),b("button",{type:"button","aria-label":C(t)("admin.traffic.restoreAll"),onClick:ae},[Pe(C(ii))],8,A$)])),b("div",I$,[($(!0),F(Oe,null,at(z.value,me=>($(),F("div",{key:me.key,class:"kpi-cell"},[b("span",null,L(me.label),1),b("div",null,[b("strong",null,L(me.value),1),b("small",{class:lt({up:me.trend!==null&&me.trend>0,down:me.trend!==null&&me.trend<0})},[me.trend!==null&&me.trend>0?($(),bt(C(aw),{key:0})):me.trend!==null&&me.trend<0?($(),bt(C(ow),{key:1})):($(),bt(C(pw),{key:2})),ot(L(Me(me.trend)),1)],2)])]))),128))]),b("section",$$,[b("div",O$,[b("div",null,[b("span",null,L(C(t)("admin.traffic.coreAnalysis")),1),b("h3",null,L(C(t)("admin.traffic.timelineTitle")),1),b("p",null,L(C(t)("admin.traffic.timelineScope",{count:M.value.length})),1)]),b("div",F$,[b("div",null,[b("small",null,L(C(t)("admin.traffic.view")),1),b("div",B$,[b("button",{type:"button",class:lt({active:o.value==="group"}),"data-test":"view-group",onClick:de[4]||(de[4]=me=>De("group"))},L(C(t)("admin.traffic.groupTimeline")),3),b("button",{type:"button",class:lt({active:o.value==="frame"}),"data-test":"view-frame",onClick:de[5]||(de[5]=me=>De("frame"))},L(C(t)("admin.traffic.frameTimeline")),3),b("button",{type:"button",class:lt({active:o.value==="direction"}),"data-test":"view-direction",onClick:de[6]||(de[6]=me=>De("direction"))},L(C(t)("admin.traffic.directionTrend")),3)])]),o.value!=="direction"?($(),F("div",H$,[b("small",null,L(C(t)("admin.traffic.colDirection")),1),b("div",N$,[($(),F(Oe,null,at(["all","out","in"],me=>b("button",{key:me,type:"button",class:lt({active:c.value===me}),onClick:rt=>c.value=me},L(C(t)(`admin.traffic.direction.${me}`)),11,z$)),64))])])):Z("",!0),b("div",null,[b("small",null,L(C(t)("admin.traffic.metric")),1),b("div",U$,[b("button",{type:"button",class:lt({active:r.value==="bytes"}),"data-test":"metric-bytes",onClick:de[7]||(de[7]=me=>r.value="bytes")},L(C(t)("admin.traffic.bytes")),3),b("button",{type:"button",class:lt({active:r.value==="frames"}),"data-test":"metric-frames",onClick:de[8]||(de[8]=me=>r.value="frames")},L(C(t)("admin.traffic.frames")),3)])])])]),b("div",V$,[b("span",null,L(ie.value?C(t)("admin.traffic.multiUserMatrix"):o.value==="direction"?C(t)("admin.traffic.directionTrend"):C(t)("admin.traffic.stackedTimeline")),1),b("small",null,L(C(t)("admin.traffic.bucketCount",{count:f.value.days.length})),1)]),k.value.length?o.value==="direction"?($(),F("div",W$,[($(),F("svg",{viewBox:"0 0 1000 320",preserveAspectRatio:"none",role:"img","aria-label":C(t)("admin.traffic.directionTrend")},[b("g",q$,[($(),F(Oe,null,at([52,108,164,220,276],me=>b("line",{key:me,x1:"64",y1:me,x2:"968",y2:me},null,8,Y$)),64))]),b("polyline",{class:"line outbound",points:Je(q.value.outbound)},null,8,G$),b("polyline",{class:"line inbound",points:Je(q.value.inbound)},null,8,X$),($(!0),F(Oe,null,at(f.value.days,(me,rt)=>($(),F("g",{key:me},[rt===0||rt===f.value.days.length-1||rt%Math.max(1,Math.floor(f.value.days.length/6))===0?($(),F("text",{key:0,x:64+rt/Math.max(1,f.value.days.length-1)*904,y:"305","text-anchor":"middle"},L(kt(me)),9,J$)):Z("",!0)]))),128))],8,j$)),b("div",Q$,[b("span",null,[de[13]||(de[13]=b("i",{class:"outbound"},null,-1)),ot(L(C(t)("admin.traffic.dirOut")),1)]),b("span",null,[de[14]||(de[14]=b("i",{class:"inbound"},null,-1)),ot(L(C(t)("admin.traffic.dirIn")),1)])])])):ie.value?($(),F("div",Z$,[b("div",{class:"matrix-grid",style:nn({"--columns":String(f.value.days.length)})},[($(!0),F(Oe,null,at(oe.value,me=>($(),F(Oe,{key:me.key},[b("div",{class:"matrix-label",title:`${me.userLabel} · ${Ve(me.label)}`},[b("strong",null,L(me.userLabel),1),b("span",null,L(o.value==="group"?Ve(me.label):me.label),1)],8,e4),b("div",t4,[($(!0),F(Oe,null,at(me.values,(rt,At)=>($(),F("i",{key:At,style:nn({background:wt(rt)}),title:`${me.userLabel} · ${me.label} · ${f.value.days[At]} · ${Ge(rt)}`},null,12,n4))),128))])],64))),128))],4),b("div",{class:"matrix-axis",style:nn({"--columns":String(f.value.days.length)})},[($(!0),F(Oe,null,at(f.value.days,me=>($(),F("span",{key:me},L(kt(me)),1))),128))],4)])):($(),F("div",s4,[($(!0),F(Oe,null,at(f.value.days,(me,rt)=>($(),F("div",{key:me,class:"bar-column"},[b("div",i4,[($(!0),F(Oe,null,at(V.value.slice(0,8),At=>($(),F("i",{key:At.key,style:nn({height:`${At.values[rt]/te.value*100}%`,background:At.color}),title:`${At.label} · ${Ge(At.values[rt])}`},null,12,r4))),128))]),b("span",null,L(kt(me)),1)]))),128))])):($(),F("div",K$,L(C(t)("admin.traffic.empty")),1)),o.value!=="direction"&&k.value.length?($(),F("div",o4,[($(!0),F(Oe,null,at(V.value.slice(0,8),me=>($(),F("span",{key:me.key},[b("i",{style:nn({background:me.color})},null,4),ot(L(o.value==="group"?Ve(me.label):me.label),1)]))),128))])):Z("",!0),o.value!=="direction"&&V.value.length?($(),F("div",a4,[b("table",l4,[b("thead",null,[b("tr",null,[b("th",null,L(C(t)("admin.traffic.colUser")),1),b("th",null,L(o.value==="group"?C(t)("admin.traffic.colCategory"):C(t)("admin.traffic.colFrameType")),1),b("th",null,L(C(t)("admin.traffic.total")),1),($(!0),F(Oe,null,at(f.value.days,me=>($(),F("th",{key:me},L(kt(me)),1))),128))])]),b("tbody",null,[($(!0),F(Oe,null,at(V.value.slice(0,16),me=>($(),F("tr",{key:me.key},[b("td",null,L(me.userLabel||C(t)("admin.traffic.selectedAggregate")),1),b("td",null,L(o.value==="group"?Ve(me.label):me.label),1),b("td",null,L(Ge(me.total)),1),($(!0),F(Oe,null,at(me.values,(rt,At)=>($(),F("td",{key:At},L(Ge(rt)),1))),128))]))),128))])])])):Z("",!0)]),b("div",c4,[b("section",d4,[b("div",u4,[b("div",null,[b("h3",null,L(C(t)("admin.traffic.categorySummary")),1),b("p",null,L(C(t)("admin.traffic.totalComposition")),1)]),v.value!=="all"?($(),F("button",{key:0,type:"button",onClick:de[9]||(de[9]=me=>v.value="all")},L(C(t)("admin.traffic.clear")),1)):Z("",!0)]),b("div",h4,[($(!0),F(Oe,null,at(N.value,me=>($(),F("button",{key:me.key,type:"button",class:lt({active:v.value===me.key}),onClick:rt=>v.value=v.value===me.key?"all":me.key},[b("span",p4,[b("i",{style:nn({background:me.color})},null,4),b("strong",null,L(Ve(me.key)),1),b("em",null,L(me.share.toFixed(1))+"%",1)]),b("span",v4,[b("i",{style:nn({width:`${me.share}%`,background:me.color})},null,4)]),b("span",g4,[b("strong",null,L(x(me.bytes)),1),b("small",null,L(C(t)("admin.traffic.outIn",{out:x(me.outbound),in:x(me.inbound)})),1)])],10,f4))),128))])]),b("section",m4,[b("div",_4,[b("div",null,[b("h3",null,L(C(t)("admin.traffic.userDetail")),1),b("p",null,L(C(t)("admin.traffic.userCount",{count:J.value.length})),1)]),Pe(C(Y_),{value:y.value,"onUpdate:value":de[10]||(de[10]=me=>y.value=me),class:"user-detail-select","data-test":"user-detail-filter",size:"small",filterable:"",clearable:"",options:K.value,placeholder:C(t)("admin.traffic.selectOrSearchUser")},{empty:jt(()=>[ot(L(C(t)("admin.traffic.noUserMatch")),1)]),_:1},8,["value","options","placeholder"])]),b("div",y4,[b("table",b4,[b("thead",null,[b("tr",null,[b("th",null,L(C(t)("admin.traffic.colUser")),1),b("th",null,L(C(t)("admin.traffic.totalTraffic")),1),b("th",null,L(C(t)("admin.traffic.share")),1),b("th",null,L(C(t)("admin.traffic.periodTrend")),1),b("th",null,L(C(t)("admin.traffic.activeDays")),1),de[15]||(de[15]=b("th",null,null,-1))])]),b("tbody",null,[($(!0),F(Oe,null,at(J.value,me=>($(),F("tr",{key:me.id},[b("td",null,[b("strong",null,L(me.email),1),b("small",null,L(me.id),1)]),b("td",null,L(x(me.bytes)),1),b("td",null,[b("span",w4,[b("i",{style:nn({width:`${me.share}%`})},null,4)]),ot(L(me.share.toFixed(1))+"%",1)]),b("td",{class:lt({positive:me.trend!==null&&me.trend>0,negative:me.trend!==null&&me.trend<0})},L(Me(me.trend)),3),b("td",null,L(me.activeDays)+" / "+L(d.value),1),b("td",null,[b("button",{class:"icon-button small",type:"button","aria-label":C(t)("admin.traffic.viewUser",{user:me.email}),"data-test":`open-user-${me.id}`,onClick:rt=>mt(me.id)},[Pe(C(Lg))],8,S4)])]))),128))])])])])]),b("section",C4,[b("div",k4,[b("div",null,[b("h3",null,L(C(t)("admin.traffic.diagnostics")),1),b("p",null,L(C(t)("admin.traffic.diagnosticsRange",{days:d.value})),1)])]),b("div",x4,[b("div",R4,[b("h4",null,L(C(t)("admin.traffic.dailyActivity")),1),b("div",{class:"activity-grid",style:nn({"--columns":String(f.value.days.length)})},[($(!0),F(Oe,null,at(Ze.value,me=>($(),F(Oe,{key:me.user.id},[b("span",{title:me.user.email},L(me.user.email),9,T4),b("div",null,[($(!0),F(Oe,null,at(me.values,(rt,At)=>($(),F("i",{key:At,style:nn({background:tt(rt)}),title:`${f.value.days[At]} · ${x(rt)}`},null,12,P4))),128))])],64))),128))],4)]),b("div",E4,[b("h4",null,L(C(t)("admin.traffic.frameDensity")),1),b("div",L4,[($(!0),F(Oe,null,at(et.value,me=>($(),F("div",{key:me.key},[b("span",null,L(Ve(me.key)),1),b("div",null,[b("i",{style:nn({width:`${me.density/re.value*100}%`,background:me.color})},null,4)]),b("strong",null,L(x(me.density))+"/"+L(C(t)("admin.traffic.frameUnit")),1)]))),128))])])])])],64)):($(),F("div",D$,[Pe(C(Fc)),b("h3",null,L(C(t)("admin.traffic.noUsersSelected")),1),b("button",{type:"button","data-test":"restore-users-empty",onClick:ae},L(C(t)("admin.traffic.restoreAllUsers")),1)]))])]}),_:1},8,["show"]),Q.value?($(),F("div",{key:0,class:"drawer-backdrop","data-test":"traffic-user-drawer",onClick:de[12]||(de[12]=ut(Le=>l.value=null,["self"]))},[b("aside",D4,[b("div",M4,[b("div",null,[b("span",null,L(C(t)("admin.traffic.userTraffic")),1),b("h3",null,L(Q.value.email),1),b("small",null,L(Q.value.id),1)]),b("button",{class:"icon-button",type:"button","aria-label":C(t)("common.close"),onClick:de[11]||(de[11]=Le=>l.value=null)},[Pe(C(ii))],8,A4)]),b("div",I4,[b("div",null,[b("span",null,L(C(t)("admin.traffic.totalTraffic")),1),b("strong",null,L(x(Q.value.bytes)),1)]),b("div",null,[b("span",null,L(C(t)("admin.traffic.periodTrend")),1),b("strong",null,L(Me(Q.value.trend)),1)]),b("div",null,[b("span",null,L(C(t)("admin.traffic.kpiFrames")),1),b("strong",null,L(Re(Q.value.frames)),1)])]),b("section",null,[b("h4",null,[Pe(C(cw)),ot(L(C(t)("admin.traffic.dailyTraffic")),1)]),b("div",$4,[($(!0),F(Oe,null,at(Fe.value,(Le,Ae)=>($(),F("div",{key:f.value.days[Ae]},[b("i",{style:nn({height:`${Le/Ee.value*100}%`}),title:`${f.value.days[Ae]} · ${x(Le)}`},null,12,O4),b("span",null,L(kt(f.value.days[Ae])),1)]))),128))])]),b("section",null,[b("h4",null,[Pe(C(Jh)),ot(L(C(t)("admin.traffic.frameBreakdown")),1)]),b("table",null,[b("thead",null,[b("tr",null,[b("th",null,L(C(t)("admin.traffic.colFrameType")),1),b("th",null,L(C(t)("admin.traffic.colCategory")),1),b("th",null,L(C(t)("admin.traffic.colBytes")),1),b("th",null,L(C(t)("admin.traffic.colFrames")),1)])]),b("tbody",null,[($(!0),F(Oe,null,at(Ye.value,Le=>($(),F("tr",{key:Le.name},[b("td",null,L(Le.name),1),b("td",null,L(Ve(Le.category)),1),b("td",null,L(x(Le.bytes)),1),b("td",null,L(Re(Le.frames)),1)]))),128))])])])])])):Z("",!0)]))}}),B4=Ct(F4,[["__scopeId","data-v-252de6da"]]),H4={class:"admin-panel"},N4={class:"admin-tabs"},z4=["onClick","data-test"],U4={class:"admin-body"},V4=$e({__name:"AdminPanel",setup(e){const{t}=Po(),n=j(()=>Wh.value.locale),s=j(()=>Wh.value.dateLocale),i=H("invitations"),a=j(()=>[{key:"invitations",label:t("admin.invitations")},{key:"users",label:t("admin.users")},{key:"config",label:t("admin.configTab")},{key:"feishu",label:t("admin.feishuTab")},{key:"traffic",label:t("admin.trafficTab")}]),d=w0();return(r,o)=>($(),F("div",H4,[Pe(C(k0),{abstract:"",theme:C(C0),"theme-overrides":C(d),locale:n.value,"date-locale":s.value},{default:jt(()=>[Pe(C(S0),null,{default:jt(()=>[b("div",N4,[($(!0),F(Oe,null,at(a.value,c=>($(),F("button",{key:c.key,type:"button",onClick:p=>i.value=c.key,class:lt({active:i.value===c.key}),"data-test":`admin-tab-${c.key}`},L(c.label),11,z4))),128))]),b("div",U4,[i.value==="invitations"?($(),bt(EI,{key:0})):Z("",!0),i.value==="users"?($(),bt(II,{key:1})):Z("",!0),i.value==="config"?($(),bt(KI,{key:2})):Z("",!0),i.value==="feishu"?($(),bt(JI,{key:3})):Z("",!0),i.value==="traffic"?($(),bt(B4,{key:4})):Z("",!0)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"])]))}}),K4=Ct(V4,[["__scopeId","data-v-6f7ef581"]]),W4="classic",_u=[{id:"classic",labelKey:"settings.general.themes.classicLabel",descriptionKey:"settings.general.themes.classicDescription",xtermTheme:{background:"#000000",foreground:"#c9d1d9",cursor:"#c9d1d9",cursorAccent:"#000000",selectionBackground:"#264f78",black:"#000000",red:"#f85149",green:"#3fb950",yellow:"#d29922",blue:"#58a6ff",magenta:"#bc8cff",cyan:"#39c5cf",white:"#b1bac4",brightBlack:"#6e7681",brightRed:"#ff7b72",brightGreen:"#56d364",brightYellow:"#e3b341",brightBlue:"#79c0ff",brightMagenta:"#d2a8ff",brightCyan:"#56d4dd",brightWhite:"#f0f6fc"},appVars:{"--bg":"#0d1117","--panel":"#161b22","--border":"#30363d","--fg":"#c9d1d9","--fg-dim":"#8b949e","--accent":"#58a6ff","--good":"#3fb950","--bad":"#f85149","--warn":"#d29922","--neutral":"#6e7681","--terminal-bg":"#000000","--terminal-grid":"#11161d","--terminal-overlay":"rgba(13, 17, 23, 0.85)"}},{id:"nord",labelKey:"settings.general.themes.nordLabel",descriptionKey:"settings.general.themes.nordDescription",xtermTheme:{background:"#2e3440",foreground:"#d8dee9",cursor:"#d8dee9",cursorAccent:"#2e3440",selectionBackground:"#434c5e",black:"#3b4252",red:"#bf616a",green:"#a3be8c",yellow:"#ebcb8b",blue:"#81a1c1",magenta:"#b48ead",cyan:"#88c0d0",white:"#e5e9f0",brightBlack:"#4c566a",brightRed:"#bf616a",brightGreen:"#a3be8c",brightYellow:"#ebcb8b",brightBlue:"#81a1c1",brightMagenta:"#b48ead",brightCyan:"#8fbcbb",brightWhite:"#eceff4"},appVars:{"--bg":"#242933","--panel":"#2e3440","--border":"#4c566a","--fg":"#d8dee9","--fg-dim":"#9aa7bd","--accent":"#88c0d0","--good":"#a3be8c","--bad":"#bf616a","--warn":"#ebcb8b","--neutral":"#4c566a","--terminal-bg":"#2e3440","--terminal-grid":"#242933","--terminal-overlay":"rgba(36, 41, 51, 0.88)"}},{id:"solarized-dark",labelKey:"settings.general.themes.solarizedDarkLabel",descriptionKey:"settings.general.themes.solarizedDarkDescription",xtermTheme:{background:"#002b36",foreground:"#839496",cursor:"#93a1a1",cursorAccent:"#002b36",selectionBackground:"#073642",black:"#073642",red:"#dc322f",green:"#859900",yellow:"#b58900",blue:"#268bd2",magenta:"#d33682",cyan:"#2aa198",white:"#eee8d5",brightBlack:"#002b36",brightRed:"#cb4b16",brightGreen:"#586e75",brightYellow:"#657b83",brightBlue:"#839496",brightMagenta:"#6c71c4",brightCyan:"#93a1a1",brightWhite:"#fdf6e3"},appVars:{"--bg":"#00212b","--panel":"#073642","--border":"#28535f","--fg":"#93a1a1","--fg-dim":"#657b83","--accent":"#268bd2","--good":"#859900","--bad":"#dc322f","--warn":"#b58900","--neutral":"#586e75","--terminal-bg":"#002b36","--terminal-grid":"#001e26","--terminal-overlay":"rgba(0, 33, 43, 0.9)"}},{id:"daylight",labelKey:"settings.general.themes.daylightLabel",descriptionKey:"settings.general.themes.daylightDescription",xtermTheme:{background:"#faf4e8",foreground:"#403832",cursor:"#403832",cursorAccent:"#faf4e8",selectionBackground:"#d9c7a8",black:"#403832",red:"#c94f4f",green:"#4d8a3f",yellow:"#b9831d",blue:"#2f6db3",magenta:"#8b5fa8",cyan:"#2f8f8a",white:"#ede0cc",brightBlack:"#7a6d61",brightRed:"#d56565",brightGreen:"#5d9f4d",brightYellow:"#c9922c",brightBlue:"#3d7fcf",brightMagenta:"#9b6db8",brightCyan:"#3aa39d",brightWhite:"#fffaf0"},appVars:{"--bg":"#f4ead8","--panel":"#fff8ed","--border":"#d8c7ad","--fg":"#403832","--fg-dim":"#776b5f","--accent":"#2f6db3","--good":"#4d8a3f","--bad":"#c94f4f","--warn":"#b9831d","--neutral":"#7a6d61","--terminal-bg":"#faf4e8","--terminal-grid":"#e5d6bd","--terminal-overlay":"rgba(255, 248, 237, 0.92)"}}];function Mi(e){return _u.find(t=>t.id===e)??_u[0]}function j4(e){return e==="daylight"}const q4={key:0,class:"terminal-appearance"},Y4={class:"settings-field"},G4={class:"field-label"},X4={class:"hint"},J4={class:"settings-field-grid settings-field-grid--compact","data-test":"terminal-compact-grid"},Q4={class:"settings-field"},Z4={class:"field-label",for:"terminal-font-size"},eO=["value"],tO={class:"settings-field"},nO={class:"field-label",for:"terminal-line-height"},sO=["value"],iO={class:"settings-field scrollback-field"},rO={class:"field-label",for:"terminal-scrollback"},oO=["value"],aO={class:"settings-field"},lO={class:"field-label"},cO={class:"checkbox cursor-blink"},dO=["checked"],uO={class:"hint","data-test":"terminal-scrollback-hint"},hO={key:0,class:"error"},fO=$e({__name:"SettingsTerminalAppearance",emits:["appearance-changed"],setup(e,{emit:t}){const n=t,{t:s}=$t(),i=dn(),a=i.caps,d=H(""),r=H(""),o=H(""),c=H(13),p=H(1),u=H("block"),g=H("block"),m=H(!0),y=H(5e3),v=H(5e3),l=H(!0),h=j(()=>aR.map(I=>({value:I.id,label:I.label}))),f=j(()=>[{value:"block",label:s("settings.general.terminalCursorStyleBlock")},{value:"underline",label:s("settings.general.terminalCursorStyleUnderline")},{value:"bar",label:s("settings.general.terminalCursorStyleBar")}]),_=j(()=>Math.round(y.value*2.75/1e3));async function S(){if(a.wailsBindings)try{const[I,O,U,W,z,N]=await Promise.all([fm(),pm(),vm(),gm(),mm(),_m()]);r.value=I,o.value=I,c.value=O,p.value=U,u.value=W,g.value=u.value,m.value=z,y.value=N,v.value=N}catch(I){d.value=(I==null?void 0:I.message)??String(I)}finally{l.value=!1}}let k=null;Dt(()=>{S(),k=i.events.on("prefs:changed",()=>{S()})}),Vt(()=>{k==null||k(),k=null});function P(){n("appearance-changed",{fontHead:r.value,fontSize:c.value,lineHeight:p.value,cursorStyle:u.value,cursorBlink:m.value,scrollback:v.value})}async function M(){const I=r.value,O=o.value;d.value="";try{await YS(I),o.value=I,P()}catch(U){r.value=O,d.value=(U==null?void 0:U.message)??String(U)}}async function w(I){const O=I.target,U=Number(O.value),W=Number.isFinite(U)?Math.max(8,Math.min(32,Math.round(U))):c.value,z=c.value;c.value=W,O.value=String(W),d.value="";try{await GS(W),P()}catch(N){c.value=z,O.value=String(z),d.value=(N==null?void 0:N.message)??String(N)}}async function T(I){const O=I.target,U=Number(O.value),W=Number.isFinite(U)?Math.max(1,Math.min(2,Math.round(U*10)/10)):p.value,z=p.value;p.value=W,O.value=String(W),d.value="";try{await XS(W),P()}catch(N){p.value=z,O.value=String(z),d.value=(N==null?void 0:N.message)??String(N)}}async function A(){const I=u.value,O=g.value;d.value="";try{await JS(I),g.value=I,P()}catch(U){u.value=O,d.value=(U==null?void 0:U.message)??String(U)}}async function E(I){const O=I.target,U=m.value;m.value=O.checked,d.value="";try{await QS(O.checked),P()}catch(W){m.value=U,O.checked=U,d.value=(W==null?void 0:W.message)??String(W)}}function R(I){const O=Number(I.target.value);Number.isFinite(O)&&(y.value=O)}async function D(I){const O=I.target,U=Number(O.value),W=Number.isFinite(U)?Math.max(500,Math.min(2e4,Math.round(U))):v.value,z=v.value;y.value=W,O.value=String(W),d.value="";try{await ZS(W),v.value=W,P()}catch(N){y.value=z,O.value=String(z),d.value=(N==null?void 0:N.message)??String(N)}}return(I,O)=>C(a).wailsBindings&&!l.value?($(),F("div",q4,[b("div",Y4,[b("label",G4,L(C(s)("settings.general.terminalFont")),1),Pe(ts,{modelValue:r.value,"onUpdate:modelValue":[O[0]||(O[0]=U=>r.value=U),M],options:h.value,"data-test":"terminal-font","aria-label":C(s)("settings.general.terminalFont")},null,8,["modelValue","options","aria-label"]),b("p",X4,L(C(s)("settings.general.terminalFontHint")),1)]),b("div",J4,[b("div",Q4,[b("label",Z4,L(C(s)("settings.general.terminalFontSize")),1),b("input",{id:"terminal-font-size",class:"number-input",type:"number","data-test":"terminal-font-size",min:"8",max:"32",step:"1",value:c.value,onChange:w},null,40,eO)]),b("div",tO,[b("label",nO,L(C(s)("settings.general.terminalLineHeight")),1),b("input",{id:"terminal-line-height",class:"number-input",type:"number","data-test":"terminal-line-height",min:"1.0",max:"2.0",step:"0.1",value:p.value,onChange:T},null,40,sO)]),b("div",iO,[b("label",rO,L(C(s)("settings.general.terminalScrollback")),1),b("input",{id:"terminal-scrollback",class:"number-input",type:"number","data-test":"terminal-scrollback",min:"500",max:"20000",step:"500",value:y.value,onInput:R,onChange:D},null,40,oO)]),b("div",aO,[b("label",lO,L(C(s)("settings.general.terminalCursorStyle")),1),Pe(ts,{modelValue:u.value,"onUpdate:modelValue":[O[1]||(O[1]=U=>u.value=U),A],options:f.value,"data-test":"terminal-cursor-style","aria-label":C(s)("settings.general.terminalCursorStyle")},null,8,["modelValue","options","aria-label"]),b("label",cO,[b("input",{type:"checkbox","data-test":"terminal-cursor-blink",checked:m.value,onChange:E},null,40,dO),ot(" "+L(C(s)("settings.general.terminalCursorBlink")),1)])])]),b("p",uO,L(C(s)("settings.general.terminalScrollbackHint",{mb:_.value})),1),d.value?($(),F("p",hO,L(d.value),1)):Z("",!0)])):Z("",!0)}}),pO=Ct(fO,[["__scopeId","data-v-e31f8f67"]]);async function vO(){const{data:e}=await vn("/api/push/key");return e.key}async function gO(e){await vn("/api/push/subscribe",{method:"POST",body:JSON.stringify(e)})}async function mO(e){await vn("/api/push/unsubscribe",{method:"POST",body:JSON.stringify({endpoint:e})})}async function _O(){const{data:e}=await vn("/api/push/test",{method:"POST"});return e.sent}function yO(e){let t=e.replace(/-/g,"+").replace(/_/g,"/");for(;t.length%4===1;)t=t.slice(0,-1);const n="=".repeat((4-t.length%4)%4),s=atob(t+n),i=new Uint8Array(s.length);for(let a=0;ac.map(ae=>({value:ae.value,label:o(ae.labelKey)}))),f=j(()=>_u.map(ae=>({value:ae.id,label:o(ae.labelKey),description:o(ae.descriptionKey)}))),_=H(!0),S=H(!0),k=H(!0),P=H(!0),M=H(!0),w=H(!0),T=H(!0),A=H(!1),E=H("auto"),R=H("auto"),D=H(""),I=H(""),O=H([]),U=H(!0),W=H(!0),z=H(10),N=H(!0),V=j(()=>m.notifications&&typeof navigator<"u"&&"serviceWorker"in navigator),q=H(!1),G=H(!0),te=H(!1),oe=H(!1),ie=H(""),ye={denied:"settings.general.pushNotifications.errors.denied",disabled:"settings.general.pushNotifications.errors.disabled","key-failed":"settings.general.pushNotifications.errors.keyFailed","subscribe-failed":"settings.general.pushNotifications.errors.subscribeFailed","subscribe-rejected":"settings.general.pushNotifications.errors.subscribeRejected"},K=j(()=>[{value:"auto",label:o("settings.general.auto")},...O.value.map(ae=>({value:ae,label:ae})),{value:"__custom__",label:o("settings.general.customPath")}]);async function J(){if(m.wailsBindings)try{const[ae,_e]=await Promise.all([tC(),Ou()]);O.value=_e,E.value==="__custom__"&&D.value!==I.value||(ae==="auto"?E.value="auto":_e.includes(ae)?(E.value=ae,D.value=ae,I.value=ae):(E.value="__custom__",D.value=ae,I.value=ae),R.value=E.value)}catch(ae){r.value=(ae==null?void 0:ae.message)??String(ae)}finally{T.value=!1}}let Q=null;Dt(()=>{Q=g.events.on("prefs:changed",()=>{J()})}),Vt(()=>{Q==null||Q(),Q=null}),Dt(async()=>{if(m.wailsBindings)try{const ae=await eC();y.value=ae,v.value=ae}catch(ae){r.value=(ae==null?void 0:ae.message)??String(ae)}if(m.wailsBindings){try{_.value=await ym()}catch(ae){r.value=(ae==null?void 0:ae.message)??String(ae)}finally{S.value=!1}try{k.value=await oC()}catch(ae){r.value=(ae==null?void 0:ae.message)??String(ae)}finally{P.value=!1}try{M.value=await am()}catch(ae){r.value=(ae==null?void 0:ae.message)??String(ae)}finally{w.value=!1}await J();try{U.value=await bm()}catch(ae){r.value=(ae==null?void 0:ae.message)??String(ae)}finally{W.value=!1}try{z.value=await wm()}catch(ae){r.value=(ae==null?void 0:ae.message)??String(ae)}finally{N.value=!1}}await ce()});async function ce(){if(!V.value){G.value=!1;return}try{if(!navigator.serviceWorker.controller){q.value=!1;return}const _e=await(await navigator.serviceWorker.ready).pushManager.getSubscription();q.value=_e!==null}catch{q.value=!1}finally{G.value=!1}}async function Fe(ae){const _e=ae.target,be=_e.checked;ie.value="",te.value=!0;try{const Me=await navigator.serviceWorker.ready;if(be){const x=await bO({notification:{permission:Notification.permission,requestPermission:()=>Notification.requestPermission()},registration:Me});if(!x.ok){_e.checked=!1,q.value=!1,ie.value=o(ye[x.reason]??"settings.general.pushNotifications.errors.generic");return}q.value=!0}else await wO({registration:Me}),q.value=!1}catch(Me){_e.checked=q.value,ie.value=(Me==null?void 0:Me.message)??String(Me)}finally{te.value=!1}}async function Ee(){ie.value="",oe.value=!0;try{await _O()}catch(ae){ie.value=(ae==null?void 0:ae.message)??String(ae)}finally{oe.value=!1}}async function Ye(ae){const _e=ae.target,be=_.value;_.value=_e.checked,r.value="";try{await nC(_e.checked)}catch(Me){_.value=be,r.value=(Me==null?void 0:Me.message)??String(Me)}}async function Ze(ae){const _e=ae.target,be=k.value;k.value=_e.checked,r.value="";try{await aC(_e.checked)}catch(Me){k.value=be,r.value=(Me==null?void 0:Me.message)??String(Me)}}async function ue(ae){const _e=ae.target,be=M.value;M.value=_e.checked,r.value="";try{await MS(_e.checked)}catch(Me){M.value=be,r.value=(Me==null?void 0:Me.message)??String(Me)}}async function et(){if(E.value==="__custom__")return;const ae=R.value;A.value=!0,r.value="";try{await Tf(E.value),R.value=E.value}catch(_e){E.value=ae,r.value=(_e==null?void 0:_e.message)??String(_e)}finally{A.value=!1}}async function re(){const ae=D.value.trim();if(!ae){r.value=o("settings.general.customShellRequired");return}A.value=!0,r.value="";try{await Tf(ae),E.value="__custom__",R.value="__custom__",D.value=ae,I.value=ae,O.value.includes(ae)||(O.value=[ae,...O.value])}catch(_e){r.value=(_e==null?void 0:_e.message)??String(_e)}finally{A.value=!1}}async function we(ae){const _e=ae.target,be=U.value;U.value=_e.checked,r.value="";try{await lC(_e.checked)}catch(Me){U.value=be,r.value=(Me==null?void 0:Me.message)??String(Me)}}async function fe(ae){const _e=ae.target,be=Number(_e.value),Me=Number.isFinite(be)?Math.max(1,Math.min(600,Math.round(be))):10,x=z.value;z.value=Me,_e.value=String(Me),r.value="";try{await cC(Me),s("command-notify-threshold-changed",Me)}catch(Re){z.value=x,_e.value=String(x),r.value=(Re==null?void 0:Re.message)??String(Re)}}function De(ae){s("appearance-changed",ae)}async function Qe(){const ae=y.value,_e=v.value,be=p.value;l.value=!0,r.value="";try{await u(ae),v.value=ae}catch(Me){y.value=_e,v.value=_e;try{await u(be)}catch{}r.value=(Me==null?void 0:Me.message)??String(Me)}finally{l.value=!1}}async function We(){const ae=Mi(i.value).id,_e=a.value;i.value=ae,d.value=!0,r.value="";try{m.wailsBindings&&await jS(ae),a.value=ae,s("terminal-theme-changed",ae)}catch(be){i.value=_e,s("terminal-theme-changed",_e),r.value=(be==null?void 0:be.message)??String(be)}finally{d.value=!1}}return(ae,_e)=>($(),F("div",SO,[b("div",CO,[b("div",kO,[b("label",xO,L(C(o)("settings.general.languageLabel")),1),Pe(ts,{modelValue:y.value,"onUpdate:modelValue":[_e[0]||(_e[0]=be=>y.value=be),Qe],options:h.value,disabled:l.value,"aria-label":C(o)("settings.general.languageLabel")},null,8,["modelValue","options","disabled","aria-label"]),b("p",RO,L(C(o)("settings.general.languageHint")),1)]),b("div",TO,[b("label",PO,L(C(o)("settings.general.terminalTheme")),1),Pe(ts,{modelValue:i.value,"onUpdate:modelValue":[_e[1]||(_e[1]=be=>i.value=be),We],options:f.value,disabled:d.value,"aria-label":C(o)("settings.general.terminalTheme")},null,8,["modelValue","options","disabled","aria-label"]),b("p",EO,L(C(o)("settings.general.terminalThemeHint")),1)])]),Pe(pO,{onAppearanceChanged:De}),C(m).wailsBindings&&!S.value?($(),F("label",LO,[b("input",{type:"checkbox",checked:_.value,onChange:Ye},null,40,DO),ot(" "+L(C(o)("settings.general.notificationsBell")),1)])):Z("",!0),C(m).wailsBindings&&!S.value?($(),F("p",MO,L(C(o)("settings.general.notificationsHint")),1)):Z("",!0),C(m).wailsBindings&&!P.value?($(),F("label",AO,[b("input",{type:"checkbox",checked:k.value,onChange:Ze},null,40,IO),ot(" "+L(C(o)("settings.general.shellIntegration")),1)])):Z("",!0),C(m).wailsBindings&&!P.value?($(),F("p",$O,L(C(o)("settings.general.shellIntegrationHint")),1)):Z("",!0),C(m).wailsBindings&&!w.value?($(),F("label",OO,[b("input",{type:"checkbox",checked:M.value,onChange:ue},null,40,FO),ot(" "+L(C(o)("settings.general.recoveryEnabled")),1)])):Z("",!0),C(m).wailsBindings&&!w.value?($(),F("p",BO,L(C(o)("settings.general.recoveryEnabledHint")),1)):Z("",!0),C(m).wailsBindings&&!T.value?($(),F("label",HO,L(C(o)("settings.general.defaultShell")),1)):Z("",!0),C(m).wailsBindings&&!T.value?($(),bt(ts,{key:7,modelValue:E.value,"onUpdate:modelValue":[_e[2]||(_e[2]=be=>E.value=be),et],options:K.value,"aria-label":C(o)("settings.general.defaultShell"),disabled:A.value},null,8,["modelValue","options","aria-label","disabled"])):Z("",!0),C(m).wailsBindings&&!T.value?($(),F("p",NO,L(C(o)("settings.general.defaultShellHint")),1)):Z("",!0),C(m).wailsBindings&&!T.value&&E.value==="__custom__"?($(),F("div",zO,[it(b("input",{class:"text-input","onUpdate:modelValue":_e[3]||(_e[3]=be=>D.value=be),placeholder:C(o)("settings.general.customShellPath"),"aria-label":C(o)("settings.general.customShellPath"),disabled:A.value},null,8,UO),[[Pt,D.value]]),b("button",{disabled:A.value,onClick:re},L(C(o)("settings.general.saveCustom")),9,VO)])):Z("",!0),C(m).wailsBindings&&!W.value?($(),F("label",KO,[b("input",{type:"checkbox",checked:U.value,onChange:we},null,40,WO),ot(" "+L(C(o)("settings.general.webglRenderer")),1)])):Z("",!0),C(m).wailsBindings&&!W.value?($(),F("p",jO,L(C(o)("settings.general.webglHint")),1)):Z("",!0),C(m).wailsBindings&&!N.value?($(),F("label",qO,L(C(o)("settings.general.commandNotifyThreshold")),1)):Z("",!0),C(m).wailsBindings&&!N.value?($(),F("input",{key:13,class:"number-input",type:"number",min:"1",max:"600",value:z.value,onChange:fe},null,40,YO)):Z("",!0),C(m).wailsBindings&&!N.value?($(),F("p",GO,L(C(o)("settings.general.commandNotifyHint")),1)):Z("",!0),r.value?($(),F("p",XO,L(r.value),1)):Z("",!0),V.value?($(),F("section",JO,[b("h3",QO,L(C(o)("settings.general.pushNotifications.title")),1),G.value?Z("",!0):($(),F("label",ZO,[b("input",{type:"checkbox","data-testid":"push-toggle",checked:q.value,disabled:te.value,onChange:Fe},null,40,eF),ot(" "+L(C(o)("settings.general.pushNotifications.enable")),1)])),q.value?($(),F("button",{key:1,type:"button",class:"push-test-button","data-testid":"push-test",disabled:oe.value,onClick:Ee},L(C(o)("settings.general.pushNotifications.test")),9,tF)):Z("",!0),ie.value?($(),F("p",nF,L(ie.value),1)):Z("",!0)])):Z("",!0)]))}}),iF=Ct(sF,[["__scopeId","data-v-e7440565"]]);async function Av(e,t){const{data:n}=await vn(e,{method:"POST",body:JSON.stringify(t)});return n}async function rF(e,t){const{handle:n,ke1:s}=await $0(t),i=await Av("/api/auth/stepup/init",{email:e,login_ke:s});let a;try{({ke3:a}=await O0(n,i.login_response,F0,e))}catch{throw new Error("invalid credentials")}return(await Av("/api/auth/stepup/finalize",{email:e,session_id:i.session_id,login_ke3:a})).step_up_token}async function oF(e,t){await vn("/api/me/password",{method:"POST",body:JSON.stringify({current_password:e,new_password:t})})}async function aF(e,t){const n=await rF(e,t);await vn("/api/me",{method:"DELETE",headers:{"X-Step-Up-Token":n},body:JSON.stringify({email:e})})}function lF(e){const t=e.toLowerCase();return!!(t==="localhost"||t==="127.0.0.1"||t==="::1"||t.startsWith("127.")||t.startsWith("[")&&t.endsWith("]")&&t.slice(1,-1)==="::1")}function cF(e,t){const n=e.trim();if(!n)return rn("mobile.relayUrlRequired");let s;try{s=new URL(n)}catch{return rn("mobile.relayUrlMalformed")}return s.protocol!=="http:"&&s.protocol!=="https:"?rn("mobile.relayUrlProtocol"):s.pathname!=="/"||s.search!==""||s.hash!==""?rn("mobile.relayUrlNoPath"):s.protocol==="http:"&&!lF(s.hostname)&&!t?rn("mobile.relayUrlInsecure"):null}const Iv=ka("AttermQRScanner"),dF={class:"pair-consume"},uF={key:0,class:"pending"},hF={class:"step","data-testid":"pair-step"},fF={class:"elapsed","data-testid":"pair-elapsed"},pF={key:1,class:"pair-error","data-testid":"pair-error"},vF={class:"code"};function gF(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=t.length%4===0?"":"=".repeat(4-t.length%4),s=atob(t+n),i=new Uint8Array(s.length);for(let a=0;a{const _=r.value;switch(_){case"pair_invalid_url":return a("mobile.pairing.errInvalidUrl");case"pair_invalid_scheme":return a("mobile.pairing.errInvalidScheme");case"platform_unsupported":return a("mobile.pairing.errPlatformUnsupported");case"cannot_reach_relay":return a("mobile.pairing.errCannotReachRelay");case"pair_timeout":return a("mobile.pairing.errTimeout");case"pair_invalid":return a("mobile.pairing.errPairInvalid");case"cancelled":return a("mobile.pairing.errCancelled");default:return a("mobile.pairing.errGeneric",{message:_})}}),y=j(()=>(o.value/1e3).toFixed(1)+"s"),v=j(()=>{switch(c.value){case"parsing":return a("mobile.pairing.stepParsing");case"requesting":return a("mobile.pairing.stepRequesting");case"saving":return a("mobile.pairing.stepSaving");default:return""}});function l(){g||d.value!=="pending"||(o.value=Date.now()-u,p=requestAnimationFrame(l))}function h(){g=!0,r.value="cancelled",d.value="error",p&&(cancelAnimationFrame(p),p=0)}async function f(){var S;const _=mF(n.scannedUrl,!!n.allowInsecure);if(typeof _=="string"){r.value=_,d.value="error";return}u=Date.now(),o.value=0,p=requestAnimationFrame(l);try{if(!i.relay.consumePairing)throw new Error("platform_unsupported");c.value="requesting";const k=await Promise.race([i.relay.consumePairing(_.origin,_.token,_.wrapKey),new Promise((P,M)=>setTimeout(()=>M(new Error("pair_timeout")),16e3))]);if(g||(c.value="saving",await i.relay.save({url:k.relay_url,token:k.session_token,session_expires_at:k.expires_at,allow_insecure_relay:!!n.allowInsecure,remote_permission:"full",last_email:((S=k.user)==null?void 0:S.email)??"",connected:!1,realmId:k.realm_id,homeInstanceURL:k.home_instance_url}),g))return;s("connected")}catch(k){if(g)return;r.value=k instanceof Error?k.message:String(k),d.value="error"}finally{p&&(cancelAnimationFrame(p),p=0)}}return Dt(f),Vt(()=>{g=!0,p&&(cancelAnimationFrame(p),p=0)}),(_,S)=>($(),F("div",dF,[d.value==="pending"?($(),F("div",uF,[b("p",null,L(C(a)("mobile.pairing.connecting")),1),b("p",hF,L(v.value),1),b("p",fF,L(y.value),1),b("button",{type:"button",class:"cancel","data-testid":"pair-cancel",onClick:h},L(C(a)("common.cancel")),1)])):($(),F("div",pF,[b("p",null,L(C(a)("mobile.pairing.failed")),1),b("p",vF,L(m.value),1),b("button",{type:"button",onClick:S[0]||(S[0]=k=>s("cancel"))},L(C(a)("mobile.pairing.back")),1)]))]))}}),yF=Ct(_F,[["__scopeId","data-v-285ce5b2"]]),bF={class:"tab-pane account-tab"},wF=["disabled"],SF={class:"field-label",for:"account-relay-url"},CF={class:"relay-url-row"},kF=["disabled"],xF=["disabled"],RF={key:2,class:"checkbox-row"},TF=["disabled"],PF={class:"settings-field-grid settings-field-grid--two","data-testid":"account-login-credentials-grid"},EF={class:"settings-field"},LF={class:"field-label",for:"account-login-email"},DF=["disabled"],MF={class:"settings-field"},AF={class:"field-label",for:"account-login-password"},IF=["disabled"],$F={key:3,class:"inline-error",role:"alert"},OF=["disabled"],FF={class:"account-section"},BF={class:"field-label"},HF={class:"email-value","data-testid":"account-email"},NF=["disabled"],zF={class:"account-section"},UF={class:"settings-field"},VF={class:"field-label",for:"account-old-password"},KF=["disabled"],WF={class:"settings-field-grid settings-field-grid--two","data-testid":"account-password-grid"},jF={class:"settings-field"},qF={class:"field-label",for:"account-new-password"},YF=["disabled"],GF={key:0,class:"hint"},XF={class:"settings-field"},JF={class:"field-label",for:"account-confirm-password"},QF=["disabled"],ZF={key:0,class:"hint"},eB=["disabled"],tB={key:0,class:"error"},nB={key:1,class:"success"},sB={class:"account-section danger-zone"},iB={class:"hint warning-text"},rB={class:"field-label",for:"danger-current-password"},oB=["disabled"],aB={class:"field-label",for:"danger-confirm-email"},lB=["disabled"],cB=["disabled"],dB={key:0,class:"error"},uB=$e({__name:"SettingsAccount",setup(e){const{t}=$t(),n=dn(),s=H(""),i=H(!0),a=H(!1),d=H(!1),r=H("https://"),o=H(""),c=H(""),p=H(""),u=H(!1),g=H(!1),m=H(""),y=H(""),v=j(()=>!!n.relay.login),l=j(()=>!!n.relay.consumePairing),h=j(()=>r.value+o.value.trim());function f(K){const J=/^\s*(https?:\/\/)(.*)$/i.exec(K);J?(r.value=J[1].toLowerCase(),o.value=J[2].trim()):o.value=K.trim(),r.value==="https://"&&(u.value=!1)}function _(){f(o.value)}Dt(async()=>{var K,J;try{const Q=await n.relay.load();Q&&(f(Q.url||""),c.value=Q.last_email||"",u.value=!!Q.allow_insecure_relay)}catch{}try{p.value=await((J=(K=n.relay).loadSavedPassword)==null?void 0:J.call(K))??""}catch{}try{const Q=await n.relay.fetchMe();s.value=Q.email,c.value||(c.value=Q.email),d.value=!0}catch{d.value=!1}finally{i.value=!1}});async function S(){var K,J;if(!a.value){a.value=!0;try{await((J=(K=n.relay).logout)==null?void 0:J.call(K))}catch{}finally{if(v.value){d.value=!1,s.value="",a.value=!1,n.events.emit("relay:auth-restored",void 0);return}location.assign("/login.html")}}}async function k(){if(!n.relay.login||g.value)return;m.value="";const K=cF(h.value,u.value);if(K){m.value=K;return}if(!c.value.trim()){m.value=t("mobile.emailRequired");return}if(!p.value){m.value=t("mobile.passwordRequired");return}g.value=!0;try{await n.relay.login(h.value.replace(/\/$/,""),c.value.trim(),p.value,u.value);const J=await n.relay.fetchMe();s.value=J.email,c.value=J.email,d.value=!0,n.events.emit("relay:auth-restored",void 0)}catch(J){const Q=J instanceof Error?J.message:String(J);Q==="invalid_credentials"?m.value=t("mobile.invalidCredentials"):Q==="rate_limited"?m.value=t("mobile.rateLimited"):/403|origin/i.test(Q)?m.value=t("mobile.originRejected"):m.value=t("mobile.cannotReachRelay",{message:Q})}finally{g.value=!1}}async function P(){m.value="";try{const{camera:K}=await Iv.requestPermissions();if(K!=="granted"){m.value=t("mobile.pairing.cameraDenied");return}const J=await Iv.scan();if(J.cancelled)return;if(!J.rawValue){m.value=t("mobile.pairing.noQrDetected");return}y.value=J.rawValue}catch(K){const J=K instanceof Error?K.message:String(K);/PLUGIN_NOT_AVAILABLE|not implemented/i.test(J)?m.value=t("mobile.pairing.scanNotAvailable"):m.value=J}}async function M(){y.value="";try{const K=await n.relay.fetchMe();s.value=K.email,c.value=K.email,d.value=!0,n.events.emit("relay:auth-restored",void 0)}catch(K){m.value=K instanceof Error?K.message:String(K)}}function w(K){return K instanceof Error&&K.message==="invalid credentials"?t("settings.account.errors.wrongPassword"):K instanceof Xs?K.code==="step_up_required"||K.code==="step_up_invalid"?t("settings.account.errors.sessionExpired"):K.status===401?t("settings.account.errors.wrongPassword"):K.status===429?t("settings.account.errors.rateLimited"):K.status===0?t("settings.account.errors.network"):t("settings.account.errors.generic"):K instanceof Error?K.message:String(K)}const T=H(""),A=H(""),E=H(""),R=H(!1),D=H(""),I=H(""),O=j(()=>A.value.length>=8),U=j(()=>E.value!==""&&A.value===E.value),W=j(()=>T.value!==""&&O.value&&U.value&&!R.value);async function z(){if(W.value){D.value="",I.value="",R.value=!0;try{await oF(T.value,A.value),I.value=t("settings.account.changePassword.successToast"),T.value="",A.value="",E.value=""}catch(K){D.value=w(K)}finally{R.value=!1}}}const N=H(!1),V=H(""),q=H(""),G=H(!1),te=H(""),oe=j(()=>V.value!==""&&s.value!==""&&q.value===s.value&&!G.value);function ie(){N.value=!N.value,N.value||(V.value="",q.value="",te.value="")}async function ye(){if(oe.value&&window.confirm(t("settings.account.dangerZone.confirmPrompt"))){te.value="",G.value=!0;try{await aF(s.value,V.value),location.assign("/login.html")}catch(K){te.value=w(K)}finally{G.value=!1}}}return(K,J)=>($(),F("div",bF,[!d.value&&v.value?($(),F("form",{key:0,class:"account-section inline-login","data-testid":"account-inline-login",onSubmit:ut(k,["prevent"])},[b("h3",null,L(C(t)("mobile.loginButton")),1),l.value?($(),F("button",{key:0,type:"button",class:"secondary primary-action","data-testid":"account-scan-qr",disabled:g.value||!!y.value,onClick:P},L(C(t)("mobile.pairing.scan")),9,wF)):Z("",!0),y.value?($(),bt(yF,{key:1,"scanned-url":y.value,"allow-insecure":u.value,onConnected:M,onCancel:J[0]||(J[0]=Q=>y.value="")},null,8,["scanned-url","allow-insecure"])):Z("",!0),b("label",SF,L(C(t)("mobile.relayUrl")),1),b("div",CF,[it(b("select",{"onUpdate:modelValue":J[1]||(J[1]=Q=>r.value=Q),"data-testid":"account-login-scheme",disabled:g.value,onChange:J[2]||(J[2]=Q=>r.value==="https://"?u.value=!1:void 0)},J[12]||(J[12]=[b("option",{value:"https://"},"https://",-1),b("option",{value:"http://"},"http://",-1)]),40,kF),[[bg,r.value]]),it(b("input",{id:"account-relay-url","onUpdate:modelValue":J[3]||(J[3]=Q=>o.value=Q),"data-testid":"account-login-url",disabled:g.value,autocomplete:"off",autocapitalize:"off",spellcheck:"false",placeholder:"relay.example.com",onInput:_},null,40,xF),[[Pt,o.value]])]),r.value==="http://"?($(),F("label",RF,[b("span",null,L(C(t)("mobile.allowInsecure")),1),it(b("input",{"onUpdate:modelValue":J[4]||(J[4]=Q=>u.value=Q),"data-testid":"account-login-allow-insecure",disabled:g.value,type:"checkbox"},null,8,TF),[[vo,u.value]])])):Z("",!0),b("div",PF,[b("div",EF,[b("label",LF,L(C(t)("mobile.email")),1),it(b("input",{id:"account-login-email","onUpdate:modelValue":J[5]||(J[5]=Q=>c.value=Q),"data-testid":"account-login-email",disabled:g.value,type:"email",autocomplete:"username",autocapitalize:"off",spellcheck:"false"},null,8,DF),[[Pt,c.value]])]),b("div",MF,[b("label",AF,L(C(t)("mobile.password")),1),it(b("input",{id:"account-login-password","onUpdate:modelValue":J[6]||(J[6]=Q=>p.value=Q),"data-testid":"account-login-password",disabled:g.value,type:"password",autocomplete:"current-password"},null,8,IF),[[Pt,p.value]])])]),m.value?($(),F("p",$F,L(m.value),1)):Z("",!0),b("button",{type:"submit",class:"secondary primary-action","data-testid":"account-login-submit",disabled:g.value},L(g.value?C(t)("common.loading"):C(t)("mobile.loginButton")),9,OF)],32)):($(),F(Oe,{key:1},[b("section",FF,[b("label",BF,L(C(t)("settings.account.email")),1),b("p",HF,L(i.value?C(t)("common.loading"):s.value),1),b("button",{type:"button",class:"secondary","data-testid":"account-logout-button",disabled:a.value,onClick:S},L(a.value?C(t)("settings.account.logout.submitting"):C(t)("settings.account.logout.button")),9,NF)]),b("section",zF,[b("h3",null,L(C(t)("settings.account.changePassword.title")),1),b("div",UF,[b("label",VF,L(C(t)("settings.account.changePassword.oldPassword")),1),it(b("input",{id:"account-old-password","onUpdate:modelValue":J[7]||(J[7]=Q=>T.value=Q),"data-testid":"old-password-input",type:"password",autocomplete:"current-password",disabled:R.value},null,8,KF),[[Pt,T.value]])]),b("div",WF,[b("div",jF,[b("label",qF,L(C(t)("settings.account.changePassword.newPassword")),1),it(b("input",{id:"account-new-password","onUpdate:modelValue":J[8]||(J[8]=Q=>A.value=Q),"data-testid":"new-password-input",type:"password",autocomplete:"new-password",disabled:R.value},null,8,YF),[[Pt,A.value]]),A.value&&!O.value?($(),F("p",GF,L(C(t)("settings.account.changePassword.hintLength")),1)):Z("",!0)]),b("div",XF,[b("label",JF,L(C(t)("settings.account.changePassword.confirmPassword")),1),it(b("input",{id:"account-confirm-password","onUpdate:modelValue":J[9]||(J[9]=Q=>E.value=Q),"data-testid":"confirm-password-input",type:"password",autocomplete:"new-password",disabled:R.value,onKeyup:Xn(z,["enter"])},null,40,QF),[[Pt,E.value]]),E.value&&!U.value?($(),F("p",ZF,L(C(t)("settings.account.changePassword.hintMismatch")),1)):Z("",!0)])]),b("button",{type:"button",class:"secondary","data-testid":"change-password-submit",disabled:!W.value,onClick:z},L(R.value?C(t)("settings.account.changePassword.submitting"):C(t)("settings.account.changePassword.submit")),9,eB),D.value?($(),F("p",tB,L(D.value),1)):Z("",!0),I.value?($(),F("p",nB,L(I.value),1)):Z("",!0)]),b("section",sB,[b("h3",null,L(C(t)("settings.account.dangerZone.title")),1),b("p",iB,L(C(t)("settings.account.dangerZone.warning")),1),b("button",{type:"button",class:"secondary","data-testid":"danger-zone-toggle",onClick:ie},L(C(t)("settings.account.dangerZone.toggle")),1),N.value?($(),F(Oe,{key:0},[b("label",rB,L(C(t)("settings.account.dangerZone.currentPassword")),1),it(b("input",{id:"danger-current-password","onUpdate:modelValue":J[10]||(J[10]=Q=>V.value=Q),"data-testid":"danger-current-password",type:"password",autocomplete:"current-password",disabled:G.value},null,8,oB),[[Pt,V.value]]),b("label",aB,L(C(t)("settings.account.dangerZone.typeEmailToConfirm")),1),it(b("input",{id:"danger-confirm-email","onUpdate:modelValue":J[11]||(J[11]=Q=>q.value=Q),"data-testid":"danger-confirm-email",type:"text",autocomplete:"off",spellcheck:"false",disabled:G.value},null,8,lB),[[Pt,q.value]]),b("button",{type:"button",class:"danger-btn","data-testid":"danger-delete-button",disabled:!oe.value,onClick:ye},L(G.value?C(t)("settings.account.dangerZone.deleting"):C(t)("settings.account.dangerZone.deleteButton")),9,cB),te.value?($(),F("p",dB,L(te.value),1)):Z("",!0)],64)):Z("",!0)])],64))]))}}),hB=Ct(uB,[["__scopeId","data-v-55932ce0"]]);var Pa={},fB=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Sy={},Ds={};let wh;const pB=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Ds.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};Ds.getSymbolTotalCodewords=function(t){return pB[t]};Ds.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};Ds.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');wh=t};Ds.isKanjiModeEnabled=function(){return typeof wh<"u"};Ds.toSJIS=function(t){return wh(t)};var yc={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(s){return s&&typeof s.bit<"u"&&s.bit>=0&&s.bit<4},e.from=function(s,i){if(e.isValid(s))return s;try{return t(s)}catch{return i}}})(yc);function Cy(){this.buffer=[],this.length=0}Cy.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var vB=Cy;function Ea(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}Ea.prototype.set=function(e,t,n,s){const i=e*this.size+t;this.data[i]=n,s&&(this.reservedBit[i]=!0)};Ea.prototype.get=function(e,t){return this.data[e*this.size+t]};Ea.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};Ea.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var gB=Ea,ky={};(function(e){const t=Ds.getSymbolSize;e.getRowColCoords=function(s){if(s===1)return[];const i=Math.floor(s/7)+2,a=t(s),d=a===145?26:Math.ceil((a-13)/(2*i-2))*2,r=[a-7];for(let o=1;o=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const a=i.size;let d=0,r=0,o=0,c=null,p=null;for(let u=0;u=5&&(d+=t.N1+(r-5)),c=m,r=1),m=i.get(g,u),m===p?o++:(o>=5&&(d+=t.N1+(o-5)),p=m,o=1)}r>=5&&(d+=t.N1+(r-5)),o>=5&&(d+=t.N1+(o-5))}return d},e.getPenaltyN2=function(i){const a=i.size;let d=0;for(let r=0;r=10&&(r===1488||r===93)&&d++,o=o<<1&2047|i.get(p,c),p>=10&&(o===1488||o===93)&&d++}return d*t.N3},e.getPenaltyN4=function(i){let a=0;const d=i.data.length;for(let o=0;o=0;){const d=a[0];for(let o=0;o0){const a=new Uint8Array(this.degree);return a.set(s,i),a}return s};var _B=Sh,Ey={},fr={},Ch={};Ch.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var hi={};const Ly="[0-9]+",yB="[A-Z $%*+\\-./:]+";let _a="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";_a=_a.replace(/u/g,"\\u");const bB="(?:(?![A-Z0-9 $%*+\\-./:]|"+_a+`)(?:.|[\r +]))+`;hi.KANJI=new RegExp(_a,"g");hi.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");hi.BYTE=new RegExp(bB,"g");hi.NUMERIC=new RegExp(Ly,"g");hi.ALPHANUMERIC=new RegExp(yB,"g");const wB=new RegExp("^"+_a+"$"),SB=new RegExp("^"+Ly+"$"),CB=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");hi.testKanji=function(t){return wB.test(t)};hi.testNumeric=function(t){return SB.test(t)};hi.testAlphanumeric=function(t){return CB.test(t)};(function(e){const t=Ch,n=hi;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,d){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(d))throw new Error("Invalid version: "+d);return d>=1&&d<10?a.ccBits[0]:d<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return n.testNumeric(a)?e.NUMERIC:n.testAlphanumeric(a)?e.ALPHANUMERIC:n.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function s(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+i)}}e.from=function(a,d){if(e.isValid(a))return a;try{return s(a)}catch{return d}}})(fr);(function(e){const t=Ds,n=bc,s=yc,i=fr,a=Ch,d=7973,r=t.getBCHDigit(d);function o(g,m,y){for(let v=1;v<=40;v++)if(m<=e.getCapacity(v,y,g))return v}function c(g,m){return i.getCharCountIndicator(g,m)+4}function p(g,m){let y=0;return g.forEach(function(v){const l=c(v.mode,m);y+=l+v.getBitsLength()}),y}function u(g,m){for(let y=1;y<=40;y++)if(p(g,y)<=e.getCapacity(y,m,i.MIXED))return y}e.from=function(m,y){return a.isValid(m)?parseInt(m,10):y},e.getCapacity=function(m,y,v){if(!a.isValid(m))throw new Error("Invalid QR Code version");typeof v>"u"&&(v=i.BYTE);const l=t.getSymbolTotalCodewords(m),h=n.getTotalCodewordsCount(m,y),f=(l-h)*8;if(v===i.MIXED)return f;const _=f-c(v,m);switch(v){case i.NUMERIC:return Math.floor(_/10*3);case i.ALPHANUMERIC:return Math.floor(_/11*2);case i.KANJI:return Math.floor(_/13);case i.BYTE:default:return Math.floor(_/8)}},e.getBestVersionForData=function(m,y){let v;const l=s.from(y,s.M);if(Array.isArray(m)){if(m.length>1)return u(m,l);if(m.length===0)return 1;v=m[0]}else v=m;return o(v.mode,v.getLength(),l)},e.getEncodedBits=function(m){if(!a.isValid(m)||m<7)throw new Error("Invalid QR Code version");let y=m<<12;for(;t.getBCHDigit(y)-r>=0;)y^=d<=0;)i^=My<0&&(s=this.data.substr(n),i=parseInt(s,10),t.put(i,a*3+1))};var RB=Co;const TB=fr,Sd=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function ko(e){this.mode=TB.ALPHANUMERIC,this.data=e}ko.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};ko.prototype.getLength=function(){return this.data.length};ko.prototype.getBitsLength=function(){return ko.getBitsLength(this.data.length)};ko.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let s=Sd.indexOf(this.data[n])*45;s+=Sd.indexOf(this.data[n+1]),t.put(s,11)}this.data.length%2&&t.put(Sd.indexOf(this.data[n]),6)};var PB=ko;const EB=fr;function xo(e){this.mode=EB.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}xo.getBitsLength=function(t){return t*8};xo.prototype.getLength=function(){return this.data.length};xo.prototype.getBitsLength=function(){return xo.getBitsLength(this.data.length)};xo.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` +Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var AB=Ro,Iy={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,s,i){var a={},d={};d[s]=0;var r=t.PriorityQueue.make();r.push(s,0);for(var o,c,p,u,g,m,y,v,l;!r.empty();){o=r.pop(),c=o.value,u=o.cost,g=n[c]||{};for(p in g)g.hasOwnProperty(p)&&(m=g[p],y=u+m,v=d[p],l=typeof d[p]>"u",(l||v>y)&&(d[p]=y,r.push(p,y),a[p]=c))}if(typeof i<"u"&&typeof d[i]>"u"){var h=["Could not find a path from ",s," to ",i,"."].join("");throw new Error(h)}return a},extract_shortest_path_from_predecessor_list:function(n,s){for(var i=[],a=s;a;)i.push(a),n[a],a=n[a];return i.reverse(),i},find_path:function(n,s,i){var a=t.single_source_shortest_paths(n,s,i);return t.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(n){var s=t.PriorityQueue,i={},a;n=n||{};for(a in s)s.hasOwnProperty(a)&&(i[a]=s[a]);return i.queue=[],i.sorter=n.sorter||s.default_sorter,i},default_sorter:function(n,s){return n.cost-s.cost},push:function(n,s){var i={value:n,cost:s};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Iy);var IB=Iy.exports;(function(e){const t=fr,n=RB,s=PB,i=LB,a=AB,d=hi,r=Ds,o=IB;function c(h){return unescape(encodeURIComponent(h)).length}function p(h,f,_){const S=[];let k;for(;(k=h.exec(_))!==null;)S.push({data:k[0],index:k.index,mode:f,length:k[0].length});return S}function u(h){const f=p(d.NUMERIC,t.NUMERIC,h),_=p(d.ALPHANUMERIC,t.ALPHANUMERIC,h);let S,k;return r.isKanjiModeEnabled()?(S=p(d.BYTE,t.BYTE,h),k=p(d.KANJI,t.KANJI,h)):(S=p(d.BYTE_KANJI,t.BYTE,h),k=[]),f.concat(_,S,k).sort(function(M,w){return M.index-w.index}).map(function(M){return{data:M.data,mode:M.mode,length:M.length}})}function g(h,f){switch(f){case t.NUMERIC:return n.getBitsLength(h);case t.ALPHANUMERIC:return s.getBitsLength(h);case t.KANJI:return a.getBitsLength(h);case t.BYTE:return i.getBitsLength(h)}}function m(h){return h.reduce(function(f,_){const S=f.length-1>=0?f[f.length-1]:null;return S&&S.mode===_.mode?(f[f.length-1].data+=_.data,f):(f.push(_),f)},[])}function y(h){const f=[];for(let _=0;_=0&&r<=6&&(o===0||o===6)||o>=0&&o<=6&&(r===0||r===6)||r>=2&&r<=4&&o>=2&&o<=4?e.set(a+r,d+o,!0,!0):e.set(a+r,d+o,!1,!0))}}function VB(e){const t=e.size;for(let n=8;n>r&1)===1,e.set(i,a,d,!0),e.set(a,i,d,!0)}function xd(e,t,n){const s=e.size,i=NB.getEncodedBits(t,n);let a,d;for(a=0;a<15;a++)d=(i>>a&1)===1,a<6?e.set(a,8,d,!0):a<8?e.set(a+1,8,d,!0):e.set(s-15+a,8,d,!0),a<8?e.set(8,s-a-1,d,!0):a<9?e.set(8,15-a-1+1,d,!0):e.set(8,15-a-1,d,!0);e.set(s-8,8,1,!0)}function jB(e,t){const n=e.size;let s=-1,i=n-1,a=7,d=0;for(let r=n-1;r>0;r-=2)for(r===6&&r--;;){for(let o=0;o<2;o++)if(!e.isReserved(i,r-o)){let c=!1;d>>a&1)===1),e.set(i,r-o,c),a--,a===-1&&(d++,a=7)}if(i+=s,i<0||n<=i){i-=s,s=-s;break}}}function qB(e,t,n){const s=new $B;n.forEach(function(o){s.put(o.mode.bit,4),s.put(o.getLength(),zB.getCharCountIndicator(o.mode,e)),o.write(s)});const i=Sc.getSymbolTotalCodewords(e),a=wu.getTotalCodewordsCount(e,t),d=(i-a)*8;for(s.getLengthInBits()+4<=d&&s.put(0,4);s.getLengthInBits()%8!==0;)s.putBit(0);const r=(d-s.getLengthInBits())/8;for(let o=0;o=7&&WB(o,t),jB(o,d),isNaN(s)&&(s=bu.getBestMask(o,xd.bind(null,o,n))),bu.applyMask(s,o),xd(o,n,s),{modules:o,version:t,errorCorrectionLevel:n,maskPattern:s,segments:i}}Sy.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let s=Cd.M,i,a;return typeof n<"u"&&(s=Cd.from(n.errorCorrectionLevel,Cd.M),i=Xl.from(n.version),a=bu.from(n.maskPattern),n.toSJISFunc&&Sc.setToSJISFunction(n.toSJISFunc)),GB(t,i,s,a)};var $y={},kh={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let s=n.slice().replace("#","").split("");if(s.length<3||s.length===5||s.length>8)throw new Error("Invalid hex color: "+n);(s.length===3||s.length===4)&&(s=Array.prototype.concat.apply([],s.map(function(a){return[a,a]}))),s.length===6&&s.push("F","F");const i=parseInt(s.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+s.slice(0,6).join("")}}e.getOptions=function(s){s||(s={}),s.color||(s.color={});const i=typeof s.margin>"u"||s.margin===null||s.margin<0?4:s.margin,a=s.width&&s.width>=21?s.width:void 0,d=s.scale||4;return{width:a,scale:a?4:d,margin:i,color:{dark:t(s.color.dark||"#000000ff"),light:t(s.color.light||"#ffffffff")},type:s.type,rendererOpts:s.rendererOpts||{}}},e.getScale=function(s,i){return i.width&&i.width>=s+i.margin*2?i.width/(s+i.margin*2):i.scale},e.getImageWidth=function(s,i){const a=e.getScale(s,i);return Math.floor((s+i.margin*2)*a)},e.qrToImageData=function(s,i,a){const d=i.modules.size,r=i.modules.data,o=e.getScale(d,a),c=Math.floor((d+a.margin*2)*o),p=a.margin*o,u=[a.color.light,a.color.dark];for(let g=0;g=p&&m>=p&&g"u"&&(!d||!d.getContext)&&(o=d,d=void 0),d||(c=s()),o=t.getOptions(o);const p=t.getImageWidth(a.modules.size,o),u=c.getContext("2d"),g=u.createImageData(p,p);return t.qrToImageData(g.data,a,o),n(u,c,p),u.putImageData(g,0,0),c},e.renderToDataURL=function(a,d,r){let o=r;typeof o>"u"&&(!d||!d.getContext)&&(o=d,d=void 0),o||(o={});const c=e.render(a,d,o),p=o.type||"image/png",u=o.rendererOpts||{};return c.toDataURL(p,u.quality)}})($y);var Oy={};const XB=kh;function Fv(e,t){const n=e.a/255,s=t+'="'+e.hex+'"';return n<1?s+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':s}function Rd(e,t,n){let s=e+t;return typeof n<"u"&&(s+=" "+n),s}function JB(e,t,n){let s="",i=0,a=!1,d=0;for(let r=0;r0&&o>0&&e[r-1]||(s+=a?Rd("M",o+n,.5+c+n):Rd("m",i,0),i=0,a=!1),o+1':"",c="',p='viewBox="0 0 '+r+" "+r+'"',g=''+o+c+` +`;return typeof s=="function"&&s(null,g),g};const QB=fB,Su=Sy,Fy=$y,ZB=Oy;function xh(e,t,n,s,i){const a=[].slice.call(arguments,1),d=a.length,r=typeof a[d-1]=="function";if(!r&&!QB())throw new Error("Callback required as last argument");if(r){if(d<2)throw new Error("Too few arguments provided");d===2?(i=n,n=t,t=s=void 0):d===3&&(t.getContext&&typeof i>"u"?(i=s,s=void 0):(i=s,s=n,n=t,t=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(n=t,t=s=void 0):d===2&&!t.getContext&&(s=n,n=t,t=void 0),new Promise(function(o,c){try{const p=Su.create(n,s);o(e(p,t,s))}catch(p){c(p)}})}try{const o=Su.create(n,s);i(null,e(o,t,s))}catch(o){i(o)}}Pa.create=Su.create;Pa.toCanvas=xh.bind(null,Fy.render);Pa.toDataURL=xh.bind(null,Fy.renderToDataURL);Pa.toString=xh.bind(null,function(e,t,n){return ZB.render(e,n)});const e6={class:"pairing-panel","data-testid":"pairing-panel"},t6={class:"title"},n6={class:"hint"},s6=["disabled"],i6={key:1,class:"qr-wrap"},r6=["src"],o6={key:0,class:"wrap-badge","data-testid":"pair-wrap-badge"},a6={key:1,class:"wrap-warning","data-testid":"pair-wrap-warning"},l6={key:2,class:"countdown"},c6={class:"time"},d6={key:3,class:"countdown expired","data-testid":"pair-expired"},u6={class:"prefix"},h6={key:2,class:"error"},f6=$e({__name:"PairingPanel",setup(e){const{t}=$t(),n=H(!1),s=H(""),i=H(null),a=H(""),d=H(Math.floor(Date.now()/1e3));let r=null;const o=j(()=>i.value?Math.max(0,i.value.expires_at-d.value):0),c=j(()=>{const g=o.value,m=Math.floor(g/60),y=g%60;return`${m}:${y.toString().padStart(2,"0")}`}),p=j(()=>i.value!==null&&o.value===0);async function u(){n.value=!0,s.value="";try{const g=await J1();a.value=await Pa.toDataURL(g.qr_url,{width:240,margin:1}),i.value=g,d.value=Math.floor(Date.now()/1e3),r&&clearInterval(r),r=setInterval(()=>{d.value=Math.floor(Date.now()/1e3)},1e3)}catch(g){s.value=g instanceof Error?g.message:String(g)}finally{n.value=!1}}return Vt(()=>{r&&clearInterval(r)}),(g,m)=>($(),F("section",e6,[b("div",t6,L(C(t)("settings.relay.pairing.title")),1),b("p",n6,L(C(t)("settings.relay.pairing.hint")),1),i.value?($(),F("div",i6,[b("img",{src:a.value,alt:"",class:lt(["qr",{dimmed:p.value}]),"data-testid":"pair-qr"},null,10,r6),i.value.wrapped?($(),F("div",o6,L(C(t)("settings.relay.pairing.wrappedBadge")),1)):($(),F("p",a6,L(C(t)("settings.relay.pairing.unwrappedWarning")),1)),p.value?($(),F("div",d6,L(C(t)("settings.relay.pairing.expired")),1)):($(),F("div",l6,[b("span",null,L(C(t)("settings.relay.pairing.expiresIn")),1),b("span",c6,L(c.value),1)])),b("code",u6,L(i.value.token.slice(0,12))+"…",1),b("button",{type:"button","data-testid":"pair-regenerate",onClick:u},L(C(t)("settings.relay.pairing.regenerate")),1)])):($(),F("button",{key:0,type:"button","data-testid":"pair-generate",disabled:n.value,onClick:u},L(n.value?C(t)("settings.relay.pairing.generating"):C(t)("settings.relay.pairing.generate")),9,s6)),s.value?($(),F("p",h6,L(s.value),1)):Z("",!0)]))}}),p6=Ct(f6,[["__scopeId","data-v-45575575"]]),v6={class:"tab-pane"},g6={key:0,class:"dim"},m6={class:"uplink-toggle-row"},_6={class:"field-label"},y6=["disabled"],b6={class:"toggle-label"},w6={class:"hint"},S6={class:"url-label-row"},C6={class:"field-label",for:"relay-host"},k6={class:"insecure-inline"},x6=["disabled"],R6={class:"url-scheme","aria-hidden":"true"},T6=["disabled"],P6={key:0,class:"warning"},E6={class:"settings-field-grid settings-field-grid--two","data-test":"relay-credentials-grid"},L6={class:"settings-field"},D6={class:"field-label",for:"relay-email"},M6=["autocomplete","disabled"],A6={class:"settings-field"},I6={class:"field-label",for:"relay-password"},$6={class:"password-field"},O6=["type","disabled"],F6=["aria-label","aria-pressed","disabled"],B6={key:0,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},H6={key:1,width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"},N6={class:"field-label",for:"relay-claim-token"},z6=["placeholder","disabled"],U6={class:"hint"},V6=["disabled"],K6={class:"auth-switch-action"},W6={class:"checkbox"},j6=["checked","disabled"],q6={key:2,class:"warning"},Y6={key:3,class:"error"},G6={class:"danger-zone"},X6={class:"danger-zone-text"},J6={class:"field-label"},Q6={class:"hint"},Z6=["disabled"],e8=$e({__name:"SettingsRelay",emits:["relay-config-changed","dirty"],setup(e,{expose:t,emit:n}){const s=dn(),i=n,a=H(""),d=H(""),r=H(!1),o=H(!1),c=H(!1),p=H(!0),u=H(!1),g=H(!1),m=H(!1),y=H(""),{t:v}=$t(),l=H(""),h=H(""),f=H(!1),_=H("login"),S=H(""),k=H(""),P=H(""),M=H(""),w=H(""),T=H(!1);function A(ye){return ye.trim().replace(/^[a-zA-Z][a-zA-Z0-9+.-]*:\/\//,"")}const E=j(()=>"https://");yt(a,ye=>{/:\/\//.test(ye)&&(a.value=A(ye))});const R=j(()=>{const ye=A(a.value);return ye?E.value+ye:""}),D=j(()=>A(a.value)!==M.value||d.value!==w.value||r.value!==T.value);yt(D,ye=>i("dirty",ye));function I(){_.value=_.value==="login"?"register":"login",_.value==="login"&&(S.value="")}function O(ye){try{const K=new URL(ye.trim());return K.host?["http:","https:","ws:","wss:"].includes(K.protocol):!1}catch{return!1}}const U=j(()=>P.value?{text:v("settings.relay.connectedAs",{identity:P.value}),cls:"on"}:k.value?{text:v("settings.relay.connectedAs",{identity:k.value.slice(0,8)}),cls:"on"}:R.value?c.value?{text:v("settings.relay.paused"),cls:"off"}:O(R.value)?{text:v("settings.relay.connecting"),cls:"warn"}:{text:v("settings.relay.relayInvalid"),cls:"error"}:{text:v("settings.relay.notConfigured"),cls:"off"});async function W(){p.value=!0;try{const ye=await Pl();if(r.value=ye.allow_insecure_relay,a.value=A(ye.url),d.value=ye.token,o.value=ye.disable_e2ee??!1,c.value=ye.paused??!1,N(),l.value=ye.last_email??"",l.value)try{h.value=await Y1()}catch{}else h.value="";if(k.value="",P.value="",ye.token)try{const K=await gf();P.value=K.email||"",k.value=K.user_id||""}catch{}}catch(ye){y.value=(ye==null?void 0:ye.message)??String(ye)}finally{p.value=!1}}Dt(async()=>{await W(),s.events.on("relay:auth-info",async ye=>{const{user_id:K}=ye;if(k.value=K||"",!K){P.value="";return}try{const J=await gf();P.value=J.email||""}catch{}}),s.events.on("e2ee-mode-changed",ye=>{const K=ye==null?void 0:ye.disabled;typeof K=="boolean"&&(o.value=K)})}),Vt(()=>{});async function z(ye){const K=ye.target,J=!!(K!=null&&K.checked);o.value=J;try{await K1(J)}catch(Q){o.value=!J,y.value=(Q==null?void 0:Q.message)??String(Q)}}function N(){M.value=A(a.value),w.value=d.value,T.value=r.value}async function V(){try{await vf({url:R.value,token:d.value,session_expires_at:0,allow_insecure_relay:r.value,disable_e2ee:o.value,remote_permission:"full",last_email:l.value.trim()})}catch{}if(h.value)try{await G1(h.value)}catch(ye){Lt("relay","remember relay password failed",{error:Rt(ye)})}N()}async function q(){if(u.value=!0,y.value="",!O(R.value)){y.value=v("settings.relay.relayInvalid"),u.value=!1;return}try{await X1(R.value,r.value)}catch(J){await V(),y.value=v("settings.relay.versionProbeFailed",{reason:(J==null?void 0:J.message)??String(J)}),u.value=!1;return}const ye=!!(l.value.trim()&&h.value),K=!!d.value;if(ye){try{_.value==="register"?await q1(R.value,l.value.trim(),h.value,S.value.trim(),r.value):await j1(R.value,l.value.trim(),h.value,r.value)}catch(J){await V(),y.value=v("settings.relay.loginFailedInline",{reason:(J==null?void 0:J.message)??String(J)}),u.value=!1;return}S.value=""}else if(K)try{await vf({url:R.value,token:d.value,session_expires_at:0,allow_insecure_relay:r.value,disable_e2ee:o.value,remote_permission:"full"})}catch(J){y.value=(J==null?void 0:J.message)??String(J),u.value=!1;return}else{await V(),y.value=v("settings.relay.credentialsRequired"),u.value=!1;return}try{const J=await Pl();r.value=J.allow_insecure_relay,a.value=A(J.url),d.value=J.token,o.value=J.disable_e2ee??!1,c.value=J.paused??!1,l.value=J.last_email??"",N()}catch(J){y.value=(J==null?void 0:J.message)??String(J),u.value=!1;return}u.value=!1,i("relay-config-changed")}async function G(){m.value=!0,y.value="";try{await W1(c.value),i("relay-config-changed")}catch(ye){y.value=(ye==null?void 0:ye.message)??String(ye),c.value=!c.value}finally{m.value=!1}}async function te(){if(window.confirm(v("settings.relay.clearConfirm"))){g.value=!0,y.value="";try{await V1(),await W(),N(),i("relay-config-changed")}catch(ye){y.value=v("settings.relay.clearFailed",{reason:(ye==null?void 0:ye.message)??String(ye)})}finally{g.value=!1}}}const oe=j(()=>!u.value&&!!A(a.value)),ie=j(()=>u.value?v("settings.relay.saving"):v("settings.relay.saveConnect"));return t({save:q,canSave:oe,saveLabel:ie,paused:c,saving:u,dirty:D}),(ye,K)=>($(),F("div",v6,[p.value?($(),F("div",g6,L(C(v)("common.loading")),1)):($(),F(Oe,{key:1},[b("div",m6,[b("span",_6,L(C(v)("settings.relay.uplink")),1),b("label",{class:lt(["toggle-switch",{disabled:m.value}])},[it(b("input",{"onUpdate:modelValue":K[0]||(K[0]=J=>c.value=J),type:"checkbox","true-value":!1,"false-value":!0,disabled:m.value||!a.value,onChange:G},null,40,y6),[[vo,c.value]]),K[7]||(K[7]=b("span",{class:"toggle-track"},[b("span",{class:"toggle-thumb"})],-1)),b("span",b6,L(c.value?C(v)("settings.relay.off"):C(v)("settings.relay.on")),1)],2)]),b("div",{class:lt(["status-pill",U.value.cls])},[K[8]||(K[8]=b("span",{class:"dot"},"●",-1)),ot(" "+L(U.value.text),1)],2),b("p",w6,L(C(v)("settings.relay.hint")),1),b("div",S6,[b("label",C6,L(C(v)("settings.relay.relayUrl")),1),b("label",k6,[it(b("input",{"onUpdate:modelValue":K[1]||(K[1]=J=>r.value=J),type:"checkbox",disabled:u.value},null,8,x6),[[vo,r.value]]),ot(" "+L(C(v)("settings.relay.insecureMode")),1)])]),b("div",{class:lt(["url-input",{insecure:r.value}])},[b("span",R6,L(E.value),1),it(b("input",{id:"relay-host","onUpdate:modelValue":K[2]||(K[2]=J=>a.value=J),type:"text",placeholder:"relay.example.com",autocomplete:"off",spellcheck:"false",disabled:u.value,onKeyup:Xn(q,["enter"])},null,40,T6),[[Pt,a.value]])],2),r.value?($(),F("p",P6,L(C(v)("settings.relay.insecureWarning")),1)):Z("",!0),b("div",E6,[b("div",L6,[b("label",D6,L(C(v)("settings.relay.email")),1),it(b("input",{id:"relay-email","onUpdate:modelValue":K[3]||(K[3]=J=>l.value=J),type:"email",autocomplete:_.value==="register"?"email":"username",disabled:u.value,onKeyup:Xn(q,["enter"])},null,40,M6),[[Pt,l.value]])]),b("div",A6,[b("label",I6,L(C(v)("settings.relay.password")),1),b("div",$6,[it(b("input",{id:"relay-password","onUpdate:modelValue":K[4]||(K[4]=J=>h.value=J),type:f.value?"text":"password",autocomplete:"current-password",disabled:u.value,onKeyup:Xn(q,["enter"])},null,40,O6),[[x0,h.value]]),b("button",{type:"button",class:"password-toggle","aria-label":f.value?C(v)("settings.relay.passwordHide"):C(v)("settings.relay.passwordShow"),"aria-pressed":f.value,disabled:u.value,onClick:K[5]||(K[5]=J=>f.value=!f.value)},[f.value?($(),F("svg",H6,K[10]||(K[10]=[b("path",{d:"M17.94 17.94A10.07 10.07 0 0 1 12 20c-7 0-11-8-11-8a18.45 18.45 0 0 1 5.06-5.94M9.9 4.24A9.12 9.12 0 0 1 12 4c7 0 11 8 11 8a18.5 18.5 0 0 1-2.16 3.19m-6.72-1.07a3 3 0 1 1-4.24-4.24"},null,-1),b("line",{x1:"1",y1:"1",x2:"23",y2:"23"},null,-1)]))):($(),F("svg",B6,K[9]||(K[9]=[b("path",{d:"M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"},null,-1),b("circle",{cx:"12",cy:"12",r:"3"},null,-1)])))],8,F6)])])]),_.value==="register"?($(),F(Oe,{key:1},[b("label",N6,L(C(v)("settings.relay.claimToken")),1),it(b("input",{id:"relay-claim-token","onUpdate:modelValue":K[6]||(K[6]=J=>S.value=J),type:"text",autocomplete:"off",spellcheck:"false",placeholder:C(v)("settings.relay.claimTokenPlaceholder"),disabled:u.value,onKeyup:Xn(q,["enter"])},null,40,z6),[[Pt,S.value]]),b("p",U6,L(C(v)("settings.relay.claimTokenHint")),1)],64)):Z("",!0),b("button",{type:"button",class:"auth-switch",disabled:u.value,onClick:I},[ot(L(_.value==="login"?C(v)("settings.relay.noAccountPrompt"):C(v)("settings.relay.haveAccountPrompt"))+" ",1),b("span",K6,L(_.value==="login"?C(v)("settings.relay.modeRegister"):C(v)("settings.relay.modeLogin")),1)],8,V6),b("label",W6,[b("input",{checked:o.value,type:"checkbox",disabled:u.value,onChange:z},null,40,j6),ot(" "+L(C(v)("settings.relay.disableE2EE")),1)]),o.value?($(),F("p",q6,L(C(v)("settings.relay.disableE2EEWarning")),1)):Z("",!0),y.value?($(),F("p",Y6,L(y.value),1)):Z("",!0),Pe(p6),b("div",G6,[b("div",X6,[b("div",J6,L(C(v)("settings.relay.clearTitle")),1),b("p",Q6,L(C(v)("settings.relay.clearHint")),1)]),b("button",{type:"button",class:"danger-btn",disabled:u.value||g.value||p.value,onClick:te},L(g.value?C(v)("settings.relay.clearing"):C(v)("settings.relay.clearAction")),9,Z6)])],64))]))}}),t8=Ct(e8,[["__scopeId","data-v-100947b5"]]),Cu={DEBUG:0,INFO:1,WARN:2,ERROR:3},n8=/^(\d{4}\/\d{2}\/\d{2} \d{2}:\d{2}:\d{2}\.\d{3}) (DEBUG|INFO|WARN|ERROR)\s+\[([^\]]+)\] (.*)$/;function By(e){const t=n8.exec(e);return t?{kind:"structured",ts:t[1],level:t[2],tag:t[3],msg:t[4]}:{kind:"raw",text:e}}function s8(e,t){return Cu[e]>=Cu[t]}const Hy=[{value:"DEBUG",label:"DEBUG+"},{value:"INFO",label:"INFO+"},{value:"WARN",label:"WARN+"},{value:"ERROR",label:"ERROR"}],i8=[{value:"DEBUG",label:"DEBUG"},{value:"INFO",label:"INFO"},{value:"WARN",label:"WARN"},{value:"ERROR",label:"ERROR"}];function r8(e){return e in Cu}const Cc="",Jl="*";function o8(e,t){if(!t)return!0;if(t.endsWith(Jl)){const n=t.slice(0,-Jl.length);return e===n||e.startsWith(n+"-")}return e===t}function Ny(e,t){const n=new Map;for(const r of e.split(` +`)){const o=By(r);o.kind==="structured"&&n.set(o.tag,(n.get(o.tag)??0)+1)}const s=Array.from(n.values()).reduce((r,o)=>r+o,0),i=new Map;for(const r of n.keys()){const o=r.split("-")[0];i.set(o,[...i.get(o)??[],r])}const a=Array.from(i.entries()).filter(([,r])=>r.length>1).map(([r,o])=>({value:r+Jl,label:`${r}${Jl} (${o.reduce((c,p)=>c+(n.get(p)??0),0)})`})).sort((r,o)=>r.value.localeCompare(o.value)),d=Array.from(n.entries()).map(([r,o])=>({value:r,label:`${r} (${o})`})).sort((r,o)=>r.value.localeCompare(o.value));return[{value:Cc,label:`${t} (${s})`},...a,...d]}const a8={class:"log-lines"},l8={class:"ts"},c8={class:"lvl"},d8={class:"tag"},u8={class:"msg"},h8={key:1,class:"raw"},f8=$e({__name:"LogLines",props:{content:{},minLevel:{default:"DEBUG"},tag:{default:Cc}},setup(e){const t=e,n=j(()=>t.content.split(` +`).map(By).filter(i=>i.kind==="raw"?!0:s8(i.level,t.minLevel)&&o8(i.tag,t.tag)));return(s,i)=>($(),F("div",a8,[($(!0),F(Oe,null,at(n.value,(a,d)=>($(),F("div",{key:d,class:lt(["log-line",a.kind==="structured"?"lvl-"+a.level:"lvl-raw"])},[a.kind==="structured"?($(),F(Oe,{key:0},[b("span",l8,L(a.ts),1),b("span",c8,L(a.level),1),b("span",d8,"["+L(a.tag)+"]",1),b("span",u8,L(a.msg),1)],64)):($(),F("span",h8,L(a.text),1))],2))),128))]))}}),zy=Ct(f8,[["__scopeId","data-v-c9e8e2b4"]]),p8={class:"tab-pane"},v8={key:0,class:"dim"},g8={class:"checkbox"},m8=["checked"],_8={class:"level-row"},y8={class:"level-label"},b8={class:"level-select"},w8=["aria-label","title"],S8={class:"checkbox-row"},C8={class:"checkbox"},k8=["checked"],x8=["aria-label","title"],R8={class:"kv"},T8={class:"k"},P8=["title"],E8={class:"actions"},L8={key:0,class:"error"},D8={key:1,class:"tail-wrap"},M8={class:"tail-header"},A8={class:"tail-label"},I8=["title"],$8={class:"tail-level"},O8={class:"tail-tag"},F8=["disabled"],B8={key:0,class:"tail-error"},H8={key:1,class:"tail-empty"},N8=$e({__name:"SettingsLogging",emits:["open-log-viewer"],setup(e){const t=H(!0),n=H(""),s=H(""),i=H(!0),a=H(""),d=H(!1),r=H("INFO"),{t:o}=$t(),c=H(null),p=H(""),u=H(!1);let g=null;const m=H(null),y=H("DEBUG"),v=H(Cc),l=j(()=>{var R;return Ny(((R=c.value)==null?void 0:R.content)??"",o("settings.logging.tagFilterAll"))}),h=H(!0);function f(){var R;return(R=m.value)==null?void 0:R.$el}function _(R){return R.scrollHeight-R.scrollTop-R.clientHeight<24}async function S(R){if(!t.value)return;const D=f();if(!(R!=null&&R.force)&&D&&!_(D)){h.value=!1;return}h.value=!0,u.value=!0,p.value="";try{c.value=await dm()}catch(O){p.value=(O==null?void 0:O.message)??String(O)}finally{u.value=!1}await cn();const I=f();I&&(I.scrollTop=I.scrollHeight)}function k(){const R=f();if(!R)return;const D=_(R);D&&!h.value?S():h.value=D}yt(m,(R,D,I)=>{const O=R==null?void 0:R.$el;O&&(O.addEventListener("scroll",k,{passive:!0}),I(()=>O.removeEventListener("scroll",k)))});function P(R){t.value=R.enabled,n.value=R.path,s.value=R.effective_path,r8(R.level)&&(r.value=R.level)}Dt(async()=>{try{P(await Yo())}catch(R){a.value=(R==null?void 0:R.message)??String(R)}finally{i.value=!1}try{d.value=await iC()}catch{}await S(),g=window.setInterval(S,3e3)}),Vt(()=>{g!==null&&(window.clearInterval(g),g=null)});async function M(R){const D=R.target,I=t.value;t.value=D.checked,a.value="";try{await Ga({enabled:D.checked,path:n.value}),P(await Yo())}catch(O){t.value=I,a.value=(O==null?void 0:O.message)??String(O)}}async function w(R){const D=r.value;r.value=R,a.value="";try{await Ga({enabled:t.value,path:n.value,level:R}),P(await Yo()),await S({force:!0})}catch(I){r.value=D,a.value=(I==null?void 0:I.message)??String(I)}}async function T(R){const D=R.target,I=d.value;d.value=D.checked;try{await rC(D.checked)}catch(O){d.value=I,a.value=(O==null?void 0:O.message)??String(O)}}async function A(){a.value="";try{const R=await WS();if(!R)return;await Ga({enabled:t.value,path:R}),P(await Yo())}catch(R){a.value=(R==null?void 0:R.message)??String(R)}}async function E(){a.value="";try{await Ga({enabled:t.value,path:""}),P(await Yo())}catch(R){a.value=(R==null?void 0:R.message)??String(R)}}return(R,D)=>($(),F("div",p8,[i.value?($(),F("div",v8,L(C(o)("common.loading")),1)):($(),F(Oe,{key:1},[b("label",g8,[b("input",{type:"checkbox",checked:t.value,onChange:M},null,40,m8),ot(" "+L(C(o)("settings.logging.writeLogs")),1)]),b("div",_8,[b("span",y8,L(C(o)("settings.logging.writeLevel")),1),b("div",b8,[Pe(ts,{modelValue:r.value,options:C(i8),ariaLabel:C(o)("settings.logging.writeLevel"),"onUpdate:modelValue":D[0]||(D[0]=I=>w(I))},null,8,["modelValue","options","ariaLabel"])]),b("span",{class:"info-icon",role:"img","aria-label":C(o)("settings.logging.writeLevelHint"),title:C(o)("settings.logging.writeLevelHint")},"i",8,w8)]),b("div",S8,[b("label",C8,[b("input",{type:"checkbox",checked:d.value,onChange:T},null,40,k8),ot(" "+L(C(o)("settings.logging.ptyInputDebug")),1)]),b("span",{class:"info-icon",role:"img","aria-label":C(o)("settings.logging.ptyInputDebugHint"),title:C(o)("settings.logging.ptyInputDebugHint")},"i",8,x8)]),b("div",R8,[b("span",T8,L(C(o)("settings.logging.currentFile")),1),b("span",{class:"v path",title:s.value},L(s.value),9,P8)]),b("div",E8,[b("button",{onClick:A},L(C(o)("settings.logging.changeLocation")),1),b("button",{onClick:E},L(C(o)("settings.logging.resetDefault")),1),b("button",{onClick:D[1]||(D[1]=I=>R.$emit("open-log-viewer"))},L(C(o)("settings.logging.viewLogs")),1)]),a.value?($(),F("p",L8,L(a.value),1)):Z("",!0),t.value?($(),F("section",D8,[b("header",M8,[b("span",A8,L(C(o)("settings.logging.liveTail")),1),h.value?Z("",!0):($(),F("button",{key:0,class:"tail-paused",title:C(o)("settings.logging.tailPausedHint"),onClick:D[2]||(D[2]=I=>S({force:!0}))},L(C(o)("settings.logging.tailPaused")),9,I8)),b("div",$8,[Pe(ts,{modelValue:y.value,options:C(Hy),ariaLabel:C(o)("settings.logging.levelFilter"),"onUpdate:modelValue":D[3]||(D[3]=I=>y.value=I)},null,8,["modelValue","options","ariaLabel"])]),b("div",O8,[Pe(ts,{modelValue:v.value,options:l.value,ariaLabel:C(o)("settings.logging.tagFilter"),"onUpdate:modelValue":D[4]||(D[4]=I=>v.value=I)},null,8,["modelValue","options","ariaLabel"])]),b("button",{class:"tail-refresh",disabled:u.value,onClick:D[5]||(D[5]=I=>S({force:!0}))},L(C(o)("common.refresh")),9,F8)]),p.value?($(),F("p",B8,L(p.value),1)):!c.value||!c.value.exists?($(),F("p",H8,L(C(o)("settings.logging.noContent")),1)):($(),bt(zy,{key:2,ref_key:"tailEl",ref:m,class:"tail-content",content:c.value.content,minLevel:y.value,tag:v.value},null,8,["content","minLevel","tag"]))])):Z("",!0)],64))]))}}),z8=Ct(N8,[["__scopeId","data-v-cd8d05fa"]]);function Uy(e,t=Date.now()){const n=Math.floor(t/1e3)-e;return n<60?rn("settings.updates.justNow"):n<3600?rn("settings.updates.minutesAgo",{count:Math.floor(n/60)}):n<86400?rn("settings.updates.hoursAgo",{count:Math.floor(n/3600)}):rn("settings.updates.daysAgo",{count:Math.floor(n/86400)})}const U8={class:"tab-pane"},V8={key:0,class:"dim"},K8={class:"grid"},W8={class:"kv"},j8={class:"k"},q8={class:"v"},Y8={class:"kv"},G8={class:"k"},X8={class:"v"},J8={key:0,class:"kv"},Q8={class:"k"},Z8=["title"],eH={key:0,class:"checkbox"},tH=["checked"],nH={key:1,class:"proxy-box"},sH={class:"field-label",for:"update-gh-proxy"},iH={class:"proxy-row"},rH=["disabled"],oH={class:"hint"},aH={key:2,class:"notes"},lH={key:3,class:"version-lines"},cH=["value"],dH={key:4,class:"actions"},uH=["disabled"],hH=["disabled"],fH=["disabled"],pH={key:5,class:"error"},vH=$e({__name:"SettingsUpdates",emits:["request-install"],setup(e){const t=H(null),n=H(!0),s=H(""),i=H(!1),a=H(!1),d=H(!0),r=H(""),o=H(""),c=H(!1),p=H(!1),u=H(!1);let g=null;const{t:m}=$t();function y(A){const E=A.replace(/^v/,"").split(".");return E.length<2?"":`v${E[0]}.${E[1]}`}yt(()=>{var A;return(A=t.value)==null?void 0:A.lines},A=>{var D;if(!A||A.length===0||o.value&&A.some(I=>I.minor===o.value))return;const E=y(((D=t.value)==null?void 0:D.current)??""),R=A.find(I=>I.minor===E);o.value=R?R.minor:A[0].minor},{immediate:!0});const v=j(()=>{var R;const E=(((R=t.value)==null?void 0:R.lines)??[]).find(D=>D.minor===o.value);return(E==null?void 0:E.latest)??""});Dt(async()=>{try{const[A,E,R]=await Promise.all([go(),om(),xf()]);t.value=A,n.value=E,s.value=R}catch(A){r.value=(A==null?void 0:A.message)??String(A)}finally{d.value=!1}g=window.setInterval(async()=>{try{t.value=await go()}catch{}},2e3)}),Vt(()=>{g!==null&&window.clearInterval(g)});async function l(){i.value=!0;try{await nm()}catch{}finally{i.value=!1}}async function h(){c.value=!0;try{await sm()}catch{}}async function f(){if(v.value){c.value=!0;try{await RS(v.value)}catch{}}}yt(()=>{var A;return(A=t.value)==null?void 0:A.downloaded_exists},async(A,E)=>{var D;if(!A||E||!c.value||p.value)return;const R=((D=t.value)==null?void 0:D.latest)??"";c.value=!1,p.value=!0;try{if(window.confirm(m("settings.updates.redownloadPrompt",{version:R})))try{await kf(R)}catch{}}finally{p.value=!1}});async function _(){u.value=!0;try{await im()}catch{}finally{u.value=!1}}async function S(){var E;const A=((E=t.value)==null?void 0:E.latest)??"";if(A)try{await kf(A)}catch{}}async function k(A){const E=A.target;n.value=E.checked,await TS(E.checked)}async function P(){a.value=!0,r.value="";try{await PS(s.value),s.value=await xf()}catch(A){r.value=(A==null?void 0:A.message)??String(A)}finally{a.value=!1}}const M=j(()=>{var A,E;return((A=t.value)==null?void 0:A.current)==="dev"||((E=t.value)==null?void 0:E.current)===""}),w=j(()=>{var A,E;return(((E=(A=t.value)==null?void 0:A.lines)==null?void 0:E.length)??0)>=2}),T=j(()=>{const A=t.value;return A?A.current==="dev"||A.current===""?m("settings.updates.devDisabled"):A.error?A.error:A.checking||i.value?m("settings.updates.checking"):A.ready?m("settings.updates.readyToInstall",{version:A.latest}):A.downloading?m("settings.updates.downloadingStatus",{version:A.latest,pct:A.download_pct}):A.available?m("settings.updates.available",{version:A.latest}):A.last_check_at>0?m("settings.updates.upToDate",{ago:Uy(A.last_check_at)}):m("settings.updates.notChecked"):""});return(A,E)=>($(),F("div",U8,[d.value?($(),F("div",V8,L(C(m)("common.loading")),1)):t.value?($(),F(Oe,{key:1},[b("div",K8,[b("div",W8,[b("span",j8,L(C(m)("settings.updates.currentVersion")),1),b("span",q8,L(t.value.current||C(m)("common.unknown")),1)]),b("div",Y8,[b("span",G8,L(C(m)("settings.updates.status")),1),b("span",X8,L(T.value),1)]),t.value.download_path&&(t.value.ready||t.value.downloading)?($(),F("div",J8,[b("span",Q8,L(C(m)("settings.updates.downloadPath")),1),b("span",{class:"v path",title:t.value.download_path},L(t.value.download_path),9,Z8)])):Z("",!0)]),M.value?Z("",!0):($(),F("label",eH,[b("input",{type:"checkbox",checked:n.value,onChange:k},null,40,tH),ot(" "+L(C(m)("settings.updates.autoCheck")),1)])),M.value?Z("",!0):($(),F("div",nH,[b("label",sH,L(C(m)("settings.updates.ghProxy")),1),b("div",iH,[it(b("input",{id:"update-gh-proxy","onUpdate:modelValue":E[0]||(E[0]=R=>s.value=R),type:"url",placeholder:"https://gh-proxy.example.com/",spellcheck:"false"},null,512),[[Pt,s.value,void 0,{trim:!0}]]),b("button",{disabled:a.value,onClick:P},L(a.value?C(m)("settings.relay.saving"):C(m)("common.save")),9,rH)]),b("p",oH,L(C(m)("settings.updates.proxyHint")),1)])),!M.value&&t.value.notes?($(),F("details",aH,[b("summary",null,L(C(m)("settings.updates.releaseNotes")),1),b("pre",null,L(t.value.notes),1)])):Z("",!0),!M.value&&w.value&&t.value.lines&&!t.value.ready?($(),F("div",lH,[($(!0),F(Oe,null,at(t.value.lines,R=>($(),F("div",{key:R.minor,class:"version-line"},[b("label",null,[it(b("input",{type:"radio",value:R.minor,"onUpdate:modelValue":E[1]||(E[1]=D=>o.value=D)},null,8,cH),[[Id,o.value]]),ot(" "+L(C(m)("settings.updates.versionLine",{minor:R.minor}))+" → "+L(R.latest),1)])]))),128))])):Z("",!0),M.value?Z("",!0):($(),F("div",dH,[b("button",{onClick:l,disabled:i.value||t.value.checking},L(C(m)("settings.updates.checkNow")),9,uH),w.value&&!t.value.ready&&!t.value.downloading?($(),F("button",{key:0,class:"primary",disabled:t.value.downloading||!v.value,onClick:f},L(C(m)("settings.updates.downloadVersion",{version:v.value})),9,hH)):Z("",!0),!w.value&&t.value.available&&!t.value.ready&&!t.value.downloading?($(),F("button",{key:1,class:"primary",onClick:h},L(C(m)("settings.updates.downloadVersion",{version:t.value.latest})),1)):Z("",!0),t.value.downloading?($(),F("button",{key:2,class:"primary danger",disabled:u.value,onClick:_},L(u.value?C(m)("settings.updates.cancelling"):C(m)("settings.updates.cancelDownload",{pct:t.value.download_pct})),9,fH)):Z("",!0),t.value.ready?($(),F("button",{key:3,class:"primary danger",onClick:E[2]||(E[2]=R=>A.$emit("request-install",t.value.latest))},L(C(m)("settings.updates.forceInstallRestart")),1)):Z("",!0),t.value.ready?($(),F("button",{key:4,class:"secondary",onClick:S},L(C(m)("settings.updates.redownload")),1)):Z("",!0)])),r.value?($(),F("p",pH,L(r.value),1)):Z("",!0)],64)):Z("",!0)]))}}),gH=Ct(vH,[["__scopeId","data-v-c859d0af"]]),mH={key:0,class:"translate-settings"},_H=["value"],yH=["value"],bH=["value"],wH=["value"],SH={key:0,class:"extra-params-error"},CH={key:1,class:"hint"},kH={class:"muted"},xH=$e({__name:"TranslateSettings",setup(e){var u;const t=Hr(),{t:n}=$t(),s=[{code:"zh-CN",labelKey:"plugins.translate.simplifiedChinese"},{code:"en",labelKey:"plugins.translate.targetEnglish"},{code:"ja",labelKey:"plugins.translate.targetJapanese"},{code:"ko",labelKey:"plugins.translate.targetKorean"},{code:"de",labelKey:"plugins.translate.targetGerman"},{code:"fr",labelKey:"plugins.translate.targetFrench"},{code:"es",labelKey:"plugins.translate.targetSpanish"}],i=j(()=>{var g;return(g=t.cfg)==null?void 0:g.translate}),a=j(()=>s.map(g=>({value:g.code,label:n(g.labelKey)}))),d=j({get:()=>{var g;return((g=i.value)==null?void 0:g.defaultTargetLang)??"zh-CN"},set:g=>{p({defaultTargetLang:g})}}),r=H(((u=i.value)==null?void 0:u.extraParams)??""),o=H("");yt(()=>{var g;return((g=i.value)==null?void 0:g.extraParams)??""},g=>{g!==r.value&&(r.value=g)});function c(g){const m=g.target.value;r.value=m;const y=m.trim();if(y===""){o.value="",p({extraParams:""});return}let v;try{v=JSON.parse(y)}catch(l){o.value=l instanceof Error?l.message:String(l);return}if(!v||typeof v!="object"||Array.isArray(v)){o.value=n("plugins.translate.extraParamsInvalid");return}o.value="",p({extraParams:y})}async function p(g){if(!t.cfg)return;const m=JSON.parse(JSON.stringify(t.cfg));m.translate={...m.translate,...g};try{await t.save(m)}catch(y){Us("plugin-translate","save config failed",{error:Rt(y)})}}return(g,m)=>i.value?($(),F("div",mH,[b("label",null,[b("span",null,L(C(n)("plugins.translate.baseUrl")),1),b("input",{type:"text",value:i.value.baseUrl,onChange:m[0]||(m[0]=y=>p({baseUrl:y.target.value})),placeholder:"https://api.openai.com"},null,40,_H)]),b("label",null,[b("span",null,L(C(n)("plugins.translate.apiKey")),1),b("input",{type:"password",value:i.value.apiKey,onChange:m[1]||(m[1]=y=>p({apiKey:y.target.value})),placeholder:"sk-..."},null,40,yH)]),b("label",null,[b("span",null,L(C(n)("plugins.translate.model")),1),b("input",{type:"text",value:i.value.model,onChange:m[2]||(m[2]=y=>p({model:y.target.value})),placeholder:"gpt-4o-mini"},null,40,bH)]),b("label",null,[b("span",null,L(C(n)("plugins.translate.defaultTargetLanguage")),1),Pe(ts,{modelValue:d.value,"onUpdate:modelValue":m[3]||(m[3]=y=>d.value=y),options:a.value,"aria-label":C(n)("plugins.translate.defaultTargetLanguage")},null,8,["modelValue","options","aria-label"])]),b("label",null,[b("span",null,L(C(n)("plugins.translate.extraParams")),1),b("textarea",{class:"extra-params",rows:"3",spellcheck:"false",value:r.value,onInput:c,placeholder:'{"stream": true, "top_p": 0.9}'},null,40,wH),o.value?($(),F("span",SH,L(o.value),1)):($(),F("span",CH,L(C(n)("plugins.translate.extraParamsHint")),1))]),b("p",kH,L(C(n)("plugins.translate.keyStoredPlaintext",{path:"~/.config/atterm/config.json"})),1)])):Z("",!0)}}),RH=Ct(xH,[["__scopeId","data-v-2b2be568"]]),TH={class:"settings-plugins"},PH={class:"hint"},EH={key:0,class:"loading"},LH={key:1,class:"plugin-list"},DH={class:"row-head"},MH=["checked","onChange"],AH={class:"title"},IH={class:"desc"},$H={key:0,class:"fe-settings"},OH={class:"muted"},FH={key:2,class:"widget-settings"},BH=["checked"],HH={class:"muted"},NH={key:0,class:"empty"},zH=$e({__name:"SettingsPlugins",setup(e){const t=Hr(),{t:n}=$t(),s=dn(),i=j(()=>Zm.filter(r=>!r.desktopOnly||s.caps.wailsBindings));Dt(async()=>{t.cfg||await t.load()});async function a(r){var c;if(!((c=t.cfg)!=null&&c.widget))return;const o=JSON.parse(JSON.stringify(t.cfg));o.widget.aiOnly=r;try{await t.save(o)}catch(p){Us("plugin","widget aiOnly save failed",{error:Rt(p)})}}async function d(r,o){try{await t.setEnabled(r,o)}catch(c){Us("plugin","setEnabled failed",{error:Rt(c)})}}return(r,o)=>($(),F("section",TH,[b("p",PH,L(C(n)("settings.plugins.hint")),1),C(t).cfg?($(),F("ul",LH,[($(!0),F(Oe,null,at(i.value,c=>{var p,u;return $(),F("li",{key:c.id,class:"plugin-row"},[b("label",DH,[b("input",{type:"checkbox",checked:C(t).isPluginEnabled(c.id),onChange:g=>d(c.id,g.target.checked)},null,40,MH),b("span",AH,L(C(n)(c.titleKey)),1)]),b("p",IH,L(C(n)(c.descriptionKey)),1),c.id==="file-explorer"&&C(t).isPluginEnabled("file-explorer")?($(),F("div",$H,[b("p",OH,L(C(n)("settings.plugins.panelDragHint")),1)])):Z("",!0),c.id==="translate"&&C(t).isPluginEnabled("translate")?($(),bt(RH,{key:1})):Z("",!0),c.id==="desk-widget"&&C(t).isPluginEnabled("desk-widget")?($(),F("div",FH,[b("label",null,[b("input",{type:"checkbox",checked:((u=(p=C(t).cfg)==null?void 0:p.widget)==null?void 0:u.aiOnly)??!1,onChange:o[0]||(o[0]=g=>a(g.target.checked))},null,40,BH),b("span",null,L(C(n)("plugins.deskWidget.aiOnly")),1)]),b("p",HH,L(C(n)("plugins.deskWidget.aiOnlyHint")),1)])):Z("",!0)])}),128)),i.value.length===0?($(),F("li",NH,L(C(n)("settings.plugins.noneRegistered")),1)):Z("",!0)])):($(),F("div",EH,L(C(n)("common.loading")),1))]))}}),UH=Ct(zH,[["__scopeId","data-v-a25af5cc"]]),Ai=[{id:"pane.split-vertical-new",group:"pane",labelKey:"settings.shortcuts.splitPaneVertically",defaultBinding:"Mod+KeyN"},{id:"pane.split-horizontal-new",group:"pane",labelKey:"settings.shortcuts.splitPaneHorizontally",defaultBinding:"Mod+Shift+KeyN"},{id:"pane.close",group:"pane",labelKey:"settings.shortcuts.closePane",defaultBinding:"Mod+KeyW"},{id:"pane.focus-left",group:"pane",labelKey:"settings.shortcuts.focusPaneLeft",defaultBinding:"Mod+Alt+ArrowLeft"},{id:"pane.focus-right",group:"pane",labelKey:"settings.shortcuts.focusPaneRight",defaultBinding:"Mod+Alt+ArrowRight"},{id:"pane.focus-up",group:"pane",labelKey:"settings.shortcuts.focusPaneUp",defaultBinding:"Mod+Alt+ArrowUp"},{id:"pane.focus-down",group:"pane",labelKey:"settings.shortcuts.focusPaneDown",defaultBinding:"Mod+Alt+ArrowDown"},{id:"terminal.search",group:"pane",labelKey:"settings.shortcuts.terminalSearch",defaultBinding:"Mod+KeyF"},{id:"tab.new",group:"tab",labelKey:"settings.shortcuts.newTab",defaultBinding:"Mod+KeyT"},{id:"tab.prev",group:"tab",labelKey:"settings.shortcuts.previousTab",defaultBinding:"Mod+Shift+BracketLeft"},{id:"tab.next",group:"tab",labelKey:"settings.shortcuts.nextTab",defaultBinding:"Mod+Shift+BracketRight"},{id:"toggleTaskSidebar",group:"sidebar",labelKey:"tasks.sidebar.collapse",defaultBinding:"Mod+KeyB"},{id:"sidebar.focus-search",group:"sidebar",labelKey:"settings.shortcuts.focusSidebarSearch",defaultBinding:"Mod+Shift+KeyF"}],ri=Object.fromEntries(Ai.map(e=>[e.id,e])),VH=Object.fromEntries(Ai.map(e=>[e.defaultBinding,e.id])),Vy=new Set(["KeyA","KeyB","KeyC","KeyD","KeyE","KeyF","KeyG","KeyH","KeyI","KeyJ","KeyK","KeyL","KeyM","KeyN","KeyO","KeyP","KeyQ","KeyR","KeyS","KeyT","KeyU","KeyV","KeyW","KeyX","KeyY","KeyZ","Digit0","Digit1","Digit2","Digit3","Digit4","Digit5","Digit6","Digit7","Digit8","Digit9","ArrowLeft","ArrowRight","ArrowUp","ArrowDown","BracketLeft","BracketRight","Minus","Equal","Backquote","Comma","Period","Slash","Semicolon","Quote","Backslash"]);function Ky(e,t){const n=t==="Meta"?e.metaKey:e.ctrlKey;if((t==="Meta"?e.ctrlKey:e.metaKey)||!Vy.has(e.code)||!n&&!e.altKey&&!e.shiftKey)return null;const i=[];return n&&i.push("Mod"),e.altKey&&i.push("Alt"),e.shiftKey&&i.push("Shift"),i.push(e.code),i.join("+")}function Wy(e){const t={};for(const n of Ai)t[n.id]=n.defaultBinding;for(const[n,s]of Object.entries(e))n in ri&&(t[n]=s);return t}function KH(e,t){const n=e[t];if(!n)return[];const s=[];for(const[i,a]of Object.entries(e))i!==t&&a===n&&s.push(i);return s}function WH(e){const t={...VH};for(const[n,s]of Object.entries(e))if(n in ri){for(const i of Object.keys(t))if(t[i]===n){delete t[i];break}s!==""&&(t[s]=n)}return t}const jH={KeyA:"A",KeyB:"B",KeyC:"C",KeyD:"D",KeyE:"E",KeyF:"F",KeyG:"G",KeyH:"H",KeyI:"I",KeyJ:"J",KeyK:"K",KeyL:"L",KeyM:"M",KeyN:"N",KeyO:"O",KeyP:"P",KeyQ:"Q",KeyR:"R",KeyS:"S",KeyT:"T",KeyU:"U",KeyV:"V",KeyW:"W",KeyX:"X",KeyY:"Y",KeyZ:"Z",Digit0:"0",Digit1:"1",Digit2:"2",Digit3:"3",Digit4:"4",Digit5:"5",Digit6:"6",Digit7:"7",Digit8:"8",Digit9:"9",ArrowLeft:"←",ArrowRight:"→",ArrowUp:"↑",ArrowDown:"↓",BracketLeft:"[",BracketRight:"]",Minus:"-",Equal:"=",Backquote:"`",Comma:",",Period:".",Slash:"/",Semicolon:";",Quote:"'",Backslash:"\\"};function qH(e,t){if(e==="")return"";const n=YH(e);if(n===null||n.code===null)return e;const s=jH[n.code]??n.code;if(t==="Meta"){let a="";return n.mod&&(a+="⌘"),n.alt&&(a+="⌥"),n.shift&&(a+="⇧"),a+s}const i=[];return n.mod&&i.push("Ctrl"),n.alt&&i.push("Alt"),n.shift&&i.push("Shift"),i.push(s),i.join("+")}function YH(e){if(e==="")return{mod:!1,alt:!1,shift:!1,code:null};const t=e.split("+");if(t.length<2)return null;const n=t[t.length-1];if(!Vy.has(n))return null;const s=t.slice(0,-1),i=["Mod","Alt","Shift"];let a=0;const d={mod:!1,alt:!1,shift:!1};for(const r of s){for(;a{if(c.key==="Escape"){c.preventDefault(),c.stopPropagation(),o(),s("cancel");return}if(c.key==="Backspace"){c.preventDefault(),c.stopPropagation(),o(),s("update","");return}if(c.key==="Tab"||c.key==="Enter"){c.preventDefault(),c.stopPropagation();return}const p=Ky(c,n.mod);p!==null&&(c.preventDefault(),c.stopPropagation(),o(),s("update",p))},document.addEventListener("keydown",d,{capture:!0}))}function o(){i.value=!1,d&&(document.removeEventListener("keydown",d,{capture:!0}),d=null)}return Vt(o),(c,p)=>($(),F("button",{type:"button",class:lt(["hotkey-cell",{capturing:i.value,empty:!i.value&&c.value===""}]),onClick:r},[i.value?($(),F(Oe,{key:0},[ot(L(C(a)("settings.shortcuts.pressKey")),1)],64)):c.value===""?($(),F(Oe,{key:1},[ot(L(C(a)("common.disabled")),1)],64)):($(),F(Oe,{key:2},[ot(L(c.value),1)],64))],2))}}),Td=Ct(GH,[["__scopeId","data-v-80cabc38"]]),XH={class:"shortcut-settings"},JH={class:"shortcut-group"},QH={class:"label"},ZH=["title","onClick"],e7={key:0,class:"conflict"},t7={class:"shortcut-group"},n7={class:"label"},s7=["title","onClick"],i7={key:0,class:"conflict"},r7={key:0,class:"shortcut-group"},o7={class:"label"},a7=["title","onClick"],l7={key:0,class:"conflict"},c7={class:"actions-row"},d7=["disabled"],u7=["disabled"],h7={key:1,class:"error"},f7=$e({__name:"SettingsShortcuts",props:{mod:{}},emits:["bindings-changed"],setup(e,{expose:t,emit:n}){function s(){return ju()}const i=e,a=n,d=j(()=>i.mod??s()),{t:r}=$t(),o=H({}),c=H({}),p=H("");function u(){c.value=JSON.parse(JSON.stringify(o.value))}Dt(async()=>{try{o.value=await hm()}catch(T){p.value=(T==null?void 0:T.message)??String(T)}u()});const g=j(()=>JSON.stringify(o.value)!==JSON.stringify(c.value)),m=j(()=>Wy(c.value));function y(T){return m.value[T.id]??T.defaultBinding}function v(T){return KH(m.value,T.id)}const l=j(()=>Ai.some(T=>v(T).length>0));function h(T,A){if(A===T.defaultBinding){const E={...c.value};delete E[T.id],c.value=E;return}c.value={...c.value,[T.id]:A}}function f(T){const A={...c.value};delete A[T.id],c.value=A}function _(){c.value={}}async function S(){const T={};for(const[A,E]of Object.entries(c.value))A in ri&&E!==ri[A].defaultBinding&&(T[A]=E);p.value="";try{await qS(T),o.value=T,a("bindings-changed",T)}catch(A){p.value=(A==null?void 0:A.message)??String(A)}}function k(){u()}const P=Ai.filter(T=>T.group==="pane"),M=Ai.filter(T=>T.group==="tab"),w=Ai.filter(T=>T.group==="sidebar");return t({dirty:g}),(T,A)=>($(),F("div",XH,[b("section",JH,[b("h3",null,L(C(r)("settings.shortcuts.pane")),1),($(!0),F(Oe,null,at(C(P),E=>($(),F("div",{key:E.id,class:"shortcut-row"},[b("div",QH,L(C(r)(E.labelKey)),1),Pe(Td,{value:y(E),mod:d.value,onUpdate:R=>h(E,R)},null,8,["value","mod","onUpdate"]),b("button",{class:"reset-row",title:C(r)("settings.shortcuts.resetTo",{binding:E.defaultBinding}),onClick:R=>f(E)},"↺",8,ZH),v(E).length?($(),F("div",e7,L(C(r)("settings.shortcuts.conflictsWith",{labels:v(E).map(R=>C(ri)[R]?C(r)(C(ri)[R].labelKey):R).join(", ")})),1)):Z("",!0)]))),128))]),b("section",t7,[b("h3",null,L(C(r)("settings.shortcuts.tab")),1),($(!0),F(Oe,null,at(C(M),E=>($(),F("div",{key:E.id,class:"shortcut-row"},[b("div",n7,L(C(r)(E.labelKey)),1),Pe(Td,{value:y(E),mod:d.value,onUpdate:R=>h(E,R)},null,8,["value","mod","onUpdate"]),b("button",{class:"reset-row",title:C(r)("settings.shortcuts.resetTo",{binding:E.defaultBinding}),onClick:R=>f(E)},"↺",8,s7),v(E).length?($(),F("div",i7,L(C(r)("settings.shortcuts.conflictsWith",{labels:v(E).map(R=>C(ri)[R]?C(r)(C(ri)[R].labelKey):R).join(", ")})),1)):Z("",!0)]))),128))]),C(w).length>0?($(),F("section",r7,[b("h3",null,L(C(r)("settings.shortcuts.sidebar")),1),($(!0),F(Oe,null,at(C(w),E=>($(),F("div",{key:E.id,class:"shortcut-row"},[b("div",o7,L(C(r)(E.labelKey)),1),Pe(Td,{value:y(E),mod:d.value,onUpdate:R=>h(E,R)},null,8,["value","mod","onUpdate"]),b("button",{class:"reset-row",title:C(r)("settings.shortcuts.resetTo",{binding:E.defaultBinding}),onClick:R=>f(E)},"↺",8,a7),v(E).length?($(),F("div",l7,L(C(r)("settings.shortcuts.conflictsWith",{labels:v(E).map(R=>C(ri)[R]?C(r)(C(ri)[R].labelKey):R).join(", ")})),1)):Z("",!0)]))),128))])):Z("",!0),b("div",c7,[b("button",{class:"reset-all",onClick:_},L(C(r)("settings.shortcuts.resetAll")),1),A[0]||(A[0]=b("div",{class:"spacer"},null,-1)),b("button",{class:"discard",disabled:!g.value,onClick:k},L(C(r)("common.discard")),9,d7),b("button",{class:"save",disabled:!g.value||l.value,onClick:S},L(C(r)("common.save")),9,u7)]),p.value?($(),F("p",h7,L(p.value),1)):Z("",!0)]))}}),p7=Ct(f7,[["__scopeId","data-v-05d9d72b"]]);function v7(e){const t=s=>s.padEnd(24," ");return[`atterm desktop diagnostics — ${e.generated_at}`,"--------------------------------------------------",t("App version:")+e.app_version,t("OS:")+`${e.os} ${e.os_version} (${e.arch})`.replace(/\s+/g," ").trim(),t("WebView:")+(e.webview_summary||"(unknown)"),t("Relay URL:")+(e.relay_url||"(not configured)"),t("Relay status:")+e.relay_status,t("Relay token:")+(e.relay_token_redacted||"(none)"),t("Allow insecure HTTP:")+(e.allow_insecure_relay?"yes":"no"),t("Remote permission:")+e.remote_permission,t("Uplink paused:")+(e.uplink_paused?"yes":"no"),"","Recent relay errors (most recent first):",...e.recent_relay_errors.length===0?[" (none)"]:e.recent_relay_errors.map(s=>` ${s.timestamp} ${s.message}`),"","Config summary:",t(" Default shell:")+e.config.default_shell,t(" Locale:")+e.config.locale,t(" Theme:")+e.config.terminal_theme,t(" Notifications:")+(e.config.notifications_enabled?"enabled":"disabled"),t(" Shell integration:")+(e.config.shell_integration_enabled?"enabled":"disabled"),t(" WebGL renderer:")+(e.config.webgl_renderer_enabled?"enabled":"disabled"),t(" Logging:")+(e.config.logging_enabled?`enabled (${e.config.log_file_path})`:"disabled"),t(" Auto-check updates:")+(e.config.auto_check_updates?"enabled":"disabled"),t(" Command notify:")+`${e.config.command_notify_threshold_seconds}s`].join(` +`)}const g7={class:"diag"},m7={class:"hint"},_7={class:"preview","data-testid":"diag-preview"},y7={class:"row"},b7={key:0,class:"status"},w7=$e({__name:"SettingsDiagnostics",setup(e){const{t}=$t(),n=H(null),s=H(""),i=H("");async function a(){i.value="",n.value=await Q1(navigator.userAgent),s.value=v7(n.value)}async function d(){if(s.value)try{await navigator.clipboard.writeText(s.value),i.value=t("settings.diagnostics.copied"),setTimeout(()=>{i.value=""},1500)}catch{i.value=t("settings.diagnostics.copyFailed")}}async function r(){if(s.value)try{const o=await Z1(s.value);o&&(i.value=t("settings.diagnostics.exported",{path:o}),setTimeout(()=>{i.value=""},3e3))}catch(o){i.value=o instanceof Error?o.message:String(o)}}return Dt(a),(o,c)=>($(),F("div",g7,[b("p",m7,L(C(t)("settings.diagnostics.hint")),1),b("pre",_7,L(s.value),1),b("div",y7,[b("button",{type:"button","data-testid":"diag-copy",onClick:d},L(C(t)("settings.diagnostics.copy")),1),b("button",{type:"button","data-testid":"diag-export",onClick:r},L(C(t)("settings.diagnostics.export")),1),b("button",{type:"button","data-testid":"diag-refresh",onClick:a},L(C(t)("settings.diagnostics.refresh")),1),i.value?($(),F("span",b7,L(i.value),1)):Z("",!0)])]))}}),S7=Ct(w7,[["__scopeId","data-v-1a4e377a"]]),C7={key:0,class:"configio","data-testid":"configio-panel"},k7={class:"configio-section"},x7={class:"section-title"},R7={class:"hint"},T7={class:"checkbox"},P7={class:"row"},E7=["disabled"],L7={key:0,class:"status","data-testid":"configio-export-status"},D7={key:1,class:"status error","data-testid":"configio-export-error"},M7={class:"configio-section"},A7={class:"section-title"},I7={class:"hint"},$7={class:"row"},O7={key:0,class:"status","data-testid":"configio-import-filename"},F7={key:0,class:"status","data-testid":"configio-import-loading"},B7={key:1,class:"status error","data-testid":"configio-preview-error"},H7={key:2,class:"configio-preview","data-testid":"configio-preview"},N7={key:0,class:"hint","data-testid":"configio-preview-empty"},z7={key:1,"data-testid":"configio-changes-add"},U7={key:2,"data-testid":"configio-changes-replace"},V7={key:3,"data-testid":"configio-changes-unchanged"},K7={key:4,"data-testid":"configio-skipped"},W7={class:"row"},j7=["disabled"],q7={key:5,class:"status error","data-testid":"configio-apply-error"},Y7={key:3,class:"configio-report","data-testid":"configio-report"},G7={"data-testid":"configio-report-summary"},X7={"data-testid":"configio-report-applied"},J7={key:0,"data-testid":"configio-report-skipped"},Q7=$e({__name:"SettingsConfigIO",setup(e){const{t}=$t(),s=dn().caps.wailsBindings,i=H(!1),a=H(!1),d=H(""),r=H("");async function o(){if(!(!s||a.value)){a.value=!0,d.value="",r.value="";try{const I=await FS(i.value);I&&(d.value=t("settings.configio.export.success",{path:I}))}catch(I){r.value=I instanceof Error?I.message:String(I)}finally{a.value=!1}}}const c=H(null),p=H(""),u=H(""),g=H(!1),m=H(null),y=H(""),v=H(!1),l=H(""),h=H(null),f=j(()=>{var I;return((I=m.value)==null?void 0:I.changes.filter(O=>O.action==="add"))??[]}),_=j(()=>{var I;return((I=m.value)==null?void 0:I.changes.filter(O=>O.action==="replace"))??[]}),S=j(()=>{var I;return((I=m.value)==null?void 0:I.changes.filter(O=>O.action==="unchanged"))??[]}),k=j(()=>{var I;return(((I=m.value)==null?void 0:I.changes.length)??0)>0}),P=j(()=>s&&!!m.value&&!!u.value&&!v.value);function M(){var I;s&&((I=c.value)==null||I.click())}function w(I){return typeof I.text=="function"?I.text():new Promise((O,U)=>{const W=new FileReader;W.onload=()=>O(String(W.result??"")),W.onerror=()=>U(W.error??new Error(t("settings.configio.import.fileReadError"))),W.readAsText(I)})}async function T(I){var W;const O=I.target,U=(W=O.files)==null?void 0:W[0];O.value="",U&&await A(U)}async function A(I){E(),p.value=I.name,g.value=!0;try{const O=await w(I),U=await BS(O);u.value=O,m.value=U}catch(O){y.value=O instanceof Error?O.message:String(O)}finally{g.value=!1}}function E(){p.value="",u.value="",m.value=null,y.value="",v.value=!1,l.value="",h.value=null}async function R(){if(P.value){v.value=!0,l.value="";try{h.value=await HS(u.value),m.value=null}catch(I){l.value=I instanceof Error?I.message:String(I)}finally{v.value=!1}}}function D(){E()}return(I,O)=>C(s)?($(),F("div",C7,[b("section",k7,[b("h4",x7,L(C(t)("settings.configio.export.title")),1),b("p",R7,L(C(t)("settings.configio.export.hint")),1),b("label",T7,[it(b("input",{type:"checkbox","onUpdate:modelValue":O[0]||(O[0]=U=>i.value=U),"data-testid":"configio-env-checkbox"},null,512),[[vo,i.value]]),ot(" "+L(C(t)("settings.configio.export.includeEnvLabel")),1)]),b("div",P7,[b("button",{type:"button","data-testid":"configio-export-button",disabled:a.value,onClick:o},L(a.value?C(t)("settings.configio.export.exporting"):C(t)("settings.configio.export.button")),9,E7),d.value?($(),F("span",L7,L(d.value),1)):Z("",!0),r.value?($(),F("span",D7,L(r.value),1)):Z("",!0)])]),b("section",M7,[b("h4",A7,L(C(t)("settings.configio.import.title")),1),b("p",I7,L(C(t)("settings.configio.import.hint")),1),b("input",{ref_key:"fileInput",ref:c,class:"file-input",type:"file",accept:"application/json,.json","data-testid":"configio-import-file-input",onChange:T},null,544),b("div",$7,[b("button",{type:"button","data-testid":"configio-import-pick-button",onClick:M},L(C(t)("settings.configio.import.pickFile")),1),p.value?($(),F("span",O7,L(C(t)("settings.configio.import.fileLabel",{name:p.value})),1)):Z("",!0)]),g.value?($(),F("p",F7,L(C(t)("settings.configio.import.previewing")),1)):Z("",!0),y.value?($(),F("p",B7,L(C(t)("settings.configio.import.previewError",{error:y.value})),1)):Z("",!0),m.value?($(),F("div",H7,[b("h5",null,L(C(t)("settings.configio.import.previewTitle")),1),k.value?Z("",!0):($(),F("p",N7,L(C(t)("settings.configio.import.noChanges")),1)),f.value.length?($(),F("div",z7,[b("h6",null,L(C(t)("settings.configio.import.changesAdd"))+" ("+L(f.value.length)+")",1),b("ul",null,[($(!0),F(Oe,null,at(f.value,U=>($(),F("li",{key:U.key},[ot(L(U.key),1),U.detail?($(),F(Oe,{key:0},[ot(" — "+L(U.detail),1)],64)):Z("",!0)]))),128))])])):Z("",!0),_.value.length?($(),F("div",U7,[b("h6",null,L(C(t)("settings.configio.import.changesReplace"))+" ("+L(_.value.length)+")",1),b("ul",null,[($(!0),F(Oe,null,at(_.value,U=>($(),F("li",{key:U.key},[ot(L(U.key),1),U.detail?($(),F(Oe,{key:0},[ot(" — "+L(U.detail),1)],64)):Z("",!0)]))),128))])])):Z("",!0),S.value.length?($(),F("div",V7,[b("h6",null,L(C(t)("settings.configio.import.changesUnchanged"))+" ("+L(S.value.length)+")",1),b("ul",null,[($(!0),F(Oe,null,at(S.value,U=>($(),F("li",{key:U.key},L(U.key),1))),128))])])):Z("",!0),m.value.skipped.length?($(),F("div",K7,[b("h6",null,L(C(t)("settings.configio.import.skippedTitle"))+" ("+L(m.value.skipped.length)+")",1),b("ul",null,[($(!0),F(Oe,null,at(m.value.skipped,(U,W)=>($(),F("li",{key:W},L(U),1))),128))])])):Z("",!0),b("div",W7,[b("button",{type:"button","data-testid":"configio-apply-button",disabled:!P.value,onClick:R},L(v.value?C(t)("settings.configio.import.applying"):C(t)("settings.configio.import.apply")),9,j7),b("button",{type:"button","data-testid":"configio-cancel-button",onClick:D},L(C(t)("common.cancel")),1)]),l.value?($(),F("p",q7,L(C(t)("settings.configio.import.applyError",{error:l.value})),1)):Z("",!0)])):Z("",!0),h.value?($(),F("div",Y7,[b("h5",null,L(C(t)("settings.configio.import.appliedTitle")),1),b("p",G7,L(C(t)("settings.configio.import.appliedSummary",{count:h.value.applied.length})),1),b("ul",X7,[($(!0),F(Oe,null,at(h.value.applied,U=>($(),F("li",{key:U.key},[ot(L(U.key),1),U.detail?($(),F(Oe,{key:0},[ot(" — "+L(U.detail),1)],64)):Z("",!0)]))),128))]),h.value.skipped.length?($(),F("div",J7,[b("h6",null,L(C(t)("settings.configio.import.skippedTitle"))+" ("+L(h.value.skipped.length)+")",1),b("ul",null,[($(!0),F(Oe,null,at(h.value.skipped,(U,W)=>($(),F("li",{key:W},L(U),1))),128))])])):Z("",!0)])):Z("",!0)])])):Z("",!0)}}),Z7=Ct(Q7,[["__scopeId","data-v-9ef7411c"]]),eN={class:"snippet-run-panel"},tN={key:0,class:"select-phase"},nN={class:"hint"},sN={key:0,class:"error","data-testid":"snippet-run-error"},iN={class:"host-list"},rN=["data-testid","checked","onChange"],oN={class:"footer"},aN=["disabled","title"],lN={key:1,class:"results-phase"},cN={class:"rows"},dN=["data-testid","data-state"],uN={class:"row-head"},hN={class:"row-host"},fN=["data-testid","data-state"],pN=["data-testid"],vN=["data-testid"],gN=["data-testid"],mN={key:0,class:"error","data-testid":"snippet-run-error"},_N={class:"footer"},yN=["disabled"],bN=$e({__name:"SnippetRunPanel",props:{snippetLabel:{},snippetText:{}},emits:["close"],setup(e,{expose:t,emit:n}){const s=e,i=n,{t:a}=$t(),d=dn(),r=H([]),o=H(new Set),c=H(null),p=H([]),u=H(!1),g=H(!1),m=H("");function y(R){var D;return((D=R.alias)==null?void 0:D.trim())||R.host.trim()}function v(R){const D=new Set(o.value);D.has(R)?D.delete(R):D.add(R),o.value=D}const l=j(()=>o.value.size>0&&!u.value),h=j(()=>p.value.some(R=>R.state==="pending"||R.state==="running"));async function f(){if(!l.value)return;m.value="",u.value=!0;const R=r.value.filter(D=>o.value.has(D.id)).map(D=>D.id);p.value=R.map(D=>{const I=r.value.find(O=>O.id===D);return{host_id:D,host_label:I?y(I):D,state:"pending",exit_code:0,output:"",truncated:!1}}),w=[];try{const D=await AS(s.snippetLabel,s.snippetText,R);c.value=D;const I=w;w=[];for(const O of I)O.run_id===D&&T(O)}catch(D){m.value=D instanceof Error?D.message:String(D),p.value=[],w=[]}finally{u.value=!1}}async function _(){if(!(!c.value||g.value)){g.value=!0,m.value="";try{await IS(c.value)}catch(R){m.value=R instanceof Error?R.message:String(R)}finally{g.value=!1}}}function S(R){switch(R.state){case"pending":return a("snippets.pending");case"running":return a("snippets.running");case"ok":return a("snippets.ok");case"failed":return a("snippets.failed");case"error":return`${a("snippets.error")} · ${R.error??""}`}}function k(R){if(R.state==="error"){const D=R.error??"";return R.output?`${D} +${R.output}`:D}return R.output}function P(){return p.value.map(R=>`=== ${R.host_label} === +${k(R)}`).join(` + +`)}async function M(){const R=P(),D=typeof navigator>"u"?void 0:navigator.clipboard;if(D!=null&&D.writeText){await D.writeText(R);return}va(R)}let w=[];function T(R){const D=p.value.findIndex(I=>I.host_id===R.result.host_id);D>=0&&(p.value[D]=R.result)}function A(R){const D=R;if(!c.value){w.push(D);return}D.run_id===c.value&&T(D)}let E=null;return Dt(async()=>{E=d.events.on("snippet:run:progress",A);try{r.value=await Qg()}catch(R){m.value=R instanceof Error?R.message:String(R)}}),Vt(()=>{E==null||E(),E=null}),t({buildCopyAllText:P}),(R,D)=>($(),F("div",{class:"snippet-run-overlay",onClick:D[2]||(D[2]=ut(I=>i("close"),["self"]))},[b("div",eN,[c.value?($(),F("div",lN,[b("ul",cN,[($(!0),F(Oe,null,at(p.value,I=>($(),F("li",{key:I.host_id,class:lt(["row",`state-${I.state}`]),"data-testid":`snippet-run-row-${I.host_id}`,"data-state":I.state},[b("div",uN,[b("span",hN,L(I.host_label),1),b("span",{class:"row-state","data-testid":`snippet-run-state-${I.host_id}`,"data-state":I.state},L(S(I)),9,fN)]),I.state==="failed"?($(),F("span",{key:0,class:"row-exitcode","data-testid":`snippet-run-exitcode-${I.host_id}`},L(C(a)("snippets.exitCode",{code:I.exit_code})),9,pN)):Z("",!0),I.state==="ok"||I.state==="failed"||I.state==="error"&&I.output?($(),F("pre",{key:1,class:"row-output","data-testid":`snippet-run-output-${I.host_id}`},L(I.output),9,vN)):Z("",!0),I.truncated?($(),F("p",{key:2,class:"row-truncated","data-testid":`snippet-run-truncated-${I.host_id}`},L(C(a)("snippets.truncated")),9,gN)):Z("",!0)],10,dN))),128))]),m.value?($(),F("p",mN,L(m.value),1)):Z("",!0),b("div",_N,[b("button",{"data-testid":"snippet-run-close",onClick:D[1]||(D[1]=I=>i("close"))},L(C(a)("common.close")),1),b("button",{"data-testid":"snippet-run-copyall",onClick:M},L(C(a)("snippets.copyAll")),1),h.value?($(),F("button",{key:0,"data-testid":"snippet-run-cancel",disabled:g.value,onClick:_},L(C(a)("snippets.cancel")),9,yN)):Z("",!0)])])):($(),F("div",tN,[b("p",nN,L(C(a)("snippets.selectHosts")),1),m.value?($(),F("p",sN,L(m.value),1)):Z("",!0),b("ul",iN,[($(!0),F(Oe,null,at(r.value,I=>($(),F("li",{key:I.id},[b("label",null,[b("input",{type:"checkbox","data-testid":`snippet-run-host-${I.id}`,checked:o.value.has(I.id),onChange:O=>v(I.id)},null,40,rN),b("span",null,L(y(I)),1)])]))),128))]),b("div",oN,[b("button",{"data-testid":"snippet-run-close",onClick:D[0]||(D[0]=I=>i("close"))},L(C(a)("common.close")),1),b("button",{class:"primary","data-testid":"snippet-run-start",disabled:!l.value,title:o.value.size===0?C(a)("snippets.noHostsSelected"):"",onClick:f},L(C(a)("snippets.runOnHosts")),9,aN)])]))])]))}}),wN=Ct(bN,[["__scopeId","data-v-ca33db20"]]),SN={class:"tab-pane"},CN={class:"hint"},kN={class:"show-toggle"},xN=["checked"],RN={class:"list"},TN=["data-testid"],PN=["title"],EN=["title"],LN={class:"hotkey"},DN={class:"actions"},MN=["disabled","onClick"],AN=["disabled","onClick"],IN=["onClick"],$N=["data-testid","onClick"],ON=["data-testid","onClick"],FN={key:0,class:"edit-row"},BN={class:"edit-top"},HN=["placeholder"],NN=["placeholder"],zN=["placeholder"],UN={class:"edit-actions"},VN={class:"footer"},KN={key:0,class:"error"},WN={class:"actions"},jN=$e({__name:"SettingsTemplates",setup(e){const{t}=$t(),n=dn(),s=H([]),i=H(null),a=H(!1),d=H(!1),r=H(""),o=H(null),c=n.caps.wailsBindings;function p(E){o.value=E}function u(){o.value=null}async function g(){const E=await t_(n.templates);s.value=[...E],d.value=await n.templates.loadHidden()}let m=null;Dt(async()=>{await g(),m=n.events.on("prefs:changed",()=>{g()})}),Vt(()=>{m==null||m(),m=null});function y(){n.events.emit("quickTemplates:changed",null)}async function v(){r.value="";try{await n.templates.save(s.value),y()}catch(E){r.value=E instanceof Error?E.message:String(E)}}async function l(E){d.value=E;try{await n.templates.saveHidden(E),y()}catch(R){r.value=R instanceof Error?R.message:String(R)}}function h(){i.value={id:crypto.randomUUID(),label:"",text:"",hotkey:"",isNew:!0}}function f(E){i.value={id:E.id,label:E.label,text:E.text,hotkey:E.hotkey||"",isNew:!1}}function _(){i.value=null}async function S(){if(!i.value)return;const E=i.value;if(!E.label.trim()||!E.text)return;const R={id:E.id,label:E.label.trim(),text:E.text};if(E.hotkey.trim()&&(R.hotkey=E.hotkey.trim()),E.isNew)s.value.push(R);else{const D=s.value.findIndex(I=>I.id===E.id);D>=0&&(s.value[D]=R)}i.value=null,await v()}async function k(E){s.value=s.value.filter(R=>R.id!==E),await v()}async function P(E){const R=s.value.findIndex(D=>D.id===E);R<=0||([s.value[R-1],s.value[R]]=[s.value[R],s.value[R-1]],await v())}async function M(E){const R=s.value.findIndex(D=>D.id===E);R<0||R>=s.value.length-1||([s.value[R],s.value[R+1]]=[s.value[R+1],s.value[R]],await v())}function w(){a.value=!0}async function T(){a.value=!1,await n.templates.clear(),await g(),y()}function A(){a.value=!1}return(E,R)=>($(),F("div",SN,[b("p",CN,L(C(t)("settings.templates.intro")),1),b("label",kN,[b("input",{type:"checkbox","data-testid":"template-show-toggle",checked:!d.value,onChange:R[0]||(R[0]=D=>l(!D.target.checked))},null,40,xN),b("span",null,L(C(t)("settings.templates.showBar")),1)]),b("ul",RN,[($(!0),F(Oe,null,at(s.value,(D,I)=>($(),F("li",{key:D.id,class:"row","data-testid":`template-row-${D.id}`},[b("span",{class:"label",title:D.label},L(D.label),9,PN),b("code",{class:"text",title:D.text},L(D.text),9,EN),b("code",LN,L(D.hotkey||"—"),1),b("div",DN,[b("button",{disabled:I===0,onClick:O=>P(D.id)},"↑",8,MN),b("button",{disabled:I===s.value.length-1,onClick:O=>M(D.id)},"↓",8,AN),b("button",{onClick:O=>f(D)},L(C(t)("settings.templates.edit")),9,IN),C(c)?($(),F("button",{key:0,"data-testid":`template-run-${D.id}`,onClick:O=>p(D)},L(C(t)("snippets.runOnHosts")),9,$N)):Z("",!0),b("button",{class:"del","data-testid":`template-delete-${D.id}`,onClick:O=>k(D.id)},L(C(t)("settings.templates.delete")),9,ON)])],8,TN))),128))]),i.value?($(),F("div",FN,[b("div",BN,[it(b("input",{"onUpdate:modelValue":R[1]||(R[1]=D=>i.value.label=D),class:"edit-label-input",placeholder:C(t)("settings.templates.label"),"data-testid":"template-edit-label"},null,8,HN),[[Pt,i.value.label]]),it(b("input",{"onUpdate:modelValue":R[2]||(R[2]=D=>i.value.hotkey=D),class:"edit-hotkey-input",placeholder:C(t)("settings.templates.hotkey"),"data-testid":"template-edit-hotkey"},null,8,NN),[[Pt,i.value.hotkey]])]),it(b("textarea",{"onUpdate:modelValue":R[3]||(R[3]=D=>i.value.text=D),class:"edit-text-input",rows:"3",placeholder:C(t)("settings.templates.text"),"data-testid":"template-edit-text"},null,8,zN),[[Pt,i.value.text]]),b("div",UN,[b("button",{onClick:_},L(C(t)("common.cancel")),1),b("button",{class:"primary","data-testid":"template-edit-save",onClick:S},L(C(t)("settings.templates.save")),1)])])):Z("",!0),b("div",VN,[b("button",{"data-testid":"template-add",onClick:h},L(C(t)("settings.templates.add")),1),b("button",{"data-testid":"template-reset",onClick:w},L(C(t)("settings.templates.reset")),1),r.value?($(),F("span",KN,L(r.value),1)):Z("",!0)]),a.value?($(),F("div",{key:1,class:"dialog-backdrop",onClick:A},[b("div",{class:"dialog",onClick:R[4]||(R[4]=ut(()=>{},["stop"]))},[b("p",null,L(C(t)("settings.templates.resetConfirm")),1),b("div",WN,[b("button",{onClick:A},L(C(t)("common.cancel")),1),b("button",{"data-testid":"template-reset-confirm",onClick:T},L(C(t)("settings.templates.reset")),1)])])])):Z("",!0),o.value?($(),bt(wN,{key:2,"snippet-label":o.value.label,"snippet-text":o.value.text,onClose:u},null,8,["snippet-label","snippet-text"])):Z("",!0)]))}}),qN=Ct(jN,[["__scopeId","data-v-d57ad1d6"]]),YN={class:"tab-pane"},GN={class:"hint"},XN={class:"hint"},JN={class:"hint"},QN={class:"list"},ZN=["data-testid"],ez=["title"],tz={key:0,class:"badge","data-testid":"profile-default-badge"},nz={class:"detail"},sz={class:"detail"},iz={class:"actions"},rz=["data-testid","onClick"],oz=["data-testid"],az=["data-testid","onClick"],lz=["data-testid","onClick"],cz={key:0,class:"hint"},dz={key:1,class:"edit-row","data-testid":"profile-editor"},uz={class:"settings-field-grid settings-field-grid--two","data-testid":"profile-primary-grid"},hz=["placeholder"],fz=["placeholder"],pz=["placeholder"],vz=["placeholder"],gz={class:"hint"},mz=["placeholder"],_z={class:"hint"},yz={class:"checkbox"},bz={class:"hint"},wz={class:"edit-actions"},Sz={class:"footer"},Cz={key:0,class:"error"},kz=$e({__name:"SettingsProfiles",emits:["profiles-changed"],setup(e,{emit:t}){const{t:n}=$t(),s=dn(),i=t,a=H([]),d=H(""),r=H(!0),o=H(""),c=H(null);async function p(){o.value="";try{const[P,M]=await Promise.all([Sm(),uC()]);a.value=P??[],d.value=M??""}catch(P){o.value=(P==null?void 0:P.message)??String(P)}finally{r.value=!1}}let u=null;Dt(()=>{p(),u=s.events.on("prefs:changed",()=>{p()})}),Vt(()=>{u==null||u(),u=null});function g(P){return P?Object.entries(P).map(([M,w])=>`${M}=${w}`).join(` +`):""}function m(P){const M={};for(const w of P.split(` +`)){const T=w.trim();if(!T)continue;const A=T.indexOf("=");if(A<=0)continue;const E=T.slice(0,A).trim(),R=T.slice(A+1);E&&(M[E]=R)}return Object.keys(M).length>0?M:void 0}async function y(){o.value="";try{return await dC(a.value),i("profiles-changed"),!0}catch(P){const M=(P==null?void 0:P.message)??String(P);return await p(),o.value||(o.value=M),!1}}function v(){c.value={id:crypto.randomUUID(),name:"",shell:"",cwd:"",startupCmd:"",envText:"",syncEnv:!1,isNew:!0}}function l(P){c.value={id:P.id,name:P.name,shell:P.shell??"",cwd:P.cwd??"",startupCmd:P.startup_cmd??"",envText:g(P.env),syncEnv:!!P.sync_env,isNew:!1}}function h(){c.value=null}async function f(){if(!c.value)return;const P=c.value;if(!P.name.trim()){o.value=n("settings.profiles.nameRequired");return}const M={id:P.id,name:P.name.trim()};P.shell.trim()&&(M.shell=P.shell.trim()),P.cwd.trim()&&(M.cwd=P.cwd.trim()),P.startupCmd.trim()&&(M.startup_cmd=P.startupCmd.trim());const w=m(P.envText);w&&(M.env=w),P.syncEnv&&(M.sync_env=!0),P.isNew?a.value=[...a.value,M]:a.value=a.value.map(T=>T.id===P.id?M:T),c.value=null,await y()}async function _(P){const M=d.value===P;a.value=a.value.filter(T=>T.id!==P),await y()&&M&&await k()}async function S(P){const M=d.value;d.value=P,o.value="";try{await hC(P),i("profiles-changed")}catch(w){d.value=M,o.value=(w==null?void 0:w.message)??String(w)}}async function k(){await S("")}return(P,M)=>($(),F("div",YN,[b("p",GN,L(C(n)("settings.profiles.intro")),1),b("p",XN,L(C(n)("settings.profiles.precedenceHint")),1),b("p",JN,L(C(n)("settings.profiles.envPrivacyIntro")),1),r.value?Z("",!0):($(),F(Oe,{key:0},[b("ul",QN,[($(!0),F(Oe,null,at(a.value,w=>($(),F("li",{key:w.id,class:"row","data-testid":`profile-row-${w.id}`},[b("span",{class:"name",title:w.name},[ot(L(w.name)+" ",1),w.id===d.value?($(),F("span",tz,L(C(n)("settings.profiles.defaultBadge")),1)):Z("",!0)],8,ez),b("code",nz,L(w.shell||C(n)("settings.profiles.shellUnset")),1),b("code",sz,L(w.cwd||C(n)("settings.profiles.cwdUnset")),1),b("div",iz,[w.id!==d.value?($(),F("button",{key:0,"data-testid":`profile-set-default-${w.id}`,onClick:T=>S(w.id)},L(C(n)("settings.profiles.setDefault")),9,rz)):($(),F("button",{key:1,"data-testid":`profile-clear-default-${w.id}`,onClick:M[0]||(M[0]=T=>k())},L(C(n)("settings.profiles.clearDefault")),9,oz)),b("button",{"data-testid":`profile-edit-${w.id}`,onClick:T=>l(w)},L(C(n)("settings.profiles.edit")),9,az),b("button",{class:"del","data-testid":`profile-delete-${w.id}`,onClick:T=>_(w.id)},L(C(n)("settings.profiles.delete")),9,lz)])],8,ZN))),128))]),a.value.length===0?($(),F("p",cz,L(C(n)("settings.profiles.empty")),1)):Z("",!0)],64)),c.value?($(),F("div",dz,[b("div",uz,[it(b("input",{"onUpdate:modelValue":M[1]||(M[1]=w=>c.value.name=w),class:"edit-input",placeholder:C(n)("settings.profiles.name"),"data-testid":"profile-edit-name"},null,8,hz),[[Pt,c.value.name]]),it(b("input",{"onUpdate:modelValue":M[2]||(M[2]=w=>c.value.shell=w),class:"edit-input",placeholder:C(n)("settings.profiles.shellPlaceholder"),"data-testid":"profile-edit-shell"},null,8,fz),[[Pt,c.value.shell]])]),it(b("input",{"onUpdate:modelValue":M[3]||(M[3]=w=>c.value.cwd=w),class:"edit-input",placeholder:C(n)("settings.profiles.cwdPlaceholder"),"data-testid":"profile-edit-cwd"},null,8,pz),[[Pt,c.value.cwd]]),it(b("input",{"onUpdate:modelValue":M[4]||(M[4]=w=>c.value.startupCmd=w),class:"edit-input",placeholder:C(n)("settings.profiles.startupCmdPlaceholder"),"data-testid":"profile-edit-startup-cmd"},null,8,vz),[[Pt,c.value.startupCmd]]),b("p",gz,L(C(n)("settings.profiles.startupCmdHint")),1),it(b("textarea",{"onUpdate:modelValue":M[5]||(M[5]=w=>c.value.envText=w),class:"edit-input edit-textarea",rows:"3",placeholder:C(n)("settings.profiles.envPlaceholder"),"data-testid":"profile-edit-env"},null,8,mz),[[Pt,c.value.envText]]),b("p",_z,L(C(n)("settings.profiles.envHint")),1),b("label",yz,[it(b("input",{type:"checkbox","onUpdate:modelValue":M[6]||(M[6]=w=>c.value.syncEnv=w),"data-testid":"profile-edit-sync-env"},null,512),[[vo,c.value.syncEnv]]),ot(" "+L(C(n)("settings.profiles.syncEnv")),1)]),b("p",bz,L(c.value.syncEnv?C(n)("settings.profiles.syncEnvOnHint"):C(n)("settings.profiles.syncEnvOffHint")),1),b("div",wz,[b("button",{onClick:h},L(C(n)("common.cancel")),1),b("button",{class:"primary","data-testid":"profile-edit-save",onClick:f},L(C(n)("settings.profiles.save")),1)])])):Z("",!0),b("div",Sz,[b("button",{"data-testid":"profile-add",onClick:v},L(C(n)("settings.profiles.add")),1),o.value?($(),F("span",Cz,L(o.value),1)):Z("",!0)])]))}}),xz=Ct(kz,[["__scopeId","data-v-41aa374f"]]),Rz={class:"settings-tasks"},Tz={class:"preset-list"},Pz=["value","checked"],Ez={class:"preset-meta"},Lz={class:"preset-name"},Dz={class:"preset-desc"},Mz={class:"preset-preview"},Az={class:"group-by-row","data-test":"settings-group-by"},Iz={class:"group-by-label"},$z=["value","checked"],Oz={class:"expand-toggle"},Fz=["checked"],Bz=$e({__name:"SettingsTasks",setup(e){const{t}=$t(),n=H(!0),s=["iconOnly","iconLabel"],i=["host","state"],a=Bu(),d=Hm();Dt(async()=>{try{const u=await Zg();(u==="iconOnly"||u==="iconLabel")&&(a.activeId.value=u)}catch{}try{const u=await em();n.value=!u}catch{}});async function r(u){const g=u.target.value;await a.setPreset(g)}async function o(u){const g=u.target.checked;n.value=g,await tm(!g)}async function c(u){const g=u.target.value;await d.setGroupBy(g)}function p(u){return t(u==="host"?"tasks.settings.groupByHost":"tasks.settings.groupByState")}return(u,g)=>($(),F("section",Rz,[b("div",Tz,[($(),F(Oe,null,at(s,m=>b("label",{key:m,class:"preset-option"},[b("input",{type:"radio",name:"preset",value:m,checked:C(a).activeId.value===m,onChange:r},null,40,Pz),b("div",Ez,[b("div",Lz,L(C(t)(`tasks.preset.${m}.name`)),1),b("div",Dz,L(C(t)(`tasks.preset.${m}.description`)),1),b("div",Mz,[Pe(ci,{state:"running",preset:C(Qo)[m]},null,8,["preset"]),Pe(ci,{state:"waiting_input",preset:C(Qo)[m]},null,8,["preset"]),Pe(ci,{state:"completed",preset:C(Qo)[m]},null,8,["preset"]),Pe(ci,{state:"failed",preset:C(Qo)[m]},null,8,["preset"])])])])),64))]),b("div",Az,[b("span",Iz,L(C(t)("tasks.settings.groupBy")),1),($(),F(Oe,null,at(i,m=>b("label",{key:m,class:"group-by-option"},[b("input",{type:"radio",name:"taskGroupBy",value:m,checked:C(d).activeId.value===m,onChange:c},null,40,$z),ot(" "+L(p(m)),1)])),64))]),b("label",Oz,[b("input",{type:"checkbox",checked:n.value,onChange:o},null,40,Fz),ot(" "+L(C(t)("tasks.settings.expandByDefault")),1)])]))}}),Hz=Ct(Bz,[["__scopeId","data-v-d7749d1b"]]),Nz={class:"tab-pane"},zz={class:"hook-install","data-test":"hook-install"},Uz={class:"hook-install__row"},Vz=["title"],Kz={class:"hook-install__label"},Wz={class:"hook-install__toggle"},jz=["checked"],qz={key:0,class:"hook-install__error"},Yz={class:"ai-only","data-test":"feishu-ai-only"},Gz={class:"ai-only__toggle"},Xz=["checked"],Jz={class:"remote-terminal","data-test":"feishu-remote-terminal"},Qz={class:"remote-terminal__toggle"},Zz=["checked"],eU={key:0,class:"remote-terminal__attach-label"},tU={key:0,class:"hint feishu-status-error","data-test":"feishu-load-error"},nU={key:1,class:"hint","data-test":"feishu-relay-disabled"},sU={key:2,class:"hint"},iU={class:"feishu-mode"},rU={class:"feishu-mode__label"},oU={class:"feishu-mode__label-text"},aU={class:"feishu-mode__effective"},lU={key:0,class:"feishu-mode__warn"},cU={class:"test-send","data-test":"feishu-test-send"},dU={class:"test-send__title"},uU={class:"hint"},hU={class:"test-send__buttons"},fU=["disabled","onClick","data-test"],pU={key:0,class:"test-send__ok","data-test":"feishu-test-ok"},vU={key:1,class:"error","data-test":"feishu-test-error"},gU={key:1,class:"feishu-configured","data-test":"feishu-configured"},mU={class:"configured-line"},_U={class:"configured-badge"},yU={key:0,class:"configured-appid"},bU={class:"field-label"},wU={class:"callback-row"},SU=["value"],CU={class:"hint"},kU={key:1,class:"hint","data-test":"feishu-longconn-hint"},xU={key:2,class:"error"},RU={class:"actions"},TU={key:3,class:"pair-hint"},PU={key:2,class:"feishu-fieldset settings-field-grid settings-field-grid--two","data-test":"feishu-credentials-grid"},EU={class:"field-label settings-field"},LU={class:"field-label settings-field"},DU={class:"field-label settings-field"},MU={class:"field-label settings-field"},AU={key:0,class:"error settings-field--full"},IU={class:"actions settings-field--full"},$U=2500,OU=15*60*1e3,FU=$e({__name:"SettingsFeishu",setup(e){const{t}=$t(),n=H({enabled:!1,mode:"local",bound:!1,open_id:"",disabled:!1}),s=H({AppID:"",AppSecret:"",EncryptKey:"",VerifyToken:""}),i=H(""),a=H(""),d=H(!0),r=H("auto"),o=H(""),c=j(()=>[{value:"auto",label:t("settings.feishu.mode.options.auto")},{value:"local",label:t("settings.feishu.mode.options.local")},{value:"relay",label:t("settings.feishu.mode.options.relay")}]);async function p(G){const te=G.target.checked;try{await sC(te),d.value=te}catch{try{d.value=await Ef()}catch(oe){Lt("feishu","ai-notifications toggle out of sync with backend",{error:Rt(oe)})}}}async function u(G){try{await hS(G),r.value=G,o.value=await wf()}catch(te){r.value=await bf(),Us("feishu","SetFeishuModePref failed",{error:Rt(te)})}}const g=H(!1),m=H("ai"),y=j(()=>[{value:"ai",label:t("settings.feishu.remoteTerminal.autoAttach.ai")},{value:"all",label:t("settings.feishu.remoteTerminal.autoAttach.all")},{value:"none",label:t("settings.feishu.remoteTerminal.autoAttach.none")}]);async function v(G){const te=G.target.checked;try{await Sf(te,m.value),g.value=te}catch{try{const oe=await Uc();g.value=oe.enabled,m.value=oe.auto_attach}catch(oe){Lt("feishu","remote-terminal settings out of sync with backend",{error:Rt(oe)})}}}async function l(G){try{await Sf(g.value,G),m.value=G}catch{try{const te=await Uc();g.value=te.enabled,m.value=te.auto_attach}catch(te){Lt("feishu","remote-terminal settings out of sync with backend",{error:Rt(te)})}}}const h=H(!1),f=H(!1),_=["command_success","command_failure","command_sealed","waiting_input"],S=H(""),k=H({ok:!1,error:""});async function P(G){S.value=G,k.value={ok:!1,error:""};try{await mS(G),k.value={ok:!0,error:""}}catch(te){k.value={ok:!1,error:te instanceof Error?te.message:String(te)}}finally{S.value=""}}const M=H({enabled:!0,binary_path:"",binary_ok:!1,binary_version:"",settings_path:"",settings_ok:!1,last_error:"",last_check:""});async function w(){try{n.value=await fS()}catch(G){n.value={enabled:!1,mode:n.value.mode,bound:!1,open_id:"",disabled:!1,error:G instanceof Error?G.message:String(G)}}}async function T(){try{M.value=await _S()}catch{}}const A=j(()=>M.value.enabled?M.value.binary_ok&&M.value.settings_ok?"hook-install__dot--green":"hook-install__dot--amber":"hook-install__dot--gray"),E=j(()=>M.value.enabled?M.value.binary_ok&&M.value.settings_ok?t("settings.feishu.hook_install.healthy"):t("settings.feishu.hook_install.needs_attention"):t("settings.feishu.hook_install.disabled"));async function R(G){const te=G.target.checked;try{await Cf(te)}finally{await T()}}async function D(){try{await Cf(!0)}finally{await T()}}Dt(async()=>{await w(),await T();try{d.value=await Ef()}catch{}try{const G=await Uc();g.value=G.enabled,m.value=G.auto_attach}catch{}try{r.value=await bf(),o.value=await wf()}catch{}});async function I(){a.value="";try{await pS(s.value),h.value=!1,await w()}catch(G){a.value=G instanceof Error?G.message:String(G)}}function O(){a.value="",h.value=!0}async function U(){if(n.value.callback_url)try{await navigator.clipboard.writeText(n.value.callback_url),f.value=!0,setTimeout(()=>{f.value=!1},1500)}catch{}}let W=null;function z(){W&&(clearInterval(W),W=null)}function N(){z();const G=Date.now();W=setInterval(async()=>{if(await w(),n.value.bound){i.value="",z();return}Date.now()-G>=OU&&z()},$U)}Vt(z);async function V(){try{i.value=await vS(),N()}catch(G){a.value=G instanceof Error?G.message:String(G)}}async function q(){try{z(),await gS(),i.value="",h.value=!1,await w()}catch(G){a.value=G instanceof Error?G.message:String(G)}}return(G,te)=>($(),F("div",Nz,[b("section",zz,[b("header",Uz,[b("span",{class:lt(["hook-install__dot",A.value]),title:M.value.last_error||""},null,10,Vz),b("span",Kz,L(E.value),1),b("label",Wz,[b("input",{type:"checkbox",checked:M.value.enabled,onChange:R},null,40,jz),b("span",null,L(C(t)("settings.feishu.hook_install.enable")),1)]),M.value.enabled&&(!M.value.binary_ok||!M.value.settings_ok)?($(),F("button",{key:0,type:"button",class:"hook-install__retry",onClick:D,"data-test":"hook-install-retry"},L(C(t)("settings.feishu.hook_install.retry")),1)):Z("",!0)]),M.value.enabled&&M.value.last_error?($(),F("p",qz,L(M.value.last_error),1)):Z("",!0)]),b("section",Yz,[b("label",Gz,[b("input",{type:"checkbox",checked:d.value,onChange:p},null,40,Xz),b("span",null,L(C(t)("settings.feishu.aiOnlyNotifications")),1)])]),b("section",Jz,[b("label",Qz,[b("input",{type:"checkbox",checked:g.value,onChange:v},null,40,Zz),b("span",null,L(C(t)("settings.feishu.remoteTerminal.enable")),1)]),g.value?($(),F("div",eU,[b("span",null,L(C(t)("settings.feishu.remoteTerminal.autoAttachLabel")),1),Pe(ts,{class:"remote-terminal__attach-select","model-value":m.value,options:y.value,"aria-label":C(t)("settings.feishu.remoteTerminal.autoAttachLabel"),"data-test":"feishu-auto-attach","onUpdate:modelValue":l},null,8,["model-value","options","aria-label"])])):Z("",!0)]),n.value.error?($(),F("div",tU,[b("span",null,L(C(t)("settings.feishu.load_error",{error:n.value.error})),1),b("button",{type:"button",class:"hook-install__retry",onClick:w,"data-test":"feishu-status-retry"},L(C(t)("settings.feishu.retry_status")),1)])):n.value.relay_disabled?($(),F("p",nU,L(C(t)("settings.feishu.relay_disabled")),1)):n.value.enabled?($(),F(Oe,{key:3},[b("div",iU,[b("div",rU,[b("span",oU,L(C(t)("settings.feishu.mode.label")),1),Pe(ts,{class:"feishu-mode__select","model-value":r.value,options:c.value,"aria-label":C(t)("settings.feishu.mode.label"),"onUpdate:modelValue":u},null,8,["model-value","options","aria-label"])]),b("p",aU,[b("span",null,L(C(t)("settings.feishu.mode.effective.label"))+":",1),b("strong",null,L(o.value||"—"),1),r.value==="relay"&&o.value==="local"?($(),F("span",lU," ⚠ "+L(C(t)("settings.feishu.mode.effective.fallbackWarn")),1)):Z("",!0)])]),n.value.bound?($(),F(Oe,{key:0},[b("p",null,L(C(t)("settings.feishu.bound",{open_id:n.value.open_id})),1),b("section",cU,[b("p",dU,L(C(t)("settings.feishu.test_send.title")),1),b("p",uU,L(C(t)("settings.feishu.test_send.hint")),1),b("div",hU,[($(),F(Oe,null,at(_,oe=>b("button",{key:oe,type:"button",class:"btn-secondary",disabled:S.value!=="",onClick:ie=>P(oe),"data-test":"feishu-test-"+oe},L(S.value===oe?C(t)("settings.feishu.test_send.sending"):C(t)(`settings.feishu.test_send.${oe}`)),9,fU)),64))]),k.value.ok?($(),F("p",pU,L(C(t)("settings.feishu.test_send.sent")),1)):k.value.error?($(),F("p",vU,L(C(t)("settings.feishu.test_send.failed",{error:k.value.error})),1)):Z("",!0)]),b("button",{type:"button",class:"btn-danger",onClick:q},L(C(t)("settings.feishu.delete")),1)],64)):n.value.configured&&!h.value?($(),F("div",gU,[b("p",mU,[b("span",_U,L(C(t)("settings.feishu.configured")),1),n.value.app_id?($(),F("span",yU,L(C(t)("settings.feishu.app_id_label"))+": "+L(n.value.app_id),1)):Z("",!0)]),n.value.callback_url?($(),F(Oe,{key:0},[b("label",bU,[ot(L(C(t)("settings.feishu.callback_label"))+" ",1),b("span",wU,[b("input",{value:n.value.callback_url,readonly:"",class:"field-input","data-test":"feishu-callback-url"},null,8,SU),b("button",{type:"button",class:"btn-primary",onClick:U,"data-test":"feishu-callback-copy"},L(f.value?C(t)("settings.feishu.copied"):C(t)("settings.feishu.copy")),1)])]),b("p",CU,L(C(t)("settings.feishu.callback_hint_relay")),1)],64)):($(),F("p",kU,L(C(t)("settings.feishu.longconn_hint_local")),1)),a.value?($(),F("div",xU,L(a.value),1)):Z("",!0),b("div",RU,[b("button",{type:"button",class:"btn-primary",onClick:V,"data-test":"feishu-begin-pair"},L(C(t)("settings.feishu.begin_pair")),1),b("button",{type:"button",class:"btn-secondary",onClick:O},L(C(t)("settings.feishu.reconfigure")),1)]),i.value?($(),F("p",TU,L(C(t)("settings.feishu.pair_hint",{code:i.value})),1)):Z("",!0)])):($(),F("fieldset",PU,[b("label",EU,[te[4]||(te[4]=ot("App ID ")),it(b("input",{"onUpdate:modelValue":te[0]||(te[0]=oe=>s.value.AppID=oe),type:"text",class:"field-input"},null,512),[[Pt,s.value.AppID]])]),b("label",LU,[te[5]||(te[5]=ot("App Secret ")),it(b("input",{"onUpdate:modelValue":te[1]||(te[1]=oe=>s.value.AppSecret=oe),type:"password",class:"field-input"},null,512),[[Pt,s.value.AppSecret]])]),b("label",DU,[te[6]||(te[6]=ot("Encrypt Key ")),it(b("input",{"onUpdate:modelValue":te[2]||(te[2]=oe=>s.value.EncryptKey=oe),type:"password",class:"field-input"},null,512),[[Pt,s.value.EncryptKey]])]),b("label",MU,[te[7]||(te[7]=ot("Verify Token ")),it(b("input",{"onUpdate:modelValue":te[3]||(te[3]=oe=>s.value.VerifyToken=oe),type:"password",class:"field-input"},null,512),[[Pt,s.value.VerifyToken]])]),a.value?($(),F("div",AU,L(a.value),1)):Z("",!0),b("div",IU,[b("button",{type:"button",class:"btn-primary",onClick:I},L(C(t)("settings.feishu.save")),1)])]))],64)):($(),F("p",sU,L(C(t)("settings.feishu.disabled")),1))]))}}),BU=Ct(FU,[["__scopeId","data-v-2aad46af"]]),HU={class:"tab-pane"},NU={key:0,class:"dim"},zU={class:"header-row"},UU={class:"hint"},VU={key:0,class:"header-actions"},KU=["disabled","aria-label"],WU=["disabled"],jU={key:0,class:"hint"},qU={key:1,class:"error"},YU={key:2,class:"dim"},GU={key:3,class:"device-list"},XU={class:"device-info"},JU={class:"ua"},QU={class:"meta"},ZU={key:0,class:"current-tag"},e9=["disabled","onClick"],t9=$e({__name:"SettingsDevices",setup(e){const{t}=$t(),n=dn(),s=H([]),i=H(!0),a=H(!1),d=H(!1),r=H({}),o=H(""),c=H(!1);async function p(v=!1){v||(i.value=!0),a.value=!0,o.value="",c.value=!1;try{if(!n.sessions.listRelaySessions){c.value=!0,s.value=[];return}s.value=await n.sessions.listRelaySessions()}catch(l){const h=(l==null?void 0:l.message)??String(l);h.includes("not authenticated")?c.value=!0:o.value=h}finally{i.value=!1,a.value=!1}}Dt(()=>{p()});async function u(){await p(!0)}async function g(v){var h,f;const l=v.user_agent||t("settings.devices.unknownUA");if(window.confirm(t("settings.devices.revokeConfirm",{ua:l}))){r.value={...r.value,[v.id_hash]:!0};try{await((f=(h=n.sessions).revokeRelaySession)==null?void 0:f.call(h,v.id_hash)),await p(!0)}catch(_){o.value=(_==null?void 0:_.message)??String(_)}finally{const _={...r.value};delete _[v.id_hash],r.value=_}}}async function m(){var v,l;if(window.confirm(t("settings.devices.signOutOthersConfirm"))){d.value=!0;try{await((l=(v=n.sessions).signOutOtherRelaySessions)==null?void 0:l.call(v)),await p(!0)}catch(h){o.value=(h==null?void 0:h.message)??String(h)}finally{d.value=!1}}}function y(v){const l=new Date(v);return t("settings.devices.timeFormat",{y:l.getFullYear(),m:l.getMonth()+1,d:l.getDate(),hh:String(l.getHours()).padStart(2,"0"),mm:String(l.getMinutes()).padStart(2,"0")})}return(v,l)=>($(),F("div",HU,[i.value?($(),F("div",NU,L(C(t)("common.loading")),1)):($(),F(Oe,{key:1},[b("div",zU,[b("p",UU,L(C(t)("settings.devices.hint")),1),c.value?Z("",!0):($(),F("div",VU,[b("button",{type:"button",class:"icon-btn",disabled:a.value,"aria-label":C(t)("settings.devices.refresh"),onClick:u},L(a.value?"…":"⟳"),9,KU),b("button",{type:"button",class:"secondary",disabled:d.value||s.value.filter(h=>!h.is_current).length===0,onClick:m},L(d.value?C(t)("settings.devices.signingOut"):C(t)("settings.devices.signOutOthers")),9,WU)]))]),c.value?($(),F("p",jU,L(C(t)("settings.devices.notAuthenticated")),1)):o.value?($(),F("p",qU,L(o.value),1)):s.value.length===0?($(),F("p",YU,L(C(t)("settings.devices.empty")),1)):($(),F("div",GU,[($(!0),F(Oe,null,at(s.value,h=>($(),F("div",{key:h.id_hash,class:"device-row"},[b("div",XU,[b("div",JU,L(h.user_agent||C(t)("settings.devices.unknownUA")),1),b("div",QU,L(C(t)("settings.devices.loginLine",{time:y(h.created_at),ip:h.ip_prefix})),1)]),h.is_current?($(),F("span",ZU,L(C(t)("settings.devices.currentTag")),1)):($(),F("button",{key:1,type:"button",class:"danger-btn",disabled:!!r.value[h.id_hash],onClick:f=>g(h)},L(r.value[h.id_hash]?C(t)("settings.devices.revoking"):C(t)("settings.devices.revoke")),9,e9))]))),128))]))],64))]))}}),n9=Ct(t9,[["__scopeId","data-v-6015f38d"]]),s9={class:"received-files"},i9={class:"header"},r9={"data-testid":"total-bytes"},o9={class:"muted"},a9={class:"actions"},l9=["disabled"],c9={key:0,class:"error"},d9={key:1},u9={key:2,class:"empty"},h9={key:3,class:"sessions"},f9=["onClick"],p9={class:"session-name"},v9={class:"muted"},g9=["onClick"],m9={key:0,class:"files"},_9={class:"file-name"},y9={class:"muted"},b9=["onClick"],w9=$e({__name:"SettingsReceivedFiles",setup(e){const t=H({total_bytes:0,sessions:[]}),n=H(!1),s=H(new Set),i=H("");function a(g){return g<1024?`${g} B`:g<1024*1024?`${(g/1024).toFixed(1)} KiB`:`${(g/(1024*1024)).toFixed(1)} MiB`}async function d(){n.value=!0,i.value="";try{t.value=await ER()}catch(g){i.value=String(g)}finally{n.value=!1}}async function r(){if(confirm("Clear ALL received files? This cannot be undone.")){try{await RR()}catch(g){i.value=String(g)}await d()}}async function o(g){try{await TR(g)}catch(m){i.value=String(m)}await d()}async function c(g,m){try{await PR(g,m)}catch(y){i.value=String(y)}await d()}async function p(){try{await LR()}catch(g){i.value=String(g)}}function u(g){const m=new Set(s.value);m.has(g)?m.delete(g):m.add(g),s.value=m}return Dt(d),(g,m)=>($(),F("div",s9,[b("div",i9,[b("div",null,[b("strong",r9,"Total: "+L(a(t.value.total_bytes)),1),b("span",o9," · "+L(t.value.sessions.length)+" sessions",1)]),b("div",a9,[b("button",{onClick:p},"Open folder"),b("button",{class:"danger",disabled:t.value.sessions.length===0,onClick:r},"Clear all",8,l9)])]),i.value?($(),F("div",c9,L(i.value),1)):Z("",!0),n.value?($(),F("div",d9,"Loading…")):t.value.sessions.length===0?($(),F("div",u9,"No files received.")):($(),F("ul",h9,[($(!0),F(Oe,null,at(t.value.sessions,y=>($(),F("li",{key:y.session_id,class:"session"},[b("div",{class:"session-row","data-testid":"session-row",onClick:v=>u(y.session_id)},[b("span",p9,L(y.session_name||y.session_id.slice(0,8)),1),b("span",v9," · "+L(y.files.length)+" files · "+L(a(y.bytes)),1),b("button",{class:"session-clear danger",onClick:ut(v=>o(y.session_id),["stop"])},"Clear",8,g9)],8,f9),s.value.has(y.session_id)?($(),F("ul",m9,[($(!0),F(Oe,null,at(y.files,v=>($(),F("li",{key:v.name,"data-testid":"file-row"},[b("span",_9,L(v.name),1),b("span",y9," · "+L(a(v.bytes)),1),b("button",{class:"file-delete danger",onClick:l=>c(y.session_id,v.name)},"Delete",8,b9)]))),128))])):Z("",!0)]))),128))]))]))}}),S9=Ct(w9,[["__scopeId","data-v-4b01c574"]]);function jy(e=300,t=10){const n=H(Ei());let s=null;return Dt(()=>{if(n.value)return;let i=0;s=setInterval(()=>{i++;const a=Ei();a&&(n.value=a),(a||i>=t)&&(s!==null&&clearInterval(s),s=null)},e)}),Vt(()=>{s!==null&&clearInterval(s),s=null}),n}const C9=["locale_preference","quick_templates","notifications_enabled","ai_notifications_only","command_notify_threshold_seconds","shell_integration_enabled","pinned_session_ids"],Bv=e=>`atterm.${e}.value`,Hv=e=>`atterm.${e}.meta`;function k9(){return{readValue(e){const t=localStorage.getItem(Bv(e));if(t!==null)try{return JSON.parse(t)}catch{return}},writeValue(e,t){localStorage.setItem(Bv(e),JSON.stringify(t))},readMeta(e){const t=localStorage.getItem(Hv(e));if(t===null)return{updatedAtLocal:0,dirty:!1};try{const n=JSON.parse(t);return{updatedAtLocal:Number((n==null?void 0:n.updatedAtLocal)??0),dirty:!!(n!=null&&n.dirty)}}catch{return{updatedAtLocal:0,dirty:!1}}},writeMeta(e,t){localStorage.setItem(Hv(e),JSON.stringify(t))},keys(){return[...C9]}}}function qy(e){const t=k9().readValue(e);return typeof t=="string"?t:void 0}const x9="bbbac178-5e9b-45b4-8b79-3257d9af7ca5",R9="55480000-0000-4000-8000-000000000001",T9=241,P9=240;function Yy(e,t,n,s,i){let a;try{a=$u(t)}catch{throw new Error(`${i}: value is not valid base64`)}const d=fl(e,n,s,a);if(!d)throw new Error(`${i}: could not decrypt (wrong account key or corrupted blob)`);let r;try{r=JSON.parse(new TextDecoder().decode(d))}catch{throw new Error(`${i}: decrypted payload is not valid JSON`)}if(typeof r!="object"||r===null||Array.isArray(r))throw new Error(`${i}: decrypted payload is not a JSON object`);return r}function E9(e,t){const n=Yy(e,t,x9,T9,"openProfilesBlob");return{profiles:(n.profiles??[]).map(i=>({id:i.id,name:i.name,shell:i.shell??"",cwd:i.cwd??"",startupCmd:i.startup_cmd??"",syncEnv:!!i.sync_env,env:i.env})),defaultProfileId:n.default_profile_id??""}}function L9(e,t){const n=Yy(e,t,R9,P9,"openSSHHostsBlob"),s=(n.hosts??[]).map(({host:a})=>({id:a.id,alias:a.alias??"",host:a.host,port:a.port??"",user:a.user,authKind:a.auth_kind,keyId:a.key_id??"",tags:a.tags??[],note:a.note??"",hasJumpChain:!!a.proxy_jump,isProxyCommandHost:!!a.proxy_command})),i=(n.keys??[]).map(({key:a})=>({id:a.id,name:a.name,keyType:a.key_type??""}));return{hosts:s,keys:i}}const D9={key:0,class:"mobile-profiles","data-testid":"mobile-profiles-panel"},M9={class:"hint"},A9={key:0,class:"status","data-testid":"mobile-profiles-locked"},I9={key:1,class:"status","data-testid":"mobile-profiles-no-data"},$9={key:2,class:"status error","data-testid":"mobile-profiles-error"},O9={key:3,class:"status","data-testid":"mobile-profiles-empty"},F9={key:0,class:"host-picker"},B9=["value"],H9={key:1,class:"status","data-testid":"mobile-profiles-no-hosts"},N9={key:2,class:"status error","data-testid":"mobile-profiles-create-error"},z9={class:"profile-list","data-testid":"mobile-profiles-list"},U9={class:"profile-header"},V9={class:"profile-name"},K9={key:0,class:"badge","data-testid":"mobile-profile-default-badge"},W9=["disabled","onClick"],j9={class:"profile-fields"},q9={"data-testid":"mobile-profile-shell"},Y9={"data-testid":"mobile-profile-cwd"},G9={"data-testid":"mobile-profile-startup-cmd"},X9={"data-testid":"mobile-profile-env"},J9={key:2,class:"env-list"},Q9=$e({__name:"SettingsProfilesMobile",emits:["session-created"],setup(e,{emit:t}){const{t:n}=$t(),s=dn(),i=s.caps.capacitor,a=t,d=i?jy():H(null),r=H([]),o=H(""),c=H(""),p=H(!1);function u(){if(!i)return;c.value="";const P=d.value;if(!P)return;const M=qy("profiles_encrypted");if(p.value=M!==void 0,M!==void 0)try{const w=E9(P,M);r.value=w.profiles,o.value=w.defaultProfileId}catch(w){c.value=w instanceof Error?w.message:String(w)}}yt(d,u,{immediate:!0});const g=j(()=>d.value?c.value?"error":p.value?r.value.length===0?"empty":"ready":"noData":"locked"),m=H([]),y=j(()=>{const P=new Map;for(const M of m.value)!M.host_id||P.has(M.host_id)||P.set(M.host_id,M.host||M.host_id);return[...P.entries()].map(([M,w])=>({id:M,name:w})).sort((M,w)=>M.name.localeCompare(w.name))}),v=H("");yt(y,P=>{var M;P.some(w=>w.id===v.value)||(v.value=((M=P[0])==null?void 0:M.id)??"")},{immediate:!0});async function l(){if(i)try{m.value=await s.sessions.listRemoteSessions()}catch{m.value=[]}}Dt(l);const h=H(null),f=H(""),_=new Set(["unknown_profile","permission_denied","request_in_flight","duplicate_request_id","unknown_host_id","invalid_request","upstream_unavailable","session_create_busy","timeout","relay_not_configured"]);function S(P){return _.has(P)?n(`settings.mobileProfiles.openErrors.${P}`):n("settings.mobileProfiles.openErrors.generic",{error:P})}async function k(P){if(h.value!==null)return;const M=v.value;if(!M)return;const w=s.sessions.createSessionWithProfile;if(!w){f.value=S("relay_not_configured");return}h.value=P,f.value="";try{const T=await w(M,P);a("session-created",T)}catch(T){f.value=S(T instanceof Error?T.message:String(T))}finally{h.value=null}}return(P,M)=>C(i)?($(),F("div",D9,[b("p",M9,L(C(n)("settings.mobileProfiles.intro")),1),g.value==="locked"?($(),F("p",A9,L(C(n)("settings.mobileSync.locked")),1)):g.value==="noData"?($(),F("p",I9,L(C(n)("settings.mobileSync.noData")),1)):g.value==="error"?($(),F("p",$9,L(C(n)("settings.mobileSync.error",{error:c.value})),1)):g.value==="empty"?($(),F("p",O9,L(C(n)("settings.mobileProfiles.empty")),1)):($(),F(Oe,{key:4},[y.value.length>0?($(),F("label",F9,[b("span",null,L(C(n)("settings.mobileProfiles.hostLabel")),1),it(b("select",{"onUpdate:modelValue":M[0]||(M[0]=w=>v.value=w),"data-testid":"mobile-profiles-host-select"},[($(!0),F(Oe,null,at(y.value,w=>($(),F("option",{key:w.id,value:w.id},L(w.name),9,B9))),128))],512),[[bg,v.value]])])):($(),F("p",H9,L(C(n)("settings.mobileProfiles.noHosts")),1)),f.value?($(),F("p",N9,L(f.value),1)):Z("",!0),b("ul",z9,[($(!0),F(Oe,null,at(r.value,w=>($(),F("li",{key:w.id,class:"profile-item","data-testid":"mobile-profile-item"},[b("div",U9,[b("span",V9,L(w.name||C(n)("common.unknown")),1),w.id===o.value?($(),F("span",K9,L(C(n)("settings.mobileProfiles.defaultBadge")),1)):Z("",!0),b("button",{type:"button",class:"open-btn","data-testid":"mobile-profile-open",disabled:!v.value||h.value!==null,onClick:T=>k(w.id)},L(h.value===w.id?C(n)("settings.mobileProfiles.opening"):C(n)("settings.mobileProfiles.openButton")),9,W9)]),b("dl",j9,[b("dt",null,L(C(n)("settings.mobileProfiles.shell")),1),b("dd",q9,L(w.shell||C(n)("common.unknown")),1),b("dt",null,L(C(n)("settings.mobileProfiles.cwd")),1),b("dd",Y9,L(w.cwd||C(n)("common.unknown")),1),b("dt",null,L(C(n)("settings.mobileProfiles.startupCmd")),1),b("dd",G9,L(w.startupCmd||C(n)("common.unknown")),1),b("dt",null,L(C(n)("settings.mobileProfiles.env")),1),b("dd",X9,[w.syncEnv?!w.env||Object.keys(w.env).length===0?($(),F(Oe,{key:1},[ot(L(C(n)("settings.mobileProfiles.envNone")),1)],64)):($(),F("ul",J9,[($(!0),F(Oe,null,at(w.env,(T,A)=>($(),F("li",{key:A},L(A)+"="+L(T),1))),128))])):($(),F(Oe,{key:0},[ot(L(C(n)("settings.mobileProfiles.envNotSynced")),1)],64))])])]))),128))])],64))])):Z("",!0)}}),Z9=Ct(Q9,[["__scopeId","data-v-1c4c4dd0"]]),eV={key:0,class:"mobile-hosts","data-testid":"mobile-hosts-panel"},tV={class:"hint"},nV={key:0,class:"status","data-testid":"mobile-hosts-locked"},sV={key:1,class:"status","data-testid":"mobile-hosts-no-data"},iV={key:2,class:"status error","data-testid":"mobile-hosts-error"},rV={key:3,class:"status","data-testid":"mobile-hosts-empty"},oV={key:4,class:"host-list","data-testid":"mobile-hosts-list"},aV={class:"host-header"},lV={class:"host-alias"},cV={class:"host-target"},dV={key:0,class:"badge badge-warn","data-testid":"mobile-host-proxy-command-badge"},uV={key:1,class:"badge","data-testid":"mobile-host-jump-chain-badge"},hV={class:"host-fields"},fV={"data-testid":"mobile-host-user"},pV={"data-testid":"mobile-host-port"},vV={"data-testid":"mobile-host-key"},gV={"data-testid":"mobile-host-tags"},mV={"data-testid":"mobile-host-note"},_V=$e({__name:"SettingsSSHHostsMobile",setup(e){const{t}=$t(),s=dn().caps.capacitor,i=s?jy():H(null),a=H([]),d=H([]),r=H(""),o=H(!1);function c(){if(!s)return;r.value="";const g=i.value;if(!g)return;const m=qy("ssh_hosts_encrypted");if(o.value=m!==void 0,m!==void 0)try{const y=L9(g,m);a.value=y.hosts,d.value=y.keys}catch(y){r.value=y instanceof Error?y.message:String(y)}}yt(i,c,{immediate:!0});const p=j(()=>i.value?r.value?"error":o.value?a.value.length===0?"empty":"ready":"noData":"locked");function u(g){var m;return g?((m=d.value.find(y=>y.id===g))==null?void 0:m.name)??g:""}return(g,m)=>C(s)?($(),F("div",eV,[b("p",tV,L(C(t)("settings.mobileHosts.intro")),1),p.value==="locked"?($(),F("p",nV,L(C(t)("settings.mobileSync.locked")),1)):p.value==="noData"?($(),F("p",sV,L(C(t)("settings.mobileSync.noData")),1)):p.value==="error"?($(),F("p",iV,L(C(t)("settings.mobileSync.error",{error:r.value})),1)):p.value==="empty"?($(),F("p",rV,L(C(t)("settings.mobileHosts.empty")),1)):($(),F("ul",oV,[($(!0),F(Oe,null,at(a.value,y=>($(),F("li",{key:y.id,class:"host-item","data-testid":"mobile-host-item"},[b("div",aV,[b("span",lV,L(y.alias||y.host),1),b("span",cV,L(y.host),1),y.isProxyCommandHost?($(),F("span",dV,L(C(t)("settings.mobileHosts.proxyCommand")),1)):y.hasJumpChain?($(),F("span",uV,L(C(t)("settings.mobileHosts.jumpChain")),1)):Z("",!0)]),b("dl",hV,[b("dt",null,L(C(t)("settings.mobileHosts.user")),1),b("dd",fV,L(y.user||C(t)("common.unknown")),1),b("dt",null,L(C(t)("settings.mobileHosts.port")),1),b("dd",pV,L(y.port||C(t)("common.unknown")),1),y.keyId?($(),F(Oe,{key:0},[b("dt",null,L(C(t)("settings.mobileHosts.key")),1),b("dd",vV,L(u(y.keyId)),1)],64)):Z("",!0),y.tags.length?($(),F(Oe,{key:1},[b("dt",null,L(C(t)("settings.mobileHosts.tags")),1),b("dd",gV,L(y.tags.join(", ")),1)],64)):Z("",!0),y.note?($(),F(Oe,{key:2},[b("dt",null,L(C(t)("settings.mobileHosts.note")),1),b("dd",mV,L(y.note),1)],64)):Z("",!0)])]))),128))]))])):Z("",!0)}}),yV=Ct(_V,[["__scopeId","data-v-721a37c4"]]),bV=["data-state"],wV={class:"sync-row"},SV=["data-state"],CV={class:"sync-last","data-testid":"sync-last-synced"},kV={key:0,class:"sync-pending","data-testid":"sync-pending"},xV=["disabled"],RV={key:0,class:"sync-error","data-testid":"sync-error"},TV={key:1,class:"sync-error","data-testid":"sync-trigger-error"},PV={key:2,class:"sync-notice","data-testid":"sync-notice"},EV={key:0,class:"sync-notice-adopted","data-testid":"sync-notice-adopted"},LV={key:1,class:"sync-notice-conflict","data-testid":"sync-notice-conflict"},DV=$e({__name:"SyncStatusIndicator",setup(e){const{t}=$t(),n=dn(),s=n.caps.wailsBindings,i=H({state:"idle",last_synced_at:0,pending_keys:0}),a=H(!1),d=H(""),r=H(null),o={locale_preference:"sync.keys.locale_preference",quick_templates:"sync.keys.quick_templates",notifications_enabled:"sync.keys.notifications_enabled",ai_notifications_only:"sync.keys.ai_notifications_only",command_notify_threshold_seconds:"sync.keys.command_notify_threshold_seconds",shell_integration_enabled:"sync.keys.shell_integration_enabled",pinned_session_ids:"sync.keys.pinned_session_ids",ssh_hosts_encrypted:"sync.keys.ssh_hosts_encrypted",terminal_theme:"sync.keys.terminal_theme",terminal_font_head:"sync.keys.terminal_font_head",terminal_font_size:"sync.keys.terminal_font_size",terminal_line_height:"sync.keys.terminal_line_height",terminal_cursor_style:"sync.keys.terminal_cursor_style",terminal_cursor_blink:"sync.keys.terminal_cursor_blink",terminal_scrollback:"sync.keys.terminal_scrollback",default_shell:"sync.keys.default_shell",shortcut_bindings:"sync.keys.shortcut_bindings",profiles_encrypted:"sync.keys.profiles_encrypted"};function c(f){const _=o[f];return _?t(_):f.replace(/_/g," ").replace(/\b\w/g,S=>S.toUpperCase())}const p=j(()=>{if(i.value.last_synced_at===0)return t("sync.lastSyncedNever");const f=Uy(Math.floor(i.value.last_synced_at/1e3));return t("sync.lastSyncedAt",{time:f})}),u=j(()=>{switch(i.value.state){case"idle":return t("sync.stateIdle");case"syncing":return t("sync.stateSyncing");case"offline":return t("sync.stateOffline");case"error":return t("sync.stateError")}});async function g(){if(!(i.value.state==="syncing"||a.value)){a.value=!0,d.value="";try{await OS()}catch(f){d.value=f instanceof Error?f.message:String(f)}finally{a.value=!1}}}function m(){r.value=null}function y(f){i.value=f,d.value=""}function v(f){var S,k;const _=f;(((S=_.adopted)==null?void 0:S.length)??0)===0&&(((k=_.conflict)==null?void 0:k.length)??0)===0||(r.value=_)}let l=null,h=null;return Dt(async()=>{if(s){l=n.events.on("sync:status",y),h=n.events.on("sync:pulled",v);try{i.value=await $S()}catch{}}}),Vt(()=>{l==null||l(),l=null,h==null||h(),h=null}),(f,_)=>C(s)?($(),F("div",{key:0,class:"sync-indicator","data-testid":"sync-indicator","data-state":i.value.state},[b("div",wV,[b("span",{class:lt(["sync-dot",`state-${i.value.state}`]),"aria-hidden":"true"},null,2),b("span",{class:"sync-state","data-testid":"sync-state","data-state":i.value.state},L(u.value),9,SV),b("span",CV,L(p.value),1),i.value.pending_keys>0?($(),F("span",kV,L(C(t)("sync.pendingKeys",{count:i.value.pending_keys})),1)):Z("",!0),b("button",{class:"sync-now-btn","data-testid":"sync-now-button",disabled:i.value.state==="syncing"||a.value,onClick:g},L(C(t)("sync.syncNow")),9,xV)]),i.value.last_error?($(),F("p",RV,L(i.value.last_error),1)):Z("",!0),d.value?($(),F("p",TV,L(d.value),1)):Z("",!0),r.value?($(),F("div",PV,[r.value.adopted&&r.value.adopted.length?($(),F("p",EV,L(C(t)("sync.pulledAdopted",{keys:r.value.adopted.map(c).join(", ")})),1)):Z("",!0),r.value.conflict&&r.value.conflict.length?($(),F("p",LV,L(C(t)("sync.pulledConflict",{keys:r.value.conflict.map(c).join(", ")})),1)):Z("",!0),b("button",{class:"sync-notice-dismiss","data-testid":"sync-notice-dismiss",onClick:m},L(C(t)("app.dismiss")),1)])):Z("",!0)],8,bV)):Z("",!0)}}),MV=Ct(DV,[["__scopeId","data-v-3da58fd3"]]),AV={class:"dialog"},IV={key:0},$V={key:0},OV={class:"dim"},FV={key:1},BV={class:"dim"},HV={key:1,class:"warn"},NV={class:"row"},zV=$e({__name:"ConfirmInstallDialog",props:{version:{},localCount:{},remoteCount:{}},emits:["confirm","cancel"],setup(e){const{t}=$t(),n=i=>i===1?"sessions.endLocalSessionOne":"sessions.endLocalSessionMany",s=i=>i===1?"sessions.detachRemoteSessionOne":"sessions.detachRemoteSessionMany";return(i,a)=>($(),F("div",{class:"backdrop",onClick:a[2]||(a[2]=ut(d=>i.$emit("cancel"),["self"]))},[b("div",AV,[b("h2",null,L(C(t)("settings.updates.installTitle",{version:i.version})),1),b("p",null,[ot(L(C(t)("settings.updates.installIntro"))+" ",1),i.localCount>0||i.remoteCount>0?($(),F(Oe,{key:0},[ot(L(C(t)("settings.updates.installThisWill")),1)],64)):Z("",!0)]),i.localCount>0||i.remoteCount>0?($(),F("ul",IV,[i.localCount>0?($(),F("li",$V,[ot(L(C(t)(n(i.localCount),{count:i.localCount}))+" ",1),b("span",OV,L(C(t)("sessions.runningProcessesTerminated")),1)])):Z("",!0),i.remoteCount>0?($(),F("li",FV,[ot(L(C(t)(s(i.remoteCount),{count:i.remoteCount}))+" ",1),b("span",BV,L(C(t)("sessions.remotePtyKeepsRunning")),1)])):Z("",!0)])):Z("",!0),i.localCount>0?($(),F("p",HV,L(C(t)("sessions.saveWorkFirst")),1)):Z("",!0),b("div",NV,[b("button",{onClick:a[0]||(a[0]=d=>i.$emit("cancel"))},L(C(t)("common.cancel")),1),b("button",{class:lt(["primary",{danger:i.localCount>0}]),onClick:a[1]||(a[1]=d=>i.$emit("confirm"))},L(i.localCount>0?C(t)("settings.updates.forceInstall"):C(t)("settings.updates.installRestart")),3)])])]))}}),UV=Ct(zV,[["__scopeId","data-v-3b3531ba"]]),VV={class:"dialog"},KV={class:"header"},WV=["title"],jV={key:0,class:"error"},qV={key:1,class:"empty"},YV={key:2,class:"empty"},GV={key:3,class:"content-wrap"},XV={key:0,class:"hint"},JV={class:"row"},QV={class:"lvl-filter"},ZV={class:"lvl-filter-label"},eK={class:"lvl-filter-select"},tK={class:"lvl-filter-label"},nK={class:"tag-filter-select"},sK=["disabled"],iK=$e({__name:"LogViewerDialog",props:{preview:{},loading:{type:Boolean},error:{}},emits:["close","refresh"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H("DEBUG"),d=H(Cc),r=j(()=>Ny(n.preview.content,i("settings.logging.tagFilterAll"))),o=H(null);async function c(){var g;await cn();const u=(g=o.value)==null?void 0:g.$el;u&&(u.scrollTop=u.scrollHeight)}yt(()=>n.preview.content,()=>{c()},{immediate:!0});async function p(){await navigator.clipboard.writeText(n.preview.content)}return(u,g)=>($(),F("div",{class:"backdrop",onClick:g[4]||(g[4]=ut(m=>s("close"),["self"]))},[b("div",VV,[b("div",KV,[b("h2",null,L(C(i)("settings.logging.title")),1),b("div",{class:"path",title:n.preview.path},L(n.preview.path),9,WV)]),n.error?($(),F("div",jV,L(n.error),1)):n.loading?($(),F("div",qV,L(C(i)("common.loading")),1)):n.preview.exists?($(),F("div",GV,[n.preview.truncated?($(),F("div",XV,L(C(i)("settings.logging.truncated")),1)):Z("",!0),Pe(zy,{ref_key:"contentEl",ref:o,class:"content",content:n.preview.content,minLevel:a.value,tag:d.value},null,8,["content","minLevel","tag"])])):($(),F("div",YV,L(C(i)("settings.logging.noContent")),1)),b("div",JV,[b("div",QV,[b("span",ZV,L(C(i)("settings.logging.levelFilter")),1),b("div",eK,[Pe(ts,{modelValue:a.value,options:C(Hy),ariaLabel:C(i)("settings.logging.levelFilter"),"onUpdate:modelValue":g[0]||(g[0]=m=>a.value=m)},null,8,["modelValue","options","ariaLabel"])]),b("span",tK,L(C(i)("settings.logging.tagFilter")),1),b("div",nK,[Pe(ts,{modelValue:d.value,options:r.value,ariaLabel:C(i)("settings.logging.tagFilter"),"onUpdate:modelValue":g[1]||(g[1]=m=>d.value=m)},null,8,["modelValue","options","ariaLabel"])])]),b("button",{onClick:g[2]||(g[2]=m=>s("refresh"))},L(C(i)("common.refresh")),1),b("button",{onClick:p,disabled:!n.preview.content},L(C(i)("common.copy")),9,sK),b("button",{class:"primary",onClick:g[3]||(g[3]=m=>s("close"))},L(C(i)("common.close")),1)])])]))}}),rK=Ct(iK,[["__scopeId","data-v-b060bffd"]]),oK={class:"settings-dialog"},aK={class:"settings-header"},lK=["disabled"],cK={class:"settings-body"},dK={class:"settings-nav"},uK=["innerHTML"],hK={class:"nav-label"},fK=["innerHTML"],pK={class:"nav-label"},vK=["innerHTML"],gK={class:"nav-label"},mK=["innerHTML"],_K={class:"nav-label"},yK=["innerHTML"],bK={class:"nav-label"},wK=["innerHTML"],SK={class:"nav-label"},CK=["innerHTML"],kK={class:"nav-label"},xK=["innerHTML"],RK={class:"nav-label"},TK=["innerHTML"],PK={class:"nav-label"},EK=["innerHTML"],LK={class:"nav-label"},DK=["innerHTML"],MK={class:"nav-label"},AK=["innerHTML"],IK={class:"nav-label"},$K=["innerHTML"],OK={class:"nav-label"},FK=["innerHTML"],BK={class:"nav-label"},HK=["innerHTML"],NK={class:"nav-label"},zK={class:"settings-pane"},UK={class:"settings-pane-header"},VK={class:"settings-pane-title"},KK={key:0,class:"settings-pane-subtitle"},WK={key:9,class:"diag-merged"},jK={key:0,class:"merged-section"},qK={class:"merged-section-title"},YK={class:"merged-section"},GK={key:0,class:"merged-section-title"},XK={class:"merged-section"},JK={class:"merged-section-title"},QK={key:0,class:"settings-footer"},ZK=["disabled"],eW=["disabled"],tW={class:"version-footer","data-testid":"settings-version-footer"},nW={class:"discard-dialog"},sW={class:"discard-row"},fs='viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round"',iW=$e({__name:"SettingsDialog",props:{localSessionCount:{},remoteSessionCount:{},terminalThemeId:{},initialTab:{}},emits:["close","relay-config-changed","terminal-theme-changed","command-notify-threshold-changed","appearance-changed","bindings-changed","profiles-changed","session-created"],setup(e,{emit:t}){const n=dn(),s=n.caps,{t:i,resolvedLocale:a}=$t(),d={general:{labelKey:"settings.tabs.general",english:"General preferences"},account:{labelKey:"settings.account.title",english:"Account"},tasks:{labelKey:"tasks.settings.section",english:"Tasks display"},relay:{labelKey:"settings.tabs.relay",english:"Relay"},plugins:{labelKey:"settings.tabs.plugins",english:"Plugins"},shortcuts:{labelKey:"settings.tabs.shortcuts",english:"Keyboard shortcuts"},templates:{labelKey:"settings.templates.tab",english:"Quick templates"},profiles:{labelKey:"settings.profiles.tab",english:"Session profiles"},logging:{labelKey:"settings.tabs.logging",english:"Logging"},updates:{labelKey:"settings.tabs.updates",english:"Updates"},diagnostics:{labelKey:"settings.diagnostics.tab",english:"Diagnostics"},feishu:{labelKey:"settings.feishu.title",english:"Feishu integration"},devices:{labelKey:"settings.tabs.devices",english:"Signed-in devices"},"received-files":{labelKey:"settings.tabs.receivedFiles",english:"Received files"},"mobile-profiles":{labelKey:"settings.tabs.mobileProfiles",english:"Synced profiles"},"mobile-hosts":{labelKey:"settings.tabs.mobileHosts",english:"SSH hosts"}},r=j(()=>i(d[m.value].labelKey)),o=j(()=>a.value==="zh-CN"?d[m.value].english:""),c={general:``,account:``,tasks:``,relay:``,plugins:``,shortcuts:``,templates:``,profiles:``,updates:``,diagnostics:``,feishu:``,devices:``,"received-files":``,"mobile-profiles":``,"mobile-hosts":``},p=e,u=t,g=p.initialTab==="logging"?"diagnostics":p.initialTab??"general",m=H(g),y=new Set;s.autoUpdate||y.add("updates"),s.pluginHost||(y.add("plugins"),y.add("shortcuts")),s.wailsBindings&&y.add("account"),s.wailsBindings||(y.add("relay"),y.add("diagnostics"),y.add("received-files"),y.add("feishu"),y.add("profiles")),s.capacitor||(y.add("mobile-profiles"),y.add("mobile-hosts")),y.has(m.value)&&(m.value="general");const v=H(Mi(p.terminalThemeId).id);yt(()=>p.terminalThemeId,J=>{v.value=Mi(J).id});const l=H(null),h=H(!1),f=H(null),_=H(!1),S=H(null),k=H(""),P=H(!1),M=H(!1),w=H(!1),T=H(""),A=H(""),E=j(()=>{const J=A.value.trim();return!J||J==="dev"?"AT Term (dev)":`AT Term ${J.startsWith("v")?J:`v${J}`}`});Dt(async()=>{if(s.wailsBindings)try{const J=await um();v.value=Mi(J).id}catch{}}),Dt(async()=>{try{A.value=await n.system.getAppVersion()}catch{}});function R(J){if(m.value!==J){if(m.value==="relay"&&h.value){f.value=J,_.value=!0;return}m.value=J}}function D(){_.value=!1,f.value&&(m.value=f.value,f.value=null),h.value=!1}function I(){_.value=!1,f.value=null}function O(){var J;(J=l.value)!=null&&J.saving||u("close")}function U(J){h.value=J}function W(){h.value=!1,u("relay-config-changed")}function z(J){v.value=Mi(J).id,u("terminal-theme-changed",J)}function N(J){u("command-notify-threshold-changed",J)}function V(J){u("appearance-changed",J)}function q(J){u("bindings-changed",J)}function G(){u("profiles-changed")}async function te(){M.value=!0,await oe()}async function oe(){k.value="",P.value=!0;try{S.value=await dm()}catch(J){k.value=(J==null?void 0:J.message)??String(J)}finally{P.value=!1}}function ie(J){T.value=J,w.value=!0}async function ye(){w.value=!1;try{await rm()}catch{}}function K(){var J;(J=l.value)==null||J.save()}return(J,Q)=>{var ce,Fe,Ee,Ye;return $(),F("div",{class:"backdrop",onClick:ut(O,["self"])},[b("div",oK,[b("header",aK,[b("h2",null,L(C(i)("settings.title")),1),C(s).wailsBindings?($(),bt(MV,{key:0,class:"header-sync-indicator"})):Z("",!0),b("button",{class:"close-btn",onClick:O,disabled:(ce=l.value)==null?void 0:ce.saving},"×",8,lK)]),b("div",cK,[b("aside",dK,[b("button",{class:lt(["settings-nav-item",{active:m.value==="general"}]),onClick:Q[0]||(Q[0]=Ze=>R("general"))},[b("span",{class:"nav-icon",innerHTML:c.general},null,8,uK),b("span",hK,L(C(i)("settings.tabs.general")),1)],2),C(s).wailsBindings?Z("",!0):($(),F("button",{key:0,class:lt(["settings-nav-item",{active:m.value==="account"}]),onClick:Q[1]||(Q[1]=Ze=>R("account"))},[b("span",{class:"nav-icon",innerHTML:c.account},null,8,fK),b("span",pK,L(C(i)("settings.account.title")),1)],2)),b("button",{class:lt(["settings-nav-item",{active:m.value==="tasks"}]),onClick:Q[2]||(Q[2]=Ze=>R("tasks"))},[b("span",{class:"nav-icon",innerHTML:c.tasks},null,8,vK),b("span",gK,L(C(i)("tasks.settings.section")),1)],2),C(s).wailsBindings?($(),F("button",{key:1,class:lt(["settings-nav-item",{active:m.value==="relay"}]),onClick:Q[3]||(Q[3]=Ze=>R("relay"))},[b("span",{class:"nav-icon",innerHTML:c.relay},null,8,mK),b("span",_K,L(C(i)("settings.tabs.relay")),1)],2)):Z("",!0),b("button",{class:lt(["settings-nav-item",{active:m.value==="devices"}]),onClick:Q[4]||(Q[4]=Ze=>R("devices"))},[b("span",{class:"nav-icon",innerHTML:c.devices},null,8,yK),b("span",bK,L(C(i)("settings.tabs.devices")),1)],2),C(s).capacitor?($(),F("button",{key:2,class:lt(["settings-nav-item",{active:m.value==="mobile-profiles"}]),onClick:Q[5]||(Q[5]=Ze=>R("mobile-profiles"))},[b("span",{class:"nav-icon",innerHTML:c["mobile-profiles"]},null,8,wK),b("span",SK,L(C(i)("settings.tabs.mobileProfiles")),1)],2)):Z("",!0),C(s).capacitor?($(),F("button",{key:3,class:lt(["settings-nav-item",{active:m.value==="mobile-hosts"}]),onClick:Q[6]||(Q[6]=Ze=>R("mobile-hosts"))},[b("span",{class:"nav-icon",innerHTML:c["mobile-hosts"]},null,8,CK),b("span",kK,L(C(i)("settings.tabs.mobileHosts")),1)],2)):Z("",!0),C(s).pluginHost?($(),F("button",{key:4,class:lt(["settings-nav-item",{active:m.value==="plugins"}]),onClick:Q[7]||(Q[7]=Ze=>R("plugins"))},[b("span",{class:"nav-icon",innerHTML:c.plugins},null,8,xK),b("span",RK,L(C(i)("settings.tabs.plugins")),1)],2)):Z("",!0),C(s).pluginHost?($(),F("button",{key:5,class:lt(["settings-nav-item",{active:m.value==="shortcuts"}]),onClick:Q[8]||(Q[8]=Ze=>R("shortcuts"))},[b("span",{class:"nav-icon",innerHTML:c.shortcuts},null,8,TK),b("span",PK,L(C(i)("settings.tabs.shortcuts")),1)],2)):Z("",!0),b("button",{class:lt(["settings-nav-item",{active:m.value==="templates"}]),onClick:Q[9]||(Q[9]=Ze=>R("templates"))},[b("span",{class:"nav-icon",innerHTML:c.templates},null,8,EK),b("span",LK,L(C(i)("settings.templates.tab")),1)],2),C(s).wailsBindings?($(),F("button",{key:6,class:lt(["settings-nav-item",{active:m.value==="profiles"}]),onClick:Q[10]||(Q[10]=Ze=>R("profiles"))},[b("span",{class:"nav-icon",innerHTML:c.profiles},null,8,DK),b("span",MK,L(C(i)("settings.profiles.tab")),1)],2)):Z("",!0),C(s).autoUpdate?($(),F("button",{key:7,class:lt(["settings-nav-item",{active:m.value==="updates"}]),onClick:Q[11]||(Q[11]=Ze=>R("updates"))},[b("span",{class:"nav-icon",innerHTML:c.updates},null,8,AK),b("span",IK,L(C(i)("settings.tabs.updates")),1)],2)):Z("",!0),C(s).wailsBindings?($(),F("button",{key:8,class:lt(["settings-nav-item",{active:m.value==="diagnostics"}]),onClick:Q[12]||(Q[12]=Ze=>R("diagnostics"))},[b("span",{class:"nav-icon",innerHTML:c.diagnostics},null,8,$K),b("span",OK,L(C(i)("settings.diagnostics.tab")),1)],2)):Z("",!0),C(s).wailsBindings?($(),F("button",{key:9,class:lt(["settings-nav-item",{active:m.value==="feishu"}]),onClick:Q[13]||(Q[13]=Ze=>R("feishu"))},[b("span",{class:"nav-icon",innerHTML:c.feishu},null,8,FK),b("span",BK,L(C(i)("settings.feishu.title")),1)],2)):Z("",!0),C(s).wailsBindings?($(),F("button",{key:10,class:lt(["settings-nav-item",{active:m.value==="received-files"}]),onClick:Q[14]||(Q[14]=Ze=>R("received-files"))},[b("span",{class:"nav-icon",innerHTML:c["received-files"]},null,8,HK),b("span",NK,L(C(i)("settings.tabs.receivedFiles")),1)],2)):Z("",!0)]),b("section",zK,[b("header",UK,[b("h3",VK,L(r.value),1),o.value?($(),F("span",KK,L(o.value),1)):Z("",!0)]),it(Pe(iF,{"terminal-theme-id":v.value,onTerminalThemeChanged:z,onCommandNotifyThresholdChanged:N,onAppearanceChanged:V},null,8,["terminal-theme-id"]),[[ms,m.value==="general"]]),!C(s).wailsBindings&&m.value==="account"?($(),bt(hB,{key:0})):Z("",!0),it(Pe(Hz,null,null,512),[[ms,m.value==="tasks"]]),C(s).wailsBindings?it(($(),bt(t8,{key:1,ref_key:"relayRef",ref:l,onDirty:U,onRelayConfigChanged:W},null,512)),[[ms,m.value==="relay"]]):Z("",!0),C(s).autoUpdate?it(($(),bt(gH,{key:2,onRequestInstall:ie},null,512)),[[ms,m.value==="updates"]]):Z("",!0),C(s).pluginHost?it(($(),bt(UH,{key:3},null,512)),[[ms,m.value==="plugins"]]):Z("",!0),C(s).pluginHost?it(($(),bt(p7,{key:4,onBindingsChanged:q},null,512)),[[ms,m.value==="shortcuts"]]):Z("",!0),m.value==="templates"?($(),bt(qN,{key:5})):Z("",!0),m.value==="profiles"&&C(s).wailsBindings?($(),bt(xz,{key:6,onProfilesChanged:G})):Z("",!0),m.value==="mobile-profiles"&&C(s).capacitor?($(),bt(Z9,{key:7,onSessionCreated:Q[15]||(Q[15]=Ze=>u("session-created",Ze))})):Z("",!0),m.value==="mobile-hosts"&&C(s).capacitor?($(),bt(yV,{key:8})):Z("",!0),m.value==="diagnostics"&&C(s).wailsBindings?($(),F("div",WK,[C(s).fileDialog?($(),F("section",jK,[b("h4",qK,L(C(i)("settings.tabs.logging")),1),Pe(z8,{onOpenLogViewer:te})])):Z("",!0),b("section",YK,[C(s).fileDialog?($(),F("h4",GK,L(C(i)("settings.diagnostics.section")),1)):Z("",!0),Pe(S7)]),b("section",XK,[b("h4",JK,L(C(i)("settings.configio.title")),1),Pe(Z7)])])):Z("",!0),m.value==="feishu"&&C(s).wailsBindings?($(),bt(BU,{key:10})):Z("",!0),m.value==="devices"?($(),bt(n9,{key:11})):Z("",!0),m.value==="received-files"&&C(s).wailsBindings?($(),bt(S9,{key:12})):Z("",!0)])]),m.value==="relay"?($(),F("footer",QK,[b("button",{onClick:O,disabled:(Fe=l.value)==null?void 0:Fe.saving},L(C(i)("common.cancel")),9,ZK),b("button",{class:"primary",disabled:!((Ee=l.value)!=null&&Ee.canSave),onClick:K},L(((Ye=l.value)==null?void 0:Ye.saveLabel)??C(i)("settings.relay.saveConnect")),9,eW)])):Z("",!0),b("footer",tW,L(E.value),1)]),_.value?($(),F("div",{key:0,class:"discard-backdrop",onClick:ut(I,["self"])},[b("div",nW,[b("h3",null,L(C(i)("settings.discardRelayTitle")),1),b("p",null,L(C(i)("settings.discardRelayBody")),1),b("div",sW,[b("button",{onClick:I},L(C(i)("common.stay")),1),b("button",{class:"danger",onClick:D},L(C(i)("common.discard")),1)])])])):Z("",!0),w.value?($(),bt(UV,{key:1,version:T.value,"local-count":p.localSessionCount,"remote-count":p.remoteSessionCount,onConfirm:ye,onCancel:Q[16]||(Q[16]=Ze=>w.value=!1)},null,8,["version","local-count","remote-count"])):Z("",!0),M.value?($(),bt(rK,{key:2,preview:S.value??{path:"",exists:!1,truncated:!1,content:""},loading:P.value,error:k.value,onRefresh:oe,onClose:Q[17]||(Q[17]=Ze=>M.value=!1)},null,8,["preview","loading","error"])):Z("",!0)])}}}),rW=Ct(iW,[["__scopeId","data-v-5e0ae162"]]);function Gy(e){if(!e||typeof e!="object")return null;const t=e,n=typeof t.Fingerprint=="string"?t.Fingerprint:"",s=typeof t.Host=="string"?t.Host:"";if(!n||!s)return null;const i=typeof t.HopIndex=="number"&&t.HopIndex>0?t.HopIndex:0,a=typeof t.HopName=="string"?t.HopName:"";return{fingerprint:n,host:s,hopIndex:i,hopName:a}}const oW={class:"dialog"},aW={class:"row"},lW={class:"inline"},cW={class:"inline"},dW={key:0},uW={key:2,class:"tofu","data-test":"ssh-tofu"},hW={key:3,class:"error","data-test":"ssh-error"},fW={class:"row end"},pW=["disabled"],vW=$e({__name:"NewSshDialog",emits:["connected","cancel"],setup(e,{emit:t}){const n=t,s=H(""),i=H("22"),a=H(""),d=H("password"),r=H(""),o=H(""),c=H(""),p=H(!1),u=H(""),g=H(null);function m(v){return{host:s.value,port:i.value||"22",user:a.value,auth_kind:d.value,password:d.value==="password"?r.value:void 0,private_key:d.value==="key"?o.value:void 0,passphrase:d.value==="key"?c.value:void 0,accepted_host_key_host:v==null?void 0:v.host,accepted_host_key_fingerprint:v==null?void 0:v.fingerprint}}async function y(v){if(!p.value){p.value=!0,u.value="";try{const l=await nS(m(v));g.value=null,n("connected",l.session_id)}catch(l){const h=Gy(l);h?g.value=h:(g.value=null,u.value=l instanceof Error?l.message:String(l))}finally{p.value=!1}}}return(v,l)=>($(),F("div",{class:"backdrop",onClick:l[11]||(l[11]=ut(h=>v.$emit("cancel"),["self"]))},[b("div",oW,[l[21]||(l[21]=b("h2",null,"New SSH Connection",-1)),b("label",null,[l[12]||(l[12]=ot("Host ")),it(b("input",{"data-test":"ssh-host","onUpdate:modelValue":l[0]||(l[0]=h=>s.value=h),autocomplete:"off"},null,512),[[Pt,s.value]])]),b("label",null,[l[13]||(l[13]=ot("Port ")),it(b("input",{"data-test":"ssh-port","onUpdate:modelValue":l[1]||(l[1]=h=>i.value=h),autocomplete:"off"},null,512),[[Pt,i.value]])]),b("label",null,[l[14]||(l[14]=ot("User ")),it(b("input",{"data-test":"ssh-user","onUpdate:modelValue":l[2]||(l[2]=h=>a.value=h),autocomplete:"off"},null,512),[[Pt,a.value]])]),b("div",aW,[b("label",lW,[it(b("input",{type:"radio",value:"password","onUpdate:modelValue":l[3]||(l[3]=h=>d.value=h),"data-test":"ssh-auth-password"},null,512),[[Id,d.value]]),l[15]||(l[15]=ot(" Password "))]),b("label",cW,[it(b("input",{type:"radio",value:"key","onUpdate:modelValue":l[4]||(l[4]=h=>d.value=h),"data-test":"ssh-auth-key"},null,512),[[Id,d.value]]),l[16]||(l[16]=ot(" Private key "))])]),d.value==="password"?($(),F("label",dW,[l[17]||(l[17]=ot("Password ")),it(b("input",{"data-test":"ssh-password",type:"password","onUpdate:modelValue":l[5]||(l[5]=h=>r.value=h),autocomplete:"off"},null,512),[[Pt,r.value]])])):($(),F(Oe,{key:1},[b("label",null,[l[18]||(l[18]=ot("Private key (PEM) ")),it(b("textarea",{"data-test":"ssh-private-key","onUpdate:modelValue":l[6]||(l[6]=h=>o.value=h),rows:"4"},null,512),[[Pt,o.value]])]),b("label",null,[l[19]||(l[19]=ot("Passphrase (optional) ")),it(b("input",{"data-test":"ssh-passphrase",type:"password","onUpdate:modelValue":l[7]||(l[7]=h=>c.value=h),autocomplete:"off"},null,512),[[Pt,c.value]])])],64)),g.value?($(),F("div",uW,[l[20]||(l[20]=b("p",{class:"warn"},"Unknown host key. Verify this fingerprint before trusting it:",-1)),b("code",null,L(g.value.fingerprint),1),b("button",{class:"primary","data-test":"ssh-accept-hostkey",onClick:l[8]||(l[8]=h=>y(g.value))}," Accept & Connect ")])):Z("",!0),u.value?($(),F("p",hW,L(u.value),1)):Z("",!0),b("div",fW,[b("button",{onClick:l[9]||(l[9]=h=>v.$emit("cancel"))},"Cancel"),b("button",{class:"primary","data-test":"ssh-connect",disabled:p.value,onClick:l[10]||(l[10]=h=>y(null))}," Connect ",8,pW)])])]))}}),gW=Ct(vW,[["__scopeId","data-v-c791c224"]]),mW=256*1024,_W=/-----BEGIN [A-Z0-9 ]*PRIVATE KEY-----/;function yW(e){return _W.test(e)}const Nv="openssh-key-v1\0";function bW(e){if(!e)return!1;if(e.includes("ENCRYPTED PRIVATE KEY")||/^\s*Proc-Type:\s*4,ENCRYPTED/m.test(e))return!0;if(!e.includes("BEGIN OPENSSH PRIVATE KEY"))return!1;const t=wW(e);return t!==null&&t!=="none"}function wW(e){const t=e.replace(/-----BEGIN [^-]*-----/g,"").replace(/-----END [^-]*-----/g,"").replace(/\s+/g,"");if(t==="")return null;let n;try{n=atob(t)}catch{return null}if(!n.startsWith(Nv))return null;const s=Nv.length;if(n.length{const s=new FileReader;s.onload=()=>t(String(s.result??"")),s.onerror=()=>n(s.error??new Error("could not read file")),s.readAsText(e)})}async function kW(e){if(e.size>mW)throw new Error(`${e.name} is too large to be a private key.`);const t=await CW(e);if(!yW(t))throw new Error(`${e.name} is not a private key file.`);return{pem:t,suggestedName:xW(e.name),encrypted:bW(t)}}function xW(e){const t=e.split(/[/\\]/).pop()??"",n=t.toLowerCase();for(const s of SW)if(n.endsWith(s)&&t.length>s.length)return t.slice(0,-s.length);return t}const RW="22";function TW(e){const t=e.user.trim(),n=e.host.trim(),s=(e.port??"").trim(),i=s!==""&&s!==RW?`-p ${s} `:"",a=t===""?n:`${t}@${n}`;return`ssh ${i}${a}`}const ku=e=>e.trim().toLowerCase();function Ql(e){const t=new Set,n=[];for(const s of e){const i=s.trim();if(i==="")continue;const a=ku(i);t.has(a)||(t.add(a),n.push(i))}return n}function PW(e){return Ql(e.split(","))}function EW(e){return Ql(e.flatMap(n=>n.tags??[])).sort((n,s)=>n.localeCompare(s))}function LW(e,t){if(t.length===0)return!0;const n=new Set((e??[]).map(ku));return t.every(s=>n.has(ku(s)))}const DW={class:"ssh-shell"},MW={class:"ssh-header"},AW={class:"tabs"},IW={class:"tab-count"},$W={class:"tab-count"},OW={class:"tab-count"},FW={key:0,class:"search"},BW=["placeholder"],HW={key:1,class:"search-spacer"},NW=["disabled","title"],zW=["title"],UW={key:0,class:"ssh-error","data-test":"ssh-hosts-error"},VW={key:1,class:"ssh-tofu","data-test":"ssh-host-tofu"},KW={class:"tofu-title"},WW={class:"tofu-msg"},jW={class:"tofu-fp"},qW={key:0,class:"tofu-note"},YW={class:"tofu-actions"},GW={key:2,class:"ssh-success","data-test":"ssh-config-import-result"},XW={class:"ssh-body"},JW={key:0,class:"empty"},QW={class:"empty-title"},ZW={class:"empty-sub"},ej={key:0,class:"tag-bar","data-test":"ssh-tag-filter-bar"},tj=["data-test","onClick"],nj={key:1,class:"empty","data-test":"ssh-hosts-no-match"},sj={class:"empty-title"},ij={class:"empty-sub"},rj={key:2,class:"card-grid"},oj=["data-test","onDblclick","onContextmenu"],aj={class:"card-glyph"},lj={class:"card-main"},cj={class:"card-label"},dj={class:"card-sub"},uj={key:0,class:"card-proxy"},hj=["data-test","title"],fj={key:1,class:"card-tags"},pj=["data-test"],vj={class:"card-actions"},gj=["data-test","disabled","title","onClick"],mj=["title","onClick"],_j=["data-test","title","onClick"],yj={class:"ssh-body"},bj={key:0,class:"empty"},wj={class:"empty-title"},Sj={class:"empty-sub"},Cj={key:1,class:"card-grid"},kj={class:"card-glyph"},xj={class:"card-main"},Rj={class:"card-label"},Tj={class:"card-sub"},Pj={class:"card-actions"},Ej=["data-test","title","onClick"],Lj=["data-test","title","onClick"],Dj={class:"ssh-body"},Mj={key:0,class:"empty","data-test":"ssh-tunnels-empty"},Aj={class:"empty-title"},Ij={class:"empty-sub"},$j=["data-test"],Oj={class:"fwd-host-head"},Fj={class:"fwd-host-name"},Bj={class:"fwd-host-sub"},Hj=["data-test","title"],Nj=["data-test"],zj={class:"card-grid"},Uj=["data-test"],Vj={class:"card-glyph"},Kj={class:"card-main"},Wj={class:"card-label"},jj={class:"fwd-kind"},qj={key:0,class:"fwd-note"},Yj={class:"card-sub fwd-route"},Gj={key:0,class:"fwd-row-conns"},Xj=["data-test"],Jj={class:"fwd-card-side"},Qj=["data-test"],Zj={class:"card-actions"},eq=["data-test","title","disabled","onClick"],tq=["data-test","title","disabled","onClick"],nq=["data-test","title","disabled","onClick"],sq=["data-test","title","onClick"],iq=["data-test","title","onClick"],rq={key:0,class:"drawer"},oq={class:"drawer-head"},aq={class:"drawer-body"},lq={class:"field"},cq={class:"fl"},dq=["placeholder"],uq={class:"field-row"},hq={class:"field grow"},fq={class:"fl"},pq=["placeholder"],vq={class:"field port"},gq={class:"fl"},mq={class:"field tag-field"},_q={class:"fl"},yq={class:"tag-editor"},bq=["data-test"],wq=["data-test","title","onClick"],Sq=["placeholder","onKeydown"],Cq={key:0,class:"combo-menu","data-test":"ssh-tag-menu"},kq=["data-test","onMousedown"],xq={class:"field"},Rq={class:"fl"},Tq=["placeholder"],Pq={class:"seg"},Eq={key:0,class:"identity-hint","data-test":"ssh-host-identity-file"},Lq={class:"fl"},Dq={class:"hint"},Mq={key:1,class:"identity-hint proxy","data-test":"ssh-host-drawer-proxy"},Aq={key:2,class:"field"},Iq={class:"fl"},$q={key:0},Oq={key:0,class:"field"},Fq={class:"fl"},Bq={"data-test":"ssh-add-keyid"},Hq={key:1,class:"empty-keys-hint"},Nq={class:"hint"},zq={class:"fwd-section","data-test":"ssh-startup-section"},Uq={class:"fwd-section-head"},Vq={class:"fl"},Kq={class:"hint"},Wq={class:"field"},jq=["placeholder"],qq={class:"field-row"},Yq={class:"field port"},Gq={class:"fl"},Xq=["placeholder"],Jq={key:0,class:"hint grow","data-test":"ssh-startup-steps"},Qq={class:"fwd-section","data-test":"ssh-forwards-section"},Zq={class:"fwd-section-head"},eY={class:"fl"},tY={class:"hint"},nY={key:0,class:"hint","data-test":"ssh-forwards-none"},sY=["data-test"],iY={class:"fwd-rule-head"},rY={class:"seg sm"},oY=["data-test","onClick"],aY=["data-test","onClick"],lY=["data-test","onClick"],cY=["data-test","title","onClick"],dY={class:"hint"},uY={class:"field-row"},hY={class:"field grow"},fY={class:"fl"},pY=["data-test","onUpdate:modelValue"],vY={class:"field port"},gY={class:"fl"},mY=["data-test","onUpdate:modelValue"],_Y={key:0,class:"field-row"},yY={class:"field grow"},bY={class:"fl"},wY=["data-test","onUpdate:modelValue"],SY={class:"field port"},CY={class:"fl"},kY=["data-test","onUpdate:modelValue"],xY={class:"field"},RY={class:"fl"},TY=["data-test","onUpdate:modelValue","placeholder"],PY=["data-test"],EY={class:"drawer-foot"},LY=["disabled"],DY={key:0,class:"drawer"},MY={class:"drawer-head"},AY={class:"drawer-body"},IY={class:"field"},$Y={class:"fl"},OY=["placeholder"],FY={class:"field"},BY={class:"fl pem-label"},HY={key:0},NY={key:0,class:"pem-tools"},zY=["disabled","title"],UY=["title"],VY={class:"field"},KY={class:"fl"},WY={key:0,class:"enc-hint","data-test":"ssh-key-encrypted-hint"},jY={class:"import-block"},qY={class:"drawer-foot"},YY=["disabled"],GY={key:0,class:"drawer","data-test":"ssh-tunnel-drawer"},XY={class:"drawer-head"},JY={class:"drawer-body"},QY={class:"field"},ZY={class:"fl"},eG={"data-test":"ssh-tunnel-host"},tG={class:"hint"},nG={class:"seg"},sG={class:"hint"},iG={class:"field-row"},rG={class:"field grow"},oG={class:"fl"},aG={class:"field port"},lG={class:"fl"},cG={key:0,class:"field-row"},dG={class:"field grow"},uG={class:"fl"},hG={class:"field port"},fG={class:"fl"},pG={class:"field"},vG={class:"fl"},gG=["placeholder"],mG={key:1,class:"fwd-warn","data-test":"ssh-tunnel-bind-warning"},_G={class:"drawer-foot"},yG=["disabled"],bG=["disabled"],wG={key:0,class:"drawer wide","data-test":"ssh-config-import-drawer"},SG={class:"drawer-head"},CG={class:"drawer-body"},kG={key:0,class:"empty","data-test":"ssh-config-import-loading"},xG={class:"empty-sub"},RG={key:1,class:"ssh-error inline","data-test":"ssh-config-import-error"},TG={key:0,class:"empty","data-test":"ssh-config-import-empty"},PG={class:"empty-title"},EG={class:"empty-sub"},LG={key:0,class:"config-section-title"},DG={key:1,class:"config-entry-list"},MG={class:"config-entry-label"},AG=["data-test","checked","onChange"],IG={class:"config-entry-main"},$G={class:"config-entry-alias"},OG={class:"config-entry-sub"},FG={class:"config-entry-badges"},BG=["data-test","title"],HG=["data-test","title"],NG={class:"config-section-title"},zG={class:"config-skipped","data-test":"ssh-config-import-skipped"},UG={class:"skip-alias"},VG={class:"skip-reason"},KG={class:"config-note"},WG={class:"drawer-foot config-foot"},jG={key:0,class:"ssh-error inline","data-test":"ssh-config-import-confirm-error"},qG={class:"foot-actions"},YG=["disabled"],GG=3e3,XG=$e({__name:"SshHostsPanel",emits:["connected","close"],setup(e,{emit:t}){var Ni,zi;const n=t,{t:s}=$t(),i=H("hosts"),a=H([]),d=H([]),r=H(""),o=H(""),c=H("");async function p(){[a.value,d.value]=await Promise.all([Qg(),lS()])}function u(le){le.preventDefault()}let g;Dt(()=>{window.addEventListener("dragover",u),window.addEventListener("drop",u),p(),rt(),g=setInterval(()=>void rt(),GG)}),Vt(()=>{window.removeEventListener("dragover",u),window.removeEventListener("drop",u),g!==void 0&&clearInterval(g)});const m=H([]),y=j(()=>EW(a.value)),v=j(()=>{const le=o.value.trim().toLowerCase();return a.value.filter(ge=>LW(ge.tags,m.value)?le===""?!0:`${ge.alias??""} ${ge.host} ${ge.user} ${(ge.tags??[]).join(" ")}`.toLowerCase().includes(le):!1)});function l(le){const ge=m.value.indexOf(le);m.value=ge>=0?m.value.filter(pe=>pe!==le):[...m.value,le]}function h(){m.value=[]}const f=j(()=>d.value.map(le=>({value:le.id,label:le.key_type?`${le.name} (${le.key_type})`:le.name}))),_=H(!1),S=j(()=>{const le=we.value.trim().toLowerCase(),ge=new Set(re.value.map(pe=>pe.toLowerCase()));return y.value.filter(pe=>!ge.has(pe.toLowerCase())&&(le===""||pe.toLowerCase().includes(le)))});function k(le){re.value=Ql([...re.value,...le])}function P(){k(PW(we.value)),we.value=""}function M(le){k([le]),we.value="",_.value=!1}function w(le){re.value=re.value.filter(ge=>ge!==le)}function T(){we.value===""&&(re.value=re.value.slice(0,-1))}function A(){P(),window.setTimeout(()=>_.value=!1,120)}function E(le){var ge;return((ge=le.alias)==null?void 0:ge.trim())||`${le.user}@${le.host}`}function R(le){const ge=le.port&&le.port!=="22"?`:${le.port}`:"",pe=le.auth_kind==="key"?s("ssh.subtitleAuthKey"):s("ssh.subtitleAuthPassword");return`${le.user}@${le.host}${ge} · ${pe}`}function D(le){return!!le.proxy_command}function I(le){return!!(le.proxy_jump||le.proxy_command)}function O(le){return D(le)?s("ssh.proxy.commandBadge"):s("ssh.proxy.jumpBadge",{target:le.proxy_jump??""})}function U(le){return D(le)?s("ssh.proxy.commandReason",{command:le.proxy_command??""}):le.proxy_jump?s("ssh.proxy.jumpReason",{target:le.proxy_jump}):""}const W=H(null);function z(le){return(le.alias??"").trim()||(le.host??"").trim()}const N=j(()=>{const le=W.value;if(!le)return"";const{prompt:ge}=le;if(ge.hopIndex===0)return s("ssh.hostKey.direct");const pe=z(le.host);return ge.hopName===pe?s("ssh.hostKey.targetHop",{target:pe,hop:ge.hopIndex}):s("ssh.hostKey.jumpHop",{name:ge.hopName,hop:ge.hopIndex,target:pe})});function V(){const le=W.value;le&&G(le.host.id,{host:le.prompt.host,fingerprint:le.prompt.fingerprint})}function q(){W.value=null}async function G(le,ge={host:"",fingerprint:""}){if(c.value)return;r.value="";const pe=a.value.find(Te=>Te.id===le);if(pe&&D(pe)){r.value=U(pe);return}c.value=le;try{const Te=await Jg(le,ge);W.value=null,n("connected",Te.session_id)}catch(Te){const Wt=Gy(Te);if(Wt&&pe){W.value={host:pe,prompt:Wt};return}W.value=null,r.value=Te instanceof Error?Te.message:String(Te)}finally{c.value=""}}const te=H({open:!1,x:0,y:0,host:null}),oe=j(()=>[{key:"connect",label:s("ssh.hosts.menuConnect")},{key:"edit",label:s("ssh.hosts.menuEdit")},{key:"duplicate",label:s("ssh.hosts.menuDuplicate")},{key:"copy-ssh",label:s("ssh.hosts.menuCopySsh")},{key:"remove",label:s("ssh.hosts.menuRemove"),separatorBefore:!0}]);function ie(le,ge){te.value={open:!0,x:le.clientX,y:le.clientY,host:ge}}function ye(){te.value={...te.value,open:!1,host:null}}async function K(le){const ge=te.value.host;if(ge)switch(le){case"connect":await G(ge.id);break;case"edit":x(ge);break;case"duplicate":await J(ge);break;case"copy-ssh":await Q(ge);break;case"remove":await kt(ge.id);break}}async function J(le){var pe;r.value="";const ge={...le,id:"",alias:(pe=le.alias)!=null&&pe.trim()?`${le.alias.trim()} copy`:""};try{const Te=await mf(ge,{});await p(),le.auth_kind==="password"&&x(Te??ge)}catch(Te){r.value=Te instanceof Error?Te.message:String(Te)}}async function Q(le){const ge=TW({user:le.user,host:le.host,port:le.port}),pe=typeof navigator>"u"?void 0:navigator.clipboard;if(pe!=null&&pe.writeText){await pe.writeText(ge);return}va(ge)}const ce=H(!1),Fe=H(null),Ee=H(null),Ye=H(""),Ze=H(""),ue=H("22"),et=H(""),re=H([]),we=H(""),fe=H("password"),De=H(""),Qe=H(""),We=H(""),ae=H("");function _e(){const le=Number.parseInt(ae.value.trim(),10);return Number.isFinite(le)&&le>0?le:0}const be=j(()=>We.value.split(` +`).filter(le=>le.trim()!=="").length);function Me(){var le;Fe.value="",Ee.value=null,Ye.value="",Ze.value="",ue.value="22",et.value="",re.value=[],we.value="",fe.value="password",De.value="",Qe.value=((le=d.value[0])==null?void 0:le.id)??"",We.value="",ae.value="",Je.value=[],ce.value=!0}function x(le){var ge;Fe.value=le.id,Ee.value={...le},Ye.value=le.alias??"",Ze.value=le.host,ue.value=le.port||"22",et.value=le.user,re.value=Ql(le.tags??[]),we.value="",fe.value=le.auth_kind,De.value="",Qe.value=le.key_id??((ge=d.value[0])==null?void 0:ge.id)??"",We.value=le.startup_command??"",ae.value=le.startup_delay_ms?String(le.startup_delay_ms):"",Je.value=wt(le.forwards),ce.value=!0}function Re(){ce.value=!1,Fe.value=null,Ee.value=null}const Ge=j(()=>Ze.value.trim()===""||et.value.trim()===""?!1:fe.value==="key"?Qe.value!=="":!0);async function Ve(){if(!Ge.value)return;r.value="";const le={alias:Ye.value.trim(),host:Ze.value.trim(),port:ue.value.trim()||"22",user:et.value.trim(),tags:re.value,auth_kind:fe.value,key_id:fe.value==="key"?Qe.value:void 0,startup_command:We.value,startup_delay_ms:_e(),forwards:wt(Je.value)},ge={password:fe.value==="password"?De.value:void 0},pe=fe.value==="password"&&De.value!=="";try{Fe.value?await zc({...Ee.value??{},id:Fe.value,...le},pe?ge:null):await mf({id:"",...le},ge),Re(),await p()}catch(Te){r.value=Te instanceof Error?Te.message:String(Te)}}async function kt(le){r.value="";try{await sS(le),await p()}catch(ge){r.value=ge instanceof Error?ge.message:String(ge)}}const Je=H([]);function wt(le){return(le??[]).map(ge=>({id:ge.id,kind:ge.kind,bind_addr:ge.bind_addr??"",bind_port:ge.bind_port??"",target_host:ge.target_host??"",target_port:ge.target_port??"",note:ge.note??""}))}function tt(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`fwd-${Date.now()}-${Math.random().toString(36).slice(2,10)}`}function mt(){Je.value=[...Je.value,{id:tt(),kind:"local",bind_addr:"127.0.0.1",bind_port:"",target_host:"",target_port:"",note:""}]}function se(le){Je.value=Je.value.filter(ge=>ge.id!==le)}function de(le,ge){le.kind=ge}function Le(le){return s(le==="remote"?"ssh.forwards.kindRemoteHint":le==="dynamic"?"ssh.forwards.kindDynamicHint":"ssh.forwards.kindLocalHint")}function Ae(le){const ge=(le??"").trim().toLowerCase();if(ge===""||ge==="localhost"||ge==="::1"||ge==="[::1]")return!0;const pe=/^127\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/.exec(ge);return pe!==null&&pe.slice(1).every(Te=>Number(Te)<=255)}function ct(le){if(Ae(le.bind_addr))return"";const ge=(le.bind_addr??"").trim();return le.kind==="dynamic"?s("ssh.forwards.warnDynamic",{addr:ge}):le.kind==="remote"?s("ssh.forwards.warnRemote",{addr:ge}):s("ssh.forwards.warnLocal",{addr:ge})}const ve=H([]),Be=H("");function me(le,ge){return`${le}/${ge}`}async function rt(){try{ve.value=await aS()??[]}catch{}}const At=j(()=>{const le=new Map;for(const ge of ve.value)le.set(me(ge.host_id,ge.rule_id),ge);return le});function St(le,ge){return At.value.get(me(le,ge))}function xe(le,ge){var pe;return((pe=St(le,ge))==null?void 0:pe.running)===!0}const je=j(()=>a.value.filter(le=>{var ge;return(((ge=le.forwards)==null?void 0:ge.length)??0)>0})),ft=j(()=>ve.value.filter(le=>le.running).length);function Tt(le){return s(le==="remote"?"ssh.forwards.kindRemote":le==="dynamic"?"ssh.forwards.kindDynamic":"ssh.forwards.kindLocal")}function qt(le,ge){const pe=St(le.id,ge.id);return pe!=null&&pe.running&&pe.listen_addr?pe.listen_addr:`${(ge.bind_addr??"").trim()||"127.0.0.1"}:${(ge.bind_port??"").trim()}`}function zt(le,ge){var Te;const pe=St(le.id,ge.id);return pe!=null&&pe.running?(Te=pe.target)!=null&&Te.trim()?pe.target:s("ssh.forwards.dynamicTarget"):ge.kind==="dynamic"?s("ssh.forwards.dynamicTarget"):`${(ge.target_host??"").trim()}:${(ge.target_port??"").trim()}`}function Yt(le,ge){const pe=St(le.id,ge.id);return pe?pe.running?s("ssh.forwards.stateRunning"):s("ssh.forwards.stateStopped"):s("ssh.forwards.stateIdle")}function Qt(le,ge){const pe=St(le.id,ge.id);return pe?pe.running?"running":"stopped":"idle"}async function xn(le,ge){if(!(D(le)||Be.value)){r.value="",Be.value=me(le.id,ge.id);try{await oS(le.id,ge.id)}catch(pe){r.value=pe instanceof Error?pe.message:String(pe)}finally{Be.value="",await rt()}}}async function $n(le,ge){if(!Be.value){r.value="",Be.value=me(le.id,ge.id);try{await _f(le.id,ge.id)}catch(pe){r.value=pe instanceof Error?pe.message:String(pe)}finally{Be.value="",await rt()}}}function Xt(){i.value="tunnels",rt()}const Gt=H(!1),Rn=H(""),Zt=H(""),on=H(!1),Ot=H(null),Hn=j(()=>a.value.filter(le=>!D(le)).map(le=>({value:le.id,label:E(le)})));function Tn(){var le;r.value="",Zt.value="",Rn.value=((le=Hn.value[0])==null?void 0:le.value)??"",Ot.value={id:tt(),kind:"local",bind_addr:"127.0.0.1",bind_port:"",target_host:"",target_port:"",note:""},Gt.value=!0}function bn(le,ge){r.value="",Zt.value=ge.id,Rn.value=le.id,Ot.value=wt([ge])[0],Gt.value=!0}function fn(){Gt.value=!1,Ot.value=null,Zt.value=""}const ss=j(()=>{const le=Ot.value;return!le||Rn.value===""||(le.bind_port??"").trim()===""?!1:le.kind==="dynamic"?!0:(le.target_host??"").trim()!==""&&(le.target_port??"").trim()!==""});async function Nn(){const le=Ot.value;if(!ss.value||!le||on.value)return;const ge=a.value.find(Yn=>Yn.id===Rn.value);if(!ge)return;r.value="",on.value=!0;const pe=wt([le])[0],Te=wt(ge.forwards),Wt=Te.findIndex(Yn=>Yn.id===pe.id),qn=Wt>=0?Te.map((Yn,As)=>As===Wt?pe:Yn):[...Te,pe];try{return await zc({...ge,forwards:qn},null),await p(),fn(),{host:ge,rule:pe}}catch(Yn){r.value=Yn instanceof Error?Yn.message:String(Yn);return}finally{on.value=!1}}async function ke(){const le=await Nn();le&&await xn(le.host,le.rule)}async function nt(le,ge){r.value="";try{St(le.id,ge.id)&&await _f(le.id,ge.id),await zc({...le,forwards:wt(le.forwards).filter(pe=>pe.id!==ge.id)},null),await p(),await rt()}catch(pe){r.value=pe instanceof Error?pe.message:String(pe)}}const gt=H(!1),It=H(null),pn=H(""),Nt=H(""),Pn=H(""),is=H(!1),On=H(!1),us=H(!1);function Vs(){pn.value="",Nt.value="",Pn.value="",is.value=!1,On.value=!1,us.value=!1}async function Ks(){if(!(!It.value||us.value)){if(On.value){On.value=!1,Nt.value="",Pn.value="",is.value=!1;return}r.value="",us.value=!0;try{const le=await yf(It.value);Nt.value=le.private_key,Pn.value=le.passphrase??"",On.value=!0}catch(le){r.value=le instanceof Error?le.message:String(le)}finally{us.value=!1}}}async function fi(){if(It.value){r.value="";try{const le=On.value?Nt.value:(await yf(It.value)).private_key,ge=typeof navigator>"u"?void 0:navigator.clipboard;ge!=null&&ge.writeText?await ge.writeText(le):va(le)}catch(le){r.value=le instanceof Error?le.message:String(le)}}}function Ss(){It.value="",Vs(),gt.value=!0}function ei(){Re(),i.value="keys",Ss()}function Oi(le){It.value=le.id,Vs(),pn.value=le.name,gt.value=!0}function pi(){gt.value=!1,It.value=null}const pr=H(((zi=(Ni=window.matchMedia)==null?void 0:Ni.call(window,"(hover: hover) and (pointer: fine)"))==null?void 0:zi.matches)??!0),vr=H(null),vi=H(!1);function Fi(){var le;(le=vr.value)==null||le.click()}async function gr(le){var Te;const ge=le.target,pe=(Te=ge.files)==null?void 0:Te[0];await gi(pe),ge.value=""}async function Cs(le){var ge,pe;vi.value=!1,await gi((pe=(ge=le.dataTransfer)==null?void 0:ge.files)==null?void 0:pe[0])}async function gi(le){if(le){r.value="";try{const ge=await kW(le);Nt.value=ge.pem,is.value=ge.encrypted,pn.value.trim()===""&&(pn.value=ge.suggestedName)}catch(ge){r.value=ge instanceof Error?ge.message:String(ge)}}}const Bi=j(()=>pn.value.trim()!==""&&(It.value?!0:Nt.value.trim()!==""));async function mi(){if(Bi.value){r.value="";try{It.value?await dS(It.value,pn.value.trim(),Nt.value,Pn.value):await cS(pn.value.trim(),Nt.value,Pn.value),pi(),await p()}catch(le){r.value=le instanceof Error?le.message:String(le)}}}async function _i(le){r.value="";try{await uS(le),await p()}catch(ge){r.value=ge instanceof Error?ge.message:String(ge)}}const Ms=H(!1),mr=H(!1),yi=H(""),En=H(""),ks=H(null),Wn=H(new Set),xs=H(!1),jn=H(null),zn=j(()=>{var le;return((le=ks.value)==null?void 0:le.entries)??[]}),bi=j(()=>{var le;return((le=ks.value)==null?void 0:le.skipped)??[]}),hs=j(()=>new Set(a.value.map(le=>le.alias).filter(Boolean)));function Rs(le){return!!le.alias&&hs.value.has(le.alias)}function Nr(le){return{...le}}async function Io(){Ms.value=!0,yi.value="",En.value="",jn.value=null,ks.value=null,Wn.value=new Set,mr.value=!0;try{ks.value=await iS()}catch(le){yi.value=le instanceof Error?le.message:String(le)}finally{mr.value=!1}}function Hi(){Ms.value=!1}function zr(le){const ge=new Set(Wn.value);ge.has(le)?ge.delete(le):ge.add(le),Wn.value=ge}const Ur=j(()=>Wn.value.size>0);async function $o(){if(!(!ks.value||Wn.value.size===0)){xs.value=!0,En.value="";try{const le=zn.value.filter((pe,Te)=>Wn.value.has(Te)).map(Nr),ge=await rS(le);jn.value=ge,Ms.value=!1,await p()}catch(le){En.value=le instanceof Error?le.message:String(le)}finally{xs.value=!1}}}return(le,ge)=>($(),F("div",{class:"ssh-overlay",onClick:ge[32]||(ge[32]=ut(pe=>le.$emit("close"),["self"]))},[b("div",DW,[b("header",MW,[b("div",AW,[b("button",{class:lt(["tab",{on:i.value==="hosts"}]),"data-test":"ssh-tab-hosts",onClick:ge[0]||(ge[0]=pe=>i.value="hosts")},[Pe(C(to),{size:14}),ot(" "+L(C(s)("ssh.tabHosts"))+" ",1),b("span",IW,L(a.value.length),1)],2),b("button",{class:lt(["tab",{on:i.value==="keys"}]),"data-test":"ssh-tab-keys",onClick:ge[1]||(ge[1]=pe=>i.value="keys")},[Pe(C(qa),{size:14}),ot(" "+L(C(s)("ssh.tabKeys"))+" ",1),b("span",$W,L(d.value.length),1)],2),b("button",{class:lt(["tab",{on:i.value==="tunnels"}]),"data-test":"ssh-tab-tunnels",onClick:Xt},[Pe(C(ul),{size:14}),ot(" "+L(C(s)("ssh.forwards.tab"))+" ",1),b("span",OW,L(ft.value),1)],2)]),i.value==="hosts"?($(),F("div",FW,[Pe(C(Mg),{size:13,class:"search-icon"}),it(b("input",{"onUpdate:modelValue":ge[2]||(ge[2]=pe=>o.value=pe),"data-test":"ssh-search",placeholder:C(s)("ssh.filterPlaceholder"),spellcheck:"false",autocomplete:"off"},null,8,BW),[[Pt,o.value]])])):($(),F("div",HW)),i.value==="hosts"?($(),F("button",{key:2,class:"new-btn ghost","data-test":"ssh-config-import-open",onClick:Io},[Pe(C(Qh),{size:14}),ot(" "+L(C(s)("ssh.configImport.open")),1)])):Z("",!0),i.value==="hosts"?($(),F("button",{key:3,class:"new-btn","data-test":"ssh-new-host",onClick:Me},[Pe(C(Vi),{size:14}),ot(" "+L(C(s)("ssh.newHost")),1)])):i.value==="keys"?($(),F("button",{key:4,class:"new-btn","data-test":"ssh-key-new",onClick:Ss},[Pe(C(Vi),{size:14}),ot(" "+L(C(s)("ssh.newKey")),1)])):($(),F(Oe,{key:5},[b("button",{class:"new-btn ghost","data-test":"ssh-tunnels-refresh",onClick:rt},[Pe(C(Dg),{size:14}),ot(" "+L(C(s)("ssh.forwards.refresh")),1)]),b("button",{class:"new-btn","data-test":"ssh-tunnel-new",disabled:Hn.value.length===0,title:Hn.value.length===0?C(s)("ssh.forwards.newNeedsHost"):"",onClick:Tn},[Pe(C(Vi),{size:14}),ot(" "+L(C(s)("ssh.forwards.new")),1)],8,NW)],64)),b("button",{class:"close-x",title:C(s)("common.close"),onClick:ge[3]||(ge[3]=pe=>le.$emit("close"))},[Pe(C(ii),{size:16})],8,zW)]),r.value?($(),F("p",UW,L(r.value),1)):Z("",!0),W.value?($(),F("div",VW,[b("p",KW,L(C(s)("ssh.hostKey.title")),1),b("p",WW,L(N.value),1),b("code",jW,L(W.value.prompt.fingerprint),1),W.value.prompt.hopIndex>0?($(),F("p",qW,L(C(s)("ssh.hostKey.chainNote")),1)):Z("",!0),b("div",YW,[b("button",{"data-test":"ssh-host-reject-hostkey",onClick:q},L(C(s)("ssh.hostKey.reject")),1),b("button",{class:"new-btn","data-test":"ssh-host-accept-hostkey",onClick:V},L(C(s)("ssh.hostKey.accept")),1)])])):Z("",!0),jn.value!==null?($(),F("p",GW,L(C(s)("ssh.importedHosts",{count:jn.value})),1)):Z("",!0),it(b("div",XW,[a.value.length===0?($(),F("div",JW,[Pe(C(to),{size:40,class:"empty-icon"}),b("p",QW,L(C(s)("ssh.hosts.emptyTitle")),1),b("p",ZW,L(C(s)("ssh.hosts.emptySub")),1),b("button",{class:"new-btn ghost",onClick:Me},[Pe(C(Vi),{size:14}),ot(" "+L(C(s)("ssh.newHost")),1)])])):($(),F(Oe,{key:1},[y.value.length?($(),F("div",ej,[($(!0),F(Oe,null,at(y.value,pe=>($(),F("button",{key:pe,class:lt(["tag-pill",{on:m.value.includes(pe)}]),"data-test":`ssh-tag-filter-${pe}`,onClick:Te=>l(pe)},L(pe),11,tj))),128)),m.value.length?($(),F("button",{key:0,class:"tag-clear","data-test":"ssh-tag-filter-clear",onClick:h},[Pe(C(ii),{size:11}),ot(" "+L(C(s)("ssh.hosts.clearTags")),1)])):Z("",!0)])):Z("",!0),v.value.length===0?($(),F("div",nj,[Pe(C(to),{size:40,class:"empty-icon"}),b("p",sj,L(C(s)("ssh.hosts.noMatchTitle")),1),b("p",ij,L(C(s)("ssh.hosts.noMatchSub")),1)])):($(),F("div",rj,[($(!0),F(Oe,null,at(v.value,pe=>{var Te;return $(),F("article",{key:pe.id,class:lt(["card",{busy:c.value===pe.id}]),"data-test":`ssh-host-card-${pe.id}`,onDblclick:Wt=>G(pe.id),onContextmenu:ut(Wt=>ie(Wt,pe),["prevent"])},[b("div",aj,[pe.auth_kind==="key"?($(),bt(C(qa),{key:0,size:16})):($(),bt(C(to),{key:1,size:16}))]),b("div",lj,[b("div",cj,L(E(pe)),1),b("div",dj,L(R(pe)),1),I(pe)?($(),F("div",uj,[b("span",{class:lt(["proxy-badge",{blocked:D(pe)}]),"data-test":`ssh-host-proxy-${pe.id}`,title:U(pe)},L(O(pe)),11,hj)])):Z("",!0),(Te=pe.tags)!=null&&Te.length?($(),F("div",fj,[($(!0),F(Oe,null,at(pe.tags,Wt=>($(),F("span",{key:Wt,class:"card-tag","data-test":`ssh-host-tag-${pe.id}-${Wt}`},L(Wt),9,pj))),128))])):Z("",!0)]),b("div",vj,[b("button",{class:"act connect","data-test":`ssh-connect-${pe.id}`,disabled:c.value===pe.id||D(pe),title:U(pe)||C(s)("common.connect"),onClick:ut(Wt=>G(pe.id),["stop"])},[Pe(C(bw),{size:13})],8,gj),b("button",{class:"act",title:C(s)("ssh.edit"),onClick:ut(Wt=>x(pe),["stop"])},[Pe(C(Oc),{size:13})],8,mj),b("button",{class:"act danger","data-test":`ssh-delete-${pe.id}`,title:C(s)("common.delete"),onClick:ut(Wt=>kt(pe.id),["stop"])},[Pe(C(Ya),{size:13})],8,_j)])],42,oj)}),128))]))],64))],512),[[ms,i.value==="hosts"]]),it(b("div",yj,[d.value.length===0?($(),F("div",bj,[Pe(C(qa),{size:40,class:"empty-icon"}),b("p",wj,L(C(s)("ssh.keys.emptyTitle")),1),b("p",Sj,L(C(s)("ssh.keys.emptySub")),1),b("button",{class:"new-btn ghost",onClick:Ss},[Pe(C(Vi),{size:14}),ot(" "+L(C(s)("ssh.newKey")),1)])])):($(),F("div",Cj,[($(!0),F(Oe,null,at(d.value,pe=>($(),F("article",{key:pe.id,class:"card"},[b("div",kj,[Pe(C(qa),{size:16})]),b("div",xj,[b("div",Rj,L(pe.name),1),b("div",Tj,L(pe.key_type?C(s)("ssh.keys.typeLabel",{type:pe.key_type}):C(s)("ssh.keys.genericSubtitle")),1)]),b("div",Pj,[b("button",{class:"act","data-test":`ssh-key-edit-${pe.id}`,title:C(s)("ssh.edit"),onClick:ut(Te=>Oi(pe),["stop"])},[Pe(C(Oc),{size:13})],8,Ej),b("button",{class:"act danger","data-test":`ssh-key-delete-${pe.id}`,title:C(s)("common.delete"),onClick:ut(Te=>_i(pe.id),["stop"])},[Pe(C(Ya),{size:13})],8,Lj)])]))),128))]))],512),[[ms,i.value==="keys"]]),it(b("div",Dj,[je.value.length===0?($(),F("div",Mj,[Pe(C(ul),{size:40,class:"empty-icon"}),b("p",Aj,L(C(s)("ssh.forwards.emptyTitle")),1),b("p",Ij,L(C(s)("ssh.forwards.emptySub")),1),Hn.value.length?($(),F("button",{key:0,class:"new-btn ghost","data-test":"ssh-tunnel-new-empty",onClick:Tn},[Pe(C(Vi),{size:14}),ot(" "+L(C(s)("ssh.forwards.new")),1)])):Z("",!0)])):Z("",!0),($(!0),F(Oe,null,at(je.value,pe=>($(),F("section",{key:pe.id,class:"fwd-host","data-test":`ssh-tunnel-host-${pe.id}`},[b("header",Oj,[b("span",Fj,L(E(pe)),1),b("span",Bj,L(pe.user)+"@"+L(pe.host),1),I(pe)?($(),F("span",{key:0,class:lt(["proxy-badge",{blocked:D(pe)}]),"data-test":`ssh-tunnel-proxy-${pe.id}`,title:U(pe)},L(O(pe)),11,Hj)):Z("",!0)]),D(pe)?($(),F("p",{key:0,class:"fwd-proxy-reason","data-test":`ssh-tunnel-proxy-reason-${pe.id}`},L(C(s)("ssh.forwards.proxyBlocked"))+" "+L(U(pe)),9,Nj)):Z("",!0),b("div",zj,[($(!0),F(Oe,null,at(pe.forwards,Te=>{var Wt,qn,Yn;return $(),F("article",{key:Te.id,class:"card fwd-card","data-test":`ssh-tunnel-row-${pe.id}-${Te.id}`},[b("div",Vj,[Pe(C(ul),{size:16})]),b("div",Kj,[b("div",Wj,[b("span",jj,L(Tt(Te.kind)),1),Te.note?($(),F("span",qj,L(Te.note),1)):Z("",!0)]),b("div",Yj,L(qt(pe,Te))+" → "+L(zt(pe,Te)),1),St(pe.id,Te.id)?($(),F("div",Gj,L(C(s)("ssh.forwards.conns",{count:((Wt=St(pe.id,Te.id))==null?void 0:Wt.conns)??0})),1)):Z("",!0),(qn=St(pe.id,Te.id))!=null&&qn.error?($(),F("p",{key:1,class:"fwd-row-error","data-test":`ssh-tunnel-error-${pe.id}-${Te.id}`},L((Yn=St(pe.id,Te.id))==null?void 0:Yn.error),9,Xj)):Z("",!0)]),b("div",Jj,[b("span",{class:lt(["fwd-state",Qt(pe,Te)]),"data-test":`ssh-tunnel-state-${pe.id}-${Te.id}`},L(Yt(pe,Te)),11,Qj),b("div",Zj,[xe(pe.id,Te.id)?($(),F("button",{key:0,class:"act danger","data-test":`ssh-tunnel-stop-${pe.id}-${Te.id}`,title:C(s)("ssh.forwards.stop"),disabled:Be.value!=="",onClick:As=>$n(pe,Te)},[Pe(C(_w),{size:13})],8,eq)):($(),F(Oe,{key:1},[b("button",{class:"act connect","data-test":`ssh-tunnel-start-${pe.id}-${Te.id}`,title:D(pe)?U(pe):C(s)("ssh.forwards.start"),disabled:D(pe)||Be.value!=="",onClick:As=>xn(pe,Te)},[Pe(C(vw),{size:13})],8,tq),St(pe.id,Te.id)?($(),F("button",{key:0,class:"act","data-test":`ssh-tunnel-dismiss-${pe.id}-${Te.id}`,title:C(s)("ssh.forwards.dismiss"),disabled:Be.value!=="",onClick:As=>$n(pe,Te)},[Pe(C(ii),{size:13})],8,nq)):Z("",!0)],64)),b("button",{class:"act","data-test":`ssh-tunnel-edit-${pe.id}-${Te.id}`,title:C(s)("ssh.edit"),onClick:As=>bn(pe,Te)},[Pe(C(Oc),{size:13})],8,sq),b("button",{class:"act danger","data-test":`ssh-tunnel-delete-${pe.id}-${Te.id}`,title:C(s)("common.delete"),onClick:As=>nt(pe,Te)},[Pe(C(Ya),{size:13})],8,iq)])])],8,Uj)}),128))])],8,$j))),128))],512),[[ms,i.value==="tunnels"]]),Pe(Fm,{open:te.value.open,x:te.value.x,y:te.value.y,items:oe.value,onClose:ye,onSelect:K},null,8,["open","x","y","items"]),Pe(ys,{name:"drawer"},{default:jt(()=>{var pe;return[ce.value?($(),F("aside",rq,[b("div",oq,[b("span",null,L(Fe.value?C(s)("ssh.hostDrawer.titleEdit"):C(s)("ssh.hostDrawer.titleNew")),1),b("button",{class:"close-x",onClick:Re},[Pe(C(ii),{size:15})])]),b("div",aq,[b("label",lq,[b("span",cq,L(C(s)("ssh.hostDrawer.address")),1),it(b("input",{"data-test":"ssh-add-host","onUpdate:modelValue":ge[4]||(ge[4]=Te=>Ze.value=Te),placeholder:C(s)("ssh.hostDrawer.addressPlaceholder"),spellcheck:"false",autocomplete:"off"},null,8,dq),[[Pt,Ze.value]])]),b("div",uq,[b("label",hq,[b("span",fq,L(C(s)("ssh.hostDrawer.label")),1),it(b("input",{"data-test":"ssh-add-alias","onUpdate:modelValue":ge[5]||(ge[5]=Te=>Ye.value=Te),placeholder:C(s)("ssh.hostDrawer.labelPlaceholder"),autocomplete:"off"},null,8,pq),[[Pt,Ye.value]])]),b("label",vq,[b("span",gq,L(C(s)("ssh.hostDrawer.port")),1),it(b("input",{"data-test":"ssh-add-port","onUpdate:modelValue":ge[6]||(ge[6]=Te=>ue.value=Te),autocomplete:"off"},null,512),[[Pt,ue.value]])])]),b("label",mq,[b("span",_q,L(C(s)("ssh.hostDrawer.tags")),1),b("div",yq,[($(!0),F(Oe,null,at(re.value,Te=>($(),F("span",{key:Te,class:"chip","data-test":`ssh-add-tag-chip-${Te}`},[ot(L(Te)+" ",1),b("button",{type:"button",class:"chip-x","data-test":`ssh-add-tag-remove-${Te}`,title:C(s)("ssh.hostDrawer.removeTag",{tag:Te}),onClick:ut(Wt=>w(Te),["prevent"])},[Pe(C(ii),{size:10})],8,wq)],8,bq))),128)),it(b("input",{class:"tag-input","data-test":"ssh-add-tag-input","onUpdate:modelValue":ge[7]||(ge[7]=Te=>we.value=Te),placeholder:re.value.length?"":C(s)("ssh.hostDrawer.tagsPlaceholder"),autocomplete:"off",spellcheck:"false",onFocus:ge[8]||(ge[8]=Te=>_.value=!0),onInput:ge[9]||(ge[9]=Te=>_.value=!0),onBlur:A,onKeydown:[Xn(ut(P,["prevent"]),["enter"]),Xn(ut(P,["prevent"]),[","]),Xn(T,["backspace"])]},null,40,Sq),[[Pt,we.value]]),_.value&&S.value.length?($(),F("ul",Cq,[($(!0),F(Oe,null,at(S.value,Te=>($(),F("li",{key:Te,class:"combo-opt","data-test":`ssh-tag-opt-${Te}`,onMousedown:ut(Wt=>M(Te),["prevent"])},L(Te),41,kq))),128))])):Z("",!0)])]),b("label",xq,[b("span",Rq,L(C(s)("ssh.hostDrawer.username")),1),it(b("input",{"data-test":"ssh-add-user","onUpdate:modelValue":ge[10]||(ge[10]=Te=>et.value=Te),placeholder:C(s)("ssh.hostDrawer.usernamePlaceholder"),autocomplete:"off"},null,8,Tq),[[Pt,et.value]])]),b("div",Pq,[b("button",{class:lt({on:fe.value==="password"}),"data-test":"ssh-auth-password",onClick:ge[11]||(ge[11]=Te=>fe.value="password")},L(C(s)("ssh.hostDrawer.authPassword")),3),b("button",{class:lt({on:fe.value==="key"}),"data-test":"ssh-auth-key",onClick:ge[12]||(ge[12]=Te=>fe.value="key")},L(C(s)("ssh.hostDrawer.authKey")),3)]),(pe=Ee.value)!=null&&pe.identity_file?($(),F("p",Eq,[b("span",Lq,L(C(s)("ssh.hostDrawer.identityFileLabel")),1),b("code",null,L(Ee.value.identity_file),1),b("span",Dq,L(C(s)("ssh.hostDrawer.identityFileHint")),1)])):Z("",!0),Ee.value&&I(Ee.value)?($(),F("p",Mq,L(U(Ee.value)),1)):Z("",!0),fe.value==="password"?($(),F("label",Aq,[b("span",Iq,[ot(L(C(s)("ssh.hostDrawer.password")),1),Fe.value?($(),F("em",$q,L(C(s)("ssh.hostDrawer.keepBlank")),1)):Z("",!0)]),it(b("input",{"data-test":"ssh-add-password",type:"password","onUpdate:modelValue":ge[13]||(ge[13]=Te=>De.value=Te),autocomplete:"off"},null,512),[[Pt,De.value]])])):($(),F(Oe,{key:3},[d.value.length?($(),F("label",Oq,[b("span",Fq,L(C(s)("ssh.hostDrawer.keyPicker")),1),b("div",Bq,[Pe(ts,{modelValue:Qe.value,"onUpdate:modelValue":ge[14]||(ge[14]=Te=>Qe.value=Te),options:f.value,"aria-label":C(s)("ssh.hostDrawer.keyPickerAria")},null,8,["modelValue","options","aria-label"])])])):($(),F("div",Hq,[b("p",Nq,L(C(s)("ssh.hostDrawer.noKeys")),1),b("button",{class:"btn primary sm","data-test":"ssh-host-add-key",onClick:ei},[Pe(C(Vi),{size:13}),ot(" "+L(C(s)("ssh.hostDrawer.addKey")),1)])]))],64)),b("div",zq,[b("div",Uq,[b("span",Vq,L(C(s)("ssh.startup.sectionTitle")),1)]),b("p",Kq,L(C(s)("ssh.startup.sectionHint")),1),b("label",Wq,[it(b("textarea",{"data-test":"ssh-startup-command","onUpdate:modelValue":ge[15]||(ge[15]=Te=>We.value=Te),rows:"3",spellcheck:"false",autocomplete:"off",placeholder:C(s)("ssh.startup.placeholder")},null,8,jq),[[Pt,We.value]])]),b("div",qq,[b("label",Yq,[b("span",Gq,L(C(s)("ssh.startup.delay")),1),it(b("input",{"data-test":"ssh-startup-delay","onUpdate:modelValue":ge[16]||(ge[16]=Te=>ae.value=Te),placeholder:String(1500),autocomplete:"off"},null,8,Xq),[[Pt,ae.value]])]),be.value?($(),F("p",Jq,L(C(s)("ssh.startup.steps",{count:be.value})),1)):Z("",!0)])]),b("div",Qq,[b("div",Zq,[b("span",eY,L(C(s)("ssh.forwards.sectionTitle")),1),b("button",{class:"btn sm",type:"button","data-test":"ssh-forward-add",onClick:ut(mt,["prevent"])},[Pe(C(Vi),{size:13}),ot(" "+L(C(s)("ssh.forwards.add")),1)])]),b("p",tY,L(C(s)("ssh.forwards.sectionHint")),1),Je.value.length===0?($(),F("p",nY,L(C(s)("ssh.forwards.noRules")),1)):Z("",!0),($(!0),F(Oe,null,at(Je.value,Te=>($(),F("div",{key:Te.id,class:"fwd-rule","data-test":`ssh-forward-rule-${Te.id}`},[b("div",iY,[b("div",rY,[b("button",{type:"button",class:lt({on:Te.kind==="local"}),"data-test":`ssh-forward-kind-local-${Te.id}`,onClick:ut(Wt=>de(Te,"local"),["prevent"])},L(C(s)("ssh.forwards.kindLocal")),11,oY),b("button",{type:"button",class:lt({on:Te.kind==="remote"}),"data-test":`ssh-forward-kind-remote-${Te.id}`,onClick:ut(Wt=>de(Te,"remote"),["prevent"])},L(C(s)("ssh.forwards.kindRemote")),11,aY),b("button",{type:"button",class:lt({on:Te.kind==="dynamic"}),"data-test":`ssh-forward-kind-dynamic-${Te.id}`,onClick:ut(Wt=>de(Te,"dynamic"),["prevent"])},L(C(s)("ssh.forwards.kindDynamic")),11,lY)]),b("button",{type:"button",class:"act danger","data-test":`ssh-forward-remove-${Te.id}`,title:C(s)("ssh.forwards.remove"),onClick:ut(Wt=>se(Te.id),["prevent"])},[Pe(C(Ya),{size:13})],8,cY)]),b("p",dY,L(Le(Te.kind)),1),b("div",uY,[b("label",hY,[b("span",fY,L(C(s)("ssh.forwards.bindAddr")),1),it(b("input",{"data-test":`ssh-forward-bind-addr-${Te.id}`,"onUpdate:modelValue":Wt=>Te.bind_addr=Wt,placeholder:"127.0.0.1",spellcheck:"false",autocomplete:"off"},null,8,pY),[[Pt,Te.bind_addr]])]),b("label",vY,[b("span",gY,L(C(s)("ssh.forwards.bindPort")),1),it(b("input",{"data-test":`ssh-forward-bind-port-${Te.id}`,"onUpdate:modelValue":Wt=>Te.bind_port=Wt,autocomplete:"off"},null,8,mY),[[Pt,Te.bind_port]])])]),Te.kind!=="dynamic"?($(),F("div",_Y,[b("label",yY,[b("span",bY,L(C(s)("ssh.forwards.targetHost")),1),it(b("input",{"data-test":`ssh-forward-target-host-${Te.id}`,"onUpdate:modelValue":Wt=>Te.target_host=Wt,spellcheck:"false",autocomplete:"off"},null,8,wY),[[Pt,Te.target_host]])]),b("label",SY,[b("span",CY,L(C(s)("ssh.forwards.targetPort")),1),it(b("input",{"data-test":`ssh-forward-target-port-${Te.id}`,"onUpdate:modelValue":Wt=>Te.target_port=Wt,autocomplete:"off"},null,8,kY),[[Pt,Te.target_port]])])])):Z("",!0),b("label",xY,[b("span",RY,L(C(s)("ssh.forwards.label")),1),it(b("input",{"data-test":`ssh-forward-note-${Te.id}`,"onUpdate:modelValue":Wt=>Te.note=Wt,placeholder:C(s)("ssh.forwards.labelPlaceholder"),autocomplete:"off"},null,8,TY),[[Pt,Te.note]])]),ct(Te)?($(),F("p",{key:1,class:"fwd-warn","data-test":`ssh-forward-bind-warning-${Te.id}`},L(ct(Te)),9,PY)):Z("",!0)],8,sY))),128))])]),b("div",EY,[b("button",{class:"btn ghost",onClick:Re},L(C(s)("common.cancel")),1),b("button",{class:"btn primary","data-test":"ssh-add-submit",disabled:!Ge.value,onClick:Ve},L(Fe.value?C(s)("common.save"):C(s)("ssh.hostDrawer.submitNew")),9,LY)])])):Z("",!0)]}),_:1}),Pe(ys,{name:"drawer"},{default:jt(()=>[gt.value?($(),F("aside",DY,[b("div",MY,[b("span",null,L(It.value?C(s)("ssh.keyDrawer.titleEdit"):C(s)("ssh.keyDrawer.titleNew")),1),b("button",{class:"close-x",onClick:pi},[Pe(C(ii),{size:15})])]),b("div",AY,[b("label",IY,[b("span",$Y,L(C(s)("ssh.keyDrawer.name")),1),it(b("input",{"data-test":"ssh-key-name","onUpdate:modelValue":ge[17]||(ge[17]=pe=>pn.value=pe),placeholder:C(s)("ssh.keyDrawer.namePlaceholder"),autocomplete:"off"},null,8,OY),[[Pt,pn.value]])]),b("label",FY,[b("span",BY,[b("span",null,[ot(L(C(s)("ssh.keyDrawer.pem")),1),It.value&&!On.value?($(),F("em",HY,L(C(s)("ssh.keyDrawer.keepBlank")),1)):Z("",!0)]),It.value?($(),F("span",NY,[b("button",{type:"button",class:"act","data-test":"ssh-key-reveal",disabled:us.value,title:On.value?C(s)("ssh.keyDrawer.hide"):C(s)("ssh.keyDrawer.reveal"),onClick:ut(Ks,["prevent"])},[On.value?($(),bt(C(uw),{key:0,size:13})):($(),bt(C(Lg),{key:1,size:13}))],8,zY),b("button",{type:"button",class:"act","data-test":"ssh-key-copy",title:C(s)("ssh.keyDrawer.copy"),onClick:ut(fi,["prevent"])},[Pe(C(dw),{size:13})],8,UY)])):Z("",!0)]),it(b("textarea",{"data-test":"ssh-key-pem","onUpdate:modelValue":ge[18]||(ge[18]=pe=>Nt.value=pe),rows:"6",spellcheck:"false",placeholder:"-----BEGIN OPENSSH PRIVATE KEY-----"},null,512),[[Pt,Nt.value]])]),b("label",VY,[b("span",KY,L(C(s)("ssh.keyDrawer.passphrase")),1),it(b("input",{"data-test":"ssh-key-passphrase",type:"password","onUpdate:modelValue":ge[19]||(ge[19]=pe=>Pn.value=pe),autocomplete:"off"},null,512),[[Pt,Pn.value]])]),is.value?($(),F("p",WY,L(C(s)("ssh.keyDrawer.encryptedHint")),1)):Z("",!0),b("div",jY,[b("input",{ref_key:"keyFileInput",ref:vr,class:"file-input","data-test":"ssh-key-file-input",type:"file",onChange:gr},null,544),pr.value?($(),F("div",{key:0,class:lt(["dropzone",{over:vi.value}]),"data-test":"ssh-key-dropzone",onDragover:ge[20]||(ge[20]=ut(pe=>vi.value=!0,["prevent"])),onDragenter:ge[21]||(ge[21]=ut(pe=>vi.value=!0,["prevent"])),onDragleave:ge[22]||(ge[22]=pe=>vi.value=!1),onDrop:ut(Cs,["prevent"])},[Pe(C(hw),{size:20,class:"dropzone-icon"}),b("span",null,L(C(s)("ssh.keyDrawer.dropzone")),1)],34)):Z("",!0),b("button",{class:"btn import",type:"button","data-test":"ssh-key-import-btn",onClick:Fi},[Pe(C(yw),{size:13}),ot(" "+L(C(s)("ssh.keyDrawer.importFromFile")),1)])])]),b("div",qY,[b("button",{class:"btn ghost",onClick:pi},L(C(s)("common.cancel")),1),b("button",{class:"btn primary","data-test":"ssh-key-submit",disabled:!Bi.value,onClick:mi},L(It.value?C(s)("common.save"):C(s)("ssh.keyDrawer.submitNew")),9,YY)])])):Z("",!0)]),_:1}),Pe(ys,{name:"drawer"},{default:jt(()=>[Gt.value&&Ot.value?($(),F("aside",GY,[b("div",XY,[b("span",null,L(Zt.value?C(s)("ssh.forwards.drawerTitleEdit"):C(s)("ssh.forwards.drawerTitleNew")),1),b("button",{class:"close-x",onClick:fn},[Pe(C(ii),{size:15})])]),b("div",JY,[b("label",QY,[b("span",ZY,L(C(s)("ssh.forwards.hostPicker")),1),b("div",eG,[Pe(ts,{modelValue:Rn.value,"onUpdate:modelValue":ge[23]||(ge[23]=pe=>Rn.value=pe),options:Hn.value,disabled:Zt.value!=="","aria-label":C(s)("ssh.forwards.hostPickerAria")},null,8,["modelValue","options","disabled","aria-label"])])]),b("p",tG,L(C(s)("ssh.forwards.hostPickerHint")),1),b("div",nG,[b("button",{type:"button",class:lt({on:Ot.value.kind==="local"}),"data-test":"ssh-tunnel-kind-local",onClick:ge[24]||(ge[24]=ut(pe=>Ot.value.kind="local",["prevent"]))},L(C(s)("ssh.forwards.kindLocal")),3),b("button",{type:"button",class:lt({on:Ot.value.kind==="remote"}),"data-test":"ssh-tunnel-kind-remote",onClick:ge[25]||(ge[25]=ut(pe=>Ot.value.kind="remote",["prevent"]))},L(C(s)("ssh.forwards.kindRemote")),3),b("button",{type:"button",class:lt({on:Ot.value.kind==="dynamic"}),"data-test":"ssh-tunnel-kind-dynamic",onClick:ge[26]||(ge[26]=ut(pe=>Ot.value.kind="dynamic",["prevent"]))},L(C(s)("ssh.forwards.kindDynamic")),3)]),b("p",sG,L(Le(Ot.value.kind)),1),b("div",iG,[b("label",rG,[b("span",oG,L(C(s)("ssh.forwards.bindAddr")),1),it(b("input",{"data-test":"ssh-tunnel-bind-addr","onUpdate:modelValue":ge[27]||(ge[27]=pe=>Ot.value.bind_addr=pe),placeholder:"127.0.0.1",spellcheck:"false",autocomplete:"off"},null,512),[[Pt,Ot.value.bind_addr]])]),b("label",aG,[b("span",lG,L(C(s)("ssh.forwards.bindPort")),1),it(b("input",{"data-test":"ssh-tunnel-bind-port","onUpdate:modelValue":ge[28]||(ge[28]=pe=>Ot.value.bind_port=pe),autocomplete:"off"},null,512),[[Pt,Ot.value.bind_port]])])]),Ot.value.kind!=="dynamic"?($(),F("div",cG,[b("label",dG,[b("span",uG,L(C(s)("ssh.forwards.targetHost")),1),it(b("input",{"data-test":"ssh-tunnel-target-host","onUpdate:modelValue":ge[29]||(ge[29]=pe=>Ot.value.target_host=pe),spellcheck:"false",autocomplete:"off"},null,512),[[Pt,Ot.value.target_host]])]),b("label",hG,[b("span",fG,L(C(s)("ssh.forwards.targetPort")),1),it(b("input",{"data-test":"ssh-tunnel-target-port","onUpdate:modelValue":ge[30]||(ge[30]=pe=>Ot.value.target_port=pe),autocomplete:"off"},null,512),[[Pt,Ot.value.target_port]])])])):Z("",!0),b("label",pG,[b("span",vG,L(C(s)("ssh.forwards.label")),1),it(b("input",{"data-test":"ssh-tunnel-note","onUpdate:modelValue":ge[31]||(ge[31]=pe=>Ot.value.note=pe),placeholder:C(s)("ssh.forwards.labelPlaceholder"),autocomplete:"off"},null,8,gG),[[Pt,Ot.value.note]])]),ct(Ot.value)?($(),F("p",mG,L(ct(Ot.value)),1)):Z("",!0)]),b("div",_G,[b("button",{class:"btn ghost",onClick:fn},L(C(s)("common.cancel")),1),b("button",{class:"btn","data-test":"ssh-tunnel-save-start",disabled:!ss.value||on.value,onClick:ke},L(C(s)("ssh.forwards.saveAndStart")),9,yG),b("button",{class:"btn primary","data-test":"ssh-tunnel-save",disabled:!ss.value||on.value,onClick:Nn},L(C(s)("common.save")),9,bG)])])):Z("",!0)]),_:1}),Pe(ys,{name:"drawer"},{default:jt(()=>[Ms.value?($(),F("aside",wG,[b("div",SG,[b("span",null,L(C(s)("ssh.configImport.title")),1),b("button",{class:"close-x",onClick:Hi},[Pe(C(ii),{size:15})])]),b("div",CG,[mr.value?($(),F("div",kG,[b("p",xG,L(C(s)("ssh.configImport.loading")),1)])):yi.value?($(),F("p",RG,L(yi.value),1)):ks.value?($(),F(Oe,{key:2},[zn.value.length===0&&bi.value.length===0?($(),F("div",TG,[Pe(C(Qh),{size:36,class:"empty-icon"}),b("p",PG,L(C(s)("ssh.configImport.emptyTitle")),1),b("p",EG,L(C(s)("ssh.configImport.emptySub")),1)])):($(),F(Oe,{key:1},[zn.value.length?($(),F("p",LG,L(C(s)("ssh.configImport.importableTitle",{count:zn.value.length})),1)):Z("",!0),zn.value.length?($(),F("ul",DG,[($(!0),F(Oe,null,at(zn.value,(pe,Te)=>($(),F("li",{key:`${pe.alias}-${Te}`,class:"config-entry"},[b("label",MG,[b("input",{type:"checkbox","data-test":`ssh-config-entry-check-${Te}`,checked:Wn.value.has(Te),onChange:Wt=>zr(Te)},null,40,AG),b("span",IG,[b("span",$G,L(pe.alias||`${pe.user}@${pe.host}`),1),b("span",OG,L(pe.user)+"@"+L(pe.host)+L(pe.port&&pe.port!=="22"?`:${pe.port}`:""),1)]),b("span",FG,[Rs(pe)?($(),F("span",{key:0,class:"overwrite-badge","data-test":`ssh-config-entry-overwrite-${Te}`,title:C(s)("ssh.configImport.overwriteTitle")},L(C(s)("ssh.configImport.overwriteBadge")),9,BG)):Z("",!0),I(pe)?($(),F("span",{key:1,class:lt(["proxy-badge",{blocked:D(pe)}]),"data-test":`ssh-config-entry-proxy-${Te}`,title:U(pe)},L(D(pe)?C(s)("ssh.configImport.proxyBadge",{label:O(pe)}):O(pe)),11,HG)):Z("",!0)])])]))),128))])):Z("",!0),bi.value.length?($(),F(Oe,{key:2},[b("p",NG,L(C(s)("ssh.configImport.skippedTitle",{count:bi.value.length})),1),b("ul",zG,[($(!0),F(Oe,null,at(bi.value,(pe,Te)=>($(),F("li",{key:`${pe.alias}-${Te}`,class:"skip-row"},[b("span",UG,L(pe.alias),1),b("span",VG,L(pe.reason),1)]))),128))])],64)):Z("",!0)],64)),b("p",KG,L(ks.value.note),1)],64)):Z("",!0)]),b("div",WG,[En.value?($(),F("p",jG,L(En.value),1)):Z("",!0),b("div",qG,[b("button",{class:"btn ghost",onClick:Hi},L(C(s)("common.cancel")),1),b("button",{class:"btn primary","data-test":"ssh-config-import-confirm",disabled:!Ur.value||xs.value,onClick:$o},L(xs.value?C(s)("ssh.configImport.importing"):C(s)("ssh.configImport.confirm",{count:Wn.value.size})),9,YG)])])])):Z("",!0)]),_:1})])]))}}),JG=Ct(XG,[["__scopeId","data-v-d1c3506a"]]),QG={class:"dialog"},ZG={key:0},eX={class:"dim"},tX={key:1},nX={class:"dim"},sX={key:0,class:"warn"},iX={class:"row"},rX=$e({__name:"ConfirmQuitDialog",props:{localCount:{},remoteCount:{}},emits:["confirm","cancel"],setup(e){const{t}=$t(),n=i=>i===1?"sessions.endLocalSessionOne":"sessions.endLocalSessionMany",s=i=>i===1?"sessions.detachRemoteSessionOne":"sessions.detachRemoteSessionMany";return(i,a)=>($(),F("div",{class:"backdrop",onClick:a[2]||(a[2]=ut(d=>i.$emit("cancel"),["self"]))},[b("div",QG,[b("h2",null,L(C(t)("sessions.quitTitle")),1),b("p",null,L(C(t)("sessions.closingWill")),1),b("ul",null,[i.localCount>0?($(),F("li",ZG,[ot(L(C(t)(n(i.localCount),{count:i.localCount}))+" ",1),b("span",eX,L(C(t)("sessions.runningProcessesTerminated")),1)])):Z("",!0),i.remoteCount>0?($(),F("li",tX,[ot(L(C(t)(s(i.remoteCount),{count:i.remoteCount}))+" ",1),b("span",nX,L(C(t)("sessions.remotePtyKeepsRunning")),1)])):Z("",!0)]),i.localCount>0?($(),F("p",sX,L(C(t)("sessions.saveWorkFirst")),1)):Z("",!0),b("div",iX,[b("button",{onClick:a[0]||(a[0]=d=>i.$emit("cancel"))},L(C(t)("common.cancel")),1),b("button",{class:lt(["primary",{danger:i.localCount>0}]),onClick:a[1]||(a[1]=d=>i.$emit("confirm"))},L(C(t)("sessions.quit")),3)])])]))}}),oX=Ct(rX,[["__scopeId","data-v-380786e4"]]),aX={class:"startup-fatal","data-testid":"startup-fatal",role:"alert"},lX={class:"startup-fatal-panel"},cX={key:0,class:"startup-fatal-log"},dX={class:"startup-fatal-actions"},uX={key:1,class:"startup-fatal-copy-status"},hX=$e({__name:"StartupFatalPanel",props:{fatal:{}},emits:["quit"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H("");async function d(){var o;const r=["AT Term startup failed",n.fatal.message,n.fatal.log_path?`log: ${n.fatal.log_path}`:""].filter(Boolean).join(` +`);try{if(!((o=navigator.clipboard)!=null&&o.writeText))throw new Error("clipboard unavailable");await navigator.clipboard.writeText(r),a.value=i("app.startupFailureCopied")}catch{a.value=i("terminal.copyFailed")}}return(r,o)=>($(),F("div",aX,[b("section",lX,[b("h1",null,L(C(i)("app.startupFailureTitle")),1),b("p",null,L(C(i)("app.startupFailureIntro")),1),b("pre",null,L(r.fatal.message),1),r.fatal.log_path?($(),F("div",cX,[b("span",null,L(C(i)("app.startupFailureLogPath")),1),b("code",null,L(r.fatal.log_path),1)])):Z("",!0),b("div",dX,[b("button",{onClick:d},L(C(i)("app.startupFailureCopy")),1),b("button",{class:"danger",onClick:o[0]||(o[0]=c=>s("quit"))},L(C(i)("sessions.quit")),1)]),a.value?($(),F("p",uX,L(a.value),1)):Z("",!0)])]))}}),fX=Ct(hX,[["__scopeId","data-v-ad8304f2"]]),pX={class:"dialog",role:"dialog","aria-modal":"true"},vX={key:0},gX={key:1},mX={class:"row"},_X=$e({__name:"ConfirmCloseSessionDialog",props:{title:{},isAi:{type:Boolean},isRunning:{type:Boolean},isRemote:{type:Boolean},count:{default:1}},emits:["confirm","cancel"],setup(e){const{t}=$t();return(n,s)=>($(),F("div",{class:"backdrop",onClick:s[2]||(s[2]=ut(i=>n.$emit("cancel"),["self"]))},[b("div",pX,[b("h2",null,L(C(t)("sessions.closeSessionTitle")),1),b("p",null,L(n.count>1?C(t)("sessions.closeSessionManyBody",{count:n.count}):C(t)("sessions.closeSessionBody",{title:n.title})),1),b("ul",null,[n.isAi?($(),F("li",vX,L(C(t)("sessions.closeAiSessionWarning")),1)):Z("",!0),n.isRunning?($(),F("li",gX,L(C(t)("sessions.closeRunningSessionWarning")),1)):Z("",!0),b("li",null,L(C(t)(n.isRemote?"sessions.closeRemoteDetachHint":"sessions.closeLocalTerminateHint")),1)]),b("div",mX,[b("button",{type:"button",onClick:s[0]||(s[0]=i=>n.$emit("cancel"))},L(C(t)("common.cancel")),1),b("button",{type:"button",class:"primary danger",onClick:s[1]||(s[1]=i=>n.$emit("confirm"))},L(C(t)("sessions.closeSessionConfirm")),1)])])]))}}),yX=Ct(_X,[["__scopeId","data-v-e95fa892"]]),bX={key:0,class:"recovery-dialog-backdrop",role:"dialog","aria-modal":"true"},wX={class:"recovery-dialog"},SX={class:"subtitle"},CX={class:"tab-list"},kX={class:"tab-row"},xX=["onUpdate:modelValue"],RX=["onClick"],TX={class:"tab-title"},PX={class:"tab-meta"},EX={key:0,class:"pane-list"},LX={class:"pane-shell"},DX={class:"pane-cwd"},MX={class:"pane-badge"},AX=["disabled"],IX=$e({__name:"RecoveryDialog",props:{snapshot:{},open:{type:Boolean}},emits:["restore","discard"],setup(e,{emit:t}){const n=e,s=t,{t:i}=$t(),a=H({}),d=H({});zs(()=>{if(n.snapshot)for(const v of n.snapshot.tabs)a.value[v.id]===void 0&&(a.value[v.id]=!0)});const r=j(()=>{const v=Math.floor(Date.now()/1e3),l=Math.max(0,v-n.snapshot.saved_at_unix);return Math.floor(l/60)}),o=j(()=>n.snapshot.clean_shutdown?i("recovery.dialog.subtitleClean",{minutes:r.value}):i("recovery.dialog.subtitleUnclean",{minutes:r.value})),c=j(()=>n.snapshot.tabs.filter(v=>a.value[v.id]).length),p=j(()=>n.snapshot.tabs.length),u=j(()=>c.value===p.value?i("recovery.dialog.btnRestoreAll",{count:p.value}):i("recovery.dialog.btnRestoreSelected",{count:c.value}));function g(v){var l,h;if(v.session_type!=="ai"&&v.last_command_line){const f=v.last_command_line.split(/\s+/)[0];if(f&&!["claude","codex","aider"].includes(f))return i("recovery.dialog.badgeUnclassified")}return v.session_type==="ai"?((l=v.ai)==null?void 0:l.kind)==="aider"||(h=v.ai)!=null&&h.session_id?i("recovery.dialog.badgeResumable"):i("recovery.dialog.badgeFresh"):i("recovery.dialog.badgeShell")}function m(v,l){var _;const h=l.panes[0],f=((_=h==null?void 0:h.last_cwd)==null?void 0:_.split("/").filter(Boolean).pop())??"";return`Tab ${v+1}`+(f?` · ${f}`:"")}function y(){const v=n.snapshot.tabs.filter(l=>a.value[l.id]);s("restore",v)}return(v,l)=>v.open?($(),F("div",bX,[b("div",wX,[b("header",null,[b("h2",null,L(C(i)("recovery.dialog.title")),1),b("p",SX,L(o.value),1)]),b("ul",CX,[($(!0),F(Oe,null,at(v.snapshot.tabs,(h,f)=>($(),F("li",{key:h.id},[b("label",kX,[it(b("input",{type:"checkbox","onUpdate:modelValue":_=>a.value[h.id]=_},null,8,xX),[[vo,a.value[h.id]]]),b("button",{class:"caret",type:"button",onClick:_=>d.value[h.id]=!d.value[h.id]},L(d.value[h.id]?"▾":"▸"),9,RX),b("span",TX,L(m(f,h)),1),b("span",PX,L(h.panes.length)+" "+L(h.panes.length>1?"panes":"pane"),1)]),d.value[h.id]?($(),F("ul",EX,[($(!0),F(Oe,null,at(h.panes,_=>($(),F("li",{key:_.slot},[b("span",LX,L(_.shell.split("/").pop()||_.shell),1),b("span",DX,L(_.last_cwd),1),b("span",MX,L(g(_)),1)]))),128))])):Z("",!0)]))),128))]),b("footer",null,[b("button",{"data-testid":"btn-discard",class:"btn-secondary",onClick:l[0]||(l[0]=h=>s("discard"))},L(C(i)("recovery.dialog.btnDiscard")),1),b("button",{"data-testid":"btn-restore",class:"btn-primary",disabled:c.value===0,onClick:y},L(u.value),9,AX)])])])):Z("",!0)}}),$X=Ct(IX,[["__scopeId","data-v-4735cb7a"]]),OX={class:"startup-update-backdrop",role:"dialog","aria-modal":"true"},FX={class:"startup-update-dialog"},BX={class:"subtitle"},HX={class:"status"},NX={key:0,class:"notes"},zX=["disabled"],UX=["disabled"],VX=$e({__name:"StartupUpdateDialog",emits:["dismiss"],setup(e,{emit:t}){const n=t,{t:s}=$t(),i=H(null),a=H(!1),d=H(!1);let r=null;Dt(async()=>{try{i.value=await go()}catch{}r=window.setInterval(async()=>{try{i.value=await go()}catch{}},2e3)}),Vt(()=>{r!==null&&window.clearInterval(r)});const o=j(()=>{const g=i.value;return g?g.error?g.error:g.ready?s("startupUpdate.statusReady",{version:g.latest}):g.downloading?s("startupUpdate.statusDownloading",{version:g.latest,pct:g.download_pct}):s("startupUpdate.statusAvailable",{version:g.latest}):""});async function c(){a.value=!0;try{await sm()}catch{}finally{a.value=!1}}async function p(){d.value=!0;try{await im()}catch{}finally{d.value=!1}}async function u(){try{await rm()}catch{}}return(g,m)=>{var y,v,l,h,f,_;return $(),F("div",OX,[b("div",FX,[b("header",null,[b("h2",null,L(C(s)("startupUpdate.title")),1),b("p",BX,L(C(s)("startupUpdate.currentToLatest",{current:((y=i.value)==null?void 0:y.current)??"",latest:((v=i.value)==null?void 0:v.latest)??""})),1)]),b("p",HX,L(o.value),1),(l=i.value)!=null&&l.notes?($(),F("details",NX,[b("summary",null,L(C(s)("startupUpdate.releaseNotes")),1),b("pre",null,L(i.value.notes),1)])):Z("",!0),b("footer",null,[b("button",{"data-testid":"startup-update-later",class:"btn-secondary",onClick:m[0]||(m[0]=S=>n("dismiss"))},L(C(s)("startupUpdate.later")),1),(h=i.value)!=null&&h.ready?($(),F("button",{key:0,"data-testid":"startup-update-install",class:"btn-primary",onClick:u},L(C(s)("startupUpdate.installRestart")),1)):(f=i.value)!=null&&f.downloading?($(),F("button",{key:1,"data-testid":"startup-update-cancel",class:"btn-primary danger",disabled:d.value,onClick:p},L(d.value?C(s)("startupUpdate.cancelling"):C(s)("startupUpdate.cancel",{pct:((_=i.value)==null?void 0:_.download_pct)??0})),9,zX)):($(),F("button",{key:2,"data-testid":"startup-update-download",class:"btn-primary",disabled:a.value,onClick:c},L(C(s)("startupUpdate.downloadInstall")),9,UX))])])])}}}),KX=Ct(VX,[["__scopeId","data-v-e5615fd1"]]);function WX(e){const t=e.thresholdMs??3e3,n=e.mod;let s=null,i=!1;function a(){s!==null&&(clearTimeout(s),s=null)}function d(){i&&(i=!1,e.onHide())}function r(){s=null,i=!0,e.onShow()}function o(g){return!(g.key!==n||g.altKey||g.shiftKey||(n==="Meta"?g.ctrlKey:g.metaKey))}function c(g){if(o(g)){if(g.repeat||s!==null||i)return;s=setTimeout(r,t);return}a(),d()}function p(g){g.key===n&&(a(),d())}function u(){a(),d()}document.addEventListener("keydown",c,{capture:!0}),document.addEventListener("keyup",p,{capture:!0}),window.addEventListener("blur",u),Zl(()=>{a(),document.removeEventListener("keydown",c,{capture:!0}),document.removeEventListener("keyup",p,{capture:!0}),window.removeEventListener("blur",u)})}const jX={key:0,class:"hints-backdrop"},qX=["aria-label"],YX={class:"hints-header"},GX={class:"hints-group"},XX={class:"chord"},JX={class:"label"},QX={class:"hints-group"},ZX={class:"chord"},eJ={class:"label"},tJ=$e({__name:"ShortcutHints",props:{mod:{},thresholdMs:{},bindings:{}},setup(e){function t(){return ju()}const n=e,s=n.mod??t(),i=H(!1),{t:a}=$t();WX({mod:s,thresholdMs:n.thresholdMs??3e3,onShow:()=>{i.value=!0},onHide:()=>{i.value=!1}});const d=j(()=>Wy(n.bindings??{})),r=Ai.filter(u=>u.group==="pane"),o=Ai.filter(u=>u.group==="tab");function c(u){return qH(d.value[u.id]??"",s)}function p(u){return(d.value[u.id]??"")===""}return(u,g)=>($(),bt(ys,{name:"fade"},{default:jt(()=>[i.value?($(),F("div",jX,[b("div",{class:"hints-panel",role:"dialog","aria-label":C(a)("settings.shortcuts.keyboardShortcuts")},[b("div",YX,L(C(a)("settings.shortcuts.keyboardShortcuts")),1),b("section",GX,[b("h3",null,L(C(a)("settings.shortcuts.pane")),1),($(!0),F(Oe,null,at(C(r),m=>($(),F("div",{key:m.id,class:lt(["hint-row",{disabled:p(m)}])},[b("div",XX,L(p(m)?"—":c(m)),1),b("div",JX,L(C(a)(m.labelKey)),1)],2))),128))]),b("section",QX,[b("h3",null,L(C(a)("settings.shortcuts.tab")),1),($(!0),F(Oe,null,at(C(o),m=>($(),F("div",{key:m.id,class:lt(["hint-row",{disabled:p(m)}])},[b("div",ZX,L(p(m)?"—":c(m)),1),b("div",eJ,L(C(a)(m.labelKey)),1)],2))),128))])],8,qX)])):Z("",!0)]),_:1}))}}),nJ=Ct(tJ,[["__scopeId","data-v-f52d16ed"]]),sJ={class:"paste-preview-host"},iJ=["onMouseenter","onMouseleave"],rJ=["src","alt","onClick"],oJ={class:"paste-toast-name"},aJ=["aria-label","onClick"],lJ=["src","alt"],cJ=5e3,dJ=$e({__name:"PasteImagePreviewHost",setup(e){const t=H([]),n=H(null),s=new Map;function i(y){const v=window.setTimeout(()=>r(y),cJ);s.set(y,v)}function a(y){const v=s.get(y);v!==void 0&&(window.clearTimeout(v),s.delete(y))}function d(y){let v;try{v=URL.createObjectURL(y.file)}catch(l){Lt("paste","preview createObjectURL failed",{error:Rt(l)});return}t.value.push({id:y.id,file:y.file,url:v,name:y.name}),i(y.id)}function r(y){a(y);const v=t.value.findIndex(h=>h.id===y);if(v===-1)return;const[l]=t.value.splice(v,1);URL.revokeObjectURL(l.url)}function o(y){a(y)}function c(y){t.value.some(v=>v.id===y)&&i(y)}function p(y){n.value&&URL.revokeObjectURL(n.value.url);try{n.value={url:URL.createObjectURL(y.file),name:y.name}}catch(v){Lt("paste","lightbox createObjectURL failed",{error:Rt(v)}),n.value=null}}function u(){n.value&&(URL.revokeObjectURL(n.value.url),n.value=null)}function g(y){y.key==="Escape"&&n.value&&u()}let m=null;return Dt(()=>{m=aa.on(d),document.addEventListener("keydown",g)}),Vt(()=>{m==null||m(),m=null,document.removeEventListener("keydown",g);for(const y of s.values())window.clearTimeout(y);s.clear();for(const y of t.value)URL.revokeObjectURL(y.url);t.value=[],n.value&&(URL.revokeObjectURL(n.value.url),n.value=null)}),(y,v)=>($(),F("div",sJ,[($(!0),F(Oe,null,at(t.value,l=>($(),F("div",{key:l.id,class:"paste-toast","data-testid":"paste-toast",onMouseenter:h=>o(l.id),onMouseleave:h=>c(l.id)},[b("img",{src:l.url,alt:l.name,class:"paste-toast-thumb",onClick:h=>p(l)},null,8,rJ),b("span",oJ,L(l.name),1),b("button",{type:"button",class:"paste-toast-close","data-testid":"paste-toast-close","aria-label":"close "+l.name,onClick:h=>r(l.id)},"×",8,aJ)],40,iJ))),128)),n.value?($(),F("div",{key:0,class:"paste-lightbox","data-testid":"paste-lightbox",onClick:u},[b("img",{src:n.value.url,alt:n.value.name,onClick:v[0]||(v[0]=ut(()=>{},["stop"]))},null,8,lJ)])):Z("",!0)]))}}),uJ=Ct(dJ,[["__scopeId","data-v-6eda1305"]]),hJ={class:"paste-file-host"},fJ={class:"paste-file-name"},pJ={class:"paste-file-size"},vJ=["aria-label","onClick"],gJ=3e3,mJ=$e({__name:"PasteFilePreviewHost",setup(e){const t=H([]),n=new Map;function s(c){return c<1024?`${c} B`:c<1024*1024?`${(c/1024).toFixed(1)} KiB`:`${(c/(1024*1024)).toFixed(1)} MiB`}function i(c){const p=window.setTimeout(()=>r(c),gJ);n.set(c,p)}function a(c){const p=n.get(c);p!==void 0&&(window.clearTimeout(p),n.delete(c))}function d(c){t.value.push({id:c.id,name:c.name,size:c.size}),i(c.id)}function r(c){a(c);const p=t.value.findIndex(u=>u.id===c);p!==-1&&t.value.splice(p,1)}let o=null;return Dt(()=>{o=Gd.on(d)}),Vt(()=>{o==null||o(),o=null;for(const c of n.values())window.clearTimeout(c);n.clear(),t.value=[]}),(c,p)=>($(),F("div",hJ,[($(!0),F(Oe,null,at(t.value,u=>($(),F("div",{key:u.id,class:"paste-file-toast","data-testid":"paste-file-toast"},[p[0]||(p[0]=b("span",{class:"paste-file-icon"},"📎",-1)),b("span",fJ,L(u.name),1),b("span",pJ,"("+L(s(u.size))+")",1),b("button",{type:"button",class:"paste-file-close","data-testid":"paste-file-close","aria-label":"close "+u.name,onClick:g=>r(u.id)},"×",8,vJ)]))),128))]))}}),_J=Ct(mJ,[["__scopeId","data-v-436c1298"]]),yJ=$e({__name:"PluginHost",props:{slotId:{},context:{}},setup(e){const t=e,n=Hr(),{t:s}=$t(),i=tg([]),a=H(!1);async function d(){if(n.cfg&&!a.value){a.value=!0;try{const o=e_(t.slotId).filter(p=>n.isPluginEnabled(p.id)).filter(p=>p.slot!=="context-menu"&&p.slot!=="companion-window"),c=[];for(const p of o)try{const u=await p.load();c.push({descriptor:p,component:u.default})}catch(u){Us("plugin","failed to load",{plugin:p.id,error:Rt(u)}),t.context.showToast(s("app.pluginFailedToLoad",{title:s(p.titleKey)}));try{await n.setEnabled(p.id,!1)}catch(g){Lt("plugin","disable-after-load-failure also failed",{plugin:p.id,error:Rt(g)})}}i.value=c}finally{a.value=!1}}}return Dt(async()=>{n.cfg||await n.load(),await d()}),yt(()=>n.cfg,()=>{d()},{deep:!0}),(r,o)=>($(),F("div",{class:lt(["plugin-host",`slot-${r.slotId}`])},[($(!0),F(Oe,null,at(i.value,c=>($(),bt(R0(c.component),{key:c.descriptor.id,context:r.context},null,8,["context"]))),128))],2))}}),zv=Ct(yJ,[["__scopeId","data-v-db2df210"]]),Uv=3e4;function bJ(e,t={}){let n=!0;const s=t.transport??((a,d)=>fetch(a,d));async function i(a,d,r,o){var k,P,M;const c=e.baseUrl.replace(/\/+$/,"")+"/v1/chat/completions",p=`You are a translation engine. Detect the source language and translate to ${d}. Respond with strict JSON: {"detectedSrcLang":"","translated":""}. No commentary, no markdown.`,u=`You are a translation engine. Translate the following text to ${d}. Output ONLY the translation, no explanation, no quotes, no markdown.`,g={model:e.model,messages:[{role:"system",content:o?p:u},{role:"user",content:a}],temperature:.2};o&&(g.response_format={type:"json_object"});const m=wJ(e.extraParams);m&&Object.assign(g,m);const y=new AbortController,v=setTimeout(()=>y.abort(),Uv),l=()=>y.abort();r.addEventListener("abort",l);let h;try{h=await s(c,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${e.apiKey}`},body:JSON.stringify(g),signal:y.signal})}catch(w){throw w instanceof DOMException&&w.name==="AbortError"?r.aborted?new Os("aborted",rn("plugins.translate.userCancelled")):new Os("timeout",rn("plugins.translate.requestTimedOut",{seconds:Uv/1e3})):new Os("network",w instanceof Error?w.message:String(w))}finally{clearTimeout(v),r.removeEventListener("abort",l)}const f=await h.text();if(h.status===401||h.status===403)throw new Os("auth",rn("plugins.translate.authFailed",{status:h.status}),h.status,f.slice(0,200));if(h.status===429)throw new Os("rate_limit",rn("plugins.translate.rateLimited"),h.status,f.slice(0,200));if(h.status>=500)throw new Os("server",rn("plugins.translate.serverError",{status:h.status}),h.status,f.slice(0,200));if(h.status===400&&o&&/response_format|json_object/i.test(f))throw n=!1,new Vv;if(!h.ok)throw new Os("unknown",`HTTP ${h.status}`,h.status,f.slice(0,200));let _;try{_=JSON.parse(f)}catch{throw new Os("parse",rn("plugins.translate.providerNonJson"),h.status,f.slice(0,200))}const S=((M=(P=(k=_.choices)==null?void 0:k[0])==null?void 0:P.message)==null?void 0:M.content)??"";if(!o)return{translated:S.trim(),detectedSrcLang:"unknown"};try{const w=JSON.parse(S);if(typeof w.translated!="string")throw new Error(rn("plugins.translate.missingTranslated"));const T=typeof w.detectedSrcLang=="string"?w.detectedSrcLang:"unknown";return{translated:w.translated,detectedSrcLang:T}}catch{return{translated:S,detectedSrcLang:"unknown"}}}return{async translate(a,d,r){try{return await i(a,d,r.signal,n)}catch(o){if(o instanceof Vv)return await i(a,d,r.signal,!1);throw o}}}}class Vv extends Error{constructor(){super(rn("plugins.translate.responseFormatUnsupported"))}}function wJ(e){if(!e||!e.trim())return null;let t;try{t=JSON.parse(e)}catch(n){throw new Os("unknown",rn("plugins.translate.invalidExtraParams",{detail:n instanceof Error?n.message:String(n)}))}if(!t||typeof t!="object"||Array.isArray(t))throw new Os("unknown",rn("plugins.translate.invalidExtraParams",{detail:"must be JSON object"}));return t}const SJ={class:"translate-panel__handle"},CJ={class:"translate-panel__title"},kJ=["aria-label"],xJ={class:"translate-panel__source"},RJ={class:"translate-panel__label"},TJ={key:0,class:"translate-panel__detected"},PJ={class:"translate-panel__pre"},EJ={class:"translate-panel__target-row"},LJ={class:"translate-panel__label"},DJ={class:"translate-panel__target-select","data-testid":"translate-target"},MJ={class:"translate-panel__result"},AJ={key:0,class:"translate-panel__loading"},IJ={key:1,class:"translate-panel__error",role:"alert"},$J={key:2,class:"translate-panel__text"},OJ={key:3,class:"translate-panel__placeholder"},FJ={key:0,class:"translate-panel__history"},BJ=["onClick"],HJ={class:"translate-panel__history-source"},NJ={class:"translate-panel__history-translated"},zJ=$e({__name:"TranslatePanel",setup(e){const t=Gu(),{t:n}=$t(),s=[{code:"zh-CN",labelKey:"plugins.translate.simplifiedChinese"},{code:"en",labelKey:"plugins.translate.targetEnglish"},{code:"ja",labelKey:"plugins.translate.targetJapanese"},{code:"ko",labelKey:"plugins.translate.targetKorean"},{code:"de",labelKey:"plugins.translate.targetGerman"},{code:"fr",labelKey:"plugins.translate.targetFrench"},{code:"es",labelKey:"plugins.translate.targetSpanish"}],i=j(()=>s.map(v=>({value:v.code,label:n(v.labelKey)}))),a=j({get:()=>t.targetLang,set:v=>{t.changeTarget(v)}}),d=H({x:-1,y:80}),r=H(!1),o=H({dx:0,dy:0});function c(v){if(v.target.closest(".translate-panel__handle")==null)return;r.value=!0;const h=v.currentTarget.getBoundingClientRect();o.value={dx:v.clientX-h.left,dy:v.clientY-h.top},d.value={x:h.left,y:h.top},v.preventDefault()}function p(v){r.value&&(d.value=g(v.clientX-o.value.dx,v.clientY-o.value.dy))}function u(){r.value=!1}function g(v,l){return{x:Math.max(8,Math.min(window.innerWidth-480-8,v)),y:Math.max(8,Math.min(window.innerHeight-320-8,l))}}window.addEventListener("mousemove",p),window.addEventListener("mouseup",u),sc(()=>{window.removeEventListener("mousemove",p),window.removeEventListener("mouseup",u)});const m=j(()=>d.value.x<0?{left:`${Math.max(8,(window.innerWidth-480)/2)}px`,top:"80px"}:{left:`${d.value.x}px`,top:`${d.value.y}px`});function y(){t.retry()}return(v,l)=>{var h;return $(),bt(Sl,{to:"body"},[C(t).visible?($(),F("div",{key:0,"data-testid":"translate-panel",class:"translate-panel",style:nn(m.value),onMousedown:c},[b("header",SJ,[b("span",CJ,L(C(n)("plugins.translate.title")),1),b("button",{type:"button",class:"translate-panel__close","data-testid":"translate-close","aria-label":C(n)("plugins.translate.closePanel"),onClick:l[0]||(l[0]=(...f)=>C(t).close&&C(t).close(...f))},"×",8,kJ)]),b("section",xJ,[b("div",RJ,[ot(L(C(n)("plugins.translate.source"))+" ",1),(h=C(t).result)!=null&&h.detectedSrcLang&&C(t).result.detectedSrcLang!=="unknown"?($(),F("span",TJ,"· "+L(C(n)("plugins.translate.detected",{lang:C(t).result.detectedSrcLang})),1)):Z("",!0)]),b("pre",PJ,L(C(t).source),1)]),b("section",EJ,[b("label",LJ,L(C(n)("plugins.translate.target")),1),b("div",DJ,[Pe(ts,{modelValue:a.value,"onUpdate:modelValue":l[1]||(l[1]=f=>a.value=f),options:i.value,"aria-label":C(n)("plugins.translate.target")},null,8,["modelValue","options","aria-label"])])]),b("section",MJ,[C(t).loading?($(),F("div",AJ,L(C(n)("plugins.translate.translating")),1)):C(t).error?($(),F("div",IJ,[b("div",null,L(C(t).error.message),1),b("button",{type:"button",onClick:y},L(C(n)("common.retry")),1)])):C(t).result?($(),F("div",$J,L(C(t).result.translated),1)):($(),F("div",OJ,L(C(n)("plugins.translate.noResult")),1))]),C(t).history.length>0?($(),F("details",FJ,[b("summary",null,L(C(n)("plugins.translate.recent",{count:C(t).history.length})),1),b("ul",null,[($(!0),F(Oe,null,at(C(t).history,(f,_)=>($(),F("li",{key:_},[b("button",{type:"button",class:"translate-panel__history-row",onClick:S=>C(t).restoreFromHistory(f)},[b("span",HJ,L(f.source.slice(0,60)),1),l[2]||(l[2]=b("span",{class:"translate-panel__history-arrow"},"→",-1)),b("span",NJ,L(f.translated.slice(0,60)),1)],8,BJ)]))),128))])])):Z("",!0)],36)):Z("",!0)])}}}),UJ=Ct(zJ,[["__scopeId","data-v-be75a3d1"]]);var Kv;(e=>{class t{constructor(o={}){Y(this,"in_per_sec");Y(this,"out_per_sec");typeof o=="string"&&(o=JSON.parse(o)),this.in_per_sec=o.in_per_sec,this.out_per_sec=o.out_per_sec}static createFrom(o={}){return new t(o)}}e.ByteStats=t;class n{constructor(o={}){Y(this,"at_ms");Y(this,"rtt_ms");typeof o=="string"&&(o=JSON.parse(o)),this.at_ms=o.at_ms,this.rtt_ms=o.rtt_ms}static createFrom(o={}){return new n(o)}}e.RTTSample=n;class s{constructor(o={}){Y(this,"last_ms");Y(this,"p50_ms");Y(this,"p95_ms");typeof o=="string"&&(o=JSON.parse(o)),this.last_ms=o.last_ms,this.p50_ms=o.p50_ms,this.p95_ms=o.p95_ms}static createFrom(o={}){return new s(o)}}e.RTTStats=s;class i{constructor(o={}){Y(this,"at_ms");Y(this,"reason");Y(this,"duration_ms");typeof o=="string"&&(o=JSON.parse(o)),this.at_ms=o.at_ms,this.reason=o.reason,this.duration_ms=o.duration_ms}static createFrom(o={}){return new i(o)}}e.ReconnectEvent=i;class a{constructor(o={}){Y(this,"count_last_hour");Y(this,"last_at_ms");Y(this,"last_reason");Y(this,"history");typeof o=="string"&&(o=JSON.parse(o)),this.count_last_hour=o.count_last_hour,this.last_at_ms=o.last_at_ms,this.last_reason=o.last_reason,this.history=this.convertValues(o.history,i)}static createFrom(o={}){return new a(o)}convertValues(o,c,p=!1){if(!o)return o;if(o.slice&&o.map)return o.map(u=>this.convertValues(u,c));if(typeof o=="object"){if(p){for(const u of Object.keys(o))o[u]=new c(o[u]);return o}return new c(o)}return o}}e.ReconnectStats=a;class d{constructor(o={}){Y(this,"state");Y(this,"rtt");Y(this,"rtt_samples");Y(this,"reconnect");Y(this,"bytes");Y(this,"seq_gaps");typeof o=="string"&&(o=JSON.parse(o)),this.state=o.state,this.rtt=this.convertValues(o.rtt,s),this.rtt_samples=this.convertValues(o.rtt_samples,n),this.reconnect=this.convertValues(o.reconnect,a),this.bytes=this.convertValues(o.bytes,t),this.seq_gaps=o.seq_gaps}static createFrom(o={}){return new d(o)}convertValues(o,c,p=!1){if(!o)return o;if(o.slice&&o.map)return o.map(u=>this.convertValues(u,c));if(typeof o=="object"){if(p){for(const u of Object.keys(o))o[u]=new c(o[u]);return o}return new c(o)}return o}}e.Snapshot=d})(Kv||(Kv={}));var Wv;(e=>{class t{constructor(s={}){Y(this,"AppID");Y(this,"AppSecret");Y(this,"EncryptKey");Y(this,"VerifyToken");typeof s=="string"&&(s=JSON.parse(s)),this.AppID=s.AppID,this.AppSecret=s.AppSecret,this.EncryptKey=s.EncryptKey,this.VerifyToken=s.VerifyToken}static createFrom(s={}){return new t(s)}}e.Credentials=t})(Wv||(Wv={}));var jv;(e=>{class t{constructor(s={}){Y(this,"enabled");Y(this,"binary_path");Y(this,"binary_ok");Y(this,"binary_version");Y(this,"settings_path");Y(this,"settings_ok");Y(this,"last_error");Y(this,"last_check");typeof s=="string"&&(s=JSON.parse(s)),this.enabled=s.enabled,this.binary_path=s.binary_path,this.binary_ok=s.binary_ok,this.binary_version=s.binary_version,this.settings_path=s.settings_path,this.settings_ok=s.settings_ok,this.last_error=s.last_error,this.last_check=s.last_check}static createFrom(s={}){return new t(s)}}e.State=t})(jv||(jv={}));var xu;(e=>{class t{constructor(x={}){Y(this,"kind");Y(this,"session_id");Y(this,"captured_at_unix");typeof x=="string"&&(x=JSON.parse(x)),this.kind=x.kind,this.session_id=x.session_id,this.captured_at_unix=x.captured_at_unix}static createFrom(x={}){return new t(x)}}e.AIInfo=t;class n{constructor(x={}){Y(this,"host");Y(this,"fingerprint");typeof x=="string"&&(x=JSON.parse(x)),this.host=x.host,this.fingerprint=x.fingerprint}static createFrom(x={}){return new n(x)}}e.AcceptedHostKey=n;class s{constructor(x={}){Y(this,"host_id");Y(this,"rule_id");Y(this,"kind");Y(this,"listen_addr");Y(this,"target");Y(this,"conns");Y(this,"started_at");Y(this,"running");Y(this,"error");typeof x=="string"&&(x=JSON.parse(x)),this.host_id=x.host_id,this.rule_id=x.rule_id,this.kind=x.kind,this.listen_addr=x.listen_addr,this.target=x.target,this.conns=x.conns,this.started_at=x.started_at,this.running=x.running,this.error=x.error}static createFrom(x={}){return new s(x)}}e.ActiveForward=s;class i{constructor(x={}){Y(this,"kind");Y(this,"text");Y(this,"filename");Y(this,"content_type");Y(this,"data_base64");Y(this,"reason");typeof x=="string"&&(x=JSON.parse(x)),this.kind=x.kind,this.text=x.text,this.filename=x.filename,this.content_type=x.content_type,this.data_base64=x.data_base64,this.reason=x.reason}static createFrom(x={}){return new i(x)}}e.ClipboardPastePayload=i;class a{constructor(x={}){Y(this,"atterm_export");Y(this,"exported_at");Y(this,"app_version");Y(this,"preferences");typeof x=="string"&&(x=JSON.parse(x)),this.atterm_export=x.atterm_export,this.exported_at=x.exported_at,this.app_version=x.app_version,this.preferences=x.preferences}static createFrom(x={}){return new a(x)}}e.ConfigExport=a;class d{constructor(x={}){Y(this,"default_shell");Y(this,"locale");Y(this,"terminal_theme");Y(this,"notifications_enabled");Y(this,"shell_integration_enabled");Y(this,"webgl_renderer_enabled");Y(this,"logging_enabled");Y(this,"log_file_path");Y(this,"auto_check_updates");Y(this,"command_notify_threshold_seconds");typeof x=="string"&&(x=JSON.parse(x)),this.default_shell=x.default_shell,this.locale=x.locale,this.terminal_theme=x.terminal_theme,this.notifications_enabled=x.notifications_enabled,this.shell_integration_enabled=x.shell_integration_enabled,this.webgl_renderer_enabled=x.webgl_renderer_enabled,this.logging_enabled=x.logging_enabled,this.log_file_path=x.log_file_path,this.auto_check_updates=x.auto_check_updates,this.command_notify_threshold_seconds=x.command_notify_threshold_seconds}static createFrom(x={}){return new d(x)}}e.ConfigSummary=d;class r{constructor(x={}){Y(this,"timestamp");Y(this,"message");typeof x=="string"&&(x=JSON.parse(x)),this.timestamp=x.timestamp,this.message=x.message}static createFrom(x={}){return new r(x)}}e.RelayErrorEntry=r;class o{constructor(x={}){Y(this,"generated_at");Y(this,"app_version");Y(this,"os");Y(this,"arch");Y(this,"os_version");Y(this,"webview_summary");Y(this,"user_agent");Y(this,"relay_url");Y(this,"relay_status");Y(this,"relay_token_redacted");Y(this,"allow_insecure_relay");Y(this,"remote_permission");Y(this,"uplink_paused");Y(this,"recent_relay_errors");Y(this,"config");typeof x=="string"&&(x=JSON.parse(x)),this.generated_at=x.generated_at,this.app_version=x.app_version,this.os=x.os,this.arch=x.arch,this.os_version=x.os_version,this.webview_summary=x.webview_summary,this.user_agent=x.user_agent,this.relay_url=x.relay_url,this.relay_status=x.relay_status,this.relay_token_redacted=x.relay_token_redacted,this.allow_insecure_relay=x.allow_insecure_relay,this.remote_permission=x.remote_permission,this.uplink_paused=x.uplink_paused,this.recent_relay_errors=this.convertValues(x.recent_relay_errors,r),this.config=this.convertValues(x.config,d)}static createFrom(x={}){return new o(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.DiagnosticsPayload=o;class c{constructor(x={}){Y(this,"name");Y(this,"isDir");Y(this,"size");Y(this,"modTime");typeof x=="string"&&(x=JSON.parse(x)),this.name=x.name,this.isDir=x.isDir,this.size=x.size,this.modTime=x.modTime}static createFrom(x={}){return new c(x)}}e.DirEntry=c;class p{constructor(x={}){Y(this,"url");Y(this,"session_token");typeof x=="string"&&(x=JSON.parse(x)),this.url=x.url,this.session_token=x.session_token}static createFrom(x={}){return new p(x)}}e.Endpoint=p;class u{constructor(x={}){Y(this,"enabled");Y(this,"auto_attach");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.auto_attach=x.auto_attach}static createFrom(x={}){return new u(x)}}e.FeishuRemoteTerminalSettings=u;class g{constructor(x={}){Y(this,"enabled");Y(this,"mode");Y(this,"bound");Y(this,"open_id");Y(this,"disabled");Y(this,"relay_disabled");Y(this,"error");Y(this,"configured");Y(this,"app_id");Y(this,"app_id_hash");Y(this,"callback_url");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.mode=x.mode,this.bound=x.bound,this.open_id=x.open_id,this.disabled=x.disabled,this.relay_disabled=x.relay_disabled,this.error=x.error,this.configured=x.configured,this.app_id=x.app_id,this.app_id_hash=x.app_id_hash,this.callback_url=x.callback_url}static createFrom(x={}){return new g(x)}}e.FeishuStatusResp=g;class m{constructor(x={}){Y(this,"path");Y(this,"data");Y(this,"isBinary");Y(this,"truncatedAt");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.data=x.data,this.isBinary=x.isBinary,this.truncatedAt=x.truncatedAt}static createFrom(x={}){return new m(x)}}e.FileContent=m;class y{constructor(x={}){Y(this,"enabled");Y(this,"panelWidthPx");Y(this,"panelCollapsed");Y(this,"innerTreeRatio");Y(this,"showHidden");Y(this,"showLineNumbers");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.panelWidthPx=x.panelWidthPx,this.panelCollapsed=x.panelCollapsed,this.innerTreeRatio=x.innerTreeRatio,this.showHidden=x.showHidden,this.showLineNumbers=x.showLineNumbers}static createFrom(x={}){return new y(x)}}e.FileExplorerConfig=y;class v{constructor(x={}){Y(this,"path");Y(this,"size");Y(this,"modTime");Y(this,"isBinary");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.size=x.size,this.modTime=x.modTime,this.isBinary=x.isBinary}static createFrom(x={}){return new v(x)}}e.FileMetaInfo=v;class l{constructor(x={}){Y(this,"id");Y(this,"kind");Y(this,"bind_addr");Y(this,"bind_port");Y(this,"target_host");Y(this,"target_port");Y(this,"note");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.kind=x.kind,this.bind_addr=x.bind_addr,this.bind_port=x.bind_port,this.target_host=x.target_host,this.target_port=x.target_port,this.note=x.note}static createFrom(x={}){return new l(x)}}e.ForwardRule=l;class h{constructor(x={}){Y(this,"timestamp_ms");Y(this,"level");Y(this,"tag");Y(this,"message");typeof x=="string"&&(x=JSON.parse(x)),this.timestamp_ms=x.timestamp_ms,this.level=x.level,this.tag=x.tag,this.message=x.message}static createFrom(x={}){return new h(x)}}e.FrontendLogRecord=h;class f{constructor(x={}){Y(this,"host_id");Y(this,"host");Y(this,"user");typeof x=="string"&&(x=JSON.parse(x)),this.host_id=x.host_id,this.host=x.host,this.user=x.user}static createFrom(x={}){return new f(x)}}e.HostInfo=f;class _{constructor(x={}){Y(this,"key");Y(this,"action");Y(this,"detail");typeof x=="string"&&(x=JSON.parse(x)),this.key=x.key,this.action=x.action,this.detail=x.detail}static createFrom(x={}){return new _(x)}}e.ImportChange=_;class S{constructor(x={}){Y(this,"changes");Y(this,"skipped");typeof x=="string"&&(x=JSON.parse(x)),this.changes=this.convertValues(x.changes,_),this.skipped=x.skipped}static createFrom(x={}){return new S(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.ImportPreview=S;class k{constructor(x={}){Y(this,"applied");Y(this,"skipped");typeof x=="string"&&(x=JSON.parse(x)),this.applied=this.convertValues(x.applied,_),this.skipped=x.skipped}static createFrom(x={}){return new k(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.ImportReport=k;class P{constructor(x={}){Y(this,"host");Y(this,"fingerprint");typeof x=="string"&&(x=JSON.parse(x)),this.host=x.host,this.fingerprint=x.fingerprint}static createFrom(x={}){return new P(x)}}e.KnownHostEntry=P;class M{constructor(x={}){Y(this,"path");Y(this,"exists");Y(this,"truncated");Y(this,"content");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.exists=x.exists,this.truncated=x.truncated,this.content=x.content}static createFrom(x={}){return new M(x)}}e.LogPreview=M;class w{constructor(x={}){Y(this,"enabled");Y(this,"path");Y(this,"effective_path");Y(this,"dev_dual_output");Y(this,"level");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.path=x.path,this.effective_path=x.effective_path,this.dev_dual_output=x.dev_dual_output,this.level=x.level}static createFrom(x={}){return new w(x)}}e.LoggingConfig=w;class T{constructor(x={}){Y(this,"command");Y(this,"args");Y(this,"cwd");Y(this,"cols");Y(this,"rows");Y(this,"profile_id");Y(this,"ai_kind");Y(this,"initial_ai_session_id");Y(this,"initial_ai_command_line");typeof x=="string"&&(x=JSON.parse(x)),this.command=x.command,this.args=x.args,this.cwd=x.cwd,this.cols=x.cols,this.rows=x.rows,this.profile_id=x.profile_id,this.ai_kind=x.ai_kind,this.initial_ai_session_id=x.initial_ai_session_id,this.initial_ai_command_line=x.initial_ai_command_line}static createFrom(x={}){return new T(x)}}e.NewSessionReq=T;class A{constructor(x={}){Y(this,"session_id");typeof x=="string"&&(x=JSON.parse(x)),this.session_id=x.session_id}static createFrom(x={}){return new A(x)}}e.NewSessionResp=A;class E{constructor(x={}){Y(this,"token");Y(this,"expires_at");Y(this,"qr_url");Y(this,"wrapped");typeof x=="string"&&(x=JSON.parse(x)),this.token=x.token,this.expires_at=x.expires_at,this.qr_url=x.qr_url,this.wrapped=x.wrapped}static createFrom(x={}){return new E(x)}}e.PairingTokenResponse=E;class R{constructor(x={}){Y(this,"slot");Y(this,"remote");Y(this,"host_id");Y(this,"session_id");Y(this,"shell");Y(this,"shell_args");Y(this,"last_cwd");Y(this,"session_type");Y(this,"last_command_line");Y(this,"title");Y(this,"ai");typeof x=="string"&&(x=JSON.parse(x)),this.slot=x.slot,this.remote=x.remote,this.host_id=x.host_id,this.session_id=x.session_id,this.shell=x.shell,this.shell_args=x.shell_args,this.last_cwd=x.last_cwd,this.session_type=x.session_type,this.last_command_line=x.last_command_line,this.title=x.title,this.ai=this.convertValues(x.ai,t)}static createFrom(x={}){return new R(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.PaneSnapshot=R;class D{constructor(x={}){Y(this,"enabled");Y(this,"aiOnly");Y(this,"collapsed");Y(this,"windowX");Y(this,"windowY");Y(this,"mutedUntilUnix");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.aiOnly=x.aiOnly,this.collapsed=x.collapsed,this.windowX=x.windowX,this.windowY=x.windowY,this.mutedUntilUnix=x.mutedUntilUnix}static createFrom(x={}){return new D(x)}}e.WidgetConfig=D;class I{constructor(x={}){Y(this,"bindings");typeof x=="string"&&(x=JSON.parse(x)),this.bindings=x.bindings}static createFrom(x={}){return new I(x)}}e.ShortcutsConfig=I;class O{constructor(x={}){Y(this,"enabled");Y(this,"provider");Y(this,"baseUrl");Y(this,"apiKey");Y(this,"model");Y(this,"defaultTargetLang");Y(this,"extraParams");typeof x=="string"&&(x=JSON.parse(x)),this.enabled=x.enabled,this.provider=x.provider,this.baseUrl=x.baseUrl,this.apiKey=x.apiKey,this.model=x.model,this.defaultTargetLang=x.defaultTargetLang,this.extraParams=x.extraParams}static createFrom(x={}){return new O(x)}}e.TranslateConfig=O;class U{constructor(x={}){Y(this,"fileExplorer");Y(this,"translate");Y(this,"shortcuts");Y(this,"widget");typeof x=="string"&&(x=JSON.parse(x)),this.fileExplorer=this.convertValues(x.fileExplorer,y),this.translate=this.convertValues(x.translate,O),this.shortcuts=this.convertValues(x.shortcuts,I),this.widget=this.convertValues(x.widget,D)}static createFrom(x={}){return new U(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.PluginConfig=U;class W{constructor(x={}){Y(this,"id");Y(this,"label");Y(this,"text");Y(this,"hotkey");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.label=x.label,this.text=x.text,this.hotkey=x.hotkey}static createFrom(x={}){return new W(x)}}e.QuickTemplate=W;class z{constructor(x={}){Y(this,"name");Y(this,"bytes");Y(this,"received_at");typeof x=="string"&&(x=JSON.parse(x)),this.name=x.name,this.bytes=x.bytes,this.received_at=x.received_at}static createFrom(x={}){return new z(x)}}e.ReceivedFileEntry=z;class N{constructor(x={}){Y(this,"session_id");Y(this,"session_name");Y(this,"bytes");Y(this,"files");typeof x=="string"&&(x=JSON.parse(x)),this.session_id=x.session_id,this.session_name=x.session_name,this.bytes=x.bytes,this.files=this.convertValues(x.files,z)}static createFrom(x={}){return new N(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.ReceivedFilesSessionEntry=N;class V{constructor(x={}){Y(this,"total_bytes");Y(this,"sessions");typeof x=="string"&&(x=JSON.parse(x)),this.total_bytes=x.total_bytes,this.sessions=this.convertValues(x.sessions,N)}static createFrom(x={}){return new V(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.ReceivedFilesSummary=V;class q{constructor(x={}){Y(this,"id");Y(this,"layout");Y(this,"active_pane_idx");Y(this,"col_ratio");Y(this,"row_ratio");Y(this,"panes");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.layout=x.layout,this.active_pane_idx=x.active_pane_idx,this.col_ratio=x.col_ratio,this.row_ratio=x.row_ratio,this.panes=this.convertValues(x.panes,R)}static createFrom(x={}){return new q(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.TabSnapshot=q;class G{constructor(x={}){Y(this,"version");Y(this,"host_id");Y(this,"clean_shutdown");Y(this,"saved_at_unix");Y(this,"active_tab_id");Y(this,"tabs");typeof x=="string"&&(x=JSON.parse(x)),this.version=x.version,this.host_id=x.host_id,this.clean_shutdown=x.clean_shutdown,this.saved_at_unix=x.saved_at_unix,this.active_tab_id=x.active_tab_id,this.tabs=this.convertValues(x.tabs,q)}static createFrom(x={}){return new G(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.RecoverySnapshot=G;class te{constructor(x={}){Y(this,"url");Y(this,"token");Y(this,"session_expires_at");Y(this,"allow_insecure_relay");Y(this,"disable_e2ee");Y(this,"remote_permission");Y(this,"last_email");Y(this,"connected");Y(this,"remote_proxy_url");Y(this,"remote_http_proxy_url");Y(this,"paused");typeof x=="string"&&(x=JSON.parse(x)),this.url=x.url,this.token=x.token,this.session_expires_at=x.session_expires_at,this.allow_insecure_relay=x.allow_insecure_relay,this.disable_e2ee=x.disable_e2ee,this.remote_permission=x.remote_permission,this.last_email=x.last_email,this.connected=x.connected,this.remote_proxy_url=x.remote_proxy_url,this.remote_http_proxy_url=x.remote_http_proxy_url,this.paused=x.paused}static createFrom(x={}){return new te(x)}}e.RelayConfig=te;class oe{constructor(x={}){Y(this,"user_id");Y(this,"email");Y(this,"is_admin");typeof x=="string"&&(x=JSON.parse(x)),this.user_id=x.user_id,this.email=x.email,this.is_admin=x.is_admin}static createFrom(x={}){return new oe(x)}}e.RelayMe=oe;class ie{constructor(x={}){Y(this,"id_hash");Y(this,"user_agent");Y(this,"ip_prefix");Y(this,"created_at");Y(this,"expires_at");Y(this,"is_current");typeof x=="string"&&(x=JSON.parse(x)),this.id_hash=x.id_hash,this.user_agent=x.user_agent,this.ip_prefix=x.ip_prefix,this.created_at=x.created_at,this.expires_at=x.expires_at,this.is_current=x.is_current}static createFrom(x={}){return new ie(x)}}e.RelaySessionRow=ie;class ye{constructor(x={}){Y(this,"path");Y(this,"entries");Y(this,"truncated");Y(this,"total");typeof x=="string"&&(x=JSON.parse(x)),this.path=x.path,this.entries=this.convertValues(x.entries,c),this.truncated=x.truncated,this.total=x.total}static createFrom(x={}){return new ye(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.SFTPListing=ye;class K{constructor(x={}){Y(this,"alias");Y(this,"reason");typeof x=="string"&&(x=JSON.parse(x)),this.alias=x.alias,this.reason=x.reason}static createFrom(x={}){return new K(x)}}e.SSHConfigImportSkipped=K;class J{constructor(x={}){Y(this,"id");Y(this,"alias");Y(this,"host");Y(this,"port");Y(this,"user");Y(this,"auth_kind");Y(this,"key_id");Y(this,"tags");Y(this,"note");Y(this,"startup_command");Y(this,"startup_delay_ms");Y(this,"identity_file");Y(this,"proxy_jump");Y(this,"proxy_command");Y(this,"forwards");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.alias=x.alias,this.host=x.host,this.port=x.port,this.user=x.user,this.auth_kind=x.auth_kind,this.key_id=x.key_id,this.tags=x.tags,this.note=x.note,this.startup_command=x.startup_command,this.startup_delay_ms=x.startup_delay_ms,this.identity_file=x.identity_file,this.proxy_jump=x.proxy_jump,this.proxy_command=x.proxy_command,this.forwards=this.convertValues(x.forwards,l)}static createFrom(x={}){return new J(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.SSHHost=J;class Q{constructor(x={}){Y(this,"entries");Y(this,"skipped");Y(this,"note");typeof x=="string"&&(x=JSON.parse(x)),this.entries=this.convertValues(x.entries,J),this.skipped=this.convertValues(x.skipped,K),this.note=x.note}static createFrom(x={}){return new Q(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.SSHConfigImportPreview=Q;class ce{constructor(x={}){Y(this,"host");Y(this,"port");Y(this,"user");Y(this,"auth_kind");Y(this,"password");Y(this,"private_key");Y(this,"passphrase");Y(this,"cols");Y(this,"rows");Y(this,"accepted_host_key_host");Y(this,"accepted_host_key_fingerprint");typeof x=="string"&&(x=JSON.parse(x)),this.host=x.host,this.port=x.port,this.user=x.user,this.auth_kind=x.auth_kind,this.password=x.password,this.private_key=x.private_key,this.passphrase=x.passphrase,this.cols=x.cols,this.rows=x.rows,this.accepted_host_key_host=x.accepted_host_key_host,this.accepted_host_key_fingerprint=x.accepted_host_key_fingerprint}static createFrom(x={}){return new ce(x)}}e.SSHConnectReq=ce;class Fe{constructor(x={}){Y(this,"id");Y(this,"name");Y(this,"key_type");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.name=x.name,this.key_type=x.key_type}static createFrom(x={}){return new Fe(x)}}e.SSHKey=Fe;class Ee{constructor(x={}){Y(this,"private_key");Y(this,"passphrase");typeof x=="string"&&(x=JSON.parse(x)),this.private_key=x.private_key,this.passphrase=x.passphrase}static createFrom(x={}){return new Ee(x)}}e.SSHKeySecret=Ee;class Ye{constructor(x={}){Y(this,"service_id");Y(this,"client_ticket");Y(this,"client_to_host_key");Y(this,"host_to_client_key");Y(this,"port");Y(this,"path_prefix");typeof x=="string"&&(x=JSON.parse(x)),this.service_id=x.service_id,this.client_ticket=x.client_ticket,this.client_to_host_key=x.client_to_host_key,this.host_to_client_key=x.host_to_client_key,this.port=x.port,this.path_prefix=x.path_prefix}static createFrom(x={}){return new Ye(x)}}e.ServicePreviewMapping=Ye;class Ze{constructor(x={}){Y(this,"gateway_id");Y(this,"mapping_index");Y(this,"service_id");Y(this,"client_ticket");Y(this,"client_to_host_key");Y(this,"host_to_client_key");typeof x=="string"&&(x=JSON.parse(x)),this.gateway_id=x.gateway_id,this.mapping_index=x.mapping_index,this.service_id=x.service_id,this.client_ticket=x.client_ticket,this.client_to_host_key=x.client_to_host_key,this.host_to_client_key=x.host_to_client_key}static createFrom(x={}){return new Ze(x)}}e.ServicePreviewRebindRequest=Ze;class ue{constructor(x={}){Y(this,"mappings");Y(this,"service_id");Y(this,"client_ticket");Y(this,"client_to_host_key");Y(this,"host_to_client_key");typeof x=="string"&&(x=JSON.parse(x)),this.mappings=this.convertValues(x.mappings,Ye),this.service_id=x.service_id,this.client_ticket=x.client_ticket,this.client_to_host_key=x.client_to_host_key,this.host_to_client_key=x.host_to_client_key}static createFrom(x={}){return new ue(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.ServicePreviewStartRequest=ue;class et{constructor(x={}){Y(this,"id");Y(this,"url");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.url=x.url}static createFrom(x={}){return new et(x)}}e.ServicePreviewStartResponse=et;class re{constructor(x={}){Y(this,"id");Y(this,"name");Y(this,"shell");Y(this,"cwd");Y(this,"startup_cmd");Y(this,"env");Y(this,"sync_env");typeof x=="string"&&(x=JSON.parse(x)),this.id=x.id,this.name=x.name,this.shell=x.shell,this.cwd=x.cwd,this.startup_cmd=x.startup_cmd,this.env=x.env,this.sync_env=x.sync_env}static createFrom(x={}){return new re(x)}}e.SessionProfile=re;class we{constructor(x={}){Y(this,"deleted");typeof x=="string"&&(x=JSON.parse(x)),this.deleted=x.deleted}static createFrom(x={}){return new we(x)}}e.SignOutOthersResult=we;class fe{constructor(x={}){Y(this,"fatal");Y(this,"message");Y(this,"log_path");typeof x=="string"&&(x=JSON.parse(x)),this.fatal=x.fatal,this.message=x.message,this.log_path=x.log_path}static createFrom(x={}){return new fe(x)}}e.StartupError=fe;class De{constructor(x={}){Y(this,"state");Y(this,"last_synced_at");Y(this,"pending_keys");Y(this,"last_error");typeof x=="string"&&(x=JSON.parse(x)),this.state=x.state,this.last_synced_at=x.last_synced_at,this.pending_keys=x.pending_keys,this.last_error=x.last_error}static createFrom(x={}){return new De(x)}}e.SyncStatus=De;class Qe{constructor(x={}){Y(this,"baseUrl");Y(this,"apiKey");Y(this,"body");Y(this,"timeoutSeconds");typeof x=="string"&&(x=JSON.parse(x)),this.baseUrl=x.baseUrl,this.apiKey=x.apiKey,this.body=x.body,this.timeoutSeconds=x.timeoutSeconds}static createFrom(x={}){return new Qe(x)}}e.TranslateHTTPRequest=Qe;class We{constructor(x={}){Y(this,"status");Y(this,"body");typeof x=="string"&&(x=JSON.parse(x)),this.status=x.status,this.body=x.body}static createFrom(x={}){return new We(x)}}e.TranslateHTTPResponse=We;class ae{constructor(x={}){Y(this,"minor");Y(this,"latest");Y(this,"notes");Y(this,"asset_url");typeof x=="string"&&(x=JSON.parse(x)),this.minor=x.minor,this.latest=x.latest,this.notes=x.notes,this.asset_url=x.asset_url}static createFrom(x={}){return new ae(x)}}e.VersionLine=ae;class _e{constructor(x={}){Y(this,"current");Y(this,"latest");Y(this,"available");Y(this,"notes");Y(this,"checking");Y(this,"last_check_at");Y(this,"downloading");Y(this,"download_pct");Y(this,"ready");Y(this,"downloaded_exists");Y(this,"error");Y(this,"asset_url");Y(this,"asset_size");Y(this,"download_dir");Y(this,"download_path");Y(this,"lines");typeof x=="string"&&(x=JSON.parse(x)),this.current=x.current,this.latest=x.latest,this.available=x.available,this.notes=x.notes,this.checking=x.checking,this.last_check_at=x.last_check_at,this.downloading=x.downloading,this.download_pct=x.download_pct,this.ready=x.ready,this.downloaded_exists=x.downloaded_exists,this.error=x.error,this.asset_url=x.asset_url,this.asset_size=x.asset_size,this.download_dir=x.download_dir,this.download_path=x.download_path,this.lines=this.convertValues(x.lines,ae)}static createFrom(x={}){return new _e(x)}convertValues(x,Re,Ge=!1){if(!x)return x;if(x.slice&&x.map)return x.map(Ve=>this.convertValues(Ve,Re));if(typeof x=="object"){if(Ge){for(const Ve of Object.keys(x))x[Ve]=new Re(x[Ve]);return x}return new Re(x)}return x}}e.UpdateState=_e;class be{constructor(x={}){Y(this,"password");typeof x=="string"&&(x=JSON.parse(x)),this.password=x.password}static createFrom(x={}){return new be(x)}}e.sshCredential=be})(xu||(xu={}));const VJ=$e({__name:"TranslatePanelHost",setup(e){const t=Gu(),n=Hr(),s=dn(),i=j(()=>{var d;return((d=n.cfg)==null?void 0:d.translate)??null});function a(d){return async(r,o)=>{const c=xu.TranslateHTTPRequest.createFrom({baseUrl:d.baseUrl,apiKey:d.apiKey,body:o.body,timeoutSeconds:30}),p=await DR(c);return new Response(p.body,{status:p.status,headers:{"Content-Type":"application/json"}})}}return zs(()=>{const d=i.value;if(!d||!d.apiKey||!d.baseUrl||!d.model){t.configure({provider:{translate:async()=>{throw new Error(rn("plugins.translate.notConfigured"))}},defaultTargetLang:(d==null?void 0:d.defaultTargetLang)||"zh-CN"});return}const r=bJ({baseUrl:d.baseUrl,apiKey:d.apiKey,model:d.model,extraParams:d.extraParams},s.caps.wailsBindings?{transport:a({baseUrl:d.baseUrl,apiKey:d.apiKey})}:void 0);t.configure({provider:r,defaultTargetLang:d.defaultTargetLang})}),(d,r)=>($(),bt(UJ))}});function KJ(e){const t=j(()=>{var o;return((o=e.activePane.value)==null?void 0:o.sessionId)??null}),n=j(()=>{var o;return!!((o=e.activePane.value)!=null&&o.remote)}),s=j(()=>{const o=e.activePane.value;return o?e.sessionConnectionForPane(o):null}),i=j(()=>{const o=e.activePane.value;return o?e.endpointForPane(o):null}),a=j(()=>{const o=e.activePane.value;if(!o)return null;const c=e.sessionInfoForPane(o);return(c==null?void 0:c.cwd)??null});function d(o){const c=e.activePane.value;if(!c||!c.sessionId){e.showToast(rn("app.noActiveSession"));return}const p=e.endpointForPane(c);if(!p){e.showToast(rn("app.noEndpoint"));return}e.sendToSession(c.sessionId,p,o)}const r=j(()=>e.terminalThemeId.value);return{activePane:e.activePane,activeSessionId:t,activeIsRemote:n,activeSessionConnection:s,activeEndpoint:i,activeCwd:a,terminalThemeId:r,send:d,showToast:e.showToast}}const qv=new Map;function WJ(e,t){return`${e.url}|${t}`}function jJ(e,t,n){const s=WJ(e,t);let i=qv.get(s);i||(i=new Gg(e,t,{}),qv.set(s,i),i.attach()),i.sendInput(n)}function qJ(e,t,n,s){if(t===n)return e;const i=e.slice(),a=i.findIndex(c=>c.id===t);if(a<0)return e;const[d]=i.splice(a,1),r=i.findIndex(c=>c.id===n);if(r<0)return i.push(d),i;const o=s==="after"?r+1:r;return i.splice(o,0,d),i}function YJ(e,t,n,s,i){const a=e.find(c=>c.id===s);if(!a)return null;const d=[];for(const c of a.panes)c.sessionId&&!c.remote&&d.push(c.sessionId);const r=i!=null&&i.detachOnly?[]:d.slice(),o=new Set(r);return{localIdsToClose:r,nextTabs:e.filter(c=>c.id!==s),nextLocalList:o.size===0?t:t.filter(c=>!o.has(c.id)),wasCurrent:n===s}}function GJ(e,t,n){const s=new Set(n),i=[];for(const a of e){if(!s.has(a.id))continue;a.panes.some(r=>r.sessionId&&(r.remote||t.has(r.sessionId)))||i.push(a.id)}return i}let Lr=null,ya=null,Ii=null,Li=null;function XJ(){return new Promise(e=>{Li=document.createElement("div"),Li.style.cssText="position:fixed;top:0;left:0;width:0;height:0;overflow:hidden;pointer-events:none;visibility:hidden;",Ii=document.createElement("div"),Ii.style.cssText="position:absolute;top:0;left:0;width:400px;height:300px;",Li.appendChild(Ii),document.body.appendChild(Li),Lr=new Um.Terminal({fontFamily:"ui-monospace, SFMono-Regular, Menlo, Consolas, monospace",fontSize:13,allowProposedApi:!0}),ya=new Km.FitAddon,Lr.loadAddon(ya),Lr.open(Ii),requestAnimationFrame(()=>e())})}function JJ(){Lr==null||Lr.dispose(),Li&&Li.parentElement&&Li.parentElement.removeChild(Li),Lr=null,ya=null,Ii=null,Li=null}function QJ(e,t){if(!ya||!Ii)return{cols:80,rows:24};Ii.style.width=`${Math.max(40,Math.floor(e))}px`,Ii.style.height=`${Math.max(40,Math.floor(t))}px`,Ii.offsetWidth;const n=ya.proposeDimensions();return!n||!n.cols||!n.rows?{cols:80,rows:24}:{cols:n.cols,rows:n.rows}}function ll(e){const t=document.querySelector(".main");if(!t||t.clientWidth<100||t.clientHeight<100)return{cols:80,rows:24};const n=e==="vertical"||e==="grid2x2"?2:1,s=e==="horizontal"||e==="grid2x2"?2:1,i=(t.clientWidth-(n-1)*2)/n,a=(t.clientHeight-(s-1)*2)/s;return QJ(i,a)}function ZJ(e){let t=0,n=0,s=0,i=0,a=0;function d(c){s=c.clientX,i=c.clientY,!a&&(a=requestAnimationFrame(()=>{a=0,e.onDrag(t-s,n-i),t=s,n=i}))}function r(){var c;window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",r),a&&cancelAnimationFrame(a),a=0,(c=e.onEnd)==null||c.call(e)}function o(c){t=c.clientX,n=c.clientY,s=t,i=n,c.preventDefault(),window.addEventListener("mousemove",d),window.addEventListener("mouseup",r)}return{onMouseDown:o}}function eQ(e){const t=Hr(),n=n_(),s=j(()=>{var u;return((u=t.cfg)==null?void 0:u.fileExplorer.panelWidthPx)??380}),i=H(null),a=j(()=>i.value??s.value),d=j({get:()=>{var u;return((u=t.cfg)==null?void 0:u.fileExplorer.panelCollapsed)??!0},set:u=>{if(!t.cfg)return;const g=JSON.parse(JSON.stringify(t.cfg));g.fileExplorer.panelCollapsed=u,t.save(g)}});function r(){d.value=!d.value}yt(()=>n.pending,async u=>{u&&(t.isPluginEnabled("file-explorer")||await t.setEnabled("file-explorer",!0),d.value&&(d.value=!1))});const o=j(()=>t.isPluginEnabled("file-explorer")),c=j(()=>j4(e.terminalThemeId.value)?"light":"dimmed"),{onMouseDown:p}=ZJ({onDrag:u=>{const g=i.value??s.value,m=Math.max(240,Math.min(g+u,window.innerWidth*.7));i.value=m},onEnd:()=>{if(i.value===null||!t.cfg){i.value=null;return}const u=JSON.parse(JSON.stringify(t.cfg));u.fileExplorer.panelWidthPx=i.value,t.save(u),i.value=null}});return{panelWidth:a,panelCollapsed:d,togglePanel:r,onPanelResizeDown:p,rightPanelHasPlugin:o,fileExplorerTheme:c}}function tQ(e,t,n,s){var i,a;return{command:e.shell||s||"/bin/sh",args:e.shell_args??[],cwd:e.last_cwd??"",cols:t,rows:n,ai_kind:((i=e.ai)==null?void 0:i.kind)??"",initial_ai_session_id:((a=e.ai)==null?void 0:a.session_id)??"",initial_ai_command_line:e.last_command_line??""}}function bl(e){return{id:e.session_id??"",command:e.shell??"",cwd:e.last_cwd??"",title:e.title??"",cols:0,rows:0,started_at:0,host_id:e.host_id??"",type:e.session_type??"",current_command:e.last_command_line??""}}const Yv="atterm.web.window_id",Xy="atterm.web.tabs.v1.";function nQ(){if(crypto!=null&&crypto.randomUUID)return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}function Jy(){let e=sessionStorage.getItem(Yv);return e||(e=nQ(),sessionStorage.setItem(Yv,e)),e}function sQ(){const e=Xy+Jy();try{const t=localStorage.getItem(e);return t?JSON.parse(t):null}catch{return null}}function iQ(e){const t=Xy+Jy();localStorage.setItem(t,JSON.stringify(e))}function Gv(e){const t=/^#\/session\/([^?]+)(?:\?(.*))?$/.exec(e);if(!t)return{sid:null,focus:void 0,permission:void 0};const n=decodeURIComponent(t[1]),s=new URLSearchParams(t[2]??""),i=s.get("focus")==="input"?"input":void 0,a=s.get("permission")==="view"?"view":void 0;return{sid:n,focus:i,permission:a}}function rQ(e,t){const s=new URLSearchParams().toString();return`#/session/${encodeURIComponent(e)}${s?"?"+s:""}`}function oQ(e){const{enabled:t,tabs:n,currentTabId:s,currentTab:i,gotoTab:a,openRemoteAsTab:d,newId:r}=e;let o=null;function c(){o&&clearTimeout(o),o=setTimeout(()=>{o=null,iQ({tabs:n.value.map(m=>({id:m.id,layout:m.layout,active_pane_idx:m.activePaneIdx,col_ratio:m.colRatio,row_ratio:m.rowRatio,panes:m.panes.map((y,v)=>{var l,h;return{slot:v,session_id:y.sessionId??"",host_id:(l=y.lastSeenInfo)==null?void 0:l.host_id,sealed:(h=y.lastSeenInfo)==null?void 0:h.sealed}}).filter(y=>y.session_id)})),active_tab_id:s.value??""})},300)}function p(){const{sid:m}=Gv(location.hash);m&&d(m)}t&&(yt(i,m=>{const y=m==null?void 0:m.panes[m.activePaneIdx],v=(y==null?void 0:y.sessionId)??"",l=v?rQ(v):"#/";location.hash!==l&&history.replaceState({},"",l)}),yt(n,()=>{c()},{deep:!0}),Dt(()=>{window.addEventListener("hashchange",p)}),sc(()=>{window.removeEventListener("hashchange",p),o!==null&&window.clearTimeout(o)}));function u(m){const y=["single","vertical","horizontal","grid2x2"],v=[];let l=-1;for(const h of m.tabs){const f=y.includes(h.layout)?h.layout:"single",_={id:r(),layout:f,activePaneIdx:h.active_pane_idx,colRatio:h.col_ratio??Ts,rowRatio:h.row_ratio??Ts,panes:[]},S=Ju[f];for(let k=0;kM.slot===k);if(!P||!P.session_id){_.panes[k]={sessionId:null,remote:!1};continue}_.panes[k]={sessionId:P.session_id,remote:!0,lastSeenInfo:bl({slot:P.slot,host_id:P.host_id,session_id:P.session_id,shell:""})}}h.id===m.active_tab_id&&(l=v.length),n.value.push(_),v.push(_.id)}l>=0&&v[l]?a(v[l]):v.length>0&&a(v[0])}function g(){const m=sQ();if(m&&m.tabs.length>0)return u(m),!0;const{sid:y}=Gv(location.hash);return y?(d(y),!0):!1}return{tryRestoreOnBoot:g}}function aQ(e){return e.current_command||e.title||e.session_id.slice(0,8)}function lQ(e){const{isOpenRemoteSession:t}=e,n=H(null),s=H([]);let i=null;function a(v){return v.type==="ai"||v.task_state==="running"}function d(v){return!t(v.session_id)&&a(v)}const r=j(()=>{if(s.value.length>1)return"";const v=n.value;return v?aQ(v):""}),o=j(()=>s.value.some(v=>v.type==="ai")),c=j(()=>s.value.some(v=>v.task_state==="running")),p=j(()=>s.value.length>0&&s.value.every(v=>t(v.session_id)));function u(){n.value=null,s.value=[],i=null}function g(v,l){s.value=v,n.value=v[0]??null,i=l}function m(){const v=i;u(),v==null||v()}function y(){u()}return{pendingCloseSessions:s,pendingCloseTitle:r,pendingCloseIsAi:o,pendingCloseIsRunning:c,pendingCloseIsRemote:p,confirmCloseSession:m,cancelCloseSession:y,isCloseRiskySession:a,shouldConfirmCloseSession:d,openCloseSessionConfirm:g}}function cQ(e){if(e.ssh_host_id)return{kind:"reconnect",hostId:e.ssh_host_id};const t=(e.shell||e.title||e.last_command_line||"").trim();return t==="ssh"||t.startsWith("ssh ")?{kind:"adhoc"}:{kind:"local"}}const dQ=4;function uQ(e){const{tabs:t,localList:n,localHostID:s,pendingLocalIds:i,pins:a,hasLocalPty:d,newId:r,gotoTab:o,startNewTab:c,predictCellDims:p,pauseRecoverySnapshot:u}=e,g=H({open:!1,snapshot:null});async function m(h){var S;const f=((S=g.value.snapshot)==null?void 0:S.active_tab_id)??"";if(g.value={open:!1,snapshot:null},h.length===0){d&&await c();return}const _=u==null?void 0:u();try{await l(h,f)}finally{_==null||_()}}async function y(){g.value={open:!1,snapshot:null};try{await DS()}catch(h){Lt("recovery","discard failed",{error:Rt(h)})}d&&await c()}async function v(h,f){const _=new Array(h.length);let S=0;const k=Array.from({length:Math.min(dQ,h.length)},async()=>{for(;Sr()),S=h.map((D,I)=>({id:_[I],layout:D.layout,activePaneIdx:D.active_pane_idx,colRatio:D.col_ratio,rowRatio:D.row_ratio,panes:[]}));await a.ready();let k=-1;const P=(await Ou())[0]??"",M=[];for(let D=0;D{const{pickIdx:I,slot:O,tab:U}=D,W=U.panes.find(N=>N.slot===O);if(!W)return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1}};if(W.remote&&W.session_id)return{pickIdx:I,slot:O,pane:{sessionId:W.session_id,remote:!0,lastSeenInfo:bl(W)}};if(!d)return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1}};const z=cQ(W);if(z.kind==="reconnect")try{const N=await Jg(z.hostId),V=p(U.layout);return{pickIdx:I,slot:O,pane:{sessionId:N.session_id,remote:!1},seed:{id:N.session_id,command:W.title||"ssh",cwd:"",title:W.title||"ssh",type:"shell",cols:V.cols,rows:V.rows,started_at:Math.floor(Date.now()/1e3),host_id:s.value}}}catch{return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1,lastSeenInfo:bl({...W,title:(W.title||"ssh")+" — reconnect failed, open it again"})}}}if(z.kind==="adhoc")return{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1,lastSeenInfo:bl({...W,title:(W.title||"ssh")+" — SSH disconnected, reconnect to resume"})}};try{const N=W.session_id||"",V=p(U.layout),q=tQ(W,V.cols,V.rows,P),G=await lm(q);return{pickIdx:I,slot:O,pane:{sessionId:G.session_id,remote:!1},seed:{id:G.session_id,command:q.command,cwd:q.cwd||"",title:W.title||q.command,type:W.session_type||"",cols:V.cols,rows:V.rows,started_at:Math.floor(Date.now()/1e3),host_id:s.value},pinRename:N&&a.isPinned(N)?{oldSid:N,newSid:G.session_id}:void 0}}catch(N){return Lt("recovery","pane spawn failed",{error:Rt(N)}),{pickIdx:I,slot:O,pane:{sessionId:null,remote:!1}}}}),T=[],A=[];for(const D of w)S[D.pickIdx].panes[D.slot]=D.pane,D.seed&&T.push(D.seed),D.pinRename&&A.push(D.pinRename);for(const D of T)i.add(D.id);const E=new Set(n.value.map(D=>D.id)),R=T.filter(D=>!E.has(D.id));R.length>0&&(n.value=[...n.value,...R]);for(const D of A)a.rename(D.oldSid,D.newSid);t.value=[...t.value,...S],k>=0&&_[k]?o(_[k]):_.length>0&&o(_[0]),await a.flushNow()}return{recoveryDialogState:g,onRecoveryRestore:m,onRecoveryDiscard:y}}function hQ(){let e=null,t=null,n=null;function s(){t==null||t.detach(),t=null,n!==null&&(window.clearInterval(n),n=null)}function i(o,c){e==null||e.detach(),e=new ff(o,{onSessions:c.onSessions,onStatus:c.onStatus}),e.attach()}function a(o,c){s(),t=new ff(o,{onSessions:c.onSessions,onPrefsChanged:c.onPrefsChanged,onStatus:c.onStatus}),t.attach()}function d(o,c){s(),n=window.setInterval(()=>{o()},c)}function r(){e==null||e.detach(),e=null,s()}return{attachLocal:i,attachRemoteWS:a,startRemotePoll:d,stopRemote:s,isRemoteWSAttached:()=>t!==null,detachAll:r}}function fQ(e,t,n){const s=new Set(e.map(d=>d.id)),i=new Set,a=[];for(const d of n){if(s.has(d))continue;const r=t.find(o=>o.id===d);r&&(i.add(d),a.push(r))}return{localList:[...e,...a],pending:i}}function Xv(e){if(e.layout!=="single"||e.panes.length!==1)return null;const t=e.panes[0];return!(t!=null&&t.remote)||!t.sessionId?null:t.sessionId}function pQ(e){const t=new Set(e.remoteSessions.map(a=>a.id));for(const a of t)e.missingSince.delete(a);const n=new Set;for(const a of e.tabs){const d=Xv(a);d&&n.add(d)}for(const a of e.missingSince.keys())n.has(a)||e.missingSince.delete(a);const s=[],i=[];for(const a of e.tabs){const d=Xv(a);if(!d){i.push(a);continue}if(t.has(d)){i.push(a);continue}const r=e.missingSince.get(d)??e.nowMs;if(e.missingSince.set(d,r),e.nowMs-r>=e.graceMs){e.missingSince.delete(d),s.push(a.id);continue}i.push(a)}return{tabs:i,removedTabIds:s}}function vQ(e,t,n){if(!n)return{remote:!1,corrected:!1};const s=t.includes(e);return{remote:!s,corrected:s}}function gQ(){return ju()}function mQ(e,t){var n,s,i;switch(e){case"pane.split-vertical-new":return t.onSplitVertical(),!0;case"pane.split-horizontal-new":return t.onSplitHorizontal(),!0;case"pane.close":return t.onClosePane(),!0;case"pane.focus-left":return t.onFocusPane("left"),!0;case"pane.focus-right":return t.onFocusPane("right"),!0;case"pane.focus-up":return t.onFocusPane("up"),!0;case"pane.focus-down":return t.onFocusPane("down"),!0;case"tab.new":return t.onNewTab(),!0;case"tab.prev":return t.onSwitchTab(-1),!0;case"tab.next":return t.onSwitchTab(1),!0;case"toggleTaskSidebar":return(n=t.onToggleTaskSidebar)==null||n.call(t),!0;case"sidebar.focus-search":return(s=t.onFocusSidebarSearch)==null||s.call(t),!0;case"terminal.search":return(i=t.onTerminalSearch)==null||i.call(t),!0}return!1}function _Q(e,t={}){const n=t.mod??gQ(),s=j(()=>{var d;const a=((d=t.bindings)==null?void 0:d.value)??{};return WH(a)});function i(a){const d=Ky(a,n);if(d===null)return;const r=s.value[d];r&&mQ(r,e)&&(a.preventDefault(),a.stopPropagation())}document.addEventListener("keydown",i,{capture:!0}),Zl(()=>{document.removeEventListener("keydown",i,{capture:!0})})}function yQ(e,t,n={}){const s=j(()=>{const g=new Map;for(const m of e.value)g.set(m.session_id,m);for(const m of t.value)g.set(m.session_id,m);return[...g.values()]}),i=j(()=>{const g={};for(const m of s.value){const y=m.host_id||"";(g[y]||(g[y]=[])).push(m)}for(const m of Object.keys(g))g[m].sort(Al);return g}),a=j(()=>{if(!n.localHostId)return i.value;const g={};for(const m of Object.keys(i.value))m!==n.localHostId&&(g[m]=i.value[m]);return g}),d=j(()=>{const g={};for(const[m,y]of Object.entries(i.value))g[m]=y.filter(v=>v.unread===!0).length;return g}),r=j(()=>Object.values(d.value).reduce((g,m)=>g+m,0)),o=j(()=>s.value.filter(g=>(g.task_state==="completed"||g.task_state==="failed")&&g.unread===!1).sort(Tx)),c=j(()=>{const g={};for(const m of s.value){const y=m.task_state??"idle";(g[y]||(g[y]=[])).push(m)}for(const m of Object.keys(g))g[m].sort((y,v)=>Al(y,v));return g}),p=j(()=>{const g={};for(const[m,y]of Object.entries(c.value))g[m]=y.filter(v=>v.unread===!0).length;return g});function u(g){const m=i.value[g]??[];let y="idle",v=mo("idle");for(const l of m){const h=l.task_state??"idle",f=mo(h);f({id:v.id,layout:v.layout,active_pane_idx:v.activePaneIdx,col_ratio:v.colRatio,row_ratio:v.rowRatio,panes:v.panes.map((l,h)=>{var P;const f=l.sessionId?e.sessionInfoFor(l.sessionId):void 0,_=l.sessionId?t.get(l.sessionId):void 0,S=(f==null?void 0:f.type)==="ai",k=!!l.remote&&(!f||f.host_id!==e.localHostID.value);return{slot:h,remote:k||void 0,host_id:k?(f==null?void 0:f.host_id)??"":void 0,session_id:(!l.remote||k)&&l.sessionId?l.sessionId:void 0,shell:((P=f==null?void 0:f.command)==null?void 0:P.split(" ")[0])??"",shell_args:[],last_cwd:(f==null?void 0:f.cwd)??"",session_type:(f==null?void 0:f.type)??"",last_command_line:(f==null?void 0:f.current_command)??"",title:(f==null?void 0:f.title)??"",ai:S&&_?{..._}:void 0,ssh_host_id:(f==null?void 0:f.ssh_host_id)||void 0}})})).filter(v=>v.panes.length>0);return{version:1,host_id:"",clean_shutdown:!1,saved_at_unix:0,active_tab_id:e.currentTabId.value??"",tabs:y}}function r(){n&&(clearTimeout(n),n=null),s&&(clearTimeout(s),s=null),i=!1;try{LS(d()).catch(y=>{Lt("recovery","saveRecoverySnapshot failed",{error:Rt(y)})})}catch(y){Lt("recovery","saveRecoverySnapshot failed",{error:Rt(y)})}}function o(){a++,n&&(clearTimeout(n),n=null),s&&(clearTimeout(s),s=null);let y=!1;return()=>{y||(y=!0,a=Math.max(0,a-1),a===0&&i&&r())}}function c(){i=!0,!(a>0)&&(n&&clearTimeout(n),n=setTimeout(()=>{n=null,r()},bQ))}function p(){i=!0,!(a>0)&&(s||(s=setTimeout(()=>{s=null,r()},wQ)))}yt(()=>e.tabs.value.map(y=>({id:y.id,layout:y.layout,active:y.activePaneIdx,col:y.colRatio,row:y.rowRatio,paneIds:y.panes.map(v=>v.sessionId??"").join("|")})),()=>{c()},{deep:!0}),yt(e.currentTabId,()=>{p()}),yt(()=>e.tabs.value.map(y=>y.panes.map(v=>{const l=v.sessionId?e.sessionInfoFor(v.sessionId):void 0;return[v.sessionId??"",(l==null?void 0:l.type)??"",(l==null?void 0:l.title)??"",(l==null?void 0:l.cwd)??""].join("~")}).join("|")).join("||"),()=>{c()}),yt(()=>e.tabs.value.map(y=>y.panes.map(v=>{const l=v.sessionId?e.sessionInfoFor(v.sessionId):void 0;return(l==null?void 0:l.current_command)??""}).join("|")).join("||"),()=>{p()});const g=(e.onEvent??((y,v)=>dn().events.on(y,v)))("recovery:ai-sid",y=>{const v=(y==null?void 0:y.session_id)??"",l=(y==null?void 0:y.kind)??"",h=(y==null?void 0:y.ai_session_id)??"";if(!(!v||!l)&&!(l!=="claude"&&l!=="codex"&&l!=="aider")){if(!h){t.delete(v),c();return}t.set(v,{kind:l,session_id:h,captured_at_unix:Math.floor(Date.now()/1e3)}),c()}}),m=setInterval(()=>{i&&r()},SQ);return Zl(()=>{g==null||g(),n&&clearTimeout(n),s&&clearTimeout(s),clearInterval(m)}),{buildSnapshot:d,flushNow:r,pause:o}}function ro(e){return e.id??e.session_id??""}const kQ=6,Jv={idle:0,failed:1,waiting:2,running:3};function xQ(e){switch(e){case"waiting_input":return"waiting";case"failed":return"failed";case"running":return"running";default:return"idle"}}function RQ(e){switch(e){case"running":case"waiting_input":case"completed":case"failed":case"disconnected":case"closed":return e;default:return"idle"}}function TQ(e){const t=e.trim().replace(/[/\\]+$/,"");if(!t)return"";const n=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return n>=0?t.slice(n+1):t}function PQ(e){const t={current_command:e.current_command,title:e.title,session_id:ro(e),cwd:e.cwd,type:e.type};if((e.current_command??"").trim()||(e.title??"").trim())return El(t);const n=TQ(e.cwd??"");if(n)return n;const s=(e.command??"").trim();return s?Br({current_command:s,title:"",session_id:ro(e)}):El(t)}function EQ(e,t,n){const s=Ml(e.cwd,t);return!s||s===n?"":s}function LQ(e,t,n){if(t!=="running"&&t!=="waiting")return 0;const s=e.command_started_at;if(!s)return 0;const i=n-s*1e3;return i>0?i:0}function DQ(e,t={}){const n=t.nowMs??Date.now(),s=t.maxRows??kQ,i=(t.localHostId??"").trim(),a=t.home??"",d=t.aiOnly??!1,r=e.filter(f=>f.task_state!=="closed"&&(!d||f.type==="ai")),o=r.map(f=>{const _=xQ(f.task_state),S=(f.host_id??"").trim(),k=!!i&&!!S&&S!==i,P={current_command:f.current_command,title:f.title,session_id:ro(f),cwd:f.cwd,type:f.type},M=PQ(f);return{row:{sessionId:ro(f),title:M,subtitle:EQ(f,a,M),state:_,taskState:RQ(f.task_state),kind:f.type==="ai"?Br(P):"",remoteHost:k?(f.host??"").trim():"",ageMs:LQ(f,_,n),lastOutputAt:f.last_output_at??0,unread:f.unread===!0},source:f}});o.sort((f,_)=>Al({...f.source,session_id:ro(f.source)},{..._.source,session_id:ro(_.source)}));const c=o.map(f=>f.row),p=c.filter(f=>f.state==="waiting").length,u=c.filter(f=>f.state==="failed").length,g=c.filter(f=>f.state==="running").length,m=c.filter(f=>f.unread).length,y=r.filter(f=>f.task_state==="completed").length;let v="idle";for(const f of c)Jv[f.state]>Jv[v]&&(v=f.state);const l=Math.max(0,c.filter(f=>f.state==="idle").length-y),h={waitingCount:p,failedCount:u,runningCount:g,completedCount:y,idleCount:l};return{mood:v,unreadCount:m,...h,...MQ(m,h),rows:c.slice(0,s),attentionIds:c.filter(f=>f.state==="waiting"||f.state==="failed").map(f=>f.sessionId),overflowCount:Math.max(0,c.length-s),aiOnly:d}}function MQ(e,t){const n=[];return t.failedCount>0&&n.push(`${t.failedCount} 个失败`),t.runningCount>0&&n.push(`${t.runningCount} 个在跑`),t.waitingCount>0&&n.push(`${t.waitingCount} 个等待输入`),t.completedCount>0&&n.push(`${t.completedCount} 个已完成`),{headline:e>0?`${e} 个会话有最新内容`:"暂无最新内容",subline:n.join(" · ")}}function AQ(e){const t=dn(),n=Hr();if(!t.deskWidget)return;const s=t.deskWidget;let i=!1,a="";async function d(o){if(o!==i)try{o?(a||(a=await Fu().catch(()=>"")),await s.start(),i=!0,await r()):(await s.stop(),i=!1)}catch(c){if(Lt("widget","lifecycle change failed",{enabled:o,error:Rt(c)}),o){i=!1;try{await n.setEnabled("desk-widget",!1)}catch(p){Lt("widget","disable-after-start-failure also failed",{error:Rt(p)})}}}}async function r(){var c,p;if(!i)return;const o=DQ(e.sessions.value,{localHostId:e.localHostId.value,home:a,aiOnly:((p=(c=n.cfg)==null?void 0:c.widget)==null?void 0:p.aiOnly)??!1});try{await s.pushState(JSON.stringify(o))}catch(u){i=!1,Lt("widget","state push failed",{error:Rt(u)})}}yt(()=>n.isPluginEnabled("desk-widget"),o=>{d(o)},{immediate:!0}),yt(e.sessions,()=>void r(),{deep:!0}),yt(()=>{var o,c;return(c=(o=n.cfg)==null?void 0:o.widget)==null?void 0:c.aiOnly},()=>void r())}const IQ={key:1,class:"auth-error-banner",role:"alert"},$Q={class:"auth-error-msg"},OQ=["aria-label"],FQ={key:4,class:"main-row"},BQ={class:"main"},HQ={key:0,class:"empty"},NQ={key:2,class:"toast"},zQ=["title"],UQ=6e4,VQ=3e3,KQ=$e({__name:"App",setup(e,{expose:t}){const n=dn(),s=n.caps,{t:i}=$t(),a=H(null),d=na({});function r(ee){return d[ee]??0}const o={auth_invalid_token:"app.authInvalidToken",auth_user_disabled:"app.authUserDisabled",session_id_owner_mismatch:"app.sessionIdOwnerMismatch",forbidden:"app.forbidden"},c=j(()=>a.value?o[a.value]?i(o[a.value]):a.value:""),p=j(()=>s.localPty?i("app.startingFirstSession"):i("app.waitingForSessionSelection"));function u(){m.value="relay",Fe.value=!0}function g(){m.value="account",Fe.value=!0}const m=H(void 0),y=H(null),v=H(null),l=H(""),h=H(""),f=H([]),_=H(""),S=H([]),k=H([]),P=H([]),M=new Map,w=new Set;function T(ee){return{...ee,session_id:ee.id}}const A=j(()=>S.value.map(T)),E=j(()=>k.value.map(T)),R=yQ(A,E);AQ({sessions:R.all,localHostId:l});const D=Ku(),I=Wu(),O=H(!1);async function U(ee){O.value=ee;try{await tm(ee)}catch{}}function W(ee){wi(ee.session_id)}function z(ee,he){const Ie=IC(ie.value,he.sessionId);if(!Ie)return;const Se=ee.panes.findIndex(tn=>tn.sessionId===he.sessionId);if(Se!==-1){Se===he.paneIdx?Cs(i("app.sessionAlreadyInTab")):ee.panes=$C(ee.panes,Se,he.paneIdx),ee.activePaneIdx=he.paneIdx,no();return}const _t=ee.panes[he.paneIdx],Bt=_t&&!_t.sessionId?he.paneIdx:null;if(Bt===null){const tn=yp(ee.layout,ee.panes,he.paneIdx,"vertical",ee.colRatio,ee.rowRatio);if(tn.noop){Cs(i("app.paneFull"));return}ee.layout=tn.layout,ee.panes=tn.panes,ee.colRatio=tn.colRatio,ee.rowRatio=tn.rowRatio,ee.activePaneIdx=tn.newPaneIdx,q(Ie),ee.panes[tn.newPaneIdx]=Ie.pane,no();return}q(Ie),ee.panes[Bt]=Ie.pane,ee.activePaneIdx=Bt,no()}function N(ee){return Af(ie.value,ee)!==null}function V(ee){const he=Af(ie.value,ee);if(no(),!he){Cs(i("terminal.alreadyOwnTab"));return}const Ie=ie.value.find(Se=>Se.id===he.tabId);Ie&&(ti(Ie,he.paneIdx,{detachOnly:!0}),wi(ee,he.pane.remote))}function q(ee){if(!ee.from)return;const he=ie.value.find(Ie=>Ie.id===ee.from.tabId);he&&ti(he,ee.from.paneIdx,{detachOnly:!0})}function G(ee){const he=Cr(ie.value,ee.session_id);if(!he)return;const Ie=ie.value.find(Se=>Se.id===he.tabId);Ie&&ti(Ie,he.paneIdx)}function te(ee){if(!ct(ee)){G(ee);return}ve([ee],()=>G(ee))}async function oe(ee){try{await kS(ee)}catch{Lt("app","markSessionsSeen failed",{payload:JSON.stringify(ee)})}}const ie=H([]),ye=H(null),K=H("loading"),J=H(""),Q=H(null),ce=H(!1),Fe=H(!1),Ee=H(""),Ye=H(null),Ze=j(()=>{var ee;return((ee=Ye.value)==null?void 0:ee.is_admin)===!0});let ue=0;function et(){ue++,Ye.value=null}async function re(ee="",he=!1){const Ie=++ue;try{const Se=await n.relay.fetchMe();if(Ie!==ue)return;if(ee&&Se.user_id!==ee){Ye.value=null,Lt("app","discarded relay identity from a different authenticated user");return}Ye.value=Se}catch(Se){if(Ie!==ue)return;Ye.value=null,he&&Lt("app","failed to refresh relay identity",{error:Rt(Se)})}}const we=H(!1);yt(Ze,ee=>{ee||(we.value=!1)});const fe=H(!1),De=H(!1),Qe=H(!1);let We=null,ae=null,_e=null,be=null,Me=null,x=null;function Re(){if(Qt==null||Qt.flushNow(),Fo.value===0&&Jn.value===0){Pf();return}fe.value=!0}function Ge(){fe.value=!1,Pf()}function Ve(){fe.value=!1}function kt(ee){var Se;const he=Cr(ie.value,ee);if(!he)return!1;const Ie=ie.value.find(_t=>_t.id===he.tabId);return((Se=Ie==null?void 0:Ie.panes[he.paneIdx])==null?void 0:Se.remote)===!0}const{pendingCloseSessions:Je,pendingCloseTitle:wt,pendingCloseIsAi:tt,pendingCloseIsRunning:mt,pendingCloseIsRemote:se,confirmCloseSession:de,cancelCloseSession:Le,isCloseRiskySession:Ae,shouldConfirmCloseSession:ct,openCloseSessionConfirm:ve}=lQ({isOpenRemoteSession:ee=>kt(ee)});function Be(ee){const he=ee.sessionId;if(!he)return ee.lastSeenInfo?T(ee.lastSeenInfo):null;const Ie=qn(he,ee.remote)??qn(he,!ee.remote)??ee.lastSeenInfo;return Ie?T(Ie):null}function me(ee){return ee.filter(he=>!he.remote).map(Be).filter(he=>!!he&&Ae(he))}const rt=H(!1);let At=null;const St=H(W4),xe=j(()=>Mi(St.value)),je=H({fontHead:"",fontSize:13,lineHeight:1,cursorStyle:"block",cursorBlink:!0,scrollback:5e3}),ft=j(()=>xe.value.appVars),Tt=H(10),qt=zu(),zt=H(""),Yt=j(()=>qt.value&&zt.value!=="darwin");let Qt=null;const{recoveryDialogState:xn,onRecoveryRestore:$n,onRecoveryDiscard:Xt}=uQ({tabs:ie,localList:S,localHostID:l,pendingLocalIds:w,pins:D,hasLocalPty:s.localPty,newId:()=>Nn(),gotoTab:ee=>Te(ee),startNewTab:()=>_r(),predictCellDims:ll,pauseRecoverySnapshot:()=>Qt==null?void 0:Qt.pause()}),Gt=H(!1),Rn=H(null),Zt=H(!0);function on(){var Ie;const ee=Rn.value;Zt.value&&(((Ie=ee==null?void 0:ee.tabs)==null?void 0:Ie.length)??0)>0&&ee?xn.value={open:!0,snapshot:ee}:s.localPty&&_r()}function Ot(){Gt.value=!1,on()}async function Hn(ee){try{const he=new Promise(Se=>window.setTimeout(Se,ee));return await Promise.race([nm().catch(()=>{}),he]),!!(await go()).available}catch{return!1}}let Tn=!1,bn=null;const fn=hQ();let ss="";const Nn=()=>typeof crypto<"u"&&"randomUUID"in crypto?crypto.randomUUID():"tab-"+Math.random().toString(36).slice(2),ke=j(()=>ie.value.find(ee=>ee.id===ye.value)??null),nt=na(new Set);yt(ye,ee=>{ee&&nt.add(ee)},{immediate:!0});const gt=j(()=>ie.value.filter(ee=>nt.has(ee.id))),It=H(null),pn=H(null),Nt=j(()=>{const ee=ke.value;return(ee==null?void 0:ee.panes[ee.activePaneIdx])??null});yt(Nt,ee=>{It.value=ee},{immediate:!0});const Pn=j(()=>{const ee=ke.value;if(!ee)return null;const he=ee.panes[ee.activePaneIdx];return he!=null&&he.sessionId?qn(he.sessionId,he.remote)??he.lastSeenInfo??null:(he==null?void 0:he.lastSeenInfo)??null});yt(()=>{const ee=Pn.value;return[ee==null?void 0:ee.type,ee==null?void 0:ee.title]},([ee,he])=>{var Se,_t;const Ie=ee==="ai"&&he?he:"AT Term";(_t=(Se=n.system).windowSetTitle)==null||_t.call(Se,Ie).catch(()=>{})},{immediate:!0});const is=j(()=>{var ee;return((ee=Pn.value)==null?void 0:ee.task_state)??null}),On=j(()=>{const ee=Pn.value;if(!ee)return"";if(ee.type==="ai"&&ee.title)return ee.title;if(ee.cwd){const Ie=ee.cwd.replace(/\/+$/,"");if(Ie==="")return"/";const Se=Ie.split("/").pop();if(Se)return Se}const he=(ee.command||"").split(/\s+/)[0]||"";return he.split("/").pop()||he}),us=new Map;kn("atterm:pluginInputSenders",us);const Vs=na(new Map);kn("atterm:pluginSessionConnections",Vs);const Ks=KJ({activePane:It,endpointForPane:Fi,sessionInfoForPane:gr,sessionConnectionForPane:ee=>ee.sessionId?Vs.get(ee.sessionId)??null:null,sendToSession:(ee,he,Ie)=>{const Se=us.get(ee);if(Se){Se(Ie);return}jJ(he,ee,Ie)},showToast:Cs,terminalThemeId:St});kn("atterm:pluginContext",Ks);const{panelWidth:fi,panelCollapsed:Ss,togglePanel:ei,onPanelResizeDown:Oi,rightPanelHasPlugin:pi,fileExplorerTheme:pr}=eQ({terminalThemeId:St}),vr=j(()=>{const ee=new Set;for(const he of ie.value)for(const Ie of he.panes)Ie.sessionId&&ee.add(Ie.sessionId);return ee}),vi=j(()=>Array.from(vr.value));function Fi(ee){return ee.remote?v.value:y.value}function gr(ee){return ee.sessionId?qn(ee.sessionId,ee.remote)??null:null}function Cs(ee){Ee.value=ee,bn!==null&&window.clearTimeout(bn),bn=window.setTimeout(()=>{Ee.value="",bn=null},2e3)}function gi(){const ee=new Map;for(const he of S.value)ee.set(he.id,he);for(const he of k.value)ee.set(he.id,he);return ee}function Bi(ee){const he=new Set(S.value.map(Se=>Se.id)),Ie=[];for(const Se of ie.value){let _t=!1;for(let Bt=0;Bthe.id));k.value=P.value.filter(he=>!ee.has(he.id))}function _i(ee){const he=gi(),Ie=fQ(ee,S.value,w);S.value=Ie.localList,w.clear();for(const Se of Ie.pending)w.add(Se);mi(),Bi(he),K.value!=="ready"&&(K.value="ready")}function Ms(ee){P.value=ee,mi();const he=pQ({tabs:ie.value,remoteSessions:k.value,missingSince:M,nowMs:Date.now(),graceMs:UQ});he.removedTabIds.length>0&&(ie.value=he.tabs,ye.value&&he.removedTabIds.includes(ye.value)&&(ie.value.length>0?Te(ie.value[0].id):location.hash=""))}function mr(ee){fn.attachLocal(ee,{onSessions:_i,onStatus:he=>{he==="error"&&(K.value="error")}})}function yi(){n.events.emit("prefs:remote-changed",void 0)}function En(ee){fn.attachRemoteWS(ee,{onSessions:Ms,onPrefsChanged:yi,onStatus:he=>{he==="error"&&(K.value="error")}})}async function ks(){try{Ms(await eS())}catch(ee){Js("app","remote session poll failed; keeping last list",{error:Rt(ee)})}}async function Wn(){const he=(await n.sessions.listRemoteSessions()).map(Ie=>{const Se=Ie;return{...Se,id:Se.id??Se.session_id??""}});Ms(he)}async function xs(){const ee=await n.relay.load(),he=ee?Io(ee):null;return v.value=he,he?(En(he),!0):(fn.stopRemote(),P.value=[],k.value=[],!1)}function jn(){fn.isRemoteWSAttached()||fn.startRemotePoll(Wn,3e3)}function zn(ee,he){if(fn.stopRemote(),P.value=[],k.value=[],M.clear(),v.value=he,!!ee){if(he){En(he);return}ks(),fn.startRemotePoll(ks,2e3)}}async function bi(){let ee={url:"",token:"",connected:!1};try{ee=await Pl()}catch(tn){Js("app","getRelayConfig failed; keeping last known",{error:Rt(tn)})}const he=ee.remote_http_proxy_url??"";ee.token&&he?wg({baseURL:he+"/relay-http",sessionToken:ee.token,expiresAt:null,allowInsecure:!1}):Sg();const Ie=!!(ee.connected&&ee.url),Se=ee.remote_proxy_url??"",_t=Ie&&Se?{url:Se,session_token:ee.token}:null,Bt=`${Ie}|${(_t==null?void 0:_t.url)??""}|${(_t==null?void 0:_t.session_token)??""}`;Bt!==ss&&(ss=Bt,zn(Ie,_t))}function hs(){s.wailsBindings&&bi()}function Rs(){hs(),re()}function Nr(){Fe.value=!1,m.value=void 0,hs()}function Io(ee){if(!ee.token)return null;const he=ee.homeInstanceURL||ee.url;if(!he)return{url:`${location.protocol==="https:"?"wss:":"ws:"}//${location.host}`,session_token:ee.token};try{const Ie=new URL(he);return{url:`${Ie.protocol==="https:"?"wss:":"ws:"}//${Ie.host}`,session_token:ee.token}}catch{return null}}async function Hi(){const ee=await um();St.value=Mi(ee).id}function zr(ee){St.value=Mi(ee).id}async function Ur(){const[ee,he,Ie,Se,_t,Bt]=await Promise.all([fm(),pm(),vm(),gm(),mm(),_m()]);je.value={fontHead:ee,fontSize:he,lineHeight:Ie,cursorStyle:Se,cursorBlink:_t,scrollback:Bt}}function $o(ee){je.value=ee}function Ni(ee){Tt.value=ee}async function zi(){f.value=await Sm()??[],_.value&&!f.value.some(ee=>ee.id===_.value)&&(_.value="")}function le(){zi()}function ge(){const ee=location.hash.match(/^#\/t\/([\w-]+)$/);return ee?ee[1]:null}function pe(){const ee=ge();ee&&ie.value.some(he=>he.id===ee)&&(ye.value=ee)}function Te(ee){ye.value=ee,location.hash!=="#/t/"+ee&&(location.hash="#/t/"+ee),we.value=!1}function Wt(ee,he,Ie){ie.value=qJ(ie.value,ee,he,Ie)}function qn(ee,he){return(he?k.value:S.value).find(Ie=>Ie.id===ee)}function Yn(ee){var Ie;const he=ee.panes[ee.activePaneIdx];return!(he!=null&&he.sessionId)||he.remote?"":((Ie=qn(he.sessionId,!1))==null?void 0:Ie.cwd)??""}async function As(ee,he,Ie){const Se=await Ou();if(Se.length===0)throw new Error(i("app.noShellsFound"));const _t=await lm({command:Se[0],cwd:ee,cols:he.cols,rows:he.rows,...Ie?{profile_id:Ie}:{}});return w.add(_t.session_id),S.value=[...S.value,{id:_t.session_id,command:Se[0],cwd:ee||"",title:Se[0],cols:he.cols,rows:he.rows,started_at:Math.floor(Date.now()/1e3),host_id:l.value}],_t.session_id}async function _r(){if(!ce.value){ce.value=!0,J.value="";try{const ee=ke.value?Yn(ke.value):"",he=await As(ee,ll("single"),_.value),Ie=Nn();ie.value.push({id:Ie,layout:"single",panes:[{sessionId:he,remote:!1}],activePaneIdx:0,colRatio:Ts,rowRatio:Ts}),Te(Ie)}catch(ee){K.value="error",J.value=(ee==null?void 0:ee.message)??String(ee)}finally{ce.value=!1}}}function kc(ee){if(w.add(ee),!S.value.some(Ie=>Ie.id===ee)){const Ie=ll("single");S.value=[...S.value,{id:ee,command:"ssh",cwd:"",title:"ssh",cols:Ie.cols,rows:Ie.rows,started_at:Math.floor(Date.now()/1e3),host_id:l.value}]}const he=Nn();ie.value.push({id:he,layout:"single",panes:[{sessionId:ee,remote:!1}],activePaneIdx:0,colRatio:Ts,rowRatio:Ts}),Te(he)}function La(ee){De.value=!1,Qe.value=!1,kc(ee)}function xc(ee){Nr(),wi(ee)}async function Da(ee){const he=ke.value;if(!he)return;const Ie=Yn(he),Se=yp(he.layout,he.panes,he.activePaneIdx,ee,he.colRatio,he.rowRatio);if(Se.noop){Cs(i("app.paneFull"));return}he.layout=Se.layout,he.panes=Se.panes,he.activePaneIdx=Se.activePaneIdx,he.colRatio=Se.colRatio,he.rowRatio=Se.rowRatio;try{const _t=await As(Ie,ll(Se.layout),_.value);he.panes[Se.newPaneIdx]={sessionId:_t,remote:!1}}catch(_t){Cs(i("app.splitFailed",{message:(_t==null?void 0:_t.message)??String(_t)}))}}async function Rc(){const ee=ke.value;ee&&Ma(ee,ee.activePaneIdx)}function Ma(ee,he){const Ie=ee.panes[he],Se=Ie?me([Ie]):[];if(Se.length>0){ve(Se,()=>ti(ee,he));return}ti(ee,he)}function ti(ee,he,Ie){const Se=ee.panes[he];!(ee.layout==="single")&&(Se!=null&&Se.sessionId)&&!Se.remote&&!(Ie!=null&&Ie.detachOnly)&&yr(Se.sessionId);const Bt=K5(ee.layout,ee.panes,he,ee.colRatio,ee.rowRatio);ee.layout=Bt.layout,ee.panes=Bt.panes,ee.activePaneIdx=Bt.activePaneIdx,ee.colRatio=Bt.colRatio,ee.rowRatio=Bt.rowRatio,Bt.closeTab&&Vr(ee.id,Ie)}function yr(ee){w.delete(ee);const he=S.value.filter(Ie=>Ie.id!==ee);he.length!==S.value.length&&(S.value=he,mi()),Rf(ee).catch(()=>{})}function Vr(ee,he){const Ie=YJ(ie.value,S.value,ye.value,ee,he);if(Ie){for(const Se of Ie.localIdsToClose)w.delete(Se);ie.value=Ie.nextTabs,Ie.nextLocalList!==S.value&&(S.value=Ie.nextLocalList,mi()),Ie.wasCurrent&&(ie.value.length>0?Te(ie.value[0].id):location.hash="");for(const Se of Ie.localIdsToClose)Rf(Se).catch(()=>{})}}function Ws(ee){const he=ie.value.find(Se=>Se.id===ee),Ie=he?me(he.panes):[];if(Ie.length>0){ve(Ie,()=>Vr(ee));return}Vr(ee)}function Tc(ee){const he=ke.value;if(!he)return;const Ie=q5(he.layout,he.activePaneIdx,ee);Ie!==null&&(he.activePaneIdx=Ie)}function Aa(ee){if(ie.value.length===0)return;const he=ie.value.findIndex(Se=>Se.id===ye.value);if(he===-1)return;const Ie=(he+ee+ie.value.length)%ie.value.length;Te(ie.value[Ie].id)}function wi(ee,he=!0){const Ie=Cr(ie.value,ee);if(Ie){const Bt=ie.value.find(tn=>tn.id===Ie.tabId);Bt&&Bt.activePaneIdx!==Ie.paneIdx&&(Bt.activePaneIdx=Ie.paneIdx),Te(Ie.tabId);return}const Se=vQ(ee,S.value.map(Bt=>Bt.id),he);Se.corrected&&Lt("app","opened a local session through the remote path",{sessionId:ee});const _t=Nn();ie.value.push({id:_t,layout:"single",panes:[{sessionId:ee,remote:Se.remote}],activePaneIdx:0,colRatio:Ts,rowRatio:Ts}),Te(_t)}function Ia(ee){return ee===1?"single":ee===2?"vertical":ee===3||ee===4?"grid2x2":null}function $a(ee){return Cr(ie.value,ee)}function Oa(ee){const he=ie.value.findIndex(Ie=>Ie.id===ee);return he<0?0:he+1}async function Fa(){const ee=Array.from(I.selectedIds.value),he=Ia(ee.length);if(!he)return;for(const Bt of ee){const tn=Cr(ie.value,Bt);if(!tn)continue;const Si=ie.value.find(Ui=>Ui.id===tn.tabId);Si&&await ti(Si,tn.paneIdx,{detachOnly:!0})}const Ie=Ju[he],Se=new Array(Ie).fill(null).map((Bt,tn)=>tnee.has(Se)),Ie=he.map(Pc).filter(Se=>!!Se&&Ae(Se));if(Ie.length>0){ve(Ie,()=>Oo(he));return}Oo(he)}async function Oo(ee){for(const he of ee){const Ie=Cr(ie.value,he);if(!Ie)continue;const Se=ie.value.find(_t=>_t.id===Ie.tabId);Se&&await ti(Se,Ie.paneIdx)}I.clear()}function Ba(ee){var Bt,tn,Si,Ui,Ho,Ua,Va,Ka;const he=ee,Ie=typeof(he==null?void 0:he.session_id)=="string"?he.session_id:typeof(he==null?void 0:he.sessionId)=="string"?he.sessionId:"";if(!Ie)return;const Se=Cr(ie.value,Ie);if(!Se){const js=k.value.some(No=>No.id===Ie)||!S.value.some(No=>No.id===Ie);wi(Ie,js),(tn=(Bt=n.system).windowUnminimize)==null||tn.call(Bt),(Ui=(Si=n.system).windowShow)==null||Ui.call(Si);return}const _t=ie.value.find(js=>js.id===Se.tabId);_t&&(_t.activePaneIdx=Se.paneIdx,Te(Se.tabId),(Ua=(Ho=n.system).windowUnminimize)==null||Ua.call(Ho),(Ka=(Va=n.system).windowShow)==null||Ka.call(Va))}const Ec=j(()=>ie.value.map(ee=>{const he=ee.panes[ee.activePaneIdx],Ie=he!=null&&he.sessionId?qn(he.sessionId,he.remote)??null:null,Se=!Ie&&(he!=null&&he.lastSeenInfo)?he.lastSeenInfo:null;return{id:ee.id,layout:ee.layout,activeSession:Ie??Se,activeRemote:!!(he!=null&&he.remote),paneCount:ee.panes.length,disconnected:!Ie&&!!Se}})),Lc=j(()=>R.all.value.length),Fo=j(()=>{let ee=0;for(const he of ie.value)for(const Ie of he.panes)Ie.sessionId&&!Ie.remote&&ee++;return ee}),Jn=j(()=>{let ee=0;for(const he of ie.value)for(const Ie of he.panes)Ie.sessionId&&Ie.remote&&ee++;return ee}),Kr=H({});async function Bo(){Kr.value=await hm()}function Ha(ee){Kr.value=ee}const Na=H(0);_Q({onSplitVertical:()=>Da("vertical"),onSplitHorizontal:()=>Da("horizontal"),onClosePane:Rc,onFocusPane:Tc,onNewTab:()=>{s.localPty&&_r()},onSwitchTab:Aa,onToggleTaskSidebar:()=>U(!O.value),onFocusSidebarSearch:()=>{var ee;(ee=pn.value)==null||ee.focusSearch()},onTerminalSearch:()=>{Na.value++}},{bindings:Kr}),Qt=s.wailsBindings?CQ({tabs:ie,currentTabId:ye,localHostID:l,sessionInfoFor:ee=>qn(ee,!1)??qn(ee,!0)}):null,yt([ie,ye],()=>{ie.value.length!==0&&(ye.value&&ie.value.find(ee=>ee.id===ye.value)||Te(ie.value[0].id))});const za=oQ({enabled:!s.wailsBindings,tabs:ie,currentTabId:ye,currentTab:ke,gotoTab:Te,openRemoteAsTab:wi,newId:Nn});return Dt(async()=>{if(s.wailsBindings)try{O.value=await em()}catch{}We=n.events.on("before-close",Re),ae=n.events.on("notification:click",Ba),_e=n.events.on("widget:activate",Ba);try{const Se=await n.system.getEnvironment();Se!==null&&(zt.value=(Se.platform??"").toLowerCase())}catch{}if(x=n.events.on("relay:auth-error",Se=>{const _t=Se;a.value=(_t==null?void 0:_t.reason)??null,et()}),be=n.events.on("relay:auth-info",Se=>{const _t=Se,Bt=typeof(_t==null?void 0:_t.user_id)=="string"?_t.user_id:"";if(!Bt){et();return}re(Bt,!0)}),n.events.on("relay:viewers",Se=>{const _t=Se;_t&&typeof _t.session_id=="string"&&(d[_t.session_id]=_t.count??0)}),n.events.on("prefs:changed",()=>{s.wailsBindings&&(Hi(),Ur(),Bo(),zi())}),Me=n.events.on("relay:auth-restored",()=>{re("",!0),!s.wailsBindings&&(async()=>{try{await xs()&&(K.value="ready",jn())}catch(Se){Lt("app","failed to refresh relay state after login",{error:Rt(Se)})}})()}),re(),pe(),window.addEventListener("hashchange",pe),s.wailsBindings)try{const Se=await VS();if(Se!=null&&Se.fatal){Q.value=Se,K.value="error",J.value=Se.message;return}}catch(Se){Lt("app","failed to load startup fatal state",{error:Rt(Se)})}if(await XJ(),s.wailsBindings)try{Tt.value=await wm()}catch(Se){Lt("app","failed to load command-notify threshold",{error:Rt(Se)})}let ee="",he={version:1,host_id:"",clean_shutdown:!1,saved_at_unix:0,tabs:[]},Ie=!0;if(s.wailsBindings)try{ee="refreshTerminalTheme",await Hi(),ee="refreshTerminalAppearance",await Ur(),ee="refreshShortcutBindings",await Bo(),ee="refreshProfiles",await zi(),ee="getEndpoint",y.value=await KS(),ee="getHostInfo";const Se=await cm();l.value=Se.host_id,h.value=Se.host,ee="loadRecoverySnapshot",he=await ES(),Ie=await am(),ee="connectLocalSessionList",mr(y.value),ee="refreshRelayConfig",await bi()}catch(Se){const _t=(Se==null?void 0:Se.name)??"Error",Bt=(Se==null?void 0:Se.message)??String(Se);Us("boot",`step "${ee}" failed`,{name:_t,message:Bt,stack:Se==null?void 0:Se.stack}),K.value="error",J.value=`${ee}: ${_t}: ${Bt}`||i("app.wailsBindingsUnavailable");return}else try{ee="loadRelayConfig";const Se=await xs();!Se&&!s.localPty&&g(),K.value="ready",Se&&jn()}catch(Se){const _t=(Se==null?void 0:Se.name)??"Error",Bt=(Se==null?void 0:Se.message)??String(Se);Us("boot",`web: step "${ee}" failed`,{name:_t,message:Bt,stack:Se==null?void 0:Se.stack}),fn.startRemotePoll(Wn,3e3)}s.wailsBindings&&(At=window.setInterval(async()=>{try{const Se=await go();rt.value=!!(Se.available||Se.ready)}catch{}},5e3));try{if(!Tn&&ie.value.length===0&&(Tn=!0,!za.tryRestoreOnBoot())){if(Rn.value=he,Zt.value=Ie,s.wailsBindings&&s.autoUpdate&&await om()&&await Hn(VQ)){Gt.value=!0;return}on()}}catch(Se){const _t=(Se==null?void 0:Se.name)??"Error",Bt=(Se==null?void 0:Se.message)??String(Se);Us("boot","auto-start failed",{name:_t,message:Bt,stack:Se==null?void 0:Se.stack}),K.value="error",J.value=`autoStart: ${_t}: ${Bt}`}}),sc(()=>{We==null||We(),We=null,ae==null||ae(),ae=null,_e==null||_e(),_e=null,be==null||be(),be=null,Me==null||Me(),Me=null,x==null||x(),x=null,et(),window.removeEventListener("hashchange",pe),fn.detachAll(),bn!==null&&window.clearTimeout(bn),At!==null&&window.clearInterval(At),JJ()}),t({me:Ye}),(ee,he)=>{var Ie;return $(),F("div",{class:lt(["app",[`fe-theme-${C(pr)}`,{"is-maximized":Yt.value}]]),style:nn(ft.value)},[C(s).windowControls?($(),bt(Jk,{key:0,status:K.value,"error-msg":J.value,"session-count":Lc.value,"remote-endpoint":v.value,"current-title":On.value,"current-task-state":is.value},null,8,["status","error-msg","session-count","remote-endpoint","current-title","current-task-state"])):Z("",!0),Pe(uJ),Pe(_J),a.value?($(),F("div",IQ,[b("span",$Q,L(c.value),1),b("button",{class:"auth-error-action",onClick:u},L(C(i)("app.openSettings")),1),b("button",{class:"auth-error-dismiss",onClick:he[0]||(he[0]=Se=>a.value=null),"aria-label":C(i)("app.dismiss")},"×",8,OQ)])):Z("",!0),Q.value?Z("",!0):($(),bt(XC,{key:2,tabs:Ec.value,"current-id":ye.value,starting:ce.value,"can-new-local":C(s).localPty,"update-badge":rt.value,"is-admin":Ze.value,"admin-open":we.value,profiles:f.value,"selected-profile-id":_.value,onActivate:Te,onDetachSession:V,onClose:Ws,onNew:_r,onNewSsh:he[1]||(he[1]=Se=>Qe.value=!0),onReorder:Wt,onOpenSettings:he[2]||(he[2]=Se=>Fe.value=!0),onToggleAdmin:he[3]||(he[3]=Se=>we.value=!we.value),onSelectProfile:he[4]||(he[4]=Se=>_.value=Se)},null,8,["tabs","current-id","starting","can-new-local","update-badge","is-admin","admin-open","profiles","selected-profile-id"])),Q.value?($(),bt(fX,{key:3,fatal:Q.value,onQuit:Ge},null,8,["fatal"])):($(),F("div",FQ,[Pe(z2,{ref_key:"taskSidebarRef",ref:pn,collapsed:O.value,"by-host":C(R).byHost.value,"primary-state-for-host":C(R).primaryStateForHost,"completed-seen":C(R).completedSeen.value,"total-unread":C(R).totalUnread.value,"by-state-groups":C(R).byState.value,"active-session-id":((Ie=It.value)==null?void 0:Ie.sessionId)??null,"open-session-ids":vi.value,"local-host-id":l.value,"local-host":h.value,"pane-location-for":$a,"can-detach-session":N,"tab-index-by-id":Oa,"onUpdate:collapsed":U,onOpen:W,onClose:te,onDetachSession:V,onMergeSelected:Fa,onCloseSelected:br,onMarkSeen:oe},null,8,["collapsed","by-host","primary-state-for-host","completed-seen","total-unread","by-state-groups","active-session-id","open-session-ids","local-host-id","local-host"]),b("main",BQ,[we.value?($(),bt(K4,{key:0})):y.value||v.value?($(),F(Oe,{key:1},[ie.value.length===0?($(),F("div",HQ,L(p.value),1)):Z("",!0),($(!0),F(Oe,null,at(gt.value,Se=>it(($(),bt(dP,{key:Se.id,tab:Se,"endpoint-for":Fi,"session-info-for":gr,"viewer-count-for":r,active:Se.id===ye.value,"terminal-theme":xe.value.xtermTheme,"command-notify-threshold-sec":Tt.value,"search-request-seq":Na.value,appearance:je.value,"service-preview-available":!!C(n).servicePreview,onSetActivePane:_t=>Se.activePaneIdx=_t,onClosePane:_t=>Ma(Se,_t),onDropSession:_t=>z(Se,_t),onDetachSession:V,onToast:Cs,"onUpdate:colRatio":_t=>{Se.colRatio=_t},"onUpdate:rowRatio":_t=>{Se.rowRatio=_t}},null,8,["tab","active","terminal-theme","command-notify-threshold-sec","search-request-seq","appearance","service-preview-available","onSetActivePane","onClosePane","onDropSession","onUpdate:colRatio","onUpdate:rowRatio"])),[[ms,Se.id===ye.value]])),128))],64)):Z("",!0),Ee.value?($(),F("div",NQ,L(Ee.value),1)):Z("",!0)]),C(s).pluginHost&&C(pi)?($(),F(Oe,{key:0},[b("button",{class:"panel-toggle",onClick:he[5]||(he[5]=(...Se)=>C(ei)&&C(ei)(...Se)),title:C(Ss)?C(i)("app.showPanel"):C(i)("app.hidePanel")},L(C(Ss)?"‹":"›"),9,zQ),C(Ss)?Z("",!0):($(),F(Oe,{key:0},[b("div",{class:"right-resizer",onMousedown:he[6]||(he[6]=(...Se)=>C(Oi)&&C(Oi)(...Se))},null,32),Pe(zv,{"slot-id":"right-panel",context:C(Ks),class:"right-panel",style:nn({flex:"0 0 "+C(fi)+"px"})},null,8,["context","style"])],64))],64)):Z("",!0)])),C(s).pluginHost?($(),bt(zv,{key:5,"slot-id":"bottom-toolbar",context:C(Ks),class:"bottom-toolbar"},null,8,["context"])):Z("",!0),C(s).pluginHost?($(),bt(VJ,{key:6})):Z("",!0),Fe.value?($(),bt(rW,{key:7,"local-session-count":Fo.value,"remote-session-count":Jn.value,"terminal-theme-id":St.value,"initial-tab":m.value,onTerminalThemeChanged:zr,onCommandNotifyThresholdChanged:Ni,onAppearanceChanged:$o,onBindingsChanged:Ha,onProfilesChanged:le,onRelayConfigChanged:Rs,onSessionCreated:xc,onClose:Nr},null,8,["local-session-count","remote-session-count","terminal-theme-id","initial-tab"])):Z("",!0),De.value?($(),bt(gW,{key:8,onConnected:La,onCancel:he[7]||(he[7]=Se=>De.value=!1)})):Z("",!0),Qe.value?($(),bt(JG,{key:9,onConnected:La,onClose:he[8]||(he[8]=Se=>Qe.value=!1)})):Z("",!0),fe.value?($(),bt(oX,{key:10,"local-count":Fo.value,"remote-count":Jn.value,onConfirm:Ge,onCancel:Ve},null,8,["local-count","remote-count"])):Z("",!0),C(Je).length>0?($(),bt(yX,{key:11,title:C(wt),count:C(Je).length,"is-ai":C(tt),"is-running":C(mt),"is-remote":C(se),onConfirm:C(de),onCancel:C(Le)},null,8,["title","count","is-ai","is-running","is-remote","onConfirm","onCancel"])):Z("",!0),C(xn).snapshot?($(),bt($X,{key:12,open:C(xn).open,snapshot:C(xn).snapshot,onRestore:C($n),onDiscard:C(Xt)},null,8,["open","snapshot","onRestore","onDiscard"])):Z("",!0),Gt.value?($(),bt(KX,{key:13,onDismiss:Ot})):Z("",!0),Pe(nJ,{bindings:Kr.value},null,8,["bindings"])],6)}}}),WQ=Ct(KQ,[["__scopeId","data-v-beb2a608"]]);function jQ(){T0(),jh(ir.value),yt(ir,e=>{jh(e)})}async function qQ(e){var s,i;ew(),await xw(e.i18n),jQ();const t=JC(e.createPlatform);await((s=e.beforeMount)==null?void 0:s.call(e,t));const n=P0(WQ);n.use(N0()),n.provide("platform",t),n.config.globalProperties.$platform=t,n.mount("#app"),await((i=e.afterMount)==null?void 0:i.call(e,t,n)),Z0("boot","renderer ready",{href:typeof location>"u"?"":location.pathname})}const YQ={localPty:!1,autoUpdate:!1,pluginHost:!1,windowControls:!1,systemClipboard:!0,notifications:typeof Notification<"u",fileDialog:!0,wailsBindings:!1,capacitor:!1},GQ={async load(){const e=E0();return e?{url:e.baseURL,token:e.sessionToken??"",session_expires_at:e.expiresAt??0,allow_insecure_relay:e.allowInsecure,remote_permission:"full",last_email:"",connected:!1,...e.realmId!==void 0?{realmId:e.realmId}:{},...e.homeInstanceURL!==void 0?{homeInstanceURL:e.homeInstanceURL}:{}}:null},async save(e){wg({baseURL:e.url,sessionToken:e.token||null,expiresAt:e.session_expires_at||null,allowInsecure:e.allow_insecure_relay,...e.realmId!==void 0?{realmId:e.realmId}:{},...e.homeInstanceURL!==void 0?{homeInstanceURL:e.homeInstanceURL}:{}})},async clear(){Sg()},async fetchMe(){const{data:e}=await vn("/api/me");return e},async logout(){await B0()}},XQ={async closeSession(e){await vn(`/api/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},async listShells(){return[]},async listRemoteSessions(){const{listSessions:e}=await fo(async()=>{const{listSessions:n}=await import("./sessions-RpM2fLHY.js");return{listSessions:n}},__vite__mapDeps([3,4,1,5]));return(await e()).map(n=>({...n,session_id:n.id}))},async markSessionsSeen(e){await vn("/api/sessions/seen",{method:"POST",body:JSON.stringify(e)})},async getPins(){try{const e=localStorage.getItem("atterm.pinned_session_ids.value");if(e===null)return[];const t=JSON.parse(e);return Array.isArray(t)?t.filter(n=>typeof n=="string"):[]}catch{return[]}},async setPins(e){localStorage.setItem("atterm.pinned_session_ids.value",JSON.stringify(e));const{notifyLocalChange:t}=await fo(async()=>{const{notifyLocalChange:n}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:n}},__vite__mapDeps([6,4,1]));t("pinned_session_ids")},async listRelaySessions(){const{data:e}=await vn("/api/me/sessions");return e},async revokeRelaySession(e){await vn(`/api/me/sessions/${encodeURIComponent(e)}`,{method:"DELETE"})},async signOutOtherRelaySessions(){const{data:e}=await vn("/api/me/sessions/sign-out-others",{method:"POST"});return e}},Qy=(()=>{const e=new Map;return{on(t,n){let s=e.get(t);return s||(s=new Set,e.set(t,s)),s.add(n),()=>{s.delete(n)}},emit(t,n){const s=e.get(t);if(s)for(const i of Array.from(s))try{i(n)}catch(a){Lt("events","listener threw",{event:t,error:Rt(a)})}}}})(),JQ={async showNotification(e,t,n){if(!(typeof Notification>"u"))try{const s=new Notification(e,{body:t});n&&(s.onclick=()=>Qy.emit("notification:click",n))}catch{}},async getClipboardPaste(){var e;if(typeof navigator>"u"||!((e=navigator.clipboard)!=null&&e.readText))return{kind:"none"};try{const t=await navigator.clipboard.readText();return t?{kind:"text",text:t}:{kind:"none"}}catch{return{kind:"none"}}},async openExternalURL(e){window.open(e,"_blank","noopener")},async getEnvironment(){return{buildType:"web",platform:navigator.userAgent,arch:""}},async getAppVersion(){const{fetchVersion:e}=await fo(async()=>{const{fetchVersion:t}=await import("./version-Dm8mqW3q.js");return{fetchVersion:t}},__vite__mapDeps([7,4,1]));return e()}},Pd="atterm.quick_templates.value",Qv="atterm.templates_hidden.value",Ed="atterm.aux_keys.value",QQ={async load(){try{const e=localStorage.getItem(Pd);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},async save(e){localStorage.setItem(Pd,JSON.stringify(e));const{notifyLocalChange:t}=await fo(async()=>{const{notifyLocalChange:n}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:n}},__vite__mapDeps([6,4,1]));t("quick_templates")},async clear(){localStorage.setItem(Pd,JSON.stringify([]));const{notifyLocalChange:e}=await fo(async()=>{const{notifyLocalChange:t}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:t}},__vite__mapDeps([6,4,1]));e("quick_templates")},async loadHidden(){try{return JSON.parse(localStorage.getItem(Qv)??"false")}catch{return!1}},async saveHidden(e){localStorage.setItem(Qv,JSON.stringify(e))}},ZQ={async load(){try{const e=localStorage.getItem(Ed);if(!e)return[];const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}},async save(e){localStorage.setItem(Ed,JSON.stringify(e))},async clear(){localStorage.removeItem(Ed)}};function eZ(){return zw(()=>H0()),{caps:YQ,relay:GQ,sessions:XQ,system:JQ,events:Qy,templates:QQ,auxKeys:ZQ}}qQ({i18n:{loadPreference:async()=>localStorage.getItem("atterm.locale"),savePreference:async e=>localStorage.setItem("atterm.locale",String(e))},createPlatform:eZ,beforeMount:e=>{const t=new L0(D0(),M0());A0(t);const n=()=>{t.pull().then(()=>e.events.emit("prefs:changed",void 0)).catch(()=>{})};n(),e.events.on("prefs:remote-changed",n)}});export{lw as C,yw as U,ii as X,Lt as a,gZ as b,hn as c,cZ as d,Rt as e,va as f,lZ as g,fZ as h,j4 as i,dZ as j,vZ as k,aZ as l,pZ as m,uZ as n,$t as o,dn as p,Hr as q,ZJ as r,hZ as s,rn as t,n_ as u}; diff --git a/internal/relay/web-dist/assets/index-Bc7PlSwi.js b/internal/relay/web-dist/assets/index-X9DIw5ut.js similarity index 99% rename from internal/relay/web-dist/assets/index-Bc7PlSwi.js rename to internal/relay/web-dist/assets/index-X9DIw5ut.js index 50cd1a9b..dce56a1a 100644 --- a/internal/relay/web-dist/assets/index-Bc7PlSwi.js +++ b/internal/relay/web-dist/assets/index-X9DIw5ut.js @@ -1 +1 @@ -import{O as E,o as T,n as A,S as x,B as D,A as L,E as k,D as g,m as O,c as w,l as P,C as M,M as v,W as B,F as R,R as W}from"./FileExplorer-BGCt84ef.js";class te{constructor(t,e,n,i){this.state=t,this.pos=e,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=E(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),n=Math.max(e.from,this.pos-250),i=e.text.slice(n-e.from,this.pos-e.from),l=i.search(V(t));return l<0?null:{from:n+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,n){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function S(o){let t=Object.keys(o).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function j(o){let t=Object.create(null),e=Object.create(null);for(let{label:i}of o){t[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[e,n]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:j(t);return i=>{let l=i.matchBefore(n);return l||i.explicit?{from:l?l.from:i.pos,options:t,validFor:e}:null}}function oe(o,t){return e=>{for(let n=E(e.state).resolveInner(e.pos,-1);n;n=n.parent){if(o.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return t(e)}}function V(o,t){var e;let{source:n}=o,i=n[n.length-1]!="$";return i?new RegExp(`(?:${n})${i?"$":""}`,(e=o.flags)!==null&&e!==void 0?e:o.ignoreCase?"i":""):o}const q=L.define(),z=w.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class H{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class b{constructor(t,e,n){this.field=t,this.from=e,this.to=n}map(t){let e=t.mapPos(this.from,-1,v.TrackDel),n=t.mapPos(this.to,1,v.TrackDel);return e==null||n==null?null:new b(this.field,e,n)}}class I{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let n=[],i=[e],l=t.doc.lineAt(e),f=/^\s*/.exec(l.text)[0];for(let r of this.lines){if(n.length){let a=f,c=/^\t*/.exec(r)[0].length;for(let s=0;snew b(r.field,i[r.line]+r.from,i[r.line]+r.to));return{text:n,ranges:p}}static parse(t){let e=[],n=[],i=[],l;for(let f of t.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(f);){let p=l[1]?+l[1]:null,r=l[2]||l[3]||"",a=-1,c=r.replace(/\\[{}]/g,s=>s[1]);for(let s=0;s=a&&d.field++}for(let s of i)if(s.line==n.length&&s.from>l.index){let d=l[2]?3+(l[1]||"").length:2;s.from-=d,s.to-=d}i.push(new H(a,n.length,l.index,l.index+c.length)),f=f.slice(0,l.index)+r+f.slice(l.index+l[0].length)}f=f.replace(/\\([{}])/g,(p,r,a)=>{for(let c of i)c.line==n.length&&c.from>a&&(c.from--,c.to--);return r}),n.push(f)}return new I(n,i)}}let K=g.widget({widget:new class extends B{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),N=g.mark({class:"cm-snippetField"});class m{constructor(t,e){this.ranges=t,this.active=e,this.deco=g.set(t.map(n=>(n.from==n.to?K:N).range(n.from,n.to)),!0)}map(t){let e=[];for(let n of this.ranges){let i=n.map(t);if(!i)return null;e.push(i)}return new m(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(n=>n.field==this.active&&n.from<=e.from&&n.to>=e.to))}}const h=x.define({map(o,t){return o&&o.map(t)}}),X=x.define(),u=O.define({create(){return null},update(o,t){for(let e of t.effects){if(e.is(h))return e.value;if(e.is(X)&&o)return new m(o.ranges,e.value)}return o&&t.docChanged&&(o=o.map(t.changes)),o&&t.selection&&!o.selectionInsideField(t.selection)&&(o=null),o},provide:o=>w.decorations.from(o,t=>t?t.deco:g.none)});function y(o,t){return k.create(o.filter(e=>e.field==t).map(e=>k.range(e.from,e.to)))}function U(o){let t=I.parse(o);return(e,n,i,l)=>{let{text:f,ranges:p}=t.instantiate(e.state,i),{main:r}=e.state.selection,a={changes:{from:i,to:l==r.from?r.to:l,insert:A.of(f)},scrollIntoView:!0,annotations:n?[q.of(n),T.userEvent.of("input.complete")]:void 0};if(p.length&&(a.selection=y(p,0)),p.some(c=>c.field>0)){let c=new m(p,0),s=a.effects=[h.of(c)];e.state.field(u,!1)===void 0&&s.push(x.appendConfig.of([u,Z,_,z]))}e.dispatch(e.state.update(a))}}function $(o){return({state:t,dispatch:e})=>{let n=t.field(u,!1);if(!n||o<0&&n.active==0)return!1;let i=n.active+o,l=o>0&&!n.ranges.some(f=>f.field==i+o);return e(t.update({selection:y(n.ranges,i),effects:h.of(l?null:new m(n.ranges,i)),scrollIntoView:!0})),!0}}const Y=({state:o,dispatch:t})=>o.field(u,!1)?(t(o.update({effects:h.of(null)})),!0):!1,G=$(1),J=$(-1),Q=[{key:"Tab",run:G,shift:J},{key:"Escape",run:Y}],F=R.define({combine(o){return o.length?o[0]:Q}}),Z=P.highest(M.compute([F],o=>o.facet(F)));function ie(o,t){return{...t,apply:U(o)}}const _=w.domEventHandlers({mousedown(o,t){let e=t.state.field(u,!1),n;if(!e||(n=t.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let i=e.ranges.find(l=>l.from<=n&&l.to>=n);return!i||i.field==e.active?!1:(t.dispatch({selection:y(e.ranges,i.field),effects:h.of(e.ranges.some(l=>l.field>i.field)?new m(e.ranges,i.field):null),scrollIntoView:!0}),!0)}}),C=new class extends W{};C.startSide=1;C.endSide=-1;export{te as C,ne as c,oe as i,ie as s}; +import{O as E,o as T,n as A,S as x,B as D,A as L,E as k,D as g,m as O,c as w,l as P,C as M,M as v,W as B,F as R,R as W}from"./FileExplorer-DTHAXsem.js";class te{constructor(t,e,n,i){this.state=t,this.pos=e,this.explicit=n,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(t){let e=E(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),n=Math.max(e.from,this.pos-250),i=e.text.slice(n-e.from,this.pos-e.from),l=i.search(V(t));return l<0?null:{from:n+l,to:this.pos,text:i.slice(l)}}get aborted(){return this.abortListeners==null}addEventListener(t,e,n){t=="abort"&&this.abortListeners&&(this.abortListeners.push(e),n&&n.onDocChange&&(this.abortOnDocChange=!0))}}function S(o){let t=Object.keys(o).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function j(o){let t=Object.create(null),e=Object.create(null);for(let{label:i}of o){t[i[0]]=!0;for(let l=1;ltypeof i=="string"?{label:i}:i),[e,n]=t.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:j(t);return i=>{let l=i.matchBefore(n);return l||i.explicit?{from:l?l.from:i.pos,options:t,validFor:e}:null}}function oe(o,t){return e=>{for(let n=E(e.state).resolveInner(e.pos,-1);n;n=n.parent){if(o.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return t(e)}}function V(o,t){var e;let{source:n}=o,i=n[n.length-1]!="$";return i?new RegExp(`(?:${n})${i?"$":""}`,(e=o.flags)!==null&&e!==void 0?e:o.ignoreCase?"i":""):o}const q=L.define(),z=w.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center",cursor:"pointer"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class H{constructor(t,e,n,i){this.field=t,this.line=e,this.from=n,this.to=i}}class b{constructor(t,e,n){this.field=t,this.from=e,this.to=n}map(t){let e=t.mapPos(this.from,-1,v.TrackDel),n=t.mapPos(this.to,1,v.TrackDel);return e==null||n==null?null:new b(this.field,e,n)}}class I{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let n=[],i=[e],l=t.doc.lineAt(e),f=/^\s*/.exec(l.text)[0];for(let r of this.lines){if(n.length){let a=f,c=/^\t*/.exec(r)[0].length;for(let s=0;snew b(r.field,i[r.line]+r.from,i[r.line]+r.to));return{text:n,ranges:p}}static parse(t){let e=[],n=[],i=[],l;for(let f of t.split(/\r\n?|\n/)){for(;l=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(f);){let p=l[1]?+l[1]:null,r=l[2]||l[3]||"",a=-1,c=r.replace(/\\[{}]/g,s=>s[1]);for(let s=0;s=a&&d.field++}for(let s of i)if(s.line==n.length&&s.from>l.index){let d=l[2]?3+(l[1]||"").length:2;s.from-=d,s.to-=d}i.push(new H(a,n.length,l.index,l.index+c.length)),f=f.slice(0,l.index)+r+f.slice(l.index+l[0].length)}f=f.replace(/\\([{}])/g,(p,r,a)=>{for(let c of i)c.line==n.length&&c.from>a&&(c.from--,c.to--);return r}),n.push(f)}return new I(n,i)}}let K=g.widget({widget:new class extends B{toDOM(){let o=document.createElement("span");return o.className="cm-snippetFieldPosition",o}ignoreEvent(){return!1}}}),N=g.mark({class:"cm-snippetField"});class m{constructor(t,e){this.ranges=t,this.active=e,this.deco=g.set(t.map(n=>(n.from==n.to?K:N).range(n.from,n.to)),!0)}map(t){let e=[];for(let n of this.ranges){let i=n.map(t);if(!i)return null;e.push(i)}return new m(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(n=>n.field==this.active&&n.from<=e.from&&n.to>=e.to))}}const h=x.define({map(o,t){return o&&o.map(t)}}),X=x.define(),u=O.define({create(){return null},update(o,t){for(let e of t.effects){if(e.is(h))return e.value;if(e.is(X)&&o)return new m(o.ranges,e.value)}return o&&t.docChanged&&(o=o.map(t.changes)),o&&t.selection&&!o.selectionInsideField(t.selection)&&(o=null),o},provide:o=>w.decorations.from(o,t=>t?t.deco:g.none)});function y(o,t){return k.create(o.filter(e=>e.field==t).map(e=>k.range(e.from,e.to)))}function U(o){let t=I.parse(o);return(e,n,i,l)=>{let{text:f,ranges:p}=t.instantiate(e.state,i),{main:r}=e.state.selection,a={changes:{from:i,to:l==r.from?r.to:l,insert:A.of(f)},scrollIntoView:!0,annotations:n?[q.of(n),T.userEvent.of("input.complete")]:void 0};if(p.length&&(a.selection=y(p,0)),p.some(c=>c.field>0)){let c=new m(p,0),s=a.effects=[h.of(c)];e.state.field(u,!1)===void 0&&s.push(x.appendConfig.of([u,Z,_,z]))}e.dispatch(e.state.update(a))}}function $(o){return({state:t,dispatch:e})=>{let n=t.field(u,!1);if(!n||o<0&&n.active==0)return!1;let i=n.active+o,l=o>0&&!n.ranges.some(f=>f.field==i+o);return e(t.update({selection:y(n.ranges,i),effects:h.of(l?null:new m(n.ranges,i)),scrollIntoView:!0})),!0}}const Y=({state:o,dispatch:t})=>o.field(u,!1)?(t(o.update({effects:h.of(null)})),!0):!1,G=$(1),J=$(-1),Q=[{key:"Tab",run:G,shift:J},{key:"Escape",run:Y}],F=R.define({combine(o){return o.length?o[0]:Q}}),Z=P.highest(M.compute([F],o=>o.facet(F)));function ie(o,t){return{...t,apply:U(o)}}const _=w.domEventHandlers({mousedown(o,t){let e=t.state.field(u,!1),n;if(!e||(n=t.posAtCoords({x:o.clientX,y:o.clientY}))==null)return!1;let i=e.ranges.find(l=>l.from<=n&&l.to>=n);return!i||i.field==e.active?!1:(t.dispatch({selection:y(e.ranges,i.field),effects:h.of(e.ranges.some(l=>l.field>i.field)?new m(e.ranges,i.field):null),scrollIntoView:!0}),!0)}}),C=new class extends W{};C.startSide=1;C.endSide=-1;export{te as C,ne as c,oe as i,ie as s}; diff --git a/internal/relay/web-dist/assets/index-D9YFpvOI.js b/internal/relay/web-dist/assets/index-Z6WUIGxm.js similarity index 87% rename from internal/relay/web-dist/assets/index-D9YFpvOI.js rename to internal/relay/web-dist/assets/index-Z6WUIGxm.js index 5d8d7ad7..4f9bcbde 100644 --- a/internal/relay/web-dist/assets/index-D9YFpvOI.js +++ b/internal/relay/web-dist/assets/index-Z6WUIGxm.js @@ -1 +1 @@ -import{L as p,g as u,H as n,J as m,Q as e}from"./FileExplorer-BGCt84ef.js";import{html as l}from"./index-CsH7OxDu.js";import{javascriptLanguage as b}from"./index-CZ0p1U99.js";import{L as S,a as r}from"./index-q_Op_mkr.js";import"./useI18n-CnvN0FfF.js";import"./index-BH9vIdLD.js";import"./prefsSync-D8z1rJ8H.js";import"./client-2UEf7AK8.js";import"./Switch-CpxGRRqY.js";import"./auth-Dhl8fEWW.js";import"./index-BSlQSXjR.js";import"./index-Bc7PlSwi.js";const c=S.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,nodeProps:[["isolate",-3,3,13,17,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new r("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new r("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new r("[~RPwxU~ZOp~~",11,15),new r("[~RPrsU~ZOn~~",11,14),new r("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new r("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),P=b.parser.configure({top:"SingleExpression"}),o=c.configure({props:[m({Text:e.content,Is:e.definitionOperator,AttributeName:e.attributeName,VueAttributeName:e.keyword,Identifier:e.variableName,"AttributeValue ScriptAttributeValue":e.attributeValue,Entity:e.character,"{{ }}":e.brace,"@ :":e.punctuation})]}),i={parser:P},Q=o.configure({wrap:n((O,t)=>O.name=="InterpolationContent"?i:null)}),g=o.configure({wrap:n((O,t)=>O.name=="AttributeScript"?i:null),top:"Attribute"}),y={parser:Q},R={parser:g},a=l();function s(O){return O.configure({dialect:"selfClosing",wrap:n(X)},"vue")}const T=s(a.language);function X(O,t){switch(O.name){case"Attribute":return/^(@|:|v-)/.test(t.read(O.from,O.from+2))?R:null;case"Text":return y}return null}function U(O={}){let t=a;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof p))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new u(t.language==a.language?T:s(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["{",'"']}})])}export{U as vue,T as vueLanguage}; +import{L as p,g as u,H as n,J as m,Q as e}from"./FileExplorer-DTHAXsem.js";import{html as l}from"./index-DI-4cHpq.js";import{javascriptLanguage as b}from"./index-ChhOm7oD.js";import{L as S,a as r}from"./index-B2EmydOR.js";import"./useI18n-lwZlSdSx.js";import"./index-OVPV9rln.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";import"./index-BHEGRR_x.js";import"./index-X9DIw5ut.js";const c=S.deserialize({version:14,states:"%pOVOWOOObQPOOOpOSO'#C_OOOO'#Cp'#CpQVOWOOQxQPOOO!TQQOOQ!YQPOOOOOO,58y,58yO!_OSO,58yOOOO-E6n-E6nO!dQQO'#CqQ{QPOOO!iQPOOQ{QPOOO!qQPOOOOOO1G.e1G.eOOQO,59],59]OOQO-E6o-E6oO!yOpO'#CiO#RO`O'#CiQOQPOOO#ZO#tO'#CmO#fO!bO'#CmOOQO,59T,59TO#qOpO,59TO#vO`O,59TOOOO'#Cr'#CrO#{O#tO,59XOOQO,59X,59XOOOO'#Cs'#CsO$WO!bO,59XOOQO1G.o1G.oOOOO-E6p-E6pOOQO1G.s1G.sOOOO-E6q-E6q",stateData:"$g~OjOS~OQROUROkQO~OWTOXUOZUO`VO~OSXOTWO~OXUO[]OlZO~OY^O~O[_O~OT`O~OYaO~OmcOodO~OmfOogO~O^iOnhO~O_jOphO~ObkOqkOrmO~OcnOsnOtmO~OnpO~OppO~ObkOqkOrrO~OcnOsnOtrO~OWX`~",goto:"!^hPPPiPPPPPPPPPmPPPpPPsy!Q!WTROSRe]Re_QSORYSS[T^Rb[QlfRqlQogRso",nodeNames:"⚠ Content Text Interpolation InterpolationContent }} Entity Attribute VueAttributeName : Identifier @ Is ScriptAttributeValue AttributeScript AttributeScript AttributeName AttributeValue Entity Entity",maxTerm:36,nodeProps:[["isolate",-3,3,13,17,""]],skippedNodes:[0],repeatNodeCount:4,tokenData:"'y~RdXY!aYZ!a]^!apq!ars!rwx!w}!O!|!O!P#t!Q![#y![!]$s!_!`%g!b!c%l!c!}#y#R#S#y#T#j#y#j#k%q#k#o#y%W;'S#y;'S;:j$m<%lO#y~!fSj~XY!aYZ!a]^!apq!a~!wOm~~!|Oo~!b#RX`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|!b#qP;=`<%l!|~#yOl~%W$QXY#t`!b}!O!|!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y%W$pP;=`<%l#y~$zXX~`!b}!O!|!Q![!|![!]!|!c!}!|#R#S!|#T#o!|%W;'S!|;'S;:j#n<%lO!|~%lO[~~%qOZ~%W%xXY#t`!b}!O&e!Q![#y![!]!|!c!}#y#R#S#y#T#o#y%W;'S#y;'S;:j$m<%lO#y!b&jX`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|!b'^XW!b`!b}!O!|!Q![!|![!]!|!c!}'V#R#S!|#T#o'V%W;'S!|;'S;:j#n<%lO!|",tokenizers:[6,7,new r("b~RP#q#rU~XP#q#r[~aOT~~",17,4),new r("!k~RQvwX#o#p!_~^TU~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOU~~![P;=`<%lm~!bP#o#p!e~!jOk~~",72,2),new r("[~RPwxU~ZOp~~",11,15),new r("[~RPrsU~ZOn~~",11,14),new r("!e~RQvwXwx!_~^Tc~Opmq!]m!^;'Sm;'S;=`!X<%lOm~pUOpmq!]m!]!^!S!^;'Sm;'S;=`!X<%lOm~!XOc~~![P;=`<%lm~!dOt~~",66,35),new r("!e~RQrsXvw^~^Or~~cTb~Oprq!]r!^;'Sr;'S;=`!^<%lOr~uUOprq!]r!]!^!X!^;'Sr;'S;=`!^<%lOr~!^Ob~~!aP;=`<%lr~",66,33)],topRules:{Content:[0,1],Attribute:[1,7]},tokenPrec:157}),P=b.parser.configure({top:"SingleExpression"}),o=c.configure({props:[m({Text:e.content,Is:e.definitionOperator,AttributeName:e.attributeName,VueAttributeName:e.keyword,Identifier:e.variableName,"AttributeValue ScriptAttributeValue":e.attributeValue,Entity:e.character,"{{ }}":e.brace,"@ :":e.punctuation})]}),i={parser:P},Q=o.configure({wrap:n((O,t)=>O.name=="InterpolationContent"?i:null)}),g=o.configure({wrap:n((O,t)=>O.name=="AttributeScript"?i:null),top:"Attribute"}),y={parser:Q},R={parser:g},a=l();function s(O){return O.configure({dialect:"selfClosing",wrap:n(X)},"vue")}const T=s(a.language);function X(O,t){switch(O.name){case"Attribute":return/^(@|:|v-)/.test(t.read(O.from,O.from+2))?R:null;case"Text":return y}return null}function U(O={}){let t=a;if(O.base){if(O.base.language.name!="html"||!(O.base.language instanceof p))throw new RangeError("The base option must be the result of calling html(...)");t=O.base}return new u(t.language==a.language?T:s(t.language),[t.support,t.language.data.of({closeBrackets:{brackets:["{",'"']}})])}export{U as vue,T as vueLanguage}; diff --git a/internal/relay/web-dist/assets/index-arVCiUK9.css b/internal/relay/web-dist/assets/index-arVCiUK9.css deleted file mode 100644 index d374669d..00000000 --- a/internal/relay/web-dist/assets/index-arVCiUK9.css +++ /dev/null @@ -1,32 +0,0 @@ -.tabbar.drop-active[data-v-e57c51b9]{box-shadow:inset 0 -2px 0 var(--accent);background:color-mix(in srgb,var(--accent) 8%,transparent)}.tabbar[data-v-e57c51b9]{position:sticky;top:0;z-index:12;display:flex;align-items:stretch;background:var(--panel);flex:0 0 auto;height:28px;overflow:hidden}.tabs[data-v-e57c51b9]{display:flex;flex:1 1 auto;overflow-x:auto;scrollbar-width:none;-ms-overflow-style:none}.tabs[data-v-e57c51b9]::-webkit-scrollbar{display:none}.tab[data-v-e57c51b9]{display:flex;align-items:center;gap:6px;padding:0 8px 0 12px;border-right:1px solid var(--border);font-size:12px;color:var(--fg-dim);cursor:pointer;-webkit-user-select:none;user-select:none;white-space:nowrap;min-width:110px;max-width:220px;transition:background .12s;touch-action:pan-y}.tab.dragging[data-v-e57c51b9]{opacity:.5}.tab[data-v-e57c51b9]:hover{background:#ffffff0a}.tab.active[data-v-e57c51b9]{background:var(--bg);color:var(--fg);box-shadow:inset 0 -2px 0 var(--accent)}.tab .num[data-v-e57c51b9]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;color:var(--fg-dim)}.tab.active .num[data-v-e57c51b9]{color:var(--accent)}.tab .dot[data-v-e57c51b9]{font-size:9px;color:var(--good)}.tab .remote-dot[data-v-e57c51b9]{color:#d29922}.tab .remote-dot.disconnected[data-v-e57c51b9]{color:var(--fg-dim)}.tab.disconnected .title[data-v-e57c51b9]{color:var(--fg-dim);font-style:italic}.tab .layout-icon[data-v-e57c51b9]{font-size:11px;color:var(--fg-dim);font-family:ui-monospace,SFMono-Regular,Menlo,monospace;letter-spacing:-1px}.tab .title[data-v-e57c51b9]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;flex:1 1 auto;overflow:hidden;text-overflow:ellipsis}.tab .close[data-v-e57c51b9]{border:none;background:transparent;padding:0 4px;font-size:14px;line-height:1;color:var(--fg-dim);border-radius:4px;opacity:0;transition:opacity .12s,background .12s,color .12s}.tab:hover .close[data-v-e57c51b9],.tab.active .close[data-v-e57c51b9]{opacity:1}.tab .close[data-v-e57c51b9]:hover{background:#f851492e;color:var(--bad)}.profile-picker[data-v-e57c51b9]{max-width:120px;height:100%;border:none;border-left:1px solid var(--border);background:transparent;color:var(--fg-dim);font-size:11px;padding:0 6px;cursor:pointer}.profile-picker[data-v-e57c51b9]:hover{color:var(--fg)}.plus[data-v-e57c51b9]{border:none;background:transparent;color:var(--fg-dim);font-size:18px;line-height:1;padding:0 14px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.plus[data-v-e57c51b9]:hover:not(:disabled){color:var(--accent);background:#58a6ff14}.plus[data-v-e57c51b9]:disabled{opacity:.4;cursor:not-allowed}.ssh-btn[data-v-e57c51b9]{display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.ssh-btn[data-v-e57c51b9]:hover{color:var(--accent);background:#58a6ff14}.ssh-btn svg[data-v-e57c51b9]{display:block}.settings-btn[data-v-e57c51b9]{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.settings-btn[data-v-e57c51b9]:hover{color:var(--accent);background:#58a6ff14}.settings-btn svg[data-v-e57c51b9]{display:block}.settings-btn .dot[data-v-e57c51b9]{position:absolute;top:4px;right:4px;width:6px;height:6px;background:#d29922;border-radius:50%}.admin-btn[data-v-e57c51b9]{position:relative;display:inline-flex;align-items:center;justify-content:center;border:none;background:transparent;color:var(--fg-dim);padding:0 10px;cursor:pointer;border-left:1px solid var(--border);transition:color .12s,background .12s}.admin-btn[data-v-e57c51b9]:hover,.admin-btn.active[data-v-e57c51b9]{color:var(--accent);background:#58a6ff14}.tab.unread[data-v-e57c51b9]{background:color-mix(in srgb,var(--unread-c) 10%,transparent)}.tab.unread .title[data-v-e57c51b9]{font-weight:600;color:#fff}.tab.unread[data-v-e57c51b9]:not(.active){box-shadow:inset 0 -2px 0 var(--unread-c)}@media (max-width: 767px){.tabbar[data-v-e57c51b9]{height:36px}.tab[data-v-e57c51b9]{min-width:86px;max-width:150px;padding:0 6px 0 10px;gap:4px}.tab .num[data-v-e57c51b9]{display:none}.tab .close[data-v-e57c51b9]{opacity:1;padding:0 2px}.settings-btn[data-v-e57c51b9],.admin-btn[data-v-e57c51b9]{min-width:40px;padding:0 12px}}.window-controls[data-v-1ccfd0fb]{display:inline-flex;align-items:stretch;height:100%;margin-left:8px}.wc-btn[data-v-1ccfd0fb]{display:inline-flex;align-items:center;justify-content:center;width:36px;border:none;background:transparent;color:var(--fg-dim);cursor:pointer;transition:background .12s,color .12s}.wc-btn[data-v-1ccfd0fb]:hover{background:#ffffff14;color:var(--fg)}.wc-close[data-v-1ccfd0fb]:hover{background:#e81123;color:#fff}.conn-health-pill[data-v-5daa187a]{display:inline-flex;align-items:center;gap:4px;padding:2px 8px;height:20px;border-radius:999px;border:1px solid var(--border, #ccc);background:transparent;color:inherit;font-size:11px;font-variant-numeric:tabular-nums;cursor:pointer;line-height:1;white-space:nowrap}.conn-health-pill .dot[data-v-5daa187a]{font-size:8px;line-height:1}.band-green[data-v-5daa187a]{color:var(--good, #16a34a);border-color:color-mix(in srgb,var(--good, #16a34a) 35%,transparent)}.band-yellow[data-v-5daa187a]{color:var(--warn, #d97706);border-color:color-mix(in srgb,var(--warn, #d97706) 35%,transparent)}.band-red[data-v-5daa187a]{color:var(--bad, #dc2626);border-color:color-mix(in srgb,var(--bad, #dc2626) 35%,transparent)}.band-off[data-v-5daa187a]{color:var(--fg-dim, #888)}.band-reconnecting[data-v-5daa187a]{color:var(--warn, #d97706);animation:conn-health-pulse-5daa187a 1s ease-in-out infinite}@keyframes conn-health-pulse-5daa187a{0%,to{opacity:1}50%{opacity:.35}}@media (prefers-reduced-motion: reduce){.band-reconnecting[data-v-5daa187a]{animation:none}}.drawer[data-v-c8bb9e85]{position:fixed;top:36px;right:8px;z-index:1100;width:280px;background:var(--bg, #fff);color:var(--fg, #111);border:1px solid var(--border, #ddd);border-radius:8px;box-shadow:0 8px 24px #0000001f;padding:10px 12px;font-size:12px;display:flex;flex-direction:column;gap:8px}.head[data-v-c8bb9e85]{display:flex;align-items:center;justify-content:space-between;font-weight:600}.close[data-v-c8bb9e85]{background:transparent;border:0;cursor:pointer;font-size:16px;line-height:1;color:inherit}.row[data-v-c8bb9e85]{display:flex;justify-content:space-between;padding:2px 0}.metric-label[data-v-c8bb9e85]{color:var(--fg-dim, #666)}.metric-value[data-v-c8bb9e85]{font-variant-numeric:tabular-nums}.spark[data-v-c8bb9e85]{color:var(--good, #16a34a);display:block}.reconn-table[data-v-c8bb9e85]{width:100%;border-collapse:collapse;font-size:11px}.reconn-table th[data-v-c8bb9e85],.reconn-table td[data-v-c8bb9e85]{text-align:left;padding:2px 4px;border-top:1px solid var(--border, #eee)}.gaps[data-v-c8bb9e85]{color:var(--warn, #d97706)}.titlebar[data-v-2cf685eb]{position:relative;display:flex;align-items:center;gap:12px;padding:6px 14px;background:var(--panel);border-bottom:1px solid var(--border);flex:0 0 auto;--wails-draggable: drag}.window-title[data-v-2cf685eb]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);max-width:50%;font-size:12px;color:var(--fg);font-weight:500;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;padding:0 8px}.status[data-v-2cf685eb]{font-size:12px;color:var(--fg-dim);--wails-draggable: no-drag;flex:0 0 auto;margin-left:auto}.status .bad[data-v-2cf685eb]{color:var(--bad)}.status .dim[data-v-2cf685eb]{color:var(--good)}.e2ee-off-chip[data-v-2cf685eb]{--wails-draggable: no-drag;flex:0 0 auto;display:inline-flex;align-items:center;gap:4px;margin-left:8px;padding:2px 8px;font-size:11px;font-weight:600;line-height:1.4;color:#1f1300;background:#f4b740;border-radius:999px;letter-spacing:.02em;white-space:nowrap}.e2ee-off-chip .chip-icon[data-v-2cf685eb]{font-size:12px;line-height:1}.titlebar[data-v-2cf685eb]:after{content:"";position:absolute;left:0;right:0;bottom:-1px;height:3px;background:repeating-linear-gradient(90deg,transparent 0px,transparent 200px,rgba(74,222,128,.3) 320px,#4ade80 500px,#bbf7d0 560px,#4ade80 620px,rgba(74,222,128,.3) 800px,transparent 920px,transparent 1120px);background-size:1120px 100%;background-position:var(--sweep-offset, 0px) 0;box-shadow:0 -1px 6px #4ade8066;opacity:0;transition:opacity .25s ease;pointer-events:none}.titlebar.is-running[data-v-2cf685eb]:after{opacity:1}@media (prefers-reduced-motion: reduce){.titlebar[data-v-2cf685eb]:after{background:#4ade80}}.last-output[data-v-ea632618]{display:inline-flex;align-items:center;gap:3px;flex:none;color:var(--fg-dim, #6e7681);white-space:nowrap;font-family:var(--font-mono, ui-monospace, monospace);font-size:9px;line-height:1;font-variant-numeric:tabular-nums}.last-output-clock[data-v-ea632618]{width:10px;height:10px;flex:none}.last-output.live[data-v-ea632618]{color:var(--accent, #58a6ff)}.row-main[data-v-81d1a3d4]{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}.row-top[data-v-81d1a3d4]{display:flex;align-items:center;gap:6px;min-width:0}.state-label[data-v-81d1a3d4]{font-size:11px;opacity:.85;white-space:nowrap;flex-shrink:0}.cmd-and-cwd[data-v-81d1a3d4]{flex:1 1 auto;min-width:0;display:flex;gap:6px;overflow:hidden;align-items:baseline}.cmd[data-v-81d1a3d4]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--font-mono);flex:1 1 auto;min-width:0}.row-meta[data-v-81d1a3d4]{display:flex;align-items:center;gap:6px;min-width:0;padding-left:18px}.cwd[data-v-81d1a3d4]{color:var(--fg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-mono);font-size:.85em;flex:1 1 auto;min-width:0}.row-tail[data-v-81d1a3d4]{flex:0 0 auto;min-width:46px;align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:3px}.row-tail.time-only[data-v-81d1a3d4]{justify-content:flex-end}.row-tail[data-v-81d1a3d4] .last-output{opacity:.65}.kind[data-v-81d1a3d4]{font-size:8.5px;line-height:1.4;padding:1px 4px;border-radius:3px;border:1px solid var(--border);color:var(--fg-dim);white-space:nowrap;transition:opacity .1s}.row-close[data-v-81d1a3d4]{position:absolute;top:4px;right:6px;display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;font-size:13px;line-height:1;cursor:pointer;color:var(--fg-dim);border-radius:4px}.row-close[data-v-81d1a3d4]:hover{background:#f851492e;color:var(--bad)}.session-row-menu[data-v-f6b9c7cb]{position:fixed;z-index:1000;min-width:140px;padding:4px;background:var(--menu-bg, #1f1f22);border:1px solid rgba(255,255,255,.12);border-radius:6px;box-shadow:0 8px 24px #0006}.menu-item[data-v-f6b9c7cb]{display:block;width:100%;padding:6px 10px;background:transparent;border:none;color:inherit;text-align:left;cursor:pointer;border-radius:4px;font-size:13px}.menu-item[data-v-f6b9c7cb]:hover:not(.disabled),.menu-item[data-v-f6b9c7cb]:focus:not(.disabled){background:#ffffff14;outline:none}.menu-item.disabled[data-v-f6b9c7cb]{opacity:.4;cursor:not-allowed}.menu-separator[data-v-f6b9c7cb]{height:1px;margin:4px 6px;background:#ffffff1f}.session-details-popover[data-v-9528360b]{position:fixed;z-index:1000;min-width:260px;max-width:420px;width:min(420px,calc(100vw - 16px));box-sizing:border-box;padding:8px 10px 10px;background:var(--menu-bg, #1f1f22);border:1px solid rgba(255,255,255,.14);border-radius:8px;box-shadow:0 12px 32px #00000073;font-size:12px}.popover-title[data-v-9528360b]{font-weight:600;padding-bottom:6px;border-bottom:1px solid rgba(255,255,255,.08);margin-bottom:6px}.rows[data-v-9528360b]{display:flex;flex-direction:column;gap:3px;max-height:380px;overflow-x:auto;overflow-y:auto;-webkit-overflow-scrolling:touch}.row[data-v-9528360b]{display:grid;grid-template-columns:96px 1fr auto;gap:8px;align-items:baseline;min-width:max-content}.label[data-v-9528360b]{color:var(--fg-dim);white-space:nowrap}.value[data-v-9528360b]{overflow:visible;text-overflow:clip;white-space:nowrap;font-family:var(--font-mono);min-width:0}.copy[data-v-9528360b]{border:none;background:transparent;color:var(--fg-dim);cursor:pointer;padding:0 3px;font-size:12px;border-radius:3px}.copy[data-v-9528360b]:hover{color:var(--fg);background:#ffffff14}.task-grouped-list[data-v-42b39ad3]{display:flex;flex-direction:column;gap:8px;font-size:12px}.host-header[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;font-weight:500;padding:4px 6px;cursor:pointer;-webkit-user-select:none;user-select:none}.host-header[data-v-42b39ad3]:hover{background:#ffffff0a;border-radius:4px}.host-header .caret[data-v-42b39ad3]{font-size:9px;opacity:.7;width:9px;display:inline-block}.host-name[data-v-42b39ad3]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.counts[data-v-42b39ad3]{margin-left:auto;display:inline-flex;gap:2px;align-items:center;flex-shrink:0}.unread-badge[data-v-42b39ad3]{font-size:10px;opacity:.8;background:#ffffff0f;border-radius:3px;padding:1px 4px;white-space:nowrap;flex-shrink:0}.local-chip[data-v-42b39ad3]{font-size:10px;color:var(--accent);border:1px solid color-mix(in srgb,var(--accent) 40%,transparent);border-radius:3px;padding:0 4px;line-height:1.3;white-space:nowrap;flex-shrink:0}.mark-all[data-v-42b39ad3]{background:none;border:none;cursor:pointer;padding:0 4px;color:inherit}.host-group[data-v-42b39ad3]{display:flex;flex-direction:column;gap:4px}.group-header[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;font-weight:500;padding:4px 6px;cursor:pointer;-webkit-user-select:none;user-select:none}.group-header[data-v-42b39ad3]:hover{background:#ffffff0a;border-radius:4px}.group-header .caret[data-v-42b39ad3]{font-size:9px;opacity:.7;width:9px;display:inline-block}.pinned-group .pin-icon[data-v-42b39ad3]{font-size:11px}.group-title[data-v-42b39ad3]{flex:0 1 auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.group-count[data-v-42b39ad3]{margin-left:auto;font-size:10px;opacity:.8;background:#ffffff0f;border-radius:3px;padding:1px 4px}.task-row[data-v-42b39ad3]{display:flex;flex-direction:row;align-items:stretch;gap:6px;padding:5px 8px;border:1px solid rgba(255,255,255,.08);background:#ffffff05;width:100%;text-align:left;cursor:pointer;color:inherit;border-radius:6px;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none;touch-action:pan-y;position:relative}.task-row[data-v-42b39ad3] .row-close{opacity:0;transition:opacity .1s}.task-row[data-v-42b39ad3]:hover .row-close,.task-row[data-v-42b39ad3]:focus-within .row-close{opacity:1}.task-row[data-v-42b39ad3]:hover .kind,.task-row[data-v-42b39ad3]:focus-within .kind{opacity:0}@media (hover: none){.task-row[data-v-42b39ad3] .row-close{position:static;align-self:flex-start;opacity:1}.task-row[data-v-42b39ad3] .kind{opacity:1}}.task-row[data-v-42b39ad3]:hover{background:#ffffff0f;border-color:#ffffff29}.task-row.active[data-v-42b39ad3]{background:color-mix(in srgb,var(--accent) 10%,transparent);border-color:color-mix(in srgb,var(--accent) 28%,var(--border));box-shadow:inset 2px 0 0 var(--accent)}.task-row.active[data-v-42b39ad3]:hover{background:color-mix(in srgb,var(--accent) 14%,transparent)}.task-row.selected[data-v-42b39ad3]{outline:2px solid var(--accent);outline-offset:-2px}.task-row.unread[data-v-42b39ad3]{background:color-mix(in srgb,var(--unread-c) 7%,transparent);border-color:color-mix(in srgb,var(--unread-c) 24%,var(--border));box-shadow:inset 2px 0 0 var(--unread-c)}.task-row.unread[data-v-42b39ad3]:hover{background:color-mix(in srgb,var(--unread-c) 12%,transparent)}.task-row.unread[data-v-42b39ad3] .cmd{font-weight:600;color:#fff}.task-row.active.unread[data-v-42b39ad3]{background:color-mix(in srgb,var(--unread-c) 14%,transparent);border-color:color-mix(in srgb,var(--accent) 28%,var(--border));box-shadow:inset 2px 0 0 var(--unread-c)}.task-row.dim[data-v-42b39ad3]{opacity:.6}.task-row.dim.active[data-v-42b39ad3]{opacity:.9}.task-row.dim.unread[data-v-42b39ad3]{opacity:1}.row-main[data-v-42b39ad3]{flex:1 1 auto;min-width:0;display:flex;flex-direction:column;gap:1px}.row-top[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;min-width:0}.state-label[data-v-42b39ad3]{font-size:11px;opacity:.85;white-space:nowrap;flex-shrink:0}.cmd-and-cwd[data-v-42b39ad3]{flex:1 1 auto;min-width:0;display:flex;gap:6px;overflow:hidden;align-items:baseline}.cmd[data-v-42b39ad3]{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;font-family:var(--font-mono);flex:1 1 auto;min-width:0}.row-meta[data-v-42b39ad3]{display:flex;align-items:center;gap:6px;min-width:0;padding-left:18px}.cwd[data-v-42b39ad3]{color:var(--fg-dim);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-family:var(--font-mono);font-size:.85em;flex:1 1 auto;min-width:0}.row-tail[data-v-42b39ad3]{flex:0 0 auto;min-width:46px;align-self:stretch;display:flex;flex-direction:column;align-items:flex-end;justify-content:space-between;gap:3px}.row-tail.time-only[data-v-42b39ad3]{justify-content:flex-end}.row-tail[data-v-42b39ad3] .last-output{opacity:.65}.kind[data-v-42b39ad3]{font-size:8.5px;line-height:1.4;padding:1px 4px;border-radius:3px;border:1px solid var(--border);color:var(--fg-dim);white-space:nowrap;transition:opacity .1s}.completed-row-close[data-v-42b39ad3]{position:absolute;top:5px;right:8px;border:none;background:transparent;color:var(--fg-dim);border-radius:4px;cursor:pointer;font-size:13px;line-height:1;padding:1px 4px}.completed-row-close[data-v-42b39ad3]:hover{background:#f851492e;color:var(--bad)}.completed-fold[data-v-42b39ad3]{border-top:1px solid rgba(255,255,255,.06);margin-top:6px;padding-top:4px;display:flex;flex-direction:column;gap:4px}.fold-toggle[data-v-42b39ad3]{background:none;border:none;cursor:pointer;padding:4px 6px;width:100%;text-align:left;color:inherit;opacity:.7}.fold-mark-all[data-v-42b39ad3]{background:none;border:1px solid rgba(255,255,255,.12);cursor:pointer;padding:4px 8px;margin:4px 6px;color:inherit;border-radius:3px}.empty-hint[data-v-42b39ad3]{padding:24px 12px;text-align:center;color:var(--fg);opacity:.55;font-size:12px}.bulk-bar[data-v-c912fe83]{display:flex;flex-wrap:wrap;gap:6px;align-items:center;padding:6px 4px}.counter[data-v-c912fe83]{font-size:11px;color:var(--fg-dim);margin-right:4px;white-space:nowrap}.btn[data-v-c912fe83]{background:none;border:1px solid rgba(255,255,255,.14);color:inherit;cursor:pointer;padding:3px 8px;font-size:11px;border-radius:3px;line-height:1.4}.btn[data-v-c912fe83]:hover:not(:disabled){background:#ffffff0f}.btn[data-v-c912fe83]:disabled{opacity:.4;cursor:not-allowed}.btn.primary[data-v-c912fe83]{border-color:color-mix(in srgb,var(--accent) 40%,var(--border));color:var(--accent)}.btn.primary[data-v-c912fe83]:hover:not(:disabled){background:color-mix(in srgb,var(--accent) 12%,transparent)}.btn.ghost[data-v-c912fe83]{border-color:transparent;opacity:.75}.task-sidebar-shell[data-v-0741527d]{display:contents}.task-sidebar[data-v-0741527d]{position:relative;background:var(--panel);border-right:1px solid var(--border);color:var(--fg);display:flex;flex-direction:column;height:100%}.task-sidebar.collapsed[data-v-0741527d]{width:32px}.sidebar-hamburger[data-v-0741527d]{position:fixed;top:34px;left:8px;z-index:20;padding:4px 8px;background:var(--panel);border:1px solid var(--border);color:inherit;border-radius:4px;cursor:pointer;font-size:12px;line-height:1}.task-sidebar.drawer[data-v-0741527d]{position:fixed;top:0;bottom:0;left:0;z-index:15;transform:translate(-100%);transition:transform .2s ease;box-shadow:2px 0 8px #0000004d}.task-sidebar.drawer.open[data-v-0741527d]{transform:translate(0)}.expanded[data-v-0741527d]{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.resize-handle[data-v-0741527d]{position:absolute;top:0;right:-2px;width:4px;height:100%;cursor:ew-resize;-webkit-user-select:none;user-select:none;z-index:1}.resize-handle[data-v-0741527d]:hover{background:#ffffff0f}.sidebar-header[data-v-0741527d]{display:flex;align-items:center;padding:8px 10px;border-bottom:1px solid var(--border)}.title[data-v-0741527d]{flex:1 1 auto;min-width:0;font-weight:500;margin-right:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.search-icon-btn[data-v-0741527d]{background:none;border:none;color:inherit;cursor:pointer;padding:2px 4px;margin-right:6px;opacity:.7;display:inline-flex;align-items:center;justify-content:center;border-radius:3px}.search-icon-btn[data-v-0741527d]:hover{opacity:1;background:#ffffff0d}.collapse-button[data-v-0741527d],.expand-button[data-v-0741527d]{background:none;border:none;cursor:pointer;color:inherit;font-size:14px}.group-toggle[data-v-0741527d]{background:none;border:1px solid var(--border);color:inherit;cursor:pointer;border-radius:3px;font-size:11px;padding:1px 6px;margin-right:6px;opacity:.8}.group-toggle[data-v-0741527d]:hover{opacity:1;background:#ffffff0d}.sidebar-search[data-v-0741527d]{flex:1 1 auto;min-width:60px;background:#ffffff08;border:1px solid transparent;color:inherit;border-radius:3px;padding:1px 6px;font-size:12px;font-family:inherit;line-height:20px;margin-right:6px;outline:none}.sidebar-search[data-v-0741527d]:focus{border-color:var(--border);background:#ffffff0d}.sidebar-search[data-v-0741527d]::placeholder{opacity:.5}.list-wrap[data-v-0741527d]{flex:1 1 auto;overflow-y:auto;overflow-x:hidden;padding:4px;scrollbar-width:none}.list-wrap[data-v-0741527d]::-webkit-scrollbar{display:none}footer[data-v-0741527d]{padding:8px;border-top:1px solid var(--border)}.mark-all[data-v-0741527d]{background:none;border:1px solid var(--border);cursor:pointer;padding:6px 10px;color:inherit;border-radius:3px;width:100%}.rail[data-v-0741527d]{display:flex;flex-direction:column;align-items:center;padding:6px 0;gap:4px}.rail-badge[data-v-0741527d]{font-size:10px;background:#ef4444;color:#fff;border-radius:8px;padding:1px 5px}.rail-icon[data-v-0741527d]{cursor:pointer;padding:2px}@media (max-width: 767px){.sidebar-hamburger[data-v-0741527d]{top:calc(env(safe-area-inset-top) + 42px);left:calc(env(safe-area-inset-left) + 8px);min-height:32px}.task-sidebar.drawer[data-v-0741527d]{top:env(safe-area-inset-top);bottom:env(safe-area-inset-bottom);max-width:min(86vw,360px)}}.select-dropdown[data-v-65a81c06]{position:relative;width:100%}.trigger[data-v-65a81c06]{-moz-appearance:none;appearance:none;-webkit-appearance:none;box-sizing:border-box;display:flex;align-items:center;justify-content:space-between;gap:8px;width:100%;height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px;font-family:inherit;line-height:1.3;cursor:pointer;text-align:left}.trigger[data-v-65a81c06]:after{content:"▾";color:var(--fg-dim);font-size:11px;transition:transform .15s ease;flex-shrink:0}.trigger[data-v-65a81c06]:hover:not(:disabled):after{color:var(--fg)}.trigger[data-v-65a81c06]:hover:not(:disabled){border-color:var(--fg-dim)}.trigger[data-v-65a81c06]:focus-visible{outline:none;box-shadow:0 0 0 2px var(--accent)}.trigger[data-v-65a81c06]:disabled{cursor:not-allowed;opacity:.6}.trigger-label[data-v-65a81c06]{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.trigger-open[data-v-65a81c06]:after{transform:rotate(180deg)}.menu[data-v-65a81c06]{position:absolute;top:calc(100% + 4px);left:0;right:0;max-height:240px;overflow-y:auto;margin:0;padding:4px 0;list-style:none;background:var(--bg);border:1px solid var(--border);border-radius:6px;box-shadow:0 6px 16px #00000059;z-index:1000}.option[data-v-65a81c06]{position:relative;display:flex;flex-direction:column;gap:2px;padding:8px 10px;cursor:pointer}.option-label[data-v-65a81c06]{color:var(--fg);font-size:13px;line-height:1.3}.option-description[data-v-65a81c06]{color:var(--fg-dim);font-size:12px;line-height:1.3}.option-highlight[data-v-65a81c06]{background:#ffffff0f}.option-selected[data-v-65a81c06]:before{content:"";position:absolute;top:4px;bottom:4px;left:0;width:2px;background:var(--accent);border-radius:2px}.option-selected .option-label[data-v-65a81c06]{color:var(--fg);font-weight:500}.sp-switcher[data-v-c9d59669]{position:relative;display:inline-flex;align-items:center;gap:6px;pointer-events:auto}.sp-seg[data-v-c9d59669]{display:inline-flex;align-items:center;gap:2px;background:var(--terminal-overlay, rgba(13, 17, 23, .92));border:1px solid var(--border);border-radius:8px;padding:2px}.sp-seg button[data-v-c9d59669]{display:inline-flex;align-items:center;gap:6px;white-space:nowrap;flex:0 0 auto;border:0;border-radius:5px;padding:4px 8px;color:var(--fg-dim);background:transparent;font:12px var(--font-mono);cursor:pointer}.sp-seg button[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-seg button.active[data-v-c9d59669]{color:var(--fg);background:#ffffff1a}.sp-seg button.reconnecting[data-v-c9d59669]{color:var(--warning, #d29922)}.sp-caret[data-v-c9d59669]{color:var(--fg-dim);font-size:10px}.sp-dot[data-v-c9d59669]{width:6px;height:6px;border-radius:50%;background:var(--good, #3fb950);flex:0 0 auto}.sp-dot.reconnecting[data-v-c9d59669]{background:var(--warning, #d29922);animation:sp-pulse-c9d59669 1s infinite}@keyframes sp-pulse-c9d59669{50%{opacity:.3}}.sp-actions[data-v-c9d59669]{display:inline-flex;align-items:center;gap:2px;background:var(--terminal-overlay, rgba(13, 17, 23, .92));border:1px solid var(--border);border-radius:8px;padding:2px}.sp-actions button[data-v-c9d59669]{width:24px;height:24px;display:inline-flex;align-items:center;justify-content:center;border:0;border-radius:5px;color:var(--fg-dim);background:transparent;cursor:pointer}.sp-actions button[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-actions button.close[data-v-c9d59669]:hover{color:var(--bad);background:#f851491f}.sp-ico[data-v-c9d59669]{display:inline-flex;align-items:center;justify-content:center}.sp-actions svg[data-v-c9d59669]{width:13px;height:13px;display:block}.sp-menu[data-v-c9d59669]{position:absolute;top:32px;left:0;z-index:20;min-width:210px;background:var(--terminal-overlay, rgba(13, 17, 23, .98));border:1px solid var(--border);border-radius:8px;padding:4px;box-shadow:0 12px 30px #00000073}.sp-item[data-v-c9d59669]{display:flex;align-items:center;gap:8px;width:100%;padding:6px 8px;border:0;border-radius:6px;background:transparent;color:var(--fg-dim);font:12px var(--font-mono);cursor:pointer;white-space:nowrap;text-align:left}.sp-item[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff0f}.sp-item.active[data-v-c9d59669]{color:var(--fg);background:#ffffff1a}.sp-lbl[data-v-c9d59669]{flex:1}.sp-mini[data-v-c9d59669]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;color:var(--fg-dim);flex:0 0 auto}.sp-mini[data-v-c9d59669]:hover{color:var(--fg);background:#ffffff1a}.sp-mini svg[data-v-c9d59669]{width:13px;height:13px;display:block}.sp-x[data-v-c9d59669]{width:22px;height:22px;display:inline-flex;align-items:center;justify-content:center;border-radius:5px;color:var(--fg-dim);flex:0 0 auto}.sp-x[data-v-c9d59669]:hover{color:var(--bad);background:#f851491f}.sp-sep[data-v-c9d59669]{height:1px;background:var(--border);margin:4px 2px}.sp-add[data-v-c9d59669]{color:var(--good, #3fb950)}.popover[data-v-063a4cb7]{position:fixed;transform:translate(-50%);background:#2b2c30;color:#fff;border-radius:8px;display:flex;box-shadow:0 6px 20px #0006;font-family:-apple-system,system-ui,sans-serif;z-index:1000}.popover[data-v-063a4cb7]:after{content:"";position:absolute;left:50%;transform:translate(-50%);width:0;height:0;border-left:5px solid transparent;border-right:5px solid transparent}.popover.arrow-down[data-v-063a4cb7]:after{bottom:-5px;border-top:5px solid #2b2c30}.popover.arrow-up[data-v-063a4cb7]:after{top:-5px;border-bottom:5px solid #2b2c30}.btn[data-v-063a4cb7]{position:relative;background:none;border:none;color:#fff;padding:4px 11px;font-size:11px;font-family:inherit;cursor:pointer;border-right:1px solid #3f4046}.btn[data-v-063a4cb7]:last-child{border-right:none}.btn.send[data-v-063a4cb7]{color:#60a5fa;font-weight:600}.btn.cancel[data-v-063a4cb7]{font-size:14px;line-height:1;padding:4px 8px}.btn[data-v-063a4cb7]:disabled{opacity:.5;cursor:not-allowed}.btn[data-v-063a4cb7]:before{content:"";position:absolute;top:-8px;bottom:-8px;left:0;right:0}.term-search[data-v-302a13f7]{position:absolute;top:8px;left:12px;z-index:6;display:flex;align-items:center;gap:4px;padding:4px 6px;border:1px solid var(--border);border-radius:6px;background:var(--panel);box-shadow:0 4px 12px #00000059}.term-search-input[data-v-302a13f7]{width:180px;padding:2px 6px;border:1px solid var(--border);border-radius:4px;background:var(--bg);color:var(--fg);font-size:12px;outline:none}.term-search-input[data-v-302a13f7]:focus{border-color:var(--accent)}.term-search-count[data-v-302a13f7]{min-width:52px;color:var(--fg-dim);font-size:11px;text-align:center;white-space:nowrap}.term-search-btn[data-v-302a13f7]{padding:1px 6px;border:1px solid var(--border);border-radius:4px;background:#21262d;color:var(--fg);font-size:11px;line-height:16px;cursor:pointer}.term-search-btn[data-v-302a13f7]:hover:not(:disabled){background:var(--border)}.term-search-btn[data-v-302a13f7]:disabled{opacity:.4;cursor:default}.term-view[data-v-acf7d666]{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--terminal-bg);overflow:hidden}.term[data-v-acf7d666]{position:absolute;left:0;right:0;top:0;bottom:30px}.service-preview-frame[data-v-acf7d666]{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;height:100%;border:0;background:#fff}.service-preview-reconnecting[data-v-acf7d666]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:9;display:flex;gap:10px;align-items:center;justify-content:center;color:var(--fg);background:var(--terminal-overlay, rgba(13, 17, 23, .9));font:13px var(--font-mono)}.service-preview-reconnecting-spinner[data-v-acf7d666]{width:14px;height:14px;border:2px solid rgba(255,255,255,.25);border-top-color:var(--fg);border-radius:50%;animation:service-preview-spin-acf7d666 .8s linear infinite}@keyframes service-preview-spin-acf7d666{to{transform:rotate(360deg)}}@media (prefers-reduced-motion: reduce){.service-preview-reconnecting-spinner[data-v-acf7d666]{animation:none}}.service-preview-controls{position:relative;display:flex;align-items:center;gap:6px;padding:0;pointer-events:auto}.service-preview-port-form{position:absolute;top:34px;right:0;z-index:8;width:330px;padding:8px;display:flex;flex-direction:column;align-items:stretch;gap:6px;border:1px solid var(--border);border-radius:8px;background:var(--terminal-overlay);box-shadow:0 8px 24px #00000052}.service-preview-port-form button:not(.trigger){border:0;border-radius:5px;padding:4px 8px;color:var(--fg-dim);background:transparent;font:12px var(--font-mono);cursor:pointer}.service-preview-port-form button[type=submit]{color:var(--fg);background:#ffffff1a}.service-preview-port-form button:disabled{opacity:.55;cursor:default}.service-preview-host{width:100%}.service-preview-host .trigger{height:27px;padding:3px 7px;border-radius:5px;background:var(--bg);font:12px var(--font-mono)}.service-preview-host .menu{background:var(--terminal-overlay);font:12px var(--font-mono)}.service-preview-host .option{padding:6px 8px}.service-preview-mapping-row{display:grid;grid-template-columns:76px minmax(0,1fr) 24px;align-items:center;gap:5px}.service-preview-mapping-row input{width:auto;min-width:0}.service-preview-mapping-row input+input{width:auto}.service-preview-mapping-row.root-mapping{grid-template-columns:76px minmax(0,1fr)}.service-preview-path{color:var(--fg-dim);font:12px var(--font-mono)}.preview-add-mapping{white-space:nowrap}.service-preview-form-actions{display:flex;align-items:center;gap:4px}.service-preview-form-spacer{flex:1}.service-preview-port-form input{width:76px;border:1px solid var(--border);border-radius:5px;padding:3px 6px;color:var(--fg);background:var(--bg);font:12px var(--font-mono);outline:none}.service-preview-port-form input:focus{border-color:var(--accent)}.service-preview-port-form .service-preview-mapping-row input{width:100%}.template-bar[data-v-acf7d666]{position:absolute;left:0;right:0;bottom:0;height:30px;display:flex;align-items:center;gap:6px;overflow-x:auto;padding:2px 8px;border-top:1px solid var(--border);background:var(--panel);z-index:4;scrollbar-width:none}.template-bar[data-v-acf7d666]::-webkit-scrollbar{display:none}.aux-key-bar[data-v-acf7d666]{position:absolute;left:0;right:0;bottom:0;height:30px;display:flex;align-items:center;gap:6px;overflow:hidden;padding:2px 8px;border-top:1px solid var(--border);background:var(--panel);z-index:4}.aux-key-scroll[data-v-acf7d666]{min-width:0;flex:1 1 auto;height:100%;display:flex;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none}.aux-key-scroll[data-v-acf7d666]::-webkit-scrollbar{display:none}.file-picker-input[data-v-acf7d666]{display:none}.template-btn[data-v-acf7d666]{flex:0 0 auto;height:22px;padding:0 10px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);font-size:.76rem;font-family:var(--font-mono);cursor:pointer}.template-btn[data-v-acf7d666]:hover{border-color:var(--accent);color:var(--accent)}.aux-key-btn[data-v-acf7d666]{flex:0 0 auto;min-width:34px;height:22px;padding:0 9px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);font-size:.76rem;font-family:var(--font-mono);cursor:pointer}.aux-key-btn[data-v-acf7d666]:hover:not(:disabled){border-color:var(--accent);color:var(--accent)}.aux-key-btn[data-v-acf7d666]:disabled{color:var(--fg-dim);cursor:default;opacity:.55}.keyboard-toggle-btn[data-v-acf7d666]{min-width:76px;font-weight:600}.template-confirm-panel[data-v-acf7d666]{position:absolute;left:8px;right:8px;bottom:calc(60px + env(safe-area-inset-bottom));display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center;padding:7px;border:1px solid var(--border);border-radius:8px;background:var(--panel);z-index:6;box-shadow:0 8px 24px #0000004d}.template-confirm-copy[data-v-acf7d666]{min-width:0}.template-confirm-label[data-v-acf7d666]{color:var(--fg);font:600 .78rem var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-confirm-text[data-v-acf7d666]{margin-top:2px;color:var(--fg-dim);font:.72rem var(--font-mono);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.template-confirm-btn[data-v-acf7d666]{height:30px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:0 10px;cursor:pointer}.template-confirm-btn.primary[data-v-acf7d666]{border-color:var(--accent);color:var(--accent)}.paste-confirm-panel[data-v-acf7d666]{position:absolute;left:8px;right:8px;bottom:calc(30px + env(safe-area-inset-bottom));display:grid;grid-template-columns:1fr auto auto;gap:6px;align-items:center;padding:7px;border:1px solid var(--border);border-radius:8px;background:var(--panel);z-index:6;box-shadow:0 8px 24px #0000004d}.paste-confirm-input[data-v-acf7d666]{min-width:0;resize:vertical;border-radius:6px;border:1px solid var(--border);background:var(--terminal-bg);color:var(--fg);padding:6px 8px;font:.78rem var(--font-mono)}.paste-confirm-btn[data-v-acf7d666]{height:30px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);padding:0 10px;cursor:pointer}.paste-confirm-btn.primary[data-v-acf7d666]{border-color:var(--accent);color:var(--accent)}.paste-confirm-btn[data-v-acf7d666]:disabled{color:var(--fg-dim);border-color:var(--border);cursor:default;opacity:.55}.term[data-v-acf7d666] .xterm{padding:6px 8px}.term[data-v-acf7d666] .xterm-viewport{top:6px;right:8px;bottom:6px;left:8px;z-index:5;background:transparent!important;touch-action:pan-y;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}.term[data-v-acf7d666] .xterm-helper-textarea{caret-color:transparent}.overlay[data-v-acf7d666]{position:absolute;top:8px;right:12px;background:var(--terminal-overlay);border:1px solid var(--border);border-radius:6px;padding:4px 10px;font-size:12px;color:var(--fg-dim);pointer-events:none}.overlay.avoid-top-right-badge[data-v-acf7d666]{top:34px}.viewer-overlay[data-v-acf7d666]{position:absolute;top:0;right:0;bottom:0;left:0;background:#00000059;display:flex;align-items:center;justify-content:center;pointer-events:none;-webkit-user-select:none;user-select:none;z-index:5}.viewer-overlay-card[data-v-acf7d666]{background:var(--terminal-overlay);border:1px solid var(--border);border-radius:10px;padding:14px 22px;text-align:center;pointer-events:auto;box-shadow:0 10px 30px #00000059}.viewer-overlay-title[data-v-acf7d666]{font-size:14px;font-weight:600;color:var(--fg)}.viewer-overlay-host[data-v-acf7d666]{margin-top:4px;font-size:12px;color:var(--fg);font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;opacity:.85}.viewer-overlay-hint[data-v-acf7d666]{margin-top:6px;font-size:12px;color:var(--fg-dim)}.viewer-overlay-btn[data-v-acf7d666]{margin-top:8px;padding:6px 14px;border:none;border-radius:8px;background:#3b82f6;color:#fff;font-weight:600;pointer-events:auto;cursor:pointer}.overlay .warn[data-v-acf7d666]{color:#d29922}.overlay .bad[data-v-acf7d666]{color:var(--bad)}.overlay .dim[data-v-acf7d666]{color:var(--fg-dim)}.progress-track[data-v-acf7d666]{width:190px;height:4px;margin-top:6px;border-radius:999px;background:#94a3b83d;overflow:hidden}.progress-fill[data-v-acf7d666]{height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--accent),#4ade80);transition:width .12s ease}.term-context-menu[data-v-acf7d666]{position:fixed;min-width:150px;padding:6px;border-radius:8px;border:1px solid var(--border);background:#0d1117f5;box-shadow:0 10px 30px #00000059;z-index:1000}.term-context-item[data-v-acf7d666]{width:100%;border:none;background:transparent;color:var(--fg);text-align:left;padding:8px 10px;border-radius:6px;cursor:pointer}.term-context-item[data-v-acf7d666]:hover:not(:disabled){background:#ffffff0f}.term-context-item[data-v-acf7d666]:disabled{color:var(--fg-dim);cursor:default}.term-view.focused[data-v-acf7d666]{box-shadow:inset 0 0 0 1px var(--accent)}.pane-splitter[data-v-442ddd17]{position:absolute;z-index:5;background:transparent;-webkit-user-select:none;user-select:none;touch-action:none}.pane-splitter.col[data-v-442ddd17]{top:0;bottom:0;width:6px;cursor:col-resize}.pane-splitter.row[data-v-442ddd17]{left:0;right:0;height:6px;cursor:row-resize}.pane-splitter[data-v-442ddd17]:hover,.pane-splitter[data-v-442ddd17]:active{background:#ffffff14}.pane-grid[data-v-76c1e407]{position:absolute;top:0;right:0;bottom:0;left:0;display:grid;gap:2px;background:var(--terminal-grid)}.pane-grid.single[data-v-76c1e407]{grid-template:"a"}.cell[data-v-76c1e407]{position:relative;background:var(--terminal-bg);overflow:hidden}.cell.drop-target[data-v-76c1e407]{box-shadow:inset 0 0 0 2px var(--accent)}.cell.drop-target[data-v-76c1e407]:after{content:"";position:absolute;top:0;right:0;bottom:0;left:0;background:color-mix(in srgb,var(--accent) 12%,transparent);pointer-events:none}.term-host[data-v-76c1e407]{position:absolute;top:0;right:0;bottom:0;left:0}.empty[data-v-76c1e407]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--fg-dim);font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace}.cell-controls[data-v-76c1e407]{position:absolute;top:6px;right:8px;display:flex;align-items:center;gap:4px;z-index:6;pointer-events:none}.service-preview-controls-slot[data-v-76c1e407]{display:inline-flex;align-items:center;min-width:0;pointer-events:auto}.remote-badge[data-v-76c1e407]{display:inline-flex;align-items:center;gap:6px;background:#0d1117d9;border:1px solid var(--border);border-radius:10px;padding:2px 8px;font-size:11px;line-height:1.5;color:#d29922;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;-webkit-user-select:none;user-select:none;pointer-events:none}.remote-preview-trigger[data-v-76c1e407]{display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;padding:0;border:0;border-radius:4px;color:inherit;background:transparent;cursor:pointer;pointer-events:auto}.remote-preview-trigger[data-v-76c1e407]:hover{color:var(--fg);background:#ffffff1a}.remote-preview-trigger svg[data-v-76c1e407]{display:block}.remote-badge svg[data-v-76c1e407]{display:block}.viewers-badge[data-v-76c1e407]{position:absolute;top:4px;right:4px;display:inline-flex;align-items:center;gap:4px;padding:1px 6px;border-radius:6px;background:#0000008c;color:var(--fg);font-size:11px;pointer-events:none}.viewers-badge svg[data-v-76c1e407]{display:block}.remote-badge .who[data-v-76c1e407]{font-weight:600}.remote-badge .who.dim[data-v-76c1e407],.remote-badge .sid[data-v-76c1e407]{color:var(--fg-dim);font-weight:400}.remote-badge .sid[data-v-76c1e407]:before{content:"·";margin-right:4px}.close-pane[data-v-76c1e407]{border:none;background:#0d1117b3;color:var(--fg-dim);font-size:14px;line-height:1;padding:2px 6px;border-radius:4px;cursor:pointer;opacity:0;pointer-events:auto;transition:opacity .12s,background .12s,color .12s}.cell:hover .close-pane[data-v-76c1e407]{opacity:1}.pane-grip[data-v-76c1e407]{opacity:0;transition:opacity .1s;cursor:grab;pointer-events:auto;-webkit-user-drag:element;padding:0 3px;font-size:12px;line-height:1;color:var(--fg-dim);-webkit-user-select:none;user-select:none}.pane-grip[data-v-76c1e407]:active{cursor:grabbing}.cell:hover .pane-grip[data-v-76c1e407]{opacity:1}@media (hover: none){.pane-grip[data-v-76c1e407]{display:none}}.close-pane[data-v-76c1e407]:hover{background:#f851492e;color:var(--bad)}.create-form[data-v-b7ce3097]{margin-bottom:1rem}.field[data-v-b7ce3097]{display:flex;flex-direction:column;gap:.25rem}.field-label[data-v-b7ce3097]{font-size:.75rem;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.06em}.secret-alert[data-v-b7ce3097]{margin:.5rem 0}.secret-msg[data-v-b7ce3097]{color:var(--fg-dim);font-size:.85rem;margin-bottom:.5rem}.secret-display[data-v-b7ce3097]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;color:var(--good);word-break:break-all;display:block;padding:.25rem 0}.empty[data-v-b7ce3097]{color:var(--fg-dim);font-size:.875rem;margin:.5rem 0 0}.secret-alert[data-v-b54d534a]{margin-bottom:.5rem}.secret-msg[data-v-b54d534a]{color:var(--fg-dim);font-size:.85rem;margin-bottom:.5rem}.secret-display[data-v-b54d534a]{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.85rem;color:var(--good);word-break:break-all;display:block;padding:.25rem 0}.form-error[data-v-b54d534a]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.hint[data-v-be878b2d]{color:var(--fg-dim);font-size:.875rem;margin:0 0 1rem}.muted[data-v-be878b2d]{color:var(--fg-dim);font-size:.875rem}.warn[data-v-be878b2d]{color:var(--warn, #d89614);font-size:.8125rem}.actions[data-v-be878b2d]{margin-top:1rem}.version code[data-v-be878b2d]{color:var(--fg)}.form-error[data-v-be878b2d]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.hint[data-v-b32379d1]{color:var(--fg-dim);font-size:.875rem;margin:0 0 1rem}.muted[data-v-b32379d1]{color:var(--fg-dim);font-size:.875rem}.warn[data-v-b32379d1]{color:var(--warn, #d89614);font-size:.8125rem}.actions[data-v-b32379d1]{margin-top:1rem}.form-error[data-v-b32379d1]{color:var(--bad);font-size:.875rem;margin:.5rem 0 0}.traffic[data-v-2ace187f]{display:flex;flex-direction:column;gap:16px}.empty[data-v-2ace187f]{color:var(--fg-dim)}.admin-panel[data-v-99471adc]{display:flex;flex-direction:column;height:100%;min-height:0}.admin-tabs[data-v-99471adc]{display:flex;gap:2px;padding:8px 12px 0;border-bottom:1px solid var(--border);flex:0 0 auto}.admin-tabs button[data-v-99471adc]{background:transparent;border:none;border-bottom:2px solid transparent;color:var(--fg-dim);padding:8px 12px;cursor:pointer;font-size:13px}.admin-tabs button[data-v-99471adc]:hover{color:var(--fg)}.admin-tabs button.active[data-v-99471adc]{color:var(--accent);border-bottom-color:var(--accent);font-weight:600}.admin-body[data-v-99471adc]{flex:1 1 auto;min-height:0;overflow-y:auto;padding:20px 24px}.terminal-appearance[data-v-e31f8f67]{display:flex;flex-direction:column;gap:14px}.field-label[data-v-e31f8f67]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.hint[data-v-e31f8f67]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.error[data-v-e31f8f67]{color:var(--bad);font-size:12px;margin:0}.checkbox[data-v-e31f8f67]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.number-input[data-v-e31f8f67]{width:80px;padding:4px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.settings-field-grid .number-input[data-v-e31f8f67]{width:100%}.cursor-blink[data-v-e31f8f67]{min-height:18px}.scrollback-field[data-v-e31f8f67]{align-items:flex-start}.tab-pane[data-v-e7440565]{display:flex;flex-direction:column;gap:14px}.field-label[data-v-e7440565]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.hint[data-v-e7440565]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.error[data-v-e7440565]{color:var(--bad);font-size:12px;margin:0}.checkbox[data-v-e7440565]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.number-input[data-v-e7440565]{width:80px;padding:4px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.text-input[data-v-e7440565]{padding:6px 8px;background:var(--bg);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.custom-shell-row[data-v-e7440565]{display:flex;gap:8px}.custom-shell-row .text-input[data-v-e7440565]{flex:1 1 auto}.custom-shell-row button[data-v-e7440565]{padding:6px 10px;background:var(--panel);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit}.push-section[data-v-e7440565]{display:flex;flex-direction:column;gap:8px;padding-top:14px;border-top:1px solid var(--border)}.section-title[data-v-e7440565]{margin:0;font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.push-test-button[data-v-e7440565]{align-self:flex-start;padding:6px 10px;background:var(--panel);border:1px solid var(--border);border-radius:4px;color:var(--fg);font:inherit;cursor:pointer}.push-test-button[data-v-e7440565]:disabled{opacity:.5;cursor:not-allowed}.pair-consume[data-v-285ce5b2]{display:flex;flex-direction:column;align-items:flex-start;gap:10px;padding:12px;border:1px solid var(--border);border-radius:6px;background:#ffffff08}.pending[data-v-285ce5b2],.pair-error[data-v-285ce5b2]{display:flex;flex-direction:column;gap:6px;color:var(--fg-dim);font-size:13px}.pending p[data-v-285ce5b2],.pair-error p[data-v-285ce5b2]{margin:0}.step[data-v-285ce5b2],.elapsed[data-v-285ce5b2],.code[data-v-285ce5b2]{font-family:var(--font-mono);font-size:12px}.code[data-v-285ce5b2]{color:var(--bad)}.cancel[data-v-285ce5b2],.pair-error button[data-v-285ce5b2]{align-self:flex-start}.tab-pane[data-v-55932ce0]{display:flex;flex-direction:column;gap:12px}.account-section[data-v-55932ce0]{display:flex;flex-direction:column;gap:8px;padding-bottom:16px;border-bottom:1px solid var(--border)}.account-section[data-v-55932ce0]:last-child{border-bottom:none;padding-bottom:0}.account-section h3[data-v-55932ce0]{margin:0 0 4px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.field-label[data-v-55932ce0]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.email-value[data-v-55932ce0]{margin:0;color:var(--fg);font-size:13px}.hint[data-v-55932ce0]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.5}.warning-text[data-v-55932ce0]{color:var(--bad)}.error[data-v-55932ce0]{color:var(--bad);font-size:12px;margin:0}.success[data-v-55932ce0]{color:var(--good);font-size:12px;margin:0}.relay-url-row[data-v-55932ce0]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px}.checkbox-row[data-v-55932ce0]{display:flex;align-items:center;justify-content:space-between;gap:12px;color:var(--fg-dim);font-size:12px}.checkbox-row input[data-v-55932ce0]{flex:0 0 auto}.inline-error[data-v-55932ce0]{color:var(--bad);font-size:12px;margin:0}input[type=text][data-v-55932ce0],input[type=email][data-v-55932ce0],select[data-v-55932ce0],input[type=password][data-v-55932ce0]{height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}input[data-v-55932ce0]:focus{outline:none;box-shadow:0 0 0 2px var(--accent)}button.secondary[data-v-55932ce0]{align-self:flex-start;background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}button.secondary[data-v-55932ce0]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}button.secondary[data-v-55932ce0]:disabled{opacity:.5;cursor:not-allowed}button.primary-action[data-v-55932ce0]{background:var(--accent);border-color:var(--accent);color:#0d1117;font-weight:600}button.primary-action[data-v-55932ce0]:hover:not(:disabled){background:#79b8ff;color:#0d1117}.danger-btn[data-v-55932ce0]{align-self:flex-start;background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.danger-btn[data-v-55932ce0]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-55932ce0]:disabled{opacity:.5;cursor:not-allowed}.pairing-panel[data-v-45575575]{display:flex;flex-direction:column;gap:10px;padding:12px;border:1px solid var(--border);border-radius:10px}.title[data-v-45575575]{font-size:13px;font-weight:700;color:var(--fg)}.hint[data-v-45575575]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.45}.qr-wrap[data-v-45575575]{display:flex;flex-direction:column;align-items:center;gap:8px}.qr[data-v-45575575]{width:240px;height:240px;image-rendering:pixelated;background:#fff;padding:6px;border-radius:6px}.qr.dimmed[data-v-45575575]{opacity:.35}.countdown[data-v-45575575]{font-size:12px;color:var(--fg-dim)}.countdown.expired[data-v-45575575]{color:var(--bad)}.wrap-badge[data-v-45575575]{font-size:11px;color:var(--fg-dim);padding:2px 8px;border:1px solid var(--border);border-radius:4px}.wrap-warning[data-v-45575575]{font-size:11px;color:var(--warn);background:#ffc8000f;border-left:2px solid var(--warn);padding:6px 10px;margin:0;line-height:1.4;text-align:left;max-width:240px}.prefix[data-v-45575575]{font-family:ui-monospace,Menlo,monospace;font-size:11px;color:var(--fg-dim)}.error[data-v-45575575]{color:var(--bad);font-size:12px;margin:0}button[data-v-45575575]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}button[data-v-45575575]:disabled{opacity:.55}.url-label-row[data-v-100947b5]{display:flex;align-items:center;justify-content:space-between;gap:10px}.insecure-inline[data-v-100947b5]{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:var(--fg-dim);text-transform:none;letter-spacing:normal;cursor:pointer;-webkit-user-select:none;user-select:none}.insecure-inline input[type=checkbox][data-v-100947b5]{margin:0}.url-input[data-v-100947b5]{display:flex;align-items:stretch;border:1px solid var(--border);border-radius:6px;overflow:hidden;background:var(--bg)}.url-input[data-v-100947b5]:focus-within{box-shadow:0 0 0 2px var(--accent)}.url-scheme[data-v-100947b5]{display:inline-flex;align-items:center;padding:0 8px;font-size:13px;color:var(--fg-dim);background:color-mix(in srgb,var(--fg-dim) 12%,transparent 88%);border-right:1px solid var(--border);-webkit-user-select:none;user-select:none;white-space:nowrap}.url-input.insecure .url-scheme[data-v-100947b5]{color:var(--warn, #d97706)}.url-input input[data-v-100947b5]{flex:1;border:0;border-radius:0;background:transparent;min-width:0}.url-input input[data-v-100947b5]:focus{box-shadow:none}.auth-switch[data-v-100947b5]{-webkit-appearance:none;-moz-appearance:none;appearance:none;align-self:flex-start;background:transparent;border:0;padding:0;margin:-4px 0 0;font:inherit;font-size:12px;color:var(--fg-dim);cursor:pointer}.auth-switch[data-v-100947b5]:disabled{cursor:not-allowed;opacity:.5}.auth-switch-action[data-v-100947b5]{color:var(--accent);text-decoration:underline;text-underline-offset:2px}.auth-switch:hover:not(:disabled) .auth-switch-action[data-v-100947b5]{text-decoration:none}.tab-pane[data-v-100947b5]{display:flex;flex-direction:column;gap:12px}.dim[data-v-100947b5]{color:var(--fg-dim);font-size:13px}.uplink-toggle-row[data-v-100947b5]{display:flex;align-items:center;gap:10px}.toggle-switch[data-v-100947b5]{display:inline-flex;align-items:center;gap:6px;cursor:pointer;-webkit-user-select:none;user-select:none}.toggle-switch.disabled[data-v-100947b5]{opacity:.5;cursor:not-allowed}.toggle-switch input[type=checkbox][data-v-100947b5]{position:absolute;opacity:0;width:0;height:0}.toggle-track[data-v-100947b5]{position:relative;display:inline-block;width:32px;height:18px;background:var(--fg-dim);border-radius:9px;transition:background .15s}.toggle-switch input:checked+.toggle-track[data-v-100947b5]{background:var(--good)}.toggle-thumb[data-v-100947b5]{position:absolute;top:2px;left:2px;width:14px;height:14px;background:var(--fg);border-radius:50%;transition:transform .15s}.toggle-switch input:checked+.toggle-track .toggle-thumb[data-v-100947b5]{transform:translate(14px)}.toggle-label[data-v-100947b5]{font-size:12px;color:var(--fg-dim);min-width:2.2em}.status-pill[data-v-100947b5]{display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid var(--border);border-radius:999px;font-size:12px;width:max-content}.status-pill .dot[data-v-100947b5]{font-size:10px;line-height:1}.status-pill.on .dot[data-v-100947b5]{color:var(--good)}.status-pill.off .dot[data-v-100947b5]{color:var(--fg-dim)}.status-pill.on[data-v-100947b5]{color:var(--good)}.status-pill.off[data-v-100947b5]{color:var(--fg-dim)}.status-pill.warn[data-v-100947b5],.status-pill.warn .dot[data-v-100947b5]{color:var(--warn, #d97706)}.status-pill.error[data-v-100947b5],.status-pill.error .dot[data-v-100947b5]{color:var(--bad)}.hint[data-v-100947b5]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.field-label[data-v-100947b5]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.05em}.checkbox[data-v-100947b5]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.error[data-v-100947b5]{color:var(--bad);font-size:12px;margin:0}.warning[data-v-100947b5]{color:var(--bad);font-size:12px;line-height:1.45;margin:0}input[type=text][data-v-100947b5],input[type=email][data-v-100947b5],input[type=password][data-v-100947b5]{height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}input[data-v-100947b5]:focus{outline:none;box-shadow:0 0 0 2px var(--accent)}.password-field[data-v-100947b5]{position:relative;display:block}.password-field input[data-v-100947b5]{width:100%;padding-right:36px}.password-toggle[data-v-100947b5]{position:absolute;top:50%;right:8px;transform:translateY(-50%);display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;padding:0;border:0;background:transparent;color:var(--fg-dim);border-radius:4px;cursor:pointer;transition:color .15s ease,background .15s ease}.password-toggle[data-v-100947b5]:hover:not(:disabled){color:var(--fg);background:color-mix(in srgb,var(--accent) 12%,transparent 88%)}.password-toggle[data-v-100947b5]:focus-visible{outline:2px solid var(--accent);outline-offset:1px}.password-toggle[data-v-100947b5]:disabled{opacity:.4;cursor:not-allowed}.danger-zone[data-v-100947b5]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-top:8px;padding-top:12px;border-top:1px solid var(--border)}.danger-zone-text[data-v-100947b5]{flex:1;min-width:0}.danger-btn[data-v-100947b5]{align-self:flex-start;background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.danger-btn[data-v-100947b5]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-100947b5]:disabled{opacity:.5;cursor:not-allowed}.log-lines[data-v-c9e8e2b4]{font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:11px;line-height:1.45;white-space:pre-wrap;word-break:break-word}.log-line[data-v-c9e8e2b4]{display:block}.ts[data-v-c9e8e2b4]{color:var(--fg-dim);margin-right:6px}.lvl[data-v-c9e8e2b4]{margin-right:6px;font-weight:700}.tag[data-v-c9e8e2b4]{color:var(--accent);margin-right:6px}.msg[data-v-c9e8e2b4]{color:var(--fg)}.raw[data-v-c9e8e2b4],.lvl-DEBUG .lvl[data-v-c9e8e2b4],.lvl-DEBUG .msg[data-v-c9e8e2b4]{color:var(--fg-dim)}.lvl-INFO .lvl[data-v-c9e8e2b4]{color:var(--fg)}.lvl-WARN .lvl[data-v-c9e8e2b4],.lvl-WARN .msg[data-v-c9e8e2b4]{color:var(--warn, #d2a86a)}.lvl-ERROR .lvl[data-v-c9e8e2b4],.lvl-ERROR .msg[data-v-c9e8e2b4]{color:var(--bad)}.tab-pane[data-v-cd8d05fa]{display:flex;flex-direction:column;gap:14px}.dim[data-v-cd8d05fa]{color:var(--fg-dim);font-size:13px}.checkbox[data-v-cd8d05fa]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.checkbox-row[data-v-cd8d05fa]{display:flex;align-items:center;gap:6px}.level-row[data-v-cd8d05fa]{display:flex;align-items:center;gap:8px}.level-label[data-v-cd8d05fa]{font-size:13px;color:var(--fg)}.level-select[data-v-cd8d05fa]{width:104px}.info-icon[data-v-cd8d05fa]{display:inline-flex;align-items:center;justify-content:center;width:14px;height:14px;border:1px solid var(--fg-dim);border-radius:50%;color:var(--fg-dim);font-size:10px;font-style:italic;line-height:1;cursor:help;-webkit-user-select:none;user-select:none}.info-icon[data-v-cd8d05fa]:hover{color:var(--fg);border-color:var(--fg)}.kv[data-v-cd8d05fa]{display:flex;align-items:flex-start;gap:12px;font-size:12px}.kv .k[data-v-cd8d05fa]{color:var(--fg-dim);width:130px}.kv .v[data-v-cd8d05fa]{color:var(--fg)}.kv .path[data-v-cd8d05fa]{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.actions[data-v-cd8d05fa]{display:flex;gap:8px}.error[data-v-cd8d05fa]{color:var(--bad);font-size:12px;margin:0}button[data-v-cd8d05fa]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}button[data-v-cd8d05fa]:hover{background:#ffffff0a}.tail-wrap[data-v-cd8d05fa]{display:flex;flex-direction:column;gap:6px;margin-top:4px}.tail-header[data-v-cd8d05fa]{display:flex;align-items:center;gap:8px}.tail-label[data-v-cd8d05fa]{font-size:12px;color:var(--fg-dim);text-transform:uppercase;letter-spacing:.04em;flex:1 1 auto}.tail-refresh[data-v-cd8d05fa]{height:24px;padding:2px 10px;font-size:12px}.tail-paused[data-v-cd8d05fa]{height:24px;padding:2px 10px;font-size:12px;flex:0 0 auto;color:var(--accent);border-color:var(--accent)}.tail-level[data-v-cd8d05fa]{width:104px;flex:0 0 auto}.tail-tag[data-v-cd8d05fa]{width:152px;flex:0 0 auto}.tail-empty[data-v-cd8d05fa]{color:var(--fg-dim);font-size:12px;margin:0}.tail-error[data-v-cd8d05fa]{color:var(--bad);font-size:12px;margin:0}.tail-content[data-v-cd8d05fa]{margin:0;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px;color:var(--fg);font-size:11px;line-height:1.45;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;max-height:280px;overflow:auto;white-space:pre-wrap;word-break:break-word}.tab-pane[data-v-c859d0af]{display:flex;flex-direction:column;gap:14px}.dim[data-v-c859d0af]{color:var(--fg-dim);font-size:13px}.grid[data-v-c859d0af]{display:grid;gap:6px;font-size:12px}.kv[data-v-c859d0af]{display:flex;align-items:flex-start;gap:12px}.kv .k[data-v-c859d0af]{color:var(--fg-dim);width:130px}.kv .v[data-v-c859d0af]{color:var(--fg)}.kv .path[data-v-c859d0af]{flex:1;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.checkbox[data-v-c859d0af]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.proxy-box[data-v-c859d0af]{display:grid;gap:6px}.field-label[data-v-c859d0af]{color:var(--fg-dim);font-size:12px}.proxy-row[data-v-c859d0af]{display:flex;gap:8px}.proxy-row input[data-v-c859d0af]{flex:1;min-width:0;height:32px;padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font:inherit;font-size:13px}.hint[data-v-c859d0af]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.4}.notes[data-v-c859d0af]{font-size:12px;color:var(--fg)}.notes summary[data-v-c859d0af]{color:var(--fg-dim);cursor:pointer}.notes pre[data-v-c859d0af]{background:var(--bg);border:1px solid var(--border);padding:8px;border-radius:6px;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;max-height:160px;overflow-y:auto;font-size:11px}.version-lines[data-v-c859d0af]{display:grid;gap:6px;font-size:13px;color:var(--fg)}.version-line label[data-v-c859d0af]{display:flex;align-items:center;gap:8px;cursor:pointer}.actions[data-v-c859d0af]{display:flex;gap:8px}.error[data-v-c859d0af]{color:var(--bad);font-size:12px;margin:0}button[data-v-c859d0af]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}button[data-v-c859d0af]:hover:not(:disabled){background:#ffffff0a}button[data-v-c859d0af]:disabled{opacity:.5;cursor:default}button.primary[data-v-c859d0af]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}button.primary[data-v-c859d0af]:hover:not(:disabled){background:#79b8ff;border-color:#79b8ff}button.primary.danger[data-v-c859d0af]{background:var(--bad);color:#0d1117;border-color:var(--bad)}button.primary.danger[data-v-c859d0af]:hover:not(:disabled){background:#ff6f6a;border-color:#ff6f6a}button.secondary[data-v-c859d0af]{background:transparent;color:var(--fg-dim);border:1px solid var(--border)}button.secondary[data-v-c859d0af]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}.translate-settings[data-v-2b2be568]{margin-top:8px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px;display:flex;flex-direction:column;gap:8px}.translate-settings label[data-v-2b2be568]{display:flex;flex-direction:column;gap:3px}.translate-settings label span[data-v-2b2be568]{opacity:.7;font-size:11px}.translate-settings input[data-v-2b2be568],.translate-settings select[data-v-2b2be568]{background:#00000040;color:inherit;border:1px solid #2d333b;border-radius:3px;padding:4px 6px;font-size:12px}.extra-params[data-v-2b2be568]{background:#00000040;color:inherit;border:1px solid #2d333b;border-radius:3px;padding:4px 6px;font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;resize:vertical;min-height:56px}.extra-params-error[data-v-2b2be568]{color:#f87171;font-size:11px}.hint[data-v-2b2be568]{opacity:.55;font-size:11px}.muted[data-v-2b2be568]{opacity:.55;font-size:11px;margin:4px 0 0}.settings-plugins[data-v-a25af5cc]{padding:12px 16px;color:var(--settings-fg, #c9d1d9)}.hint[data-v-a25af5cc]{margin:0 0 12px;font-size:12px;opacity:.7}.plugin-list[data-v-a25af5cc]{list-style:none;margin:0;padding:0}.plugin-row[data-v-a25af5cc]{border:1px solid #2d333b;border-radius:6px;padding:10px 12px;margin-bottom:8px}.row-head[data-v-a25af5cc]{display:flex;align-items:center;gap:8px;font-weight:600}.desc[data-v-a25af5cc]{margin:6px 0 0 24px;font-size:12px;opacity:.7}.empty[data-v-a25af5cc]{font-size:12px;opacity:.5}.fe-settings[data-v-a25af5cc]{margin-top:8px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px;display:flex;flex-direction:column;gap:6px}.fe-settings label[data-v-a25af5cc]{display:inline-flex;align-items:center;gap:6px}.fe-settings .muted[data-v-a25af5cc]{margin:6px 0 0;opacity:.6;font-size:11px}.widget-settings[data-v-a25af5cc]{margin:8px 0 0 24px;padding-top:8px;border-top:1px solid #2d333b;font-size:12px}.widget-settings label[data-v-a25af5cc]{display:inline-flex;align-items:center;gap:6px}.widget-settings .muted[data-v-a25af5cc]{margin:6px 0 0;opacity:.6;font-size:11px}.hotkey-cell[data-v-80cabc38]{font-family:SF Mono,Menlo,monospace;font-size:12px;background:#0d1117;border:1px solid #2d333b;color:#c9d1d9;padding:3px 8px;border-radius:4px;cursor:pointer;min-width:160px;text-align:left}.hotkey-cell[data-v-80cabc38]:hover{background:#161b22}.hotkey-cell.capturing[data-v-80cabc38]{background:#58a6ff1f;border-color:var(--accent);color:var(--accent)}.hotkey-cell.empty[data-v-80cabc38]{color:#6e7681;font-style:italic}.shortcut-settings[data-v-05d9d72b]{padding:8px 4px;font-size:12px;color:var(--fg)}.shortcut-group[data-v-05d9d72b]{margin-bottom:18px}.shortcut-group h3[data-v-05d9d72b]{margin:4px 0 8px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.shortcut-row[data-v-05d9d72b]{display:grid;grid-template-columns:1fr auto auto;align-items:center;gap:8px;padding:4px 0}.label[data-v-05d9d72b]{color:var(--fg)}.reset-row[data-v-05d9d72b]{background:transparent;border:1px solid #2d333b;color:var(--fg-dim);padding:2px 8px;border-radius:4px;cursor:pointer}.reset-row[data-v-05d9d72b]:hover{background:#ffffff0a;color:var(--fg)}.conflict[data-v-05d9d72b]{grid-column:1 / -1;color:#f85149;font-size:11px;padding-left:4px}.actions-row[data-v-05d9d72b]{display:flex;gap:8px;margin-top:12px;align-items:center}.spacer[data-v-05d9d72b]{flex:1}.actions-row button[data-v-05d9d72b]{background:#21262d;border:1px solid #2d333b;color:#c9d1d9;padding:4px 12px;border-radius:4px;cursor:pointer}.actions-row button[data-v-05d9d72b]:disabled{opacity:.4;cursor:default}.actions-row .save[data-v-05d9d72b]{background:var(--accent);color:#0d1117;border-color:var(--accent)}.actions-row .save[data-v-05d9d72b]:disabled{background:#21262d;color:#c9d1d9;border-color:#2d333b}.error[data-v-05d9d72b]{color:#f85149;font-size:12px;margin:8px 0 0}@media (max-width: 640px){.shortcut-row[data-v-05d9d72b]{grid-template-columns:minmax(0,1fr) minmax(0,140px) auto}.shortcut-row[data-v-05d9d72b] .hotkey-cell{min-width:0;width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions-row[data-v-05d9d72b]{flex-wrap:wrap}}.diag[data-v-1a4e377a]{display:flex;flex-direction:column;gap:10px}.hint[data-v-1a4e377a]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.preview[data-v-1a4e377a]{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:10px;font-family:ui-monospace,Menlo,monospace;font-size:11px;line-height:1.4;max-height:320px;overflow:auto;white-space:pre;color:var(--fg);margin:0}.row[data-v-1a4e377a]{display:flex;gap:8px;align-items:center}button[data-v-1a4e377a]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}.status[data-v-1a4e377a]{font-size:12px;color:var(--fg-dim)}.configio[data-v-9ef7411c]{display:flex;flex-direction:column;gap:16px;margin-top:12px;padding-top:12px;border-top:1px solid var(--border)}.configio-section[data-v-9ef7411c]{display:flex;flex-direction:column;gap:8px}.section-title[data-v-9ef7411c]{margin:0;font-size:13px}.hint[data-v-9ef7411c]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.checkbox[data-v-9ef7411c]{display:flex;align-items:center;gap:6px;font-size:12px}.row[data-v-9ef7411c]{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.status[data-v-9ef7411c]{font-size:12px;color:var(--fg-dim)}.status.error[data-v-9ef7411c]{color:var(--bad)}.file-input[data-v-9ef7411c]{display:none}.configio-preview[data-v-9ef7411c],.configio-report[data-v-9ef7411c]{border:1px solid var(--border);border-radius:6px;padding:10px;background:var(--bg);display:flex;flex-direction:column;gap:6px}.configio-preview h5[data-v-9ef7411c],.configio-report h5[data-v-9ef7411c]{margin:0;font-size:12px}.configio-preview h6[data-v-9ef7411c],.configio-report h6[data-v-9ef7411c]{margin:4px 0 2px;font-size:11px;color:var(--fg-dim)}.configio-preview ul[data-v-9ef7411c],.configio-report ul[data-v-9ef7411c]{margin:0;padding-left:18px;font-size:12px}button[data-v-9ef7411c]{height:30px;border:1px solid var(--accent);border-radius:7px;background:var(--accent);color:var(--bg);padding:0 12px;font-size:12px;font-weight:700;cursor:pointer}button[data-v-9ef7411c]:disabled{opacity:.5;cursor:default}.snippet-run-overlay[data-v-ca33db20]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:60}.snippet-run-panel[data-v-ca33db20]{background:#11182b;border:1px solid #1e2638;border-radius:11px;padding:16px 18px;min-width:360px;max-width:560px;max-height:80vh;overflow-y:auto;display:flex;flex-direction:column;gap:12px;color:#e6e7ea}.hint[data-v-ca33db20]{font-size:12px;color:var(--fg-dim);margin:0}.host-list[data-v-ca33db20]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px;max-height:40vh;overflow-y:auto}.host-list label[data-v-ca33db20]{display:flex;align-items:center;gap:8px;font-size:.85rem}.rows[data-v-ca33db20]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:8px}.row[data-v-ca33db20]{border:1px solid var(--border);border-radius:6px;padding:8px 10px;background:var(--bg);display:flex;flex-direction:column;gap:4px}.row-head[data-v-ca33db20]{display:flex;justify-content:space-between;align-items:center;gap:8px}.row-host[data-v-ca33db20]{font-weight:600;font-family:var(--font-mono);font-size:.85rem}.row-state[data-v-ca33db20]{font-size:.78rem}.row.state-ok .row-state[data-v-ca33db20]{color:var(--good, #3fb950)}.row.state-failed .row-state[data-v-ca33db20],.row.state-error .row-state[data-v-ca33db20]{color:var(--bad)}.row.state-running .row-state[data-v-ca33db20]{color:var(--accent)}.row-exitcode[data-v-ca33db20]{font-size:.74rem;color:var(--fg-dim);font-family:var(--font-mono)}.row-output[data-v-ca33db20]{font-family:var(--font-mono);font-size:.76rem;white-space:pre-wrap;word-break:break-word;background:#ffffff08;border-radius:4px;padding:6px 8px;margin:0;max-height:30vh;overflow-y:auto}.row-truncated[data-v-ca33db20]{font-size:.72rem;color:var(--fg-dim);margin:0;font-style:italic}.error[data-v-ca33db20]{color:var(--bad);font-size:.75rem;margin:0}.footer[data-v-ca33db20]{display:flex;gap:8px;justify-content:flex-end}.footer .primary[data-v-ca33db20]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.tab-pane[data-v-d57ad1d6]{display:flex;flex-direction:column;gap:10px}.hint[data-v-d57ad1d6]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.show-toggle[data-v-d57ad1d6]{display:inline-flex;align-items:center;gap:8px;font-size:13px;color:var(--fg)}.list[data-v-d57ad1d6]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.row[data-v-d57ad1d6]{display:grid;grid-template-columns:7rem 1fr 5rem auto;gap:8px;align-items:center;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:6px}.label[data-v-d57ad1d6]{font-weight:600;font-family:var(--font-mono);font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.text[data-v-d57ad1d6]{font-family:var(--font-mono);font-size:.78rem;color:var(--fg-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hotkey[data-v-d57ad1d6]{font-family:var(--font-mono);font-size:.74rem;color:var(--fg-dim);text-align:center}.actions[data-v-d57ad1d6]{display:flex;gap:4px}.actions button[data-v-d57ad1d6]{height:24px;padding:0 8px;font-size:.74rem}.actions .del[data-v-d57ad1d6]{color:var(--bad);border-color:#f8514966}.edit-row[data-v-d57ad1d6]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--panel);border:1px solid var(--accent);border-radius:6px}.edit-top[data-v-d57ad1d6]{display:grid;grid-template-columns:1fr 8rem;gap:8px}.edit-row input[data-v-d57ad1d6],.edit-row textarea[data-v-d57ad1d6]{padding:6px 8px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:4px;font-size:.85rem;font-family:var(--font-mono);width:100%;box-sizing:border-box}.edit-row input[data-v-d57ad1d6]{height:28px}.edit-row textarea[data-v-d57ad1d6]{resize:vertical;min-height:60px;line-height:1.4}.edit-actions[data-v-d57ad1d6]{display:flex;gap:6px;justify-content:flex-end}.edit-actions button[data-v-d57ad1d6]{height:28px;padding:0 14px;font-size:.78rem}.edit-actions .primary[data-v-d57ad1d6]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.footer[data-v-d57ad1d6]{display:flex;gap:8px;align-items:center}.error[data-v-d57ad1d6]{color:var(--bad);font-size:.75rem}.dialog-backdrop[data-v-d57ad1d6]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0000008c;display:flex;align-items:center;justify-content:center;z-index:50}.dialog[data-v-d57ad1d6]{background:#11182b;padding:14px 18px;border:1px solid #1e2638;border-radius:11px;max-width:320px;display:flex;flex-direction:column;gap:10px;color:#e6e7ea}@media (max-width: 640px){.row[data-v-d57ad1d6]{grid-template-columns:minmax(0,1fr) auto}.text[data-v-d57ad1d6]{grid-column:1 / -1;grid-row:2}.hotkey[data-v-d57ad1d6]{grid-column:2;grid-row:1}.actions[data-v-d57ad1d6]{grid-column:1 / -1;flex-wrap:wrap}.edit-top[data-v-d57ad1d6]{grid-template-columns:minmax(0,1fr)}}.tab-pane[data-v-41aa374f]{display:flex;flex-direction:column;gap:10px}.hint[data-v-41aa374f]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.list[data-v-41aa374f]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.row[data-v-41aa374f]{display:grid;grid-template-columns:9rem 1fr 1fr auto;gap:8px;align-items:center;padding:8px 10px;background:var(--bg);border:1px solid var(--border);border-radius:6px}.name[data-v-41aa374f]{font-weight:600;font-size:.85rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:flex;align-items:center;gap:6px}.badge[data-v-41aa374f]{font-size:.65rem;font-weight:600;text-transform:uppercase;letter-spacing:.04em;color:var(--accent);border:1px solid var(--accent);border-radius:3px;padding:1px 4px}.detail[data-v-41aa374f]{font-family:var(--font-mono);font-size:.78rem;color:var(--fg-dim);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions[data-v-41aa374f]{display:flex;gap:4px}.actions button[data-v-41aa374f]{height:24px;padding:0 8px;font-size:.74rem}.actions .del[data-v-41aa374f]{color:var(--bad);border-color:#f8514966}.edit-row[data-v-41aa374f]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--panel);border:1px solid var(--accent);border-radius:6px}.edit-input[data-v-41aa374f]{padding:6px 8px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:4px;font-size:.85rem;font-family:var(--font-mono);width:100%;box-sizing:border-box;height:28px}.edit-textarea[data-v-41aa374f]{height:auto;resize:vertical;min-height:60px;line-height:1.4}.checkbox[data-v-41aa374f]{display:flex;align-items:center;gap:6px;font-size:13px;color:var(--fg)}.edit-actions[data-v-41aa374f]{display:flex;gap:6px;justify-content:flex-end}.edit-actions button[data-v-41aa374f]{height:28px;padding:0 14px;font-size:.78rem}.edit-actions .primary[data-v-41aa374f]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.footer[data-v-41aa374f]{display:flex;gap:8px;align-items:center}.error[data-v-41aa374f]{color:var(--bad);font-size:.75rem}@media (max-width: 640px){.row[data-v-41aa374f]{grid-template-columns:repeat(2,minmax(0,1fr))}.name[data-v-41aa374f]{grid-column:1 / -1}.actions[data-v-41aa374f]{grid-column:1 / -1;flex-wrap:wrap;justify-content:flex-end}}.section-title[data-v-d7749d1b]{font-size:14px;font-weight:500;margin:0 0 12px}.preset-list[data-v-d7749d1b]{display:flex;flex-direction:column;gap:12px;margin-bottom:16px}.preset-option[data-v-d7749d1b]{display:flex;gap:10px;padding:10px;border:1px solid rgba(255,255,255,.08);border-radius:4px;cursor:pointer}.preset-option[data-v-d7749d1b]:hover{background:#ffffff08}.preset-name[data-v-d7749d1b]{font-weight:500}.preset-desc[data-v-d7749d1b]{font-size:12px;opacity:.7;margin:4px 0}.preset-preview[data-v-d7749d1b]{display:flex;gap:10px;margin-top:6px}.expand-toggle[data-v-d7749d1b]{display:flex;align-items:center;gap:8px;padding:6px 0}.group-by-row[data-v-d7749d1b]{display:flex;align-items:center;gap:14px;margin-bottom:10px;flex-wrap:wrap}.group-by-label[data-v-d7749d1b]{font-size:13px}.group-by-option[data-v-d7749d1b]{display:flex;align-items:center;gap:4px;font-size:13px;cursor:pointer}.feishu-fieldset[data-v-2aad46af]{border:none;padding:0;margin:0}.field-label[data-v-2aad46af]{display:flex;flex-direction:column;gap:.25rem;font-size:13px;color:var(--fg-dim)}.field-input[data-v-2aad46af]{padding:6px 10px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;font-size:13px}.actions[data-v-2aad46af]{display:flex;gap:.5rem;margin-top:.25rem}.feishu-configured[data-v-2aad46af]{display:flex;flex-direction:column;gap:.75rem}.configured-line[data-v-2aad46af]{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;margin:0;font-size:13px}.configured-badge[data-v-2aad46af]{display:inline-block;padding:2px 8px;border-radius:4px;background:var(--good);color:var(--bg);font-size:12px}.configured-appid[data-v-2aad46af]{color:var(--fg-dim);font-family:var(--mono, monospace)}.callback-row[data-v-2aad46af]{display:flex;gap:.5rem;align-items:center}.callback-row .field-input[data-v-2aad46af]{flex:1;font-family:var(--mono, monospace)}.btn-secondary[data-v-2aad46af]{background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}.error[data-v-2aad46af]{color:#f87171;font-size:13px}.test-send[data-v-2aad46af]{border-top:1px solid var(--border);border-bottom:1px solid var(--border);padding:12px 0;margin:4px 0;display:flex;flex-direction:column;gap:6px}.test-send__title[data-v-2aad46af]{font-size:13px;font-weight:600;color:var(--fg);margin:0}.test-send .hint[data-v-2aad46af]{margin:0}.test-send__buttons[data-v-2aad46af]{display:flex;flex-wrap:wrap;gap:6px;margin-top:2px}.test-send__buttons .btn-secondary[data-v-2aad46af]:disabled{opacity:.5;cursor:default}.test-send__ok[data-v-2aad46af]{color:var(--good);font-size:13px;margin:0}.pair-hint[data-v-2aad46af]{font-size:13px;color:var(--fg-dim);margin-top:.5rem}.hint[data-v-2aad46af]{font-size:13px;color:var(--fg-dim);margin:0 0 1rem}.feishu-status-error[data-v-2aad46af]{display:flex;align-items:center;gap:8px;color:var(--warn)}.hook-install[data-v-2aad46af]{padding:8px 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px}.hook-install__row[data-v-2aad46af]{display:flex;align-items:center;gap:8px}.hook-install__dot[data-v-2aad46af]{display:inline-block;width:8px;height:8px;border-radius:50%}.hook-install__dot--green[data-v-2aad46af]{background:var(--good)}.hook-install__dot--amber[data-v-2aad46af]{background:var(--warn)}.hook-install__dot--gray[data-v-2aad46af]{background:var(--neutral)}.hook-install__label[data-v-2aad46af]{flex:1;font-size:13px}.hook-install__toggle[data-v-2aad46af]{display:flex;gap:4px;align-items:center;font-size:12px}.hook-install__retry[data-v-2aad46af]{font-size:12px;padding:2px 8px}.hook-install__error[data-v-2aad46af]{font-size:12px;color:var(--warn);margin:6px 0 0}.ai-only[data-v-2aad46af]{padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px}.ai-only__toggle[data-v-2aad46af]{display:flex;gap:6px;align-items:center;font-size:13px}.remote-terminal[data-v-2aad46af]{padding:0 0 12px;border-bottom:1px solid var(--border);margin-bottom:12px;display:flex;flex-direction:column;gap:8px}.remote-terminal__toggle[data-v-2aad46af]{display:flex;gap:6px;align-items:center;font-size:13px}.remote-terminal__attach-label[data-v-2aad46af]{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--fg-dim);padding-left:22px}.remote-terminal__attach-select[data-v-2aad46af]{width:220px}.feishu-mode[data-v-2aad46af]{margin:8px 0}.feishu-mode__label[data-v-2aad46af]{display:flex;gap:8px;align-items:center;font-size:13px;color:var(--fg-dim)}.feishu-mode__label-text[data-v-2aad46af]{flex-shrink:0}.feishu-mode__select[data-v-2aad46af]{width:240px}.feishu-mode__effective[data-v-2aad46af]{margin:4px 0 0;font-size:12px;color:var(--fg-dim, #999)}.feishu-mode__warn[data-v-2aad46af]{color:var(--warn, #d89614);margin-left:8px}.tab-pane[data-v-6015f38d]{display:flex;flex-direction:column;gap:12px}.dim[data-v-6015f38d]{color:var(--fg-dim);font-size:13px}.hint[data-v-6015f38d]{margin:0;color:var(--fg-dim);font-size:12px;line-height:1.5}.error[data-v-6015f38d]{color:var(--bad);font-size:12px;margin:0}.header-row[data-v-6015f38d]{display:flex;align-items:flex-start;justify-content:space-between;gap:12px}.header-actions[data-v-6015f38d]{display:flex;align-items:center;gap:8px;flex-shrink:0}.icon-btn[data-v-6015f38d]{width:28px;height:28px;padding:0;border:1px solid var(--border);border-radius:6px;background:transparent;color:var(--fg-dim);cursor:pointer;font-size:14px}.icon-btn[data-v-6015f38d]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}.icon-btn[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}button.secondary[data-v-6015f38d]{background:transparent;color:var(--fg-dim);border:1px solid var(--border);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer}button.secondary[data-v-6015f38d]:hover:not(:disabled){color:var(--fg);background:#ffffff0a}button.secondary[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}.device-list[data-v-6015f38d]{display:flex;flex-direction:column;border-top:1px solid var(--border)}.device-row[data-v-6015f38d]{display:flex;align-items:center;gap:12px;padding:10px 0;border-bottom:1px solid var(--border)}.device-info[data-v-6015f38d]{flex:1;min-width:0}.ua[data-v-6015f38d]{color:var(--fg);font-size:13px;overflow-wrap:anywhere}.meta[data-v-6015f38d]{color:var(--fg-dim);font-size:12px;margin-top:2px}.current-tag[data-v-6015f38d]{color:var(--fg-dim);font-size:12px;padding:2px 8px;border:1px solid var(--border);border-radius:999px;flex-shrink:0}.danger-btn[data-v-6015f38d]{background:transparent;color:var(--bad);border:1px solid var(--bad);border-radius:6px;padding:6px 12px;font-size:13px;cursor:pointer;flex-shrink:0}.danger-btn[data-v-6015f38d]:hover:not(:disabled){background:color-mix(in srgb,var(--bad) 8%,transparent 92%)}.danger-btn[data-v-6015f38d]:disabled{opacity:.5;cursor:not-allowed}.received-files[data-v-4b01c574]{display:flex;flex-direction:column;gap:12px;padding:8px 4px}.header[data-v-4b01c574]{display:flex;justify-content:space-between;align-items:center}.actions[data-v-4b01c574]{display:flex;gap:8px}.actions button[data-v-4b01c574]{padding:4px 10px}.actions button.danger[data-v-4b01c574]{color:#d33}.muted[data-v-4b01c574]{color:var(--fg-dim, #999);font-size:.875rem}.error[data-v-4b01c574]{color:#d33;padding:4px 0;font-size:.875rem}.sessions[data-v-4b01c574]{list-style:none;padding:0;margin:0}.session[data-v-4b01c574]{border-bottom:1px solid var(--border, #333);padding:8px 0}.session-row[data-v-4b01c574]{display:flex;align-items:center;gap:8px;cursor:pointer}.session-name[data-v-4b01c574]{font-weight:500}.session-clear[data-v-4b01c574]{margin-left:auto;padding:2px 8px;font-size:.85rem}.session-clear.danger[data-v-4b01c574]{color:#d33}.files[data-v-4b01c574]{list-style:none;padding-left:16px;margin:4px 0 0}.files li[data-v-4b01c574]{display:flex;align-items:center;gap:8px;padding:2px 0}.file-name[data-v-4b01c574]{font-family:monospace;font-size:.875rem}.file-delete[data-v-4b01c574]{margin-left:auto;font-size:.8rem;padding:1px 6px}.file-delete.danger[data-v-4b01c574]{color:#d33}.empty[data-v-4b01c574]{color:var(--fg-dim, #999);padding:8px 0}@media (max-width: 640px){.header[data-v-4b01c574]{flex-wrap:wrap;align-items:flex-start;gap:8px}.actions[data-v-4b01c574],.session-row[data-v-4b01c574],.files li[data-v-4b01c574]{flex-wrap:wrap}.file-name[data-v-4b01c574]{min-width:0;overflow-wrap:anywhere}}.mobile-profiles[data-v-1c4c4dd0]{display:flex;flex-direction:column;gap:12px}.hint[data-v-1c4c4dd0]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.status[data-v-1c4c4dd0]{font-size:13px;color:var(--fg-dim);margin:0}.status.error[data-v-1c4c4dd0]{color:var(--bad)}.profile-list[data-v-1c4c4dd0]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.profile-item[data-v-1c4c4dd0]{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--bg)}.profile-header[data-v-1c4c4dd0]{display:flex;align-items:center;gap:8px;margin-bottom:6px}.profile-name[data-v-1c4c4dd0]{font-weight:600;font-size:13px;color:var(--fg);flex:1}.badge[data-v-1c4c4dd0]{font-size:11px;padding:1px 6px;border-radius:4px;background:#58a6ff29;color:var(--accent)}.host-picker[data-v-1c4c4dd0]{display:flex;align-items:center;gap:8px;font-size:12px;color:var(--fg-dim)}.host-picker select[data-v-1c4c4dd0]{font-size:12px;padding:2px 6px}.open-btn[data-v-1c4c4dd0]{font-size:12px;padding:3px 10px;border-radius:6px;border:1px solid var(--border);background:var(--bg);color:var(--fg);cursor:pointer}.open-btn[data-v-1c4c4dd0]:disabled{opacity:.5;cursor:default}.profile-fields[data-v-1c4c4dd0]{margin:0;display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px}.profile-fields dt[data-v-1c4c4dd0]{color:var(--fg-dim)}.profile-fields dd[data-v-1c4c4dd0]{margin:0;color:var(--fg);word-break:break-all}.env-list[data-v-1c4c4dd0]{list-style:none;margin:0;padding:0}.mobile-hosts[data-v-721a37c4]{display:flex;flex-direction:column;gap:12px}.hint[data-v-721a37c4]{font-size:12px;color:var(--fg-dim);margin:0;line-height:1.5}.status[data-v-721a37c4]{font-size:13px;color:var(--fg-dim);margin:0}.status.error[data-v-721a37c4]{color:var(--bad)}.host-list[data-v-721a37c4]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}.host-item[data-v-721a37c4]{border:1px solid var(--border);border-radius:8px;padding:10px 12px;background:var(--bg)}.host-header[data-v-721a37c4]{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}.host-alias[data-v-721a37c4]{font-weight:600;font-size:13px;color:var(--fg)}.host-target[data-v-721a37c4]{font-size:12px;color:var(--fg-dim)}.badge[data-v-721a37c4]{font-size:11px;padding:1px 6px;border-radius:4px;background:#58a6ff29;color:var(--accent)}.badge-warn[data-v-721a37c4]{background:#f8514929;color:var(--bad)}.host-fields[data-v-721a37c4]{margin:0;display:grid;grid-template-columns:auto 1fr;gap:2px 10px;font-size:12px}.host-fields dt[data-v-721a37c4]{color:var(--fg-dim)}.host-fields dd[data-v-721a37c4]{margin:0;color:var(--fg);word-break:break-all}.sync-indicator[data-v-3da58fd3]{display:flex;flex-direction:column;gap:4px;font-size:.78rem}.sync-row[data-v-3da58fd3]{display:flex;align-items:center;gap:8px}.sync-dot[data-v-3da58fd3]{width:8px;height:8px;border-radius:50%;flex-shrink:0;background:var(--fg-dim)}.sync-dot.state-idle[data-v-3da58fd3]{background:var(--good, #3fb950)}.sync-dot.state-syncing[data-v-3da58fd3]{background:var(--accent)}.sync-dot.state-offline[data-v-3da58fd3]{background:var(--fg-dim)}.sync-dot.state-error[data-v-3da58fd3]{background:var(--bad)}.sync-state[data-v-3da58fd3]{color:var(--fg)}.sync-state[data-state=error][data-v-3da58fd3]{color:var(--bad)}.sync-state[data-state=offline][data-v-3da58fd3],.sync-last[data-v-3da58fd3],.sync-pending[data-v-3da58fd3]{color:var(--fg-dim)}.sync-pending[data-v-3da58fd3]{font-weight:600}.sync-now-btn[data-v-3da58fd3]{margin-left:auto;font-size:.76rem;padding:2px 8px}.sync-error[data-v-3da58fd3]{color:var(--bad);margin:0}.sync-notice[data-v-3da58fd3]{display:flex;flex-direction:column;gap:4px;border:1px solid var(--border);border-radius:6px;padding:6px 8px;background:var(--bg)}.sync-notice-adopted[data-v-3da58fd3],.sync-notice-conflict[data-v-3da58fd3]{margin:0}.sync-notice-dismiss[data-v-3da58fd3]{align-self:flex-end;font-size:.72rem;padding:2px 8px}.backdrop[data-v-3b3531ba]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-3b3531ba]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-3b3531ba]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-3b3531ba]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-3b3531ba]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.dialog .dim[data-v-3b3531ba]{color:var(--fg-dim);font-size:12px}.dialog .warn[data-v-3b3531ba]{color:#d29922;font-size:12px}.row[data-v-3b3531ba]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-3b3531ba]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary[data-v-3b3531ba]:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}.primary.danger[data-v-3b3531ba]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-3b3531ba]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.backdrop[data-v-b060bffd]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-b060bffd]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:min(860px,calc(100vw - 32px));max-height:calc(100vh - 32px);box-sizing:border-box;display:flex;flex-direction:column;gap:12px}.header[data-v-b060bffd]{display:flex;flex-direction:column;gap:4px}.header h2[data-v-b060bffd]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.path[data-v-b060bffd]{color:var(--fg-dim);font-size:12px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;overflow-wrap:anywhere}.content-wrap[data-v-b060bffd]{min-height:0;display:flex;flex-direction:column;gap:8px}.content[data-v-b060bffd]{margin:0;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:12px;overflow:auto;min-height:200px;max-height:calc(100vh - 220px);color:var(--fg);font-size:11px;line-height:1.45;white-space:pre-wrap;word-break:break-word;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.row[data-v-b060bffd]{display:flex;justify-content:flex-end;gap:8px}.hint[data-v-b060bffd],.empty[data-v-b060bffd]{color:var(--fg-dim);font-size:12px}.error[data-v-b060bffd]{color:var(--bad);font-size:12px}.primary[data-v-b060bffd]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.lvl-filter[data-v-b060bffd]{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--fg-dim);margin-right:auto}.lvl-filter-select[data-v-b060bffd]{width:104px}.tag-filter-select[data-v-b060bffd]{width:168px}.backdrop[data-v-5e0ae162]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:100}.settings-dialog[data-v-5e0ae162]{background:var(--panel);border:1px solid var(--border);border-radius:8px;width:720px;height:540px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);box-sizing:border-box;display:flex;flex-direction:column;overflow:hidden}.settings-header[data-v-5e0ae162]{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;border-bottom:1px solid var(--border)}.settings-header h2[data-v-5e0ae162]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.header-sync-indicator[data-v-5e0ae162]{flex:1;min-width:0;margin:0 16px}.close-btn[data-v-5e0ae162]{background:transparent;border:none;color:var(--fg-dim);font-size:18px;line-height:1;cursor:pointer;padding:4px 8px;border-radius:4px}.close-btn[data-v-5e0ae162]:hover:not(:disabled){background:#ffffff0f;color:var(--fg)}.settings-body[data-v-5e0ae162]{flex:1 1 auto;display:flex;min-height:0}.settings-nav[data-v-5e0ae162]{width:160px;flex:0 0 160px;border-right:1px solid var(--border);display:flex;flex-direction:column;padding:8px 6px;gap:2px}.settings-nav-item[data-v-5e0ae162]{display:flex;align-items:center;gap:8px;width:100%;text-align:left;background:transparent;border:none;color:var(--fg-dim);padding:8px 12px;border-radius:6px;cursor:pointer;font-size:13px}.settings-nav-item .nav-icon[data-v-5e0ae162]{display:inline-flex;width:16px;height:16px;flex:0 0 16px;color:var(--fg-dim)}.settings-nav-item .nav-icon[data-v-5e0ae162] svg{width:16px;height:16px}.settings-nav-item.active .nav-icon[data-v-5e0ae162]{color:var(--accent)}.settings-nav-item .nav-label[data-v-5e0ae162]{flex:1 1 auto;min-width:0}.settings-nav-item[data-v-5e0ae162]:hover{background:#ffffff0a;color:var(--fg)}.settings-nav-item.active[data-v-5e0ae162]{background:#58a6ff1f;color:var(--accent);font-weight:600}.settings-pane[data-v-5e0ae162]{flex:1 1 auto;padding:20px 24px;overflow-y:auto}.settings-pane-header[data-v-5e0ae162]{display:flex;align-items:baseline;gap:10px;margin:0 0 16px}.settings-pane-title[data-v-5e0ae162]{margin:0;font-size:20px;font-weight:600;letter-spacing:-.01em;color:var(--fg)}.settings-pane-subtitle[data-v-5e0ae162]{font-size:12px;color:var(--fg-dim)}.settings-footer[data-v-5e0ae162]{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--border)}.settings-footer button[data-v-5e0ae162]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}.settings-footer button[data-v-5e0ae162]:hover:not(:disabled){background:#ffffff0a}.settings-footer button[data-v-5e0ae162]:disabled{opacity:.5;cursor:default}.settings-footer .primary[data-v-5e0ae162]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.settings-footer .primary[data-v-5e0ae162]:hover:not(:disabled){background:#79b8ff;border-color:#79b8ff}.settings-footer .danger[data-v-5e0ae162]{border-color:var(--bad);color:var(--bad)}.settings-footer .danger[data-v-5e0ae162]:hover:not(:disabled){background:#f851491a}.version-footer[data-v-5e0ae162]{flex:0 0 auto;padding:4px 16px 8px;font-size:11px;color:var(--fg-dim);text-align:right}.diag-merged[data-v-5e0ae162]{display:flex;flex-direction:column;gap:20px}.merged-section[data-v-5e0ae162]{display:flex;flex-direction:column;gap:10px}.merged-section+.merged-section[data-v-5e0ae162]{border-top:1px solid var(--border);padding-top:18px}.merged-section-title[data-v-5e0ae162]{margin:0;font-size:13px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.discard-backdrop[data-v-5e0ae162]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:105}.discard-dialog[data-v-5e0ae162]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:380px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.discard-dialog h3[data-v-5e0ae162]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.discard-dialog p[data-v-5e0ae162]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.discard-row[data-v-5e0ae162]{display:flex;justify-content:flex-end;gap:8px}.discard-row button[data-v-5e0ae162]{height:32px;padding:6px 14px;background:var(--bg);color:var(--fg);border:1px solid var(--border);border-radius:6px;cursor:pointer;font-size:13px}.discard-row button[data-v-5e0ae162]:hover{background:#ffffff0a}.discard-row .danger[data-v-5e0ae162]{border-color:var(--bad);color:var(--bad)}.discard-row .danger[data-v-5e0ae162]:hover{background:#f851491a}@media (max-width: 640px){.backdrop[data-v-5e0ae162]{align-items:stretch;justify-content:stretch;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}.settings-dialog[data-v-5e0ae162]{width:100vw;height:auto;max-width:100vw;max-height:100dvh;border-left:none;border-right:none;border-radius:0}.settings-header[data-v-5e0ae162]{padding:10px 12px}.settings-body[data-v-5e0ae162]{flex-direction:column}.settings-nav[data-v-5e0ae162]{width:100%;flex:0 0 auto;flex-direction:row;overflow-x:auto;overflow-y:hidden;border-right:none;border-bottom:1px solid var(--border);padding:6px 8px;scrollbar-width:none}.settings-nav[data-v-5e0ae162]::-webkit-scrollbar{display:none}.settings-nav-item[data-v-5e0ae162]{flex:0 0 auto;width:auto;min-height:34px;padding:6px 10px;white-space:nowrap}.settings-pane[data-v-5e0ae162]{min-height:0;padding:14px 16px 18px}.settings-pane-header[data-v-5e0ae162]{margin-bottom:12px}.settings-pane-title[data-v-5e0ae162]{font-size:18px}.settings-footer[data-v-5e0ae162]{padding:10px 12px}.version-footer[data-v-5e0ae162]{padding:4px 12px 8px}}.backdrop[data-v-c791c224]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-c791c224]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:10px}.dialog h2[data-v-c791c224]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog label[data-v-c791c224]{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--fg-dim)}.dialog label.inline[data-v-c791c224]{flex-direction:row;align-items:center;gap:6px;color:var(--fg)}.dialog input[data-v-c791c224],.dialog textarea[data-v-c791c224]{background:var(--bg);border:1px solid var(--border);border-radius:4px;padding:6px 8px;color:var(--fg);font-size:13px}.row[data-v-c791c224]{display:flex;gap:12px}.row.end[data-v-c791c224]{justify-content:flex-end;margin-top:4px}.tofu[data-v-c791c224]{display:flex;flex-direction:column;gap:6px;border:1px solid #d29922;border-radius:6px;padding:10px}.tofu code[data-v-c791c224]{font-size:12px;word-break:break-all;color:var(--fg)}.warn[data-v-c791c224]{color:#d29922;font-size:12px;margin:0}.error[data-v-c791c224]{color:var(--bad);font-size:12px;margin:0}.primary[data-v-c791c224]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.ssh-overlay[data-v-d1c3506a]{position:fixed;top:0;right:0;bottom:0;left:0;z-index:120;background:#010409b8;-webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);display:flex;align-items:center;justify-content:center}.ssh-shell[data-v-d1c3506a]{position:relative;width:min(1040px,calc(100vw - 48px));height:min(720px,calc(100vh - 48px));background:radial-gradient(120% 80% at 100% 0%,rgba(88,166,255,.06),transparent 55%),var(--bg);border:1px solid var(--border);border-radius:12px;box-shadow:0 24px 64px #0000008c;overflow:hidden;display:flex;flex-direction:column}.ssh-header[data-v-d1c3506a]{display:flex;align-items:center;gap:12px;padding:10px 16px;border-bottom:1px solid var(--border);background:var(--panel)}.tabs[data-v-d1c3506a]{display:flex;gap:4px}.tab[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:6px;background:transparent;border:1px solid transparent;color:var(--fg-dim);font-size:12px;font-weight:600;letter-spacing:.04em;padding:6px 12px;border-radius:7px;cursor:pointer;transition:all .12s}.tab[data-v-d1c3506a]:hover{color:var(--fg)}.tab.on[data-v-d1c3506a]{color:var(--fg);background:var(--bg);border-color:var(--border)}.tab-count[data-v-d1c3506a]{font-size:10px;color:var(--fg-dim);background:#8b949e29;padding:1px 6px;border-radius:999px}.search[data-v-d1c3506a]{flex:1;max-width:360px;display:flex;align-items:center;gap:7px;background:var(--bg);border:1px solid var(--border);border-radius:7px;padding:0 10px}.search-spacer[data-v-d1c3506a]{flex:1}.search-icon[data-v-d1c3506a]{color:var(--fg-dim);flex:none}.search input[data-v-d1c3506a]{flex:1;background:transparent;border:none;outline:none;color:var(--fg);font-size:13px;padding:7px 0}.new-btn[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:5px;background:var(--accent);color:#04101f;border:none;font-size:12px;font-weight:600;padding:7px 12px;border-radius:7px;cursor:pointer;transition:filter .12s}.new-btn[data-v-d1c3506a]:hover{filter:brightness(1.1)}.new-btn.ghost[data-v-d1c3506a]{background:transparent;color:var(--accent);border:1px solid var(--accent)}.close-x[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;color:var(--fg-dim);cursor:pointer;padding:4px;border-radius:6px;transition:color .12s,background .12s}.close-x[data-v-d1c3506a]:hover{color:var(--fg);background:#8b949e1f}.ssh-error[data-v-d1c3506a]{margin:0;padding:8px 16px;font-size:12px;color:var(--bad);background:#f8514914;border-bottom:1px solid rgba(248,81,73,.2)}.ssh-error.inline[data-v-d1c3506a]{border-bottom:none;border-radius:6px}.ssh-tofu[data-v-d1c3506a]{margin:0;padding:10px 16px;display:flex;flex-direction:column;gap:6px;background:#d2992214;border-bottom:1px solid rgba(210,153,34,.3)}.ssh-tofu p[data-v-d1c3506a]{margin:0;font-size:12px;line-height:1.5}.ssh-tofu .tofu-title[data-v-d1c3506a]{font-weight:600;color:var(--warn, #d29922)}.ssh-tofu .tofu-msg[data-v-d1c3506a]{color:var(--fg)}.ssh-tofu .tofu-note[data-v-d1c3506a]{color:var(--fg-dim);font-size:11px}.ssh-tofu .tofu-fp[data-v-d1c3506a]{font-size:12px;word-break:break-all;color:var(--fg)}.ssh-tofu .tofu-actions[data-v-d1c3506a]{display:flex;gap:8px;justify-content:flex-end}.ssh-success[data-v-d1c3506a]{margin:0;padding:8px 16px;font-size:12px;color:var(--good, #3fb950);background:#3fb95014;border-bottom:1px solid rgba(63,185,80,.2)}.ssh-body[data-v-d1c3506a]{flex:1;overflow-y:auto;padding:18px 16px 24px}.tag-bar[data-v-d1c3506a]{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 2px 14px}.tag-pill[data-v-d1c3506a]{background:var(--panel);border:1px solid var(--border);color:var(--fg-dim);font-size:11px;padding:4px 10px;border-radius:999px;cursor:pointer;transition:color .12s,border-color .12s,background .12s}.tag-pill[data-v-d1c3506a]:hover{color:var(--fg);border-color:var(--neutral)}.tag-pill.on[data-v-d1c3506a]{color:#04101f;background:var(--accent);border-color:var(--accent);font-weight:600}.tag-clear[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:3px;background:transparent;border:none;color:var(--fg-dim);font-size:11px;padding:4px 6px;cursor:pointer}.tag-clear[data-v-d1c3506a]:hover{color:var(--fg)}.card-proxy[data-v-d1c3506a]{display:flex;margin-top:5px}.card-proxy .proxy-badge[data-v-d1c3506a]{max-width:100%;text-align:left;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-tags[data-v-d1c3506a]{display:flex;flex-wrap:wrap;gap:4px;margin-top:5px}.card-tag[data-v-d1c3506a]{font-size:10px;color:var(--fg-dim);background:#8b949e29;padding:1px 7px;border-radius:999px;white-space:nowrap}.card-grid[data-v-d1c3506a]{display:grid;gap:10px;grid-template-columns:repeat(auto-fill,minmax(288px,1fr))}.card[data-v-d1c3506a]{position:relative;display:flex;align-items:center;gap:11px;padding:12px;background:var(--panel);border:1px solid var(--border);border-radius:10px;transition:border-color .14s,transform .14s,box-shadow .14s}.card[data-v-d1c3506a]:hover{border-color:var(--accent);transform:translateY(-1px);box-shadow:0 6px 18px #00000059}.card.busy[data-v-d1c3506a]{opacity:.6}.card-glyph[data-v-d1c3506a]{flex:none;width:34px;height:34px;border-radius:8px;display:flex;align-items:center;justify-content:center;color:var(--accent);background:#58a6ff1a;border:1px solid rgba(88,166,255,.18)}.card-main[data-v-d1c3506a]{flex:1;min-width:0}.card-label[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.card-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:2px}.card-actions[data-v-d1c3506a]{flex:none;display:flex;gap:4px;align-items:center}.act[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;width:28px;height:28px;border-radius:6px;background:var(--bg);border:1px solid var(--border);color:var(--fg);cursor:pointer;transition:color .12s,background .12s,border-color .12s}.act svg[data-v-d1c3506a]{display:block;flex:none;width:15px;height:15px}.act[data-v-d1c3506a]:hover{color:#fff;border-color:var(--neutral);background:#8b949e2e}.act.connect[data-v-d1c3506a]{background:var(--accent);border-color:var(--accent);color:#04101f}.act.connect[data-v-d1c3506a]:hover:not(:disabled){filter:brightness(1.12)}.act.danger[data-v-d1c3506a]{color:var(--fg-dim)}.act.danger[data-v-d1c3506a]:hover{color:#fff;border-color:var(--bad);background:#f8514933}.act[data-v-d1c3506a]:disabled{opacity:.5;cursor:default}.empty[data-v-d1c3506a]{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;color:var(--fg-dim)}.empty-icon[data-v-d1c3506a]{color:var(--neutral);opacity:.5;margin-bottom:6px}.empty-title[data-v-d1c3506a]{margin:0;font-size:14px;color:var(--fg);font-weight:600}.empty-sub[data-v-d1c3506a]{margin:0 0 12px;font-size:12px}.drawer[data-v-d1c3506a]{position:absolute;top:0;right:0;bottom:0;width:360px;max-width:84%;background:var(--panel);border-left:1px solid var(--border);box-shadow:-20px 0 48px #00000073;display:flex;flex-direction:column}.drawer.wide[data-v-d1c3506a]{width:480px}.drawer-head[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;padding:14px 16px;border-bottom:1px solid var(--border);font-size:12px;font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--fg-dim)}.drawer-body[data-v-d1c3506a]{flex:1;overflow-y:auto;padding:16px;display:flex;flex-direction:column;gap:12px}.field[data-v-d1c3506a]{display:flex;flex-direction:column;gap:5px}.field-row[data-v-d1c3506a]{display:flex;gap:10px}.field.grow[data-v-d1c3506a]{flex:1}.field.port[data-v-d1c3506a]{width:78px;flex:none}.fl[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim)}.fl em[data-v-d1c3506a]{color:var(--neutral);font-style:normal}.field input[data-v-d1c3506a],.field textarea[data-v-d1c3506a]{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:7px 9px;color:var(--fg);font-size:13px;outline:none;transition:border-color .12s}.field input[data-v-d1c3506a]:focus,.field textarea[data-v-d1c3506a]:focus{border-color:var(--accent)}.field textarea[data-v-d1c3506a]{resize:vertical;font-family:var(--font-mono-strict);font-size:12px}.hint[data-v-d1c3506a]{font-size:12px;color:var(--fg-dim);margin:0}.tag-editor[data-v-d1c3506a]{position:relative;display:flex;flex-wrap:wrap;align-items:center;gap:4px;background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:5px 6px;transition:border-color .12s}.tag-editor[data-v-d1c3506a]:focus-within{border-color:var(--accent)}.tag-editor .chip[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:3px;font-size:11px;color:var(--fg);background:#58a6ff24;border:1px solid rgba(88,166,255,.28);padding:1px 4px 1px 8px;border-radius:999px}.chip-x[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;background:transparent;border:none;color:var(--fg-dim);cursor:pointer;padding:1px;border-radius:999px;line-height:1}.chip-x[data-v-d1c3506a]:hover{color:#fff;background:#f8514959}.tag-input[data-v-d1c3506a]{flex:1;min-width:90px;background:transparent;border:none;outline:none;color:var(--fg);font-size:13px;padding:2px 3px}.combo[data-v-d1c3506a]{position:relative;display:flex}.combo input[data-v-d1c3506a]{flex:1;padding-right:26px;width:100%}.combo-caret[data-v-d1c3506a]{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:transparent;border:none;color:var(--fg-dim);cursor:pointer;font-size:11px;padding:2px 4px;line-height:1}.combo-caret[data-v-d1c3506a]:hover{color:var(--fg)}.combo-menu[data-v-d1c3506a]{position:absolute;top:calc(100% + 4px);left:0;right:0;z-index:10;margin:0;padding:4px 0;list-style:none;max-height:180px;overflow-y:auto;background:var(--bg);border:1px solid var(--border);border-radius:6px;box-shadow:0 6px 16px #00000059}.combo-opt[data-v-d1c3506a]{padding:7px 10px;font-size:13px;color:var(--fg);cursor:pointer}.combo-opt[data-v-d1c3506a]:hover{background:#ffffff0f}.identity-hint[data-v-d1c3506a]{margin:-4px 0 0;display:flex;flex-direction:column;gap:3px;font-size:11px;color:var(--fg-dim);line-height:1.4}.identity-hint code[data-v-d1c3506a]{font-family:var(--font-mono-strict);font-size:11px;color:var(--fg);background:var(--bg);border:1px solid var(--border);border-radius:5px;padding:4px 7px;word-break:break-all}.identity-hint.proxy[data-v-d1c3506a]{color:var(--warn, #d29922)}.empty-keys-hint[data-v-d1c3506a]{display:flex;flex-direction:column;align-items:flex-start;gap:8px}.enc-hint[data-v-d1c3506a]{margin:-4px 0 0;font-size:11px;color:var(--warn, #d29922)}.import-block[data-v-d1c3506a]{margin-top:4px;display:flex;flex-direction:column;gap:8px}.file-input[data-v-d1c3506a]{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}.dropzone[data-v-d1c3506a]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;padding:18px 12px;text-align:center;border:1px dashed var(--border);border-radius:8px;color:var(--fg-dim);font-size:11px;line-height:1.4;transition:border-color .12s,background .12s,color .12s}.dropzone-icon[data-v-d1c3506a]{color:var(--neutral)}.dropzone.over[data-v-d1c3506a]{border-color:var(--accent);color:var(--fg);background:#58a6ff14}.dropzone.over .dropzone-icon[data-v-d1c3506a]{color:var(--accent)}.btn.import[data-v-d1c3506a]{display:inline-flex;align-items:center;justify-content:center;gap:6px;width:100%}.btn.import svg[data-v-d1c3506a]{display:block}.btn.import[data-v-d1c3506a]:hover{background:#8b949e1a}.btn.sm[data-v-d1c3506a]{display:inline-flex;align-items:center;gap:5px;padding:6px 11px;font-size:12px}.btn.sm svg[data-v-d1c3506a]{display:block}.seg[data-v-d1c3506a]{display:flex;background:var(--bg);border:1px solid var(--border);border-radius:7px;padding:3px;gap:3px}.seg button[data-v-d1c3506a]{flex:1;background:transparent;border:none;color:var(--fg-dim);font-size:12px;padding:6px 0;border-radius:5px;cursor:pointer;transition:all .12s}.seg button.on[data-v-d1c3506a]{background:var(--accent);color:#04101f;font-weight:600}.drawer-foot[data-v-d1c3506a]{display:flex;justify-content:flex-end;gap:8px;padding:12px 16px;border-top:1px solid var(--border)}.btn[data-v-d1c3506a]{font-size:12px;padding:8px 14px;border-radius:7px;cursor:pointer;border:1px solid var(--border);background:transparent;color:var(--fg);transition:all .12s}.btn.ghost[data-v-d1c3506a]:hover{background:#8b949e1a}.btn.primary[data-v-d1c3506a]{background:var(--accent);color:#04101f;border-color:var(--accent);font-weight:600}.btn.primary[data-v-d1c3506a]:hover:not(:disabled){filter:brightness(1.1)}.btn.primary[data-v-d1c3506a]:disabled{opacity:.4;cursor:default}.drawer-enter-active[data-v-d1c3506a],.drawer-leave-active[data-v-d1c3506a]{transition:transform .18s ease,opacity .18s ease}.drawer-enter-from[data-v-d1c3506a],.drawer-leave-to[data-v-d1c3506a]{transform:translate(24px);opacity:0}.config-section-title[data-v-d1c3506a]{margin:4px 0 2px;font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--fg-dim)}.config-entry-list[data-v-d1c3506a]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.config-entry[data-v-d1c3506a]{background:var(--bg);border:1px solid var(--border);border-radius:8px}.config-entry-label[data-v-d1c3506a]{display:flex;align-items:center;gap:10px;padding:9px 10px;cursor:pointer}.config-entry-main[data-v-d1c3506a]{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.config-entry-alias[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-entry-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.config-entry-badges[data-v-d1c3506a]{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:4px}.proxy-badge[data-v-d1c3506a]{flex:none;font-size:10px;color:var(--fg-dim);background:#8b949e1f;border:1px solid rgba(139,148,158,.3);padding:3px 8px;border-radius:999px;max-width:150px;line-height:1.3;text-align:right}.proxy-badge.blocked[data-v-d1c3506a]{color:var(--warn, #d29922);background:#d299221f;border-color:#d299224d}.overwrite-badge[data-v-d1c3506a]{flex:none;font-size:10px;color:var(--fg-dim);background:#8b949e29;border:1px solid var(--border);padding:3px 8px;border-radius:999px;line-height:1.3;white-space:nowrap}.config-skipped[data-v-d1c3506a]{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:4px}.skip-row[data-v-d1c3506a]{display:flex;align-items:baseline;gap:8px;padding:6px 10px;background:#8b949e14;border-radius:6px}.skip-alias[data-v-d1c3506a]{font-size:12px;font-weight:600;color:var(--fg);flex:none}.skip-reason[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim)}.config-note[data-v-d1c3506a]{margin:6px 0 0;font-size:11px;color:var(--fg-dim);line-height:1.5}.config-foot[data-v-d1c3506a]{flex-direction:column;align-items:stretch;gap:8px}.foot-actions[data-v-d1c3506a]{display:flex;justify-content:flex-end;gap:8px}.fwd-section[data-v-d1c3506a]{display:flex;flex-direction:column;gap:8px;padding-top:12px;border-top:1px solid var(--border)}.fwd-section-head[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;gap:8px}.fwd-section-head .fl[data-v-d1c3506a]{font-size:11px;font-weight:700;letter-spacing:.06em;text-transform:uppercase}.fwd-rule[data-v-d1c3506a]{display:flex;flex-direction:column;gap:8px;padding:10px;background:var(--bg);border:1px solid var(--border);border-radius:8px}.fwd-rule-head[data-v-d1c3506a]{display:flex;align-items:center;gap:8px}.fwd-rule-head .seg[data-v-d1c3506a]{flex:1}.seg.sm button[data-v-d1c3506a]{font-size:11px;padding:4px 0}.fwd-warn[data-v-d1c3506a]{margin:0;padding:8px 9px;font-size:11px;line-height:1.5;color:var(--warn, #d29922);background:#d299221a;border:1px solid rgba(210,153,34,.32);border-radius:6px}.fwd-host[data-v-d1c3506a]{margin-bottom:16px}.fwd-host-head[data-v-d1c3506a]{display:flex;align-items:baseline;gap:8px;margin-bottom:6px}.fwd-host-name[data-v-d1c3506a]{font-size:13px;font-weight:600;color:var(--fg)}.fwd-host-sub[data-v-d1c3506a]{font-size:11px;color:var(--fg-dim);font-family:var(--font-mono-strict)}.fwd-proxy-reason[data-v-d1c3506a]{margin:0 0 8px;font-size:11px;line-height:1.5;color:var(--warn, #d29922)}.fwd-card[data-v-d1c3506a]{align-items:flex-start}.fwd-card-side[data-v-d1c3506a]{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:6px}.fwd-card .card-label[data-v-d1c3506a]{display:flex;align-items:baseline;gap:6px}.fwd-route[data-v-d1c3506a]{white-space:normal;overflow:visible;word-break:break-all}.fwd-kind[data-v-d1c3506a]{font-size:10px;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--accent)}.fwd-note[data-v-d1c3506a]{font-size:12px;color:var(--fg);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fwd-row-conns[data-v-d1c3506a]{margin-top:2px;font-size:10px;color:var(--fg-dim)}.fwd-row-error[data-v-d1c3506a]{margin:5px 0 0;font-size:11px;line-height:1.5;color:var(--bad)}.fwd-state[data-v-d1c3506a]{flex:none;font-size:10px;padding:3px 9px;border-radius:999px;border:1px solid var(--border);color:var(--fg-dim);background:#8b949e24}.fwd-state.running[data-v-d1c3506a]{color:var(--good, #3fb950);border-color:#3fb95059;background:#3fb9501f}.fwd-state.stopped[data-v-d1c3506a]{color:var(--bad);border-color:#f8514959;background:#f851491f}.pem-label[data-v-d1c3506a]{display:flex;align-items:center;justify-content:space-between;gap:8px}.pem-tools[data-v-d1c3506a]{display:flex;gap:4px}.backdrop[data-v-380786e4]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:110}.dialog[data-v-380786e4]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:460px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-380786e4]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-380786e4]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-380786e4]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.dialog .dim[data-v-380786e4]{color:var(--fg-dim);font-size:12px}.dialog .warn[data-v-380786e4]{color:#d29922;font-size:12px}.row[data-v-380786e4]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-380786e4]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary[data-v-380786e4]:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}.primary.danger[data-v-380786e4]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-380786e4]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.startup-fatal[data-v-ad8304f2]{flex:1 1 auto;min-height:0;display:flex;align-items:center;justify-content:center;padding:24px;background:#0d1117}.startup-fatal-panel[data-v-ad8304f2]{width:min(680px,100%);display:flex;flex-direction:column;gap:14px;color:var(--fg)}.startup-fatal-panel h1[data-v-ad8304f2]{margin:0;font-size:20px;font-weight:650}.startup-fatal-panel p[data-v-ad8304f2]{margin:0;color:var(--fg-dim);line-height:1.5}.startup-fatal-panel pre[data-v-ad8304f2]{margin:0;white-space:pre-wrap;overflow-wrap:anywhere;padding:12px;border:1px solid #30363d;border-radius:6px;background:#161b22;color:#ffb3b3;font-size:12px;line-height:1.45}.startup-fatal-log[data-v-ad8304f2]{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px;align-items:baseline;color:var(--fg-dim);font-size:12px}.startup-fatal-log code[data-v-ad8304f2]{min-width:0;overflow-wrap:anywhere;color:var(--fg)}.startup-fatal-actions[data-v-ad8304f2]{display:flex;gap:8px;flex-wrap:wrap}.startup-fatal-actions button[data-v-ad8304f2]{height:30px;padding:0 12px;border:1px solid #30363d;border-radius:6px;background:#21262d;color:var(--fg);cursor:pointer}.startup-fatal-actions button[data-v-ad8304f2]:hover{background:#30363d}.startup-fatal-actions button.danger[data-v-ad8304f2]{border-color:#8b2e2e;color:#ffb3b3}.startup-fatal-copy-status[data-v-ad8304f2]{margin:0;color:var(--fg-dim);font-size:12px}.backdrop[data-v-e95fa892]{position:fixed;top:0;right:0;bottom:0;left:0;background:#0009;display:flex;align-items:center;justify-content:center;z-index:111}.dialog[data-v-e95fa892]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:430px;max-width:calc(100vw - 32px);display:flex;flex-direction:column;gap:12px}.dialog h2[data-v-e95fa892]{margin:0;font-size:14px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--fg-dim)}.dialog p[data-v-e95fa892]{margin:0;font-size:13px;color:var(--fg);line-height:1.5}.dialog ul[data-v-e95fa892]{margin:0;padding-left:18px;font-size:13px;color:var(--fg);line-height:1.6}.row[data-v-e95fa892]{display:flex;justify-content:flex-end;gap:8px;margin-top:8px}.primary[data-v-e95fa892]{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}.primary.danger[data-v-e95fa892]{background:var(--bad);color:#0d1117;border-color:var(--bad)}.primary.danger[data-v-e95fa892]:hover{background:#ff6f6a;border-color:#ff6f6a;color:#0d1117}.recovery-dialog-backdrop[data-v-4735cb7a]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:200}.recovery-dialog[data-v-4735cb7a]{background:var(--bg, #0d1117);color:var(--fg, #d1d5db);border-radius:8px;min-width:480px;max-width:720px;max-height:80vh;overflow:hidden;display:flex;flex-direction:column}.recovery-dialog header[data-v-4735cb7a]{padding:16px 20px 0}.recovery-dialog h2[data-v-4735cb7a]{font-size:1.1rem;margin:0}.subtitle[data-v-4735cb7a]{font-size:.85rem;opacity:.7;margin:4px 0 12px}.tab-list[data-v-4735cb7a]{list-style:none;padding:0 20px;margin:0;overflow:auto}.tab-row[data-v-4735cb7a]{display:flex;align-items:center;gap:8px;padding:6px 0;cursor:default}.caret[data-v-4735cb7a]{background:transparent;border:0;color:inherit;cursor:pointer;padding:0 4px}.tab-title[data-v-4735cb7a]{flex:1}.tab-meta[data-v-4735cb7a]{opacity:.6;font-size:.8rem}.pane-list[data-v-4735cb7a]{list-style:none;padding-left:36px;margin:4px 0 8px;font-size:.85rem}.pane-list li[data-v-4735cb7a]{display:flex;gap:8px;padding:2px 0}.pane-shell[data-v-4735cb7a]{font-family:monospace}.pane-cwd[data-v-4735cb7a]{opacity:.7;flex:1}.pane-badge[data-v-4735cb7a]{opacity:.85;font-size:.75rem}footer[data-v-4735cb7a]{display:flex;justify-content:flex-end;gap:8px;padding:12px 20px 16px}.btn-primary[data-v-4735cb7a]{background:#2563eb;color:#fff;border:0;padding:6px 12px;border-radius:4px;cursor:pointer}.btn-primary[data-v-4735cb7a]:disabled{opacity:.4;cursor:not-allowed}.btn-secondary[data-v-4735cb7a]{background:transparent;color:inherit;border:1px solid #444;padding:6px 12px;border-radius:4px;cursor:pointer}.startup-update-backdrop[data-v-e5615fd1]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000073;display:flex;align-items:center;justify-content:center;z-index:210}.startup-update-dialog[data-v-e5615fd1]{background:var(--bg, #0d1117);color:var(--fg, #d1d5db);border-radius:8px;min-width:420px;max-width:640px;max-height:80vh;overflow:hidden;display:flex;flex-direction:column;padding:16px 20px;gap:12px}.startup-update-dialog header[data-v-e5615fd1]{display:flex;flex-direction:column;gap:4px}.startup-update-dialog h2[data-v-e5615fd1]{font-size:1.1rem;margin:0}.subtitle[data-v-e5615fd1]{font-size:.85rem;opacity:.7;margin:0;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace}.status[data-v-e5615fd1]{font-size:.85rem;margin:0}.notes[data-v-e5615fd1]{font-size:12px}.notes summary[data-v-e5615fd1]{opacity:.7;cursor:pointer}.notes pre[data-v-e5615fd1]{background:var(--bg);border:1px solid var(--border, #444);padding:8px;border-radius:6px;white-space:pre-wrap;word-break:break-word;max-height:160px;overflow-y:auto;font-size:11px;margin:6px 0 0}footer[data-v-e5615fd1]{display:flex;justify-content:flex-end;gap:8px}.btn-primary[data-v-e5615fd1]{background:var(--accent, #2563eb);color:#0d1117;border:0;padding:6px 12px;border-radius:4px;cursor:pointer;font-weight:600}.btn-primary.danger[data-v-e5615fd1]{background:var(--bad, #ef4444)}.btn-primary[data-v-e5615fd1]:disabled{opacity:.5;cursor:default}.btn-secondary[data-v-e5615fd1]{background:transparent;color:inherit;border:1px solid var(--border, #444);padding:6px 12px;border-radius:4px;cursor:pointer}.hints-backdrop[data-v-f52d16ed]{position:fixed;top:0;right:0;bottom:0;left:0;background:#00000080;display:flex;align-items:center;justify-content:center;z-index:200;pointer-events:none}.hints-panel[data-v-f52d16ed]{background:var(--panel);border:1px solid var(--border);border-radius:8px;padding:20px 24px;width:480px;max-width:calc(100vw - 32px);max-height:calc(100vh - 32px);overflow-y:auto;color:var(--fg);pointer-events:auto}.hints-header[data-v-f52d16ed]{font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim);margin-bottom:12px}.hints-group[data-v-f52d16ed]{margin-bottom:14px}.hints-group[data-v-f52d16ed]:last-child{margin-bottom:0}.hints-group h3[data-v-f52d16ed]{margin:0 0 6px;font-size:11px;text-transform:uppercase;letter-spacing:.05em;color:var(--fg-dim)}.hint-row[data-v-f52d16ed]{display:grid;grid-template-columns:120px 1fr;gap:12px;padding:3px 0;font-size:12px}.hint-row.disabled[data-v-f52d16ed]{color:var(--fg-dim)}.chord[data-v-f52d16ed]{font-family:SF Mono,Menlo,monospace;text-align:right}.label[data-v-f52d16ed]{color:inherit}.fade-enter-active[data-v-f52d16ed],.fade-leave-active[data-v-f52d16ed]{transition:opacity .1s ease}.fade-enter-from[data-v-f52d16ed],.fade-leave-to[data-v-f52d16ed]{opacity:0}.paste-preview-host[data-v-6eda1305]{position:fixed;top:88px;right:.75rem;z-index:50;display:flex;flex-direction:column;gap:8px;pointer-events:none}.paste-toast[data-v-6eda1305]{pointer-events:auto;width:200px;padding:8px;background:var(--bg, #1f2024);color:var(--fg, #e6e6e6);border:1px solid var(--border, #3a3b40);border-radius:6px;box-shadow:0 4px 14px #00000059;display:flex;flex-direction:column;gap:4px;position:relative}.paste-toast-thumb[data-v-6eda1305]{width:100%;max-height:120px;object-fit:contain;cursor:zoom-in;border-radius:4px;background:#000}.paste-toast-name[data-v-6eda1305]{font-size:12px;opacity:.8;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paste-toast-close[data-v-6eda1305]{position:absolute;top:4px;right:6px;background:transparent;border:none;color:inherit;font-size:16px;line-height:1;cursor:pointer;opacity:.7}.paste-toast-close[data-v-6eda1305]:hover{opacity:1}.paste-lightbox[data-v-6eda1305]{position:fixed;top:0;right:0;bottom:0;left:0;background:#000000d9;z-index:100;display:flex;align-items:center;justify-content:center;cursor:zoom-out;pointer-events:auto}.paste-lightbox img[data-v-6eda1305]{max-width:90vw;max-height:90vh;cursor:default}.paste-file-host[data-v-436c1298]{position:fixed;top:88px;right:.75rem;z-index:50;display:flex;flex-direction:column;gap:8px;pointer-events:none}.paste-file-toast[data-v-436c1298]{pointer-events:auto;padding:8px 12px;background:var(--bg, #1f2024);color:var(--fg, #e6e6e6);border:1px solid var(--border, #3a3b40);border-radius:6px;box-shadow:0 4px 14px #00000059;display:flex;align-items:center;gap:6px;font-size:12px;max-width:260px}.paste-file-icon[data-v-436c1298]{opacity:.7}.paste-file-name[data-v-436c1298]{font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.paste-file-size[data-v-436c1298]{opacity:.7}.paste-file-close[data-v-436c1298]{margin-left:auto;background:transparent;border:none;color:inherit;font-size:16px;line-height:1;cursor:pointer;opacity:.7}.paste-file-close[data-v-436c1298]:hover{opacity:1}.plugin-host[data-v-db2df210]{display:contents}.plugin-host.slot-right-panel[data-v-db2df210]{display:flex;flex-direction:column;height:100%}.plugin-host.slot-bottom-toolbar[data-v-db2df210]{display:flex;flex-direction:row;align-items:center;min-height:0}.translate-panel[data-v-be75a3d1]{position:fixed;width:480px;max-height:70vh;overflow:auto;background:var(--ed-tab-bg, #21262d);border:1px solid var(--ed-border, #2d333b);border-radius:6px;box-shadow:0 8px 24px #00000080;color:var(--ed-row-fg, #c9d1d9);z-index:9999;display:flex;flex-direction:column}.translate-panel__handle[data-v-be75a3d1]{display:flex;align-items:center;justify-content:space-between;padding:8px 12px;cursor:grab;background:var(--ed-row-hover, #30363d);border-bottom:1px solid var(--ed-border, #2d333b);-webkit-user-select:none;user-select:none}.translate-panel__title[data-v-be75a3d1]{font-weight:600;font-size:13px}.translate-panel__close[data-v-be75a3d1]{background:transparent;border:none;color:inherit;font-size:18px;cursor:pointer;padding:0 4px}.translate-panel__label[data-v-be75a3d1]{font-size:11px;opacity:.7;text-transform:uppercase;letter-spacing:.04em;padding:6px 12px 0}.translate-panel__detected[data-v-be75a3d1]{text-transform:none;opacity:.6}.translate-panel__pre[data-v-be75a3d1]{margin:4px 12px 8px;padding:6px;background:#00000040;border-radius:4px;font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px;max-height:200px;overflow:auto;white-space:pre-wrap}.translate-panel__target-row[data-v-be75a3d1]{display:flex;align-items:center;gap:8px;padding:8px 12px;border-top:1px solid var(--ed-border, #2d333b)}.translate-panel__target-select[data-v-be75a3d1]{flex:1}.translate-panel__result[data-v-be75a3d1]{padding:12px;border-top:1px solid var(--ed-border, #2d333b);min-height:60px}.translate-panel__loading[data-v-be75a3d1]{opacity:.7}.translate-panel__error[data-v-be75a3d1]{color:#f87171;font-size:12px;display:flex;flex-direction:column;gap:6px}.translate-panel__text[data-v-be75a3d1]{font-size:13px;max-height:240px;overflow:auto;white-space:pre-wrap}.translate-panel__placeholder[data-v-be75a3d1]{opacity:.5;font-size:12px}.translate-panel__history[data-v-be75a3d1]{padding:8px 12px;border-top:1px solid var(--ed-border, #2d333b);font-size:12px}.translate-panel__history summary[data-v-be75a3d1]{cursor:pointer;opacity:.8}.translate-panel__history ul[data-v-be75a3d1]{list-style:none;margin:6px 0 0;padding:0}.translate-panel__history-row[data-v-be75a3d1]{display:block;width:100%;text-align:left;background:transparent;border:none;color:inherit;cursor:pointer;padding:4px 0;font-size:11px}.translate-panel__history-row[data-v-be75a3d1]:hover{opacity:.85}.translate-panel__history-source[data-v-be75a3d1]{opacity:.7}.translate-panel__history-arrow[data-v-be75a3d1]{margin:0 6px;opacity:.5}.fe-theme-dimmed{--ed-shell-bg: #22272e;--ed-tree-bg: #2d333b;--ed-tree-header-bg: #22272e;--ed-tree-header-fg: rgba(173, 186, 199, .7);--ed-row-fg: #adbac7;--ed-row-hover: #373e47;--ed-row-selected: #444c56;--ed-folder: #d4a14a;--ed-chevron: rgba(173, 186, 199, .7);--ed-indent-guide: rgba(173, 186, 199, .1);--ed-tab-bg: #2d333b;--ed-tab-fg: #768390;--ed-tab-hover-fg: #adbac7;--ed-tab-active-bg: #22272e;--ed-tab-active-fg: #cdd9e5;--ed-tab-active-bar: #539bf5;--ed-border: #444c56;--ed-editor-bg: #22272e;--ed-editor-fg: #adbac7;--ed-gutter-bg: #22272e;--ed-gutter-fg: #545d68;--ed-muted: rgba(173, 186, 199, .6);--ed-error: #f47067}.fe-theme-light{--ed-shell-bg: #ffffff;--ed-tree-bg: #f6f8fa;--ed-tree-header-bg: #eef0f4;--ed-tree-header-fg: rgba(36, 41, 47, .7);--ed-row-fg: #24292f;--ed-row-hover: rgba(36, 41, 47, .06);--ed-row-selected: rgba(0, 92, 197, .13);--ed-folder: #54aeff;--ed-chevron: rgba(36, 41, 47, .55);--ed-indent-guide: rgba(36, 41, 47, .08);--ed-tab-bg: #eef0f4;--ed-tab-fg: #57606a;--ed-tab-hover-fg: #24292f;--ed-tab-active-bg: #ffffff;--ed-tab-active-fg: #24292f;--ed-tab-active-bar: #fd8c73;--ed-border: #d0d7de;--ed-editor-bg: #ffffff;--ed-editor-fg: #24292f;--ed-gutter-bg: #f6f8fa;--ed-gutter-fg: #6e7781;--ed-muted: rgba(36, 41, 47, .6);--ed-error: #cf222e}.app[data-v-beb2a608]{display:flex;flex-direction:column;height:100vh}.app.is-maximized[data-v-beb2a608]{padding:8px}.auth-error-banner[data-v-beb2a608]{display:flex;align-items:center;gap:8px;padding:7px 16px;background:#5a1e1e;border-bottom:1px solid #8b2e2e;color:#ffb3b3;font-size:12px;flex:0 0 auto}.auth-error-msg[data-v-beb2a608]{flex:1 1 auto}.auth-error-action[data-v-beb2a608]{flex:0 0 auto;border:1px solid #8b2e2e;background:transparent;color:#ffb3b3;border-radius:4px;padding:2px 8px;font-size:12px;cursor:pointer}.auth-error-action[data-v-beb2a608]:hover{background:#ffb3b31a}.auth-error-dismiss[data-v-beb2a608]{flex:0 0 auto;border:none;background:transparent;color:#ffb3b3;font-size:16px;line-height:1;cursor:pointer;padding:0 4px}.auth-error-dismiss[data-v-beb2a608]:hover{color:#fff}.main-row[data-v-beb2a608]{display:flex;flex:1 1 auto;min-height:0}.main[data-v-beb2a608]{flex:1 1 auto;display:flex;flex-direction:column;position:relative;background:#000;overflow:hidden;min-width:0}.right-resizer[data-v-beb2a608]{width:4px;cursor:col-resize;background:transparent;flex:0 0 4px}.right-resizer[data-v-beb2a608]:hover{background:var(--ed-border, #2d333b)}.panel-toggle[data-v-beb2a608]{background:var(--ed-tab-bg, #21262d);border:1px solid var(--ed-border, #2d333b);color:var(--ed-row-fg, #c9d1d9);cursor:pointer;padding:0 4px;font-size:11px;align-self:stretch;flex:0 0 auto}.panel-toggle[data-v-beb2a608]:hover{background:var(--ed-row-hover, #30363d);color:var(--ed-tab-hover-fg, #ffffff)}.right-panel[data-v-beb2a608]:empty{display:none}.right-panel[data-v-beb2a608]{border-left:1px solid var(--ed-border, #2d333b);overflow:hidden}.bottom-toolbar[data-v-beb2a608]:empty{display:none}.bottom-toolbar[data-v-beb2a608]{flex:0 0 24px;height:24px;background:var(--ed-tab-bg, var(--terminal-bg));border-top:1px solid var(--ed-border, rgba(255, 255, 255, .08))}.empty[data-v-beb2a608]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center;color:var(--fg-dim);font-size:13px}.toast[data-v-beb2a608]{position:absolute;bottom:36px;left:50%;transform:translate(-50%);background:#0d1117eb;border:1px solid var(--border);color:var(--fg);padding:6px 12px;border-radius:6px;font-size:12px;pointer-events:none}@media (max-width: 767px){.app[data-v-beb2a608]{height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);background:var(--bg);overflow:hidden}.main-row[data-v-beb2a608],.main[data-v-beb2a608]{min-width:0}.auth-error-banner[data-v-beb2a608]{padding:7px 10px;gap:6px}.auth-error-action[data-v-beb2a608]{padding:2px 6px}.toast[data-v-beb2a608]{bottom:calc(12px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);text-align:center}}/** - * Copyright (c) 2014 The xterm.js authors. All rights reserved. - * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) - * https://github.com/chjj/term.js - * @license MIT - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * Originally forked from (with the author's permission): - * Fabrice Bellard's javascript vt100 for jslinux: - * http://bellard.org/jslinux/ - * Copyright (c) 2011 Fabrice Bellard - * The original design remains. The terminal itself - * has been extended to include xterm CSI codes, among - * other features. - */.xterm{cursor:text;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:none}.xterm .xterm-helpers{position:absolute;top:0;z-index:5}.xterm .xterm-helper-textarea{padding:0;border:0;margin:0;position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-5;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer,.xterm .xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:10;color:transparent;pointer-events:none}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}.xterm-dim{opacity:1!important}.xterm-underline-1{text-decoration:underline}.xterm-underline-2{text-decoration:double underline}.xterm-underline-3{text-decoration:wavy underline}.xterm-underline-4{text-decoration:dotted underline}.xterm-underline-5{text-decoration:dashed underline}.xterm-overline{text-decoration:overline}.xterm-overline.xterm-underline-1{text-decoration:overline underline}.xterm-overline.xterm-underline-2{text-decoration:overline double underline}.xterm-overline.xterm-underline-3{text-decoration:overline wavy underline}.xterm-overline.xterm-underline-4{text-decoration:overline dotted underline}.xterm-overline.xterm-underline-5{text-decoration:overline dashed underline}.xterm-strikethrough{text-decoration:line-through}.xterm-screen .xterm-decoration-container .xterm-decoration{z-index:6;position:absolute}.xterm-screen .xterm-decoration-container .xterm-decoration.xterm-decoration-top-layer{z-index:7}.xterm-decoration-overview-ruler{z-index:8;position:absolute;top:0;right:0;pointer-events:none}.xterm-decoration-top{z-index:2;position:relative}:root{--bg: #0d1117;--panel: #161b22;--border: #30363d;--fg: #c9d1d9;--fg-dim: #8b949e;--accent: #58a6ff;--good: #3fb950;--bad: #f85149;--warn: #d29922;--neutral: #6e7681;--terminal-bg: #000000;--terminal-grid: #11161d;--terminal-overlay: rgba(13, 17, 23, .85);--font-sans: "PingFang SC", "Hiragino Sans GB", "Heiti SC", "Microsoft YaHei", "Noto Sans CJK SC", "Helvetica Neue", Helvetica, Arial, "Segoe UI", Roboto, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;--font-mono: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", ui-monospace, Menlo, Consolas, "Roboto Mono", monospace;--font-mono-strict: ui-monospace, Menlo, Consolas, "Roboto Mono", monospace}*{box-sizing:border-box}html,body{margin:0;padding:0;height:100%;background:var(--bg);color:var(--fg);font-family:var(--font-sans);font-size:14px}#app{height:100%}@supports (height: 100dvh){html,body,#app{height:100dvh}}.xterm-viewport::-webkit-scrollbar{width:10px;height:10px}.xterm-viewport::-webkit-scrollbar-track{background:transparent}.xterm-viewport::-webkit-scrollbar-thumb{background:#ffffff1a;border-radius:5px;border:2px solid transparent;background-clip:padding-box}.xterm-viewport::-webkit-scrollbar-thumb:hover{background:#ffffff40;background-clip:padding-box}.xterm-viewport::-webkit-scrollbar-corner{background:transparent}button,input,select{font:inherit;color:var(--fg)}button{background:transparent;border:1px solid var(--border);border-radius:6px;padding:6px 12px;cursor:pointer;transition:border-color .12s,color .12s}button:hover{border-color:var(--accent);color:var(--accent)}button.primary{background:var(--accent);color:#0d1117;border-color:var(--accent);font-weight:600}button.primary:hover{background:#79b8ff;border-color:#79b8ff;color:#0d1117}input,select{background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:6px 10px}input:focus,select:focus{outline:none;border-color:var(--accent)}.settings-field-grid{display:grid;gap:14px 12px;min-width:0}.settings-field-grid--two{grid-template-columns:repeat(2,minmax(0,1fr))}.settings-field-grid--compact{grid-template-columns:minmax(72px,.65fr) minmax(72px,.65fr) minmax(90px,.85fr) minmax(170px,1.6fr)}.settings-field{display:flex;flex-direction:column;gap:6px;min-width:0}.settings-field--full{grid-column:1 / -1}.settings-field>input,.settings-field>.select-dropdown,.settings-field>.password-field{min-width:0;width:100%}@media (max-width: 640px){.settings-field-grid--two,.settings-field-grid--compact{grid-template-columns:minmax(0,1fr)}.settings-field--full{grid-column:auto}} diff --git a/internal/relay/web-dist/assets/index-hP5cCp4S.js b/internal/relay/web-dist/assets/index-wpy5ZEXj.js similarity index 97% rename from internal/relay/web-dist/assets/index-hP5cCp4S.js rename to internal/relay/web-dist/assets/index-wpy5ZEXj.js index f213295f..6482333e 100644 --- a/internal/relay/web-dist/assets/index-hP5cCp4S.js +++ b/internal/relay/web-dist/assets/index-wpy5ZEXj.js @@ -1 +1 @@ -import{L as G,E as A,C as N}from"./index-q_Op_mkr.js";import{J as I,Q as u,g as Y,L as j,z as U,x as Z,q as B,O as k,c as D,E as M}from"./FileExplorer-BGCt84ef.js";import"./useI18n-CnvN0FfF.js";import"./index-BH9vIdLD.js";import"./prefsSync-D8z1rJ8H.js";import"./client-2UEf7AK8.js";import"./Switch-CpxGRRqY.js";import"./auth-Dhl8fEWW.js";const h=1,F=2,L=3,J=4,K=5,H=36,ee=37,te=38,Oe=11,oe=13;function re(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function ne(e){return e==9||e==10||e==13||e==32}let Q=null,V=null,X=0;function W(e,t){let o=e.pos+t;if(V==e&&X==o)return Q;for(;ne(e.peek(t));)t++;let O="";for(;;){let r=e.peek(t);if(!re(r))break;O+=String.fromCharCode(r),t++}return V=e,X=o,Q=O||null}function _(e,t){this.name=e,this.parent=t}const ae=new N({start:null,shift(e,t,o,O){return t==h?new _(W(O,1)||"",e):e},reduce(e,t){return t==Oe&&e?e.parent:e},reuse(e,t,o,O){let r=t.type.id;return r==h||r==oe?new _(W(O,1)||"",e):e},strict:!1}),le=new A((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let o=W(e,0);if(!o)return e.acceptToken(K);if(t.context&&o==t.context.name)return e.acceptToken(F);for(let O=t.context;O;O=O.parent)if(O.name==o)return e.acceptToken(L,-2);e.acceptToken(J)}else if(e.next!=33&&e.next!=63)return e.acceptToken(h)}},{contextual:!0});function y(e,t){return new A(o=>{let O=0,r=t.charCodeAt(0);e:for(;!(o.next<0);o.advance(),O++)if(o.next==r){for(let a=1;a"),ie=y(ee,"?>"),ce=y(te,"]]>"),me=I({Text:u.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,AttributeValue:u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta,Cdata:u.special(u.string)}),$e=G.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[le,se,ie,ce,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function T(e,t){let o=t&&t.getChild("TagName");return o?e.sliceString(o.from,o.to):""}function P(e,t){let o=t&&t.firstChild;return!o||o.name!="OpenTag"?"":T(e,o)}function Se(e,t,o){let O=t&&t.getChildren("Attribute").find(a=>a.from<=o&&a.to>=o),r=O&&O.getChild("AttributeName");return r?e.sliceString(r.from,r.to):""}function C(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ge(e,t){var o;let O=k(e).resolveInner(t,-1),r=null;for(let a=O;!r&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(r=a);if(r&&(r.to>t||r.lastChild.type.isError)){let a=r.parent;if(O.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:O.from,context:a}:{type:"openTag",from:O.from,context:C(a)};if(O.name=="AttributeName")return{type:"attrName",from:O.from,context:r};if(O.name=="AttributeValue")return{type:"attrValue",from:O.from,context:r};let s=O==r||O.name=="Attribute"?O.childBefore(t):O;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:C(a)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:a}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:r}:s?{type:"attrName",from:t,context:r}:null}else if(O.name=="StartCloseTag")return{type:"closeTag",from:t,context:O.parent};for(;O.parent&&O.to==t&&!(!((o=O.lastChild)===null||o===void 0)&&o.type.isError);)O=O.parent;return O.name=="Element"||O.name=="Text"||O.name=="Document"?{type:"tag",from:t,context:O.name=="Element"?O:C(O)}:null}class pe{constructor(t,o,O){this.attrs=o,this.attrValues=O,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(r=>({label:r,type:"text"})):[]}}const b=/^[:\-\.\w\u00b7-\uffff]*$/;function E(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function R(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function ue(e,t){let o=[],O=[],r=Object.create(null);for(let n of t){let $=E(n);o.push($),n.global&&O.push($),n.values&&(r[n.name]=n.values.map(R))}let a=[],s=[],f=Object.create(null);for(let n of e){let $=O,c=r;n.attributes&&($=$.concat(n.attributes.map(l=>typeof l=="string"?o.find(d=>d.label==l)||{label:l,type:"property"}:(l.values&&(c==r&&(c=Object.create(c)),c[l.name]=l.values.map(R)),E(l)))));let p=new pe(n,$,c);f[p.name]=p,a.push(p),n.top&&s.push(p)}s.length||(s=a);for(let n=0;n{var $;let{doc:c}=n.state,p=ge(n.state,n.pos);if(!p||p.type=="tag"&&!n.explicit)return null;let{type:l,from:d,context:S}=p;if(l=="openTag"){let i=s,m=P(c,S);if(m){let g=f[m];i=(g==null?void 0:g.children)||a}return{from:d,options:i.map(g=>g.completion),validFor:b}}else if(l=="closeTag"){let i=P(c,S);return i?{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)==">"?1:0),options:[(($=f[i])===null||$===void 0?void 0:$.closeNameCompletion)||{label:i+">",type:"type"}],validFor:b}:null}else if(l=="attrName"){let i=f[T(c,S)];return{from:d,options:(i==null?void 0:i.attrs)||O,validFor:b}}else if(l=="attrValue"){let i=Se(c,S,d);if(!i)return null;let m=f[T(c,S)],g=((m==null?void 0:m.attrValues)||r)[i];return!g||!g.length?null:{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(l=="tag"){let i=P(c,S),m=f[i],g=[],q=S&&S.lastChild;i&&(!q||q.name!="CloseTag"||T(c,q)!=i)&&g.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let v=g.concat(((m==null?void 0:m.children)||(S?a:s)).map(x=>x.openCompletion));if(S&&(m!=null&&m.text.length)){let x=S.firstChild;x.to>n.pos-20&&!/\S/.test(n.state.sliceDoc(x.to,n.pos))&&(v=v.concat(m.text))}return{from:d,options:v,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const w=j.define({name:"xml",parser:$e.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Z.add({Element(e){let t=e.firstChild,o=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:o.name=="CloseTag"?o.from:e.to}}}),B.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function he(e={}){let t=[w.data.of({autocomplete:ue(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(fe),new Y(w,t)}function z(e,t,o=e.length){if(!t)return"";let O=t.firstChild,r=O&&O.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,o)):""}const fe=D.inputHandler.of((e,t,o,O,r)=>{if(e.composing||e.state.readOnly||t!=o||O!=">"&&O!="/"||!w.isActiveAt(e.state,t,-1))return!1;let a=r(),{state:s}=a,f=s.changeByRange(n=>{var $,c,p;let{head:l}=n,d=s.doc.sliceString(l-1,l)==O,S=k(s).resolveInner(l,-1),i;if(d&&O==">"&&S.name=="EndTag"){let m=S.parent;if(((c=($=m.parent)===null||$===void 0?void 0:$.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(i=z(s.doc,m.parent,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=``;return{range:n,changes:{from:l,to:g,insert:q}}}}else if(d&&O=="/"&&S.name=="StartCloseTag"){let m=S.parent;if(S.from==l-2&&((p=m.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(i=z(s.doc,m,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`${i}>`;return{range:M.cursor(l+q.length,-1),changes:{from:l,to:g,insert:q}}}}return{range:n}});return f.changes.empty?!1:(e.dispatch([a,s.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{fe as autoCloseTags,ue as completeFromSchema,he as xml,w as xmlLanguage}; +import{L as G,E as A,C as N}from"./index-B2EmydOR.js";import{J as I,Q as u,g as Y,L as j,z as U,x as Z,q as B,O as k,c as D,E as M}from"./FileExplorer-DTHAXsem.js";import"./useI18n-lwZlSdSx.js";import"./index-OVPV9rln.js";import"./prefsSync-C5tz9Q-s.js";import"./client-DMh7GjbV.js";import"./Switch-DguIL3dU.js";import"./auth-B3RxKR1W.js";const h=1,F=2,L=3,J=4,K=5,H=36,ee=37,te=38,Oe=11,oe=13;function re(e){return e==45||e==46||e==58||e>=65&&e<=90||e==95||e>=97&&e<=122||e>=161}function ne(e){return e==9||e==10||e==13||e==32}let Q=null,V=null,X=0;function W(e,t){let o=e.pos+t;if(V==e&&X==o)return Q;for(;ne(e.peek(t));)t++;let O="";for(;;){let r=e.peek(t);if(!re(r))break;O+=String.fromCharCode(r),t++}return V=e,X=o,Q=O||null}function _(e,t){this.name=e,this.parent=t}const ae=new N({start:null,shift(e,t,o,O){return t==h?new _(W(O,1)||"",e):e},reduce(e,t){return t==Oe&&e?e.parent:e},reuse(e,t,o,O){let r=t.type.id;return r==h||r==oe?new _(W(O,1)||"",e):e},strict:!1}),le=new A((e,t)=>{if(e.next==60){if(e.advance(),e.next==47){e.advance();let o=W(e,0);if(!o)return e.acceptToken(K);if(t.context&&o==t.context.name)return e.acceptToken(F);for(let O=t.context;O;O=O.parent)if(O.name==o)return e.acceptToken(L,-2);e.acceptToken(J)}else if(e.next!=33&&e.next!=63)return e.acceptToken(h)}},{contextual:!0});function y(e,t){return new A(o=>{let O=0,r=t.charCodeAt(0);e:for(;!(o.next<0);o.advance(),O++)if(o.next==r){for(let a=1;a"),ie=y(ee,"?>"),ce=y(te,"]]>"),me=I({Text:u.content,"StartTag StartCloseTag EndTag SelfCloseEndTag":u.angleBracket,TagName:u.tagName,"MismatchedCloseTag/TagName":[u.tagName,u.invalid],AttributeName:u.attributeName,AttributeValue:u.attributeValue,Is:u.definitionOperator,"EntityReference CharacterReference":u.character,Comment:u.blockComment,ProcessingInst:u.processingInstruction,DoctypeDecl:u.documentMeta,Cdata:u.special(u.string)}),$e=G.deserialize({version:14,states:",lOQOaOOOrOxO'#CfOzOpO'#CiO!tOaO'#CgOOOP'#Cg'#CgO!{OrO'#CrO#TOtO'#CsO#]OpO'#CtOOOP'#DT'#DTOOOP'#Cv'#CvQQOaOOOOOW'#Cw'#CwO#eOxO,59QOOOP,59Q,59QOOOO'#Cx'#CxO#mOpO,59TO#uO!bO,59TOOOP'#C|'#C|O$TOaO,59RO$[OpO'#CoOOOP,59R,59ROOOQ'#C}'#C}O$dOrO,59^OOOP,59^,59^OOOS'#DO'#DOO$lOtO,59_OOOP,59_,59_O$tOpO,59`O$|OpO,59`OOOP-E6t-E6tOOOW-E6u-E6uOOOP1G.l1G.lOOOO-E6v-E6vO%UO!bO1G.oO%UO!bO1G.oO%dOpO'#CkO%lO!bO'#CyO%zO!bO1G.oOOOP1G.o1G.oOOOP1G.w1G.wOOOP-E6z-E6zOOOP1G.m1G.mO&VOpO,59ZO&_OpO,59ZOOOQ-E6{-E6{OOOP1G.x1G.xOOOS-E6|-E6|OOOP1G.y1G.yO&gOpO1G.zO&gOpO1G.zOOOP1G.z1G.zO&oO!bO7+$ZO&}O!bO7+$ZOOOP7+$Z7+$ZOOOP7+$c7+$cO'YOpO,59VO'bOpO,59VO'mO!bO,59eOOOO-E6w-E6wO'{OpO1G.uO'{OpO1G.uOOOP1G.u1G.uO(TOpO7+$fOOOP7+$f7+$fO(]O!bO<c!|;'S(o;'S;=`)]<%lO(oi>jX|W!O`Or(ors&osv(owx'}x!r(o!r!s?V!s;'S(o;'S;=`)]<%lO(oi?^X|W!O`Or(ors&osv(owx'}x!g(o!g!h?y!h;'S(o;'S;=`)]<%lO(oi@QY|W!O`Or?yrs@psv?yvwA[wxBdx!`?y!`!aCr!a;'S?y;'S;=`Db<%lO?ya@uV!O`Ov@pvxA[x!`@p!`!aAy!a;'S@p;'S;=`B^<%lO@pPA_TO!`A[!`!aAn!a;'SA[;'S;=`As<%lOA[PAsOiPPAvP;=`<%lA[aBQSiP!O`Ov&ox;'S&o;'S;=`'Q<%lO&oaBaP;=`<%l@pXBiX|WOrBdrsA[svBdvwA[w!`Bd!`!aCU!a;'SBd;'S;=`Cl<%lOBdXC]TiP|WOr'}sv'}w;'S'};'S;=`(c<%lO'}XCoP;=`<%lBdiC{ViP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiDeP;=`<%l?yiDoZ|W!O`Or(ors&osv(owx'}x!e(o!e!fEb!f#V(o#V#WIr#W;'S(o;'S;=`)]<%lO(oiEiX|W!O`Or(ors&osv(owx'}x!f(o!f!gFU!g;'S(o;'S;=`)]<%lO(oiF]X|W!O`Or(ors&osv(owx'}x!c(o!c!dFx!d;'S(o;'S;=`)]<%lO(oiGPX|W!O`Or(ors&osv(owx'}x!v(o!v!wGl!w;'S(o;'S;=`)]<%lO(oiGsX|W!O`Or(ors&osv(owx'}x!c(o!c!dH`!d;'S(o;'S;=`)]<%lO(oiHgX|W!O`Or(ors&osv(owx'}x!}(o!}#OIS#O;'S(o;'S;=`)]<%lO(oiI]V|W!O`yPOr(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(oiIyX|W!O`Or(ors&osv(owx'}x#W(o#W#XJf#X;'S(o;'S;=`)]<%lO(oiJmX|W!O`Or(ors&osv(owx'}x#T(o#T#UKY#U;'S(o;'S;=`)]<%lO(oiKaX|W!O`Or(ors&osv(owx'}x#h(o#h#iK|#i;'S(o;'S;=`)]<%lO(oiLTX|W!O`Or(ors&osv(owx'}x#T(o#T#UH`#U;'S(o;'S;=`)]<%lO(oiLwX|W!O`Or(ors&osv(owx'}x#c(o#c#dMd#d;'S(o;'S;=`)]<%lO(oiMkX|W!O`Or(ors&osv(owx'}x#V(o#V#WNW#W;'S(o;'S;=`)]<%lO(oiN_X|W!O`Or(ors&osv(owx'}x#h(o#h#iNz#i;'S(o;'S;=`)]<%lO(oi! RX|W!O`Or(ors&osv(owx'}x#m(o#m#n! n#n;'S(o;'S;=`)]<%lO(oi! uX|W!O`Or(ors&osv(owx'}x#d(o#d#e!!b#e;'S(o;'S;=`)]<%lO(oi!!iX|W!O`Or(ors&osv(owx'}x#X(o#X#Y?y#Y;'S(o;'S;=`)]<%lO(oi!#_V!SP|W!O`Or(ors&osv(owx'}x;'S(o;'S;=`)]<%lO(ok!$PXaQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qo!$wX[UVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!%mZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!&`!a;'S$q;'S;=`)c<%lO$qk!&kX!RQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$qk!'aZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_#P$q#P#Q!(S#Q;'S$q;'S;=`)c<%lO$qk!(]ZVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_!`$q!`!a!)O!a;'S$q;'S;=`)c<%lO$qk!)ZXxQVP|W!O`Or$qrs%gsv$qwx'^x!^$q!^!_(o!_;'S$q;'S;=`)c<%lO$q",tokenizers:[le,se,ie,ce,0,1,2,3,4],topRules:{Document:[0,6]},tokenPrec:0});function T(e,t){let o=t&&t.getChild("TagName");return o?e.sliceString(o.from,o.to):""}function P(e,t){let o=t&&t.firstChild;return!o||o.name!="OpenTag"?"":T(e,o)}function Se(e,t,o){let O=t&&t.getChildren("Attribute").find(a=>a.from<=o&&a.to>=o),r=O&&O.getChild("AttributeName");return r?e.sliceString(r.from,r.to):""}function C(e){for(let t=e&&e.parent;t;t=t.parent)if(t.name=="Element")return t;return null}function ge(e,t){var o;let O=k(e).resolveInner(t,-1),r=null;for(let a=O;!r&&a.parent;a=a.parent)(a.name=="OpenTag"||a.name=="CloseTag"||a.name=="SelfClosingTag"||a.name=="MismatchedCloseTag")&&(r=a);if(r&&(r.to>t||r.lastChild.type.isError)){let a=r.parent;if(O.name=="TagName")return r.name=="CloseTag"||r.name=="MismatchedCloseTag"?{type:"closeTag",from:O.from,context:a}:{type:"openTag",from:O.from,context:C(a)};if(O.name=="AttributeName")return{type:"attrName",from:O.from,context:r};if(O.name=="AttributeValue")return{type:"attrValue",from:O.from,context:r};let s=O==r||O.name=="Attribute"?O.childBefore(t):O;return(s==null?void 0:s.name)=="StartTag"?{type:"openTag",from:t,context:C(a)}:(s==null?void 0:s.name)=="StartCloseTag"&&s.to<=t?{type:"closeTag",from:t,context:a}:(s==null?void 0:s.name)=="Is"?{type:"attrValue",from:t,context:r}:s?{type:"attrName",from:t,context:r}:null}else if(O.name=="StartCloseTag")return{type:"closeTag",from:t,context:O.parent};for(;O.parent&&O.to==t&&!(!((o=O.lastChild)===null||o===void 0)&&o.type.isError);)O=O.parent;return O.name=="Element"||O.name=="Text"||O.name=="Document"?{type:"tag",from:t,context:O.name=="Element"?O:C(O)}:null}class pe{constructor(t,o,O){this.attrs=o,this.attrValues=O,this.children=[],this.name=t.name,this.completion=Object.assign(Object.assign({type:"type"},t.completion||{}),{label:this.name}),this.openCompletion=Object.assign(Object.assign({},this.completion),{label:"<"+this.name}),this.closeCompletion=Object.assign(Object.assign({},this.completion),{label:"",boost:2}),this.closeNameCompletion=Object.assign(Object.assign({},this.completion),{label:this.name+">"}),this.text=t.textContent?t.textContent.map(r=>({label:r,type:"text"})):[]}}const b=/^[:\-\.\w\u00b7-\uffff]*$/;function E(e){return Object.assign(Object.assign({type:"property"},e.completion||{}),{label:e.name})}function R(e){return typeof e=="string"?{label:`"${e}"`,type:"constant"}:/^"/.test(e.label)?e:Object.assign(Object.assign({},e),{label:`"${e.label}"`})}function ue(e,t){let o=[],O=[],r=Object.create(null);for(let n of t){let $=E(n);o.push($),n.global&&O.push($),n.values&&(r[n.name]=n.values.map(R))}let a=[],s=[],f=Object.create(null);for(let n of e){let $=O,c=r;n.attributes&&($=$.concat(n.attributes.map(l=>typeof l=="string"?o.find(d=>d.label==l)||{label:l,type:"property"}:(l.values&&(c==r&&(c=Object.create(c)),c[l.name]=l.values.map(R)),E(l)))));let p=new pe(n,$,c);f[p.name]=p,a.push(p),n.top&&s.push(p)}s.length||(s=a);for(let n=0;n{var $;let{doc:c}=n.state,p=ge(n.state,n.pos);if(!p||p.type=="tag"&&!n.explicit)return null;let{type:l,from:d,context:S}=p;if(l=="openTag"){let i=s,m=P(c,S);if(m){let g=f[m];i=(g==null?void 0:g.children)||a}return{from:d,options:i.map(g=>g.completion),validFor:b}}else if(l=="closeTag"){let i=P(c,S);return i?{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)==">"?1:0),options:[(($=f[i])===null||$===void 0?void 0:$.closeNameCompletion)||{label:i+">",type:"type"}],validFor:b}:null}else if(l=="attrName"){let i=f[T(c,S)];return{from:d,options:(i==null?void 0:i.attrs)||O,validFor:b}}else if(l=="attrValue"){let i=Se(c,S,d);if(!i)return null;let m=f[T(c,S)],g=((m==null?void 0:m.attrValues)||r)[i];return!g||!g.length?null:{from:d,to:n.pos+(c.sliceString(n.pos,n.pos+1)=='"'?1:0),options:g,validFor:/^"[^"]*"?$/}}else if(l=="tag"){let i=P(c,S),m=f[i],g=[],q=S&&S.lastChild;i&&(!q||q.name!="CloseTag"||T(c,q)!=i)&&g.push(m?m.closeCompletion:{label:"",type:"type",boost:2});let v=g.concat(((m==null?void 0:m.children)||(S?a:s)).map(x=>x.openCompletion));if(S&&(m!=null&&m.text.length)){let x=S.firstChild;x.to>n.pos-20&&!/\S/.test(n.state.sliceDoc(x.to,n.pos))&&(v=v.concat(m.text))}return{from:d,options:v,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}else return null}}const w=j.define({name:"xml",parser:$e.configure({props:[U.add({Element(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"OpenTag CloseTag SelfClosingTag"(e){return e.column(e.node.from)+e.unit}}),Z.add({Element(e){let t=e.firstChild,o=e.lastChild;return!t||t.name!="OpenTag"?null:{from:t.to,to:o.name=="CloseTag"?o.from:e.to}}}),B.add({"OpenTag CloseTag":e=>e.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/$/}});function he(e={}){let t=[w.data.of({autocomplete:ue(e.elements||[],e.attributes||[])})];return e.autoCloseTags!==!1&&t.push(fe),new Y(w,t)}function z(e,t,o=e.length){if(!t)return"";let O=t.firstChild,r=O&&O.getChild("TagName");return r?e.sliceString(r.from,Math.min(r.to,o)):""}const fe=D.inputHandler.of((e,t,o,O,r)=>{if(e.composing||e.state.readOnly||t!=o||O!=">"&&O!="/"||!w.isActiveAt(e.state,t,-1))return!1;let a=r(),{state:s}=a,f=s.changeByRange(n=>{var $,c,p;let{head:l}=n,d=s.doc.sliceString(l-1,l)==O,S=k(s).resolveInner(l,-1),i;if(d&&O==">"&&S.name=="EndTag"){let m=S.parent;if(((c=($=m.parent)===null||$===void 0?void 0:$.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(i=z(s.doc,m.parent,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=``;return{range:n,changes:{from:l,to:g,insert:q}}}}else if(d&&O=="/"&&S.name=="StartCloseTag"){let m=S.parent;if(S.from==l-2&&((p=m.lastChild)===null||p===void 0?void 0:p.name)!="CloseTag"&&(i=z(s.doc,m,l))){let g=l+(s.doc.sliceString(l,l+1)===">"?1:0),q=`${i}>`;return{range:M.cursor(l+q.length,-1),changes:{from:l,to:g,insert:q}}}}return{range:n}});return f.changes.empty?!1:(e.dispatch([a,s.update(f,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});export{fe as autoCloseTags,ue as completeFromSchema,he as xml,w as xmlLanguage}; diff --git a/internal/relay/web-dist/assets/login-6vnLvdhD.js b/internal/relay/web-dist/assets/login-B-BiQRGX.js similarity index 67% rename from internal/relay/web-dist/assets/login-6vnLvdhD.js rename to internal/relay/web-dist/assets/login-B-BiQRGX.js index 4e978fa9..0fe364d7 100644 --- a/internal/relay/web-dist/assets/login-6vnLvdhD.js +++ b/internal/relay/web-dist/assets/login-B-BiQRGX.js @@ -1 +1 @@ -import{aq as x,bI as u,a8 as I,bu as L,aJ as B,bx as f,ac as C,cy as o,al as r,cb as e,n as q,ab as l,g as V,c4 as n,j as A,k as _,m as g,B as P,aj as h,ae as S,ad as E,bj as b,an as M,h as U,ce as j,v as F,aR as R,aa as D}from"./useI18n-CnvN0FfF.js";import{s as T,A as G}from"./client-2UEf7AK8.js";import{g as H,a as J}from"./auth-Dhl8fEWW.js";import{formatVersionLabel as O,fetchVersion as z}from"./version-DPtnfoOB.js";import{L as K,a as Q}from"./mobile-guard-DNP_n6iV.js";import"./pwa-C6kIEQJT.js";const W={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/signup.html"},ae={class:"auth-version"},te=x({__name:"App",setup(re){const d=u(""),p=u(""),i=u(!1),c=u(""),v=u("dev"),{t:a}=j(),y=I(()=>O(v.value,a));L(async()=>{try{const{admin_exists:s}=await H();if(!s){location.replace("/firstrun.html");return}}catch{}v.value=await z()});function w(s){if(s instanceof G){if(s.code==="invalid_credentials")return a("auth.errors.invalidCredentials");if(s.code==="rate_limited")return a("auth.errors.rateLimited");if(s.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signInFailed")}async function N(s){if(s.preventDefault(),!i.value){c.value="",i.value=!0;try{await J(d.value,p.value);const t=new URLSearchParams(location.search).get("next");location.assign(T(t))}catch(t){c.value=w(t)}finally{i.value=!1}}}const k=B();return(s,t)=>(f(),C(e(U),{theme:e(M),"theme-overrides":e(k),locale:e(b).locale,"date-locale":e(b).dateLocale},{default:o(()=>[r(e(q),null,{default:o(()=>[l("main",W,[r(K,{class:"auth-language"}),r(e(V),{class:"auth-card",bordered:!1},{default:o(()=>[l("header",X,[l("h1",null,n(e(a)("common.appName")),1),l("p",Y,n(e(a)("auth.signIn")),1)]),r(e(A),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:o(()=>[r(e(_),{label:e(a)("auth.email"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:d.value,"onUpdate:value":t[0]||(t[0]=m=>d.value=m),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(_),{label:e(a)("auth.password"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:p.value,"onUpdate:value":t[1]||(t[1]=m=>p.value=m),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"current-password"}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:i.value,disabled:i.value,block:""},{default:o(()=>[h(n(e(a)("auth.signIn")),1)]),_:1},8,["loading","disabled"]),c.value?(f(),S("p",Z,n(c.value),1)):E("",!0),l("p",$,[h(n(e(a)("auth.haveInviteCode"))+" ",1),l("a",ee,n(e(a)("auth.signUpHere")),1),t[2]||(t[2]=h(". "))])]),_:1})]),_:1}),l("p",ae,n(y.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=F(te,[["__scopeId","data-v-45a8746e"]]);Q("login")||(R(),D(se).mount("#app")); +import{ap as x,bH as u,a7 as I,bt as L,aI as B,bw as f,ab as C,cx as o,ak as r,ca as e,n as V,aa as l,g as q,c3 as n,j as A,k as _,m as g,B as P,ai as h,ad as S,ac as E,bi as b,am as M,h as U,cd as F,v as D,aQ as H,a9 as R}from"./useI18n-lwZlSdSx.js";import{s as T,A as j}from"./client-DMh7GjbV.js";import{g as G,a as O}from"./auth-B3RxKR1W.js";import{formatVersionLabel as Q,fetchVersion as z}from"./version-Dm8mqW3q.js";import{L as J,a as K}from"./mobile-guard-Cco5WjS8.js";import"./pwa-BO-YW0rH.js";const W={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/signup.html"},ae={class:"auth-version"},te=x({__name:"App",setup(re){const d=u(""),p=u(""),i=u(!1),c=u(""),v=u("dev"),{t:a}=F(),y=I(()=>Q(v.value,a));L(async()=>{try{const{admin_exists:s}=await G();if(!s){location.replace("/firstrun.html");return}}catch{}v.value=await z()});function w(s){if(s instanceof j){if(s.code==="invalid_credentials")return a("auth.errors.invalidCredentials");if(s.code==="rate_limited")return a("auth.errors.rateLimited");if(s.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signInFailed")}async function N(s){if(s.preventDefault(),!i.value){c.value="",i.value=!0;try{await O(d.value,p.value);const t=new URLSearchParams(location.search).get("next");location.assign(T(t))}catch(t){c.value=w(t)}finally{i.value=!1}}}const k=B();return(s,t)=>(f(),C(e(U),{theme:e(M),"theme-overrides":e(k),locale:e(b).locale,"date-locale":e(b).dateLocale},{default:o(()=>[r(e(V),null,{default:o(()=>[l("main",W,[r(J,{class:"auth-language"}),r(e(q),{class:"auth-card",bordered:!1},{default:o(()=>[l("header",X,[l("h1",null,n(e(a)("common.appName")),1),l("p",Y,n(e(a)("auth.signIn")),1)]),r(e(A),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:o(()=>[r(e(_),{label:e(a)("auth.email"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:d.value,"onUpdate:value":t[0]||(t[0]=m=>d.value=m),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),r(e(_),{label:e(a)("auth.password"),"show-feedback":!1},{default:o(()=>[r(e(g),{value:p.value,"onUpdate:value":t[1]||(t[1]=m=>p.value=m),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"current-password"}},null,8,["value"])]),_:1},8,["label"]),r(e(P),{class:"submit-btn",type:"primary","attr-type":"submit",loading:i.value,disabled:i.value,block:""},{default:o(()=>[h(n(e(a)("auth.signIn")),1)]),_:1},8,["loading","disabled"]),c.value?(f(),S("p",Z,n(c.value),1)):E("",!0),l("p",$,[h(n(e(a)("auth.haveInviteCode"))+" ",1),l("a",ee,n(e(a)("auth.signUpHere")),1),t[2]||(t[2]=h(". "))])]),_:1})]),_:1}),l("p",ae,n(y.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=D(te,[["__scopeId","data-v-45a8746e"]]);K("login")||(H(),R(se).mount("#app")); diff --git a/internal/relay/web-dist/assets/mobile-guard-Cco5WjS8.js b/internal/relay/web-dist/assets/mobile-guard-Cco5WjS8.js new file mode 100644 index 00000000..dcbc06f9 --- /dev/null +++ b/internal/relay/web-dist/assets/mobile-guard-Cco5WjS8.js @@ -0,0 +1 @@ +import{ap as _,bw as t,ad as n,aa as o,c3 as c,ca as s,F as g,bJ as d,cd as m,v as b,b3 as v,be as h}from"./useI18n-lwZlSdSx.js";const y={class:"language-select"},C=["value"],L=["value"],k=_({__name:"LanguageSelect",setup(e){const{t:l,languageOptions:u,localePreference:i,setLocalePreference:f}=m();async function p(r){await f(r.target.value)}return(r,x)=>(t(),n("label",y,[o("span",null,c(s(l)("common.language")),1),o("select",{"data-testid":"language-select",value:s(i),onChange:p},[(t(!0),n(g,null,d(s(u),a=>(t(),n("option",{key:a.value,value:a.value},c(a.label),9,L))),128))],40,C)]))}}),S=b(k,[["__scopeId","data-v-abd76a8e"]]);function w(e){return v()?h()!==null?e==="setup"||e==="login"||e==="signup"||e==="firstrun"?(location.replace("/"),!0):!1:e==="setup"?!1:(location.replace("/setup.html"),!0):!1}export{S as L,w as a}; diff --git a/internal/relay/web-dist/assets/mobile-guard-DNP_n6iV.js b/internal/relay/web-dist/assets/mobile-guard-DNP_n6iV.js deleted file mode 100644 index 1c3ed47f..00000000 --- a/internal/relay/web-dist/assets/mobile-guard-DNP_n6iV.js +++ /dev/null @@ -1 +0,0 @@ -import{aq as g,bx as t,ae as n,ab as o,c4 as c,cb as s,F as p,bK as d,ce as b,v as m,b4 as v,bf as h}from"./useI18n-CnvN0FfF.js";const y={class:"language-select"},C=["value"],L=["value"],x=g({__name:"LanguageSelect",setup(e){const{t:l,languageOptions:u,localePreference:i,setLocalePreference:f}=b();async function _(r){await f(r.target.value)}return(r,k)=>(t(),n("label",y,[o("span",null,c(s(l)("common.language")),1),o("select",{"data-testid":"language-select",value:s(i),onChange:_},[(t(!0),n(p,null,d(s(u),a=>(t(),n("option",{key:a.value,value:a.value},c(a.label),9,L))),128))],40,C)]))}}),S=m(x,[["__scopeId","data-v-abd76a8e"]]);function E(e){return v()?h()!==null?e==="setup"||e==="login"||e==="signup"||e==="firstrun"?(location.replace("/"),!0):!1:e==="setup"?!1:(location.replace("/setup.html"),!0):!1}export{S as L,E as a}; diff --git a/internal/relay/web-dist/assets/prefsSync-D8z1rJ8H.js b/internal/relay/web-dist/assets/prefsSync-C5tz9Q-s.js similarity index 93% rename from internal/relay/web-dist/assets/prefsSync-D8z1rJ8H.js rename to internal/relay/web-dist/assets/prefsSync-C5tz9Q-s.js index 932b870d..793d8e84 100644 --- a/internal/relay/web-dist/assets/prefsSync-D8z1rJ8H.js +++ b/internal/relay/web-dist/assets/prefsSync-C5tz9Q-s.js @@ -1 +1 @@ -import{a as s}from"./client-2UEf7AK8.js";import"./useI18n-CnvN0FfF.js";const c=["locale_preference","quick_templates","notifications_enabled","ai_notifications_only","command_notify_threshold_seconds","shell_integration_enabled","pinned_session_ids"];class u{constructor(a,t){this.adapter=a,this.relay=t}async pull(){const a=await this.relay.get();for(const t of a){const e=this.adapter.readMeta(t.key);if(t.updated_at>e.updatedAtLocal){if(e.dirty)continue;this.adapter.writeValue(t.key,t.value),this.adapter.writeMeta(t.key,{updatedAtLocal:t.updated_at,dirty:!1})}}}markDirty(a,t){this.adapter.writeMeta(a,{updatedAtLocal:t,dirty:!0})}async push(){const a=[];for(const e of this.adapter.keys()){const i=this.adapter.readMeta(e);if(!i.dirty)continue;const o=this.adapter.readValue(e);o!==void 0&&a.push({key:e,value:o,client_updated_at:i.updatedAtLocal})}if(a.length===0)return;const t=await this.relay.put(a);for(const e of t)this.adapter.writeValue(e.key,e.value),this.adapter.writeMeta(e.key,{updatedAtLocal:e.updated_at,dirty:!1})}}function p(){const r=t=>`atterm.${t}.value`,a=t=>`atterm.${t}.meta`;return{readValue(t){const e=localStorage.getItem(r(t));if(e!==null)try{return JSON.parse(e)}catch{return}},writeValue(t,e){localStorage.setItem(r(t),JSON.stringify(e))},readMeta(t){const e=localStorage.getItem(a(t));if(e===null)return{updatedAtLocal:0,dirty:!1};try{const i=JSON.parse(e);return{updatedAtLocal:Number((i==null?void 0:i.updatedAtLocal)??0),dirty:!!(i!=null&&i.dirty)}}catch{return{updatedAtLocal:0,dirty:!1}}},writeMeta(t,e){localStorage.setItem(a(t),JSON.stringify(e))},keys(){return[...c]}}}function y(){return{async get(){const{data:r}=await s("/api/me/preferences");return r.items??[]},async put(r){const{data:a}=await s("/api/me/preferences",{method:"PUT",body:JSON.stringify({items:r})});return a.items??[]}}}let n=null;function f(r){n=r}function h(r){n&&(n.markDirty(r,Date.now()),n.push().catch(()=>{}))}export{u as PrefsSyncEngine,c as SYNCED_KEYS,y as apiRelayClient,p as localStorageAdapter,h as notifyLocalChange,f as setSharedPrefsSync}; +import{a as s}from"./client-DMh7GjbV.js";import"./useI18n-lwZlSdSx.js";const c=["locale_preference","quick_templates","notifications_enabled","ai_notifications_only","command_notify_threshold_seconds","shell_integration_enabled","pinned_session_ids"];class u{constructor(a,t){this.adapter=a,this.relay=t}async pull(){const a=await this.relay.get();for(const t of a){const e=this.adapter.readMeta(t.key);if(t.updated_at>e.updatedAtLocal){if(e.dirty)continue;this.adapter.writeValue(t.key,t.value),this.adapter.writeMeta(t.key,{updatedAtLocal:t.updated_at,dirty:!1})}}}markDirty(a,t){this.adapter.writeMeta(a,{updatedAtLocal:t,dirty:!0})}async push(){const a=[];for(const e of this.adapter.keys()){const i=this.adapter.readMeta(e);if(!i.dirty)continue;const o=this.adapter.readValue(e);o!==void 0&&a.push({key:e,value:o,client_updated_at:i.updatedAtLocal})}if(a.length===0)return;const t=await this.relay.put(a);for(const e of t)this.adapter.writeValue(e.key,e.value),this.adapter.writeMeta(e.key,{updatedAtLocal:e.updated_at,dirty:!1})}}function p(){const r=t=>`atterm.${t}.value`,a=t=>`atterm.${t}.meta`;return{readValue(t){const e=localStorage.getItem(r(t));if(e!==null)try{return JSON.parse(e)}catch{return}},writeValue(t,e){localStorage.setItem(r(t),JSON.stringify(e))},readMeta(t){const e=localStorage.getItem(a(t));if(e===null)return{updatedAtLocal:0,dirty:!1};try{const i=JSON.parse(e);return{updatedAtLocal:Number((i==null?void 0:i.updatedAtLocal)??0),dirty:!!(i!=null&&i.dirty)}}catch{return{updatedAtLocal:0,dirty:!1}}},writeMeta(t,e){localStorage.setItem(a(t),JSON.stringify(e))},keys(){return[...c]}}}function y(){return{async get(){const{data:r}=await s("/api/me/preferences");return r.items??[]},async put(r){const{data:a}=await s("/api/me/preferences",{method:"PUT",body:JSON.stringify({items:r})});return a.items??[]}}}let n=null;function f(r){n=r}function h(r){n&&(n.markDirty(r,Date.now()),n.push().catch(()=>{}))}export{u as PrefsSyncEngine,c as SYNCED_KEYS,y as apiRelayClient,p as localStorageAdapter,h as notifyLocalChange,f as setSharedPrefsSync}; diff --git a/internal/relay/web-dist/assets/pwa-C6kIEQJT.js b/internal/relay/web-dist/assets/pwa-BO-YW0rH.js similarity index 92% rename from internal/relay/web-dist/assets/pwa-C6kIEQJT.js rename to internal/relay/web-dist/assets/pwa-BO-YW0rH.js index ffda6e2f..84e6289f 100644 --- a/internal/relay/web-dist/assets/pwa-C6kIEQJT.js +++ b/internal/relay/web-dist/assets/pwa-BO-YW0rH.js @@ -1 +1 @@ -import{_ as f}from"./useI18n-CnvN0FfF.js";import{l as p,d as y}from"./auth-Dhl8fEWW.js";function g(e={}){const{immediate:n=!1,onNeedRefresh:a,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:o}=e;let c,d;const l=async(t=!0)=>{await d};async function u(){if("serviceWorker"in navigator){if(c=await f(async()=>{const{Workbox:t}=await import("./workbox-window.prod.es5-BqEJf4Xk.js");return{Workbox:t}},[]).then(({Workbox:t})=>new t("/sw.js",{scope:"/",type:"classic"})).catch(t=>{o==null||o(t)}),!c)return;c.addEventListener("activated",t=>{(t.isUpdate||t.isExternal)&&window.location.reload()}),c.addEventListener("installed",t=>{t.isUpdate||r==null||r()}),c.register({immediate:n}).then(t=>{s?s("/sw.js",t):i==null||i(t)}).catch(t=>{o==null||o(t)})}}return d=u(),l}const v="atterm-decrypt-sealed-body";function h(e){try{const n=e.replace(/-/g,"+").replace(/_/g,"/"),a=n.length%4===0?"":"=".repeat(4-n.length%4),r=atob(n+a),i=new Uint8Array(r.length);for(let s=0;s"u"||!("serviceWorker"in navigator))return;const e=navigator.serviceWorker;!e||typeof e.addEventListener!="function"||e.addEventListener("message",n=>{var s;const a=n.data;if(!_(a))return;const r=(s=n.ports)==null?void 0:s[0];if(!r)return;let i;try{i=m(a)}catch{i={fields:null}}try{r.postMessage(i)}catch{}})}typeof navigator<"u"&&"serviceWorker"in navigator&&(g({immediate:!0}),w()); +import{_ as f}from"./useI18n-lwZlSdSx.js";import{l as p,d as y}from"./auth-B3RxKR1W.js";function g(e={}){const{immediate:n=!1,onNeedRefresh:a,onOfflineReady:r,onRegistered:i,onRegisteredSW:s,onRegisterError:o}=e;let c,d;const l=async(t=!0)=>{await d};async function u(){if("serviceWorker"in navigator){if(c=await f(async()=>{const{Workbox:t}=await import("./workbox-window.prod.es5-BqEJf4Xk.js");return{Workbox:t}},[]).then(({Workbox:t})=>new t("/sw.js",{scope:"/",type:"classic"})).catch(t=>{o==null||o(t)}),!c)return;c.addEventListener("activated",t=>{(t.isUpdate||t.isExternal)&&window.location.reload()}),c.addEventListener("installed",t=>{t.isUpdate||r==null||r()}),c.register({immediate:n}).then(t=>{s?s("/sw.js",t):i==null||i(t)}).catch(t=>{o==null||o(t)})}}return d=u(),l}const v="atterm-decrypt-sealed-body";function h(e){try{const n=e.replace(/-/g,"+").replace(/_/g,"/"),a=n.length%4===0?"":"=".repeat(4-n.length%4),r=atob(n+a),i=new Uint8Array(r.length);for(let s=0;s"u"||!("serviceWorker"in navigator))return;const e=navigator.serviceWorker;!e||typeof e.addEventListener!="function"||e.addEventListener("message",n=>{var s;const a=n.data;if(!_(a))return;const r=(s=n.ports)==null?void 0:s[0];if(!r)return;let i;try{i=m(a)}catch{i={fields:null}}try{r.postMessage(i)}catch{}})}typeof navigator<"u"&&"serviceWorker"in navigator&&(g({immediate:!0}),w()); diff --git a/internal/relay/web-dist/assets/sessions-Uw5ok8wO.js b/internal/relay/web-dist/assets/sessions-RpM2fLHY.js similarity index 82% rename from internal/relay/web-dist/assets/sessions-Uw5ok8wO.js rename to internal/relay/web-dist/assets/sessions-RpM2fLHY.js index 4569727e..ea26a0f0 100644 --- a/internal/relay/web-dist/assets/sessions-Uw5ok8wO.js +++ b/internal/relay/web-dist/assets/sessions-RpM2fLHY.js @@ -1 +1 @@ -import{a as r}from"./client-2UEf7AK8.js";import{l as c,e as a}from"./auth-Dhl8fEWW.js";import"./useI18n-CnvN0FfF.js";async function p(){const{data:t}=await r("/api/sessions");return d(t)}function d(t){const e=c();return e?t.map(o=>s(o,e)):t}function s(t,e){if(!t.sealed)return t;let o;try{o=u(t.sealed)}catch{return t}const n=a(o,e,t.id);if(!n)return t;const i={...t};return n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.cwd=n.cwd),n.command!==void 0&&(i.command=n.command),n.current_command!==void 0&&(i.current_command=n.current_command),i}function u(t){const e=atob(t),o=new Uint8Array(e.length);for(let n=0;ns(o,e)):t}function s(t,e){if(!t.sealed)return t;let o;try{o=u(t.sealed)}catch{return t}const n=a(o,e,t.id);if(!n)return t;const i={...t};return n.title!==void 0&&(i.title=n.title),n.cwd!==void 0&&(i.cwd=n.cwd),n.command!==void 0&&(i.command=n.command),n.current_command!==void 0&&(i.current_command=n.current_command),i}function u(t){const e=atob(t),o=new Uint8Array(e.length);for(let n=0;n!n.value||n.value==="https://"?null:_(n.value,d.value));async function k(){o.value=null;const p=_(n.value,d.value);if(p){o.value=p;return}if(!c.value.trim()){o.value=a("setup.errors.tokenRequired");return}u.value=!0;try{const t=n.value.replace(/\/$/,"")+"/api/me",r=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${c.value.trim()}`},credentials:"omit"});if(r.status===401){o.value=a("setup.errors.tokenInvalid");return}if(r.status===403){o.value=a("setup.errors.originRejected");return}if(!r.ok){o.value=a("setup.errors.relayHttpCheckUrl",{status:r.status});return}const U={baseURL:n.value.replace(/\/$/,""),sessionToken:c.value.trim(),expiresAt:null,allowInsecure:d.value};G(U),location.replace("/")}catch(t){o.value=a("setup.errors.cannotReachRelay",{message:t instanceof Error?t.message:String(t)})}finally{u.value=!1}}const C=A();return(p,t)=>(v(),m(e(q),{theme:e($),"theme-overrides":e(C),locale:e(I).locale,"date-locale":e(I).dateLocale},{default:s(()=>[l(e(L),null,{default:s(()=>[P("main",Q,[l(J,{class:"setup-language"}),l(e(T),{title:e(a)("setup.connectToRelay"),class:"setup-card"},{default:s(()=>[y.value?(v(),m(e(R),{key:0,type:"warning","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(y.value),1)]),_:1})):N("",!0),l(e(j),{onSubmit:E(k,["prevent"])},{default:s(()=>[l(e(h),V({label:e(a)("setup.relayUrl"),feedback:g.value??""},g.value?{"validation-status":"error"}:{}),{default:s(()=>[l(e(w),{value:n.value,"onUpdate:value":t[0]||(t[0]=r=>n.value=r),placeholder:e(a)("setup.relayUrlPlaceholder"),"input-props":{name:"relay-base",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},16,["label","feedback"]),l(e(h),{label:e(a)("setup.token")},{default:s(()=>[l(e(w),{value:c.value,"onUpdate:value":t[1]||(t[1]=r=>c.value=r),type:"password","show-password-on":"click",placeholder:e(a)("setup.tokenPlaceholder"),"input-props":{name:"relay-token",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},8,["label"]),l(e(h),{label:e(a)("setup.allowInsecure")},{default:s(()=>[l(e(W),{value:d.value,"onUpdate:value":t[2]||(t[2]=r=>d.value=r),disabled:u.value},null,8,["value","disabled"])]),_:1},8,["label"]),o.value?(v(),m(e(R),{key:0,type:"error","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(o.value),1)]),_:1})):N("",!0),l(e(K),{justify:"end"},{default:s(()=>[l(e(M),{type:"primary",loading:u.value,disabled:u.value,"data-testid":"connect",onClick:k},{default:s(()=>[f(b(e(a)("setup.connect")),1)]),_:1},8,["loading","disabled"])]),_:1})]),_:1})]),_:1},8,["title"])])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),Y=z(X,[["__scopeId","data-v-adef5cda"]]);O("setup")||(D(),H(Y).mount("#app")); diff --git a/internal/relay/web-dist/assets/setup-WUaGlTjO.js b/internal/relay/web-dist/assets/setup-WUaGlTjO.js new file mode 100644 index 00000000..f7e6e1bc --- /dev/null +++ b/internal/relay/web-dist/assets/setup-WUaGlTjO.js @@ -0,0 +1 @@ +import{ap as A,bH as i,a7 as S,ct as _,aI as x,bw as v,ab as m,cx as s,ak as l,ca as e,n as L,aa as P,g as T,ai as f,c3 as b,ac as w,j as V,cA as E,k as g,bg as j,m as N,B as M,bi as I,am as $,h as F,cd as G,bV as H,v as q,aQ as z,a9 as D}from"./useI18n-lwZlSdSx.js";import{L as O,a as Q}from"./mobile-guard-Cco5WjS8.js";import{N as R,b as J,a as K}from"./Switch-DguIL3dU.js";const W={class:"setup-page"},X=A({__name:"App",setup(Z){const n=i("https://"),c=i(""),d=i(!1),o=i(null),u=i(!1),{t:a}=G();function B(){return new URLSearchParams(location.search).get("reason")==="token_invalid"?a("setup.reasonTokenInvalid"):null}const h=i(B()),y=S(()=>!n.value||n.value==="https://"?null:_(n.value,d.value));async function k(){o.value=null;const p=_(n.value,d.value);if(p){o.value=p;return}if(!c.value.trim()){o.value=a("setup.errors.tokenRequired");return}u.value=!0;try{const t=n.value.replace(/\/$/,"")+"/api/me",r=await fetch(t,{method:"GET",headers:{Authorization:`Bearer ${c.value.trim()}`},credentials:"omit"});if(r.status===401){o.value=a("setup.errors.tokenInvalid");return}if(r.status===403){o.value=a("setup.errors.originRejected");return}if(!r.ok){o.value=a("setup.errors.relayHttpCheckUrl",{status:r.status});return}const U={baseURL:n.value.replace(/\/$/,""),sessionToken:c.value.trim(),expiresAt:null,allowInsecure:d.value};H(U),location.replace("/")}catch(t){o.value=a("setup.errors.cannotReachRelay",{message:t instanceof Error?t.message:String(t)})}finally{u.value=!1}}const C=x();return(p,t)=>(v(),m(e(F),{theme:e($),"theme-overrides":e(C),locale:e(I).locale,"date-locale":e(I).dateLocale},{default:s(()=>[l(e(L),null,{default:s(()=>[P("main",W,[l(O,{class:"setup-language"}),l(e(T),{title:e(a)("setup.connectToRelay"),class:"setup-card"},{default:s(()=>[h.value?(v(),m(e(R),{key:0,type:"warning","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(h.value),1)]),_:1})):w("",!0),l(e(V),{onSubmit:E(k,["prevent"])},{default:s(()=>[l(e(g),j({label:e(a)("setup.relayUrl"),feedback:y.value??""},y.value?{"validation-status":"error"}:{}),{default:s(()=>[l(e(N),{value:n.value,"onUpdate:value":t[0]||(t[0]=r=>n.value=r),placeholder:e(a)("setup.relayUrlPlaceholder"),"input-props":{name:"relay-base",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},16,["label","feedback"]),l(e(g),{label:e(a)("setup.token")},{default:s(()=>[l(e(N),{value:c.value,"onUpdate:value":t[1]||(t[1]=r=>c.value=r),type:"password","show-password-on":"click",placeholder:e(a)("setup.tokenPlaceholder"),"input-props":{name:"relay-token",autocomplete:"off"},disabled:u.value},null,8,["value","placeholder","disabled"])]),_:1},8,["label"]),l(e(g),{label:e(a)("setup.allowInsecure")},{default:s(()=>[l(e(J),{value:d.value,"onUpdate:value":t[2]||(t[2]=r=>d.value=r),disabled:u.value},null,8,["value","disabled"])]),_:1},8,["label"]),o.value?(v(),m(e(R),{key:0,type:"error","show-icon":!0,style:{"margin-bottom":"1rem"}},{default:s(()=>[f(b(o.value),1)]),_:1})):w("",!0),l(e(K),{justify:"end"},{default:s(()=>[l(e(M),{type:"primary",loading:u.value,disabled:u.value,"data-testid":"connect",onClick:k},{default:s(()=>[f(b(e(a)("setup.connect")),1)]),_:1},8,["loading","disabled"])]),_:1})]),_:1})]),_:1},8,["title"])])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),Y=q(X,[["__scopeId","data-v-adef5cda"]]);Q("setup")||(z(),D(Y).mount("#app")); diff --git a/internal/relay/web-dist/assets/signup-AhbkM-pD.js b/internal/relay/web-dist/assets/signup-AhbkM-pD.js deleted file mode 100644 index 17517364..00000000 --- a/internal/relay/web-dist/assets/signup-AhbkM-pD.js +++ /dev/null @@ -1 +0,0 @@ -import{aq as I,bI as u,a8 as L,bu as q,aJ as A,bx as g,ac as C,cy as l,al as s,cb as e,n as B,ab as o,g as U,c4 as n,j as V,k as f,m as h,B as E,aj as _,ae as P,ad as S,bj as w,an as M,h as j,ce as F,v as R,aR as T,aa as D}from"./useI18n-CnvN0FfF.js";import{s as G,A as H}from"./client-2UEf7AK8.js";import{s as J}from"./auth-Dhl8fEWW.js";import{formatVersionLabel as O,fetchVersion as W}from"./version-DPtnfoOB.js";import{L as z,a as K}from"./mobile-guard-DNP_n6iV.js";import"./pwa-C6kIEQJT.js";const Q={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/login.html"},ae={class:"auth-version"},te=I({__name:"App",setup(re){const p=u(""),m=u(""),v=u(""),i=u(!1),c=u(""),b=u("dev"),{t:a}=F(),y=L(()=>O(b.value,a));q(async()=>{b.value=await W()});function k(r){if(r instanceof H){if(r.code==="email_taken")return a("auth.errors.emailTaken");if(r.code==="invite_invalid")return a("auth.errors.inviteInvalid");if(r.code==="password_weak")return a("auth.errors.passwordWeak");if(r.code==="invalid_email")return a("auth.errors.invalidEmail");if(r.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(r.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signUpFailed")}async function N(r){if(r.preventDefault(),!i.value){c.value="",i.value=!0;try{await J(p.value,m.value,v.value);const t=new URLSearchParams(location.search).get("next");location.assign(G(t))}catch(t){c.value=k(t)}finally{i.value=!1}}}const x=A();return(r,t)=>(g(),C(e(j),{theme:e(M),"theme-overrides":e(x),locale:e(w).locale,"date-locale":e(w).dateLocale},{default:l(()=>[s(e(B),null,{default:l(()=>[o("main",Q,[s(z,{class:"auth-language"}),s(e(U),{class:"auth-card",bordered:!1},{default:l(()=>[o("header",X,[o("h1",null,n(e(a)("common.appName")),1),o("p",Y,n(e(a)("auth.signUp")),1)]),s(e(V),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:l(()=>[s(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:l(()=>[s(e(h),{value:p.value,"onUpdate:value":t[0]||(t[0]=d=>p.value=d),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:l(()=>[s(e(h),{value:m.value,"onUpdate:value":t[1]||(t[1]=d=>m.value=d),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.inviteCode"),"show-feedback":!1},{default:l(()=>[s(e(h),{value:v.value,"onUpdate:value":t[2]||(t[2]=d=>v.value=d),type:"text","input-props":{required:!0,autocomplete:"off"}},null,8,["value"])]),_:1},8,["label"]),s(e(E),{class:"submit-btn",type:"primary","attr-type":"submit",loading:i.value,disabled:i.value,block:""},{default:l(()=>[_(n(e(a)("auth.createAccount")),1)]),_:1},8,["loading","disabled"]),c.value?(g(),P("p",Z,n(c.value),1)):S("",!0),o("p",$,[_(n(e(a)("auth.alreadyHaveAccount"))+" ",1),o("a",ee,n(e(a)("auth.signIn")),1),t[3]||(t[3]=_(". "))])]),_:1})]),_:1}),o("p",ae,n(y.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=R(te,[["__scopeId","data-v-04270efb"]]);K("signup")||(T(),D(se).mount("#app")); diff --git a/internal/relay/web-dist/assets/signup-BXhwDxUo.js b/internal/relay/web-dist/assets/signup-BXhwDxUo.js new file mode 100644 index 00000000..ce3fa276 --- /dev/null +++ b/internal/relay/web-dist/assets/signup-BXhwDxUo.js @@ -0,0 +1 @@ +import{ap as I,bH as i,a7 as L,bt as A,aI as C,bw as g,ab as q,cx as o,ak as s,ca as e,n as B,aa as l,g as U,c3 as n,j as V,k as f,m as h,B as E,ai as _,ad as P,ac as S,bi as w,am as M,h as F,cd as T,v as D,aQ as H,a9 as R}from"./useI18n-lwZlSdSx.js";import{s as j,A as G}from"./client-DMh7GjbV.js";import{s as O}from"./auth-B3RxKR1W.js";import{formatVersionLabel as Q,fetchVersion as W}from"./version-Dm8mqW3q.js";import{L as z,a as J}from"./mobile-guard-Cco5WjS8.js";import"./pwa-BO-YW0rH.js";const K={class:"auth-page"},X={class:"auth-title"},Y={class:"auth-subtitle"},Z={key:0,class:"auth-error",role:"alert"},$={class:"auth-alt"},ee={href:"/login.html"},ae={class:"auth-version"},te=I({__name:"App",setup(re){const p=i(""),m=i(""),v=i(""),u=i(!1),c=i(""),b=i("dev"),{t:a}=T(),k=L(()=>Q(b.value,a));A(async()=>{b.value=await W()});function y(r){if(r instanceof G){if(r.code==="email_taken")return a("auth.errors.emailTaken");if(r.code==="invite_invalid")return a("auth.errors.inviteInvalid");if(r.code==="password_weak")return a("auth.errors.passwordWeak");if(r.code==="invalid_email")return a("auth.errors.invalidEmail");if(r.code==="rate_limited")return a("auth.errors.rateLimitedShort");if(r.code==="invalid_request")return a("auth.errors.invalidRequest")}return a("auth.errors.signUpFailed")}async function N(r){if(r.preventDefault(),!u.value){c.value="",u.value=!0;try{await O(p.value,m.value,v.value);const t=new URLSearchParams(location.search).get("next");location.assign(j(t))}catch(t){c.value=y(t)}finally{u.value=!1}}}const x=C();return(r,t)=>(g(),q(e(F),{theme:e(M),"theme-overrides":e(x),locale:e(w).locale,"date-locale":e(w).dateLocale},{default:o(()=>[s(e(B),null,{default:o(()=>[l("main",K,[s(z,{class:"auth-language"}),s(e(U),{class:"auth-card",bordered:!1},{default:o(()=>[l("header",X,[l("h1",null,n(e(a)("common.appName")),1),l("p",Y,n(e(a)("auth.signUp")),1)]),s(e(V),{"label-placement":"top","require-mark-placement":"right-hanging",autocomplete:"on",novalidate:"",onSubmit:N},{default:o(()=>[s(e(f),{label:e(a)("auth.email"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:p.value,"onUpdate:value":t[0]||(t[0]=d=>p.value=d),type:"text",placeholder:e(a)("auth.emailPlaceholder"),"input-props":{type:"email",required:!0,autocomplete:"username"}},null,8,["value","placeholder"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.password"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:m.value,"onUpdate:value":t[1]||(t[1]=d=>m.value=d),type:"password","show-password-on":"click","input-props":{required:!0,autocomplete:"new-password",minlength:12}},null,8,["value"])]),_:1},8,["label"]),s(e(f),{label:e(a)("auth.inviteCode"),"show-feedback":!1},{default:o(()=>[s(e(h),{value:v.value,"onUpdate:value":t[2]||(t[2]=d=>v.value=d),type:"text","input-props":{required:!0,autocomplete:"off"}},null,8,["value"])]),_:1},8,["label"]),s(e(E),{class:"submit-btn",type:"primary","attr-type":"submit",loading:u.value,disabled:u.value,block:""},{default:o(()=>[_(n(e(a)("auth.createAccount")),1)]),_:1},8,["loading","disabled"]),c.value?(g(),P("p",Z,n(c.value),1)):S("",!0),l("p",$,[_(n(e(a)("auth.alreadyHaveAccount"))+" ",1),l("a",ee,n(e(a)("auth.signIn")),1),t[3]||(t[3]=_(". "))])]),_:1})]),_:1}),l("p",ae,n(k.value),1)])]),_:1})]),_:1},8,["theme","theme-overrides","locale","date-locale"]))}}),se=D(te,[["__scopeId","data-v-04270efb"]]);J("signup")||(H(),R(se).mount("#app")); diff --git a/internal/relay/web-dist/assets/useI18n-CnvN0FfF.js b/internal/relay/web-dist/assets/useI18n-lwZlSdSx.js similarity index 73% rename from internal/relay/web-dist/assets/useI18n-CnvN0FfF.js rename to internal/relay/web-dist/assets/useI18n-lwZlSdSx.js index b2bf2194..46e5af2f 100644 --- a/internal/relay/web-dist/assets/useI18n-CnvN0FfF.js +++ b/internal/relay/web-dist/assets/useI18n-lwZlSdSx.js @@ -1,23 +1,23 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prefsSync-D8z1rJ8H.js","assets/client-2UEf7AK8.js"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/prefsSync-C5tz9Q-s.js","assets/client-DMh7GjbV.js"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const n of document.querySelectorAll('link[rel="modulepreload"]'))r(n);new MutationObserver(n=>{for(const i of n)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function o(n){const i={};return n.integrity&&(i.integrity=n.integrity),n.referrerPolicy&&(i.referrerPolicy=n.referrerPolicy),n.crossOrigin==="use-credentials"?i.credentials="include":n.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(n){if(n.ep)return;n.ep=!0;const i=o(n);fetch(n.href,i)}})();const up="modulepreload",fp=function(e){return"/"+e},Sl={},pp=function(t,o,r){let n=Promise.resolve();if(o&&o.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));n=Promise.allSettled(o.map(s=>{if(s=fp(s),s in Sl)return;Sl[s]=!0;const c=s.endsWith(".css"),d=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${d}`))return;const u=document.createElement("link");if(u.rel=c?"stylesheet":up,c||(u.as="script"),u.crossOrigin="",u.href=s,l&&u.setAttribute("nonce",l),document.head.appendChild(u),c)return new Promise((p,m)=>{u.addEventListener("load",p),u.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${s}`)))})}))}function i(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return n.then(a=>{for(const l of a||[])l.status==="rejected"&&i(l.reason);return t().catch(i)})};/** * @vue/shared v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**//*! #__NO_SIDE_EFFECTS__ */function ja(e){const t=Object.create(null);for(const o of e.split(","))t[o]=1;return o=>o in t}const Ie={},pr=[],Jt=()=>{},hp=()=>!1,gi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Na=e=>e.startsWith("onUpdate:"),Xe=Object.assign,Va=(e,t)=>{const o=e.indexOf(t);o>-1&&e.splice(o,1)},gp=Object.prototype.hasOwnProperty,$e=(e,t)=>gp.call(e,t),ce=Array.isArray,hr=e=>Cn(e)==="[object Map]",Rr=e=>Cn(e)==="[object Set]",wl=e=>Cn(e)==="[object Date]",me=e=>typeof e=="function",We=e=>typeof e=="string",Ot=e=>typeof e=="symbol",ze=e=>e!==null&&typeof e=="object",lc=e=>(ze(e)||me(e))&&me(e.then)&&me(e.catch),sc=Object.prototype.toString,Cn=e=>sc.call(e),mp=e=>Cn(e).slice(8,-1),cc=e=>Cn(e)==="[object Object]",qa=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,Ur=ja(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mi=e=>{const t=Object.create(null);return o=>t[o]||(t[o]=e(o))},bp=/-(\w)/g,It=mi(e=>e.replace(bp,(t,o)=>o?o.toUpperCase():"")),vp=/\B([A-Z])/g,Eo=mi(e=>e.replace(vp,"-$1").toLowerCase()),bi=mi(e=>e.charAt(0).toUpperCase()+e.slice(1)),ji=mi(e=>e?`on${bi(e)}`:""),$o=(e,t)=>!Object.is(e,t),Kn=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},oi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},xp=e=>{const t=We(e)?Number(e):NaN;return isNaN(t)?e:t};let Pl;const vi=()=>Pl||(Pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ua(e){if(ce(e)){const t={};for(let o=0;o{if(o){const r=o.split(yp);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Ga(e){let t="";if(We(e))t=e;else if(ce(e))for(let o=0;oer(o,t))}const fc=e=>!!(e&&e.__v_isRef===!0),Rp=e=>We(e)?e:e==null?"":ce(e)||ze(e)&&(e.toString===sc||!me(e.toString))?fc(e)?Rp(e.value):JSON.stringify(e,pc,2):String(e),pc=(e,t)=>fc(t)?pc(e,t.value):hr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[Ni(r,i)+" =>"]=n,o),{})}:Rr(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Ni(o))}:Ot(t)?Ni(t):ze(t)&&!ce(t)&&!cc(t)?String(t):t,Ni=(e,t="")=>{var o;return Ot(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};/** +**//*! #__NO_SIDE_EFFECTS__ */function ja(e){const t=Object.create(null);for(const o of e.split(","))t[o]=1;return o=>o in t}const Me={},pr=[],Jt=()=>{},hp=()=>!1,gi=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Na=e=>e.startsWith("onUpdate:"),Xe=Object.assign,Va=(e,t)=>{const o=e.indexOf(t);o>-1&&e.splice(o,1)},gp=Object.prototype.hasOwnProperty,$e=(e,t)=>gp.call(e,t),ce=Array.isArray,hr=e=>Cn(e)==="[object Map]",Rr=e=>Cn(e)==="[object Set]",wl=e=>Cn(e)==="[object Date]",me=e=>typeof e=="function",We=e=>typeof e=="string",Bt=e=>typeof e=="symbol",_e=e=>e!==null&&typeof e=="object",lc=e=>(_e(e)||me(e))&&me(e.then)&&me(e.catch),sc=Object.prototype.toString,Cn=e=>sc.call(e),mp=e=>Cn(e).slice(8,-1),cc=e=>Cn(e)==="[object Object]",Ua=e=>We(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,qr=ja(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),mi=e=>{const t=Object.create(null);return o=>t[o]||(t[o]=e(o))},bp=/-(\w)/g,Mt=mi(e=>e.replace(bp,(t,o)=>o?o.toUpperCase():"")),vp=/\B([A-Z])/g,Io=mi(e=>e.replace(vp,"-$1").toLowerCase()),bi=mi(e=>e.charAt(0).toUpperCase()+e.slice(1)),ji=mi(e=>e?`on${bi(e)}`:""),$o=(e,t)=>!Object.is(e,t),Kn=(e,...t)=>{for(let o=0;o{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:r,value:o})},oi=e=>{const t=parseFloat(e);return isNaN(t)?e:t},xp=e=>{const t=We(e)?Number(e):NaN;return isNaN(t)?e:t};let Pl;const vi=()=>Pl||(Pl=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function qa(e){if(ce(e)){const t={};for(let o=0;o{if(o){const r=o.split(yp);r.length>1&&(t[r[0].trim()]=r[1].trim())}}),t}function Ga(e){let t="";if(We(e))t=e;else if(ce(e))for(let o=0;oer(o,t))}const fc=e=>!!(e&&e.__v_isRef===!0),Rp=e=>We(e)?e:e==null?"":ce(e)||_e(e)&&(e.toString===sc||!me(e.toString))?fc(e)?Rp(e.value):JSON.stringify(e,pc,2):String(e),pc=(e,t)=>fc(t)?pc(e,t.value):hr(t)?{[`Map(${t.size})`]:[...t.entries()].reduce((o,[r,n],i)=>(o[Ni(r,i)+" =>"]=n,o),{})}:Rr(t)?{[`Set(${t.size})`]:[...t.values()].map(o=>Ni(o))}:Bt(t)?Ni(t):_e(t)&&!ce(t)&&!cc(t)?String(t):t,Ni=(e,t="")=>{var o;return Bt(e)?`Symbol(${(o=e.description)!=null?o:t})`:e};/** * @vue/reactivity v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let vt;class hc{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=vt,!t&&vt&&(this.index=(vt.scopes||(vt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes)for(t=0,o=this.scopes.length;t0)return;if(Kr){let t=Kr;for(Kr=void 0;t;){const o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Gr;){let t=Gr;for(Gr=void 0;t;){const o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=o}}if(e)throw e}function vc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xc(e){let t,o=e.depsTail,r=o;for(;r;){const n=r.prevDep;r.version===-1?(r===o&&(o=n),Ja(r),_p(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=n}e.deps=t,e.depsTail=o}function la(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Cc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Cc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===on))return;e.globalVersion=on;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!la(e)){e.flags&=-3;return}const o=Ae,r=Bt;Ae=e,Bt=!0;try{vc(e);const n=e.fn(e._value);(t.version===0||$o(n,e._value))&&(e._value=n,t.version++)}catch(n){throw t.version++,n}finally{Ae=o,Bt=r,xc(e),e.flags&=-3}}function Ja(e,t=!1){const{dep:o,prevSub:r,nextSub:n}=e;if(r&&(r.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let i=o.computed.deps;i;i=i.nextDep)Ja(i,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function _p(e){const{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}let Bt=!0;const yc=[];function zo(){yc.push(Bt),Bt=!1}function Mo(){const e=yc.pop();Bt=e===void 0?!0:e}function Tl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const o=Ae;Ae=void 0;try{t()}finally{Ae=o}}}let on=0;class Ep{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Za{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!Ae||!Bt||Ae===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==Ae)o=this.activeLink=new Ep(Ae,this),Ae.deps?(o.prevDep=Ae.depsTail,Ae.depsTail.nextDep=o,Ae.depsTail=o):Ae.deps=Ae.depsTail=o,Sc(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const r=o.nextDep;r.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=r),o.prevDep=Ae.depsTail,o.nextDep=void 0,Ae.depsTail.nextDep=o,Ae.depsTail=o,Ae.deps===o&&(Ae.deps=r)}return o}trigger(t){this.version++,on++,this.notify(t)}notify(t){Ya();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Xa()}}}function Sc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Sc(r)}const o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}const ri=new WeakMap,Yo=Symbol(""),sa=Symbol(""),rn=Symbol("");function dt(e,t,o){if(Bt&&Ae){let r=ri.get(e);r||ri.set(e,r=new Map);let n=r.get(o);n||(r.set(o,n=new Za),n.map=r,n.key=o),n.track()}}function so(e,t,o,r,n,i){const a=ri.get(e);if(!a){on++;return}const l=s=>{s&&s.trigger()};if(Ya(),t==="clear")a.forEach(l);else{const s=ce(e),c=s&&qa(o);if(s&&o==="length"){const d=Number(r);a.forEach((u,p)=>{(p==="length"||p===rn||!Ot(p)&&p>=d)&&l(u)})}else switch((o!==void 0||a.has(void 0))&&l(a.get(o)),c&&l(a.get(rn)),t){case"add":s?c&&l(a.get("length")):(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"delete":s||(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"set":hr(e)&&l(a.get(Yo));break}}Xa()}function zp(e,t){const o=ri.get(e);return o&&o.get(t)}function dr(e){const t=we(e);return t===e?t:(dt(t,"iterate",rn),zt(e)?t:t.map(ut))}function xi(e){return dt(e=we(e),"iterate",rn),e}const Mp={__proto__:null,[Symbol.iterator](){return qi(this,Symbol.iterator,ut)},concat(...e){return dr(this).concat(...e.map(t=>ce(t)?dr(t):t))},entries(){return qi(this,"entries",e=>(e[1]=ut(e[1]),e))},every(e,t){return io(this,"every",e,t,void 0,arguments)},filter(e,t){return io(this,"filter",e,t,o=>o.map(ut),arguments)},find(e,t){return io(this,"find",e,t,ut,arguments)},findIndex(e,t){return io(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return io(this,"findLast",e,t,ut,arguments)},findLastIndex(e,t){return io(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return io(this,"forEach",e,t,void 0,arguments)},includes(...e){return Ui(this,"includes",e)},indexOf(...e){return Ui(this,"indexOf",e)},join(e){return dr(this).join(e)},lastIndexOf(...e){return Ui(this,"lastIndexOf",e)},map(e,t){return io(this,"map",e,t,void 0,arguments)},pop(){return Br(this,"pop")},push(...e){return Br(this,"push",e)},reduce(e,...t){return $l(this,"reduce",e,t)},reduceRight(e,...t){return $l(this,"reduceRight",e,t)},shift(){return Br(this,"shift")},some(e,t){return io(this,"some",e,t,void 0,arguments)},splice(...e){return Br(this,"splice",e)},toReversed(){return dr(this).toReversed()},toSorted(e){return dr(this).toSorted(e)},toSpliced(...e){return dr(this).toSpliced(...e)},unshift(...e){return Br(this,"unshift",e)},values(){return qi(this,"values",ut)}};function qi(e,t,o){const r=xi(e),n=r[t]();return r!==e&&!zt(e)&&(n._next=n.next,n.next=()=>{const i=n._next();return i.value&&(i.value=o(i.value)),i}),n}const Ip=Array.prototype;function io(e,t,o,r,n,i){const a=xi(e),l=a!==e&&!zt(e),s=a[t];if(s!==Ip[t]){const u=s.apply(e,i);return l?ut(u):u}let c=o;a!==e&&(l?c=function(u,p){return o.call(this,ut(u),p,e)}:o.length>2&&(c=function(u,p){return o.call(this,u,p,e)}));const d=s.call(a,c,r);return l&&n?n(d):d}function $l(e,t,o,r){const n=xi(e);let i=o;return n!==e&&(zt(e)?o.length>3&&(i=function(a,l,s){return o.call(this,a,l,s,e)}):i=function(a,l,s){return o.call(this,a,ut(l),s,e)}),n[t](i,...r)}function Ui(e,t,o){const r=we(e);dt(r,"iterate",rn);const n=r[t](...o);return(n===-1||n===!1)&&ol(o[0])?(o[0]=we(o[0]),r[t](...o)):n}function Br(e,t,o=[]){zo(),Ya();const r=we(e)[t].apply(e,o);return Xa(),Mo(),r}const Ap=ja("__proto__,__v_isRef,__isVue"),wc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Ot));function Hp(e){Ot(e)||(e=String(e));const t=we(this);return dt(t,"has",e),t.hasOwnProperty(e)}class Pc{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,r){if(o==="__v_skip")return t.__v_skip;const n=this._isReadonly,i=this._isShallow;if(o==="__v_isReactive")return!n;if(o==="__v_isReadonly")return n;if(o==="__v_isShallow")return i;if(o==="__v_raw")return r===(n?i?qp:Fc:i?Rc:$c).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const a=ce(t);if(!n){let s;if(a&&(s=Mp[o]))return s;if(o==="hasOwnProperty")return Hp}const l=Reflect.get(t,o,ot(t)?t:r);return(Ot(o)?wc.has(o):Ap(o))||(n||dt(t,"get",o),i)?l:ot(l)?a&&qa(o)?l:l.value:ze(l)?n?el(l):Ci(l):l}}class Tc extends Pc{constructor(t=!1){super(!1,t)}set(t,o,r,n){let i=t[o];if(!this._isShallow){const s=tr(i);if(!zt(r)&&!tr(r)&&(i=we(i),r=we(r)),!ce(t)&&ot(i)&&!ot(r))return s?!1:(i.value=r,!0)}const a=ce(t)&&qa(o)?Number(o)e,In=e=>Reflect.getPrototypeOf(e);function Lp(e,t,o){return function(...r){const n=this.__v_raw,i=we(n),a=hr(i),l=e==="entries"||e===Symbol.iterator&&a,s=e==="keys"&&a,c=n[e](...r),d=o?ca:t?ua:ut;return!t&&dt(i,"iterate",s?sa:Yo),{next(){const{value:u,done:p}=c.next();return p?{value:u,done:p}:{value:l?[d(u[0]),d(u[1])]:d(u),done:p}},[Symbol.iterator](){return this}}}}function An(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Wp(e,t){const o={get(n){const i=this.__v_raw,a=we(i),l=we(n);e||($o(n,l)&&dt(a,"get",n),dt(a,"get",l));const{has:s}=In(a),c=t?ca:e?ua:ut;if(s.call(a,n))return c(i.get(n));if(s.call(a,l))return c(i.get(l));i!==a&&i.get(n)},get size(){const n=this.__v_raw;return!e&&dt(we(n),"iterate",Yo),Reflect.get(n,"size",n)},has(n){const i=this.__v_raw,a=we(i),l=we(n);return e||($o(n,l)&&dt(a,"has",n),dt(a,"has",l)),n===l?i.has(n):i.has(n)||i.has(l)},forEach(n,i){const a=this,l=a.__v_raw,s=we(l),c=t?ca:e?ua:ut;return!e&&dt(s,"iterate",Yo),l.forEach((d,u)=>n.call(i,c(d),c(u),a))}};return Xe(o,e?{add:An("add"),set:An("set"),delete:An("delete"),clear:An("clear")}:{add(n){!t&&!zt(n)&&!tr(n)&&(n=we(n));const i=we(this);return In(i).has.call(i,n)||(i.add(n),so(i,"add",n,n)),this},set(n,i){!t&&!zt(i)&&!tr(i)&&(i=we(i));const a=we(this),{has:l,get:s}=In(a);let c=l.call(a,n);c||(n=we(n),c=l.call(a,n));const d=s.call(a,n);return a.set(n,i),c?$o(i,d)&&so(a,"set",n,i):so(a,"add",n,i),this},delete(n){const i=we(this),{has:a,get:l}=In(i);let s=a.call(i,n);s||(n=we(n),s=a.call(i,n)),l&&l.call(i,n);const c=i.delete(n);return s&&so(i,"delete",n,void 0),c},clear(){const n=we(this),i=n.size!==0,a=n.clear();return i&&so(n,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(n=>{o[n]=Lp(n,e,t)}),o}function Qa(e,t){const o=Wp(e,t);return(r,n,i)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?r:Reflect.get($e(o,n)&&n in r?o:r,n,i)}const jp={get:Qa(!1,!1)},Np={get:Qa(!1,!0)},Vp={get:Qa(!0,!1)};const $c=new WeakMap,Rc=new WeakMap,Fc=new WeakMap,qp=new WeakMap;function Up(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gp(e){return e.__v_skip||!Object.isExtensible(e)?0:Up(mp(e))}function Ci(e){return tr(e)?e:tl(e,!1,Dp,jp,$c)}function Kp(e){return tl(e,!1,Op,Np,Rc)}function el(e){return tl(e,!0,Bp,Vp,Fc)}function tl(e,t,o,r,n){if(!ze(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=n.get(e);if(i)return i;const a=Gp(e);if(a===0)return e;const l=new Proxy(e,a===2?r:o);return n.set(e,l),l}function gr(e){return tr(e)?gr(e.__v_raw):!!(e&&e.__v_isReactive)}function tr(e){return!!(e&&e.__v_isReadonly)}function zt(e){return!!(e&&e.__v_isShallow)}function ol(e){return e?!!e.__v_raw:!1}function we(e){const t=e&&e.__v_raw;return t?we(t):e}function da(e){return!$e(e,"__v_skip")&&Object.isExtensible(e)&&dc(e,"__v_skip",!0),e}const ut=e=>ze(e)?Ci(e):e,ua=e=>ze(e)?el(e):e;function ot(e){return e?e.__v_isRef===!0:!1}function fe(e){return Ec(e,!1)}function _c(e){return Ec(e,!0)}function Ec(e,t){return ot(e)?e:new Yp(e,t)}class Yp{constructor(t,o){this.dep=new Za,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:we(t),this._value=o?t:ut(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){const o=this._rawValue,r=this.__v_isShallow||zt(t)||tr(t);t=r?t:we(t),$o(t,o)&&(this._rawValue=t,this._value=r?t:ut(t),this.dep.trigger())}}function Xp(e){return ot(e)?e.value:e}const Jp={get:(e,t,o)=>t==="__v_raw"?e:Xp(Reflect.get(e,t,o)),set:(e,t,o,r)=>{const n=e[t];return ot(n)&&!ot(o)?(n.value=o,!0):Reflect.set(e,t,o,r)}};function zc(e){return gr(e)?e:new Proxy(e,Jp)}function N2(e){const t=ce(e)?new Array(e.length):{};for(const o in e)t[o]=Mc(e,o);return t}class Zp{constructor(t,o,r){this._object=t,this._key=o,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return zp(we(this._object),this._key)}}class Qp{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Dt(e,t,o){return ot(e)?e:me(e)?new Qp(e):ze(e)&&arguments.length>1?Mc(e,t,o):fe(e)}function Mc(e,t,o){const r=e[t];return ot(r)?r:new Zp(e,t,o)}class eh{constructor(t,o,r){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Za(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=on-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&Ae!==this)return bc(this,!0),!0}get value(){const t=this.dep.track();return Cc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function th(e,t,o=!1){let r,n;return me(e)?r=e:(r=e.get,n=e.set),new eh(r,n,o)}const Hn={},ni=new WeakMap;let jo;function oh(e,t=!1,o=jo){if(o){let r=ni.get(o);r||ni.set(o,r=[]),r.push(e)}}function rh(e,t,o=Ie){const{immediate:r,deep:n,once:i,scheduler:a,augmentJob:l,call:s}=o,c=w=>n?w:zt(w)||n===!1||n===0?co(w,1):co(w);let d,u,p,m,f=!1,g=!1;if(ot(e)?(u=()=>e.value,f=zt(e)):gr(e)?(u=()=>c(e),f=!0):ce(e)?(g=!0,f=e.some(w=>gr(w)||zt(w)),u=()=>e.map(w=>{if(ot(w))return w.value;if(gr(w))return c(w);if(me(w))return s?s(w,2):w()})):me(e)?t?u=s?()=>s(e,2):e:u=()=>{if(p){zo();try{p()}finally{Mo()}}const w=jo;jo=d;try{return s?s(e,3,[m]):e(m)}finally{jo=w}}:u=Jt,t&&n){const w=u,z=n===!0?1/0:n;u=()=>co(w(),z)}const S=Fp(),v=()=>{d.stop(),S&&S.active&&Va(S.effects,d)};if(i&&t){const w=t;t=(...z)=>{w(...z),v()}}let $=g?new Array(e.length).fill(Hn):Hn;const T=w=>{if(!(!(d.flags&1)||!d.dirty&&!w))if(t){const z=d.run();if(n||f||(g?z.some((B,x)=>$o(B,$[x])):$o(z,$))){p&&p();const B=jo;jo=d;try{const x=[z,$===Hn?void 0:g&&$[0]===Hn?[]:$,m];s?s(t,3,x):t(...x),$=z}finally{jo=B}}}else d.run()};return l&&l(T),d=new gc(u),d.scheduler=a?()=>a(T,!1):T,m=w=>oh(w,!1,d),p=d.onStop=()=>{const w=ni.get(d);if(w){if(s)s(w,4);else for(const z of w)z();ni.delete(d)}},t?r?T(!0):$=d.run():a?a(T.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}function co(e,t=1/0,o){if(t<=0||!ze(e)||e.__v_skip||(o=o||new Set,o.has(e)))return e;if(o.add(e),t--,ot(e))co(e.value,t,o);else if(ce(e))for(let r=0;r{co(r,t,o)});else if(cc(e)){for(const r in e)co(e[r],t,o);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&co(e[r],t,o)}return e}/** +**/let vt;class hc{constructor(t=!1){this.detached=t,this._active=!0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.parent=vt,!t&&vt&&(this.index=(vt.scopes||(vt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let t,o;if(this.scopes)for(t=0,o=this.scopes.length;t0)return;if(Kr){let t=Kr;for(Kr=void 0;t;){const o=t.next;t.next=void 0,t.flags&=-9,t=o}}let e;for(;Gr;){let t=Gr;for(Gr=void 0;t;){const o=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(r){e||(e=r)}t=o}}if(e)throw e}function vc(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function xc(e){let t,o=e.depsTail,r=o;for(;r;){const n=r.prevDep;r.version===-1?(r===o&&(o=n),Ja(r),Ap(r)):t=r,r.dep.activeLink=r.prevActiveLink,r.prevActiveLink=void 0,r=n}e.deps=t,e.depsTail=o}function la(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Cc(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Cc(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===on))return;e.globalVersion=on;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!la(e)){e.flags&=-3;return}const o=ze,r=Ot;ze=e,Ot=!0;try{vc(e);const n=e.fn(e._value);(t.version===0||$o(n,e._value))&&(e._value=n,t.version++)}catch(n){throw t.version++,n}finally{ze=o,Ot=r,xc(e),e.flags&=-3}}function Ja(e,t=!1){const{dep:o,prevSub:r,nextSub:n}=e;if(r&&(r.nextSub=n,e.prevSub=void 0),n&&(n.prevSub=r,e.nextSub=void 0),o.subs===e&&(o.subs=r,!r&&o.computed)){o.computed.flags&=-5;for(let i=o.computed.deps;i;i=i.nextDep)Ja(i,!0)}!t&&!--o.sc&&o.map&&o.map.delete(o.key)}function Ap(e){const{prevDep:t,nextDep:o}=e;t&&(t.nextDep=o,e.prevDep=void 0),o&&(o.prevDep=t,e.nextDep=void 0)}let Ot=!0;const yc=[];function _o(){yc.push(Ot),Ot=!1}function Eo(){const e=yc.pop();Ot=e===void 0?!0:e}function Tl(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const o=ze;ze=void 0;try{t()}finally{ze=o}}}let on=0;class Ip{constructor(t,o){this.sub=t,this.dep=o,this.version=o.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Za{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0}track(t){if(!ze||!Ot||ze===this.computed)return;let o=this.activeLink;if(o===void 0||o.sub!==ze)o=this.activeLink=new Ip(ze,this),ze.deps?(o.prevDep=ze.depsTail,ze.depsTail.nextDep=o,ze.depsTail=o):ze.deps=ze.depsTail=o,Sc(o);else if(o.version===-1&&(o.version=this.version,o.nextDep)){const r=o.nextDep;r.prevDep=o.prevDep,o.prevDep&&(o.prevDep.nextDep=r),o.prevDep=ze.depsTail,o.nextDep=void 0,ze.depsTail.nextDep=o,ze.depsTail=o,ze.deps===o&&(ze.deps=r)}return o}trigger(t){this.version++,on++,this.notify(t)}notify(t){Ya();try{for(let o=this.subs;o;o=o.prevSub)o.sub.notify()&&o.sub.dep.notify()}finally{Xa()}}}function Sc(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let r=t.deps;r;r=r.nextDep)Sc(r)}const o=e.dep.subs;o!==e&&(e.prevSub=o,o&&(o.nextSub=e)),e.dep.subs=e}}const ri=new WeakMap,Yo=Symbol(""),sa=Symbol(""),rn=Symbol("");function dt(e,t,o){if(Ot&&ze){let r=ri.get(e);r||ri.set(e,r=new Map);let n=r.get(o);n||(r.set(o,n=new Za),n.map=r,n.key=o),n.track()}}function so(e,t,o,r,n,i){const a=ri.get(e);if(!a){on++;return}const l=s=>{s&&s.trigger()};if(Ya(),t==="clear")a.forEach(l);else{const s=ce(e),c=s&&Ua(o);if(s&&o==="length"){const d=Number(r);a.forEach((u,p)=>{(p==="length"||p===rn||!Bt(p)&&p>=d)&&l(u)})}else switch((o!==void 0||a.has(void 0))&&l(a.get(o)),c&&l(a.get(rn)),t){case"add":s?c&&l(a.get("length")):(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"delete":s||(l(a.get(Yo)),hr(e)&&l(a.get(sa)));break;case"set":hr(e)&&l(a.get(Yo));break}}Xa()}function _p(e,t){const o=ri.get(e);return o&&o.get(t)}function dr(e){const t=we(e);return t===e?t:(dt(t,"iterate",rn),_t(e)?t:t.map(ut))}function xi(e){return dt(e=we(e),"iterate",rn),e}const Ep={__proto__:null,[Symbol.iterator](){return Ui(this,Symbol.iterator,ut)},concat(...e){return dr(this).concat(...e.map(t=>ce(t)?dr(t):t))},entries(){return Ui(this,"entries",e=>(e[1]=ut(e[1]),e))},every(e,t){return io(this,"every",e,t,void 0,arguments)},filter(e,t){return io(this,"filter",e,t,o=>o.map(ut),arguments)},find(e,t){return io(this,"find",e,t,ut,arguments)},findIndex(e,t){return io(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return io(this,"findLast",e,t,ut,arguments)},findLastIndex(e,t){return io(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return io(this,"forEach",e,t,void 0,arguments)},includes(...e){return qi(this,"includes",e)},indexOf(...e){return qi(this,"indexOf",e)},join(e){return dr(this).join(e)},lastIndexOf(...e){return qi(this,"lastIndexOf",e)},map(e,t){return io(this,"map",e,t,void 0,arguments)},pop(){return Or(this,"pop")},push(...e){return Or(this,"push",e)},reduce(e,...t){return $l(this,"reduce",e,t)},reduceRight(e,...t){return $l(this,"reduceRight",e,t)},shift(){return Or(this,"shift")},some(e,t){return io(this,"some",e,t,void 0,arguments)},splice(...e){return Or(this,"splice",e)},toReversed(){return dr(this).toReversed()},toSorted(e){return dr(this).toSorted(e)},toSpliced(...e){return dr(this).toSpliced(...e)},unshift(...e){return Or(this,"unshift",e)},values(){return Ui(this,"values",ut)}};function Ui(e,t,o){const r=xi(e),n=r[t]();return r!==e&&!_t(e)&&(n._next=n.next,n.next=()=>{const i=n._next();return i.value&&(i.value=o(i.value)),i}),n}const Mp=Array.prototype;function io(e,t,o,r,n,i){const a=xi(e),l=a!==e&&!_t(e),s=a[t];if(s!==Mp[t]){const u=s.apply(e,i);return l?ut(u):u}let c=o;a!==e&&(l?c=function(u,p){return o.call(this,ut(u),p,e)}:o.length>2&&(c=function(u,p){return o.call(this,u,p,e)}));const d=s.call(a,c,r);return l&&n?n(d):d}function $l(e,t,o,r){const n=xi(e);let i=o;return n!==e&&(_t(e)?o.length>3&&(i=function(a,l,s){return o.call(this,a,l,s,e)}):i=function(a,l,s){return o.call(this,a,ut(l),s,e)}),n[t](i,...r)}function qi(e,t,o){const r=we(e);dt(r,"iterate",rn);const n=r[t](...o);return(n===-1||n===!1)&&ol(o[0])?(o[0]=we(o[0]),r[t](...o)):n}function Or(e,t,o=[]){_o(),Ya();const r=we(e)[t].apply(e,o);return Xa(),Eo(),r}const zp=ja("__proto__,__v_isRef,__isVue"),wc=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Bt));function Hp(e){Bt(e)||(e=String(e));const t=we(this);return dt(t,"has",e),t.hasOwnProperty(e)}class Pc{constructor(t=!1,o=!1){this._isReadonly=t,this._isShallow=o}get(t,o,r){if(o==="__v_skip")return t.__v_skip;const n=this._isReadonly,i=this._isShallow;if(o==="__v_isReactive")return!n;if(o==="__v_isReadonly")return n;if(o==="__v_isShallow")return i;if(o==="__v_raw")return r===(n?i?Up:Fc:i?Rc:$c).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(r)?t:void 0;const a=ce(t);if(!n){let s;if(a&&(s=Ep[o]))return s;if(o==="hasOwnProperty")return Hp}const l=Reflect.get(t,o,ot(t)?t:r);return(Bt(o)?wc.has(o):zp(o))||(n||dt(t,"get",o),i)?l:ot(l)?a&&Ua(o)?l:l.value:_e(l)?n?el(l):Ci(l):l}}class Tc extends Pc{constructor(t=!1){super(!1,t)}set(t,o,r,n){let i=t[o];if(!this._isShallow){const s=tr(i);if(!_t(r)&&!tr(r)&&(i=we(i),r=we(r)),!ce(t)&&ot(i)&&!ot(r))return s?!1:(i.value=r,!0)}const a=ce(t)&&Ua(o)?Number(o)e,Mn=e=>Reflect.getPrototypeOf(e);function Lp(e,t,o){return function(...r){const n=this.__v_raw,i=we(n),a=hr(i),l=e==="entries"||e===Symbol.iterator&&a,s=e==="keys"&&a,c=n[e](...r),d=o?ca:t?ua:ut;return!t&&dt(i,"iterate",s?sa:Yo),{next(){const{value:u,done:p}=c.next();return p?{value:u,done:p}:{value:l?[d(u[0]),d(u[1])]:d(u),done:p}},[Symbol.iterator](){return this}}}}function zn(e){return function(...t){return e==="delete"?!1:e==="clear"?void 0:this}}function Wp(e,t){const o={get(n){const i=this.__v_raw,a=we(i),l=we(n);e||($o(n,l)&&dt(a,"get",n),dt(a,"get",l));const{has:s}=Mn(a),c=t?ca:e?ua:ut;if(s.call(a,n))return c(i.get(n));if(s.call(a,l))return c(i.get(l));i!==a&&i.get(n)},get size(){const n=this.__v_raw;return!e&&dt(we(n),"iterate",Yo),Reflect.get(n,"size",n)},has(n){const i=this.__v_raw,a=we(i),l=we(n);return e||($o(n,l)&&dt(a,"has",n),dt(a,"has",l)),n===l?i.has(n):i.has(n)||i.has(l)},forEach(n,i){const a=this,l=a.__v_raw,s=we(l),c=t?ca:e?ua:ut;return!e&&dt(s,"iterate",Yo),l.forEach((d,u)=>n.call(i,c(d),c(u),a))}};return Xe(o,e?{add:zn("add"),set:zn("set"),delete:zn("delete"),clear:zn("clear")}:{add(n){!t&&!_t(n)&&!tr(n)&&(n=we(n));const i=we(this);return Mn(i).has.call(i,n)||(i.add(n),so(i,"add",n,n)),this},set(n,i){!t&&!_t(i)&&!tr(i)&&(i=we(i));const a=we(this),{has:l,get:s}=Mn(a);let c=l.call(a,n);c||(n=we(n),c=l.call(a,n));const d=s.call(a,n);return a.set(n,i),c?$o(i,d)&&so(a,"set",n,i):so(a,"add",n,i),this},delete(n){const i=we(this),{has:a,get:l}=Mn(i);let s=a.call(i,n);s||(n=we(n),s=a.call(i,n)),l&&l.call(i,n);const c=i.delete(n);return s&&so(i,"delete",n,void 0),c},clear(){const n=we(this),i=n.size!==0,a=n.clear();return i&&so(n,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(n=>{o[n]=Lp(n,e,t)}),o}function Qa(e,t){const o=Wp(e,t);return(r,n,i)=>n==="__v_isReactive"?!e:n==="__v_isReadonly"?e:n==="__v_raw"?r:Reflect.get($e(o,n)&&n in r?o:r,n,i)}const jp={get:Qa(!1,!1)},Np={get:Qa(!1,!0)},Vp={get:Qa(!0,!1)};const $c=new WeakMap,Rc=new WeakMap,Fc=new WeakMap,Up=new WeakMap;function qp(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Gp(e){return e.__v_skip||!Object.isExtensible(e)?0:qp(mp(e))}function Ci(e){return tr(e)?e:tl(e,!1,Dp,jp,$c)}function Kp(e){return tl(e,!1,Bp,Np,Rc)}function el(e){return tl(e,!0,Op,Vp,Fc)}function tl(e,t,o,r,n){if(!_e(e)||e.__v_raw&&!(t&&e.__v_isReactive))return e;const i=n.get(e);if(i)return i;const a=Gp(e);if(a===0)return e;const l=new Proxy(e,a===2?r:o);return n.set(e,l),l}function gr(e){return tr(e)?gr(e.__v_raw):!!(e&&e.__v_isReactive)}function tr(e){return!!(e&&e.__v_isReadonly)}function _t(e){return!!(e&&e.__v_isShallow)}function ol(e){return e?!!e.__v_raw:!1}function we(e){const t=e&&e.__v_raw;return t?we(t):e}function da(e){return!$e(e,"__v_skip")&&Object.isExtensible(e)&&dc(e,"__v_skip",!0),e}const ut=e=>_e(e)?Ci(e):e,ua=e=>_e(e)?el(e):e;function ot(e){return e?e.__v_isRef===!0:!1}function fe(e){return Ic(e,!1)}function Ac(e){return Ic(e,!0)}function Ic(e,t){return ot(e)?e:new Yp(e,t)}class Yp{constructor(t,o){this.dep=new Za,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=o?t:we(t),this._value=o?t:ut(t),this.__v_isShallow=o}get value(){return this.dep.track(),this._value}set value(t){const o=this._rawValue,r=this.__v_isShallow||_t(t)||tr(t);t=r?t:we(t),$o(t,o)&&(this._rawValue=t,this._value=r?t:ut(t),this.dep.trigger())}}function Xp(e){return ot(e)?e.value:e}const Jp={get:(e,t,o)=>t==="__v_raw"?e:Xp(Reflect.get(e,t,o)),set:(e,t,o,r)=>{const n=e[t];return ot(n)&&!ot(o)?(n.value=o,!0):Reflect.set(e,t,o,r)}};function _c(e){return gr(e)?e:new Proxy(e,Jp)}function N2(e){const t=ce(e)?new Array(e.length):{};for(const o in e)t[o]=Ec(e,o);return t}class Zp{constructor(t,o,r){this._object=t,this._key=o,this._defaultValue=r,this.__v_isRef=!0,this._value=void 0}get value(){const t=this._object[this._key];return this._value=t===void 0?this._defaultValue:t}set value(t){this._object[this._key]=t}get dep(){return _p(we(this._object),this._key)}}class Qp{constructor(t){this._getter=t,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function Dt(e,t,o){return ot(e)?e:me(e)?new Qp(e):_e(e)&&arguments.length>1?Ec(e,t,o):fe(e)}function Ec(e,t,o){const r=e[t];return ot(r)?r:new Zp(e,t,o)}class eh{constructor(t,o,r){this.fn=t,this.setter=o,this._value=void 0,this.dep=new Za(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=on-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!o,this.isSSR=r}notify(){if(this.flags|=16,!(this.flags&8)&&ze!==this)return bc(this,!0),!0}get value(){const t=this.dep.track();return Cc(this),t&&(t.version=this.dep.version),this._value}set value(t){this.setter&&this.setter(t)}}function th(e,t,o=!1){let r,n;return me(e)?r=e:(r=e.get,n=e.set),new eh(r,n,o)}const Hn={},ni=new WeakMap;let jo;function oh(e,t=!1,o=jo){if(o){let r=ni.get(o);r||ni.set(o,r=[]),r.push(e)}}function rh(e,t,o=Me){const{immediate:r,deep:n,once:i,scheduler:a,augmentJob:l,call:s}=o,c=w=>n?w:_t(w)||n===!1||n===0?co(w,1):co(w);let d,u,p,m,f=!1,g=!1;if(ot(e)?(u=()=>e.value,f=_t(e)):gr(e)?(u=()=>c(e),f=!0):ce(e)?(g=!0,f=e.some(w=>gr(w)||_t(w)),u=()=>e.map(w=>{if(ot(w))return w.value;if(gr(w))return c(w);if(me(w))return s?s(w,2):w()})):me(e)?t?u=s?()=>s(e,2):e:u=()=>{if(p){_o();try{p()}finally{Eo()}}const w=jo;jo=d;try{return s?s(e,3,[m]):e(m)}finally{jo=w}}:u=Jt,t&&n){const w=u,_=n===!0?1/0:n;u=()=>co(w(),_)}const S=Fp(),v=()=>{d.stop(),S&&S.active&&Va(S.effects,d)};if(i&&t){const w=t;t=(..._)=>{w(..._),v()}}let $=g?new Array(e.length).fill(Hn):Hn;const T=w=>{if(!(!(d.flags&1)||!d.dirty&&!w))if(t){const _=d.run();if(n||f||(g?_.some((O,x)=>$o(O,$[x])):$o(_,$))){p&&p();const O=jo;jo=d;try{const x=[_,$===Hn?void 0:g&&$[0]===Hn?[]:$,m];s?s(t,3,x):t(...x),$=_}finally{jo=O}}}else d.run()};return l&&l(T),d=new gc(u),d.scheduler=a?()=>a(T,!1):T,m=w=>oh(w,!1,d),p=d.onStop=()=>{const w=ni.get(d);if(w){if(s)s(w,4);else for(const _ of w)_();ni.delete(d)}},t?r?T(!0):$=d.run():a?a(T.bind(null,!0),!0):d.run(),v.pause=d.pause.bind(d),v.resume=d.resume.bind(d),v.stop=v,v}function co(e,t=1/0,o){if(t<=0||!_e(e)||e.__v_skip||(o=o||new Set,o.has(e)))return e;if(o.add(e),t--,ot(e))co(e.value,t,o);else if(ce(e))for(let r=0;r{co(r,t,o)});else if(cc(e)){for(const r in e)co(e[r],t,o);for(const r of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,r)&&co(e[r],t,o)}return e}/** * @vue/runtime-core v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/function yn(e,t,o,r){try{return r?e(...r):e()}catch(n){yi(n,t,o)}}function Lt(e,t,o,r){if(me(e)){const n=yn(e,t,o,r);return n&&lc(n)&&n.catch(i=>{yi(i,t,o)}),n}if(ce(e)){const n=[];for(let i=0;i>>1,n=xt[r],i=an(n);i=an(o)?xt.push(e):xt.splice(ih(t),0,e),e.flags|=1,Ac()}}function Ac(){ii||(ii=Ic.then(kc))}function ah(e){ce(e)?mr.push(...e):yo&&e.id===-1?yo.splice(fr+1,0,e):e.flags&1||(mr.push(e),e.flags|=1),Ac()}function Rl(e,t,o=Gt+1){for(;oan(o)-an(r));if(mr.length=0,yo){yo.push(...t);return}for(yo=t,fr=0;fre.id==null?e.flags&2?-1:1/0:e.id;function kc(e){try{for(Gt=0;Gt{r._d&&Wl(-1);const i=ai(t);let a;try{a=e(...n)}finally{ai(i),r._d&&Wl(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function V2(e,t){if(Ye===null)return e;const o=Ri(Ye),r=e.dirs||(e.dirs=[]);for(let n=0;ne.__isTeleport,Yr=e=>e&&(e.disabled||e.disabled===""),Fl=e=>e&&(e.defer||e.defer===""),_l=e=>typeof SVGElement<"u"&&e instanceof SVGElement,El=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,fa=(e,t)=>{const o=e&&e.to;return We(o)?t?t(o):null:o},Lc={name:"Teleport",__isTeleport:!0,process(e,t,o,r,n,i,a,l,s,c){const{mc:d,pc:u,pbc:p,o:{insert:m,querySelector:f,createText:g,createComment:S}}=c,v=Yr(t.props);let{shapeFlag:$,children:T,dynamicChildren:w}=t;if(e==null){const z=t.el=g(""),B=t.anchor=g("");m(z,o,r),m(B,o,r);const x=(R,O)=>{$&16&&(n&&n.isCE&&(n.ce._teleportTarget=R),d(T,R,O,n,i,a,l,s))},F=()=>{const R=t.target=fa(t.props,f),O=Wc(R,t,g,m);R&&(a!=="svg"&&_l(R)?a="svg":a!=="mathml"&&El(R)&&(a="mathml"),v||(x(R,O),Yn(t,!1)))};v&&(x(o,B),Yn(t,!0)),Fl(t.props)?bt(()=>{F(),t.el.__isMounted=!0},i):F()}else{if(Fl(t.props)&&!e.el.__isMounted){bt(()=>{Lc.process(e,t,o,r,n,i,a,l,s,c),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const z=t.anchor=e.anchor,B=t.target=e.target,x=t.targetAnchor=e.targetAnchor,F=Yr(e.props),R=F?o:B,O=F?z:x;if(a==="svg"||_l(B)?a="svg":(a==="mathml"||El(B))&&(a="mathml"),w?(p(e.dynamicChildren,w,R,n,i,a,l),al(e,t,!0)):s||u(e,t,R,O,n,i,a,l,!1),v)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):kn(t,o,z,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=fa(t.props,f);j&&kn(t,j,null,c,0)}else F&&kn(t,B,x,c,1);Yn(t,v)}},remove(e,t,o,{um:r,o:{remove:n}},i){const{shapeFlag:a,children:l,anchor:s,targetStart:c,targetAnchor:d,target:u,props:p}=e;if(u&&(n(c),n(d)),i&&n(s),a&16){const m=i||!Yr(p);for(let f=0;f{e.isMounted=!0}),nr(()=>{e.isUnmounting=!0}),e}const Et=[Function,Array],Nc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Et,onEnter:Et,onAfterEnter:Et,onEnterCancelled:Et,onBeforeLeave:Et,onLeave:Et,onAfterLeave:Et,onLeaveCancelled:Et,onBeforeAppear:Et,onAppear:Et,onAfterAppear:Et,onAppearCancelled:Et},Vc=e=>{const t=e.subTree;return t.component?Vc(t.component):t},dh={name:"BaseTransition",props:Nc,setup(e,{slots:t}){const o=Sn(),r=jc();return()=>{const n=t.default&&nl(t.default(),!0);if(!n||!n.length)return;const i=qc(n),a=we(e),{mode:l}=a;if(r.isLeaving)return Gi(i);const s=zl(i);if(!s)return Gi(i);let c=ln(s,a,r,o,u=>c=u);s.type!==pt&&or(s,c);let d=o.subTree&&zl(o.subTree);if(d&&d.type!==pt&&!No(s,d)&&Vc(o).type!==pt){let u=ln(d,a,r,o);if(or(d,u),l==="out-in"&&s.type!==pt)return r.isLeaving=!0,u.afterLeave=()=>{r.isLeaving=!1,o.job.flags&8||o.update(),delete u.afterLeave,d=void 0},Gi(i);l==="in-out"&&s.type!==pt?u.delayLeave=(p,m,f)=>{const g=Uc(r,d);g[String(d.key)]=d,p[So]=()=>{m(),p[So]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function qc(e){let t=e[0];if(e.length>1){for(const o of e)if(o.type!==pt){t=o;break}}return t}const uh=dh;function Uc(e,t){const{leavingVNodes:o}=e;let r=o.get(t.type);return r||(r=Object.create(null),o.set(t.type,r)),r}function ln(e,t,o,r,n){const{appear:i,mode:a,persisted:l=!1,onBeforeEnter:s,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:p,onLeave:m,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:S,onAppear:v,onAfterAppear:$,onAppearCancelled:T}=t,w=String(e.key),z=Uc(o,e),B=(R,O)=>{R&&Lt(R,r,9,O)},x=(R,O)=>{const j=O[1];B(R,O),ce(R)?R.every(_=>_.length<=1)&&j():R.length<=1&&j()},F={mode:a,persisted:l,beforeEnter(R){let O=s;if(!o.isMounted)if(i)O=S||s;else return;R[So]&&R[So](!0);const j=z[w];j&&No(e,j)&&j.el[So]&&j.el[So](),B(O,[R])},enter(R){let O=c,j=d,_=u;if(!o.isMounted)if(i)O=v||c,j=$||d,_=T||u;else return;let J=!1;const G=R[Dn]=le=>{J||(J=!0,le?B(_,[R]):B(j,[R]),F.delayedLeave&&F.delayedLeave(),R[Dn]=void 0)};O?x(O,[R,G]):G()},leave(R,O){const j=String(e.key);if(R[Dn]&&R[Dn](!0),o.isUnmounting)return O();B(p,[R]);let _=!1;const J=R[So]=G=>{_||(_=!0,O(),G?B(g,[R]):B(f,[R]),R[So]=void 0,z[j]===e&&delete z[j])};z[j]=e,m?x(m,[R,J]):J()},clone(R){const O=ln(R,t,o,r,n);return n&&n(O),O}};return F}function Gi(e){if(Si(e))return e=Ro(e),e.children=null,e}function zl(e){if(!Si(e))return Oc(e.type)&&e.children?qc(e.children):e;const{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&me(o.default))return o.default()}}function or(e,t){e.shapeFlag&6&&e.component?(e.transition=t,or(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nl(e,t=!1,o){let r=[],n=0;for(let i=0;i1)for(let i=0;ili(f,t&&(ce(t)?t[g]:t),o,r,n));return}if(br(r)&&!n){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&li(e,t,o,r.component.subTree);return}const i=r.shapeFlag&4?Ri(r.component):r.el,a=n?null:i,{i:l,r:s}=e,c=t&&t.r,d=l.refs===Ie?l.refs={}:l.refs,u=l.setupState,p=we(u),m=u===Ie?()=>!1:f=>$e(p,f);if(c!=null&&c!==s&&(We(c)?(d[c]=null,m(c)&&(u[c]=null)):ot(c)&&(c.value=null)),me(s))yn(s,l,12,[a,d]);else{const f=We(s),g=ot(s);if(f||g){const S=()=>{if(e.f){const v=f?m(s)?u[s]:d[s]:s.value;n?ce(v)&&Va(v,i):ce(v)?v.includes(i)||v.push(i):f?(d[s]=[i],m(s)&&(u[s]=d[s])):(s.value=[i],e.k&&(d[e.k]=s.value))}else f?(d[s]=a,m(s)&&(u[s]=a)):g&&(s.value=a,e.k&&(d[e.k]=a))};a?(S.id=-1,bt(S,o)):S()}}}vi().requestIdleCallback;vi().cancelIdleCallback;const br=e=>!!e.type.__asyncLoader,Si=e=>e.type.__isKeepAlive;function Kc(e,t){Xc(e,"a",t)}function Yc(e,t){Xc(e,"da",t)}function Xc(e,t,o=tt){const r=e.__wdc||(e.__wdc=()=>{let n=o;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(wi(t,r,o),o){let n=o.parent;for(;n&&n.parent;)Si(n.parent.vnode)&&fh(r,t,o,n),n=n.parent}}function fh(e,t,o,r){const n=wi(t,e,r,!0);Zc(()=>{Va(r[t],n)},o)}function wi(e,t,o=tt,r=!1){if(o){const n=o[e]||(o[e]=[]),i=t.__weh||(t.__weh=(...a)=>{zo();const l=wn(o),s=Lt(t,o,e,a);return l(),Mo(),s});return r?n.unshift(i):n.push(i),i}}const go=e=>(t,o=tt)=>{(!dn||e==="sp")&&wi(e,(...r)=>t(...r),o)},Pi=go("bm"),Io=go("m"),ph=go("bu"),Jc=go("u"),nr=go("bum"),Zc=go("um"),hh=go("sp"),gh=go("rtg"),mh=go("rtc");function bh(e,t=tt){wi("ec",e,t)}const Qc="components";function q2(e,t){return td(Qc,e,!0,t)||e}const ed=Symbol.for("v-ndc");function U2(e){return We(e)?td(Qc,e,!1)||e:e||ed}function td(e,t,o=!0,r=!1){const n=Ye||tt;if(n){const i=n.type;{const l=rg(i,!1);if(l&&(l===t||l===It(t)||l===bi(It(t))))return i}const a=Ml(n[e]||i[e],t)||Ml(n.appContext[e],t);return!a&&r?i:a}}function Ml(e,t){return e&&(e[t]||e[It(t)]||e[bi(It(t))])}function G2(e,t,o,r){let n;const i=o,a=ce(e);if(a||We(e)){const l=a&&gr(e);let s=!1;l&&(s=!zt(e),e=xi(e)),n=new Array(e.length);for(let c=0,d=e.length;ct(l,s,void 0,i));else{const l=Object.keys(e);n=new Array(l.length);for(let s=0,c=l.length;sCr(t)?!(t.type===pt||t.type===et&&!od(t.children)):!0)?e:null}const pa=e=>e?wd(e)?Ri(e):pa(e.parent):null,Xr=Xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>pa(e.parent),$root:e=>pa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>nd(e),$forceUpdate:e=>e.f||(e.f=()=>{rl(e.update)}),$nextTick:e=>e.n||(e.n=nn.bind(e.proxy)),$watch:e=>Oh.bind(e)}),Ki=(e,t)=>e!==Ie&&!e.__isScriptSetup&&$e(e,t),xh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:o,setupState:r,data:n,props:i,accessCache:a,type:l,appContext:s}=e;let c;if(t[0]!=="$"){const m=a[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return n[t];case 4:return o[t];case 3:return i[t]}else{if(Ki(r,t))return a[t]=1,r[t];if(n!==Ie&&$e(n,t))return a[t]=2,n[t];if((c=e.propsOptions[0])&&$e(c,t))return a[t]=3,i[t];if(o!==Ie&&$e(o,t))return a[t]=4,o[t];ha&&(a[t]=0)}}const d=Xr[t];let u,p;if(d)return t==="$attrs"&&dt(e.attrs,"get",""),d(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(o!==Ie&&$e(o,t))return a[t]=4,o[t];if(p=s.config.globalProperties,$e(p,t))return p[t]},set({_:e},t,o){const{data:r,setupState:n,ctx:i}=e;return Ki(n,t)?(n[t]=o,!0):r!==Ie&&$e(r,t)?(r[t]=o,!0):$e(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:r,appContext:n,propsOptions:i}},a){let l;return!!o[a]||e!==Ie&&$e(e,a)||Ki(t,a)||(l=i[0])&&$e(l,a)||$e(r,a)||$e(Xr,a)||$e(n.config.globalProperties,a)},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:$e(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function Il(e){return ce(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}let ha=!0;function Ch(e){const t=nd(e),o=e.proxy,r=e.ctx;ha=!1,t.beforeCreate&&Al(t.beforeCreate,e,"bc");const{data:n,computed:i,methods:a,watch:l,provide:s,inject:c,created:d,beforeMount:u,mounted:p,beforeUpdate:m,updated:f,activated:g,deactivated:S,beforeDestroy:v,beforeUnmount:$,destroyed:T,unmounted:w,render:z,renderTracked:B,renderTriggered:x,errorCaptured:F,serverPrefetch:R,expose:O,inheritAttrs:j,components:_,directives:J,filters:G}=t;if(c&&yh(c,r,null),a)for(const N in a){const oe=a[N];me(oe)&&(r[N]=oe.bind(o))}if(n){const N=n.call(o,o);ze(N)&&(e.data=Ci(N))}if(ha=!0,i)for(const N in i){const oe=i[N],ye=me(oe)?oe.bind(o,o):me(oe.get)?oe.get.bind(o,o):Jt,Pe=!me(oe)&&me(oe.set)?oe.set.bind(o):Jt,Re=Y({get:ye,set:Pe});Object.defineProperty(r,N,{enumerable:!0,configurable:!0,get:()=>Re.value,set:Fe=>Re.value=Fe})}if(l)for(const N in l)rd(l[N],r,o,N);if(s){const N=me(s)?s.call(o):s;Reflect.ownKeys(N).forEach(oe=>{po(oe,N[oe])})}d&&Al(d,e,"c");function te(N,oe){ce(oe)?oe.forEach(ye=>N(ye.bind(o))):oe&&N(oe.bind(o))}if(te(Pi,u),te(Io,p),te(ph,m),te(Jc,f),te(Kc,g),te(Yc,S),te(bh,F),te(mh,B),te(gh,x),te(nr,$),te(Zc,w),te(hh,R),ce(O))if(O.length){const N=e.exposed||(e.exposed={});O.forEach(oe=>{Object.defineProperty(N,oe,{get:()=>o[oe],set:ye=>o[oe]=ye})})}else e.exposed||(e.exposed={});z&&e.render===Jt&&(e.render=z),j!=null&&(e.inheritAttrs=j),_&&(e.components=_),J&&(e.directives=J),R&&Gc(e)}function yh(e,t,o=Jt){ce(e)&&(e=ga(e));for(const r in e){const n=e[r];let i;ze(n)?"default"in n?i=Le(n.from||r,n.default,!0):i=Le(n.from||r):i=Le(n),ot(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:a=>i.value=a}):t[r]=i}}function Al(e,t,o){Lt(ce(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,o)}function rd(e,t,o,r){let n=r.includes(".")?md(o,r):()=>o[r];if(We(e)){const i=t[e];me(i)&&Zt(n,i)}else if(me(e))Zt(n,e.bind(o));else if(ze(e))if(ce(e))e.forEach(i=>rd(i,t,o,r));else{const i=me(e.handler)?e.handler.bind(o):t[e.handler];me(i)&&Zt(n,i,e)}}function nd(e){const t=e.type,{mixins:o,extends:r}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,l=i.get(t);let s;return l?s=l:!n.length&&!o&&!r?s=t:(s={},n.length&&n.forEach(c=>si(s,c,a,!0)),si(s,t,a)),ze(t)&&i.set(t,s),s}function si(e,t,o,r=!1){const{mixins:n,extends:i}=t;i&&si(e,i,o,!0),n&&n.forEach(a=>si(e,a,o,!0));for(const a in t)if(!(r&&a==="expose")){const l=Sh[a]||o&&o[a];e[a]=l?l(e[a],t[a]):t[a]}return e}const Sh={data:Hl,props:kl,emits:kl,methods:Nr,computed:Nr,beforeCreate:mt,created:mt,beforeMount:mt,mounted:mt,beforeUpdate:mt,updated:mt,beforeDestroy:mt,beforeUnmount:mt,destroyed:mt,unmounted:mt,activated:mt,deactivated:mt,errorCaptured:mt,serverPrefetch:mt,components:Nr,directives:Nr,watch:Ph,provide:Hl,inject:wh};function Hl(e,t){return t?e?function(){return Xe(me(e)?e.call(this,this):e,me(t)?t.call(this,this):t)}:t:e}function wh(e,t){return Nr(ga(e),ga(t))}function ga(e){if(ce(e)){const t={};for(let o=0;o1)return o&&me(t)?t.call(r&&r.proxy):t}}function K2(){return!!(tt||Ye||Xo)}const ad={},ld=()=>Object.create(ad),sd=e=>Object.getPrototypeOf(e)===ad;function Rh(e,t,o,r=!1){const n={},i=ld();e.propsDefaults=Object.create(null),cd(e,t,n,i);for(const a in e.propsOptions[0])a in n||(n[a]=void 0);o?e.props=r?n:Kp(n):e.type.props?e.props=n:e.props=i,e.attrs=i}function Fh(e,t,o,r){const{props:n,attrs:i,vnode:{patchFlag:a}}=e,l=we(n),[s]=e.propsOptions;let c=!1;if((r||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let u=0;u{s=!0;const[p,m]=dd(u,t,!0);Xe(a,p),m&&l.push(...m)};!o&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!s)return ze(e)&&r.set(e,pr),pr;if(ce(i))for(let d=0;de[0]==="_"||e==="$stable",il=e=>ce(e)?e.map(Kt):[Kt(e)],Eh=(e,t,o)=>{if(t._n)return t;const r=lh((...n)=>il(t(...n)),o);return r._c=!1,r},fd=(e,t,o)=>{const r=e._ctx;for(const n in e){if(ud(n))continue;const i=e[n];if(me(i))t[n]=Eh(n,i,r);else if(i!=null){const a=il(i);t[n]=()=>a}}},pd=(e,t)=>{const o=il(t);e.slots.default=()=>o},hd=(e,t,o)=>{for(const r in t)(o||r!=="_")&&(e[r]=t[r])},zh=(e,t,o)=>{const r=e.slots=ld();if(e.vnode.shapeFlag&32){const n=t._;n?(hd(r,t,o),o&&dc(r,"_",n,!0)):fd(t,r)}else t&&pd(e,t)},Mh=(e,t,o)=>{const{vnode:r,slots:n}=e;let i=!0,a=Ie;if(r.shapeFlag&32){const l=t._;l?o&&l===1?i=!1:hd(n,t,o):(i=!t.$stable,fd(t,n)),a=t}else t&&(pd(e,t),a={default:1});if(i)for(const l in n)!ud(l)&&a[l]==null&&delete n[l]},bt=Uh;function Ih(e){return Ah(e)}function Ah(e,t){const o=vi();o.__VUE__=!0;const{insert:r,remove:n,patchProp:i,createElement:a,createText:l,createComment:s,setText:c,setElementText:d,parentNode:u,nextSibling:p,setScopeId:m=Jt,insertStaticContent:f}=e,g=(h,b,P,H=null,I=null,k=null,U=void 0,q=null,A=!!b.dynamicChildren)=>{if(h===b)return;h&&!No(h,b)&&(H=qe(h),Fe(h,I,k,!0),h=null),b.patchFlag===-2&&(A=!1,b.dynamicChildren=null);const{type:E,ref:ie,shapeFlag:X}=b;switch(E){case $i:S(h,b,P,H);break;case pt:v(h,b,P,H);break;case Xn:h==null&&$(b,P,H,U);break;case et:_(h,b,P,H,I,k,U,q,A);break;default:X&1?z(h,b,P,H,I,k,U,q,A):X&6?J(h,b,P,H,I,k,U,q,A):(X&64||X&128)&&E.process(h,b,P,H,I,k,U,q,A,Ge)}ie!=null&&I&&li(ie,h&&h.ref,k,b||h,!b)},S=(h,b,P,H)=>{if(h==null)r(b.el=l(b.children),P,H);else{const I=b.el=h.el;b.children!==h.children&&c(I,b.children)}},v=(h,b,P,H)=>{h==null?r(b.el=s(b.children||""),P,H):b.el=h.el},$=(h,b,P,H)=>{[h.el,h.anchor]=f(h.children,b,P,H,h.el,h.anchor)},T=({el:h,anchor:b},P,H)=>{let I;for(;h&&h!==b;)I=p(h),r(h,P,H),h=I;r(b,P,H)},w=({el:h,anchor:b})=>{let P;for(;h&&h!==b;)P=p(h),n(h),h=P;n(b)},z=(h,b,P,H,I,k,U,q,A)=>{b.type==="svg"?U="svg":b.type==="math"&&(U="mathml"),h==null?B(b,P,H,I,k,U,q,A):R(h,b,I,k,U,q,A)},B=(h,b,P,H,I,k,U,q)=>{let A,E;const{props:ie,shapeFlag:X,transition:ne,dirs:se}=h;if(A=h.el=a(h.type,k,ie&&ie.is,ie),X&8?d(A,h.children):X&16&&F(h.children,A,null,H,I,Yi(h,k),U,q),se&&Do(h,null,H,"created"),x(A,h,h.scopeId,U,H),ie){for(const Te in ie)Te!=="value"&&!Ur(Te)&&i(A,Te,null,ie[Te],k,H);"value"in ie&&i(A,"value",null,ie.value,k),(E=ie.onVnodeBeforeMount)&&Nt(E,H,h)}se&&Do(h,null,H,"beforeMount");const ve=Hh(I,ne);ve&&ne.beforeEnter(A),r(A,b,P),((E=ie&&ie.onVnodeMounted)||ve||se)&&bt(()=>{E&&Nt(E,H,h),ve&&ne.enter(A),se&&Do(h,null,H,"mounted")},I)},x=(h,b,P,H,I)=>{if(P&&m(h,P),H)for(let k=0;k{for(let E=A;E{const q=b.el=h.el;let{patchFlag:A,dynamicChildren:E,dirs:ie}=b;A|=h.patchFlag&16;const X=h.props||Ie,ne=b.props||Ie;let se;if(P&&Bo(P,!1),(se=ne.onVnodeBeforeUpdate)&&Nt(se,P,b,h),ie&&Do(b,h,P,"beforeUpdate"),P&&Bo(P,!0),(X.innerHTML&&ne.innerHTML==null||X.textContent&&ne.textContent==null)&&d(q,""),E?O(h.dynamicChildren,E,q,P,H,Yi(b,I),k):U||oe(h,b,q,null,P,H,Yi(b,I),k,!1),A>0){if(A&16)j(q,X,ne,P,I);else if(A&2&&X.class!==ne.class&&i(q,"class",null,ne.class,I),A&4&&i(q,"style",X.style,ne.style,I),A&8){const ve=b.dynamicProps;for(let Te=0;Te{se&&Nt(se,P,b,h),ie&&Do(b,h,P,"updated")},H)},O=(h,b,P,H,I,k,U)=>{for(let q=0;q{if(b!==P){if(b!==Ie)for(const k in b)!Ur(k)&&!(k in P)&&i(h,k,b[k],null,I,H);for(const k in P){if(Ur(k))continue;const U=P[k],q=b[k];U!==q&&k!=="value"&&i(h,k,q,U,I,H)}"value"in P&&i(h,"value",b.value,P.value,I)}},_=(h,b,P,H,I,k,U,q,A)=>{const E=b.el=h?h.el:l(""),ie=b.anchor=h?h.anchor:l("");let{patchFlag:X,dynamicChildren:ne,slotScopeIds:se}=b;se&&(q=q?q.concat(se):se),h==null?(r(E,P,H),r(ie,P,H),F(b.children||[],P,ie,I,k,U,q,A)):X>0&&X&64&&ne&&h.dynamicChildren?(O(h.dynamicChildren,ne,P,I,k,U,q),(b.key!=null||I&&b===I.subTree)&&al(h,b,!0)):oe(h,b,P,ie,I,k,U,q,A)},J=(h,b,P,H,I,k,U,q,A)=>{b.slotScopeIds=q,h==null?b.shapeFlag&512?I.ctx.activate(b,P,H,U,A):G(b,P,H,I,k,U,A):le(h,b,A)},G=(h,b,P,H,I,k,U)=>{const q=h.component=Zh(h,H,I);if(Si(h)&&(q.ctx.renderer=Ge),Qh(q,!1,U),q.asyncDep){if(I&&I.registerDep(q,te,U),!h.el){const A=q.subTree=ht(pt);v(null,A,b,P)}}else te(q,h,b,P,I,k,U)},le=(h,b,P)=>{const H=b.component=h.component;if(Vh(h,b,P))if(H.asyncDep&&!H.asyncResolved){N(H,b,P);return}else H.next=b,H.update();else b.el=h.el,H.vnode=b},te=(h,b,P,H,I,k,U)=>{const q=()=>{if(h.isMounted){let{next:X,bu:ne,u:se,parent:ve,vnode:Te}=h;{const it=gd(h);if(it){X&&(X.el=Te.el,N(h,X,U)),it.asyncDep.then(()=>{h.isUnmounted||q()});return}}let Ce=X,Ze;Bo(h,!1),X?(X.el=Te.el,N(h,X,U)):X=Te,ne&&Kn(ne),(Ze=X.props&&X.props.onVnodeBeforeUpdate)&&Nt(Ze,ve,X,Te),Bo(h,!0);const Qe=Ol(h),nt=h.subTree;h.subTree=Qe,g(nt,Qe,u(nt.el),qe(nt),h,I,k),X.el=Qe.el,Ce===null&&qh(h,Qe.el),se&&bt(se,I),(Ze=X.props&&X.props.onVnodeUpdated)&&bt(()=>Nt(Ze,ve,X,Te),I)}else{let X;const{el:ne,props:se}=b,{bm:ve,m:Te,parent:Ce,root:Ze,type:Qe}=h,nt=br(b);Bo(h,!1),ve&&Kn(ve),!nt&&(X=se&&se.onVnodeBeforeMount)&&Nt(X,Ce,b),Bo(h,!0);{Ze.ce&&Ze.ce._injectChildStyle(Qe);const it=h.subTree=Ol(h);g(null,it,P,H,h,I,k),b.el=it.el}if(Te&&bt(Te,I),!nt&&(X=se&&se.onVnodeMounted)){const it=b;bt(()=>Nt(X,Ce,it),I)}(b.shapeFlag&256||Ce&&br(Ce.vnode)&&Ce.vnode.shapeFlag&256)&&h.a&&bt(h.a,I),h.isMounted=!0,b=P=H=null}};h.scope.on();const A=h.effect=new gc(q);h.scope.off();const E=h.update=A.run.bind(A),ie=h.job=A.runIfDirty.bind(A);ie.i=h,ie.id=h.uid,A.scheduler=()=>rl(ie),Bo(h,!0),E()},N=(h,b,P)=>{b.component=h;const H=h.vnode.props;h.vnode=b,h.next=null,Fh(h,b.props,H,P),Mh(h,b.children,P),zo(),Rl(h),Mo()},oe=(h,b,P,H,I,k,U,q,A=!1)=>{const E=h&&h.children,ie=h?h.shapeFlag:0,X=b.children,{patchFlag:ne,shapeFlag:se}=b;if(ne>0){if(ne&128){Pe(E,X,P,H,I,k,U,q,A);return}else if(ne&256){ye(E,X,P,H,I,k,U,q,A);return}}se&8?(ie&16&&he(E,I,k),X!==E&&d(P,X)):ie&16?se&16?Pe(E,X,P,H,I,k,U,q,A):he(E,I,k,!0):(ie&8&&d(P,""),se&16&&F(X,P,H,I,k,U,q,A))},ye=(h,b,P,H,I,k,U,q,A)=>{h=h||pr,b=b||pr;const E=h.length,ie=b.length,X=Math.min(E,ie);let ne;for(ne=0;neie?he(h,I,k,!0,!1,X):F(b,P,H,I,k,U,q,A,X)},Pe=(h,b,P,H,I,k,U,q,A)=>{let E=0;const ie=b.length;let X=h.length-1,ne=ie-1;for(;E<=X&&E<=ne;){const se=h[E],ve=b[E]=A?wo(b[E]):Kt(b[E]);if(No(se,ve))g(se,ve,P,null,I,k,U,q,A);else break;E++}for(;E<=X&&E<=ne;){const se=h[X],ve=b[ne]=A?wo(b[ne]):Kt(b[ne]);if(No(se,ve))g(se,ve,P,null,I,k,U,q,A);else break;X--,ne--}if(E>X){if(E<=ne){const se=ne+1,ve=sene)for(;E<=X;)Fe(h[E],I,k,!0),E++;else{const se=E,ve=E,Te=new Map;for(E=ve;E<=ne;E++){const at=b[E]=A?wo(b[E]):Kt(b[E]);at.key!=null&&Te.set(at.key,E)}let Ce,Ze=0;const Qe=ne-ve+1;let nt=!1,it=0;const Wt=new Array(Qe);for(E=0;E=Qe){Fe(at,I,k,!0);continue}let D;if(at.key!=null)D=Te.get(at.key);else for(Ce=ve;Ce<=ne;Ce++)if(Wt[Ce-ve]===0&&No(at,b[Ce])){D=Ce;break}D===void 0?Fe(at,I,k,!0):(Wt[D-ve]=E+1,D>=it?it=D:nt=!0,g(at,b[D],P,null,I,k,U,q,A),Ze++)}const Ht=nt?kh(Wt):pr;for(Ce=Ht.length-1,E=Qe-1;E>=0;E--){const at=ve+E,D=b[at],Q=at+1{const{el:k,type:U,transition:q,children:A,shapeFlag:E}=h;if(E&6){Re(h.component.subTree,b,P,H);return}if(E&128){h.suspense.move(b,P,H);return}if(E&64){U.move(h,b,P,Ge);return}if(U===et){r(k,b,P);for(let X=0;Xq.enter(k),I);else{const{leave:X,delayLeave:ne,afterLeave:se}=q,ve=()=>r(k,b,P),Te=()=>{X(k,()=>{ve(),se&&se()})};ne?ne(k,ve,Te):Te()}else r(k,b,P)},Fe=(h,b,P,H=!1,I=!1)=>{const{type:k,props:U,ref:q,children:A,dynamicChildren:E,shapeFlag:ie,patchFlag:X,dirs:ne,cacheIndex:se}=h;if(X===-2&&(I=!1),q!=null&&li(q,null,P,h,!0),se!=null&&(b.renderCache[se]=void 0),ie&256){b.ctx.deactivate(h);return}const ve=ie&1&&ne,Te=!br(h);let Ce;if(Te&&(Ce=U&&U.onVnodeBeforeUnmount)&&Nt(Ce,b,h),ie&6)gt(h.component,P,H);else{if(ie&128){h.suspense.unmount(P,H);return}ve&&Do(h,null,b,"beforeUnmount"),ie&64?h.type.remove(h,b,P,Ge,H):E&&!E.hasOnce&&(k!==et||X>0&&X&64)?he(E,b,P,!1,!0):(k===et&&X&384||!I&&ie&16)&&he(A,b,P),H&&Ve(h)}(Te&&(Ce=U&&U.onVnodeUnmounted)||ve)&&bt(()=>{Ce&&Nt(Ce,b,h),ve&&Do(h,null,b,"unmounted")},P)},Ve=h=>{const{type:b,el:P,anchor:H,transition:I}=h;if(b===et){Ue(P,H);return}if(b===Xn){w(h);return}const k=()=>{n(P),I&&!I.persisted&&I.afterLeave&&I.afterLeave()};if(h.shapeFlag&1&&I&&!I.persisted){const{leave:U,delayLeave:q}=I,A=()=>U(P,k);q?q(h.el,k,A):A()}else k()},Ue=(h,b)=>{let P;for(;h!==b;)P=p(h),n(h),h=P;n(b)},gt=(h,b,P)=>{const{bum:H,scope:I,job:k,subTree:U,um:q,m:A,a:E}=h;Bl(A),Bl(E),H&&Kn(H),I.stop(),k&&(k.flags|=8,Fe(U,h,b,P)),q&&bt(q,b),bt(()=>{h.isUnmounted=!0},b),b&&b.pendingBranch&&!b.isUnmounted&&h.asyncDep&&!h.asyncResolved&&h.suspenseId===b.pendingId&&(b.deps--,b.deps===0&&b.resolve())},he=(h,b,P,H=!1,I=!1,k=0)=>{for(let U=k;U{if(h.shapeFlag&6)return qe(h.component.subTree);if(h.shapeFlag&128)return h.suspense.next();const b=p(h.anchor||h.el),P=b&&b[Bc];return P?p(P):b};let rt=!1;const be=(h,b,P)=>{h==null?b._vnode&&Fe(b._vnode,null,null,!0):g(b._vnode||null,h,b,null,null,null,P),b._vnode=h,rt||(rt=!0,Rl(),Hc(),rt=!1)},Ge={p:g,um:Fe,m:Re,r:Ve,mt:G,mc:F,pc:oe,pbc:O,n:qe,o:e};return{render:be,hydrate:void 0,createApp:$h(be)}}function Yi({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function Bo({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function al(e,t,o=!1){const r=e.children,n=t.children;if(ce(r)&&ce(n))for(let i=0;i>1,e[o[l]]0&&(t[r]=o[i-1]),o[i]=r)}}for(i=o.length,a=o[i-1];i-- >0;)o[i]=a,a=t[a];return o}function gd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:gd(t)}function Bl(e){if(e)for(let t=0;tLe(Dh);function sn(e,t){return ll(e,null,t)}function Zt(e,t,o){return ll(e,t,o)}function ll(e,t,o=Ie){const{immediate:r,deep:n,flush:i,once:a}=o,l=Xe({},o),s=t&&r||!t&&i!=="post";let c;if(dn){if(i==="sync"){const m=Bh();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!s){const m=()=>{};return m.stop=Jt,m.resume=Jt,m.pause=Jt,m}}const d=tt;l.call=(m,f,g)=>Lt(m,d,f,g);let u=!1;i==="post"?l.scheduler=m=>{bt(m,d&&d.suspense)}:i!=="sync"&&(u=!0,l.scheduler=(m,f)=>{f?m():rl(m)}),l.augmentJob=m=>{t&&(m.flags|=4),u&&(m.flags|=2,d&&(m.id=d.uid,m.i=d))};const p=rh(e,t,l);return dn&&(c?c.push(p):s&&p()),p}function Oh(e,t,o){const r=this.proxy,n=We(e)?e.includes(".")?md(r,e):()=>r[e]:e.bind(r,r);let i;me(t)?i=t:(i=t.handler,o=t);const a=wn(this),l=ll(n,i.bind(r),o);return a(),l}function md(e,t){const o=t.split(".");return()=>{let r=e;for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${It(t)}Modifiers`]||e[`${Eo(t)}Modifiers`];function Wh(e,t,...o){if(e.isUnmounted)return;const r=e.vnode.props||Ie;let n=o;const i=t.startsWith("update:"),a=i&&Lh(r,t.slice(7));a&&(a.trim&&(n=o.map(d=>We(d)?d.trim():d)),a.number&&(n=o.map(oi)));let l,s=r[l=ji(t)]||r[l=ji(It(t))];!s&&i&&(s=r[l=ji(Eo(t))]),s&&Lt(s,e,6,n);const c=r[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Lt(c,e,6,n)}}function bd(e,t,o=!1){const r=t.emitsCache,n=r.get(e);if(n!==void 0)return n;const i=e.emits;let a={},l=!1;if(!me(e)){const s=c=>{const d=bd(c,t,!0);d&&(l=!0,Xe(a,d))};!o&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return!i&&!l?(ze(e)&&r.set(e,null),null):(ce(i)?i.forEach(s=>a[s]=null):Xe(a,i),ze(e)&&r.set(e,a),a)}function Ti(e,t){return!e||!gi(t)?!1:(t=t.slice(2).replace(/Once$/,""),$e(e,t[0].toLowerCase()+t.slice(1))||$e(e,Eo(t))||$e(e,t))}function Ol(e){const{type:t,vnode:o,proxy:r,withProxy:n,propsOptions:[i],slots:a,attrs:l,emit:s,render:c,renderCache:d,props:u,data:p,setupState:m,ctx:f,inheritAttrs:g}=e,S=ai(e);let v,$;try{if(o.shapeFlag&4){const w=n||r,z=w;v=Kt(c.call(z,w,d,u,m,p,f)),$=l}else{const w=t;v=Kt(w.length>1?w(u,{attrs:l,slots:a,emit:s}):w(u,null)),$=t.props?l:jh(l)}}catch(w){Jr.length=0,yi(w,e,1),v=ht(pt)}let T=v;if($&&g!==!1){const w=Object.keys($),{shapeFlag:z}=T;w.length&&z&7&&(i&&w.some(Na)&&($=Nh($,i)),T=Ro(T,$,!1,!0))}return o.dirs&&(T=Ro(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(o.dirs):o.dirs),o.transition&&or(T,o.transition),v=T,ai(S),v}const jh=e=>{let t;for(const o in e)(o==="class"||o==="style"||gi(o))&&((t||(t={}))[o]=e[o]);return t},Nh=(e,t)=>{const o={};for(const r in e)(!Na(r)||!(r.slice(9)in t))&&(o[r]=e[r]);return o};function Vh(e,t,o){const{props:r,children:n,component:i}=e,{props:a,children:l,patchFlag:s}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&s>=0){if(s&1024)return!0;if(s&16)return r?Ll(r,a,c):!!a;if(s&8){const d=t.dynamicProps;for(let u=0;ue.__isSuspense;function Uh(e,t){t&&t.pendingBranch?ce(e)?t.effects.push(...e):t.effects.push(e):ah(e)}const et=Symbol.for("v-fgt"),$i=Symbol.for("v-txt"),pt=Symbol.for("v-cmt"),Xn=Symbol.for("v-stc"),Jr=[];let Rt=null;function ba(e=!1){Jr.push(Rt=e?null:[])}function Gh(){Jr.pop(),Rt=Jr[Jr.length-1]||null}let cn=1;function Wl(e,t=!1){cn+=e,e<0&&Rt&&t&&(Rt.hasOnce=!0)}function xd(e){return e.dynamicChildren=cn>0?Rt||pr:null,Gh(),cn>0&&Rt&&Rt.push(e),e}function Y2(e,t,o,r,n,i){return xd(yd(e,t,o,r,n,i,!0))}function va(e,t,o,r,n){return xd(ht(e,t,o,r,n,!0))}function Cr(e){return e?e.__v_isVNode===!0:!1}function No(e,t){return e.type===t.type&&e.key===t.key}const Cd=({key:e})=>e??null,Jn=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||ot(e)||me(e)?{i:Ye,r:e,k:t,f:!!o}:e:null);function yd(e,t=null,o=null,r=0,n=null,i=e===et?0:1,a=!1,l=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Cd(t),ref:t&&Jn(t),scopeId:Dc,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ye};return l?(sl(s,o),i&128&&e.normalize(s)):o&&(s.shapeFlag|=We(o)?8:16),cn>0&&!a&&Rt&&(s.patchFlag>0||i&6)&&s.patchFlag!==32&&Rt.push(s),s}const ht=Kh;function Kh(e,t=null,o=null,r=0,n=null,i=!1){if((!e||e===ed)&&(e=pt),Cr(e)){const l=Ro(e,t,!0);return o&&sl(l,o),cn>0&&!i&&Rt&&(l.shapeFlag&6?Rt[Rt.indexOf(e)]=l:Rt.push(l)),l.patchFlag=-2,l}if(ng(e)&&(e=e.__vccOpts),t){t=Yh(t);let{class:l,style:s}=t;l&&!We(l)&&(t.class=Ga(l)),ze(s)&&(ol(s)&&!ce(s)&&(s=Xe({},s)),t.style=Ua(s))}const a=We(e)?1:vd(e)?128:Oc(e)?64:ze(e)?4:me(e)?2:0;return yd(e,t,o,r,n,a,i,!0)}function Yh(e){return e?ol(e)||sd(e)?Xe({},e):e:null}function Ro(e,t,o=!1,r=!1){const{props:n,ref:i,patchFlag:a,children:l,transition:s}=e,c=t?Sd(n||{},t):n,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Cd(c),ref:t&&t.ref?o&&i?ce(i)?i.concat(Jn(t)):[i,Jn(t)]:Jn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==et?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:s,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ro(e.ssContent),ssFallback:e.ssFallback&&Ro(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return s&&r&&or(d,s.clone(d)),d}function xa(e=" ",t=0){return ht($i,null,e,t)}function X2(e,t){const o=ht(Xn,null,e);return o.staticCount=t,o}function J2(e="",t=!1){return t?(ba(),va(pt,null,e)):ht(pt,null,e)}function Kt(e){return e==null||typeof e=="boolean"?ht(pt):ce(e)?ht(et,null,e.slice()):Cr(e)?wo(e):ht($i,null,String(e))}function wo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ro(e)}function sl(e,t){let o=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ce(t))o=16;else if(typeof t=="object")if(r&65){const n=t.default;n&&(n._c&&(n._d=!1),sl(e,n()),n._c&&(n._d=!0));return}else{o=32;const n=t._;!n&&!sd(t)?t._ctx=Ye:n===3&&Ye&&(Ye.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else me(t)?(t={default:t,_ctx:Ye},o=32):(t=String(t),r&64?(o=16,t=[xa(t)]):o=8);e.children=t,e.shapeFlag|=o}function Sd(...e){const t={};for(let o=0;ott||Ye;let ci,Ca;{const e=vi(),t=(o,r)=>{let n;return(n=e[o])||(n=e[o]=[]),n.push(r),i=>{n.length>1?n.forEach(a=>a(i)):n[0](i)}};ci=t("__VUE_INSTANCE_SETTERS__",o=>tt=o),Ca=t("__VUE_SSR_SETTERS__",o=>dn=o)}const wn=e=>{const t=tt;return ci(e),e.scope.on(),()=>{e.scope.off(),ci(t)}},jl=()=>{tt&&tt.scope.off(),ci(null)};function wd(e){return e.vnode.shapeFlag&4}let dn=!1;function Qh(e,t=!1,o=!1){t&&Ca(t);const{props:r,children:n}=e.vnode,i=wd(e);Rh(e,r,i,t),zh(e,n,o);const a=i?eg(e,t):void 0;return t&&Ca(!1),a}function eg(e,t){const o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xh);const{setup:r}=o;if(r){zo();const n=e.setupContext=r.length>1?og(e):null,i=wn(e),a=yn(r,e,0,[e.props,n]),l=lc(a);if(Mo(),i(),(l||e.sp)&&!br(e)&&Gc(e),l){if(a.then(jl,jl),t)return a.then(s=>{Nl(e,s)}).catch(s=>{yi(s,e,0)});e.asyncDep=a}else Nl(e,a)}else Pd(e)}function Nl(e,t,o){me(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:ze(t)&&(e.setupState=zc(t)),Pd(e)}function Pd(e,t,o){const r=e.type;e.render||(e.render=r.render||Jt);{const n=wn(e);zo();try{Ch(e)}finally{Mo(),n()}}}const tg={get(e,t){return dt(e,"get",""),e[t]}};function og(e){const t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,tg),slots:e.slots,emit:e.emit,expose:t}}function Ri(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(zc(da(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in Xr)return Xr[o](e)},has(t,o){return o in t||o in Xr}})):e.proxy}function rg(e,t=!0){return me(e)?e.displayName||e.name:e.name||t&&e.__name}function ng(e){return me(e)&&"__vccOpts"in e}const Y=(e,t)=>th(e,t,dn);function y(e,t,o){const r=arguments.length;return r===2?ze(t)&&!ce(t)?Cr(t)?ht(e,null,[t]):ht(e,t):ht(e,null,t):(r>3?o=Array.prototype.slice.call(arguments,2):r===3&&Cr(o)&&(o=[o]),ht(e,t,o))}const ig="3.5.13";/** +**/function yn(e,t,o,r){try{return r?e(...r):e()}catch(n){yi(n,t,o)}}function Lt(e,t,o,r){if(me(e)){const n=yn(e,t,o,r);return n&&lc(n)&&n.catch(i=>{yi(i,t,o)}),n}if(ce(e)){const n=[];for(let i=0;i>>1,n=xt[r],i=an(n);i=an(o)?xt.push(e):xt.splice(ih(t),0,e),e.flags|=1,zc()}}function zc(){ii||(ii=Mc.then(kc))}function ah(e){ce(e)?mr.push(...e):yo&&e.id===-1?yo.splice(fr+1,0,e):e.flags&1||(mr.push(e),e.flags|=1),zc()}function Rl(e,t,o=Gt+1){for(;oan(o)-an(r));if(mr.length=0,yo){yo.push(...t);return}for(yo=t,fr=0;fre.id==null?e.flags&2?-1:1/0:e.id;function kc(e){try{for(Gt=0;Gt{r._d&&Wl(-1);const i=ai(t);let a;try{a=e(...n)}finally{ai(i),r._d&&Wl(1)}return a};return r._n=!0,r._c=!0,r._d=!0,r}function V2(e,t){if(Ye===null)return e;const o=Ri(Ye),r=e.dirs||(e.dirs=[]);for(let n=0;ne.__isTeleport,Yr=e=>e&&(e.disabled||e.disabled===""),Fl=e=>e&&(e.defer||e.defer===""),Al=e=>typeof SVGElement<"u"&&e instanceof SVGElement,Il=e=>typeof MathMLElement=="function"&&e instanceof MathMLElement,fa=(e,t)=>{const o=e&&e.to;return We(o)?t?t(o):null:o},Lc={name:"Teleport",__isTeleport:!0,process(e,t,o,r,n,i,a,l,s,c){const{mc:d,pc:u,pbc:p,o:{insert:m,querySelector:f,createText:g,createComment:S}}=c,v=Yr(t.props);let{shapeFlag:$,children:T,dynamicChildren:w}=t;if(e==null){const _=t.el=g(""),O=t.anchor=g("");m(_,o,r),m(O,o,r);const x=(R,B)=>{$&16&&(n&&n.isCE&&(n.ce._teleportTarget=R),d(T,R,B,n,i,a,l,s))},F=()=>{const R=t.target=fa(t.props,f),B=Wc(R,t,g,m);R&&(a!=="svg"&&Al(R)?a="svg":a!=="mathml"&&Il(R)&&(a="mathml"),v||(x(R,B),Yn(t,!1)))};v&&(x(o,O),Yn(t,!0)),Fl(t.props)?bt(()=>{F(),t.el.__isMounted=!0},i):F()}else{if(Fl(t.props)&&!e.el.__isMounted){bt(()=>{Lc.process(e,t,o,r,n,i,a,l,s,c),delete e.el.__isMounted},i);return}t.el=e.el,t.targetStart=e.targetStart;const _=t.anchor=e.anchor,O=t.target=e.target,x=t.targetAnchor=e.targetAnchor,F=Yr(e.props),R=F?o:O,B=F?_:x;if(a==="svg"||Al(O)?a="svg":(a==="mathml"||Il(O))&&(a="mathml"),w?(p(e.dynamicChildren,w,R,n,i,a,l),al(e,t,!0)):s||u(e,t,R,B,n,i,a,l,!1),v)F?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):kn(t,o,_,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const j=t.target=fa(t.props,f);j&&kn(t,j,null,c,0)}else F&&kn(t,O,x,c,1);Yn(t,v)}},remove(e,t,o,{um:r,o:{remove:n}},i){const{shapeFlag:a,children:l,anchor:s,targetStart:c,targetAnchor:d,target:u,props:p}=e;if(u&&(n(c),n(d)),i&&n(s),a&16){const m=i||!Yr(p);for(let f=0;f{e.isMounted=!0}),nr(()=>{e.isUnmounting=!0}),e}const It=[Function,Array],Nc={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:It,onEnter:It,onAfterEnter:It,onEnterCancelled:It,onBeforeLeave:It,onLeave:It,onAfterLeave:It,onLeaveCancelled:It,onBeforeAppear:It,onAppear:It,onAfterAppear:It,onAppearCancelled:It},Vc=e=>{const t=e.subTree;return t.component?Vc(t.component):t},dh={name:"BaseTransition",props:Nc,setup(e,{slots:t}){const o=Sn(),r=jc();return()=>{const n=t.default&&nl(t.default(),!0);if(!n||!n.length)return;const i=Uc(n),a=we(e),{mode:l}=a;if(r.isLeaving)return Gi(i);const s=_l(i);if(!s)return Gi(i);let c=ln(s,a,r,o,u=>c=u);s.type!==pt&&or(s,c);let d=o.subTree&&_l(o.subTree);if(d&&d.type!==pt&&!No(s,d)&&Vc(o).type!==pt){let u=ln(d,a,r,o);if(or(d,u),l==="out-in"&&s.type!==pt)return r.isLeaving=!0,u.afterLeave=()=>{r.isLeaving=!1,o.job.flags&8||o.update(),delete u.afterLeave,d=void 0},Gi(i);l==="in-out"&&s.type!==pt?u.delayLeave=(p,m,f)=>{const g=qc(r,d);g[String(d.key)]=d,p[So]=()=>{m(),p[So]=void 0,delete c.delayedLeave,d=void 0},c.delayedLeave=()=>{f(),delete c.delayedLeave,d=void 0}}:d=void 0}else d&&(d=void 0);return i}}};function Uc(e){let t=e[0];if(e.length>1){for(const o of e)if(o.type!==pt){t=o;break}}return t}const uh=dh;function qc(e,t){const{leavingVNodes:o}=e;let r=o.get(t.type);return r||(r=Object.create(null),o.set(t.type,r)),r}function ln(e,t,o,r,n){const{appear:i,mode:a,persisted:l=!1,onBeforeEnter:s,onEnter:c,onAfterEnter:d,onEnterCancelled:u,onBeforeLeave:p,onLeave:m,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:S,onAppear:v,onAfterAppear:$,onAppearCancelled:T}=t,w=String(e.key),_=qc(o,e),O=(R,B)=>{R&&Lt(R,r,9,B)},x=(R,B)=>{const j=B[1];O(R,B),ce(R)?R.every(A=>A.length<=1)&&j():R.length<=1&&j()},F={mode:a,persisted:l,beforeEnter(R){let B=s;if(!o.isMounted)if(i)B=S||s;else return;R[So]&&R[So](!0);const j=_[w];j&&No(e,j)&&j.el[So]&&j.el[So](),O(B,[R])},enter(R){let B=c,j=d,A=u;if(!o.isMounted)if(i)B=v||c,j=$||d,A=T||u;else return;let J=!1;const G=R[Dn]=le=>{J||(J=!0,le?O(A,[R]):O(j,[R]),F.delayedLeave&&F.delayedLeave(),R[Dn]=void 0)};B?x(B,[R,G]):G()},leave(R,B){const j=String(e.key);if(R[Dn]&&R[Dn](!0),o.isUnmounting)return B();O(p,[R]);let A=!1;const J=R[So]=G=>{A||(A=!0,B(),G?O(g,[R]):O(f,[R]),R[So]=void 0,_[j]===e&&delete _[j])};_[j]=e,m?x(m,[R,J]):J()},clone(R){const B=ln(R,t,o,r,n);return n&&n(B),B}};return F}function Gi(e){if(Si(e))return e=Ro(e),e.children=null,e}function _l(e){if(!Si(e))return Bc(e.type)&&e.children?Uc(e.children):e;const{shapeFlag:t,children:o}=e;if(o){if(t&16)return o[0];if(t&32&&me(o.default))return o.default()}}function or(e,t){e.shapeFlag&6&&e.component?(e.transition=t,or(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function nl(e,t=!1,o){let r=[],n=0;for(let i=0;i1)for(let i=0;ili(f,t&&(ce(t)?t[g]:t),o,r,n));return}if(br(r)&&!n){r.shapeFlag&512&&r.type.__asyncResolved&&r.component.subTree.component&&li(e,t,o,r.component.subTree);return}const i=r.shapeFlag&4?Ri(r.component):r.el,a=n?null:i,{i:l,r:s}=e,c=t&&t.r,d=l.refs===Me?l.refs={}:l.refs,u=l.setupState,p=we(u),m=u===Me?()=>!1:f=>$e(p,f);if(c!=null&&c!==s&&(We(c)?(d[c]=null,m(c)&&(u[c]=null)):ot(c)&&(c.value=null)),me(s))yn(s,l,12,[a,d]);else{const f=We(s),g=ot(s);if(f||g){const S=()=>{if(e.f){const v=f?m(s)?u[s]:d[s]:s.value;n?ce(v)&&Va(v,i):ce(v)?v.includes(i)||v.push(i):f?(d[s]=[i],m(s)&&(u[s]=d[s])):(s.value=[i],e.k&&(d[e.k]=s.value))}else f?(d[s]=a,m(s)&&(u[s]=a)):g&&(s.value=a,e.k&&(d[e.k]=a))};a?(S.id=-1,bt(S,o)):S()}}}vi().requestIdleCallback;vi().cancelIdleCallback;const br=e=>!!e.type.__asyncLoader,Si=e=>e.type.__isKeepAlive;function Kc(e,t){Xc(e,"a",t)}function Yc(e,t){Xc(e,"da",t)}function Xc(e,t,o=tt){const r=e.__wdc||(e.__wdc=()=>{let n=o;for(;n;){if(n.isDeactivated)return;n=n.parent}return e()});if(wi(t,r,o),o){let n=o.parent;for(;n&&n.parent;)Si(n.parent.vnode)&&fh(r,t,o,n),n=n.parent}}function fh(e,t,o,r){const n=wi(t,e,r,!0);Zc(()=>{Va(r[t],n)},o)}function wi(e,t,o=tt,r=!1){if(o){const n=o[e]||(o[e]=[]),i=t.__weh||(t.__weh=(...a)=>{_o();const l=wn(o),s=Lt(t,o,e,a);return l(),Eo(),s});return r?n.unshift(i):n.push(i),i}}const go=e=>(t,o=tt)=>{(!dn||e==="sp")&&wi(e,(...r)=>t(...r),o)},Pi=go("bm"),Mo=go("m"),ph=go("bu"),Jc=go("u"),nr=go("bum"),Zc=go("um"),hh=go("sp"),gh=go("rtg"),mh=go("rtc");function bh(e,t=tt){wi("ec",e,t)}const Qc="components";function U2(e,t){return td(Qc,e,!0,t)||e}const ed=Symbol.for("v-ndc");function q2(e){return We(e)?td(Qc,e,!1)||e:e||ed}function td(e,t,o=!0,r=!1){const n=Ye||tt;if(n){const i=n.type;{const l=rg(i,!1);if(l&&(l===t||l===Mt(t)||l===bi(Mt(t))))return i}const a=El(n[e]||i[e],t)||El(n.appContext[e],t);return!a&&r?i:a}}function El(e,t){return e&&(e[t]||e[Mt(t)]||e[bi(Mt(t))])}function G2(e,t,o,r){let n;const i=o,a=ce(e);if(a||We(e)){const l=a&&gr(e);let s=!1;l&&(s=!_t(e),e=xi(e)),n=new Array(e.length);for(let c=0,d=e.length;ct(l,s,void 0,i));else{const l=Object.keys(e);n=new Array(l.length);for(let s=0,c=l.length;sCr(t)?!(t.type===pt||t.type===et&&!od(t.children)):!0)?e:null}const pa=e=>e?wd(e)?Ri(e):pa(e.parent):null,Xr=Xe(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>pa(e.parent),$root:e=>pa(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>nd(e),$forceUpdate:e=>e.f||(e.f=()=>{rl(e.update)}),$nextTick:e=>e.n||(e.n=nn.bind(e.proxy)),$watch:e=>Bh.bind(e)}),Ki=(e,t)=>e!==Me&&!e.__isScriptSetup&&$e(e,t),xh={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:o,setupState:r,data:n,props:i,accessCache:a,type:l,appContext:s}=e;let c;if(t[0]!=="$"){const m=a[t];if(m!==void 0)switch(m){case 1:return r[t];case 2:return n[t];case 4:return o[t];case 3:return i[t]}else{if(Ki(r,t))return a[t]=1,r[t];if(n!==Me&&$e(n,t))return a[t]=2,n[t];if((c=e.propsOptions[0])&&$e(c,t))return a[t]=3,i[t];if(o!==Me&&$e(o,t))return a[t]=4,o[t];ha&&(a[t]=0)}}const d=Xr[t];let u,p;if(d)return t==="$attrs"&&dt(e.attrs,"get",""),d(e);if((u=l.__cssModules)&&(u=u[t]))return u;if(o!==Me&&$e(o,t))return a[t]=4,o[t];if(p=s.config.globalProperties,$e(p,t))return p[t]},set({_:e},t,o){const{data:r,setupState:n,ctx:i}=e;return Ki(n,t)?(n[t]=o,!0):r!==Me&&$e(r,t)?(r[t]=o,!0):$e(e.props,t)||t[0]==="$"&&t.slice(1)in e?!1:(i[t]=o,!0)},has({_:{data:e,setupState:t,accessCache:o,ctx:r,appContext:n,propsOptions:i}},a){let l;return!!o[a]||e!==Me&&$e(e,a)||Ki(t,a)||(l=i[0])&&$e(l,a)||$e(r,a)||$e(Xr,a)||$e(n.config.globalProperties,a)},defineProperty(e,t,o){return o.get!=null?e._.accessCache[t]=0:$e(o,"value")&&this.set(e,t,o.value,null),Reflect.defineProperty(e,t,o)}};function Ml(e){return ce(e)?e.reduce((t,o)=>(t[o]=null,t),{}):e}let ha=!0;function Ch(e){const t=nd(e),o=e.proxy,r=e.ctx;ha=!1,t.beforeCreate&&zl(t.beforeCreate,e,"bc");const{data:n,computed:i,methods:a,watch:l,provide:s,inject:c,created:d,beforeMount:u,mounted:p,beforeUpdate:m,updated:f,activated:g,deactivated:S,beforeDestroy:v,beforeUnmount:$,destroyed:T,unmounted:w,render:_,renderTracked:O,renderTriggered:x,errorCaptured:F,serverPrefetch:R,expose:B,inheritAttrs:j,components:A,directives:J,filters:G}=t;if(c&&yh(c,r,null),a)for(const N in a){const oe=a[N];me(oe)&&(r[N]=oe.bind(o))}if(n){const N=n.call(o,o);_e(N)&&(e.data=Ci(N))}if(ha=!0,i)for(const N in i){const oe=i[N],ye=me(oe)?oe.bind(o,o):me(oe.get)?oe.get.bind(o,o):Jt,Pe=!me(oe)&&me(oe.set)?oe.set.bind(o):Jt,Re=Y({get:ye,set:Pe});Object.defineProperty(r,N,{enumerable:!0,configurable:!0,get:()=>Re.value,set:Fe=>Re.value=Fe})}if(l)for(const N in l)rd(l[N],r,o,N);if(s){const N=me(s)?s.call(o):s;Reflect.ownKeys(N).forEach(oe=>{po(oe,N[oe])})}d&&zl(d,e,"c");function te(N,oe){ce(oe)?oe.forEach(ye=>N(ye.bind(o))):oe&&N(oe.bind(o))}if(te(Pi,u),te(Mo,p),te(ph,m),te(Jc,f),te(Kc,g),te(Yc,S),te(bh,F),te(mh,O),te(gh,x),te(nr,$),te(Zc,w),te(hh,R),ce(B))if(B.length){const N=e.exposed||(e.exposed={});B.forEach(oe=>{Object.defineProperty(N,oe,{get:()=>o[oe],set:ye=>o[oe]=ye})})}else e.exposed||(e.exposed={});_&&e.render===Jt&&(e.render=_),j!=null&&(e.inheritAttrs=j),A&&(e.components=A),J&&(e.directives=J),R&&Gc(e)}function yh(e,t,o=Jt){ce(e)&&(e=ga(e));for(const r in e){const n=e[r];let i;_e(n)?"default"in n?i=Le(n.from||r,n.default,!0):i=Le(n.from||r):i=Le(n),ot(i)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>i.value,set:a=>i.value=a}):t[r]=i}}function zl(e,t,o){Lt(ce(e)?e.map(r=>r.bind(t.proxy)):e.bind(t.proxy),t,o)}function rd(e,t,o,r){let n=r.includes(".")?md(o,r):()=>o[r];if(We(e)){const i=t[e];me(i)&&Zt(n,i)}else if(me(e))Zt(n,e.bind(o));else if(_e(e))if(ce(e))e.forEach(i=>rd(i,t,o,r));else{const i=me(e.handler)?e.handler.bind(o):t[e.handler];me(i)&&Zt(n,i,e)}}function nd(e){const t=e.type,{mixins:o,extends:r}=t,{mixins:n,optionsCache:i,config:{optionMergeStrategies:a}}=e.appContext,l=i.get(t);let s;return l?s=l:!n.length&&!o&&!r?s=t:(s={},n.length&&n.forEach(c=>si(s,c,a,!0)),si(s,t,a)),_e(t)&&i.set(t,s),s}function si(e,t,o,r=!1){const{mixins:n,extends:i}=t;i&&si(e,i,o,!0),n&&n.forEach(a=>si(e,a,o,!0));for(const a in t)if(!(r&&a==="expose")){const l=Sh[a]||o&&o[a];e[a]=l?l(e[a],t[a]):t[a]}return e}const Sh={data:Hl,props:kl,emits:kl,methods:Nr,computed:Nr,beforeCreate:mt,created:mt,beforeMount:mt,mounted:mt,beforeUpdate:mt,updated:mt,beforeDestroy:mt,beforeUnmount:mt,destroyed:mt,unmounted:mt,activated:mt,deactivated:mt,errorCaptured:mt,serverPrefetch:mt,components:Nr,directives:Nr,watch:Ph,provide:Hl,inject:wh};function Hl(e,t){return t?e?function(){return Xe(me(e)?e.call(this,this):e,me(t)?t.call(this,this):t)}:t:e}function wh(e,t){return Nr(ga(e),ga(t))}function ga(e){if(ce(e)){const t={};for(let o=0;o1)return o&&me(t)?t.call(r&&r.proxy):t}}function K2(){return!!(tt||Ye||Xo)}const ad={},ld=()=>Object.create(ad),sd=e=>Object.getPrototypeOf(e)===ad;function Rh(e,t,o,r=!1){const n={},i=ld();e.propsDefaults=Object.create(null),cd(e,t,n,i);for(const a in e.propsOptions[0])a in n||(n[a]=void 0);o?e.props=r?n:Kp(n):e.type.props?e.props=n:e.props=i,e.attrs=i}function Fh(e,t,o,r){const{props:n,attrs:i,vnode:{patchFlag:a}}=e,l=we(n),[s]=e.propsOptions;let c=!1;if((r||a>0)&&!(a&16)){if(a&8){const d=e.vnode.dynamicProps;for(let u=0;u{s=!0;const[p,m]=dd(u,t,!0);Xe(a,p),m&&l.push(...m)};!o&&t.mixins.length&&t.mixins.forEach(d),e.extends&&d(e.extends),e.mixins&&e.mixins.forEach(d)}if(!i&&!s)return _e(e)&&r.set(e,pr),pr;if(ce(i))for(let d=0;de[0]==="_"||e==="$stable",il=e=>ce(e)?e.map(Kt):[Kt(e)],Ih=(e,t,o)=>{if(t._n)return t;const r=lh((...n)=>il(t(...n)),o);return r._c=!1,r},fd=(e,t,o)=>{const r=e._ctx;for(const n in e){if(ud(n))continue;const i=e[n];if(me(i))t[n]=Ih(n,i,r);else if(i!=null){const a=il(i);t[n]=()=>a}}},pd=(e,t)=>{const o=il(t);e.slots.default=()=>o},hd=(e,t,o)=>{for(const r in t)(o||r!=="_")&&(e[r]=t[r])},_h=(e,t,o)=>{const r=e.slots=ld();if(e.vnode.shapeFlag&32){const n=t._;n?(hd(r,t,o),o&&dc(r,"_",n,!0)):fd(t,r)}else t&&pd(e,t)},Eh=(e,t,o)=>{const{vnode:r,slots:n}=e;let i=!0,a=Me;if(r.shapeFlag&32){const l=t._;l?o&&l===1?i=!1:hd(n,t,o):(i=!t.$stable,fd(t,n)),a=t}else t&&(pd(e,t),a={default:1});if(i)for(const l in n)!ud(l)&&a[l]==null&&delete n[l]},bt=qh;function Mh(e){return zh(e)}function zh(e,t){const o=vi();o.__VUE__=!0;const{insert:r,remove:n,patchProp:i,createElement:a,createText:l,createComment:s,setText:c,setElementText:d,parentNode:u,nextSibling:p,setScopeId:m=Jt,insertStaticContent:f}=e,g=(h,b,P,H=null,M=null,k=null,q=void 0,U=null,z=!!b.dynamicChildren)=>{if(h===b)return;h&&!No(h,b)&&(H=Ue(h),Fe(h,M,k,!0),h=null),b.patchFlag===-2&&(z=!1,b.dynamicChildren=null);const{type:I,ref:ie,shapeFlag:X}=b;switch(I){case $i:S(h,b,P,H);break;case pt:v(h,b,P,H);break;case Xn:h==null&&$(b,P,H,q);break;case et:A(h,b,P,H,M,k,q,U,z);break;default:X&1?_(h,b,P,H,M,k,q,U,z):X&6?J(h,b,P,H,M,k,q,U,z):(X&64||X&128)&&I.process(h,b,P,H,M,k,q,U,z,Ge)}ie!=null&&M&&li(ie,h&&h.ref,k,b||h,!b)},S=(h,b,P,H)=>{if(h==null)r(b.el=l(b.children),P,H);else{const M=b.el=h.el;b.children!==h.children&&c(M,b.children)}},v=(h,b,P,H)=>{h==null?r(b.el=s(b.children||""),P,H):b.el=h.el},$=(h,b,P,H)=>{[h.el,h.anchor]=f(h.children,b,P,H,h.el,h.anchor)},T=({el:h,anchor:b},P,H)=>{let M;for(;h&&h!==b;)M=p(h),r(h,P,H),h=M;r(b,P,H)},w=({el:h,anchor:b})=>{let P;for(;h&&h!==b;)P=p(h),n(h),h=P;n(b)},_=(h,b,P,H,M,k,q,U,z)=>{b.type==="svg"?q="svg":b.type==="math"&&(q="mathml"),h==null?O(b,P,H,M,k,q,U,z):R(h,b,M,k,q,U,z)},O=(h,b,P,H,M,k,q,U)=>{let z,I;const{props:ie,shapeFlag:X,transition:ne,dirs:se}=h;if(z=h.el=a(h.type,k,ie&&ie.is,ie),X&8?d(z,h.children):X&16&&F(h.children,z,null,H,M,Yi(h,k),q,U),se&&Do(h,null,H,"created"),x(z,h,h.scopeId,q,H),ie){for(const Te in ie)Te!=="value"&&!qr(Te)&&i(z,Te,null,ie[Te],k,H);"value"in ie&&i(z,"value",null,ie.value,k),(I=ie.onVnodeBeforeMount)&&Nt(I,H,h)}se&&Do(h,null,H,"beforeMount");const ve=Hh(M,ne);ve&&ne.beforeEnter(z),r(z,b,P),((I=ie&&ie.onVnodeMounted)||ve||se)&&bt(()=>{I&&Nt(I,H,h),ve&&ne.enter(z),se&&Do(h,null,H,"mounted")},M)},x=(h,b,P,H,M)=>{if(P&&m(h,P),H)for(let k=0;k{for(let I=z;I{const U=b.el=h.el;let{patchFlag:z,dynamicChildren:I,dirs:ie}=b;z|=h.patchFlag&16;const X=h.props||Me,ne=b.props||Me;let se;if(P&&Oo(P,!1),(se=ne.onVnodeBeforeUpdate)&&Nt(se,P,b,h),ie&&Do(b,h,P,"beforeUpdate"),P&&Oo(P,!0),(X.innerHTML&&ne.innerHTML==null||X.textContent&&ne.textContent==null)&&d(U,""),I?B(h.dynamicChildren,I,U,P,H,Yi(b,M),k):q||oe(h,b,U,null,P,H,Yi(b,M),k,!1),z>0){if(z&16)j(U,X,ne,P,M);else if(z&2&&X.class!==ne.class&&i(U,"class",null,ne.class,M),z&4&&i(U,"style",X.style,ne.style,M),z&8){const ve=b.dynamicProps;for(let Te=0;Te{se&&Nt(se,P,b,h),ie&&Do(b,h,P,"updated")},H)},B=(h,b,P,H,M,k,q)=>{for(let U=0;U{if(b!==P){if(b!==Me)for(const k in b)!qr(k)&&!(k in P)&&i(h,k,b[k],null,M,H);for(const k in P){if(qr(k))continue;const q=P[k],U=b[k];q!==U&&k!=="value"&&i(h,k,U,q,M,H)}"value"in P&&i(h,"value",b.value,P.value,M)}},A=(h,b,P,H,M,k,q,U,z)=>{const I=b.el=h?h.el:l(""),ie=b.anchor=h?h.anchor:l("");let{patchFlag:X,dynamicChildren:ne,slotScopeIds:se}=b;se&&(U=U?U.concat(se):se),h==null?(r(I,P,H),r(ie,P,H),F(b.children||[],P,ie,M,k,q,U,z)):X>0&&X&64&&ne&&h.dynamicChildren?(B(h.dynamicChildren,ne,P,M,k,q,U),(b.key!=null||M&&b===M.subTree)&&al(h,b,!0)):oe(h,b,P,ie,M,k,q,U,z)},J=(h,b,P,H,M,k,q,U,z)=>{b.slotScopeIds=U,h==null?b.shapeFlag&512?M.ctx.activate(b,P,H,q,z):G(b,P,H,M,k,q,z):le(h,b,z)},G=(h,b,P,H,M,k,q)=>{const U=h.component=Zh(h,H,M);if(Si(h)&&(U.ctx.renderer=Ge),Qh(U,!1,q),U.asyncDep){if(M&&M.registerDep(U,te,q),!h.el){const z=U.subTree=ht(pt);v(null,z,b,P)}}else te(U,h,b,P,M,k,q)},le=(h,b,P)=>{const H=b.component=h.component;if(Vh(h,b,P))if(H.asyncDep&&!H.asyncResolved){N(H,b,P);return}else H.next=b,H.update();else b.el=h.el,H.vnode=b},te=(h,b,P,H,M,k,q)=>{const U=()=>{if(h.isMounted){let{next:X,bu:ne,u:se,parent:ve,vnode:Te}=h;{const it=gd(h);if(it){X&&(X.el=Te.el,N(h,X,q)),it.asyncDep.then(()=>{h.isUnmounted||U()});return}}let Ce=X,Ze;Oo(h,!1),X?(X.el=Te.el,N(h,X,q)):X=Te,ne&&Kn(ne),(Ze=X.props&&X.props.onVnodeBeforeUpdate)&&Nt(Ze,ve,X,Te),Oo(h,!0);const Qe=Bl(h),nt=h.subTree;h.subTree=Qe,g(nt,Qe,u(nt.el),Ue(nt),h,M,k),X.el=Qe.el,Ce===null&&Uh(h,Qe.el),se&&bt(se,M),(Ze=X.props&&X.props.onVnodeUpdated)&&bt(()=>Nt(Ze,ve,X,Te),M)}else{let X;const{el:ne,props:se}=b,{bm:ve,m:Te,parent:Ce,root:Ze,type:Qe}=h,nt=br(b);Oo(h,!1),ve&&Kn(ve),!nt&&(X=se&&se.onVnodeBeforeMount)&&Nt(X,Ce,b),Oo(h,!0);{Ze.ce&&Ze.ce._injectChildStyle(Qe);const it=h.subTree=Bl(h);g(null,it,P,H,h,M,k),b.el=it.el}if(Te&&bt(Te,M),!nt&&(X=se&&se.onVnodeMounted)){const it=b;bt(()=>Nt(X,Ce,it),M)}(b.shapeFlag&256||Ce&&br(Ce.vnode)&&Ce.vnode.shapeFlag&256)&&h.a&&bt(h.a,M),h.isMounted=!0,b=P=H=null}};h.scope.on();const z=h.effect=new gc(U);h.scope.off();const I=h.update=z.run.bind(z),ie=h.job=z.runIfDirty.bind(z);ie.i=h,ie.id=h.uid,z.scheduler=()=>rl(ie),Oo(h,!0),I()},N=(h,b,P)=>{b.component=h;const H=h.vnode.props;h.vnode=b,h.next=null,Fh(h,b.props,H,P),Eh(h,b.children,P),_o(),Rl(h),Eo()},oe=(h,b,P,H,M,k,q,U,z=!1)=>{const I=h&&h.children,ie=h?h.shapeFlag:0,X=b.children,{patchFlag:ne,shapeFlag:se}=b;if(ne>0){if(ne&128){Pe(I,X,P,H,M,k,q,U,z);return}else if(ne&256){ye(I,X,P,H,M,k,q,U,z);return}}se&8?(ie&16&&he(I,M,k),X!==I&&d(P,X)):ie&16?se&16?Pe(I,X,P,H,M,k,q,U,z):he(I,M,k,!0):(ie&8&&d(P,""),se&16&&F(X,P,H,M,k,q,U,z))},ye=(h,b,P,H,M,k,q,U,z)=>{h=h||pr,b=b||pr;const I=h.length,ie=b.length,X=Math.min(I,ie);let ne;for(ne=0;neie?he(h,M,k,!0,!1,X):F(b,P,H,M,k,q,U,z,X)},Pe=(h,b,P,H,M,k,q,U,z)=>{let I=0;const ie=b.length;let X=h.length-1,ne=ie-1;for(;I<=X&&I<=ne;){const se=h[I],ve=b[I]=z?wo(b[I]):Kt(b[I]);if(No(se,ve))g(se,ve,P,null,M,k,q,U,z);else break;I++}for(;I<=X&&I<=ne;){const se=h[X],ve=b[ne]=z?wo(b[ne]):Kt(b[ne]);if(No(se,ve))g(se,ve,P,null,M,k,q,U,z);else break;X--,ne--}if(I>X){if(I<=ne){const se=ne+1,ve=sene)for(;I<=X;)Fe(h[I],M,k,!0),I++;else{const se=I,ve=I,Te=new Map;for(I=ve;I<=ne;I++){const at=b[I]=z?wo(b[I]):Kt(b[I]);at.key!=null&&Te.set(at.key,I)}let Ce,Ze=0;const Qe=ne-ve+1;let nt=!1,it=0;const Wt=new Array(Qe);for(I=0;I=Qe){Fe(at,M,k,!0);continue}let D;if(at.key!=null)D=Te.get(at.key);else for(Ce=ve;Ce<=ne;Ce++)if(Wt[Ce-ve]===0&&No(at,b[Ce])){D=Ce;break}D===void 0?Fe(at,M,k,!0):(Wt[D-ve]=I+1,D>=it?it=D:nt=!0,g(at,b[D],P,null,M,k,q,U,z),Ze++)}const Ht=nt?kh(Wt):pr;for(Ce=Ht.length-1,I=Qe-1;I>=0;I--){const at=ve+I,D=b[at],Q=at+1{const{el:k,type:q,transition:U,children:z,shapeFlag:I}=h;if(I&6){Re(h.component.subTree,b,P,H);return}if(I&128){h.suspense.move(b,P,H);return}if(I&64){q.move(h,b,P,Ge);return}if(q===et){r(k,b,P);for(let X=0;XU.enter(k),M);else{const{leave:X,delayLeave:ne,afterLeave:se}=U,ve=()=>r(k,b,P),Te=()=>{X(k,()=>{ve(),se&&se()})};ne?ne(k,ve,Te):Te()}else r(k,b,P)},Fe=(h,b,P,H=!1,M=!1)=>{const{type:k,props:q,ref:U,children:z,dynamicChildren:I,shapeFlag:ie,patchFlag:X,dirs:ne,cacheIndex:se}=h;if(X===-2&&(M=!1),U!=null&&li(U,null,P,h,!0),se!=null&&(b.renderCache[se]=void 0),ie&256){b.ctx.deactivate(h);return}const ve=ie&1&&ne,Te=!br(h);let Ce;if(Te&&(Ce=q&&q.onVnodeBeforeUnmount)&&Nt(Ce,b,h),ie&6)gt(h.component,P,H);else{if(ie&128){h.suspense.unmount(P,H);return}ve&&Do(h,null,b,"beforeUnmount"),ie&64?h.type.remove(h,b,P,Ge,H):I&&!I.hasOnce&&(k!==et||X>0&&X&64)?he(I,b,P,!1,!0):(k===et&&X&384||!M&&ie&16)&&he(z,b,P),H&&Ve(h)}(Te&&(Ce=q&&q.onVnodeUnmounted)||ve)&&bt(()=>{Ce&&Nt(Ce,b,h),ve&&Do(h,null,b,"unmounted")},P)},Ve=h=>{const{type:b,el:P,anchor:H,transition:M}=h;if(b===et){qe(P,H);return}if(b===Xn){w(h);return}const k=()=>{n(P),M&&!M.persisted&&M.afterLeave&&M.afterLeave()};if(h.shapeFlag&1&&M&&!M.persisted){const{leave:q,delayLeave:U}=M,z=()=>q(P,k);U?U(h.el,k,z):z()}else k()},qe=(h,b)=>{let P;for(;h!==b;)P=p(h),n(h),h=P;n(b)},gt=(h,b,P)=>{const{bum:H,scope:M,job:k,subTree:q,um:U,m:z,a:I}=h;Ol(z),Ol(I),H&&Kn(H),M.stop(),k&&(k.flags|=8,Fe(q,h,b,P)),U&&bt(U,b),bt(()=>{h.isUnmounted=!0},b),b&&b.pendingBranch&&!b.isUnmounted&&h.asyncDep&&!h.asyncResolved&&h.suspenseId===b.pendingId&&(b.deps--,b.deps===0&&b.resolve())},he=(h,b,P,H=!1,M=!1,k=0)=>{for(let q=k;q{if(h.shapeFlag&6)return Ue(h.component.subTree);if(h.shapeFlag&128)return h.suspense.next();const b=p(h.anchor||h.el),P=b&&b[Oc];return P?p(P):b};let rt=!1;const be=(h,b,P)=>{h==null?b._vnode&&Fe(b._vnode,null,null,!0):g(b._vnode||null,h,b,null,null,null,P),b._vnode=h,rt||(rt=!0,Rl(),Hc(),rt=!1)},Ge={p:g,um:Fe,m:Re,r:Ve,mt:G,mc:F,pc:oe,pbc:B,n:Ue,o:e};return{render:be,hydrate:void 0,createApp:$h(be)}}function Yi({type:e,props:t},o){return o==="svg"&&e==="foreignObject"||o==="mathml"&&e==="annotation-xml"&&t&&t.encoding&&t.encoding.includes("html")?void 0:o}function Oo({effect:e,job:t},o){o?(e.flags|=32,t.flags|=4):(e.flags&=-33,t.flags&=-5)}function Hh(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}function al(e,t,o=!1){const r=e.children,n=t.children;if(ce(r)&&ce(n))for(let i=0;i>1,e[o[l]]0&&(t[r]=o[i-1]),o[i]=r)}}for(i=o.length,a=o[i-1];i-- >0;)o[i]=a,a=t[a];return o}function gd(e){const t=e.subTree.component;if(t)return t.asyncDep&&!t.asyncResolved?t:gd(t)}function Ol(e){if(e)for(let t=0;tLe(Dh);function sn(e,t){return ll(e,null,t)}function Zt(e,t,o){return ll(e,t,o)}function ll(e,t,o=Me){const{immediate:r,deep:n,flush:i,once:a}=o,l=Xe({},o),s=t&&r||!t&&i!=="post";let c;if(dn){if(i==="sync"){const m=Oh();c=m.__watcherHandles||(m.__watcherHandles=[])}else if(!s){const m=()=>{};return m.stop=Jt,m.resume=Jt,m.pause=Jt,m}}const d=tt;l.call=(m,f,g)=>Lt(m,d,f,g);let u=!1;i==="post"?l.scheduler=m=>{bt(m,d&&d.suspense)}:i!=="sync"&&(u=!0,l.scheduler=(m,f)=>{f?m():rl(m)}),l.augmentJob=m=>{t&&(m.flags|=4),u&&(m.flags|=2,d&&(m.id=d.uid,m.i=d))};const p=rh(e,t,l);return dn&&(c?c.push(p):s&&p()),p}function Bh(e,t,o){const r=this.proxy,n=We(e)?e.includes(".")?md(r,e):()=>r[e]:e.bind(r,r);let i;me(t)?i=t:(i=t.handler,o=t);const a=wn(this),l=ll(n,i.bind(r),o);return a(),l}function md(e,t){const o=t.split(".");return()=>{let r=e;for(let n=0;nt==="modelValue"||t==="model-value"?e.modelModifiers:e[`${t}Modifiers`]||e[`${Mt(t)}Modifiers`]||e[`${Io(t)}Modifiers`];function Wh(e,t,...o){if(e.isUnmounted)return;const r=e.vnode.props||Me;let n=o;const i=t.startsWith("update:"),a=i&&Lh(r,t.slice(7));a&&(a.trim&&(n=o.map(d=>We(d)?d.trim():d)),a.number&&(n=o.map(oi)));let l,s=r[l=ji(t)]||r[l=ji(Mt(t))];!s&&i&&(s=r[l=ji(Io(t))]),s&&Lt(s,e,6,n);const c=r[l+"Once"];if(c){if(!e.emitted)e.emitted={};else if(e.emitted[l])return;e.emitted[l]=!0,Lt(c,e,6,n)}}function bd(e,t,o=!1){const r=t.emitsCache,n=r.get(e);if(n!==void 0)return n;const i=e.emits;let a={},l=!1;if(!me(e)){const s=c=>{const d=bd(c,t,!0);d&&(l=!0,Xe(a,d))};!o&&t.mixins.length&&t.mixins.forEach(s),e.extends&&s(e.extends),e.mixins&&e.mixins.forEach(s)}return!i&&!l?(_e(e)&&r.set(e,null),null):(ce(i)?i.forEach(s=>a[s]=null):Xe(a,i),_e(e)&&r.set(e,a),a)}function Ti(e,t){return!e||!gi(t)?!1:(t=t.slice(2).replace(/Once$/,""),$e(e,t[0].toLowerCase()+t.slice(1))||$e(e,Io(t))||$e(e,t))}function Bl(e){const{type:t,vnode:o,proxy:r,withProxy:n,propsOptions:[i],slots:a,attrs:l,emit:s,render:c,renderCache:d,props:u,data:p,setupState:m,ctx:f,inheritAttrs:g}=e,S=ai(e);let v,$;try{if(o.shapeFlag&4){const w=n||r,_=w;v=Kt(c.call(_,w,d,u,m,p,f)),$=l}else{const w=t;v=Kt(w.length>1?w(u,{attrs:l,slots:a,emit:s}):w(u,null)),$=t.props?l:jh(l)}}catch(w){Jr.length=0,yi(w,e,1),v=ht(pt)}let T=v;if($&&g!==!1){const w=Object.keys($),{shapeFlag:_}=T;w.length&&_&7&&(i&&w.some(Na)&&($=Nh($,i)),T=Ro(T,$,!1,!0))}return o.dirs&&(T=Ro(T,null,!1,!0),T.dirs=T.dirs?T.dirs.concat(o.dirs):o.dirs),o.transition&&or(T,o.transition),v=T,ai(S),v}const jh=e=>{let t;for(const o in e)(o==="class"||o==="style"||gi(o))&&((t||(t={}))[o]=e[o]);return t},Nh=(e,t)=>{const o={};for(const r in e)(!Na(r)||!(r.slice(9)in t))&&(o[r]=e[r]);return o};function Vh(e,t,o){const{props:r,children:n,component:i}=e,{props:a,children:l,patchFlag:s}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(o&&s>=0){if(s&1024)return!0;if(s&16)return r?Ll(r,a,c):!!a;if(s&8){const d=t.dynamicProps;for(let u=0;ue.__isSuspense;function qh(e,t){t&&t.pendingBranch?ce(e)?t.effects.push(...e):t.effects.push(e):ah(e)}const et=Symbol.for("v-fgt"),$i=Symbol.for("v-txt"),pt=Symbol.for("v-cmt"),Xn=Symbol.for("v-stc"),Jr=[];let Rt=null;function ba(e=!1){Jr.push(Rt=e?null:[])}function Gh(){Jr.pop(),Rt=Jr[Jr.length-1]||null}let cn=1;function Wl(e,t=!1){cn+=e,e<0&&Rt&&t&&(Rt.hasOnce=!0)}function xd(e){return e.dynamicChildren=cn>0?Rt||pr:null,Gh(),cn>0&&Rt&&Rt.push(e),e}function Y2(e,t,o,r,n,i){return xd(yd(e,t,o,r,n,i,!0))}function va(e,t,o,r,n){return xd(ht(e,t,o,r,n,!0))}function Cr(e){return e?e.__v_isVNode===!0:!1}function No(e,t){return e.type===t.type&&e.key===t.key}const Cd=({key:e})=>e??null,Jn=({ref:e,ref_key:t,ref_for:o})=>(typeof e=="number"&&(e=""+e),e!=null?We(e)||ot(e)||me(e)?{i:Ye,r:e,k:t,f:!!o}:e:null);function yd(e,t=null,o=null,r=0,n=null,i=e===et?0:1,a=!1,l=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Cd(t),ref:t&&Jn(t),scopeId:Dc,slotScopeIds:null,children:o,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:r,dynamicProps:n,dynamicChildren:null,appContext:null,ctx:Ye};return l?(sl(s,o),i&128&&e.normalize(s)):o&&(s.shapeFlag|=We(o)?8:16),cn>0&&!a&&Rt&&(s.patchFlag>0||i&6)&&s.patchFlag!==32&&Rt.push(s),s}const ht=Kh;function Kh(e,t=null,o=null,r=0,n=null,i=!1){if((!e||e===ed)&&(e=pt),Cr(e)){const l=Ro(e,t,!0);return o&&sl(l,o),cn>0&&!i&&Rt&&(l.shapeFlag&6?Rt[Rt.indexOf(e)]=l:Rt.push(l)),l.patchFlag=-2,l}if(ng(e)&&(e=e.__vccOpts),t){t=Yh(t);let{class:l,style:s}=t;l&&!We(l)&&(t.class=Ga(l)),_e(s)&&(ol(s)&&!ce(s)&&(s=Xe({},s)),t.style=qa(s))}const a=We(e)?1:vd(e)?128:Bc(e)?64:_e(e)?4:me(e)?2:0;return yd(e,t,o,r,n,a,i,!0)}function Yh(e){return e?ol(e)||sd(e)?Xe({},e):e:null}function Ro(e,t,o=!1,r=!1){const{props:n,ref:i,patchFlag:a,children:l,transition:s}=e,c=t?Sd(n||{},t):n,d={__v_isVNode:!0,__v_skip:!0,type:e.type,props:c,key:c&&Cd(c),ref:t&&t.ref?o&&i?ce(i)?i.concat(Jn(t)):[i,Jn(t)]:Jn(t):i,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:l,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==et?a===-1?16:a|16:a,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:s,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Ro(e.ssContent),ssFallback:e.ssFallback&&Ro(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return s&&r&&or(d,s.clone(d)),d}function xa(e=" ",t=0){return ht($i,null,e,t)}function X2(e,t){const o=ht(Xn,null,e);return o.staticCount=t,o}function J2(e="",t=!1){return t?(ba(),va(pt,null,e)):ht(pt,null,e)}function Kt(e){return e==null||typeof e=="boolean"?ht(pt):ce(e)?ht(et,null,e.slice()):Cr(e)?wo(e):ht($i,null,String(e))}function wo(e){return e.el===null&&e.patchFlag!==-1||e.memo?e:Ro(e)}function sl(e,t){let o=0;const{shapeFlag:r}=e;if(t==null)t=null;else if(ce(t))o=16;else if(typeof t=="object")if(r&65){const n=t.default;n&&(n._c&&(n._d=!1),sl(e,n()),n._c&&(n._d=!0));return}else{o=32;const n=t._;!n&&!sd(t)?t._ctx=Ye:n===3&&Ye&&(Ye.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else me(t)?(t={default:t,_ctx:Ye},o=32):(t=String(t),r&64?(o=16,t=[xa(t)]):o=8);e.children=t,e.shapeFlag|=o}function Sd(...e){const t={};for(let o=0;ott||Ye;let ci,Ca;{const e=vi(),t=(o,r)=>{let n;return(n=e[o])||(n=e[o]=[]),n.push(r),i=>{n.length>1?n.forEach(a=>a(i)):n[0](i)}};ci=t("__VUE_INSTANCE_SETTERS__",o=>tt=o),Ca=t("__VUE_SSR_SETTERS__",o=>dn=o)}const wn=e=>{const t=tt;return ci(e),e.scope.on(),()=>{e.scope.off(),ci(t)}},jl=()=>{tt&&tt.scope.off(),ci(null)};function wd(e){return e.vnode.shapeFlag&4}let dn=!1;function Qh(e,t=!1,o=!1){t&&Ca(t);const{props:r,children:n}=e.vnode,i=wd(e);Rh(e,r,i,t),_h(e,n,o);const a=i?eg(e,t):void 0;return t&&Ca(!1),a}function eg(e,t){const o=e.type;e.accessCache=Object.create(null),e.proxy=new Proxy(e.ctx,xh);const{setup:r}=o;if(r){_o();const n=e.setupContext=r.length>1?og(e):null,i=wn(e),a=yn(r,e,0,[e.props,n]),l=lc(a);if(Eo(),i(),(l||e.sp)&&!br(e)&&Gc(e),l){if(a.then(jl,jl),t)return a.then(s=>{Nl(e,s)}).catch(s=>{yi(s,e,0)});e.asyncDep=a}else Nl(e,a)}else Pd(e)}function Nl(e,t,o){me(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:_e(t)&&(e.setupState=_c(t)),Pd(e)}function Pd(e,t,o){const r=e.type;e.render||(e.render=r.render||Jt);{const n=wn(e);_o();try{Ch(e)}finally{Eo(),n()}}}const tg={get(e,t){return dt(e,"get",""),e[t]}};function og(e){const t=o=>{e.exposed=o||{}};return{attrs:new Proxy(e.attrs,tg),slots:e.slots,emit:e.emit,expose:t}}function Ri(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(_c(da(e.exposed)),{get(t,o){if(o in t)return t[o];if(o in Xr)return Xr[o](e)},has(t,o){return o in t||o in Xr}})):e.proxy}function rg(e,t=!0){return me(e)?e.displayName||e.name:e.name||t&&e.__name}function ng(e){return me(e)&&"__vccOpts"in e}const Y=(e,t)=>th(e,t,dn);function y(e,t,o){const r=arguments.length;return r===2?_e(t)&&!ce(t)?Cr(t)?ht(e,null,[t]):ht(e,t):ht(e,null,t):(r>3?o=Array.prototype.slice.call(arguments,2):r===3&&Cr(o)&&(o=[o]),ht(e,t,o))}const ig="3.5.13";/** * @vue/runtime-dom v3.5.13 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/let ya;const Vl=typeof window<"u"&&window.trustedTypes;if(Vl)try{ya=Vl.createPolicy("vue",{createHTML:e=>e})}catch{}const Td=ya?e=>ya.createHTML(e):e=>e,ag="http://www.w3.org/2000/svg",lg="http://www.w3.org/1998/Math/MathML",ao=typeof document<"u"?document:null,ql=ao&&ao.createElement("template"),sg={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,r)=>{const n=t==="svg"?ao.createElementNS(ag,e):t==="mathml"?ao.createElementNS(lg,e):o?ao.createElement(e,{is:o}):ao.createElement(e);return e==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:e=>ao.createTextNode(e),createComment:e=>ao.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ao.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,r,n,i){const a=o?o.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),o),!(n===i||!(n=n.nextSibling)););else{ql.innerHTML=Td(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=ql.content;if(r==="svg"||r==="mathml"){const s=l.firstChild;for(;s.firstChild;)l.appendChild(s.firstChild);l.removeChild(s)}t.insertBefore(l,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}},vo="transition",Or="animation",yr=Symbol("_vtc"),$d={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Rd=Xe({},Nc,$d),cg=e=>(e.displayName="Transition",e.props=Rd,e),un=cg((e,{slots:t})=>y(uh,Fd(e),t)),Oo=(e,t=[])=>{ce(e)?e.forEach(o=>o(...t)):e&&e(...t)},Ul=e=>e?ce(e)?e.some(t=>t.length>1):e.length>1:!1;function Fd(e){const t={};for(const _ in e)_ in $d||(t[_]=e[_]);if(e.css===!1)return t;const{name:o="v",type:r,duration:n,enterFromClass:i=`${o}-enter-from`,enterActiveClass:a=`${o}-enter-active`,enterToClass:l=`${o}-enter-to`,appearFromClass:s=i,appearActiveClass:c=a,appearToClass:d=l,leaveFromClass:u=`${o}-leave-from`,leaveActiveClass:p=`${o}-leave-active`,leaveToClass:m=`${o}-leave-to`}=e,f=dg(n),g=f&&f[0],S=f&&f[1],{onBeforeEnter:v,onEnter:$,onEnterCancelled:T,onLeave:w,onLeaveCancelled:z,onBeforeAppear:B=v,onAppear:x=$,onAppearCancelled:F=T}=t,R=(_,J,G,le)=>{_._enterCancelled=le,Co(_,J?d:l),Co(_,J?c:a),G&&G()},O=(_,J)=>{_._isLeaving=!1,Co(_,u),Co(_,m),Co(_,p),J&&J()},j=_=>(J,G)=>{const le=_?x:$,te=()=>R(J,_,G);Oo(le,[J,te]),Gl(()=>{Co(J,_?s:i),Ut(J,_?d:l),Ul(le)||Kl(J,r,g,te)})};return Xe(t,{onBeforeEnter(_){Oo(v,[_]),Ut(_,i),Ut(_,a)},onBeforeAppear(_){Oo(B,[_]),Ut(_,s),Ut(_,c)},onEnter:j(!1),onAppear:j(!0),onLeave(_,J){_._isLeaving=!0;const G=()=>O(_,J);Ut(_,u),_._enterCancelled?(Ut(_,p),Sa()):(Sa(),Ut(_,p)),Gl(()=>{_._isLeaving&&(Co(_,u),Ut(_,m),Ul(w)||Kl(_,r,S,G))}),Oo(w,[_,G])},onEnterCancelled(_){R(_,!1,void 0,!0),Oo(T,[_])},onAppearCancelled(_){R(_,!0,void 0,!0),Oo(F,[_])},onLeaveCancelled(_){O(_),Oo(z,[_])}})}function dg(e){if(e==null)return null;if(ze(e))return[Xi(e.enter),Xi(e.leave)];{const t=Xi(e);return[t,t]}}function Xi(e){return xp(e)}function Ut(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[yr]||(e[yr]=new Set)).add(t)}function Co(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const o=e[yr];o&&(o.delete(t),o.size||(e[yr]=void 0))}function Gl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ug=0;function Kl(e,t,o,r){const n=e._endId=++ug,i=()=>{n===e._endId&&r()};if(o!=null)return setTimeout(i,o);const{type:a,timeout:l,propCount:s}=_d(e,t);if(!a)return r();const c=a+"end";let d=0;const u=()=>{e.removeEventListener(c,p),i()},p=m=>{m.target===e&&++d>=s&&u()};setTimeout(()=>{d(o[f]||"").split(", "),n=r(`${vo}Delay`),i=r(`${vo}Duration`),a=Yl(n,i),l=r(`${Or}Delay`),s=r(`${Or}Duration`),c=Yl(l,s);let d=null,u=0,p=0;t===vo?a>0&&(d=vo,u=a,p=i.length):t===Or?c>0&&(d=Or,u=c,p=s.length):(u=Math.max(a,c),d=u>0?a>c?vo:Or:null,p=d?d===vo?i.length:s.length:0);const m=d===vo&&/\b(transform|all)(,|$)/.test(r(`${vo}Property`).toString());return{type:d,timeout:u,propCount:p,hasTransform:m}}function Yl(e,t){for(;e.lengthXl(o)+Xl(e[r])))}function Xl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Sa(){return document.body.offsetHeight}function fg(e,t,o){const r=e[yr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}const di=Symbol("_vod"),Ed=Symbol("_vsh"),Z2={beforeMount(e,{value:t},{transition:o}){e[di]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):Lr(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:r}){!t!=!o&&(r?t?(r.beforeEnter(e),Lr(e,!0),r.enter(e)):r.leave(e,()=>{Lr(e,!1)}):Lr(e,t))},beforeUnmount(e,{value:t}){Lr(e,t)}};function Lr(e,t){e.style.display=t?e[di]:"none",e[Ed]=!t}const pg=Symbol(""),hg=/(^|;)\s*display\s*:/;function gg(e,t,o){const r=e.style,n=We(o);let i=!1;if(o&&!n){if(t)if(We(t))for(const a of t.split(";")){const l=a.slice(0,a.indexOf(":")).trim();o[l]==null&&Zn(r,l,"")}else for(const a in t)o[a]==null&&Zn(r,a,"");for(const a in o)a==="display"&&(i=!0),Zn(r,a,o[a])}else if(n){if(t!==o){const a=r[pg];a&&(o+=";"+a),r.cssText=o,i=hg.test(o)}}else t&&e.removeAttribute("style");di in e&&(e[di]=i?r.display:"",e[Ed]&&(r.display="none"))}const Jl=/\s*!important$/;function Zn(e,t,o){if(ce(o))o.forEach(r=>Zn(e,t,r));else if(o==null&&(o=""),t.startsWith("--"))e.setProperty(t,o);else{const r=mg(e,t);Jl.test(o)?e.setProperty(Eo(r),o.replace(Jl,""),"important"):e[r]=o}}const Zl=["Webkit","Moz","ms"],Ji={};function mg(e,t){const o=Ji[t];if(o)return o;let r=It(t);if(r!=="filter"&&r in e)return Ji[t]=r;r=bi(r);for(let n=0;nZi||(Cg.then(()=>Zi=0),Zi=Date.now());function Sg(e,t){const o=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=o.attached)return;Lt(wg(r,o.value),t,5,[r])};return o.value=e,o.attached=yg(),o}function wg(e,t){if(ce(t)){const o=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{o.call(e),e._stopped=!0},t.map(r=>n=>!n._stopped&&r&&r(n))}else return t}const ns=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pg=(e,t,o,r,n,i)=>{const a=n==="svg";t==="class"?fg(e,r,a):t==="style"?gg(e,o,r):gi(t)?Na(t)||vg(e,t,o,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tg(e,t,r,a))?(ts(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&es(e,t,r,a,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!We(r))?ts(e,It(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),es(e,t,r,a))};function Tg(e,t,o,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ns(t)&&me(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const n=e.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return ns(t)&&We(o)?!1:t in e}const zd=new WeakMap,Md=new WeakMap,ui=Symbol("_moveCb"),is=Symbol("_enterCb"),$g=e=>(delete e.props.mode,e),Rg=$g({name:"TransitionGroup",props:Xe({},Rd,{tag:String,moveClass:String}),setup(e,{slots:t}){const o=Sn(),r=jc();let n,i;return Jc(()=>{if(!n.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!Mg(n[0].el,o.vnode.el,a))return;n.forEach(_g),n.forEach(Eg);const l=n.filter(zg);Sa(),l.forEach(s=>{const c=s.el,d=c.style;Ut(c,a),d.transform=d.webkitTransform=d.transitionDuration="";const u=c[ui]=p=>{p&&p.target!==c||(!p||/transform$/.test(p.propertyName))&&(c.removeEventListener("transitionend",u),c[ui]=null,Co(c,a))};c.addEventListener("transitionend",u)})}),()=>{const a=we(e),l=Fd(a);let s=a.tag||et;if(n=[],i)for(let c=0;c{l.split(/\s+/).forEach(s=>s&&r.classList.remove(s))}),o.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(r);const{hasTransform:a}=_d(r);return i.removeChild(r),a}const Fo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ce(t)?o=>Kn(t,o):t};function Ig(e){e.target.composing=!0}function as(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Mt=Symbol("_assign"),ls={created(e,{modifiers:{lazy:t,trim:o,number:r}},n){e[Mt]=Fo(n);const i=r||n.props&&n.props.type==="number";uo(e,t?"change":"input",a=>{if(a.target.composing)return;let l=e.value;o&&(l=l.trim()),i&&(l=oi(l)),e[Mt](l)}),o&&uo(e,"change",()=>{e.value=e.value.trim()}),t||(uo(e,"compositionstart",Ig),uo(e,"compositionend",as),uo(e,"change",as))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:o,modifiers:{lazy:r,trim:n,number:i}},a){if(e[Mt]=Fo(a),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?oi(e.value):e.value,s=t??"";l!==s&&(document.activeElement===e&&e.type!=="range"&&(r&&t===o||n&&e.value.trim()===s)||(e.value=s))}},Ag={deep:!0,created(e,t,o){e[Mt]=Fo(o),uo(e,"change",()=>{const r=e._modelValue,n=Sr(e),i=e.checked,a=e[Mt];if(ce(r)){const l=Ka(r,n),s=l!==-1;if(i&&!s)a(r.concat(n));else if(!i&&s){const c=[...r];c.splice(l,1),a(c)}}else if(Rr(r)){const l=new Set(r);i?l.add(n):l.delete(n),a(l)}else a(Id(e,i))})},mounted:ss,beforeUpdate(e,t,o){e[Mt]=Fo(o),ss(e,t,o)}};function ss(e,{value:t,oldValue:o},r){e._modelValue=t;let n;if(ce(t))n=Ka(t,r.props.value)>-1;else if(Rr(t))n=t.has(r.props.value);else{if(t===o)return;n=er(t,Id(e,!0))}e.checked!==n&&(e.checked=n)}const Hg={created(e,{value:t},o){e.checked=er(t,o.props.value),e[Mt]=Fo(o),uo(e,"change",()=>{e[Mt](Sr(e))})},beforeUpdate(e,{value:t,oldValue:o},r){e[Mt]=Fo(r),t!==o&&(e.checked=er(t,r.props.value))}},kg={deep:!0,created(e,{value:t,modifiers:{number:o}},r){const n=Rr(t);uo(e,"change",()=>{const i=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>o?oi(Sr(a)):Sr(a));e[Mt](e.multiple?n?new Set(i):i:i[0]),e._assigning=!0,nn(()=>{e._assigning=!1})}),e[Mt]=Fo(r)},mounted(e,{value:t}){cs(e,t)},beforeUpdate(e,t,o){e[Mt]=Fo(o)},updated(e,{value:t}){e._assigning||cs(e,t)}};function cs(e,t){const o=e.multiple,r=ce(t);if(!(o&&!r&&!Rr(t))){for(let n=0,i=e.options.length;nString(c)===String(l)):a.selected=Ka(t,l)>-1}else a.selected=t.has(l);else if(er(Sr(a),t)){e.selectedIndex!==n&&(e.selectedIndex=n);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Sr(e){return"_value"in e?e._value:e.value}function Id(e,t){const o=t?"_trueValue":"_falseValue";return o in e?e[o]:t}const Q2={created(e,t,o){Bn(e,t,o,null,"created")},mounted(e,t,o){Bn(e,t,o,null,"mounted")},beforeUpdate(e,t,o,r){Bn(e,t,o,r,"beforeUpdate")},updated(e,t,o,r){Bn(e,t,o,r,"updated")}};function Dg(e,t){switch(e){case"SELECT":return kg;case"TEXTAREA":return ls;default:switch(t){case"checkbox":return Ag;case"radio":return Hg;default:return ls}}}function Bn(e,t,o,r,n){const a=Dg(e.tagName,o.props&&o.props.type)[n];a&&a(e,t,o,r)}const Bg=["ctrl","shift","alt","meta"],Og={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Bg.some(o=>e[`${o}Key`]&&!t.includes(o))},eP=(e,t)=>{const o=e._withMods||(e._withMods={}),r=t.join(".");return o[r]||(o[r]=(n,...i)=>{for(let a=0;a{const o=e._withKeys||(e._withKeys={}),r=t.join(".");return o[r]||(o[r]=n=>{if(!("key"in n))return;const i=Eo(n.key);if(t.some(a=>a===i||Lg[a]===i))return e(n)})},Wg=Xe({patchProp:Pg},sg);let ds;function jg(){return ds||(ds=Ih(Wg))}const oP=(...e)=>{const t=jg().createApp(...e),{mount:o}=t;return t.mount=r=>{const n=Vg(r);if(!n)return;const i=t._component;!me(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const a=o(n,!1,Ng(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t};function Ng(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vg(e){return We(e)?document.querySelector(e):e}const qg={common:{appName:"AT Term",cancel:"Cancel",confirm:"Confirm",copy:"Copy",create:"Create",created:"created",delete:"Delete",english:"English",language:"Language",loading:"Loading...",no:"no",optional:"optional",revoke:"Revoke",save:"Save",send:"send",simplifiedChinese:"Simplified Chinese",system:"System",unknown:"unknown",version:"Version",versionLabel:"version {version}",yes:"yes"},auth:{alreadyHaveAccount:"Already have an account?",createAccount:"Create account",email:"Email",emailPlaceholder:"you@example.com",setup:{title:"First-run setup",hint:"No admin yet. Create the first admin account — use the email you set in ATTERM_BOOTSTRAP_ADMIN_EMAIL.",emailPlaceholder:"your ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"Confirm password",createAdmin:"Create admin",passwordMismatch:"The two passwords do not match.",notAdmin:"Account created, but it is not an admin — make sure the email matches ATTERM_BOOTSTRAP_ADMIN_EMAIL.",failed:"Setup failed. Please try again."},errors:{emailTaken:"An account with that email already exists.",invalidCredentials:"Invalid email or password.",invalidEmail:"Please enter a valid email.",invalidRequest:"Please check your input.",inviteInvalid:"Invite code is invalid or already used.",passwordWeak:"Password must be at least 12 characters.",rateLimited:"Too many attempts. Please wait a few minutes.",rateLimitedShort:"Too many attempts. Please wait.",signInFailed:"Sign-in failed. Please try again.",signUpFailed:"Sign-up failed. Check your invite code and try again."},haveInviteCode:"Have an invite code?",inviteCode:"Invite code",password:"Password",signIn:"Sign in",signUp:"Sign up",signUpHere:"Sign up here"},setup:{allowInsecure:"Allow insecure HTTP/WS (non-loopback)",connect:"Connect",connectToRelay:"Connect to relay",disconnect:"Disconnect",errors:{cannotReachRelay:"Cannot reach relay: {message}",invalidRelayUrl:"invalid or malformed relay URL",originRejected:"Relay rejected the origin. Make sure the relay was started with ATTERM_ORIGINS containing capacitor://localhost.",relayHttp:"Relay returned HTTP {status}.",relayHttpCheckUrl:"Relay returned HTTP {status}. Check the URL and try again.",relayUrlMustBeHttp:"relay URL must start with http:// or https://",relayUrlNoPath:"relay URL must not contain a path, query, or fragment",relayUrlRequired:"relay URL is required",tokenInvalid:"API token is invalid. Generate a new one from Settings -> API Tokens on the relay web UI.",tokenInvalidSettings:"API token is invalid. Generate a new one from the relay web UI under Settings -> API Tokens.",tokenRequired:"API token is required",useInsecureForHttp:'enable "Allow insecure HTTP/WS" to use http:// with a non-loopback host'},reasonTokenInvalid:"Your API token is no longer valid. Please paste a fresh token to sign in again.",title:"Set up relay",relayUrl:"Relay URL",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"Saved."},main:{activeSessions:"active sessions",back:"back",backToSessions:"Back to sessions",empty:"No live sessions. Start one from the desktop app or",errors:{loadSessions:"Failed to load sessions."},install:{dismiss:"Dismiss install hint",text:"on iPhone, open this site with HTTPS, then tap Share -> Add to Home Screen.",title:"install AT Term"},reconnect:"Reconnect",refresh:"refresh",sessionCount:"{count} sessions",sessionCountOne:"{count} session",title:"Remote sessions",unknownCommand:"(unknown)",unknownHost:"unknown host",unlock:{action:"Sign in again",text:"This browser is signed in, but the in-memory encryption key is locked. Sign in again to decrypt session names, commands, and paths.",title:"Unlock encrypted session details"},viewOnlyNotice:"This session is view-only from this device. You can inspect output, but input is disabled.",taskTypes:{ai:"AI",test:"Test",build:"Build",deploy:"Deploy"}},terminal:{cannotReachRelay:"Cannot reach relay.",connecting:"Connecting...",disconnected:"Disconnected",ended:"session ended (exit {code})",loadingHistory:"loading history... {percent}%",paste:"Paste",pickImage:"pick image",pickFile:"pick file",remoteControl:"remote has taken control",statuses:{attached:"attached",connecting:"connecting",ended:"ended",lost:"lost",reconnecting:"reconnecting"},shortcuts:"terminal shortcuts",takeControl:"Take control",tapToChangeConfig:"Tap to change configuration.",templatePreviewTitle:"Send preview",templatePreviewSend:"Send"},sessions:{attach:"Attach",created:"Created",host:"Host"},admin:{actions:"Actions",config:{effective:"effective: {value}",effectiveDisabled:"effective: disabled",hint:'0 means "use the built-in default"; negative disables the limit entirely. Changes apply immediately and persist to the admin config file.',loadFailed:"Failed to load config.",maxConnections:"Max WS connections (per IP+token)",rateLimit:"Rate limit (requests/min per IP+token)",saveFailed:"Save failed.",runtimeLimits:"Runtime limits",debug:"Verbose logging",debugHint:"Logs relay frames. Applies immediately, no restart.",debugPayload:"Log payload bytes",debugPayloadWarn:"Logs terminal input/output — sensitive. Use only while debugging.",allowedOrigins:"Allowed Origins",allowedOriginsHint:'One per line. Mobile Capacitor clients need "capacitor://localhost". Empty = allow any origin (dev only).',allowedOriginsPlaceholder:`https://relay.example.com -capacitor://localhost`},configTab:"Config",feishuTab:"Feishu",trafficTab:"Traffic",traffic:{viewDetail:"Detail",viewGroup:"Grouped",viewSummary:"Summary",colUser:"User",colCategory:"Category",colFrameType:"Frame type",colDirection:"Direction",colBytes:"Bytes",colFrames:"Frames",dirIn:"In",dirOut:"Out",empty:"No traffic recorded for this range.",loadFailed:"Failed to load traffic stats."},feishuConfig:{title:"Feishu integration",description:"Enable the Feishu bot bridge for this relay. The encrypt key protects Feishu app credentials stored on the server.",enabled:"Enable Feishu",encryptKey:"Encrypt key",generate:"Generate",keyGenerated:"Key generated — save to apply.",keyEmptyPlaceholder:"Paste or generate a 32-byte base64 key",keyKeepPlaceholder:"Key set (…{last4}). Leave blank to keep it.",keyCopyOnce:"Copy this key somewhere safe — it is shown only once and never again.",forceRotate:"Replace the existing key (existing Feishu bindings will stop working)",baseUrl:"Base URL",statusRunning:"Running",statusStopped:"Stopped",rotateConflict:'That changes the existing key. Enable "replace" to rotate it (existing bindings will break).',loadFailed:"Failed to load Feishu config.",saveFailed:"Save failed."},created:"Created",disabled:"disabled {when}",email:"Email",errors:{actionFailed:"Action failed.",cannotDemoteSelf:"You can't demote yourself.",lastAdmin:"Can't demote the last admin - promote another user first."},id:"ID",invitationsTab:{consumed:"Consumed",count:"Count",createFailed:"Create failed: {code}",copyNow:"Copy this invitation now{note} - it will not be shown again.",empty:"No invitations yet.",expires:"Expires",loadFailed:"Failed to load invitations.",note:"Note",prefix:"Prefix",unused:"unused"},loadUsersFailed:"Failed to load users.",promote:"Promote",promoteConfirm:"Promote this user to admin?",resetPassword:"Reset password",resetPasswordConfirm:"Reset password? A new temporary password is shown once.",secretCopyOnce:"{label} - copy it now, only shown once.",status:"Status",temporaryPasswordFor:"Temporary password for {email}",title:"Admin",userStatus:{active:"active",admin:"admin"},users:"Users",invitations:"Invitations",demote:"Demote",demoteConfirm:"Demote this admin?",disable:"Disable",disableConfirm:"Disable this user? They are signed out and cannot log in."},test:{interpolation:"{count} sessions"},connHealth:{pillLabelConnecting:"connecting…",pillLabelReconnecting:"reconnecting…",pillLabelOff:"off",drawerTitle:"Connection health",drawerRttNow:"RTT (now)",drawerRttP50P95:"p50 / p95 (5 min)",drawerBytesIn:"↓ in",drawerBytesOut:"↑ out",drawerState:"State",drawerReconnectsLastHour:"Reconnects (1 h)",drawerReconnectsTime:"time",drawerReconnectsReason:"reason",drawerReconnectsDowntime:"downtime",drawerSeqGaps:"Seq gaps observed:"}},Ug={common:{appName:"AT Term",cancel:"取消",confirm:"确认",copy:"复制",create:"创建",created:"创建于",delete:"删除",english:"英语",language:"语言",loading:"正在加载...",no:"否",optional:"可选",revoke:"撤销",save:"保存",send:"发送",simplifiedChinese:"简体中文",system:"跟随系统",unknown:"未知",version:"版本",versionLabel:"版本 {version}",yes:"是"},auth:{alreadyHaveAccount:"已有账号?",createAccount:"创建账号",email:"邮箱",emailPlaceholder:"you@example.com",setup:{title:"首次安装",hint:"还没有管理员。创建第一个管理员账号——请填写你在 ATTERM_BOOTSTRAP_ADMIN_EMAIL 配置的邮箱。",emailPlaceholder:"你配置的 ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"确认密码",createAdmin:"创建管理员",passwordMismatch:"两次输入的密码不一致。",notAdmin:"账号已创建,但不是管理员——请确认邮箱与 ATTERM_BOOTSTRAP_ADMIN_EMAIL 一致。",failed:"初始化失败,请重试。"},errors:{emailTaken:"该邮箱已注册。",invalidCredentials:"邮箱或密码不正确。",invalidEmail:"请输入有效邮箱。",invalidRequest:"请检查输入。",inviteInvalid:"邀请码无效或已被使用。",passwordWeak:"密码至少需要 12 个字符。",rateLimited:"尝试次数过多,请等待几分钟。",rateLimitedShort:"尝试次数过多,请稍后再试。",signInFailed:"登录失败,请重试。",signUpFailed:"注册失败,请检查邀请码后重试。"},haveInviteCode:"有邀请码?",inviteCode:"邀请码",password:"密码",signIn:"登录",signUp:"注册",signUpHere:"在这里注册"},setup:{allowInsecure:"允许不安全的 HTTP/WS(非 loopback)",connect:"连接",connectToRelay:"连接到 relay",disconnect:"断开连接",errors:{cannotReachRelay:"无法连接 relay:{message}",invalidRelayUrl:"relay 地址无效或格式错误",originRejected:"relay 拒绝了该 Origin。请确认启动 relay 时 ATTERM_ORIGINS 包含 capacitor://localhost。",relayHttp:"relay 返回 HTTP {status}。",relayHttpCheckUrl:"relay 返回 HTTP {status}。请检查地址后重试。",relayUrlMustBeHttp:"relay 地址必须以 http:// 或 https:// 开头",relayUrlNoPath:"relay 地址不能包含 path、query 或 fragment",relayUrlRequired:"relay 地址必填",tokenInvalid:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenInvalidSettings:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenRequired:"API token 必填",useInsecureForHttp:"如需对非 loopback 主机使用 http://,请启用“允许不安全的 HTTP/WS”"},reasonTokenInvalid:"你的 API token 已失效。请粘贴新的 token 重新登录。",title:"设置 relay",relayUrl:"Relay 地址",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"已保存。"},main:{activeSessions:"活动会话",back:"返回",backToSessions:"返回会话列表",empty:"没有在线会话。请从桌面 app 或",errors:{loadSessions:"加载会话失败。"},install:{dismiss:"关闭安装提示",text:"在 iPhone 上,用 HTTPS 打开本站,然后点分享 -> 添加到主屏幕。",title:"安装 AT Term"},reconnect:"重新连接",refresh:"刷新",sessionCount:"{count} 个会话",sessionCountOne:"{count} 个会话",title:"远程会话",unknownCommand:"(未知)",unknownHost:"未知主机",unlock:{action:"重新登录",text:"此浏览器仍处于登录状态,但内存中的加密密钥已锁定。重新登录后才能解密会话名称、命令和路径。",title:"解锁加密会话信息"},viewOnlyNotice:"此设备只能查看该会话。你可以查看输出,但不能输入。",taskTypes:{ai:"AI",test:"测试",build:"构建",deploy:"部署"}},terminal:{cannotReachRelay:"无法连接 relay。",connecting:"正在连接...",disconnected:"连接已断开",ended:"会话已结束(退出码 {code})",loadingHistory:"正在加载历史... {percent}%",paste:"粘贴",pickImage:"选择图片",pickFile:"选择文件",remoteControl:"远端已接管控制",statuses:{attached:"已连接",connecting:"正在连接",ended:"已结束",lost:"连接丢失",reconnecting:"正在重连"},shortcuts:"终端快捷键",takeControl:"接管控制",tapToChangeConfig:"点击修改配置。",templatePreviewTitle:"发送预览",templatePreviewSend:"发送"},sessions:{attach:"接管",created:"创建时间",host:"主机"},admin:{actions:"操作",config:{effective:"实际:{value}",effectiveDisabled:"实际:已禁用",hint:"0 表示使用内建默认值;负数表示完全禁用限制。修改会立即生效,并持久化到管理配置文件。",loadFailed:"加载配置失败。",maxConnections:"最大 WS 连接数(每 IP+token)",rateLimit:"速率限制(每 IP+token 每分钟请求数)",saveFailed:"保存失败。",runtimeLimits:"运行时限制",debug:"详细日志",debugHint:"记录 relay 帧。立即生效,无需重启。",debugPayload:"记录 payload 字节",debugPayloadWarn:"会记录终端输入/输出,属敏感信息,仅排查问题时临时开启。",allowedOrigins:"允许的 Origin",allowedOriginsHint:'一行一个。手机 Capacitor 客户端必须包含 "capacitor://localhost"。留空 = 允许任意 origin(仅供开发)。',allowedOriginsPlaceholder:`https://relay.example.com -capacitor://localhost`},configTab:"配置",feishuTab:"飞书",trafficTab:"流量",traffic:{viewDetail:"明细",viewGroup:"分组",viewSummary:"汇总",colUser:"用户",colCategory:"类别",colFrameType:"帧类型",colDirection:"方向",colBytes:"字节",colFrames:"帧数",dirIn:"接收",dirOut:"发送",empty:"该时间范围内暂无流量记录。",loadFailed:"加载流量统计失败。"},feishuConfig:{title:"飞书集成",description:"为本 relay 启用飞书机器人桥接。加密密钥用于保护服务器上保存的飞书应用凭据。",enabled:"启用飞书",encryptKey:"加密密钥",generate:"生成",keyGenerated:"已生成密钥,保存后生效。",keyEmptyPlaceholder:"粘贴或生成一个 32 字节 base64 密钥",keyKeepPlaceholder:"已设置密钥(…{last4})。留空则保持不变。",keyCopyOnce:"请妥善复制保存此密钥——它只显示这一次,之后不再展示。",forceRotate:"替换现有密钥(现有飞书绑定将失效)",baseUrl:"Base URL",statusRunning:"运行中",statusStopped:"已停止",rotateConflict:"这会更改现有密钥。需勾选「替换」才能轮换(现有绑定会失效)。",loadFailed:"加载飞书配置失败。",saveFailed:"保存失败。"},created:"创建时间",disabled:"已禁用 {when}",email:"邮箱",errors:{actionFailed:"操作失败。",cannotDemoteSelf:"不能降级你自己。",lastAdmin:"不能降级最后一个管理员,请先提升其他用户。"},id:"ID",invitationsTab:{consumed:"已使用",count:"数量",createFailed:"创建失败:{code}",copyNow:"请立即复制此邀请{note},此后不会再次显示。",empty:"还没有邀请。",expires:"过期时间",loadFailed:"加载邀请失败。",note:"备注",prefix:"前缀",unused:"未使用"},loadUsersFailed:"加载用户失败。",promote:"提升",promoteConfirm:"将此用户提升为管理员?",resetPassword:"重置密码",resetPasswordConfirm:"重置密码?新的临时密码只会显示一次。",secretCopyOnce:"{label} - 请立即复制,仅显示一次。",status:"状态",temporaryPasswordFor:"{email} 的临时密码",title:"管理",userStatus:{active:"活跃",admin:"管理员"},users:"用户",invitations:"邀请",demote:"降级",demoteConfirm:"降级此管理员?",disable:"禁用",disableConfirm:"禁用此用户?该用户将被登出且无法登录。"},test:{interpolation:"{count} 个会话"},connHealth:{pillLabelConnecting:"连接中…",pillLabelReconnecting:"重连中…",pillLabelOff:"已关闭",drawerTitle:"连接质量",drawerRttNow:"RTT(当前)",drawerRttP50P95:"p50 / p95(最近 5 分钟)",drawerBytesIn:"↓ 接收",drawerBytesOut:"↑ 发送",drawerState:"状态",drawerReconnectsLastHour:"最近 1 小时重连",drawerReconnectsTime:"时间",drawerReconnectsReason:"原因",drawerReconnectsDowntime:"断开时长",drawerSeqGaps:"观察到的序号跳跃:"}},Ad="atterm.locale",us={en:qg,"zh-CN":Ug},Fi=fe("system"),Pn=fe("en"),Gg=Y(()=>[{label:fo("common.system"),value:"system"},{label:fo("common.english"),value:"en"},{label:fo("common.simplifiedChinese"),value:"zh-CN"}]);let Hd=cl,Wr;function rP(e={}){Wr==null||Wr(),Wr=void 0,Hd=e.getLanguages??cl;const t=Xg();Fi.value=t,wa(),Wr=(e.listenLanguageChange??rm)(()=>{wa()})}function Kg(e){Fi.value=e,wa();try{window.localStorage.setItem(Ad,e)}catch{}try{window.localStorage.setItem("atterm.locale_preference.value",JSON.stringify(e))}catch{}pp(async()=>{const{notifyLocalChange:t}=await import("./prefsSync-D8z1rJ8H.js");return{notifyLocalChange:t}},__vite__mapDeps([0,1])).then(({notifyLocalChange:t})=>{t("locale_preference")}).catch(()=>{})}function Yg(e,t=cl()){if(e==="en"||e==="zh-CN")return e;for(const o of t){const r=o.trim().toLowerCase();if(r!==""){if(r==="zh"||r.startsWith("zh-"))return"zh-CN";if(r==="en"||r.startsWith("en-"))return"en"}}return"en"}function fo(e,t={}){const o=fs(us[Pn.value],e)??fs(us.en,e)??e;return em(o,t)}function nP(e){return tm(e,{dateStyle:"medium",timeStyle:"short"})}function Xg(){try{const e=window.localStorage.getItem(Ad);return Jg(e)?e:"system"}catch{return"system"}}function Jg(e){return e==="system"||e==="en"||e==="zh-CN"}function wa(){Zg(Yg(Fi.value,Hd()))}function Zg(e){Pn.value=e,Qg(e)}function Qg(e){typeof document>"u"||(document.documentElement.lang=e)}function fs(e,t){let o=e;for(const r of t.split(".")){if(!om(o))return;o=o[r]}return typeof o=="string"?o:void 0}function em(e,t){return e.replace(/\{([^{}]+)\}/g,(o,r)=>{const n=t[r];return n===void 0?o:String(n)})}function tm(e,t){if(e===void 0||e==="")return"";try{return new Intl.DateTimeFormat(Pn.value,t).format(new Date(e))}catch{return typeof e=="string"?e:""}}function om(e){return typeof e=="object"&&e!==null}function cl(){return typeof navigator>"u"?[]:navigator.languages.length>0?navigator.languages:navigator.language?[navigator.language]:[]}function rm(e){return typeof window>"u"?()=>{}:(window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e))}const dl="atterm.relay";let On=null;function iP(){if(On!==null)return On;const e=globalThis.Capacitor;return On=!!(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform()),On}function aP(){if(typeof localStorage>"u")return null;const e=localStorage.getItem(dl);if(!e)return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null?null:{baseURL:t.baseURL??t.base??"",sessionToken:t.sessionToken??t.token??null,expiresAt:t.expiresAt??null,allowInsecure:t.allowInsecure??t.allow_insecure??!1,...t.realmId!==void 0?{realmId:t.realmId}:{},...t.homeInstanceURL!==void 0?{homeInstanceURL:t.homeInstanceURL}:{}}}catch{return null}}function lP(e){typeof localStorage>"u"||localStorage.setItem(dl,JSON.stringify(e))}function sP(){typeof localStorage>"u"||localStorage.removeItem(dl)}function cP(e,t){const o=e.trim();if(!o)return fo("setup.errors.relayUrlRequired");let r;try{r=new URL(o)}catch{return fo("setup.errors.invalidRelayUrl")}return r.protocol!=="http:"&&r.protocol!=="https:"?fo("setup.errors.relayUrlMustBeHttp"):r.pathname!=="/"||r.search!==""||r.hash!==""?fo("setup.errors.relayUrlNoPath"):r.protocol==="http:"&&!nm(r.hostname)&&!t?fo("setup.errors.useInsecureForHttp"):null}function nm(e){const t=e.toLowerCase();return!!(t==="localhost"||t==="127.0.0.1"||t==="::1"||t.startsWith("127.")||t.startsWith("[")&&t.endsWith("]")&&t.slice(1,-1)==="::1")}const dP=(e,t)=>{const o=e.__vccOpts||e;for(const[r,n]of t)o[r]=n;return o};function im(e){let t=".",o="__",r="--",n;if(e){let f=e.blockPrefix;f&&(t=f),f=e.elementPrefix,f&&(o=f),f=e.modifierPrefix,f&&(r=f)}const i={install(f){n=f.c;const g=f.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(f){let g,S;return{before(v){g=v.bem.b,S=v.bem.els,v.bem.els=null},after(v){v.bem.b=g,v.bem.els=S},$({context:v,props:$}){return f=typeof f=="string"?f:f({context:v,props:$}),v.bem.b=f,`${($==null?void 0:$.bPrefix)||t}${v.bem.b}`}}}function l(f){let g;return{before(S){g=S.bem.els},after(S){S.bem.els=g},$({context:S,props:v}){return f=typeof f=="string"?f:f({context:S,props:v}),S.bem.els=f.split(",").map($=>$.trim()),S.bem.els.map($=>`${(v==null?void 0:v.bPrefix)||t}${S.bem.b}${o}${$}`).join(", ")}}}function s(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=f.split(",").map(w=>w.trim());function $(w){return v.map(z=>`&${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${w!==void 0?`${o}${w}`:""}${r}${z}`).join(", ")}const T=g.bem.els;return T!==null?$(T[0]):$()}}}function c(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=g.bem.els;return`&:not(${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${v!==null&&v.length>0?`${o}${v[0]}`:""}${r}${f})`}}}return Object.assign(i,{cB:(...f)=>n(a(f[0]),f[1],f[2]),cE:(...f)=>n(l(f[0]),f[1],f[2]),cM:(...f)=>n(s(f[0]),f[1],f[2]),cNotM:(...f)=>n(c(f[0]),f[1],f[2])}),i}function am(e){let t=0;for(let o=0;o{let n=am(r);if(n){if(n===1){e.forEach(a=>{o.push(r.replace("&",a))});return}}else{e.forEach(a=>{o.push((a&&a+" ")+r)});return}let i=[r];for(;n--;){const a=[];i.forEach(l=>{e.forEach(s=>{a.push(l.replace("&",s))})}),i=a}i.forEach(a=>o.push(a))}),o}function cm(e,t){const o=[];return t.split(kd).forEach(r=>{e.forEach(n=>{o.push((n&&n+" ")+r)})}),o}function dm(e){let t=[""];return e.forEach(o=>{o=o&&o.trim(),o&&(o.includes("&")?t=sm(t,o):t=cm(t,o))}),t.join(", ").replace(lm," ")}function ps(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function _i(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function um(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function Ln(e){return e?/^\s*@(s|m)/.test(e):!1}const fm=/[A-Z]/g;function Dd(e){return e.replace(fm,t=>"-"+t.toLowerCase())}function pm(e,t=" "){return typeof e=="object"&&e!==null?` { +**/let ya;const Vl=typeof window<"u"&&window.trustedTypes;if(Vl)try{ya=Vl.createPolicy("vue",{createHTML:e=>e})}catch{}const Td=ya?e=>ya.createHTML(e):e=>e,ag="http://www.w3.org/2000/svg",lg="http://www.w3.org/1998/Math/MathML",ao=typeof document<"u"?document:null,Ul=ao&&ao.createElement("template"),sg={insert:(e,t,o)=>{t.insertBefore(e,o||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,o,r)=>{const n=t==="svg"?ao.createElementNS(ag,e):t==="mathml"?ao.createElementNS(lg,e):o?ao.createElement(e,{is:o}):ao.createElement(e);return e==="select"&&r&&r.multiple!=null&&n.setAttribute("multiple",r.multiple),n},createText:e=>ao.createTextNode(e),createComment:e=>ao.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>ao.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,o,r,n,i){const a=o?o.previousSibling:t.lastChild;if(n&&(n===i||n.nextSibling))for(;t.insertBefore(n.cloneNode(!0),o),!(n===i||!(n=n.nextSibling)););else{Ul.innerHTML=Td(r==="svg"?`${e}`:r==="mathml"?`${e}`:e);const l=Ul.content;if(r==="svg"||r==="mathml"){const s=l.firstChild;for(;s.firstChild;)l.appendChild(s.firstChild);l.removeChild(s)}t.insertBefore(l,o)}return[a?a.nextSibling:t.firstChild,o?o.previousSibling:t.lastChild]}},vo="transition",Br="animation",yr=Symbol("_vtc"),$d={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},Rd=Xe({},Nc,$d),cg=e=>(e.displayName="Transition",e.props=Rd,e),un=cg((e,{slots:t})=>y(uh,Fd(e),t)),Bo=(e,t=[])=>{ce(e)?e.forEach(o=>o(...t)):e&&e(...t)},ql=e=>e?ce(e)?e.some(t=>t.length>1):e.length>1:!1;function Fd(e){const t={};for(const A in e)A in $d||(t[A]=e[A]);if(e.css===!1)return t;const{name:o="v",type:r,duration:n,enterFromClass:i=`${o}-enter-from`,enterActiveClass:a=`${o}-enter-active`,enterToClass:l=`${o}-enter-to`,appearFromClass:s=i,appearActiveClass:c=a,appearToClass:d=l,leaveFromClass:u=`${o}-leave-from`,leaveActiveClass:p=`${o}-leave-active`,leaveToClass:m=`${o}-leave-to`}=e,f=dg(n),g=f&&f[0],S=f&&f[1],{onBeforeEnter:v,onEnter:$,onEnterCancelled:T,onLeave:w,onLeaveCancelled:_,onBeforeAppear:O=v,onAppear:x=$,onAppearCancelled:F=T}=t,R=(A,J,G,le)=>{A._enterCancelled=le,Co(A,J?d:l),Co(A,J?c:a),G&&G()},B=(A,J)=>{A._isLeaving=!1,Co(A,u),Co(A,m),Co(A,p),J&&J()},j=A=>(J,G)=>{const le=A?x:$,te=()=>R(J,A,G);Bo(le,[J,te]),Gl(()=>{Co(J,A?s:i),qt(J,A?d:l),ql(le)||Kl(J,r,g,te)})};return Xe(t,{onBeforeEnter(A){Bo(v,[A]),qt(A,i),qt(A,a)},onBeforeAppear(A){Bo(O,[A]),qt(A,s),qt(A,c)},onEnter:j(!1),onAppear:j(!0),onLeave(A,J){A._isLeaving=!0;const G=()=>B(A,J);qt(A,u),A._enterCancelled?(qt(A,p),Sa()):(Sa(),qt(A,p)),Gl(()=>{A._isLeaving&&(Co(A,u),qt(A,m),ql(w)||Kl(A,r,S,G))}),Bo(w,[A,G])},onEnterCancelled(A){R(A,!1,void 0,!0),Bo(T,[A])},onAppearCancelled(A){R(A,!0,void 0,!0),Bo(F,[A])},onLeaveCancelled(A){B(A),Bo(_,[A])}})}function dg(e){if(e==null)return null;if(_e(e))return[Xi(e.enter),Xi(e.leave)];{const t=Xi(e);return[t,t]}}function Xi(e){return xp(e)}function qt(e,t){t.split(/\s+/).forEach(o=>o&&e.classList.add(o)),(e[yr]||(e[yr]=new Set)).add(t)}function Co(e,t){t.split(/\s+/).forEach(r=>r&&e.classList.remove(r));const o=e[yr];o&&(o.delete(t),o.size||(e[yr]=void 0))}function Gl(e){requestAnimationFrame(()=>{requestAnimationFrame(e)})}let ug=0;function Kl(e,t,o,r){const n=e._endId=++ug,i=()=>{n===e._endId&&r()};if(o!=null)return setTimeout(i,o);const{type:a,timeout:l,propCount:s}=Ad(e,t);if(!a)return r();const c=a+"end";let d=0;const u=()=>{e.removeEventListener(c,p),i()},p=m=>{m.target===e&&++d>=s&&u()};setTimeout(()=>{d(o[f]||"").split(", "),n=r(`${vo}Delay`),i=r(`${vo}Duration`),a=Yl(n,i),l=r(`${Br}Delay`),s=r(`${Br}Duration`),c=Yl(l,s);let d=null,u=0,p=0;t===vo?a>0&&(d=vo,u=a,p=i.length):t===Br?c>0&&(d=Br,u=c,p=s.length):(u=Math.max(a,c),d=u>0?a>c?vo:Br:null,p=d?d===vo?i.length:s.length:0);const m=d===vo&&/\b(transform|all)(,|$)/.test(r(`${vo}Property`).toString());return{type:d,timeout:u,propCount:p,hasTransform:m}}function Yl(e,t){for(;e.lengthXl(o)+Xl(e[r])))}function Xl(e){return e==="auto"?0:Number(e.slice(0,-1).replace(",","."))*1e3}function Sa(){return document.body.offsetHeight}function fg(e,t,o){const r=e[yr];r&&(t=(t?[t,...r]:[...r]).join(" ")),t==null?e.removeAttribute("class"):o?e.setAttribute("class",t):e.className=t}const di=Symbol("_vod"),Id=Symbol("_vsh"),Z2={beforeMount(e,{value:t},{transition:o}){e[di]=e.style.display==="none"?"":e.style.display,o&&t?o.beforeEnter(e):Lr(e,t)},mounted(e,{value:t},{transition:o}){o&&t&&o.enter(e)},updated(e,{value:t,oldValue:o},{transition:r}){!t!=!o&&(r?t?(r.beforeEnter(e),Lr(e,!0),r.enter(e)):r.leave(e,()=>{Lr(e,!1)}):Lr(e,t))},beforeUnmount(e,{value:t}){Lr(e,t)}};function Lr(e,t){e.style.display=t?e[di]:"none",e[Id]=!t}const pg=Symbol(""),hg=/(^|;)\s*display\s*:/;function gg(e,t,o){const r=e.style,n=We(o);let i=!1;if(o&&!n){if(t)if(We(t))for(const a of t.split(";")){const l=a.slice(0,a.indexOf(":")).trim();o[l]==null&&Zn(r,l,"")}else for(const a in t)o[a]==null&&Zn(r,a,"");for(const a in o)a==="display"&&(i=!0),Zn(r,a,o[a])}else if(n){if(t!==o){const a=r[pg];a&&(o+=";"+a),r.cssText=o,i=hg.test(o)}}else t&&e.removeAttribute("style");di in e&&(e[di]=i?r.display:"",e[Id]&&(r.display="none"))}const Jl=/\s*!important$/;function Zn(e,t,o){if(ce(o))o.forEach(r=>Zn(e,t,r));else if(o==null&&(o=""),t.startsWith("--"))e.setProperty(t,o);else{const r=mg(e,t);Jl.test(o)?e.setProperty(Io(r),o.replace(Jl,""),"important"):e[r]=o}}const Zl=["Webkit","Moz","ms"],Ji={};function mg(e,t){const o=Ji[t];if(o)return o;let r=Mt(t);if(r!=="filter"&&r in e)return Ji[t]=r;r=bi(r);for(let n=0;nZi||(Cg.then(()=>Zi=0),Zi=Date.now());function Sg(e,t){const o=r=>{if(!r._vts)r._vts=Date.now();else if(r._vts<=o.attached)return;Lt(wg(r,o.value),t,5,[r])};return o.value=e,o.attached=yg(),o}function wg(e,t){if(ce(t)){const o=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{o.call(e),e._stopped=!0},t.map(r=>n=>!n._stopped&&r&&r(n))}else return t}const ns=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Pg=(e,t,o,r,n,i)=>{const a=n==="svg";t==="class"?fg(e,r,a):t==="style"?gg(e,o,r):gi(t)?Na(t)||vg(e,t,o,r,i):(t[0]==="."?(t=t.slice(1),!0):t[0]==="^"?(t=t.slice(1),!1):Tg(e,t,r,a))?(ts(e,t,r),!e.tagName.includes("-")&&(t==="value"||t==="checked"||t==="selected")&&es(e,t,r,a,i,t!=="value")):e._isVueCE&&(/[A-Z]/.test(t)||!We(r))?ts(e,Mt(t),r,i,t):(t==="true-value"?e._trueValue=r:t==="false-value"&&(e._falseValue=r),es(e,t,r,a))};function Tg(e,t,o,r){if(r)return!!(t==="innerHTML"||t==="textContent"||t in e&&ns(t)&&me(o));if(t==="spellcheck"||t==="draggable"||t==="translate"||t==="form"||t==="list"&&e.tagName==="INPUT"||t==="type"&&e.tagName==="TEXTAREA")return!1;if(t==="width"||t==="height"){const n=e.tagName;if(n==="IMG"||n==="VIDEO"||n==="CANVAS"||n==="SOURCE")return!1}return ns(t)&&We(o)?!1:t in e}const _d=new WeakMap,Ed=new WeakMap,ui=Symbol("_moveCb"),is=Symbol("_enterCb"),$g=e=>(delete e.props.mode,e),Rg=$g({name:"TransitionGroup",props:Xe({},Rd,{tag:String,moveClass:String}),setup(e,{slots:t}){const o=Sn(),r=jc();let n,i;return Jc(()=>{if(!n.length)return;const a=e.moveClass||`${e.name||"v"}-move`;if(!Eg(n[0].el,o.vnode.el,a))return;n.forEach(Ag),n.forEach(Ig);const l=n.filter(_g);Sa(),l.forEach(s=>{const c=s.el,d=c.style;qt(c,a),d.transform=d.webkitTransform=d.transitionDuration="";const u=c[ui]=p=>{p&&p.target!==c||(!p||/transform$/.test(p.propertyName))&&(c.removeEventListener("transitionend",u),c[ui]=null,Co(c,a))};c.addEventListener("transitionend",u)})}),()=>{const a=we(e),l=Fd(a);let s=a.tag||et;if(n=[],i)for(let c=0;c{l.split(/\s+/).forEach(s=>s&&r.classList.remove(s))}),o.split(/\s+/).forEach(l=>l&&r.classList.add(l)),r.style.display="none";const i=t.nodeType===1?t:t.parentNode;i.appendChild(r);const{hasTransform:a}=Ad(r);return i.removeChild(r),a}const Fo=e=>{const t=e.props["onUpdate:modelValue"]||!1;return ce(t)?o=>Kn(t,o):t};function Mg(e){e.target.composing=!0}function as(e){const t=e.target;t.composing&&(t.composing=!1,t.dispatchEvent(new Event("input")))}const Et=Symbol("_assign"),ls={created(e,{modifiers:{lazy:t,trim:o,number:r}},n){e[Et]=Fo(n);const i=r||n.props&&n.props.type==="number";uo(e,t?"change":"input",a=>{if(a.target.composing)return;let l=e.value;o&&(l=l.trim()),i&&(l=oi(l)),e[Et](l)}),o&&uo(e,"change",()=>{e.value=e.value.trim()}),t||(uo(e,"compositionstart",Mg),uo(e,"compositionend",as),uo(e,"change",as))},mounted(e,{value:t}){e.value=t??""},beforeUpdate(e,{value:t,oldValue:o,modifiers:{lazy:r,trim:n,number:i}},a){if(e[Et]=Fo(a),e.composing)return;const l=(i||e.type==="number")&&!/^0\d/.test(e.value)?oi(e.value):e.value,s=t??"";l!==s&&(document.activeElement===e&&e.type!=="range"&&(r&&t===o||n&&e.value.trim()===s)||(e.value=s))}},zg={deep:!0,created(e,t,o){e[Et]=Fo(o),uo(e,"change",()=>{const r=e._modelValue,n=Sr(e),i=e.checked,a=e[Et];if(ce(r)){const l=Ka(r,n),s=l!==-1;if(i&&!s)a(r.concat(n));else if(!i&&s){const c=[...r];c.splice(l,1),a(c)}}else if(Rr(r)){const l=new Set(r);i?l.add(n):l.delete(n),a(l)}else a(Md(e,i))})},mounted:ss,beforeUpdate(e,t,o){e[Et]=Fo(o),ss(e,t,o)}};function ss(e,{value:t,oldValue:o},r){e._modelValue=t;let n;if(ce(t))n=Ka(t,r.props.value)>-1;else if(Rr(t))n=t.has(r.props.value);else{if(t===o)return;n=er(t,Md(e,!0))}e.checked!==n&&(e.checked=n)}const Hg={created(e,{value:t},o){e.checked=er(t,o.props.value),e[Et]=Fo(o),uo(e,"change",()=>{e[Et](Sr(e))})},beforeUpdate(e,{value:t,oldValue:o},r){e[Et]=Fo(r),t!==o&&(e.checked=er(t,r.props.value))}},kg={deep:!0,created(e,{value:t,modifiers:{number:o}},r){const n=Rr(t);uo(e,"change",()=>{const i=Array.prototype.filter.call(e.options,a=>a.selected).map(a=>o?oi(Sr(a)):Sr(a));e[Et](e.multiple?n?new Set(i):i:i[0]),e._assigning=!0,nn(()=>{e._assigning=!1})}),e[Et]=Fo(r)},mounted(e,{value:t}){cs(e,t)},beforeUpdate(e,t,o){e[Et]=Fo(o)},updated(e,{value:t}){e._assigning||cs(e,t)}};function cs(e,t){const o=e.multiple,r=ce(t);if(!(o&&!r&&!Rr(t))){for(let n=0,i=e.options.length;nString(c)===String(l)):a.selected=Ka(t,l)>-1}else a.selected=t.has(l);else if(er(Sr(a),t)){e.selectedIndex!==n&&(e.selectedIndex=n);return}}!o&&e.selectedIndex!==-1&&(e.selectedIndex=-1)}}function Sr(e){return"_value"in e?e._value:e.value}function Md(e,t){const o=t?"_trueValue":"_falseValue";return o in e?e[o]:t}const Q2={created(e,t,o){On(e,t,o,null,"created")},mounted(e,t,o){On(e,t,o,null,"mounted")},beforeUpdate(e,t,o,r){On(e,t,o,r,"beforeUpdate")},updated(e,t,o,r){On(e,t,o,r,"updated")}};function Dg(e,t){switch(e){case"SELECT":return kg;case"TEXTAREA":return ls;default:switch(t){case"checkbox":return zg;case"radio":return Hg;default:return ls}}}function On(e,t,o,r,n){const a=Dg(e.tagName,o.props&&o.props.type)[n];a&&a(e,t,o,r)}const Og=["ctrl","shift","alt","meta"],Bg={stop:e=>e.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&e.button!==0,middle:e=>"button"in e&&e.button!==1,right:e=>"button"in e&&e.button!==2,exact:(e,t)=>Og.some(o=>e[`${o}Key`]&&!t.includes(o))},eP=(e,t)=>{const o=e._withMods||(e._withMods={}),r=t.join(".");return o[r]||(o[r]=(n,...i)=>{for(let a=0;a{const o=e._withKeys||(e._withKeys={}),r=t.join(".");return o[r]||(o[r]=n=>{if(!("key"in n))return;const i=Io(n.key);if(t.some(a=>a===i||Lg[a]===i))return e(n)})},Wg=Xe({patchProp:Pg},sg);let ds;function jg(){return ds||(ds=Mh(Wg))}const oP=(...e)=>{const t=jg().createApp(...e),{mount:o}=t;return t.mount=r=>{const n=Vg(r);if(!n)return;const i=t._component;!me(i)&&!i.render&&!i.template&&(i.template=n.innerHTML),n.nodeType===1&&(n.textContent="");const a=o(n,!1,Ng(n));return n instanceof Element&&(n.removeAttribute("v-cloak"),n.setAttribute("data-v-app","")),a},t};function Ng(e){if(e instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&e instanceof MathMLElement)return"mathml"}function Vg(e){return We(e)?document.querySelector(e):e}const Ug={common:{appName:"AT Term",cancel:"Cancel",close:"Close",confirm:"Confirm",copy:"Copy",create:"Create",created:"created",delete:"Delete",english:"English",language:"Language",loading:"Loading...",no:"no",optional:"optional",revoke:"Revoke",save:"Save",send:"send",simplifiedChinese:"Simplified Chinese",system:"System",unknown:"unknown",version:"Version",versionLabel:"version {version}",yes:"yes"},auth:{alreadyHaveAccount:"Already have an account?",createAccount:"Create account",email:"Email",emailPlaceholder:"you@example.com",setup:{title:"First-run setup",hint:"No admin yet. Create the first admin account — use the email you set in ATTERM_BOOTSTRAP_ADMIN_EMAIL.",emailPlaceholder:"your ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"Confirm password",createAdmin:"Create admin",passwordMismatch:"The two passwords do not match.",notAdmin:"Account created, but it is not an admin — make sure the email matches ATTERM_BOOTSTRAP_ADMIN_EMAIL.",failed:"Setup failed. Please try again."},errors:{emailTaken:"An account with that email already exists.",invalidCredentials:"Invalid email or password.",invalidEmail:"Please enter a valid email.",invalidRequest:"Please check your input.",inviteInvalid:"Invite code is invalid or already used.",passwordWeak:"Password must be at least 12 characters.",rateLimited:"Too many attempts. Please wait a few minutes.",rateLimitedShort:"Too many attempts. Please wait.",signInFailed:"Sign-in failed. Please try again.",signUpFailed:"Sign-up failed. Check your invite code and try again."},haveInviteCode:"Have an invite code?",inviteCode:"Invite code",password:"Password",signIn:"Sign in",signUp:"Sign up",signUpHere:"Sign up here"},setup:{allowInsecure:"Allow insecure HTTP/WS (non-loopback)",connect:"Connect",connectToRelay:"Connect to relay",disconnect:"Disconnect",errors:{cannotReachRelay:"Cannot reach relay: {message}",invalidRelayUrl:"invalid or malformed relay URL",originRejected:"Relay rejected the origin. Make sure the relay was started with ATTERM_ORIGINS containing capacitor://localhost.",relayHttp:"Relay returned HTTP {status}.",relayHttpCheckUrl:"Relay returned HTTP {status}. Check the URL and try again.",relayUrlMustBeHttp:"relay URL must start with http:// or https://",relayUrlNoPath:"relay URL must not contain a path, query, or fragment",relayUrlRequired:"relay URL is required",tokenInvalid:"API token is invalid. Generate a new one from Settings -> API Tokens on the relay web UI.",tokenInvalidSettings:"API token is invalid. Generate a new one from the relay web UI under Settings -> API Tokens.",tokenRequired:"API token is required",useInsecureForHttp:'enable "Allow insecure HTTP/WS" to use http:// with a non-loopback host'},reasonTokenInvalid:"Your API token is no longer valid. Please paste a fresh token to sign in again.",title:"Set up relay",relayUrl:"Relay URL",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"Saved."},main:{activeSessions:"active sessions",back:"back",backToSessions:"Back to sessions",empty:"No live sessions. Start one from the desktop app or",errors:{loadSessions:"Failed to load sessions."},install:{dismiss:"Dismiss install hint",text:"on iPhone, open this site with HTTPS, then tap Share -> Add to Home Screen.",title:"install AT Term"},reconnect:"Reconnect",refresh:"refresh",sessionCount:"{count} sessions",sessionCountOne:"{count} session",title:"Remote sessions",unknownCommand:"(unknown)",unknownHost:"unknown host",unlock:{action:"Sign in again",text:"This browser is signed in, but the in-memory encryption key is locked. Sign in again to decrypt session names, commands, and paths.",title:"Unlock encrypted session details"},viewOnlyNotice:"This session is view-only from this device. You can inspect output, but input is disabled.",taskTypes:{ai:"AI",test:"Test",build:"Build",deploy:"Deploy"}},terminal:{cannotReachRelay:"Cannot reach relay.",connecting:"Connecting...",disconnected:"Disconnected",ended:"session ended (exit {code})",loadingHistory:"loading history... {percent}%",paste:"Paste",pickImage:"pick image",pickFile:"pick file",remoteControl:"remote has taken control",statuses:{attached:"attached",connecting:"connecting",ended:"ended",lost:"lost",reconnecting:"reconnecting"},shortcuts:"terminal shortcuts",takeControl:"Take control",tapToChangeConfig:"Tap to change configuration.",templatePreviewTitle:"Send preview",templatePreviewSend:"Send"},sessions:{attach:"Attach",created:"Created",host:"Host"},admin:{actions:"Actions",config:{effective:"effective: {value}",effectiveDisabled:"effective: disabled",hint:'0 means "use the built-in default"; negative disables the limit entirely. Changes apply immediately and persist to the admin config file.',loadFailed:"Failed to load config.",maxConnections:"Max WS connections (per IP+token)",rateLimit:"Rate limit (requests/min per IP+token)",saveFailed:"Save failed.",runtimeLimits:"Runtime limits",debug:"Verbose logging",debugHint:"Logs relay frames. Applies immediately, no restart.",debugPayload:"Log payload bytes",debugPayloadWarn:"Logs terminal input/output — sensitive. Use only while debugging.",allowedOrigins:"Allowed Origins",allowedOriginsHint:'One per line. Mobile Capacitor clients need "capacitor://localhost". Empty = allow any origin (dev only).',allowedOriginsPlaceholder:`https://relay.example.com +capacitor://localhost`},configTab:"Config",feishuTab:"Feishu",trafficTab:"Traffic",traffic:{title:"Traffic analysis",timezone:"Daily aggregation in UTC",refresh:"Refresh data",platformScope:"Platform scope",platformStatus:"Platform status",globalRealtime:"Global live data",relayStatus:"Relay status",online:"Online",unknown:"Unknown",activeSessions:"Active sessions",relayInstances:"Active relays",activeUplinks:"Active uplinks",liveValue:"Live on this node",liveInstances:"Heartbeat within 90s",flushEvery:"Traffic flushes every {seconds}s",userScope:"User scope",userAnalysis:"User traffic analysis",range:"Date range",days:"{days} days",allUsers:"Users: all",selectedUsers:"Users: {selected}/{total}",filterUsers:"Filter users",selectedCount:"{selected} / {total} selected",clearAll:"Clear all",selectAll:"Select all",searchUsers:"Search email or user ID",selectOrSearchUser:"Select or search user",only:"Only",noUserMatch:"No matching users",restoreAll:"Restore all",done:"Done",noUsersSelected:"No users selected",restoreAllUsers:"Restore all users",selectedUserCount:"{count} users selected",kpiTotal:"Total traffic",kpiOutbound:"Outbound",kpiInbound:"Inbound",kpiFrames:"Frames",trendNew:"No prior data",trendFlat:"Flat",coreAnalysis:"Core analysis",timelineTitle:"User traffic timeline",timelineScope:"{count} users",view:"View",groupTimeline:"Group timeline",frameTimeline:"Frame types",directionTrend:"Direction trend",metric:"Metric",bytes:"Bytes",frames:"Frames",direction:{all:"All",out:"Outbound",in:"Inbound"},multiUserMatrix:"Multi-user matrix",stackedTimeline:"Single-user stacked",bucketCount:"{count} daily buckets",total:"Total",selectedAggregate:"Selected users",categorySummary:"Category summary",totalComposition:"Traffic mix for selected users",clear:"Clear",outIn:"Out {out} · In {in}",userDetail:"User detail",userCount:"{count} users",totalTraffic:"Total traffic",share:"Share",periodTrend:"vs prior",activeDays:"Active days",viewUser:"View {user}",diagnostics:"Traffic diagnostics",diagnosticsRange:"Last {days} days",dailyActivity:"Daily user activity",frameDensity:"Category frame density",frameUnit:"frame",userTraffic:"User traffic",dailyTraffic:"Daily traffic",frameBreakdown:"Frame type breakdown",colUser:"User",colCategory:"Category",colFrameType:"Frame type",colDirection:"Direction",colBytes:"Bytes",colFrames:"Frames",dirIn:"In",dirOut:"Out",empty:"No traffic recorded for this range.",loadFailed:"Failed to load traffic stats.",categories:{terminal:"Terminal relay",state:"State sync",filesystem:"File browser",service:"Remote preview",control:"Control",other:"Other"}},feishuConfig:{title:"Feishu integration",description:"Enable the Feishu bot bridge for this relay. The encrypt key protects Feishu app credentials stored on the server.",enabled:"Enable Feishu",encryptKey:"Encrypt key",generate:"Generate",keyGenerated:"Key generated — save to apply.",keyEmptyPlaceholder:"Paste or generate a 32-byte base64 key",keyKeepPlaceholder:"Key set (…{last4}). Leave blank to keep it.",keyCopyOnce:"Copy this key somewhere safe — it is shown only once and never again.",forceRotate:"Replace the existing key (existing Feishu bindings will stop working)",baseUrl:"Base URL",statusRunning:"Running",statusStopped:"Stopped",rotateConflict:'That changes the existing key. Enable "replace" to rotate it (existing bindings will break).',loadFailed:"Failed to load Feishu config.",saveFailed:"Save failed."},created:"Created",disabled:"disabled {when}",email:"Email",errors:{actionFailed:"Action failed.",cannotDemoteSelf:"You can't demote yourself.",lastAdmin:"Can't demote the last admin - promote another user first."},id:"ID",invitationsTab:{consumed:"Consumed",count:"Count",createFailed:"Create failed: {code}",copyNow:"Copy this invitation now{note} - it will not be shown again.",empty:"No invitations yet.",expires:"Expires",loadFailed:"Failed to load invitations.",note:"Note",prefix:"Prefix",unused:"unused"},loadUsersFailed:"Failed to load users.",promote:"Promote",promoteConfirm:"Promote this user to admin?",resetPassword:"Reset password",resetPasswordConfirm:"Reset password? A new temporary password is shown once.",secretCopyOnce:"{label} - copy it now, only shown once.",status:"Status",temporaryPasswordFor:"Temporary password for {email}",title:"Admin",userStatus:{active:"active",admin:"admin"},users:"Users",invitations:"Invitations",demote:"Demote",demoteConfirm:"Demote this admin?",disable:"Disable",disableConfirm:"Disable this user? They are signed out and cannot log in."},test:{interpolation:"{count} sessions"},connHealth:{pillLabelConnecting:"connecting…",pillLabelReconnecting:"reconnecting…",pillLabelOff:"off",drawerTitle:"Connection health",drawerRttNow:"RTT (now)",drawerRttP50P95:"p50 / p95 (5 min)",drawerBytesIn:"↓ in",drawerBytesOut:"↑ out",drawerState:"State",drawerReconnectsLastHour:"Reconnects (1 h)",drawerReconnectsTime:"time",drawerReconnectsReason:"reason",drawerReconnectsDowntime:"downtime",drawerSeqGaps:"Seq gaps observed:"}},qg={common:{appName:"AT Term",cancel:"取消",close:"关闭",confirm:"确认",copy:"复制",create:"创建",created:"创建于",delete:"删除",english:"英语",language:"语言",loading:"正在加载...",no:"否",optional:"可选",revoke:"撤销",save:"保存",send:"发送",simplifiedChinese:"简体中文",system:"跟随系统",unknown:"未知",version:"版本",versionLabel:"版本 {version}",yes:"是"},auth:{alreadyHaveAccount:"已有账号?",createAccount:"创建账号",email:"邮箱",emailPlaceholder:"you@example.com",setup:{title:"首次安装",hint:"还没有管理员。创建第一个管理员账号——请填写你在 ATTERM_BOOTSTRAP_ADMIN_EMAIL 配置的邮箱。",emailPlaceholder:"你配置的 ATTERM_BOOTSTRAP_ADMIN_EMAIL",confirmPassword:"确认密码",createAdmin:"创建管理员",passwordMismatch:"两次输入的密码不一致。",notAdmin:"账号已创建,但不是管理员——请确认邮箱与 ATTERM_BOOTSTRAP_ADMIN_EMAIL 一致。",failed:"初始化失败,请重试。"},errors:{emailTaken:"该邮箱已注册。",invalidCredentials:"邮箱或密码不正确。",invalidEmail:"请输入有效邮箱。",invalidRequest:"请检查输入。",inviteInvalid:"邀请码无效或已被使用。",passwordWeak:"密码至少需要 12 个字符。",rateLimited:"尝试次数过多,请等待几分钟。",rateLimitedShort:"尝试次数过多,请稍后再试。",signInFailed:"登录失败,请重试。",signUpFailed:"注册失败,请检查邀请码后重试。"},haveInviteCode:"有邀请码?",inviteCode:"邀请码",password:"密码",signIn:"登录",signUp:"注册",signUpHere:"在这里注册"},setup:{allowInsecure:"允许不安全的 HTTP/WS(非 loopback)",connect:"连接",connectToRelay:"连接到 relay",disconnect:"断开连接",errors:{cannotReachRelay:"无法连接 relay:{message}",invalidRelayUrl:"relay 地址无效或格式错误",originRejected:"relay 拒绝了该 Origin。请确认启动 relay 时 ATTERM_ORIGINS 包含 capacitor://localhost。",relayHttp:"relay 返回 HTTP {status}。",relayHttpCheckUrl:"relay 返回 HTTP {status}。请检查地址后重试。",relayUrlMustBeHttp:"relay 地址必须以 http:// 或 https:// 开头",relayUrlNoPath:"relay 地址不能包含 path、query 或 fragment",relayUrlRequired:"relay 地址必填",tokenInvalid:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenInvalidSettings:"API token 无效。请在 relay Web UI 的设置 -> API Tokens 中生成新 token。",tokenRequired:"API token 必填",useInsecureForHttp:"如需对非 loopback 主机使用 http://,请启用“允许不安全的 HTTP/WS”"},reasonTokenInvalid:"你的 API token 已失效。请粘贴新的 token 重新登录。",title:"设置 relay",relayUrl:"Relay 地址",relayUrlPlaceholder:"https://relay.example.com",token:"API token",tokenPlaceholder:"atk_...",saved:"已保存。"},main:{activeSessions:"活动会话",back:"返回",backToSessions:"返回会话列表",empty:"没有在线会话。请从桌面 app 或",errors:{loadSessions:"加载会话失败。"},install:{dismiss:"关闭安装提示",text:"在 iPhone 上,用 HTTPS 打开本站,然后点分享 -> 添加到主屏幕。",title:"安装 AT Term"},reconnect:"重新连接",refresh:"刷新",sessionCount:"{count} 个会话",sessionCountOne:"{count} 个会话",title:"远程会话",unknownCommand:"(未知)",unknownHost:"未知主机",unlock:{action:"重新登录",text:"此浏览器仍处于登录状态,但内存中的加密密钥已锁定。重新登录后才能解密会话名称、命令和路径。",title:"解锁加密会话信息"},viewOnlyNotice:"此设备只能查看该会话。你可以查看输出,但不能输入。",taskTypes:{ai:"AI",test:"测试",build:"构建",deploy:"部署"}},terminal:{cannotReachRelay:"无法连接 relay。",connecting:"正在连接...",disconnected:"连接已断开",ended:"会话已结束(退出码 {code})",loadingHistory:"正在加载历史... {percent}%",paste:"粘贴",pickImage:"选择图片",pickFile:"选择文件",remoteControl:"远端已接管控制",statuses:{attached:"已连接",connecting:"正在连接",ended:"已结束",lost:"连接丢失",reconnecting:"正在重连"},shortcuts:"终端快捷键",takeControl:"接管控制",tapToChangeConfig:"点击修改配置。",templatePreviewTitle:"发送预览",templatePreviewSend:"发送"},sessions:{attach:"接管",created:"创建时间",host:"主机"},admin:{actions:"操作",config:{effective:"实际:{value}",effectiveDisabled:"实际:已禁用",hint:"0 表示使用内建默认值;负数表示完全禁用限制。修改会立即生效,并持久化到管理配置文件。",loadFailed:"加载配置失败。",maxConnections:"最大 WS 连接数(每 IP+token)",rateLimit:"速率限制(每 IP+token 每分钟请求数)",saveFailed:"保存失败。",runtimeLimits:"运行时限制",debug:"详细日志",debugHint:"记录 relay 帧。立即生效,无需重启。",debugPayload:"记录 payload 字节",debugPayloadWarn:"会记录终端输入/输出,属敏感信息,仅排查问题时临时开启。",allowedOrigins:"允许的 Origin",allowedOriginsHint:'一行一个。手机 Capacitor 客户端必须包含 "capacitor://localhost"。留空 = 允许任意 origin(仅供开发)。',allowedOriginsPlaceholder:`https://relay.example.com +capacitor://localhost`},configTab:"配置",feishuTab:"飞书",trafficTab:"流量",traffic:{title:"流量分析",timezone:"按 UTC 日聚合",refresh:"刷新数据",platformScope:"平台范围",platformStatus:"平台状态",globalRealtime:"全局实时",relayStatus:"Relay 状态",online:"运行中",unknown:"未知",activeSessions:"在线会话",relayInstances:"活跃 Relay",activeUplinks:"在线 Uplink",liveValue:"当前节点实时值",liveInstances:"90 秒内有心跳",flushEvery:"流量每 {seconds} 秒入库",userScope:"用户范围",userAnalysis:"用户流量分析",range:"时间范围",days:"{days} 天",allUsers:"用户:全部",selectedUsers:"用户:已选 {selected}/{total}",filterUsers:"筛选用户",selectedCount:"{selected} / {total} 已选",clearAll:"取消全选",selectAll:"全选",searchUsers:"搜索邮箱或用户 ID",selectOrSearchUser:"选择或搜索用户",only:"仅看",noUserMatch:"未找到匹配用户",restoreAll:"恢复全部",done:"完成",noUsersSelected:"当前未选择用户",restoreAllUsers:"恢复全部用户",selectedUserCount:"已筛选 {count} 位用户",kpiTotal:"总流量",kpiOutbound:"出站流量",kpiInbound:"入站流量",kpiFrames:"帧数",trendNew:"上期为 0",trendFlat:"持平",coreAnalysis:"核心分析",timelineTitle:"用户时序流量",timelineScope:"{count} 位用户",view:"视图",groupTimeline:"分组时序",frameTimeline:"帧类型",directionTrend:"方向走势",metric:"指标",bytes:"字节",frames:"帧数",direction:{all:"全部",out:"出站",in:"入站"},multiUserMatrix:"多用户矩阵",stackedTimeline:"单用户堆叠",bucketCount:"{count} 个日桶",total:"合计",selectedAggregate:"所选用户合计",categorySummary:"类别摘要",totalComposition:"所选用户的流量构成",clear:"清除",outIn:"出 {out} · 入 {in}",userDetail:"用户明细",userCount:"{count} 位用户",totalTraffic:"总流量",share:"占比",periodTrend:"较上期",activeDays:"活跃天数",viewUser:"查看 {user}",diagnostics:"流量诊断",diagnosticsRange:"最近 {days} 天",dailyActivity:"用户日活跃度",frameDensity:"类别帧密度",frameUnit:"帧",userTraffic:"用户流量",dailyTraffic:"每日流量",frameBreakdown:"帧类型构成",colUser:"用户",colCategory:"类别",colFrameType:"帧类型",colDirection:"方向",colBytes:"字节",colFrames:"帧数",dirIn:"接收",dirOut:"发送",empty:"该时间范围内暂无流量记录。",loadFailed:"加载流量统计失败。",categories:{terminal:"终端转发",state:"状态同步",filesystem:"文件浏览",service:"远程预览",control:"控制信令",other:"其他"}},feishuConfig:{title:"飞书集成",description:"为本 relay 启用飞书机器人桥接。加密密钥用于保护服务器上保存的飞书应用凭据。",enabled:"启用飞书",encryptKey:"加密密钥",generate:"生成",keyGenerated:"已生成密钥,保存后生效。",keyEmptyPlaceholder:"粘贴或生成一个 32 字节 base64 密钥",keyKeepPlaceholder:"已设置密钥(…{last4})。留空则保持不变。",keyCopyOnce:"请妥善复制保存此密钥——它只显示这一次,之后不再展示。",forceRotate:"替换现有密钥(现有飞书绑定将失效)",baseUrl:"Base URL",statusRunning:"运行中",statusStopped:"已停止",rotateConflict:"这会更改现有密钥。需勾选「替换」才能轮换(现有绑定会失效)。",loadFailed:"加载飞书配置失败。",saveFailed:"保存失败。"},created:"创建时间",disabled:"已禁用 {when}",email:"邮箱",errors:{actionFailed:"操作失败。",cannotDemoteSelf:"不能降级你自己。",lastAdmin:"不能降级最后一个管理员,请先提升其他用户。"},id:"ID",invitationsTab:{consumed:"已使用",count:"数量",createFailed:"创建失败:{code}",copyNow:"请立即复制此邀请{note},此后不会再次显示。",empty:"还没有邀请。",expires:"过期时间",loadFailed:"加载邀请失败。",note:"备注",prefix:"前缀",unused:"未使用"},loadUsersFailed:"加载用户失败。",promote:"提升",promoteConfirm:"将此用户提升为管理员?",resetPassword:"重置密码",resetPasswordConfirm:"重置密码?新的临时密码只会显示一次。",secretCopyOnce:"{label} - 请立即复制,仅显示一次。",status:"状态",temporaryPasswordFor:"{email} 的临时密码",title:"管理",userStatus:{active:"活跃",admin:"管理员"},users:"用户",invitations:"邀请",demote:"降级",demoteConfirm:"降级此管理员?",disable:"禁用",disableConfirm:"禁用此用户?该用户将被登出且无法登录。"},test:{interpolation:"{count} 个会话"},connHealth:{pillLabelConnecting:"连接中…",pillLabelReconnecting:"重连中…",pillLabelOff:"已关闭",drawerTitle:"连接质量",drawerRttNow:"RTT(当前)",drawerRttP50P95:"p50 / p95(最近 5 分钟)",drawerBytesIn:"↓ 接收",drawerBytesOut:"↑ 发送",drawerState:"状态",drawerReconnectsLastHour:"最近 1 小时重连",drawerReconnectsTime:"时间",drawerReconnectsReason:"原因",drawerReconnectsDowntime:"断开时长",drawerSeqGaps:"观察到的序号跳跃:"}},zd="atterm.locale",us={en:Ug,"zh-CN":qg},Fi=fe("system"),Pn=fe("en"),Gg=Y(()=>[{label:fo("common.system"),value:"system"},{label:fo("common.english"),value:"en"},{label:fo("common.simplifiedChinese"),value:"zh-CN"}]);let Hd=cl,Wr;function rP(e={}){Wr==null||Wr(),Wr=void 0,Hd=e.getLanguages??cl;const t=Xg();Fi.value=t,wa(),Wr=(e.listenLanguageChange??rm)(()=>{wa()})}function Kg(e){Fi.value=e,wa();try{window.localStorage.setItem(zd,e)}catch{}try{window.localStorage.setItem("atterm.locale_preference.value",JSON.stringify(e))}catch{}pp(async()=>{const{notifyLocalChange:t}=await import("./prefsSync-C5tz9Q-s.js");return{notifyLocalChange:t}},__vite__mapDeps([0,1])).then(({notifyLocalChange:t})=>{t("locale_preference")}).catch(()=>{})}function Yg(e,t=cl()){if(e==="en"||e==="zh-CN")return e;for(const o of t){const r=o.trim().toLowerCase();if(r!==""){if(r==="zh"||r.startsWith("zh-"))return"zh-CN";if(r==="en"||r.startsWith("en-"))return"en"}}return"en"}function fo(e,t={}){const o=fs(us[Pn.value],e)??fs(us.en,e)??e;return em(o,t)}function nP(e){return tm(e,{dateStyle:"medium",timeStyle:"short"})}function Xg(){try{const e=window.localStorage.getItem(zd);return Jg(e)?e:"system"}catch{return"system"}}function Jg(e){return e==="system"||e==="en"||e==="zh-CN"}function wa(){Zg(Yg(Fi.value,Hd()))}function Zg(e){Pn.value=e,Qg(e)}function Qg(e){typeof document>"u"||(document.documentElement.lang=e)}function fs(e,t){let o=e;for(const r of t.split(".")){if(!om(o))return;o=o[r]}return typeof o=="string"?o:void 0}function em(e,t){return e.replace(/\{([^{}]+)\}/g,(o,r)=>{const n=t[r];return n===void 0?o:String(n)})}function tm(e,t){if(e===void 0||e==="")return"";try{return new Intl.DateTimeFormat(Pn.value,t).format(new Date(e))}catch{return typeof e=="string"?e:""}}function om(e){return typeof e=="object"&&e!==null}function cl(){return typeof navigator>"u"?[]:navigator.languages.length>0?navigator.languages:navigator.language?[navigator.language]:[]}function rm(e){return typeof window>"u"?()=>{}:(window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e))}const dl="atterm.relay";let Bn=null;function iP(){if(Bn!==null)return Bn;const e=globalThis.Capacitor;return Bn=!!(e&&typeof e.isNativePlatform=="function"&&e.isNativePlatform()),Bn}function aP(){if(typeof localStorage>"u")return null;const e=localStorage.getItem(dl);if(!e)return null;try{const t=JSON.parse(e);return typeof t!="object"||t===null?null:{baseURL:t.baseURL??t.base??"",sessionToken:t.sessionToken??t.token??null,expiresAt:t.expiresAt??null,allowInsecure:t.allowInsecure??t.allow_insecure??!1,...t.realmId!==void 0?{realmId:t.realmId}:{},...t.homeInstanceURL!==void 0?{homeInstanceURL:t.homeInstanceURL}:{}}}catch{return null}}function lP(e){typeof localStorage>"u"||localStorage.setItem(dl,JSON.stringify(e))}function sP(){typeof localStorage>"u"||localStorage.removeItem(dl)}function cP(e,t){const o=e.trim();if(!o)return fo("setup.errors.relayUrlRequired");let r;try{r=new URL(o)}catch{return fo("setup.errors.invalidRelayUrl")}return r.protocol!=="http:"&&r.protocol!=="https:"?fo("setup.errors.relayUrlMustBeHttp"):r.pathname!=="/"||r.search!==""||r.hash!==""?fo("setup.errors.relayUrlNoPath"):r.protocol==="http:"&&!nm(r.hostname)&&!t?fo("setup.errors.useInsecureForHttp"):null}function nm(e){const t=e.toLowerCase();return!!(t==="localhost"||t==="127.0.0.1"||t==="::1"||t.startsWith("127.")||t.startsWith("[")&&t.endsWith("]")&&t.slice(1,-1)==="::1")}const dP=(e,t)=>{const o=e.__vccOpts||e;for(const[r,n]of t)o[r]=n;return o};function im(e){let t=".",o="__",r="--",n;if(e){let f=e.blockPrefix;f&&(t=f),f=e.elementPrefix,f&&(o=f),f=e.modifierPrefix,f&&(r=f)}const i={install(f){n=f.c;const g=f.context;g.bem={},g.bem.b=null,g.bem.els=null}};function a(f){let g,S;return{before(v){g=v.bem.b,S=v.bem.els,v.bem.els=null},after(v){v.bem.b=g,v.bem.els=S},$({context:v,props:$}){return f=typeof f=="string"?f:f({context:v,props:$}),v.bem.b=f,`${($==null?void 0:$.bPrefix)||t}${v.bem.b}`}}}function l(f){let g;return{before(S){g=S.bem.els},after(S){S.bem.els=g},$({context:S,props:v}){return f=typeof f=="string"?f:f({context:S,props:v}),S.bem.els=f.split(",").map($=>$.trim()),S.bem.els.map($=>`${(v==null?void 0:v.bPrefix)||t}${S.bem.b}${o}${$}`).join(", ")}}}function s(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=f.split(",").map(w=>w.trim());function $(w){return v.map(_=>`&${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${w!==void 0?`${o}${w}`:""}${r}${_}`).join(", ")}const T=g.bem.els;return T!==null?$(T[0]):$()}}}function c(f){return{$({context:g,props:S}){f=typeof f=="string"?f:f({context:g,props:S});const v=g.bem.els;return`&:not(${(S==null?void 0:S.bPrefix)||t}${g.bem.b}${v!==null&&v.length>0?`${o}${v[0]}`:""}${r}${f})`}}}return Object.assign(i,{cB:(...f)=>n(a(f[0]),f[1],f[2]),cE:(...f)=>n(l(f[0]),f[1],f[2]),cM:(...f)=>n(s(f[0]),f[1],f[2]),cNotM:(...f)=>n(c(f[0]),f[1],f[2])}),i}function am(e){let t=0;for(let o=0;o{let n=am(r);if(n){if(n===1){e.forEach(a=>{o.push(r.replace("&",a))});return}}else{e.forEach(a=>{o.push((a&&a+" ")+r)});return}let i=[r];for(;n--;){const a=[];i.forEach(l=>{e.forEach(s=>{a.push(l.replace("&",s))})}),i=a}i.forEach(a=>o.push(a))}),o}function cm(e,t){const o=[];return t.split(kd).forEach(r=>{e.forEach(n=>{o.push((n&&n+" ")+r)})}),o}function dm(e){let t=[""];return e.forEach(o=>{o=o&&o.trim(),o&&(o.includes("&")?t=sm(t,o):t=cm(t,o))}),t.join(", ").replace(lm," ")}function ps(e){if(!e)return;const t=e.parentElement;t&&t.removeChild(e)}function Ai(e,t){return(t??document.head).querySelector(`style[cssr-id="${e}"]`)}function um(e){const t=document.createElement("style");return t.setAttribute("cssr-id",e),t}function Ln(e){return e?/^\s*@(s|m)/.test(e):!1}const fm=/[A-Z]/g;function Dd(e){return e.replace(fm,t=>"-"+t.toLowerCase())}function pm(e,t=" "){return typeof e=="object"&&e!==null?` { `+Object.entries(e).map(o=>t+` ${Dd(o[0])}: ${o[1]};`).join(` `)+` `+t+"}":`: ${e};`}function hm(e,t,o){return typeof e=="function"?e({context:t.context,props:o}):e}function hs(e,t,o,r){if(!t)return"";const n=hm(t,o,r);if(!n)return"";if(typeof n=="string")return`${e} { @@ -26,11 +26,11 @@ ${n} }`:"";const a=e?[e+" {"]:[];return i.forEach(l=>{const s=n[l];if(l==="raw"){a.push(` `+s+` `);return}l=Dd(l),s!=null&&a.push(` ${l}${pm(s)}`)}),e&&a.push("}"),a.join(` -`)}function Pa(e,t,o){e&&e.forEach(r=>{if(Array.isArray(r))Pa(r,t,o);else if(typeof r=="function"){const n=r(t);Array.isArray(n)?Pa(n,t,o):n&&o(n)}else r&&o(r)})}function Bd(e,t,o,r,n){const i=e.$;let a="";if(!i||typeof i=="string")Ln(i)?a=i:t.push(i);else if(typeof i=="function"){const c=i({context:r.context,props:n});Ln(c)?a=c:t.push(c)}else if(i.before&&i.before(r.context),!i.$||typeof i.$=="string")Ln(i.$)?a=i.$:t.push(i.$);else if(i.$){const c=i.$({context:r.context,props:n});Ln(c)?a=c:t.push(c)}const l=dm(t),s=hs(l,e.props,r,n);a?o.push(`${a} {`):s.length&&o.push(s),e.children&&Pa(e.children,{context:r.context,props:n},c=>{if(typeof c=="string"){const d=hs(l,{raw:c},r,n);o.push(d)}else Bd(c,t,o,r,n)}),t.pop(),a&&o.push("}"),i&&i.after&&i.after(r.context)}function gm(e,t,o){const r=[];return Bd(e,[],r,t,o),r.join(` +`)}function Pa(e,t,o){e&&e.forEach(r=>{if(Array.isArray(r))Pa(r,t,o);else if(typeof r=="function"){const n=r(t);Array.isArray(n)?Pa(n,t,o):n&&o(n)}else r&&o(r)})}function Od(e,t,o,r,n){const i=e.$;let a="";if(!i||typeof i=="string")Ln(i)?a=i:t.push(i);else if(typeof i=="function"){const c=i({context:r.context,props:n});Ln(c)?a=c:t.push(c)}else if(i.before&&i.before(r.context),!i.$||typeof i.$=="string")Ln(i.$)?a=i.$:t.push(i.$);else if(i.$){const c=i.$({context:r.context,props:n});Ln(c)?a=c:t.push(c)}const l=dm(t),s=hs(l,e.props,r,n);a?o.push(`${a} {`):s.length&&o.push(s),e.children&&Pa(e.children,{context:r.context,props:n},c=>{if(typeof c=="string"){const d=hs(l,{raw:c},r,n);o.push(d)}else Od(c,t,o,r,n)}),t.pop(),a&&o.push("}"),i&&i.after&&i.after(r.context)}function gm(e,t,o){const r=[];return Od(e,[],r,t,o),r.join(` -`)}function fn(e){for(var t=0,o,r=0,n=e.length;n>=4;++r,n-=4)o=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,t=(o&65535)*1540483477+((o>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(n){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}typeof window<"u"&&(window.__cssrContext={});function mm(e,t,o,r){const{els:n}=t;if(o===void 0)n.forEach(ps),t.els=[];else{const i=_i(o,r);i&&n.includes(i)&&(ps(i),t.els=n.filter(a=>a!==i))}}function gs(e,t){e.push(t)}function bm(e,t,o,r,n,i,a,l,s){let c;if(o===void 0&&(c=t.render(r),o=fn(c)),s){s.adapter(o,c??t.render(r));return}l===void 0&&(l=document.head);const d=_i(o,l);if(d!==null&&!i)return d;const u=d??um(o);if(c===void 0&&(c=t.render(r)),u.textContent=c,d!==null)return d;if(a){const p=l.querySelector(`meta[name="${a}"]`);if(p)return l.insertBefore(u,p),gs(t.els,u),u}return n?l.insertBefore(u,l.querySelector("style, link")):l.appendChild(u),gs(t.els,u),u}function vm(e){return gm(this,this.instance,e)}function xm(e={}){const{id:t,ssr:o,props:r,head:n=!1,force:i=!1,anchorMetaName:a,parent:l}=e;return bm(this.instance,this,t,r,n,i,a,l,o)}function Cm(e={}){const{id:t,parent:o}=e;mm(this.instance,this,t,o)}const Wn=function(e,t,o,r){return{instance:e,$:t,props:o,children:r,els:[],render:vm,mount:xm,unmount:Cm}},ym=function(e,t,o,r){return Array.isArray(t)?Wn(e,{$:null},null,t):Array.isArray(o)?Wn(e,t,null,o):Array.isArray(r)?Wn(e,t,o,r):Wn(e,t,o,null)};function Sm(e={}){const t={c:(...o)=>ym(t,...o),use:(o,...r)=>o.install(t,...r),find:_i,context:{},config:e};return t}function wm(e,t){if(e===void 0)return!1;if(t){const{context:{ids:o}}=t;return o.has(e)}return _i(e)!==null}const Pm="n",pn=`.${Pm}-`,Tm="__",$m="--",Od=Sm(),Ld=im({blockPrefix:pn,elementPrefix:Tm,modifierPrefix:$m});Od.use(Ld);const{c:L,find:uP}=Od,{cB:pe,cE:V,cM:re,cNotM:Po}=Ld;function Rm(e){return L(({props:{bPrefix:t}})=>`${t||pn}modal, ${t||pn}drawer`,[e])}function Fm(e){return L(({props:{bPrefix:t}})=>`${t||pn}popover`,[e])}function _m(e){return L(({props:{bPrefix:t}})=>`&${t||pn}modal`,e)}const fP=(...e)=>L(">",[pe(...e)]);function ae(e,t){return e+(t==="default"?"":t.replace(/^[a-z]/,o=>o.toUpperCase()))}function Em(e){return e.composedPath()[0]||null}function ms(e){return typeof e=="string"?e.endsWith("px")?Number(e.slice(0,e.length-2)):Number(e):e}function pP(e){if(e!=null)return typeof e=="number"?`${e}px`:e.endsWith("px")?e:`${e}px`}function Vo(e,t){const o=e.trim().split(/\s+/g),r={top:o[0]};switch(o.length){case 1:r.right=o[0],r.bottom=o[0],r.left=o[0];break;case 2:r.right=o[1],r.left=o[1],r.bottom=o[0];break;case 3:r.right=o[1],r.bottom=o[2],r.left=o[1];break;case 4:r.right=o[1],r.bottom=o[2],r.left=o[3];break;default:throw new Error("[seemly/getMargin]:"+e+" is not a valid value.")}return t===void 0?r:r[t]}function hP(e,t){const[o,r]=e.split(" ");return{row:o,col:r||o}}const bs={aliceblue:"#F0F8FF",antiquewhite:"#FAEBD7",aqua:"#0FF",aquamarine:"#7FFFD4",azure:"#F0FFFF",beige:"#F5F5DC",bisque:"#FFE4C4",black:"#000",blanchedalmond:"#FFEBCD",blue:"#00F",blueviolet:"#8A2BE2",brown:"#A52A2A",burlywood:"#DEB887",cadetblue:"#5F9EA0",chartreuse:"#7FFF00",chocolate:"#D2691E",coral:"#FF7F50",cornflowerblue:"#6495ED",cornsilk:"#FFF8DC",crimson:"#DC143C",cyan:"#0FF",darkblue:"#00008B",darkcyan:"#008B8B",darkgoldenrod:"#B8860B",darkgray:"#A9A9A9",darkgrey:"#A9A9A9",darkgreen:"#006400",darkkhaki:"#BDB76B",darkmagenta:"#8B008B",darkolivegreen:"#556B2F",darkorange:"#FF8C00",darkorchid:"#9932CC",darkred:"#8B0000",darksalmon:"#E9967A",darkseagreen:"#8FBC8F",darkslateblue:"#483D8B",darkslategray:"#2F4F4F",darkslategrey:"#2F4F4F",darkturquoise:"#00CED1",darkviolet:"#9400D3",deeppink:"#FF1493",deepskyblue:"#00BFFF",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1E90FF",firebrick:"#B22222",floralwhite:"#FFFAF0",forestgreen:"#228B22",fuchsia:"#F0F",gainsboro:"#DCDCDC",ghostwhite:"#F8F8FF",gold:"#FFD700",goldenrod:"#DAA520",gray:"#808080",grey:"#808080",green:"#008000",greenyellow:"#ADFF2F",honeydew:"#F0FFF0",hotpink:"#FF69B4",indianred:"#CD5C5C",indigo:"#4B0082",ivory:"#FFFFF0",khaki:"#F0E68C",lavender:"#E6E6FA",lavenderblush:"#FFF0F5",lawngreen:"#7CFC00",lemonchiffon:"#FFFACD",lightblue:"#ADD8E6",lightcoral:"#F08080",lightcyan:"#E0FFFF",lightgoldenrodyellow:"#FAFAD2",lightgray:"#D3D3D3",lightgrey:"#D3D3D3",lightgreen:"#90EE90",lightpink:"#FFB6C1",lightsalmon:"#FFA07A",lightseagreen:"#20B2AA",lightskyblue:"#87CEFA",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#B0C4DE",lightyellow:"#FFFFE0",lime:"#0F0",limegreen:"#32CD32",linen:"#FAF0E6",magenta:"#F0F",maroon:"#800000",mediumaquamarine:"#66CDAA",mediumblue:"#0000CD",mediumorchid:"#BA55D3",mediumpurple:"#9370DB",mediumseagreen:"#3CB371",mediumslateblue:"#7B68EE",mediumspringgreen:"#00FA9A",mediumturquoise:"#48D1CC",mediumvioletred:"#C71585",midnightblue:"#191970",mintcream:"#F5FFFA",mistyrose:"#FFE4E1",moccasin:"#FFE4B5",navajowhite:"#FFDEAD",navy:"#000080",oldlace:"#FDF5E6",olive:"#808000",olivedrab:"#6B8E23",orange:"#FFA500",orangered:"#FF4500",orchid:"#DA70D6",palegoldenrod:"#EEE8AA",palegreen:"#98FB98",paleturquoise:"#AFEEEE",palevioletred:"#DB7093",papayawhip:"#FFEFD5",peachpuff:"#FFDAB9",peru:"#CD853F",pink:"#FFC0CB",plum:"#DDA0DD",powderblue:"#B0E0E6",purple:"#800080",rebeccapurple:"#663399",red:"#F00",rosybrown:"#BC8F8F",royalblue:"#4169E1",saddlebrown:"#8B4513",salmon:"#FA8072",sandybrown:"#F4A460",seagreen:"#2E8B57",seashell:"#FFF5EE",sienna:"#A0522D",silver:"#C0C0C0",skyblue:"#87CEEB",slateblue:"#6A5ACD",slategray:"#708090",slategrey:"#708090",snow:"#FFFAFA",springgreen:"#00FF7F",steelblue:"#4682B4",tan:"#D2B48C",teal:"#008080",thistle:"#D8BFD8",tomato:"#FF6347",turquoise:"#40E0D0",violet:"#EE82EE",wheat:"#F5DEB3",white:"#FFF",whitesmoke:"#F5F5F5",yellow:"#FF0",yellowgreen:"#9ACD32",transparent:"#0000"};function zm(e,t,o){t/=100,o/=100;let r=(n,i=(n+e/60)%6)=>o-o*t*Math.max(Math.min(i,4-i,1),0);return[r(5)*255,r(3)*255,r(1)*255]}function Mm(e,t,o){t/=100,o/=100;let r=t*Math.min(o,1-o),n=(i,a=(i+e/30)%12)=>o-r*Math.max(Math.min(a-3,9-a,1),-1);return[n(0)*255,n(8)*255,n(4)*255]}const eo="^\\s*",to="\\s*$",_o="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))%\\s*",Ft="\\s*((\\.\\d+)|(\\d+(\\.\\d*)?))\\s*",qo="([0-9A-Fa-f])",Uo="([0-9A-Fa-f]{2})",Wd=new RegExp(`${eo}hsl\\s*\\(${Ft},${_o},${_o}\\)${to}`),jd=new RegExp(`${eo}hsv\\s*\\(${Ft},${_o},${_o}\\)${to}`),Nd=new RegExp(`${eo}hsla\\s*\\(${Ft},${_o},${_o},${Ft}\\)${to}`),Vd=new RegExp(`${eo}hsva\\s*\\(${Ft},${_o},${_o},${Ft}\\)${to}`),Im=new RegExp(`${eo}rgb\\s*\\(${Ft},${Ft},${Ft}\\)${to}`),Am=new RegExp(`${eo}rgba\\s*\\(${Ft},${Ft},${Ft},${Ft}\\)${to}`),Hm=new RegExp(`${eo}#${qo}${qo}${qo}${to}`),km=new RegExp(`${eo}#${Uo}${Uo}${Uo}${to}`),Dm=new RegExp(`${eo}#${qo}${qo}${qo}${qo}${to}`),Bm=new RegExp(`${eo}#${Uo}${Uo}${Uo}${Uo}${to}`);function yt(e){return parseInt(e,16)}function Om(e){try{let t;if(t=Nd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),Jo(t[13])];if(t=Wd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),1];throw new Error(`[seemly/hsla]: Invalid color value ${e}.`)}catch(t){throw t}}function Lm(e){try{let t;if(t=Vd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),Jo(t[13])];if(t=jd.exec(e))return[fi(t[1]),To(t[5]),To(t[9]),1];throw new Error(`[seemly/hsva]: Invalid color value ${e}.`)}catch(t){throw t}}function ho(e){try{let t;if(t=km.exec(e))return[yt(t[1]),yt(t[2]),yt(t[3]),1];if(t=Im.exec(e))return[ft(t[1]),ft(t[5]),ft(t[9]),1];if(t=Am.exec(e))return[ft(t[1]),ft(t[5]),ft(t[9]),Jo(t[13])];if(t=Hm.exec(e))return[yt(t[1]+t[1]),yt(t[2]+t[2]),yt(t[3]+t[3]),1];if(t=Bm.exec(e))return[yt(t[1]),yt(t[2]),yt(t[3]),Jo(yt(t[4])/255)];if(t=Dm.exec(e))return[yt(t[1]+t[1]),yt(t[2]+t[2]),yt(t[3]+t[3]),Jo(yt(t[4]+t[4])/255)];if(e in bs)return ho(bs[e]);if(Wd.test(e)||Nd.test(e)){const[o,r,n,i]=Om(e);return[...Mm(o,r,n),i]}else if(jd.test(e)||Vd.test(e)){const[o,r,n,i]=Lm(e);return[...zm(o,r,n),i]}throw new Error(`[seemly/rgba]: Invalid color value ${e}.`)}catch(t){throw t}}function Wm(e){return e>1?1:e<0?0:e}function Ta(e,t,o,r){return`rgba(${ft(e)}, ${ft(t)}, ${ft(o)}, ${Wm(r)})`}function Qi(e,t,o,r,n){return ft((e*t*(1-r)+o*r)/n)}function ee(e,t){Array.isArray(e)||(e=ho(e)),Array.isArray(t)||(t=ho(t));const o=e[3],r=t[3],n=Jo(o+r-o*r);return Ta(Qi(e[0],o,t[0],r,n),Qi(e[1],o,t[1],r,n),Qi(e[2],o,t[2],r,n),n)}function K(e,t){const[o,r,n,i=1]=Array.isArray(e)?e:ho(e);return typeof t.alpha=="number"?Ta(o,r,n,t.alpha):Ta(o,r,n,i)}function Ne(e,t){const[o,r,n,i=1]=Array.isArray(e)?e:ho(e),{lightness:a=1,alpha:l=1}=t;return jm([o*a,r*a,n*a,i*l])}function Jo(e){const t=Math.round(Number(e)*100)/100;return t>1?1:t<0?0:t}function fi(e){const t=Math.round(Number(e));return t>=360||t<0?0:t}function ft(e){const t=Math.round(Number(e));return t>255?255:t<0?0:t}function To(e){const t=Math.round(Number(e));return t>100?100:t<0?0:t}function jm(e){const[t,o,r]=e;return 3 in e?`rgba(${ft(t)}, ${ft(o)}, ${ft(r)}, ${Jo(e[3])})`:`rgba(${ft(t)}, ${ft(o)}, ${ft(r)}, 1)`}function $a(e=8){return Math.random().toString(16).slice(2,2+e)}function gP(e,t){const o=[];for(let r=0;r{t.contains(Qn(n))||o(n)};return{mousemove:r,touchstart:r}}else if(e==="clickoutside"){let r=!1;const n=a=>{r=!t.contains(Qn(a))},i=a=>{r&&(t.contains(Qn(a))||o(a))};return{mousedown:n,mouseup:i,touchstart:n,touchend:i}}return console.error(`[evtd/create-trap-handler]: name \`${e}\` is invalid. This could be a bug of evtd.`),{}}function qd(e,t,o){const r=Nm[e];let n=r.get(t);n===void 0&&r.set(t,n=new WeakMap);let i=n.get(o);return i===void 0&&n.set(o,i=Vm(e,t,o)),i}function qm(e,t,o,r){if(e==="mousemoveoutside"||e==="clickoutside"){const n=qd(e,t,o);return Object.keys(n).forEach(i=>{Go(i,document,n[i],r)}),!0}return!1}function Um(e,t,o,r){if(e==="mousemoveoutside"||e==="clickoutside"){const n=qd(e,t,o);return Object.keys(n).forEach(i=>{lo(i,document,n[i],r)}),!0}return!1}function Gm(){if(typeof window>"u")return{on:()=>{},off:()=>{}};const e=new WeakMap,t=new WeakMap;function o(){e.set(this,!0)}function r(){e.set(this,!0),t.set(this,!0)}function n(x,F,R){const O=x[F];return x[F]=function(){return R.apply(x,arguments),O.apply(x,arguments)},x}function i(x,F){x[F]=Event.prototype[F]}const a=new WeakMap,l=Object.getOwnPropertyDescriptor(Event.prototype,"currentTarget");function s(){var x;return(x=a.get(this))!==null&&x!==void 0?x:null}function c(x,F){l!==void 0&&Object.defineProperty(x,"currentTarget",{configurable:!0,enumerable:!0,get:F??l.get})}const d={bubble:{},capture:{}},u={};function p(){const x=function(F){const{type:R,eventPhase:O,bubbles:j}=F,_=Qn(F);if(O===2)return;const J=O===1?"capture":"bubble";let G=_;const le=[];for(;G===null&&(G=window),le.push(G),G!==window;)G=G.parentNode||null;const te=d.capture[R],N=d.bubble[R];if(n(F,"stopPropagation",o),n(F,"stopImmediatePropagation",r),c(F,s),J==="capture"){if(te===void 0)return;for(let oe=le.length-1;oe>=0&&!e.has(F);--oe){const ye=le[oe],Pe=te.get(ye);if(Pe!==void 0){a.set(F,ye);for(const Re of Pe){if(t.has(F))break;Re(F)}}if(oe===0&&!j&&N!==void 0){const Re=N.get(ye);if(Re!==void 0)for(const Fe of Re){if(t.has(F))break;Fe(F)}}}}else if(J==="bubble"){if(N===void 0)return;for(let oe=0;oe_(F))};return x.displayName="evtdUnifiedWindowEventHandler",x}const f=p(),g=m();function S(x,F){const R=d[x];return R[F]===void 0&&(R[F]=new Map,window.addEventListener(F,f,x==="capture")),R[F]}function v(x){return u[x]===void 0&&(u[x]=new Set,window.addEventListener(x,g)),u[x]}function $(x,F){let R=x.get(F);return R===void 0&&x.set(F,R=new Set),R}function T(x,F,R,O){const j=d[F][R];if(j!==void 0){const _=j.get(x);if(_!==void 0&&_.has(O))return!0}return!1}function w(x,F){const R=u[x];return!!(R!==void 0&&R.has(F))}function z(x,F,R,O){let j;if(typeof O=="object"&&O.once===!0?j=te=>{B(x,F,j,O),R(te)}:j=R,qm(x,F,j,O))return;const J=O===!0||typeof O=="object"&&O.capture===!0?"capture":"bubble",G=S(J,x),le=$(G,F);if(le.has(j)||le.add(j),F===window){const te=v(x);te.has(j)||te.add(j)}}function B(x,F,R,O){if(Um(x,F,R,O))return;const _=O===!0||typeof O=="object"&&O.capture===!0,J=_?"capture":"bubble",G=S(J,x),le=$(G,F);if(F===window&&!T(F,_?"bubble":"capture",x,R)&&w(x,R)){const N=u[x];N.delete(R),N.size===0&&(window.removeEventListener(x,g),u[x]=void 0)}le.has(R)&&le.delete(R),le.size===0&&G.delete(F),G.size===0&&(window.removeEventListener(x,f,J==="capture"),d[J][x]=void 0)}return{on:z,off:B}}const{on:Go,off:lo}=Gm();function hn(e){const t=Y(e),o=fe(t.value);return Zt(t,r=>{o.value=r}),typeof e=="function"?o:{__v_isRef:!0,get value(){return o.value},set value(r){e.set(r)}}}function Km(e,t){return Zt(e,o=>{o!==void 0&&(t.value=o)}),Y(()=>e.value===void 0?t.value:e.value)}function Ym(){const e=fe(!1);return Io(()=>{e.value=!0}),el(e)}const Xm=(typeof window>"u"?!1:/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&!window.MSStream;function Jm(){return Xm}function mP(e){return e}function Zm(e,t,o){var r;const n=Le(e,null);if(n===null)return;const i=(r=Sn())===null||r===void 0?void 0:r.proxy;Zt(o,a),a(o.value),nr(()=>{a(void 0,o.value)});function a(c,d){if(!n)return;const u=n[t];d!==void 0&&l(u,d),c!==void 0&&s(u,c)}function l(c,d){c[d]||(c[d]=[]),c[d].splice(c[d].findIndex(u=>u===i),1)}function s(c,d){c[d]||(c[d]=[]),~c[d].findIndex(u=>u===i)||c[d].push(i)}}const Ei=typeof document<"u"&&typeof window<"u";function Qm(e){const t={isDeactivated:!1};let o=!1;return Kc(()=>{if(t.isDeactivated=!1,!o){o=!0;return}e()}),Yc(()=>{t.isDeactivated=!0,o||(o=!0)}),t}const eb="@css-render/vue3-ssr";function tb(e,t){return``}function ob(e,t,o){const{styles:r,ids:n}=o;n.has(e)||r!==null&&(n.add(e),r.push(tb(e,t)))}const rb=typeof document<"u";function zi(){if(rb)return;const e=Le(eb,null);if(e!==null)return{adapter:(t,o)=>ob(t,o,e),context:e}}function vs(e,t){console.error(`[vueuc/${e}]: ${t}`)}var Zo=[],nb=function(){return Zo.some(function(e){return e.activeTargets.length>0})},ib=function(){return Zo.some(function(e){return e.skippedTargets.length>0})},xs="ResizeObserver loop completed with undelivered notifications.",ab=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:xs}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=xs),window.dispatchEvent(e)},gn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gn||(gn={}));var Qo=function(e){return Object.freeze(e)},lb=function(){function e(t,o){this.inlineSize=t,this.blockSize=o,Qo(this)}return e}(),Ud=function(){function e(t,o,r,n){return this.x=t,this.y=o,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Qo(this)}return e.prototype.toJSON=function(){var t=this,o=t.x,r=t.y,n=t.top,i=t.right,a=t.bottom,l=t.left,s=t.width,c=t.height;return{x:o,y:r,top:n,right:i,bottom:a,left:l,width:s,height:c}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),ul=function(e){return e instanceof SVGElement&&"getBBox"in e},Gd=function(e){if(ul(e)){var t=e.getBBox(),o=t.width,r=t.height;return!o&&!r}var n=e,i=n.offsetWidth,a=n.offsetHeight;return!(i||a||e.getClientRects().length)},Cs=function(e){var t;if(e instanceof Element)return!0;var o=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(o&&e instanceof o.Element)},sb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Zr=typeof window<"u"?window:{},jn=new WeakMap,ys=/auto|scroll/,cb=/^tb|vertical/,db=/msie|trident/i.test(Zr.navigator&&Zr.navigator.userAgent),Vt=function(e){return parseFloat(e||"0")},vr=function(e,t,o){return e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=!1),new lb((o?t:e)||0,(o?e:t)||0)},Ss=Qo({devicePixelContentBoxSize:vr(),borderBoxSize:vr(),contentBoxSize:vr(),contentRect:new Ud(0,0,0,0)}),Kd=function(e,t){if(t===void 0&&(t=!1),jn.has(e)&&!t)return jn.get(e);if(Gd(e))return jn.set(e,Ss),Ss;var o=getComputedStyle(e),r=ul(e)&&e.ownerSVGElement&&e.getBBox(),n=!db&&o.boxSizing==="border-box",i=cb.test(o.writingMode||""),a=!r&&ys.test(o.overflowY||""),l=!r&&ys.test(o.overflowX||""),s=r?0:Vt(o.paddingTop),c=r?0:Vt(o.paddingRight),d=r?0:Vt(o.paddingBottom),u=r?0:Vt(o.paddingLeft),p=r?0:Vt(o.borderTopWidth),m=r?0:Vt(o.borderRightWidth),f=r?0:Vt(o.borderBottomWidth),g=r?0:Vt(o.borderLeftWidth),S=u+c,v=s+d,$=g+m,T=p+f,w=l?e.offsetHeight-T-e.clientHeight:0,z=a?e.offsetWidth-$-e.clientWidth:0,B=n?S+$:0,x=n?v+T:0,F=r?r.width:Vt(o.width)-B-z,R=r?r.height:Vt(o.height)-x-w,O=F+S+z+$,j=R+v+w+T,_=Qo({devicePixelContentBoxSize:vr(Math.round(F*devicePixelRatio),Math.round(R*devicePixelRatio),i),borderBoxSize:vr(O,j,i),contentBoxSize:vr(F,R,i),contentRect:new Ud(u,s,F,R)});return jn.set(e,_),_},Yd=function(e,t,o){var r=Kd(e,o),n=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case gn.DEVICE_PIXEL_CONTENT_BOX:return a;case gn.BORDER_BOX:return n;default:return i}},ub=function(){function e(t){var o=Kd(t);this.target=t,this.contentRect=o.contentRect,this.borderBoxSize=Qo([o.borderBoxSize]),this.contentBoxSize=Qo([o.contentBoxSize]),this.devicePixelContentBoxSize=Qo([o.devicePixelContentBoxSize])}return e}(),Xd=function(e){if(Gd(e))return 1/0;for(var t=0,o=e.parentNode;o;)t+=1,o=o.parentNode;return t},fb=function(){var e=1/0,t=[];Zo.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(c){var d=new ub(c.target),u=Xd(c.target);l.push(d),c.lastReportedSize=Yd(c.target,c.observedBox),ue?o.activeTargets.push(n):o.skippedTargets.push(n))})})},pb=function(){var e=0;for(ws(e);nb();)e=fb(),ws(e);return ib()&&ab(),e>0},ea,Jd=[],hb=function(){return Jd.splice(0).forEach(function(e){return e()})},gb=function(e){if(!ea){var t=0,o=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return hb()}).observe(o,r),ea=function(){o.textContent="".concat(t?t--:t++)}}Jd.push(e),ea()},mb=function(e){gb(function(){requestAnimationFrame(e)})},ei=0,bb=function(){return!!ei},vb=250,xb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ps=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ts=function(e){return e===void 0&&(e=0),Date.now()+e},ta=!1,Cb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var o=this;if(t===void 0&&(t=vb),!ta){ta=!0;var r=Ts(t);mb(function(){var n=!1;try{n=pb()}finally{if(ta=!1,t=r-Ts(),!bb())return;n?o.run(1e3):t>0?o.run(t):o.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,o=function(){return t.observer&&t.observer.observe(document.body,xb)};document.body?o():Zr.addEventListener("DOMContentLoaded",o)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ps.forEach(function(o){return Zr.addEventListener(o,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ps.forEach(function(o){return Zr.removeEventListener(o,t.listener,!0)}),this.stopped=!0)},e}(),Ra=new Cb,$s=function(e){!ei&&e>0&&Ra.start(),ei+=e,!ei&&Ra.stop()},yb=function(e){return!ul(e)&&!sb(e)&&getComputedStyle(e).display==="inline"},Sb=function(){function e(t,o){this.target=t,this.observedBox=o||gn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Yd(this.target,this.observedBox,!0);return yb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),wb=function(){function e(t,o){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=o}return e}(),Nn=new WeakMap,Rs=function(e,t){for(var o=0;o=0&&(i&&Zo.splice(Zo.indexOf(r),1),r.observationTargets.splice(n,1),$s(-1))},e.disconnect=function(t){var o=this,r=Nn.get(t);r.observationTargets.slice().forEach(function(n){return o.unobserve(t,n.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Pb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Vn.connect(this,t)}return e.prototype.observe=function(t,o){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.observe(this,t,o)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.unobserve(this,t)},e.prototype.disconnect=function(){Vn.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Tb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Pb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const o of t){const r=this.elHandlersMap.get(o.target);r!==void 0&&r(o)}}registerHandler(t,o){this.elHandlersMap.set(t,o),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const Fs=new Tb,Fa=He({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const o=Sn().proxy;function r(n){const{onResize:i}=e;i!==void 0&&i(n)}Io(()=>{const n=o.$el;if(n===void 0){vs("resize-observer","$el does not exist.");return}if(n.nextElementSibling!==n.nextSibling&&n.nodeType===3&&n.nodeValue!==""){vs("resize-observer","$el can not be observed (it may be a text node).");return}n.nextElementSibling!==null&&(Fs.registerHandler(n.nextElementSibling,r),t=!0)}),nr(()=>{t&&Fs.unregisterHandler(o.$el.nextElementSibling)})},render(){return vh(this.$slots,"default")}});function _s(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const $b=/^(\d|\.)+$/,Es=/(\d|\.)+/;function oa(e,{c:t=1,offset:o=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+o)*t;return n===0?"0":`${n}px`}else if(typeof e=="string")if($b.test(e)){const n=(Number(e)+o)*t;return r?n===0?"0":`${n}px`:`${n}`}else{const n=Es.exec(e);return n?e.replace(Es,String((Number(n[0])+o)*t)):e}return e}function zs(e){const{left:t,right:o,top:r,bottom:n}=Vo(e);return`${r} ${t} ${n} ${o}`}function _a(e,t){console.error(`[naive/${e}]: ${t}`)}function Rb(e,t){throw new Error(`[naive/${e}]: ${t}`)}function Ke(e,...t){if(Array.isArray(e))e.forEach(o=>Ke(o,...t));else return e(...t)}function Ms(e){return Object.keys(e)}function Fb(e,t=[],o){const r={};return Object.getOwnPropertyNames(e).forEach(i=>{t.includes(i)||(r[i]=e[i])}),Object.assign(r,o)}function _b(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?xa(e):typeof e=="number"?xa(String(e)):null}function kt(e){return e.some(t=>Cr(t)?!(t.type===pt||t.type===et&&!kt(t.children)):!0)?e:null}function Qr(e,t){return e&&kt(e())||t()}function Eb(e,t,o){return e&&kt(e(t))||o(t)}function $t(e,t){const o=e&&kt(e());return t(o||null)}function zb(e){return!(e&&kt(e()))}const Is=He({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),Qt="n-config-provider",pi="n";function Ao(e={},t={defaultBordered:!0}){const o=Le(Qt,null);return{inlineThemeDisabled:o==null?void 0:o.inlineThemeDisabled,mergedRtlRef:o==null?void 0:o.mergedRtlRef,mergedComponentPropsRef:o==null?void 0:o.mergedComponentPropsRef,mergedBreakpointsRef:o==null?void 0:o.mergedBreakpointsRef,mergedBorderedRef:Y(()=>{var r,n;const{bordered:i}=e;return i!==void 0?i:(n=(r=o==null?void 0:o.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&n!==void 0?n:!0}),mergedClsPrefixRef:o?o.mergedClsPrefixRef:_c(pi),namespaceRef:Y(()=>o==null?void 0:o.mergedNamespaceRef.value)}}function bP(){const e=Le(Qt,null);return e?e.mergedClsPrefixRef:_c(pi)}function Fr(e,t,o,r){o||Rb("useThemeClass","cssVarsRef is not passed");const n=Le(Qt,null),i=n==null?void 0:n.mergedThemeHashRef,a=n==null?void 0:n.styleMountTarget,l=fe(""),s=zi();let c;const d=`__${e}`,u=()=>{let p=d;const m=t?t.value:void 0,f=i==null?void 0:i.value;f&&(p+=`-${f}`),m&&(p+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:S}=r;g&&(p+=`-${fn(JSON.stringify(g))}`),S&&(p+=`-${fn(JSON.stringify(S))}`),l.value=p,c=()=>{const v=o.value;let $="";for(const T in v)$+=`${T}: ${v[T]};`;L(`.${p}`,$).mount({id:p,ssr:s,parent:a}),c=void 0}};return sn(()=>{u()}),{themeClass:l,onRender:()=>{c==null||c()}}}const Ea="n-form-item";function Zd(e,{defaultSize:t="medium",mergedSize:o,mergedDisabled:r}={}){const n=Le(Ea,null);po(Ea,null);const i=Y(o?()=>o(n):()=>{const{size:s}=e;if(s)return s;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return t}),a=Y(r?()=>r(n):()=>{const{disabled:s}=e;return s!==void 0?s:n?n.disabled.value:!1}),l=Y(()=>{const{status:s}=e;return s||(n==null?void 0:n.mergedValidationStatus.value)});return nr(()=>{n&&n.restoreValidation()}),{mergedSizeRef:i,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const Qd={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},Mb={name:"zh-CN",global:{undo:"撤销",redo:"重做",confirm:"确认",clear:"清除"},Popconfirm:{positiveText:"确认",negativeText:"取消"},Cascader:{placeholder:"请选择",loading:"加载中",loadingRequiredMessage:e=>`加载全部 ${e} 的子节点后才可选中`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy年",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w周",clear:"清除",now:"此刻",confirm:"确认",selectTime:"选择时间",selectDate:"选择日期",datePlaceholder:"选择日期",datetimePlaceholder:"选择日期时间",monthPlaceholder:"选择月份",yearPlaceholder:"选择年份",quarterPlaceholder:"选择季度",weekPlaceholder:"选择周",startDatePlaceholder:"开始日期",endDatePlaceholder:"结束日期",startDatetimePlaceholder:"开始日期时间",endDatetimePlaceholder:"结束日期时间",startMonthPlaceholder:"开始月份",endMonthPlaceholder:"结束月份",monthBeforeYear:!1,firstDayOfWeek:0,today:"今天"},DataTable:{checkTableAll:"选择全部表格数据",uncheckTableAll:"取消选择全部表格数据",confirm:"确认",clear:"重置"},LegacyTransfer:{sourceTitle:"源项",targetTitle:"目标项"},Transfer:{selectAll:"全选",clearAll:"清除",unselectAll:"取消全选",total:e=>`共 ${e} 项`,selected:e=>`已选 ${e} 项`},Empty:{description:"无数据"},Select:{placeholder:"请选择"},TimePicker:{placeholder:"请选择时间",positiveText:"确认",negativeText:"取消",now:"此刻",clear:"清除"},Pagination:{goto:"跳至",selectionSuffix:"页"},DynamicTags:{add:"添加"},Log:{loading:"加载中"},Input:{placeholder:"请输入"},InputNumber:{placeholder:"请输入"},DynamicInput:{create:"添加"},ThemeEditor:{title:"主题编辑器",clearAllVars:"清除全部变量",clearSearch:"清除搜索",filterCompName:"过滤组件名",filterVarName:"过滤变量名",import:"导入",export:"导出",restore:"恢复默认"},Image:{tipPrevious:"上一张(←)",tipNext:"下一张(→)",tipCounterclockwise:"向左旋转",tipClockwise:"向右旋转",tipZoomOut:"缩小",tipZoomIn:"放大",tipDownload:"下载",tipClose:"关闭(Esc)",tipOriginalSize:"缩放到原始尺寸"}};function xr(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}function Yt(e){return(t,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let n;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):a;n=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;n=e.values[l]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}function Xt(e){return(t,o={})=>{const r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;const a=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?Ab(l,u=>u.test(a)):Ib(l,u=>u.test(a));let c;c=e.valueCallback?e.valueCallback(s):s,c=o.valueCallback?o.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function Ib(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function Ab(e,t){for(let o=0;o{const r=t.match(e.matchPattern);if(!r)return null;const n=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=o.valueCallback?o.valueCallback(a):a;const l=t.slice(n.length);return{value:a,rest:l}}}function Hb(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let kb={};function Db(){return kb}function As(e,t){var l,s,c,d;const o=Db(),r=(t==null?void 0:t.weekStartsOn)??((s=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:s.weekStartsOn)??o.weekStartsOn??((d=(c=o.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,n=Hb(e),i=n.getDay(),a=(i{let r;const n=Ob[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r},Wb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jb=(e,t,o,r)=>Wb[e],Nb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},qb={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},Ub={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Gb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Kb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yb=(e,t)=>{const o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},Xb={ordinalNumber:Yb,era:Yt({values:Nb,defaultWidth:"wide"}),quarter:Yt({values:Vb,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:qb,defaultWidth:"wide"}),day:Yt({values:Ub,defaultWidth:"wide"}),dayPeriod:Yt({values:Gb,defaultWidth:"wide",formattingValues:Kb,defaultFormattingWidth:"wide"})},Jb=/^(\d+)(th|st|nd|rd)?/i,Zb=/\d+/i,Qb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ev={any:[/^b/i,/^(a|c)/i]},tv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ov={any:[/1/i,/2/i,/3/i,/4/i]},rv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},iv={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},av={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cv={ordinalNumber:eu({matchPattern:Jb,parsePattern:Zb,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Qb,defaultMatchWidth:"wide",parsePatterns:ev,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:tv,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),day:Xt({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:lv,defaultMatchWidth:"any",parsePatterns:sv,defaultParseWidth:"any"})},dv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pv={date:xr({formats:dv,defaultWidth:"full"}),time:xr({formats:uv,defaultWidth:"full"}),dateTime:xr({formats:fv,defaultWidth:"full"})},hv={code:"en-US",formatDistance:Lb,formatLong:pv,formatRelative:jb,localize:Xb,match:cv,options:{weekStartsOn:0,firstWeekContainsDate:1}},gv={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},mv=(e,t,o)=>{let r;const n=gv[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",String(t)),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?r+"内":r+"前":r},bv={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},vv={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},xv={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Cv={date:xr({formats:bv,defaultWidth:"full"}),time:xr({formats:vv,defaultWidth:"full"}),dateTime:xr({formats:xv,defaultWidth:"full"})};function Hs(e,t,o){const r="eeee p";return Bb(e,t,o)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const yv={lastWeek:Hs,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Hs,other:"PP p"},Sv=(e,t,o,r)=>{const n=yv[e];return typeof n=="function"?n(t,o,r):n},wv={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Pv={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Tv={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},$v={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Rv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Fv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},_v=(e,t)=>{const o=Number(e);switch(t==null?void 0:t.unit){case"date":return o.toString()+"日";case"hour":return o.toString()+"时";case"minute":return o.toString()+"分";case"second":return o.toString()+"秒";default:return"第 "+o.toString()}},Ev={ordinalNumber:_v,era:Yt({values:wv,defaultWidth:"wide"}),quarter:Yt({values:Pv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Tv,defaultWidth:"wide"}),day:Yt({values:$v,defaultWidth:"wide"}),dayPeriod:Yt({values:Rv,defaultWidth:"wide",formattingValues:Fv,defaultFormattingWidth:"wide"})},zv=/^(第\s*)?\d+(日|时|分|秒)?/i,Mv=/\d+/i,Iv={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},Av={any:[/^(前)/i,/^(公元)/i]},Hv={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},kv={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Dv={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Bv={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Ov={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Lv={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Wv={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},jv={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Nv={ordinalNumber:eu({matchPattern:zv,parsePattern:Mv,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Iv,defaultMatchWidth:"wide",parsePatterns:Av,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:Hv,defaultMatchWidth:"wide",parsePatterns:kv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Bv,defaultParseWidth:"any"}),day:Xt({matchPatterns:Ov,defaultMatchWidth:"wide",parsePatterns:Lv,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:Wv,defaultMatchWidth:"any",parsePatterns:jv,defaultParseWidth:"any"})},Vv={code:"zh-CN",formatDistance:mv,formatLong:Cv,formatRelative:Sv,localize:Ev,match:Nv,options:{weekStartsOn:1,firstWeekContainsDate:4}},tu={name:"en-US",locale:hv},qv={name:"zh-CN",locale:Vv};var ou=typeof global=="object"&&global&&global.Object===Object&&global,Uv=typeof self=="object"&&self&&self.Object===Object&&self,_r=ou||Uv||Function("return this")(),wr=_r.Symbol,ru=Object.prototype,Gv=ru.hasOwnProperty,Kv=ru.toString,jr=wr?wr.toStringTag:void 0;function Yv(e){var t=Gv.call(e,jr),o=e[jr];try{e[jr]=void 0;var r=!0}catch{}var n=Kv.call(e);return r&&(t?e[jr]=o:delete e[jr]),n}var Xv=Object.prototype,Jv=Xv.toString;function Zv(e){return Jv.call(e)}var Qv="[object Null]",e0="[object Undefined]",ks=wr?wr.toStringTag:void 0;function Tn(e){return e==null?e===void 0?e0:Qv:ks&&ks in Object(e)?Yv(e):Zv(e)}function Er(e){return e!=null&&typeof e=="object"}var t0="[object Symbol]";function fl(e){return typeof e=="symbol"||Er(e)&&Tn(e)==t0}function o0(e,t){for(var o=-1,r=e==null?0:e.length,n=Array(r);++o0){if(++t>=w0)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function R0(e){return function(){return e}}var hi=function(){try{var e=hl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),F0=hi?function(e,t){return hi(e,"toString",{configurable:!0,enumerable:!1,value:R0(t),writable:!0})}:iu,_0=$0(F0),E0=9007199254740991,z0=/^(?:0|[1-9]\d*)$/;function au(e,t){var o=typeof e;return t=t??E0,!!t&&(o=="number"||o!="symbol"&&z0.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=B0}function ml(e){return e!=null&&lu(e.length)&&!pl(e)}function O0(e,t,o){if(!ir(o))return!1;var r=typeof t;return(r=="number"?ml(o)&&au(t,o.length):r=="string"&&t in o)?Mi(o[t],e):!1}function L0(e){return D0(function(t,o){var r=-1,n=o.length,i=n>1?o[n-1]:void 0,a=n>2?o[2]:void 0;for(i=e.length>3&&typeof i=="function"?(n--,i):void 0,a&&O0(o[0],o[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++r-1}function Xx(e,t){var o=this.__data__,r=Ii(o,e);return r<0?(++this.size,o.push([e,t])):o[r][1]=t,this}function mo(e){var t=-1,o=e==null?0:e.length;for(this.clear();++tn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var i=Array(n);++r=r?e:vC(e,t,o)}var CC="\\ud800-\\udfff",yC="\\u0300-\\u036f",SC="\\ufe20-\\ufe2f",wC="\\u20d0-\\u20ff",PC=yC+SC+wC,TC="\\ufe0e\\ufe0f",$C="\\u200d",RC=RegExp("["+$C+CC+PC+TC+"]");function Cu(e){return RC.test(e)}function FC(e){return e.split("")}var yu="\\ud800-\\udfff",_C="\\u0300-\\u036f",EC="\\ufe20-\\ufe2f",zC="\\u20d0-\\u20ff",MC=_C+EC+zC,IC="\\ufe0e\\ufe0f",AC="["+yu+"]",Ma="["+MC+"]",Ia="\\ud83c[\\udffb-\\udfff]",HC="(?:"+Ma+"|"+Ia+")",Su="[^"+yu+"]",wu="(?:\\ud83c[\\udde6-\\uddff]){2}",Pu="[\\ud800-\\udbff][\\udc00-\\udfff]",kC="\\u200d",Tu=HC+"?",$u="["+IC+"]?",DC="(?:"+kC+"(?:"+[Su,wu,Pu].join("|")+")"+$u+Tu+")*",BC=$u+Tu+DC,OC="(?:"+[Su+Ma+"?",Ma,wu,Pu,AC].join("|")+")",LC=RegExp(Ia+"(?="+Ia+")|"+OC+BC,"g");function WC(e){return e.match(LC)||[]}function jC(e){return Cu(e)?WC(e):FC(e)}function NC(e){return function(t){t=mu(t);var o=Cu(t)?jC(t):void 0,r=o?o[0]:t.charAt(0),n=o?xC(o,1).join(""):t.slice(1);return r[e]()+n}}var VC=NC("toUpperCase");function qC(){this.__data__=new mo,this.size=0}function UC(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}function GC(e){return this.__data__.get(e)}function KC(e){return this.__data__.has(e)}var YC=200;function XC(e,t){var o=this.__data__;if(o instanceof mo){var r=o.__data__;if(!gu||r.length{var i,a;return(a=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&a!==void 0?a:Qd[e]});return{dateLocaleRef:Y(()=>{var i;return(i=o==null?void 0:o.value)!==null&&i!==void 0?i:tu}),localeRef:r}}const bn="naive-ui-style";function $n(e,t,o){if(!t)return;const r=zi(),n=Y(()=>{const{value:l}=t;if(!l)return;const s=l[e];if(s)return s}),i=Le(Qt,null),a=()=>{sn(()=>{const{value:l}=o,s=`${l}${e}Rtl`;if(wm(s,r))return;const{value:c}=n;c&&c.style.mount({id:s,head:!0,anchorMetaName:bn,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:i==null?void 0:i.styleMountTarget})})};return r?a():Pi(a),n}const ko={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:sy,fontFamily:cy,lineHeight:dy}=ko,_u=L("body",` +`}function ob(e,t,o){const{styles:r,ids:n}=o;n.has(e)||r!==null&&(n.add(e),r.push(tb(e,t)))}const rb=typeof document<"u";function _i(){if(rb)return;const e=Le(eb,null);if(e!==null)return{adapter:(t,o)=>ob(t,o,e),context:e}}function vs(e,t){console.error(`[vueuc/${e}]: ${t}`)}var Zo=[],nb=function(){return Zo.some(function(e){return e.activeTargets.length>0})},ib=function(){return Zo.some(function(e){return e.skippedTargets.length>0})},xs="ResizeObserver loop completed with undelivered notifications.",ab=function(){var e;typeof ErrorEvent=="function"?e=new ErrorEvent("error",{message:xs}):(e=document.createEvent("Event"),e.initEvent("error",!1,!1),e.message=xs),window.dispatchEvent(e)},gn;(function(e){e.BORDER_BOX="border-box",e.CONTENT_BOX="content-box",e.DEVICE_PIXEL_CONTENT_BOX="device-pixel-content-box"})(gn||(gn={}));var Qo=function(e){return Object.freeze(e)},lb=function(){function e(t,o){this.inlineSize=t,this.blockSize=o,Qo(this)}return e}(),qd=function(){function e(t,o,r,n){return this.x=t,this.y=o,this.width=r,this.height=n,this.top=this.y,this.left=this.x,this.bottom=this.top+this.height,this.right=this.left+this.width,Qo(this)}return e.prototype.toJSON=function(){var t=this,o=t.x,r=t.y,n=t.top,i=t.right,a=t.bottom,l=t.left,s=t.width,c=t.height;return{x:o,y:r,top:n,right:i,bottom:a,left:l,width:s,height:c}},e.fromRect=function(t){return new e(t.x,t.y,t.width,t.height)},e}(),ul=function(e){return e instanceof SVGElement&&"getBBox"in e},Gd=function(e){if(ul(e)){var t=e.getBBox(),o=t.width,r=t.height;return!o&&!r}var n=e,i=n.offsetWidth,a=n.offsetHeight;return!(i||a||e.getClientRects().length)},Cs=function(e){var t;if(e instanceof Element)return!0;var o=(t=e==null?void 0:e.ownerDocument)===null||t===void 0?void 0:t.defaultView;return!!(o&&e instanceof o.Element)},sb=function(e){switch(e.tagName){case"INPUT":if(e.type!=="image")break;case"VIDEO":case"AUDIO":case"EMBED":case"OBJECT":case"CANVAS":case"IFRAME":case"IMG":return!0}return!1},Zr=typeof window<"u"?window:{},jn=new WeakMap,ys=/auto|scroll/,cb=/^tb|vertical/,db=/msie|trident/i.test(Zr.navigator&&Zr.navigator.userAgent),Vt=function(e){return parseFloat(e||"0")},vr=function(e,t,o){return e===void 0&&(e=0),t===void 0&&(t=0),o===void 0&&(o=!1),new lb((o?t:e)||0,(o?e:t)||0)},Ss=Qo({devicePixelContentBoxSize:vr(),borderBoxSize:vr(),contentBoxSize:vr(),contentRect:new qd(0,0,0,0)}),Kd=function(e,t){if(t===void 0&&(t=!1),jn.has(e)&&!t)return jn.get(e);if(Gd(e))return jn.set(e,Ss),Ss;var o=getComputedStyle(e),r=ul(e)&&e.ownerSVGElement&&e.getBBox(),n=!db&&o.boxSizing==="border-box",i=cb.test(o.writingMode||""),a=!r&&ys.test(o.overflowY||""),l=!r&&ys.test(o.overflowX||""),s=r?0:Vt(o.paddingTop),c=r?0:Vt(o.paddingRight),d=r?0:Vt(o.paddingBottom),u=r?0:Vt(o.paddingLeft),p=r?0:Vt(o.borderTopWidth),m=r?0:Vt(o.borderRightWidth),f=r?0:Vt(o.borderBottomWidth),g=r?0:Vt(o.borderLeftWidth),S=u+c,v=s+d,$=g+m,T=p+f,w=l?e.offsetHeight-T-e.clientHeight:0,_=a?e.offsetWidth-$-e.clientWidth:0,O=n?S+$:0,x=n?v+T:0,F=r?r.width:Vt(o.width)-O-_,R=r?r.height:Vt(o.height)-x-w,B=F+S+_+$,j=R+v+w+T,A=Qo({devicePixelContentBoxSize:vr(Math.round(F*devicePixelRatio),Math.round(R*devicePixelRatio),i),borderBoxSize:vr(B,j,i),contentBoxSize:vr(F,R,i),contentRect:new qd(u,s,F,R)});return jn.set(e,A),A},Yd=function(e,t,o){var r=Kd(e,o),n=r.borderBoxSize,i=r.contentBoxSize,a=r.devicePixelContentBoxSize;switch(t){case gn.DEVICE_PIXEL_CONTENT_BOX:return a;case gn.BORDER_BOX:return n;default:return i}},ub=function(){function e(t){var o=Kd(t);this.target=t,this.contentRect=o.contentRect,this.borderBoxSize=Qo([o.borderBoxSize]),this.contentBoxSize=Qo([o.contentBoxSize]),this.devicePixelContentBoxSize=Qo([o.devicePixelContentBoxSize])}return e}(),Xd=function(e){if(Gd(e))return 1/0;for(var t=0,o=e.parentNode;o;)t+=1,o=o.parentNode;return t},fb=function(){var e=1/0,t=[];Zo.forEach(function(a){if(a.activeTargets.length!==0){var l=[];a.activeTargets.forEach(function(c){var d=new ub(c.target),u=Xd(c.target);l.push(d),c.lastReportedSize=Yd(c.target,c.observedBox),ue?o.activeTargets.push(n):o.skippedTargets.push(n))})})},pb=function(){var e=0;for(ws(e);nb();)e=fb(),ws(e);return ib()&&ab(),e>0},ea,Jd=[],hb=function(){return Jd.splice(0).forEach(function(e){return e()})},gb=function(e){if(!ea){var t=0,o=document.createTextNode(""),r={characterData:!0};new MutationObserver(function(){return hb()}).observe(o,r),ea=function(){o.textContent="".concat(t?t--:t++)}}Jd.push(e),ea()},mb=function(e){gb(function(){requestAnimationFrame(e)})},ei=0,bb=function(){return!!ei},vb=250,xb={attributes:!0,characterData:!0,childList:!0,subtree:!0},Ps=["resize","load","transitionend","animationend","animationstart","animationiteration","keyup","keydown","mouseup","mousedown","mouseover","mouseout","blur","focus"],Ts=function(e){return e===void 0&&(e=0),Date.now()+e},ta=!1,Cb=function(){function e(){var t=this;this.stopped=!0,this.listener=function(){return t.schedule()}}return e.prototype.run=function(t){var o=this;if(t===void 0&&(t=vb),!ta){ta=!0;var r=Ts(t);mb(function(){var n=!1;try{n=pb()}finally{if(ta=!1,t=r-Ts(),!bb())return;n?o.run(1e3):t>0?o.run(t):o.start()}})}},e.prototype.schedule=function(){this.stop(),this.run()},e.prototype.observe=function(){var t=this,o=function(){return t.observer&&t.observer.observe(document.body,xb)};document.body?o():Zr.addEventListener("DOMContentLoaded",o)},e.prototype.start=function(){var t=this;this.stopped&&(this.stopped=!1,this.observer=new MutationObserver(this.listener),this.observe(),Ps.forEach(function(o){return Zr.addEventListener(o,t.listener,!0)}))},e.prototype.stop=function(){var t=this;this.stopped||(this.observer&&this.observer.disconnect(),Ps.forEach(function(o){return Zr.removeEventListener(o,t.listener,!0)}),this.stopped=!0)},e}(),Ra=new Cb,$s=function(e){!ei&&e>0&&Ra.start(),ei+=e,!ei&&Ra.stop()},yb=function(e){return!ul(e)&&!sb(e)&&getComputedStyle(e).display==="inline"},Sb=function(){function e(t,o){this.target=t,this.observedBox=o||gn.CONTENT_BOX,this.lastReportedSize={inlineSize:0,blockSize:0}}return e.prototype.isActive=function(){var t=Yd(this.target,this.observedBox,!0);return yb(this.target)&&(this.lastReportedSize=t),this.lastReportedSize.inlineSize!==t.inlineSize||this.lastReportedSize.blockSize!==t.blockSize},e}(),wb=function(){function e(t,o){this.activeTargets=[],this.skippedTargets=[],this.observationTargets=[],this.observer=t,this.callback=o}return e}(),Nn=new WeakMap,Rs=function(e,t){for(var o=0;o=0&&(i&&Zo.splice(Zo.indexOf(r),1),r.observationTargets.splice(n,1),$s(-1))},e.disconnect=function(t){var o=this,r=Nn.get(t);r.observationTargets.slice().forEach(function(n){return o.unobserve(t,n.target)}),r.activeTargets.splice(0,r.activeTargets.length)},e}(),Pb=function(){function e(t){if(arguments.length===0)throw new TypeError("Failed to construct 'ResizeObserver': 1 argument required, but only 0 present.");if(typeof t!="function")throw new TypeError("Failed to construct 'ResizeObserver': The callback provided as parameter 1 is not a function.");Vn.connect(this,t)}return e.prototype.observe=function(t,o){if(arguments.length===0)throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'observe' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.observe(this,t,o)},e.prototype.unobserve=function(t){if(arguments.length===0)throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': 1 argument required, but only 0 present.");if(!Cs(t))throw new TypeError("Failed to execute 'unobserve' on 'ResizeObserver': parameter 1 is not of type 'Element");Vn.unobserve(this,t)},e.prototype.disconnect=function(){Vn.disconnect(this)},e.toString=function(){return"function ResizeObserver () { [polyfill code] }"},e}();class Tb{constructor(){this.handleResize=this.handleResize.bind(this),this.observer=new(typeof window<"u"&&window.ResizeObserver||Pb)(this.handleResize),this.elHandlersMap=new Map}handleResize(t){for(const o of t){const r=this.elHandlersMap.get(o.target);r!==void 0&&r(o)}}registerHandler(t,o){this.elHandlersMap.set(t,o),this.observer.observe(t)}unregisterHandler(t){this.elHandlersMap.has(t)&&(this.elHandlersMap.delete(t),this.observer.unobserve(t))}}const Fs=new Tb,Fa=He({name:"ResizeObserver",props:{onResize:Function},setup(e){let t=!1;const o=Sn().proxy;function r(n){const{onResize:i}=e;i!==void 0&&i(n)}Mo(()=>{const n=o.$el;if(n===void 0){vs("resize-observer","$el does not exist.");return}if(n.nextElementSibling!==n.nextSibling&&n.nodeType===3&&n.nodeValue!==""){vs("resize-observer","$el can not be observed (it may be a text node).");return}n.nextElementSibling!==null&&(Fs.registerHandler(n.nextElementSibling,r),t=!0)}),nr(()=>{t&&Fs.unregisterHandler(o.$el.nextElementSibling)})},render(){return vh(this.$slots,"default")}});function As(e){return e.replace(/#|\(|\)|,|\s|\./g,"_")}const $b=/^(\d|\.)+$/,Is=/(\d|\.)+/;function oa(e,{c:t=1,offset:o=0,attachPx:r=!0}={}){if(typeof e=="number"){const n=(e+o)*t;return n===0?"0":`${n}px`}else if(typeof e=="string")if($b.test(e)){const n=(Number(e)+o)*t;return r?n===0?"0":`${n}px`:`${n}`}else{const n=Is.exec(e);return n?e.replace(Is,String((Number(n[0])+o)*t)):e}return e}function _s(e){const{left:t,right:o,top:r,bottom:n}=Vo(e);return`${r} ${t} ${n} ${o}`}function Aa(e,t){console.error(`[naive/${e}]: ${t}`)}function Rb(e,t){throw new Error(`[naive/${e}]: ${t}`)}function Ke(e,...t){if(Array.isArray(e))e.forEach(o=>Ke(o,...t));else return e(...t)}function Es(e){return Object.keys(e)}function Fb(e,t=[],o){const r={};return Object.getOwnPropertyNames(e).forEach(i=>{t.includes(i)||(r[i]=e[i])}),Object.assign(r,o)}function Ab(e,...t){return typeof e=="function"?e(...t):typeof e=="string"?xa(e):typeof e=="number"?xa(String(e)):null}function kt(e){return e.some(t=>Cr(t)?!(t.type===pt||t.type===et&&!kt(t.children)):!0)?e:null}function Qr(e,t){return e&&kt(e())||t()}function Ib(e,t,o){return e&&kt(e(t))||o(t)}function $t(e,t){const o=e&&kt(e());return t(o||null)}function _b(e){return!(e&&kt(e()))}const Ms=He({render(){var e,t;return(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e)}}),Qt="n-config-provider",pi="n";function zo(e={},t={defaultBordered:!0}){const o=Le(Qt,null);return{inlineThemeDisabled:o==null?void 0:o.inlineThemeDisabled,mergedRtlRef:o==null?void 0:o.mergedRtlRef,mergedComponentPropsRef:o==null?void 0:o.mergedComponentPropsRef,mergedBreakpointsRef:o==null?void 0:o.mergedBreakpointsRef,mergedBorderedRef:Y(()=>{var r,n;const{bordered:i}=e;return i!==void 0?i:(n=(r=o==null?void 0:o.mergedBorderedRef.value)!==null&&r!==void 0?r:t.defaultBordered)!==null&&n!==void 0?n:!0}),mergedClsPrefixRef:o?o.mergedClsPrefixRef:Ac(pi),namespaceRef:Y(()=>o==null?void 0:o.mergedNamespaceRef.value)}}function bP(){const e=Le(Qt,null);return e?e.mergedClsPrefixRef:Ac(pi)}function Fr(e,t,o,r){o||Rb("useThemeClass","cssVarsRef is not passed");const n=Le(Qt,null),i=n==null?void 0:n.mergedThemeHashRef,a=n==null?void 0:n.styleMountTarget,l=fe(""),s=_i();let c;const d=`__${e}`,u=()=>{let p=d;const m=t?t.value:void 0,f=i==null?void 0:i.value;f&&(p+=`-${f}`),m&&(p+=`-${m}`);const{themeOverrides:g,builtinThemeOverrides:S}=r;g&&(p+=`-${fn(JSON.stringify(g))}`),S&&(p+=`-${fn(JSON.stringify(S))}`),l.value=p,c=()=>{const v=o.value;let $="";for(const T in v)$+=`${T}: ${v[T]};`;L(`.${p}`,$).mount({id:p,ssr:s,parent:a}),c=void 0}};return sn(()=>{u()}),{themeClass:l,onRender:()=>{c==null||c()}}}const Ia="n-form-item";function Zd(e,{defaultSize:t="medium",mergedSize:o,mergedDisabled:r}={}){const n=Le(Ia,null);po(Ia,null);const i=Y(o?()=>o(n):()=>{const{size:s}=e;if(s)return s;if(n){const{mergedSize:c}=n;if(c.value!==void 0)return c.value}return t}),a=Y(r?()=>r(n):()=>{const{disabled:s}=e;return s!==void 0?s:n?n.disabled.value:!1}),l=Y(()=>{const{status:s}=e;return s||(n==null?void 0:n.mergedValidationStatus.value)});return nr(()=>{n&&n.restoreValidation()}),{mergedSizeRef:i,mergedDisabledRef:a,mergedStatusRef:l,nTriggerFormBlur(){n&&n.handleContentBlur()},nTriggerFormChange(){n&&n.handleContentChange()},nTriggerFormFocus(){n&&n.handleContentFocus()},nTriggerFormInput(){n&&n.handleContentInput()}}}const Qd={name:"en-US",global:{undo:"Undo",redo:"Redo",confirm:"Confirm",clear:"Clear"},Popconfirm:{positiveText:"Confirm",negativeText:"Cancel"},Cascader:{placeholder:"Please Select",loading:"Loading",loadingRequiredMessage:e=>`Please load all ${e}'s descendants before checking it.`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w",clear:"Clear",now:"Now",confirm:"Confirm",selectTime:"Select Time",selectDate:"Select Date",datePlaceholder:"Select Date",datetimePlaceholder:"Select Date and Time",monthPlaceholder:"Select Month",yearPlaceholder:"Select Year",quarterPlaceholder:"Select Quarter",weekPlaceholder:"Select Week",startDatePlaceholder:"Start Date",endDatePlaceholder:"End Date",startDatetimePlaceholder:"Start Date and Time",endDatetimePlaceholder:"End Date and Time",startMonthPlaceholder:"Start Month",endMonthPlaceholder:"End Month",monthBeforeYear:!0,firstDayOfWeek:6,today:"Today"},DataTable:{checkTableAll:"Select all in the table",uncheckTableAll:"Unselect all in the table",confirm:"Confirm",clear:"Clear"},LegacyTransfer:{sourceTitle:"Source",targetTitle:"Target"},Transfer:{selectAll:"Select all",unselectAll:"Unselect all",clearAll:"Clear",total:e=>`Total ${e} items`,selected:e=>`${e} items selected`},Empty:{description:"No Data"},Select:{placeholder:"Please Select"},TimePicker:{placeholder:"Select Time",positiveText:"OK",negativeText:"Cancel",now:"Now",clear:"Clear"},Pagination:{goto:"Goto",selectionSuffix:"page"},DynamicTags:{add:"Add"},Log:{loading:"Loading"},Input:{placeholder:"Please Input"},InputNumber:{placeholder:"Please Input"},DynamicInput:{create:"Create"},ThemeEditor:{title:"Theme Editor",clearAllVars:"Clear All Variables",clearSearch:"Clear Search",filterCompName:"Filter Component Name",filterVarName:"Filter Variable Name",import:"Import",export:"Export",restore:"Reset to Default"},Image:{tipPrevious:"Previous picture (←)",tipNext:"Next picture (→)",tipCounterclockwise:"Counterclockwise",tipClockwise:"Clockwise",tipZoomOut:"Zoom out",tipZoomIn:"Zoom in",tipDownload:"Download",tipClose:"Close (Esc)",tipOriginalSize:"Zoom to original size"}},Eb={name:"zh-CN",global:{undo:"撤销",redo:"重做",confirm:"确认",clear:"清除"},Popconfirm:{positiveText:"确认",negativeText:"取消"},Cascader:{placeholder:"请选择",loading:"加载中",loadingRequiredMessage:e=>`加载全部 ${e} 的子节点后才可选中`},Time:{dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss"},DatePicker:{yearFormat:"yyyy年",monthFormat:"MMM",dayFormat:"eeeeee",yearTypeFormat:"yyyy",monthTypeFormat:"yyyy-MM",dateFormat:"yyyy-MM-dd",dateTimeFormat:"yyyy-MM-dd HH:mm:ss",quarterFormat:"yyyy-qqq",weekFormat:"YYYY-w周",clear:"清除",now:"此刻",confirm:"确认",selectTime:"选择时间",selectDate:"选择日期",datePlaceholder:"选择日期",datetimePlaceholder:"选择日期时间",monthPlaceholder:"选择月份",yearPlaceholder:"选择年份",quarterPlaceholder:"选择季度",weekPlaceholder:"选择周",startDatePlaceholder:"开始日期",endDatePlaceholder:"结束日期",startDatetimePlaceholder:"开始日期时间",endDatetimePlaceholder:"结束日期时间",startMonthPlaceholder:"开始月份",endMonthPlaceholder:"结束月份",monthBeforeYear:!1,firstDayOfWeek:0,today:"今天"},DataTable:{checkTableAll:"选择全部表格数据",uncheckTableAll:"取消选择全部表格数据",confirm:"确认",clear:"重置"},LegacyTransfer:{sourceTitle:"源项",targetTitle:"目标项"},Transfer:{selectAll:"全选",clearAll:"清除",unselectAll:"取消全选",total:e=>`共 ${e} 项`,selected:e=>`已选 ${e} 项`},Empty:{description:"无数据"},Select:{placeholder:"请选择"},TimePicker:{placeholder:"请选择时间",positiveText:"确认",negativeText:"取消",now:"此刻",clear:"清除"},Pagination:{goto:"跳至",selectionSuffix:"页"},DynamicTags:{add:"添加"},Log:{loading:"加载中"},Input:{placeholder:"请输入"},InputNumber:{placeholder:"请输入"},DynamicInput:{create:"添加"},ThemeEditor:{title:"主题编辑器",clearAllVars:"清除全部变量",clearSearch:"清除搜索",filterCompName:"过滤组件名",filterVarName:"过滤变量名",import:"导入",export:"导出",restore:"恢复默认"},Image:{tipPrevious:"上一张(←)",tipNext:"下一张(→)",tipCounterclockwise:"向左旋转",tipClockwise:"向右旋转",tipZoomOut:"缩小",tipZoomIn:"放大",tipDownload:"下载",tipClose:"关闭(Esc)",tipOriginalSize:"缩放到原始尺寸"}};function xr(e){return(t={})=>{const o=t.width?String(t.width):e.defaultWidth;return e.formats[o]||e.formats[e.defaultWidth]}}function Yt(e){return(t,o)=>{const r=o!=null&&o.context?String(o.context):"standalone";let n;if(r==="formatting"&&e.formattingValues){const a=e.defaultFormattingWidth||e.defaultWidth,l=o!=null&&o.width?String(o.width):a;n=e.formattingValues[l]||e.formattingValues[a]}else{const a=e.defaultWidth,l=o!=null&&o.width?String(o.width):e.defaultWidth;n=e.values[l]||e.values[a]}const i=e.argumentCallback?e.argumentCallback(t):t;return n[i]}}function Xt(e){return(t,o={})=>{const r=o.width,n=r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth],i=t.match(n);if(!i)return null;const a=i[0],l=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],s=Array.isArray(l)?zb(l,u=>u.test(a)):Mb(l,u=>u.test(a));let c;c=e.valueCallback?e.valueCallback(s):s,c=o.valueCallback?o.valueCallback(c):c;const d=t.slice(a.length);return{value:c,rest:d}}}function Mb(e,t){for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)&&t(e[o]))return o}function zb(e,t){for(let o=0;o{const r=t.match(e.matchPattern);if(!r)return null;const n=r[0],i=t.match(e.parsePattern);if(!i)return null;let a=e.valueCallback?e.valueCallback(i[0]):i[0];a=o.valueCallback?o.valueCallback(a):a;const l=t.slice(n.length);return{value:a,rest:l}}}function Hb(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}let kb={};function Db(){return kb}function zs(e,t){var l,s,c,d;const o=Db(),r=(t==null?void 0:t.weekStartsOn)??((s=(l=t==null?void 0:t.locale)==null?void 0:l.options)==null?void 0:s.weekStartsOn)??o.weekStartsOn??((d=(c=o.locale)==null?void 0:c.options)==null?void 0:d.weekStartsOn)??0,n=Hb(e),i=n.getDay(),a=(i{let r;const n=Bb[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",t.toString()),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?"in "+r:r+" ago":r},Wb={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},jb=(e,t,o,r)=>Wb[e],Nb={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},Vb={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},Ub={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},qb={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},Gb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},Kb={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},Yb=(e,t)=>{const o=Number(e),r=o%100;if(r>20||r<10)switch(r%10){case 1:return o+"st";case 2:return o+"nd";case 3:return o+"rd"}return o+"th"},Xb={ordinalNumber:Yb,era:Yt({values:Nb,defaultWidth:"wide"}),quarter:Yt({values:Vb,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Ub,defaultWidth:"wide"}),day:Yt({values:qb,defaultWidth:"wide"}),dayPeriod:Yt({values:Gb,defaultWidth:"wide",formattingValues:Kb,defaultFormattingWidth:"wide"})},Jb=/^(\d+)(th|st|nd|rd)?/i,Zb=/\d+/i,Qb={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},ev={any:[/^b/i,/^(a|c)/i]},tv={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},ov={any:[/1/i,/2/i,/3/i,/4/i]},rv={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},nv={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},iv={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},av={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},lv={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},sv={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},cv={ordinalNumber:eu({matchPattern:Jb,parsePattern:Zb,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Qb,defaultMatchWidth:"wide",parsePatterns:ev,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:tv,defaultMatchWidth:"wide",parsePatterns:ov,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:rv,defaultMatchWidth:"wide",parsePatterns:nv,defaultParseWidth:"any"}),day:Xt({matchPatterns:iv,defaultMatchWidth:"wide",parsePatterns:av,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:lv,defaultMatchWidth:"any",parsePatterns:sv,defaultParseWidth:"any"})},dv={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},uv={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},fv={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},pv={date:xr({formats:dv,defaultWidth:"full"}),time:xr({formats:uv,defaultWidth:"full"}),dateTime:xr({formats:fv,defaultWidth:"full"})},hv={code:"en-US",formatDistance:Lb,formatLong:pv,formatRelative:jb,localize:Xb,match:cv,options:{weekStartsOn:0,firstWeekContainsDate:1}},gv={lessThanXSeconds:{one:"不到 1 秒",other:"不到 {{count}} 秒"},xSeconds:{one:"1 秒",other:"{{count}} 秒"},halfAMinute:"半分钟",lessThanXMinutes:{one:"不到 1 分钟",other:"不到 {{count}} 分钟"},xMinutes:{one:"1 分钟",other:"{{count}} 分钟"},xHours:{one:"1 小时",other:"{{count}} 小时"},aboutXHours:{one:"大约 1 小时",other:"大约 {{count}} 小时"},xDays:{one:"1 天",other:"{{count}} 天"},aboutXWeeks:{one:"大约 1 个星期",other:"大约 {{count}} 个星期"},xWeeks:{one:"1 个星期",other:"{{count}} 个星期"},aboutXMonths:{one:"大约 1 个月",other:"大约 {{count}} 个月"},xMonths:{one:"1 个月",other:"{{count}} 个月"},aboutXYears:{one:"大约 1 年",other:"大约 {{count}} 年"},xYears:{one:"1 年",other:"{{count}} 年"},overXYears:{one:"超过 1 年",other:"超过 {{count}} 年"},almostXYears:{one:"将近 1 年",other:"将近 {{count}} 年"}},mv=(e,t,o)=>{let r;const n=gv[e];return typeof n=="string"?r=n:t===1?r=n.one:r=n.other.replace("{{count}}",String(t)),o!=null&&o.addSuffix?o.comparison&&o.comparison>0?r+"内":r+"前":r},bv={full:"y'年'M'月'd'日' EEEE",long:"y'年'M'月'd'日'",medium:"yyyy-MM-dd",short:"yy-MM-dd"},vv={full:"zzzz a h:mm:ss",long:"z a h:mm:ss",medium:"a h:mm:ss",short:"a h:mm"},xv={full:"{{date}} {{time}}",long:"{{date}} {{time}}",medium:"{{date}} {{time}}",short:"{{date}} {{time}}"},Cv={date:xr({formats:bv,defaultWidth:"full"}),time:xr({formats:vv,defaultWidth:"full"}),dateTime:xr({formats:xv,defaultWidth:"full"})};function Hs(e,t,o){const r="eeee p";return Ob(e,t,o)?r:e.getTime()>t.getTime()?"'下个'"+r:"'上个'"+r}const yv={lastWeek:Hs,yesterday:"'昨天' p",today:"'今天' p",tomorrow:"'明天' p",nextWeek:Hs,other:"PP p"},Sv=(e,t,o,r)=>{const n=yv[e];return typeof n=="function"?n(t,o,r):n},wv={narrow:["前","公元"],abbreviated:["前","公元"],wide:["公元前","公元"]},Pv={narrow:["1","2","3","4"],abbreviated:["第一季","第二季","第三季","第四季"],wide:["第一季度","第二季度","第三季度","第四季度"]},Tv={narrow:["一","二","三","四","五","六","七","八","九","十","十一","十二"],abbreviated:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],wide:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},$v={narrow:["日","一","二","三","四","五","六"],short:["日","一","二","三","四","五","六"],abbreviated:["周日","周一","周二","周三","周四","周五","周六"],wide:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"]},Rv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Fv={narrow:{am:"上",pm:"下",midnight:"凌晨",noon:"午",morning:"早",afternoon:"下午",evening:"晚",night:"夜"},abbreviated:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"},wide:{am:"上午",pm:"下午",midnight:"凌晨",noon:"中午",morning:"早晨",afternoon:"中午",evening:"晚上",night:"夜间"}},Av=(e,t)=>{const o=Number(e);switch(t==null?void 0:t.unit){case"date":return o.toString()+"日";case"hour":return o.toString()+"时";case"minute":return o.toString()+"分";case"second":return o.toString()+"秒";default:return"第 "+o.toString()}},Iv={ordinalNumber:Av,era:Yt({values:wv,defaultWidth:"wide"}),quarter:Yt({values:Pv,defaultWidth:"wide",argumentCallback:e=>e-1}),month:Yt({values:Tv,defaultWidth:"wide"}),day:Yt({values:$v,defaultWidth:"wide"}),dayPeriod:Yt({values:Rv,defaultWidth:"wide",formattingValues:Fv,defaultFormattingWidth:"wide"})},_v=/^(第\s*)?\d+(日|时|分|秒)?/i,Ev=/\d+/i,Mv={narrow:/^(前)/i,abbreviated:/^(前)/i,wide:/^(公元前|公元)/i},zv={any:[/^(前)/i,/^(公元)/i]},Hv={narrow:/^[1234]/i,abbreviated:/^第[一二三四]刻/i,wide:/^第[一二三四]刻钟/i},kv={any:[/(1|一)/i,/(2|二)/i,/(3|三)/i,/(4|四)/i]},Dv={narrow:/^(一|二|三|四|五|六|七|八|九|十[二一])/i,abbreviated:/^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,wide:/^(一|二|三|四|五|六|七|八|九|十[二一])月/i},Ov={narrow:[/^一/i,/^二/i,/^三/i,/^四/i,/^五/i,/^六/i,/^七/i,/^八/i,/^九/i,/^十(?!(一|二))/i,/^十一/i,/^十二/i],any:[/^一|1/i,/^二|2/i,/^三|3/i,/^四|4/i,/^五|5/i,/^六|6/i,/^七|7/i,/^八|8/i,/^九|9/i,/^十(?!(一|二))|10/i,/^十一|11/i,/^十二|12/i]},Bv={narrow:/^[一二三四五六日]/i,short:/^[一二三四五六日]/i,abbreviated:/^周[一二三四五六日]/i,wide:/^星期[一二三四五六日]/i},Lv={any:[/日/i,/一/i,/二/i,/三/i,/四/i,/五/i,/六/i]},Wv={any:/^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i},jv={any:{am:/^上午?/i,pm:/^下午?/i,midnight:/^午夜/i,noon:/^[中正]午/i,morning:/^早上/i,afternoon:/^下午/i,evening:/^晚上?/i,night:/^凌晨/i}},Nv={ordinalNumber:eu({matchPattern:_v,parsePattern:Ev,valueCallback:e=>parseInt(e,10)}),era:Xt({matchPatterns:Mv,defaultMatchWidth:"wide",parsePatterns:zv,defaultParseWidth:"any"}),quarter:Xt({matchPatterns:Hv,defaultMatchWidth:"wide",parsePatterns:kv,defaultParseWidth:"any",valueCallback:e=>e+1}),month:Xt({matchPatterns:Dv,defaultMatchWidth:"wide",parsePatterns:Ov,defaultParseWidth:"any"}),day:Xt({matchPatterns:Bv,defaultMatchWidth:"wide",parsePatterns:Lv,defaultParseWidth:"any"}),dayPeriod:Xt({matchPatterns:Wv,defaultMatchWidth:"any",parsePatterns:jv,defaultParseWidth:"any"})},Vv={code:"zh-CN",formatDistance:mv,formatLong:Cv,formatRelative:Sv,localize:Iv,match:Nv,options:{weekStartsOn:1,firstWeekContainsDate:4}},tu={name:"en-US",locale:hv},Uv={name:"zh-CN",locale:Vv};var ou=typeof global=="object"&&global&&global.Object===Object&&global,qv=typeof self=="object"&&self&&self.Object===Object&&self,Ar=ou||qv||Function("return this")(),wr=Ar.Symbol,ru=Object.prototype,Gv=ru.hasOwnProperty,Kv=ru.toString,jr=wr?wr.toStringTag:void 0;function Yv(e){var t=Gv.call(e,jr),o=e[jr];try{e[jr]=void 0;var r=!0}catch{}var n=Kv.call(e);return r&&(t?e[jr]=o:delete e[jr]),n}var Xv=Object.prototype,Jv=Xv.toString;function Zv(e){return Jv.call(e)}var Qv="[object Null]",e0="[object Undefined]",ks=wr?wr.toStringTag:void 0;function Tn(e){return e==null?e===void 0?e0:Qv:ks&&ks in Object(e)?Yv(e):Zv(e)}function Ir(e){return e!=null&&typeof e=="object"}var t0="[object Symbol]";function fl(e){return typeof e=="symbol"||Ir(e)&&Tn(e)==t0}function o0(e,t){for(var o=-1,r=e==null?0:e.length,n=Array(r);++o0){if(++t>=w0)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function R0(e){return function(){return e}}var hi=function(){try{var e=hl(Object,"defineProperty");return e({},"",{}),e}catch{}}(),F0=hi?function(e,t){return hi(e,"toString",{configurable:!0,enumerable:!1,value:R0(t),writable:!0})}:iu,A0=$0(F0),I0=9007199254740991,_0=/^(?:0|[1-9]\d*)$/;function au(e,t){var o=typeof e;return t=t??I0,!!t&&(o=="number"||o!="symbol"&&_0.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=O0}function ml(e){return e!=null&&lu(e.length)&&!pl(e)}function B0(e,t,o){if(!ir(o))return!1;var r=typeof t;return(r=="number"?ml(o)&&au(t,o.length):r=="string"&&t in o)?Ei(o[t],e):!1}function L0(e){return D0(function(t,o){var r=-1,n=o.length,i=n>1?o[n-1]:void 0,a=n>2?o[2]:void 0;for(i=e.length>3&&typeof i=="function"?(n--,i):void 0,a&&B0(o[0],o[1],a)&&(i=n<3?void 0:i,n=1),t=Object(t);++r-1}function Xx(e,t){var o=this.__data__,r=Mi(o,e);return r<0?(++this.size,o.push([e,t])):o[r][1]=t,this}function mo(e){var t=-1,o=e==null?0:e.length;for(this.clear();++tn?0:n+t),o=o>n?n:o,o<0&&(o+=n),n=t>o?0:o-t>>>0,t>>>=0;for(var i=Array(n);++r=r?e:vC(e,t,o)}var CC="\\ud800-\\udfff",yC="\\u0300-\\u036f",SC="\\ufe20-\\ufe2f",wC="\\u20d0-\\u20ff",PC=yC+SC+wC,TC="\\ufe0e\\ufe0f",$C="\\u200d",RC=RegExp("["+$C+CC+PC+TC+"]");function Cu(e){return RC.test(e)}function FC(e){return e.split("")}var yu="\\ud800-\\udfff",AC="\\u0300-\\u036f",IC="\\ufe20-\\ufe2f",_C="\\u20d0-\\u20ff",EC=AC+IC+_C,MC="\\ufe0e\\ufe0f",zC="["+yu+"]",Ea="["+EC+"]",Ma="\\ud83c[\\udffb-\\udfff]",HC="(?:"+Ea+"|"+Ma+")",Su="[^"+yu+"]",wu="(?:\\ud83c[\\udde6-\\uddff]){2}",Pu="[\\ud800-\\udbff][\\udc00-\\udfff]",kC="\\u200d",Tu=HC+"?",$u="["+MC+"]?",DC="(?:"+kC+"(?:"+[Su,wu,Pu].join("|")+")"+$u+Tu+")*",OC=$u+Tu+DC,BC="(?:"+[Su+Ea+"?",Ea,wu,Pu,zC].join("|")+")",LC=RegExp(Ma+"(?="+Ma+")|"+BC+OC,"g");function WC(e){return e.match(LC)||[]}function jC(e){return Cu(e)?WC(e):FC(e)}function NC(e){return function(t){t=mu(t);var o=Cu(t)?jC(t):void 0,r=o?o[0]:t.charAt(0),n=o?xC(o,1).join(""):t.slice(1);return r[e]()+n}}var VC=NC("toUpperCase");function UC(){this.__data__=new mo,this.size=0}function qC(e){var t=this.__data__,o=t.delete(e);return this.size=t.size,o}function GC(e){return this.__data__.get(e)}function KC(e){return this.__data__.has(e)}var YC=200;function XC(e,t){var o=this.__data__;if(o instanceof mo){var r=o.__data__;if(!gu||r.length{var i,a;return(a=(i=t==null?void 0:t.value)===null||i===void 0?void 0:i[e])!==null&&a!==void 0?a:Qd[e]});return{dateLocaleRef:Y(()=>{var i;return(i=o==null?void 0:o.value)!==null&&i!==void 0?i:tu}),localeRef:r}}const bn="naive-ui-style";function $n(e,t,o){if(!t)return;const r=_i(),n=Y(()=>{const{value:l}=t;if(!l)return;const s=l[e];if(s)return s}),i=Le(Qt,null),a=()=>{sn(()=>{const{value:l}=o,s=`${l}${e}Rtl`;if(wm(s,r))return;const{value:c}=n;c&&c.style.mount({id:s,head:!0,anchorMetaName:bn,props:{bPrefix:l?`.${l}-`:void 0},ssr:r,parent:i==null?void 0:i.styleMountTarget})})};return r?a():Pi(a),n}const ko={fontFamily:'v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',fontFamilyMono:"v-mono, SFMono-Regular, Menlo, Consolas, Courier, monospace",fontWeight:"400",fontWeightStrong:"500",cubicBezierEaseInOut:"cubic-bezier(.4, 0, .2, 1)",cubicBezierEaseOut:"cubic-bezier(0, 0, .2, 1)",cubicBezierEaseIn:"cubic-bezier(.4, 0, 1, 1)",borderRadius:"3px",borderRadiusSmall:"2px",fontSize:"14px",fontSizeMini:"12px",fontSizeTiny:"12px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",lineHeight:"1.6",heightMini:"16px",heightTiny:"22px",heightSmall:"28px",heightMedium:"34px",heightLarge:"40px",heightHuge:"46px"},{fontSize:sy,fontFamily:cy,lineHeight:dy}=ko,Au=L("body",` margin: 0; font-size: ${sy}; font-family: ${cy}; @@ -40,7 +40,7 @@ ${t} `,[L("input",` font-family: inherit; font-size: inherit; - `)]);function Mr(e,t,o){if(!t)return;const r=zi(),n=Le(Qt,null),i=()=>{const a=o.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:bn,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:n==null?void 0:n.styleMountTarget}),n!=null&&n.preflightStyleDisabled||_u.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:r,parent:n==null?void 0:n.styleMountTarget})};r?i():Pi(i)}function vP(e){return e}function Ct(e,t,o,r,n,i){const a=zi(),l=Le(Qt,null);if(o){const c=()=>{const d=i==null?void 0:i.value;o.mount({id:d===void 0?t:d+t,head:!0,props:{bPrefix:d?`.${d}-`:void 0},anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||_u.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?c():Pi(c)}return Y(()=>{var c;const{theme:{common:d,self:u,peers:p={}}={},themeOverrides:m={},builtinThemeOverrides:f={}}=n,{common:g,peers:S}=m,{common:v=void 0,[e]:{common:$=void 0,self:T=void 0,peers:w={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:z=void 0,[e]:B={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:F={}}=B,R=Vr({},d||$||v||r.common,z,x,g),O=Vr((c=u||T||r.self)===null||c===void 0?void 0:c(R),f,B,m);return{common:R,self:O,peers:Vr({},r.peers,w,p),peerOverrides:Vr({},f.peers,F,S)}})}Ct.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const uy=pe("base-icon",` + `)]);function Er(e,t,o){if(!t)return;const r=_i(),n=Le(Qt,null),i=()=>{const a=o.value;t.mount({id:a===void 0?e:a+e,head:!0,anchorMetaName:bn,props:{bPrefix:a?`.${a}-`:void 0},ssr:r,parent:n==null?void 0:n.styleMountTarget}),n!=null&&n.preflightStyleDisabled||Au.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:r,parent:n==null?void 0:n.styleMountTarget})};r?i():Pi(i)}function vP(e){return e}function Ct(e,t,o,r,n,i){const a=_i(),l=Le(Qt,null);if(o){const c=()=>{const d=i==null?void 0:i.value;o.mount({id:d===void 0?t:d+t,head:!0,props:{bPrefix:d?`.${d}-`:void 0},anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget}),l!=null&&l.preflightStyleDisabled||Au.mount({id:"n-global",head:!0,anchorMetaName:bn,ssr:a,parent:l==null?void 0:l.styleMountTarget})};a?c():Pi(c)}return Y(()=>{var c;const{theme:{common:d,self:u,peers:p={}}={},themeOverrides:m={},builtinThemeOverrides:f={}}=n,{common:g,peers:S}=m,{common:v=void 0,[e]:{common:$=void 0,self:T=void 0,peers:w={}}={}}=(l==null?void 0:l.mergedThemeRef.value)||{},{common:_=void 0,[e]:O={}}=(l==null?void 0:l.mergedThemeOverridesRef.value)||{},{common:x,peers:F={}}=O,R=Vr({},d||$||v||r.common,_,x,g),B=Vr((c=u||T||r.self)===null||c===void 0?void 0:c(R),f,O,m);return{common:R,self:B,peers:Vr({},r.peers,w,p),peerOverrides:Vr({},f.peers,F,S)}})}Ct.props={theme:Object,themeOverrides:Object,builtinThemeOverrides:Object};const uy=pe("base-icon",` height: 1em; width: 1em; line-height: 1em; @@ -52,7 +52,7 @@ ${t} `,[L("svg",` height: 1em; width: 1em; - `)]),Tr=He({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Mr("-base-icon",uy,Dt(e,"clsPrefix"))},render(){return y("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),Hi=He({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const o=Ym();return()=>y(un,{name:"icon-switch-transition",appear:o.value},t)}});function Ir(e,t){const o=He({render(){return t()}});return He({name:VC(e),setup(){var r;const n=(r=Le(Qt,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var i;const a=(i=n==null?void 0:n.value)===null||i===void 0?void 0:i[e];return a?a():y(o,null)}}})}const fy=He({name:"ChevronDown",render(){return y("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),py=Ir("clear",()=>y("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),hy=Ir("close",()=>y("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),gy=Ir("error",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"}))))),my=He({name:"Eye",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),y("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),by=He({name:"EyeOff",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),y("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),y("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),y("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),y("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),vy=Ir("info",()=>y("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"}))))),xy=Ir("success",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),Cy=Ir("warning",()=>y("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),{cubicBezierEaseInOut:yy}=ko;function vn({originalTransform:e="",left:t=0,top:o=0,transition:r=`all .3s ${yy} !important`}={}){return[L("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:o,opacity:0}),L("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:o,opacity:1}),L("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:o,transition:r})]}const Sy=pe("base-clear",` + `)]),Tr=He({name:"BaseIcon",props:{role:String,ariaLabel:String,ariaDisabled:{type:Boolean,default:void 0},ariaHidden:{type:Boolean,default:void 0},clsPrefix:{type:String,required:!0},onClick:Function,onMousedown:Function,onMouseup:Function},setup(e){Er("-base-icon",uy,Dt(e,"clsPrefix"))},render(){return y("i",{class:`${this.clsPrefix}-base-icon`,onClick:this.onClick,onMousedown:this.onMousedown,onMouseup:this.onMouseup,role:this.role,"aria-label":this.ariaLabel,"aria-hidden":this.ariaHidden,"aria-disabled":this.ariaDisabled},this.$slots)}}),Hi=He({name:"BaseIconSwitchTransition",setup(e,{slots:t}){const o=Ym();return()=>y(un,{name:"icon-switch-transition",appear:o.value},t)}});function Mr(e,t){const o=He({render(){return t()}});return He({name:VC(e),setup(){var r;const n=(r=Le(Qt,null))===null||r===void 0?void 0:r.mergedIconsRef;return()=>{var i;const a=(i=n==null?void 0:n.value)===null||i===void 0?void 0:i[e];return a?a():y(o,null)}}})}const fy=He({name:"ChevronDown",render(){return y("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg"},y("path",{d:"M3.14645 5.64645C3.34171 5.45118 3.65829 5.45118 3.85355 5.64645L8 9.79289L12.1464 5.64645C12.3417 5.45118 12.6583 5.45118 12.8536 5.64645C13.0488 5.84171 13.0488 6.15829 12.8536 6.35355L8.35355 10.8536C8.15829 11.0488 7.84171 11.0488 7.64645 10.8536L3.14645 6.35355C2.95118 6.15829 2.95118 5.84171 3.14645 5.64645Z",fill:"currentColor"}))}}),py=Mr("clear",()=>y("svg",{viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M8,2 C11.3137085,2 14,4.6862915 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,4.6862915 4.6862915,2 8,2 Z M6.5343055,5.83859116 C6.33943736,5.70359511 6.07001296,5.72288026 5.89644661,5.89644661 L5.89644661,5.89644661 L5.83859116,5.9656945 C5.70359511,6.16056264 5.72288026,6.42998704 5.89644661,6.60355339 L5.89644661,6.60355339 L7.293,8 L5.89644661,9.39644661 L5.83859116,9.4656945 C5.70359511,9.66056264 5.72288026,9.92998704 5.89644661,10.1035534 L5.89644661,10.1035534 L5.9656945,10.1614088 C6.16056264,10.2964049 6.42998704,10.2771197 6.60355339,10.1035534 L6.60355339,10.1035534 L8,8.707 L9.39644661,10.1035534 L9.4656945,10.1614088 C9.66056264,10.2964049 9.92998704,10.2771197 10.1035534,10.1035534 L10.1035534,10.1035534 L10.1614088,10.0343055 C10.2964049,9.83943736 10.2771197,9.57001296 10.1035534,9.39644661 L10.1035534,9.39644661 L8.707,8 L10.1035534,6.60355339 L10.1614088,6.5343055 C10.2964049,6.33943736 10.2771197,6.07001296 10.1035534,5.89644661 L10.1035534,5.89644661 L10.0343055,5.83859116 C9.83943736,5.70359511 9.57001296,5.72288026 9.39644661,5.89644661 L9.39644661,5.89644661 L8,7.293 L6.60355339,5.89644661 Z"}))))),hy=Mr("close",()=>y("svg",{viewBox:"0 0 12 12",version:"1.1",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0},y("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},y("g",{fill:"currentColor","fill-rule":"nonzero"},y("path",{d:"M2.08859116,2.2156945 L2.14644661,2.14644661 C2.32001296,1.97288026 2.58943736,1.95359511 2.7843055,2.08859116 L2.85355339,2.14644661 L6,5.293 L9.14644661,2.14644661 C9.34170876,1.95118446 9.65829124,1.95118446 9.85355339,2.14644661 C10.0488155,2.34170876 10.0488155,2.65829124 9.85355339,2.85355339 L6.707,6 L9.85355339,9.14644661 C10.0271197,9.32001296 10.0464049,9.58943736 9.91140884,9.7843055 L9.85355339,9.85355339 C9.67998704,10.0271197 9.41056264,10.0464049 9.2156945,9.91140884 L9.14644661,9.85355339 L6,6.707 L2.85355339,9.85355339 C2.65829124,10.0488155 2.34170876,10.0488155 2.14644661,9.85355339 C1.95118446,9.65829124 1.95118446,9.34170876 2.14644661,9.14644661 L5.293,6 L2.14644661,2.85355339 C1.97288026,2.67998704 1.95359511,2.41056264 2.08859116,2.2156945 L2.14644661,2.14644661 L2.08859116,2.2156945 Z"}))))),gy=Mr("error",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M17.8838835,16.1161165 L17.7823881,16.0249942 C17.3266086,15.6583353 16.6733914,15.6583353 16.2176119,16.0249942 L16.1161165,16.1161165 L16.0249942,16.2176119 C15.6583353,16.6733914 15.6583353,17.3266086 16.0249942,17.7823881 L16.1161165,17.8838835 L22.233,24 L16.1161165,30.1161165 L16.0249942,30.2176119 C15.6583353,30.6733914 15.6583353,31.3266086 16.0249942,31.7823881 L16.1161165,31.8838835 L16.2176119,31.9750058 C16.6733914,32.3416647 17.3266086,32.3416647 17.7823881,31.9750058 L17.8838835,31.8838835 L24,25.767 L30.1161165,31.8838835 L30.2176119,31.9750058 C30.6733914,32.3416647 31.3266086,32.3416647 31.7823881,31.9750058 L31.8838835,31.8838835 L31.9750058,31.7823881 C32.3416647,31.3266086 32.3416647,30.6733914 31.9750058,30.2176119 L31.8838835,30.1161165 L25.767,24 L31.8838835,17.8838835 L31.9750058,17.7823881 C32.3416647,17.3266086 32.3416647,16.6733914 31.9750058,16.2176119 L31.8838835,16.1161165 L31.7823881,16.0249942 C31.3266086,15.6583353 30.6733914,15.6583353 30.2176119,16.0249942 L30.1161165,16.1161165 L24,22.233 L17.8838835,16.1161165 L17.7823881,16.0249942 L17.8838835,16.1161165 Z"}))))),my=He({name:"Eye",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M255.66 112c-77.94 0-157.89 45.11-220.83 135.33a16 16 0 0 0-.27 17.77C82.92 340.8 161.8 400 255.66 400c92.84 0 173.34-59.38 221.79-135.25a16.14 16.14 0 0 0 0-17.47C428.89 172.28 347.8 112 255.66 112z",fill:"none",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"32"}),y("circle",{cx:"256",cy:"256",r:"80",fill:"none",stroke:"currentColor","stroke-miterlimit":"10","stroke-width":"32"}))}}),by=He({name:"EyeOff",render(){return y("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512"},y("path",{d:"M432 448a15.92 15.92 0 0 1-11.31-4.69l-352-352a16 16 0 0 1 22.62-22.62l352 352A16 16 0 0 1 432 448z",fill:"currentColor"}),y("path",{d:"M255.66 384c-41.49 0-81.5-12.28-118.92-36.5c-34.07-22-64.74-53.51-88.7-91v-.08c19.94-28.57 41.78-52.73 65.24-72.21a2 2 0 0 0 .14-2.94L93.5 161.38a2 2 0 0 0-2.71-.12c-24.92 21-48.05 46.76-69.08 76.92a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416a239.13 239.13 0 0 0 75.8-12.58a2 2 0 0 0 .77-3.31l-21.58-21.58a4 4 0 0 0-3.83-1a204.8 204.8 0 0 1-51.16 6.47z",fill:"currentColor"}),y("path",{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96a227.34 227.34 0 0 0-74.89 12.83a2 2 0 0 0-.75 3.31l21.55 21.55a4 4 0 0 0 3.88 1a192.82 192.82 0 0 1 50.21-6.69c40.69 0 80.58 12.43 118.55 37c34.71 22.4 65.74 53.88 89.76 91a.13.13 0 0 1 0 .16a310.72 310.72 0 0 1-64.12 72.73a2 2 0 0 0-.15 2.95l19.9 19.89a2 2 0 0 0 2.7.13a343.49 343.49 0 0 0 68.64-78.48a32.2 32.2 0 0 0-.1-34.78z",fill:"currentColor"}),y("path",{d:"M256 160a95.88 95.88 0 0 0-21.37 2.4a2 2 0 0 0-1 3.38l112.59 112.56a2 2 0 0 0 3.38-1A96 96 0 0 0 256 160z",fill:"currentColor"}),y("path",{d:"M165.78 233.66a2 2 0 0 0-3.38 1a96 96 0 0 0 115 115a2 2 0 0 0 1-3.38z",fill:"currentColor"}))}}),vy=Mr("info",()=>y("svg",{viewBox:"0 0 28 28",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M14,2 C20.6274,2 26,7.37258 26,14 C26,20.6274 20.6274,26 14,26 C7.37258,26 2,20.6274 2,14 C2,7.37258 7.37258,2 14,2 Z M14,11 C13.4477,11 13,11.4477 13,12 L13,12 L13,20 C13,20.5523 13.4477,21 14,21 C14.5523,21 15,20.5523 15,20 L15,20 L15,12 C15,11.4477 14.5523,11 14,11 Z M14,6.75 C13.3096,6.75 12.75,7.30964 12.75,8 C12.75,8.69036 13.3096,9.25 14,9.25 C14.6904,9.25 15.25,8.69036 15.25,8 C15.25,7.30964 14.6904,6.75 14,6.75 Z"}))))),xy=Mr("success",()=>y("svg",{viewBox:"0 0 48 48",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M24,4 C35.045695,4 44,12.954305 44,24 C44,35.045695 35.045695,44 24,44 C12.954305,44 4,35.045695 4,24 C4,12.954305 12.954305,4 24,4 Z M32.6338835,17.6161165 C32.1782718,17.1605048 31.4584514,17.1301307 30.9676119,17.5249942 L30.8661165,17.6161165 L20.75,27.732233 L17.1338835,24.1161165 C16.6457281,23.6279612 15.8542719,23.6279612 15.3661165,24.1161165 C14.9105048,24.5717282 14.8801307,25.2915486 15.2749942,25.7823881 L15.3661165,25.8838835 L19.8661165,30.3838835 C20.3217282,30.8394952 21.0415486,30.8698693 21.5323881,30.4750058 L21.6338835,30.3838835 L32.6338835,19.3838835 C33.1220388,18.8957281 33.1220388,18.1042719 32.6338835,17.6161165 Z"}))))),Cy=Mr("warning",()=>y("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},y("g",{stroke:"none","stroke-width":"1","fill-rule":"evenodd"},y("g",{"fill-rule":"nonzero"},y("path",{d:"M12,2 C17.523,2 22,6.478 22,12 C22,17.522 17.523,22 12,22 C6.477,22 2,17.522 2,12 C2,6.478 6.477,2 12,2 Z M12.0018002,15.0037242 C11.450254,15.0037242 11.0031376,15.4508407 11.0031376,16.0023869 C11.0031376,16.553933 11.450254,17.0010495 12.0018002,17.0010495 C12.5533463,17.0010495 13.0004628,16.553933 13.0004628,16.0023869 C13.0004628,15.4508407 12.5533463,15.0037242 12.0018002,15.0037242 Z M11.99964,7 C11.4868042,7.00018474 11.0642719,7.38637706 11.0066858,7.8837365 L11,8.00036004 L11.0018003,13.0012393 L11.00857,13.117858 C11.0665141,13.6151758 11.4893244,14.0010638 12.0021602,14.0008793 C12.514996,14.0006946 12.9375283,13.6145023 12.9951144,13.1171428 L13.0018002,13.0005193 L13,7.99964009 L12.9932303,7.8830214 C12.9352861,7.38570354 12.5124758,6.99981552 11.99964,7 Z"}))))),{cubicBezierEaseInOut:yy}=ko;function vn({originalTransform:e="",left:t=0,top:o=0,transition:r=`all .3s ${yy} !important`}={}){return[L("&.icon-switch-transition-enter-from, &.icon-switch-transition-leave-to",{transform:`${e} scale(0.75)`,left:t,top:o,opacity:0}),L("&.icon-switch-transition-enter-to, &.icon-switch-transition-leave-from",{transform:`scale(1) ${e}`,left:t,top:o,opacity:1}),L("&.icon-switch-transition-enter-active, &.icon-switch-transition-leave-active",{transformOrigin:"center",position:"absolute",left:t,top:o,transition:r})]}const Sy=pe("base-clear",` flex-shrink: 0; height: 1em; width: 1em; @@ -76,7 +76,7 @@ ${t} left: 50%; top: 50%; transform: translateX(-50%) translateY(-50%); - `,[vn({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),ka=He({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Mr("-base-clear",Sy,Dt(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return y("div",{class:`${e}-base-clear`},y(Hi,null,{default:()=>{var t,o;return this.show?y("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Qr(this.$slots.icon,()=>[y(Tr,{clsPrefix:e},{default:()=>y(py,null)})])):y("div",{key:"icon",class:`${e}-base-clear__placeholder`},(o=(t=this.$slots).placeholder)===null||o===void 0?void 0:o.call(t))}}))}}),wy=pe("base-close",` + `,[vn({originalTransform:"translateX(-50%) translateY(-50%)",left:"50%",top:"50%"})])])]),ka=He({name:"BaseClear",props:{clsPrefix:{type:String,required:!0},show:Boolean,onClear:Function},setup(e){return Er("-base-clear",Sy,Dt(e,"clsPrefix")),{handleMouseDown(t){t.preventDefault()}}},render(){const{clsPrefix:e}=this;return y("div",{class:`${e}-base-clear`},y(Hi,null,{default:()=>{var t,o;return this.show?y("div",{key:"dismiss",class:`${e}-base-clear__clear`,onClick:this.onClear,onMousedown:this.handleMouseDown,"data-clear":!0},Qr(this.$slots.icon,()=>[y(Tr,{clsPrefix:e},{default:()=>y(py,null)})])):y("div",{key:"icon",class:`${e}-base-clear__placeholder`},(o=(t=this.$slots).placeholder)===null||o===void 0?void 0:o.call(t))}}))}}),wy=pe("base-close",` display: flex; align-items: center; justify-content: center; @@ -120,7 +120,7 @@ ${t} background-color: transparent; `),re("round",[L("&::before",` border-radius: 50%; - `)])]),Eu=He({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Mr("-base-close",wy,Dt(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:o,absolute:r,round:n,isButtonTag:i}=e;return y(i?"button":"div",{type:i?"button":void 0,tabindex:o||!e.focusable?-1:0,"aria-disabled":o,"aria-label":"close",role:i?void 0:"button",disabled:o,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,o&&`${t}-base-close--disabled`,n&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},y(Tr,{clsPrefix:t},{default:()=>y(hy,null)}))}}}),zu=He({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function o(l){e.width?l.style.maxWidth=`${l.offsetWidth}px`:l.style.maxHeight=`${l.offsetHeight}px`,l.offsetWidth}function r(l){e.width?l.style.maxWidth="0":l.style.maxHeight="0",l.offsetWidth;const{onLeave:s}=e;s&&s()}function n(l){e.width?l.style.maxWidth="":l.style.maxHeight="";const{onAfterLeave:s}=e;s&&s()}function i(l){if(l.style.transition="none",e.width){const s=l.offsetWidth;l.style.maxWidth="0",l.offsetWidth,l.style.transition="",l.style.maxWidth=`${s}px`}else if(e.reverse)l.style.maxHeight=`${l.offsetHeight}px`,l.offsetHeight,l.style.transition="",l.style.maxHeight="0";else{const s=l.offsetHeight;l.style.maxHeight="0",l.offsetWidth,l.style.transition="",l.style.maxHeight=`${s}px`}l.offsetWidth}function a(l){var s;e.width?l.style.maxWidth="":e.reverse||(l.style.maxHeight=""),(s=e.onAfterEnter)===null||s===void 0||s.call(e)}return()=>{const{group:l,width:s,appear:c,mode:d}=e,u=l?Fg:un,p={name:s?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:c,onEnter:i,onAfterEnter:a,onBeforeLeave:o,onLeave:r,onAfterLeave:n};return l||(p.mode=d),y(u,p,t)}}}),Py=L([L("@keyframes rotator",` + `)])]),Iu=He({name:"BaseClose",props:{isButtonTag:{type:Boolean,default:!0},clsPrefix:{type:String,required:!0},disabled:{type:Boolean,default:void 0},focusable:{type:Boolean,default:!0},round:Boolean,onClick:Function,absolute:Boolean},setup(e){return Er("-base-close",wy,Dt(e,"clsPrefix")),()=>{const{clsPrefix:t,disabled:o,absolute:r,round:n,isButtonTag:i}=e;return y(i?"button":"div",{type:i?"button":void 0,tabindex:o||!e.focusable?-1:0,"aria-disabled":o,"aria-label":"close",role:i?void 0:"button",disabled:o,class:[`${t}-base-close`,r&&`${t}-base-close--absolute`,o&&`${t}-base-close--disabled`,n&&`${t}-base-close--round`],onMousedown:l=>{e.focusable||l.preventDefault()},onClick:e.onClick},y(Tr,{clsPrefix:t},{default:()=>y(hy,null)}))}}}),_u=He({name:"FadeInExpandTransition",props:{appear:Boolean,group:Boolean,mode:String,onLeave:Function,onAfterLeave:Function,onAfterEnter:Function,width:Boolean,reverse:Boolean},setup(e,{slots:t}){function o(l){e.width?l.style.maxWidth=`${l.offsetWidth}px`:l.style.maxHeight=`${l.offsetHeight}px`,l.offsetWidth}function r(l){e.width?l.style.maxWidth="0":l.style.maxHeight="0",l.offsetWidth;const{onLeave:s}=e;s&&s()}function n(l){e.width?l.style.maxWidth="":l.style.maxHeight="";const{onAfterLeave:s}=e;s&&s()}function i(l){if(l.style.transition="none",e.width){const s=l.offsetWidth;l.style.maxWidth="0",l.offsetWidth,l.style.transition="",l.style.maxWidth=`${s}px`}else if(e.reverse)l.style.maxHeight=`${l.offsetHeight}px`,l.offsetHeight,l.style.transition="",l.style.maxHeight="0";else{const s=l.offsetHeight;l.style.maxHeight="0",l.offsetWidth,l.style.transition="",l.style.maxHeight=`${s}px`}l.offsetWidth}function a(l){var s;e.width?l.style.maxWidth="":e.reverse||(l.style.maxHeight=""),(s=e.onAfterEnter)===null||s===void 0||s.call(e)}return()=>{const{group:l,width:s,appear:c,mode:d}=e,u=l?Fg:un,p={name:s?"fade-in-width-expand-transition":"fade-in-height-expand-transition",appear:c,onEnter:i,onAfterEnter:a,onBeforeLeave:o,onLeave:r,onAfterLeave:n};return l||(p.mode=d),y(u,p,t)}}}),Py=L([L("@keyframes rotator",` 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); @@ -147,7 +147,7 @@ ${t} `,[V("icon",` height: 1em; width: 1em; - `)])])]),ia="1.6s",Ty={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},vl=He({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},Ty),setup(e){Mr("-base-loading",Py,Dt(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:o,stroke:r,scale:n}=this,i=t/n;return y("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},y(Hi,null,{default:()=>this.show?y("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},y("div",{class:`${e}-base-loading__container`},y("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},y("g",null,y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};270 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":o,"stroke-linecap":"round",cx:i,cy:i,r:t-o/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};135 ${i} ${i};450 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"})))))):y("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Xs}=ko;function $y({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:o="0.2s",enterCubicBezier:r=Xs,leaveCubicBezier:n=Xs}={}){return[L(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),L(`&.${e}-transition-leave-active`,{transition:`all ${o} ${n}!important`}),L(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),L(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const Z={neutralBase:"#000",neutralInvertBase:"#fff",neutralTextBase:"#fff",neutralPopover:"rgb(72, 72, 78)",neutralCard:"rgb(24, 24, 28)",neutralModal:"rgb(44, 44, 50)",neutralBody:"rgb(16, 16, 20)",alpha1:"0.9",alpha2:"0.82",alpha3:"0.52",alpha4:"0.38",alpha5:"0.28",alphaClose:"0.52",alphaDisabled:"0.38",alphaDisabledInput:"0.06",alphaPending:"0.09",alphaTablePending:"0.06",alphaTableStriped:"0.05",alphaPressed:"0.05",alphaAvatar:"0.18",alphaRail:"0.2",alphaProgressRail:"0.12",alphaBorder:"0.24",alphaDivider:"0.09",alphaInput:"0.1",alphaAction:"0.06",alphaTab:"0.04",alphaScrollbar:"0.2",alphaScrollbarHover:"0.3",alphaCode:"0.12",alphaTag:"0.2",primaryHover:"#7fe7c4",primaryDefault:"#63e2b7",primaryActive:"#5acea7",primarySuppl:"rgb(42, 148, 125)",infoHover:"#8acbec",infoDefault:"#70c0e8",infoActive:"#66afd3",infoSuppl:"rgb(56, 137, 197)",errorHover:"#e98b8b",errorDefault:"#e88080",errorActive:"#e57272",errorSuppl:"rgb(208, 58, 82)",warningHover:"#f5d599",warningDefault:"#f2c97d",warningActive:"#e6c260",warningSuppl:"rgb(240, 138, 0)",successHover:"#7fe7c4",successDefault:"#63e2b7",successActive:"#5acea7",successSuppl:"rgb(42, 148, 125)"},Ry=ho(Z.neutralBase),Mu=ho(Z.neutralInvertBase),Fy=`rgba(${Mu.slice(0,3).join(", ")}, `;function Se(e){return`${Fy+String(e)})`}function _y(e){const t=Array.from(Mu);return t[3]=Number(e),ee(Ry,t)}const W=Object.assign(Object.assign({name:"common"},ko),{baseColor:Z.neutralBase,primaryColor:Z.primaryDefault,primaryColorHover:Z.primaryHover,primaryColorPressed:Z.primaryActive,primaryColorSuppl:Z.primarySuppl,infoColor:Z.infoDefault,infoColorHover:Z.infoHover,infoColorPressed:Z.infoActive,infoColorSuppl:Z.infoSuppl,successColor:Z.successDefault,successColorHover:Z.successHover,successColorPressed:Z.successActive,successColorSuppl:Z.successSuppl,warningColor:Z.warningDefault,warningColorHover:Z.warningHover,warningColorPressed:Z.warningActive,warningColorSuppl:Z.warningSuppl,errorColor:Z.errorDefault,errorColorHover:Z.errorHover,errorColorPressed:Z.errorActive,errorColorSuppl:Z.errorSuppl,textColorBase:Z.neutralTextBase,textColor1:Se(Z.alpha1),textColor2:Se(Z.alpha2),textColor3:Se(Z.alpha3),textColorDisabled:Se(Z.alpha4),placeholderColor:Se(Z.alpha4),placeholderColorDisabled:Se(Z.alpha5),iconColor:Se(Z.alpha4),iconColorDisabled:Se(Z.alpha5),iconColorHover:Se(Number(Z.alpha4)*1.25),iconColorPressed:Se(Number(Z.alpha4)*.8),opacity1:Z.alpha1,opacity2:Z.alpha2,opacity3:Z.alpha3,opacity4:Z.alpha4,opacity5:Z.alpha5,dividerColor:Se(Z.alphaDivider),borderColor:Se(Z.alphaBorder),closeIconColorHover:Se(Number(Z.alphaClose)),closeIconColor:Se(Number(Z.alphaClose)),closeIconColorPressed:Se(Number(Z.alphaClose)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:Se(Z.alpha4),clearColorHover:Ne(Se(Z.alpha4),{alpha:1.25}),clearColorPressed:Ne(Se(Z.alpha4),{alpha:.8}),scrollbarColor:Se(Z.alphaScrollbar),scrollbarColorHover:Se(Z.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Se(Z.alphaProgressRail),railColor:Se(Z.alphaRail),popoverColor:Z.neutralPopover,tableColor:Z.neutralCard,cardColor:Z.neutralCard,modalColor:Z.neutralModal,bodyColor:Z.neutralBody,tagColor:_y(Z.alphaTag),avatarColor:Se(Z.alphaAvatar),invertedColor:Z.neutralBase,inputColor:Se(Z.alphaInput),codeColor:Se(Z.alphaCode),tabColor:Se(Z.alphaTab),actionColor:Se(Z.alphaAction),tableHeaderColor:Se(Z.alphaAction),hoverColor:Se(Z.alphaPending),tableColorHover:Se(Z.alphaTablePending),tableColorStriped:Se(Z.alphaTableStriped),pressedColor:Se(Z.alphaPressed),opacityDisabled:Z.alphaDisabled,inputColorDisabled:Se(Z.alphaDisabledInput),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),ue={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Ey=ho(ue.neutralBase),Iu=ho(ue.neutralInvertBase),zy=`rgba(${Iu.slice(0,3).join(", ")}, `;function Js(e){return`${zy+String(e)})`}function ct(e){const t=Array.from(Iu);return t[3]=Number(e),ee(Ey,t)}const Oe=Object.assign(Object.assign({name:"common"},ko),{baseColor:ue.neutralBase,primaryColor:ue.primaryDefault,primaryColorHover:ue.primaryHover,primaryColorPressed:ue.primaryActive,primaryColorSuppl:ue.primarySuppl,infoColor:ue.infoDefault,infoColorHover:ue.infoHover,infoColorPressed:ue.infoActive,infoColorSuppl:ue.infoSuppl,successColor:ue.successDefault,successColorHover:ue.successHover,successColorPressed:ue.successActive,successColorSuppl:ue.successSuppl,warningColor:ue.warningDefault,warningColorHover:ue.warningHover,warningColorPressed:ue.warningActive,warningColorSuppl:ue.warningSuppl,errorColor:ue.errorDefault,errorColorHover:ue.errorHover,errorColorPressed:ue.errorActive,errorColorSuppl:ue.errorSuppl,textColorBase:ue.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:ct(ue.alpha4),placeholderColor:ct(ue.alpha4),placeholderColorDisabled:ct(ue.alpha5),iconColor:ct(ue.alpha4),iconColorHover:Ne(ct(ue.alpha4),{lightness:.75}),iconColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),iconColorDisabled:ct(ue.alpha5),opacity1:ue.alpha1,opacity2:ue.alpha2,opacity3:ue.alpha3,opacity4:ue.alpha4,opacity5:ue.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:ct(Number(ue.alphaClose)),closeIconColorHover:ct(Number(ue.alphaClose)),closeIconColorPressed:ct(Number(ue.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ct(ue.alpha4),clearColorHover:Ne(ct(ue.alpha4),{lightness:.75}),clearColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),scrollbarColor:Js(ue.alphaScrollbar),scrollbarColorHover:Js(ue.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ct(ue.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ue.neutralPopover,tableColor:ue.neutralCard,cardColor:ue.neutralCard,modalColor:ue.neutralModal,bodyColor:ue.neutralBody,tagColor:"#eee",avatarColor:ct(ue.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ct(ue.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:ue.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),My={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function Au(e){const{scrollbarColor:t,scrollbarColorHover:o,scrollbarHeight:r,scrollbarWidth:n,scrollbarBorderRadius:i}=e;return Object.assign(Object.assign({},My),{height:r,width:n,borderRadius:i,color:t,colorHover:o})}const Rn={name:"Scrollbar",common:Oe,self:Au},St={name:"Scrollbar",common:W,self:Au},Iy=pe("scrollbar",` + `)])])]),ia="1.6s",Ty={strokeWidth:{type:Number,default:28},stroke:{type:String,default:void 0}},vl=He({name:"BaseLoading",props:Object.assign({clsPrefix:{type:String,required:!0},show:{type:Boolean,default:!0},scale:{type:Number,default:1},radius:{type:Number,default:100}},Ty),setup(e){Er("-base-loading",Py,Dt(e,"clsPrefix"))},render(){const{clsPrefix:e,radius:t,strokeWidth:o,stroke:r,scale:n}=this,i=t/n;return y("div",{class:`${e}-base-loading`,role:"img","aria-label":"loading"},y(Hi,null,{default:()=>this.show?y("div",{key:"icon",class:`${e}-base-loading__transition-wrapper`},y("div",{class:`${e}-base-loading__container`},y("svg",{class:`${e}-base-loading__icon`,viewBox:`0 0 ${2*i} ${2*i}`,xmlns:"http://www.w3.org/2000/svg",style:{color:r}},y("g",null,y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};270 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("circle",{class:`${e}-base-loading__icon`,fill:"none",stroke:"currentColor","stroke-width":o,"stroke-linecap":"round",cx:i,cy:i,r:t-o/2,"stroke-dasharray":5.67*t,"stroke-dashoffset":18.48*t},y("animateTransform",{attributeName:"transform",type:"rotate",values:`0 ${i} ${i};135 ${i} ${i};450 ${i} ${i}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"}),y("animate",{attributeName:"stroke-dashoffset",values:`${5.67*t};${1.42*t};${5.67*t}`,begin:"0s",dur:ia,fill:"freeze",repeatCount:"indefinite"})))))):y("div",{key:"placeholder",class:`${e}-base-loading__placeholder`},this.$slots)}))}}),{cubicBezierEaseInOut:Xs}=ko;function $y({name:e="fade-in",enterDuration:t="0.2s",leaveDuration:o="0.2s",enterCubicBezier:r=Xs,leaveCubicBezier:n=Xs}={}){return[L(`&.${e}-transition-enter-active`,{transition:`all ${t} ${r}!important`}),L(`&.${e}-transition-leave-active`,{transition:`all ${o} ${n}!important`}),L(`&.${e}-transition-enter-from, &.${e}-transition-leave-to`,{opacity:0}),L(`&.${e}-transition-leave-from, &.${e}-transition-enter-to`,{opacity:1})]}const Z={neutralBase:"#000",neutralInvertBase:"#fff",neutralTextBase:"#fff",neutralPopover:"rgb(72, 72, 78)",neutralCard:"rgb(24, 24, 28)",neutralModal:"rgb(44, 44, 50)",neutralBody:"rgb(16, 16, 20)",alpha1:"0.9",alpha2:"0.82",alpha3:"0.52",alpha4:"0.38",alpha5:"0.28",alphaClose:"0.52",alphaDisabled:"0.38",alphaDisabledInput:"0.06",alphaPending:"0.09",alphaTablePending:"0.06",alphaTableStriped:"0.05",alphaPressed:"0.05",alphaAvatar:"0.18",alphaRail:"0.2",alphaProgressRail:"0.12",alphaBorder:"0.24",alphaDivider:"0.09",alphaInput:"0.1",alphaAction:"0.06",alphaTab:"0.04",alphaScrollbar:"0.2",alphaScrollbarHover:"0.3",alphaCode:"0.12",alphaTag:"0.2",primaryHover:"#7fe7c4",primaryDefault:"#63e2b7",primaryActive:"#5acea7",primarySuppl:"rgb(42, 148, 125)",infoHover:"#8acbec",infoDefault:"#70c0e8",infoActive:"#66afd3",infoSuppl:"rgb(56, 137, 197)",errorHover:"#e98b8b",errorDefault:"#e88080",errorActive:"#e57272",errorSuppl:"rgb(208, 58, 82)",warningHover:"#f5d599",warningDefault:"#f2c97d",warningActive:"#e6c260",warningSuppl:"rgb(240, 138, 0)",successHover:"#7fe7c4",successDefault:"#63e2b7",successActive:"#5acea7",successSuppl:"rgb(42, 148, 125)"},Ry=ho(Z.neutralBase),Eu=ho(Z.neutralInvertBase),Fy=`rgba(${Eu.slice(0,3).join(", ")}, `;function Se(e){return`${Fy+String(e)})`}function Ay(e){const t=Array.from(Eu);return t[3]=Number(e),ee(Ry,t)}const W=Object.assign(Object.assign({name:"common"},ko),{baseColor:Z.neutralBase,primaryColor:Z.primaryDefault,primaryColorHover:Z.primaryHover,primaryColorPressed:Z.primaryActive,primaryColorSuppl:Z.primarySuppl,infoColor:Z.infoDefault,infoColorHover:Z.infoHover,infoColorPressed:Z.infoActive,infoColorSuppl:Z.infoSuppl,successColor:Z.successDefault,successColorHover:Z.successHover,successColorPressed:Z.successActive,successColorSuppl:Z.successSuppl,warningColor:Z.warningDefault,warningColorHover:Z.warningHover,warningColorPressed:Z.warningActive,warningColorSuppl:Z.warningSuppl,errorColor:Z.errorDefault,errorColorHover:Z.errorHover,errorColorPressed:Z.errorActive,errorColorSuppl:Z.errorSuppl,textColorBase:Z.neutralTextBase,textColor1:Se(Z.alpha1),textColor2:Se(Z.alpha2),textColor3:Se(Z.alpha3),textColorDisabled:Se(Z.alpha4),placeholderColor:Se(Z.alpha4),placeholderColorDisabled:Se(Z.alpha5),iconColor:Se(Z.alpha4),iconColorDisabled:Se(Z.alpha5),iconColorHover:Se(Number(Z.alpha4)*1.25),iconColorPressed:Se(Number(Z.alpha4)*.8),opacity1:Z.alpha1,opacity2:Z.alpha2,opacity3:Z.alpha3,opacity4:Z.alpha4,opacity5:Z.alpha5,dividerColor:Se(Z.alphaDivider),borderColor:Se(Z.alphaBorder),closeIconColorHover:Se(Number(Z.alphaClose)),closeIconColor:Se(Number(Z.alphaClose)),closeIconColorPressed:Se(Number(Z.alphaClose)),closeColorHover:"rgba(255, 255, 255, .12)",closeColorPressed:"rgba(255, 255, 255, .08)",clearColor:Se(Z.alpha4),clearColorHover:Ne(Se(Z.alpha4),{alpha:1.25}),clearColorPressed:Ne(Se(Z.alpha4),{alpha:.8}),scrollbarColor:Se(Z.alphaScrollbar),scrollbarColorHover:Se(Z.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:Se(Z.alphaProgressRail),railColor:Se(Z.alphaRail),popoverColor:Z.neutralPopover,tableColor:Z.neutralCard,cardColor:Z.neutralCard,modalColor:Z.neutralModal,bodyColor:Z.neutralBody,tagColor:Ay(Z.alphaTag),avatarColor:Se(Z.alphaAvatar),invertedColor:Z.neutralBase,inputColor:Se(Z.alphaInput),codeColor:Se(Z.alphaCode),tabColor:Se(Z.alphaTab),actionColor:Se(Z.alphaAction),tableHeaderColor:Se(Z.alphaAction),hoverColor:Se(Z.alphaPending),tableColorHover:Se(Z.alphaTablePending),tableColorStriped:Se(Z.alphaTableStriped),pressedColor:Se(Z.alphaPressed),opacityDisabled:Z.alphaDisabled,inputColorDisabled:Se(Z.alphaDisabledInput),buttonColor2:"rgba(255, 255, 255, .08)",buttonColor2Hover:"rgba(255, 255, 255, .12)",buttonColor2Pressed:"rgba(255, 255, 255, .08)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .24), 0 3px 6px 0 rgba(0, 0, 0, .18), 0 5px 12px 4px rgba(0, 0, 0, .12)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .24), 0 6px 12px 0 rgba(0, 0, 0, .16), 0 9px 18px 8px rgba(0, 0, 0, .10)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),ue={neutralBase:"#FFF",neutralInvertBase:"#000",neutralTextBase:"#000",neutralPopover:"#fff",neutralCard:"#fff",neutralModal:"#fff",neutralBody:"#fff",alpha1:"0.82",alpha2:"0.72",alpha3:"0.38",alpha4:"0.24",alpha5:"0.18",alphaClose:"0.6",alphaDisabled:"0.5",alphaAvatar:"0.2",alphaProgressRail:".08",alphaInput:"0",alphaScrollbar:"0.25",alphaScrollbarHover:"0.4",primaryHover:"#36ad6a",primaryDefault:"#18a058",primaryActive:"#0c7a43",primarySuppl:"#36ad6a",infoHover:"#4098fc",infoDefault:"#2080f0",infoActive:"#1060c9",infoSuppl:"#4098fc",errorHover:"#de576d",errorDefault:"#d03050",errorActive:"#ab1f3f",errorSuppl:"#de576d",warningHover:"#fcb040",warningDefault:"#f0a020",warningActive:"#c97c10",warningSuppl:"#fcb040",successHover:"#36ad6a",successDefault:"#18a058",successActive:"#0c7a43",successSuppl:"#36ad6a"},Iy=ho(ue.neutralBase),Mu=ho(ue.neutralInvertBase),_y=`rgba(${Mu.slice(0,3).join(", ")}, `;function Js(e){return`${_y+String(e)})`}function ct(e){const t=Array.from(Mu);return t[3]=Number(e),ee(Iy,t)}const Be=Object.assign(Object.assign({name:"common"},ko),{baseColor:ue.neutralBase,primaryColor:ue.primaryDefault,primaryColorHover:ue.primaryHover,primaryColorPressed:ue.primaryActive,primaryColorSuppl:ue.primarySuppl,infoColor:ue.infoDefault,infoColorHover:ue.infoHover,infoColorPressed:ue.infoActive,infoColorSuppl:ue.infoSuppl,successColor:ue.successDefault,successColorHover:ue.successHover,successColorPressed:ue.successActive,successColorSuppl:ue.successSuppl,warningColor:ue.warningDefault,warningColorHover:ue.warningHover,warningColorPressed:ue.warningActive,warningColorSuppl:ue.warningSuppl,errorColor:ue.errorDefault,errorColorHover:ue.errorHover,errorColorPressed:ue.errorActive,errorColorSuppl:ue.errorSuppl,textColorBase:ue.neutralTextBase,textColor1:"rgb(31, 34, 37)",textColor2:"rgb(51, 54, 57)",textColor3:"rgb(118, 124, 130)",textColorDisabled:ct(ue.alpha4),placeholderColor:ct(ue.alpha4),placeholderColorDisabled:ct(ue.alpha5),iconColor:ct(ue.alpha4),iconColorHover:Ne(ct(ue.alpha4),{lightness:.75}),iconColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),iconColorDisabled:ct(ue.alpha5),opacity1:ue.alpha1,opacity2:ue.alpha2,opacity3:ue.alpha3,opacity4:ue.alpha4,opacity5:ue.alpha5,dividerColor:"rgb(239, 239, 245)",borderColor:"rgb(224, 224, 230)",closeIconColor:ct(Number(ue.alphaClose)),closeIconColorHover:ct(Number(ue.alphaClose)),closeIconColorPressed:ct(Number(ue.alphaClose)),closeColorHover:"rgba(0, 0, 0, .09)",closeColorPressed:"rgba(0, 0, 0, .13)",clearColor:ct(ue.alpha4),clearColorHover:Ne(ct(ue.alpha4),{lightness:.75}),clearColorPressed:Ne(ct(ue.alpha4),{lightness:.9}),scrollbarColor:Js(ue.alphaScrollbar),scrollbarColorHover:Js(ue.alphaScrollbarHover),scrollbarWidth:"5px",scrollbarHeight:"5px",scrollbarBorderRadius:"5px",progressRailColor:ct(ue.alphaProgressRail),railColor:"rgb(219, 219, 223)",popoverColor:ue.neutralPopover,tableColor:ue.neutralCard,cardColor:ue.neutralCard,modalColor:ue.neutralModal,bodyColor:ue.neutralBody,tagColor:"#eee",avatarColor:ct(ue.alphaAvatar),invertedColor:"rgb(0, 20, 40)",inputColor:ct(ue.alphaInput),codeColor:"rgb(244, 244, 248)",tabColor:"rgb(247, 247, 250)",actionColor:"rgb(250, 250, 252)",tableHeaderColor:"rgb(250, 250, 252)",hoverColor:"rgb(243, 243, 245)",tableColorHover:"rgba(0, 0, 100, 0.03)",tableColorStriped:"rgba(0, 0, 100, 0.02)",pressedColor:"rgb(237, 237, 239)",opacityDisabled:ue.alphaDisabled,inputColorDisabled:"rgb(250, 250, 252)",buttonColor2:"rgba(46, 51, 56, .05)",buttonColor2Hover:"rgba(46, 51, 56, .09)",buttonColor2Pressed:"rgba(46, 51, 56, .13)",boxShadow1:"0 1px 2px -2px rgba(0, 0, 0, .08), 0 3px 6px 0 rgba(0, 0, 0, .06), 0 5px 12px 4px rgba(0, 0, 0, .04)",boxShadow2:"0 3px 6px -4px rgba(0, 0, 0, .12), 0 6px 16px 0 rgba(0, 0, 0, .08), 0 9px 28px 8px rgba(0, 0, 0, .05)",boxShadow3:"0 6px 16px -9px rgba(0, 0, 0, .08), 0 9px 28px 0 rgba(0, 0, 0, .05), 0 12px 48px 16px rgba(0, 0, 0, .03)"}),Ey={railInsetHorizontalBottom:"auto 2px 4px 2px",railInsetHorizontalTop:"4px 2px auto 2px",railInsetVerticalRight:"2px 4px 2px auto",railInsetVerticalLeft:"2px auto 2px 4px",railColor:"transparent"};function zu(e){const{scrollbarColor:t,scrollbarColorHover:o,scrollbarHeight:r,scrollbarWidth:n,scrollbarBorderRadius:i}=e;return Object.assign(Object.assign({},Ey),{height:r,width:n,borderRadius:i,color:t,colorHover:o})}const Rn={name:"Scrollbar",common:Be,self:zu},St={name:"Scrollbar",common:W,self:zu},My=pe("scrollbar",` overflow: hidden; position: relative; z-index: auto; @@ -212,7 +212,7 @@ ${t} pointer-events: all; background-color: var(--n-scrollbar-color); transition: background-color .2s var(--n-scrollbar-bezier); - `,[$y(),L("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),Ay=Object.assign(Object.assign({},Ct.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),Hu=He({name:"Scrollbar",props:Ay,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:o,mergedRtlRef:r}=Ao(e),n=$n("Scrollbar",r,t),i=fe(null),a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=fe(null),f=fe(null),g=fe(null),S=fe(0),v=fe(0),$=fe(!1),T=fe(!1);let w=!1,z=!1,B,x,F=0,R=0,O=0,j=0;const _=Jm(),J=Ct("Scrollbar","-scrollbar",Iy,Rn,e,t),G=Y(()=>{const{value:D}=p,{value:Q}=d,{value:ge}=f;return D===null||Q===null||ge===null?0:Math.min(D,ge*D/Q+ms(J.value.self.width)*1.5)}),le=Y(()=>`${G.value}px`),te=Y(()=>{const{value:D}=m,{value:Q}=u,{value:ge}=g;return D===null||Q===null||ge===null?0:ge*D/Q+ms(J.value.self.height)*1.5}),N=Y(()=>`${te.value}px`),oe=Y(()=>{const{value:D}=p,{value:Q}=S,{value:ge}=d,{value:Me}=f;if(D===null||ge===null||Me===null)return 0;{const je=ge-D;return je?Q/je*(Me-G.value):0}}),ye=Y(()=>`${oe.value}px`),Pe=Y(()=>{const{value:D}=m,{value:Q}=v,{value:ge}=u,{value:Me}=g;if(D===null||ge===null||Me===null)return 0;{const je=ge-D;return je?Q/je*(Me-te.value):0}}),Re=Y(()=>`${Pe.value}px`),Fe=Y(()=>{const{value:D}=p,{value:Q}=d;return D!==null&&Q!==null&&Q>D}),Ve=Y(()=>{const{value:D}=m,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),Ue=Y(()=>{const{trigger:D}=e;return D==="none"||$.value}),gt=Y(()=>{const{trigger:D}=e;return D==="none"||T.value}),he=Y(()=>{const{container:D}=e;return D?D():a.value}),qe=Y(()=>{const{content:D}=e;return D?D():l.value}),rt=(D,Q)=>{if(!e.scrollable)return;if(typeof D=="number"){b(D,Q??0,0,!1,"auto");return}const{left:ge,top:Me,index:je,elSize:lt,position:Tt,behavior:ke,el:st,debounce:jt=!0}=D;(ge!==void 0||Me!==void 0)&&b(ge??0,Me??0,0,!1,ke),st!==void 0?b(0,st.offsetTop,st.offsetHeight,jt,ke):je!==void 0&<!==void 0?b(0,je*lt,lt,jt,ke):Tt==="bottom"?b(0,Number.MAX_SAFE_INTEGER,0,!1,ke):Tt==="top"&&b(0,0,0,!1,ke)},be=Qm(()=>{e.container||rt({top:S.value,left:v.value})}),Ge=()=>{be.isDeactivated||se()},Pt=D=>{if(be.isDeactivated)return;const{onResize:Q}=e;Q&&Q(D),se()},h=(D,Q)=>{if(!e.scrollable)return;const{value:ge}=he;ge&&(typeof D=="object"?ge.scrollBy(D):ge.scrollBy(D,Q||0))};function b(D,Q,ge,Me,je){const{value:lt}=he;if(lt){if(Me){const{scrollTop:Tt,offsetHeight:ke}=lt;if(Q>Tt){Q+ge<=Tt+ke||lt.scrollTo({left:D,top:Q+ge-ke,behavior:je});return}}lt.scrollTo({left:D,top:Q,behavior:je})}}function P(){q(),A(),se()}function H(){I()}function I(){k(),U()}function k(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{T.value=!1},e.duration)}function U(){B!==void 0&&window.clearTimeout(B),B=window.setTimeout(()=>{$.value=!1},e.duration)}function q(){B!==void 0&&window.clearTimeout(B),$.value=!0}function A(){x!==void 0&&window.clearTimeout(x),T.value=!0}function E(D){const{onScroll:Q}=e;Q&&Q(D),ie()}function ie(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1))}function X(){const{value:D}=qe;D&&(d.value=D.offsetHeight,u.value=D.offsetWidth);const{value:Q}=he;Q&&(p.value=Q.offsetHeight,m.value=Q.offsetWidth);const{value:ge}=c,{value:Me}=s;ge&&(g.value=ge.offsetWidth),Me&&(f.value=Me.offsetHeight)}function ne(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1),p.value=D.offsetHeight,m.value=D.offsetWidth,d.value=D.scrollHeight,u.value=D.scrollWidth);const{value:Q}=c,{value:ge}=s;Q&&(g.value=Q.offsetWidth),ge&&(f.value=ge.offsetHeight)}function se(){e.scrollable&&(e.useUnifiedContainer?ne():(X(),ie()))}function ve(D){var Q;return!(!((Q=i.value)===null||Q===void 0)&&Q.contains(Em(D)))}function Te(D){D.preventDefault(),D.stopPropagation(),z=!0,Go("mousemove",window,Ce,!0),Go("mouseup",window,Ze,!0),R=v.value,O=n!=null&&n.value?window.innerWidth-D.clientX:D.clientX}function Ce(D){if(!z)return;B!==void 0&&window.clearTimeout(B),x!==void 0&&window.clearTimeout(x);const{value:Q}=m,{value:ge}=u,{value:Me}=te;if(Q===null||ge===null)return;const lt=(n!=null&&n.value?window.innerWidth-D.clientX-O:D.clientX-O)*(ge-Q)/(Q-Me),Tt=ge-Q;let ke=R+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;if(st){st.scrollLeft=ke*(n!=null&&n.value?-1:1);const{internalOnUpdateScrollLeft:jt}=e;jt&&jt(ke)}}function Ze(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,Ce,!0),lo("mouseup",window,Ze,!0),z=!1,se(),ve(D)&&I()}function Qe(D){D.preventDefault(),D.stopPropagation(),w=!0,Go("mousemove",window,nt,!0),Go("mouseup",window,it,!0),F=S.value,j=D.clientY}function nt(D){if(!w)return;B!==void 0&&window.clearTimeout(B),x!==void 0&&window.clearTimeout(x);const{value:Q}=p,{value:ge}=d,{value:Me}=G;if(Q===null||ge===null)return;const lt=(D.clientY-j)*(ge-Q)/(Q-Me),Tt=ge-Q;let ke=F+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;st&&(st.scrollTop=ke)}function it(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0),w=!1,se(),ve(D)&&I()}sn(()=>{const{value:D}=Ve,{value:Q}=Fe,{value:ge}=t,{value:Me}=c,{value:je}=s;Me&&(D?Me.classList.remove(`${ge}-scrollbar-rail--disabled`):Me.classList.add(`${ge}-scrollbar-rail--disabled`)),je&&(Q?je.classList.remove(`${ge}-scrollbar-rail--disabled`):je.classList.add(`${ge}-scrollbar-rail--disabled`))}),Io(()=>{e.container||se()}),nr(()=>{B!==void 0&&window.clearTimeout(B),x!==void 0&&window.clearTimeout(x),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0)});const Wt=Y(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:ge,height:Me,width:je,borderRadius:lt,railInsetHorizontalTop:Tt,railInsetHorizontalBottom:ke,railInsetVerticalRight:st,railInsetVerticalLeft:jt,railColor:zn}}=J.value,{top:Bi,right:sr,bottom:cr,left:Oi}=Vo(Tt),{top:Li,right:Mn,bottom:bo,left:C}=Vo(ke),{top:M,right:de,bottom:Ee,left:Be}=Vo(n!=null&&n.value?zs(st):st),{top:_e,right:oo,bottom:ro,left:no}=Vo(n!=null&&n.value?zs(jt):jt);return{"--n-scrollbar-bezier":D,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":ge,"--n-scrollbar-border-radius":lt,"--n-scrollbar-width":je,"--n-scrollbar-height":Me,"--n-scrollbar-rail-top-horizontal-top":Bi,"--n-scrollbar-rail-right-horizontal-top":sr,"--n-scrollbar-rail-bottom-horizontal-top":cr,"--n-scrollbar-rail-left-horizontal-top":Oi,"--n-scrollbar-rail-top-horizontal-bottom":Li,"--n-scrollbar-rail-right-horizontal-bottom":Mn,"--n-scrollbar-rail-bottom-horizontal-bottom":bo,"--n-scrollbar-rail-left-horizontal-bottom":C,"--n-scrollbar-rail-top-vertical-right":M,"--n-scrollbar-rail-right-vertical-right":de,"--n-scrollbar-rail-bottom-vertical-right":Ee,"--n-scrollbar-rail-left-vertical-right":Be,"--n-scrollbar-rail-top-vertical-left":_e,"--n-scrollbar-rail-right-vertical-left":oo,"--n-scrollbar-rail-bottom-vertical-left":ro,"--n-scrollbar-rail-left-vertical-left":no,"--n-scrollbar-rail-color":zn}}),Ht=o?Fr("scrollbar",void 0,Wt,e):void 0;return Object.assign(Object.assign({},{scrollTo:rt,scrollBy:h,sync:se,syncUnifiedContainer:ne,handleMouseEnterWrapper:P,handleMouseLeaveWrapper:H}),{mergedClsPrefix:t,rtlEnabled:n,containerScrollTop:S,wrapperRef:i,containerRef:a,contentRef:l,yRailRef:s,xRailRef:c,needYBar:Fe,needXBar:Ve,yBarSizePx:le,xBarSizePx:N,yBarTopPx:ye,xBarLeftPx:Re,isShowXBar:Ue,isShowYBar:gt,isIos:_,handleScroll:E,handleContentResize:Ge,handleContainerResize:Pt,handleYScrollMouseDown:Qe,handleXScrollMouseDown:Te,cssVars:o?void 0:Wt,themeClass:Ht==null?void 0:Ht.themeClass,onRender:Ht==null?void 0:Ht.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:o,triggerDisplayManually:r,rtlEnabled:n,internalHoistYRail:i,yPlacement:a,xPlacement:l,xScrollable:s}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const c=this.trigger==="none",d=(m,f)=>y("div",{ref:"yRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--vertical`,`${o}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},y(c?Is:un,c?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var m,f;return(m=this.onRender)===null||m===void 0||m.call(this),y("div",Sd(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${o}-scrollbar`,this.themeClass,n&&`${o}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=t.default)===null||f===void 0?void 0:f.call(t):y("div",{role:"none",ref:"containerRef",class:[`${o}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},y(Fa,{onResize:this.handleContentResize},{default:()=>y("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${o}-scrollbar-content`,this.contentClass]},t)})),i?null:d(void 0,void 0),s&&y("div",{ref:"xRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--horizontal`,`${o}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},y(c?Is:un,c?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:n?this.xBarLeftPx:void 0,left:n?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?u():y(Fa,{onResize:this.handleContainerResize},{default:u});return i?y(et,null,p,d(this.themeClass,this.cssVars)):p}}),xP=Hu,Hy={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function ku(e){const{textColorDisabled:t,iconColor:o,textColor2:r,fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s}=e;return Object.assign(Object.assign({},Hy),{fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s,textColor:t,iconColor:o,extraTextColor:r})}const xl={name:"Empty",common:Oe,self:ku},ar={name:"Empty",common:W,self:ku},ky={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function Du(e){const{borderRadius:t,popoverColor:o,textColor3:r,dividerColor:n,textColor2:i,primaryColorPressed:a,textColorDisabled:l,primaryColor:s,opacityDisabled:c,hoverColor:d,fontSizeTiny:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,fontSizeHuge:g,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:T,heightHuge:w}=e;return Object.assign(Object.assign({},ky),{optionFontSizeTiny:u,optionFontSizeSmall:p,optionFontSizeMedium:m,optionFontSizeLarge:f,optionFontSizeHuge:g,optionHeightTiny:S,optionHeightSmall:v,optionHeightMedium:$,optionHeightLarge:T,optionHeightHuge:w,borderRadius:t,color:o,groupHeaderTextColor:r,actionDividerColor:n,optionTextColor:i,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:s,optionOpacityDisabled:c,optionCheckColor:s,optionColorPending:d,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:d,actionTextColor:i,loadingColor:s})}const Bu={name:"InternalSelectMenu",common:Oe,peers:{Scrollbar:Rn,Empty:xl},self:Du},Fn={name:"InternalSelectMenu",common:W,peers:{Scrollbar:St,Empty:ar},self:Du},Dy={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Ou(e){const{boxShadow2:t,popoverColor:o,textColor2:r,borderRadius:n,fontSize:i,dividerColor:a}=e;return Object.assign(Object.assign({},Dy),{fontSize:i,borderRadius:n,color:o,dividerColor:a,textColor:r,boxShadow:t})}const Ar={name:"Popover",common:Oe,self:Ou},lr={name:"Popover",common:W,self:Ou},By={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"},Lu={name:"Tag",common:W,self(e){const{textColor2:t,primaryColorHover:o,primaryColorPressed:r,primaryColor:n,infoColor:i,successColor:a,warningColor:l,errorColor:s,baseColor:c,borderColor:d,tagColor:u,opacityDisabled:p,closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderRadiusSmall:$,fontSizeMini:T,fontSizeTiny:w,fontSizeSmall:z,fontSizeMedium:B,heightMini:x,heightTiny:F,heightSmall:R,heightMedium:O,buttonColor2Hover:j,buttonColor2Pressed:_,fontWeightStrong:J}=e;return Object.assign(Object.assign({},By),{closeBorderRadius:$,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:O,borderRadius:$,opacityDisabled:p,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:z,fontSizeLarge:B,fontWeightStrong:J,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:j,colorPressedCheckable:_,colorChecked:n,colorCheckedHover:o,colorCheckedPressed:r,border:`1px solid ${d}`,textColor:t,color:u,colorBordered:"#0000",closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderPrimary:`1px solid ${K(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:K(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Ne(n,{lightness:.7}),closeIconColorHoverPrimary:Ne(n,{lightness:.7}),closeIconColorPressedPrimary:Ne(n,{lightness:.7}),closeColorHoverPrimary:K(n,{alpha:.16}),closeColorPressedPrimary:K(n,{alpha:.12}),borderInfo:`1px solid ${K(i,{alpha:.3})}`,textColorInfo:i,colorInfo:K(i,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Ne(i,{alpha:.7}),closeIconColorHoverInfo:Ne(i,{alpha:.7}),closeIconColorPressedInfo:Ne(i,{alpha:.7}),closeColorHoverInfo:K(i,{alpha:.16}),closeColorPressedInfo:K(i,{alpha:.12}),borderSuccess:`1px solid ${K(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:K(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Ne(a,{alpha:.7}),closeIconColorHoverSuccess:Ne(a,{alpha:.7}),closeIconColorPressedSuccess:Ne(a,{alpha:.7}),closeColorHoverSuccess:K(a,{alpha:.16}),closeColorPressedSuccess:K(a,{alpha:.12}),borderWarning:`1px solid ${K(l,{alpha:.3})}`,textColorWarning:l,colorWarning:K(l,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Ne(l,{alpha:.7}),closeIconColorHoverWarning:Ne(l,{alpha:.7}),closeIconColorPressedWarning:Ne(l,{alpha:.7}),closeColorHoverWarning:K(l,{alpha:.16}),closeColorPressedWarning:K(l,{alpha:.11}),borderError:`1px solid ${K(s,{alpha:.3})}`,textColorError:s,colorError:K(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Ne(s,{alpha:.7}),closeIconColorHoverError:Ne(s,{alpha:.7}),closeIconColorPressedError:Ne(s,{alpha:.7}),closeColorHoverError:K(s,{alpha:.16}),closeColorPressedError:K(s,{alpha:.12})})}},Oy=He({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:o}=e;return y(vl,{clsPrefix:o,class:`${o}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?y(ka,{clsPrefix:o,show:e.showClear,onClear:e.onClear},{placeholder:()=>y(Tr,{clsPrefix:o,class:`${o}-base-suffix__arrow`},{default:()=>Qr(t.default,()=>[y(fy,null)])})}):null})}}}),Wu={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"},Cl={name:"InternalSelection",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,iconColor:p,iconColorDisabled:m,clearColor:f,clearColorHover:g,clearColorPressed:S,placeholderColor:v,placeholderColorDisabled:$,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:z,fontSizeLarge:B,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:O,fontWeight:j}=e;return Object.assign(Object.assign({},Wu),{fontWeight:j,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:z,fontSizeLarge:B,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:O,borderRadius:t,textColor:o,textColorDisabled:r,placeholderColor:v,placeholderColorDisabled:$,color:n,colorDisabled:i,colorActive:K(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${K(a,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${K(a,{alpha:.4})}`,caretColor:a,arrowColor:p,arrowColorDisabled:m,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,colorActiveWarning:K(s,{alpha:.1}),caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${K(d,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.4})}`,colorActiveError:K(d,{alpha:.1}),caretColorError:d,clearColor:f,clearColorHover:g,clearColorPressed:S})}};function Ly(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderColor:p,iconColor:m,iconColorDisabled:f,clearColor:g,clearColorHover:S,clearColorPressed:v,placeholderColor:$,placeholderColorDisabled:T,fontSizeTiny:w,fontSizeSmall:z,fontSizeMedium:B,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:O,heightLarge:j,fontWeight:_}=e;return Object.assign(Object.assign({},Wu),{fontSizeTiny:w,fontSizeSmall:z,fontSizeMedium:B,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:O,heightLarge:j,borderRadius:t,fontWeight:_,textColor:o,textColorDisabled:r,placeholderColor:$,placeholderColorDisabled:T,color:n,colorDisabled:i,colorActive:n,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${K(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${K(a,{alpha:.2})}`,caretColor:a,arrowColor:m,arrowColorDisabled:f,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,colorActiveWarning:n,caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${K(d,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${K(d,{alpha:.2})}`,colorActiveError:n,caretColorError:d,clearColor:g,clearColorHover:S,clearColorPressed:v})}const Wy={name:"InternalSelection",common:Oe,peers:{Popover:Ar},self:Ly},{cubicBezierEaseInOut:xo}=ko;function jy({duration:e=".2s",delay:t=".1s"}={}){return[L("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),L("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",` + `,[$y(),L("&:hover","background-color: var(--n-scrollbar-color-hover);")])])])])]),zy=Object.assign(Object.assign({},Ct.props),{duration:{type:Number,default:0},scrollable:{type:Boolean,default:!0},xScrollable:Boolean,trigger:{type:String,default:"hover"},useUnifiedContainer:Boolean,triggerDisplayManually:Boolean,container:Function,content:Function,containerClass:String,containerStyle:[String,Object],contentClass:[String,Array],contentStyle:[String,Object],horizontalRailStyle:[String,Object],verticalRailStyle:[String,Object],onScroll:Function,onWheel:Function,onResize:Function,internalOnUpdateScrollLeft:Function,internalHoistYRail:Boolean,yPlacement:{type:String,default:"right"},xPlacement:{type:String,default:"bottom"}}),Hu=He({name:"Scrollbar",props:zy,inheritAttrs:!1,setup(e){const{mergedClsPrefixRef:t,inlineThemeDisabled:o,mergedRtlRef:r}=zo(e),n=$n("Scrollbar",r,t),i=fe(null),a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=fe(null),f=fe(null),g=fe(null),S=fe(0),v=fe(0),$=fe(!1),T=fe(!1);let w=!1,_=!1,O,x,F=0,R=0,B=0,j=0;const A=Jm(),J=Ct("Scrollbar","-scrollbar",My,Rn,e,t),G=Y(()=>{const{value:D}=p,{value:Q}=d,{value:ge}=f;return D===null||Q===null||ge===null?0:Math.min(D,ge*D/Q+ms(J.value.self.width)*1.5)}),le=Y(()=>`${G.value}px`),te=Y(()=>{const{value:D}=m,{value:Q}=u,{value:ge}=g;return D===null||Q===null||ge===null?0:ge*D/Q+ms(J.value.self.height)*1.5}),N=Y(()=>`${te.value}px`),oe=Y(()=>{const{value:D}=p,{value:Q}=S,{value:ge}=d,{value:Ee}=f;if(D===null||ge===null||Ee===null)return 0;{const je=ge-D;return je?Q/je*(Ee-G.value):0}}),ye=Y(()=>`${oe.value}px`),Pe=Y(()=>{const{value:D}=m,{value:Q}=v,{value:ge}=u,{value:Ee}=g;if(D===null||ge===null||Ee===null)return 0;{const je=ge-D;return je?Q/je*(Ee-te.value):0}}),Re=Y(()=>`${Pe.value}px`),Fe=Y(()=>{const{value:D}=p,{value:Q}=d;return D!==null&&Q!==null&&Q>D}),Ve=Y(()=>{const{value:D}=m,{value:Q}=u;return D!==null&&Q!==null&&Q>D}),qe=Y(()=>{const{trigger:D}=e;return D==="none"||$.value}),gt=Y(()=>{const{trigger:D}=e;return D==="none"||T.value}),he=Y(()=>{const{container:D}=e;return D?D():a.value}),Ue=Y(()=>{const{content:D}=e;return D?D():l.value}),rt=(D,Q)=>{if(!e.scrollable)return;if(typeof D=="number"){b(D,Q??0,0,!1,"auto");return}const{left:ge,top:Ee,index:je,elSize:lt,position:Tt,behavior:ke,el:st,debounce:jt=!0}=D;(ge!==void 0||Ee!==void 0)&&b(ge??0,Ee??0,0,!1,ke),st!==void 0?b(0,st.offsetTop,st.offsetHeight,jt,ke):je!==void 0&<!==void 0?b(0,je*lt,lt,jt,ke):Tt==="bottom"?b(0,Number.MAX_SAFE_INTEGER,0,!1,ke):Tt==="top"&&b(0,0,0,!1,ke)},be=Qm(()=>{e.container||rt({top:S.value,left:v.value})}),Ge=()=>{be.isDeactivated||se()},Pt=D=>{if(be.isDeactivated)return;const{onResize:Q}=e;Q&&Q(D),se()},h=(D,Q)=>{if(!e.scrollable)return;const{value:ge}=he;ge&&(typeof D=="object"?ge.scrollBy(D):ge.scrollBy(D,Q||0))};function b(D,Q,ge,Ee,je){const{value:lt}=he;if(lt){if(Ee){const{scrollTop:Tt,offsetHeight:ke}=lt;if(Q>Tt){Q+ge<=Tt+ke||lt.scrollTo({left:D,top:Q+ge-ke,behavior:je});return}}lt.scrollTo({left:D,top:Q,behavior:je})}}function P(){U(),z(),se()}function H(){M()}function M(){k(),q()}function k(){x!==void 0&&window.clearTimeout(x),x=window.setTimeout(()=>{T.value=!1},e.duration)}function q(){O!==void 0&&window.clearTimeout(O),O=window.setTimeout(()=>{$.value=!1},e.duration)}function U(){O!==void 0&&window.clearTimeout(O),$.value=!0}function z(){x!==void 0&&window.clearTimeout(x),T.value=!0}function I(D){const{onScroll:Q}=e;Q&&Q(D),ie()}function ie(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1))}function X(){const{value:D}=Ue;D&&(d.value=D.offsetHeight,u.value=D.offsetWidth);const{value:Q}=he;Q&&(p.value=Q.offsetHeight,m.value=Q.offsetWidth);const{value:ge}=c,{value:Ee}=s;ge&&(g.value=ge.offsetWidth),Ee&&(f.value=Ee.offsetHeight)}function ne(){const{value:D}=he;D&&(S.value=D.scrollTop,v.value=D.scrollLeft*(n!=null&&n.value?-1:1),p.value=D.offsetHeight,m.value=D.offsetWidth,d.value=D.scrollHeight,u.value=D.scrollWidth);const{value:Q}=c,{value:ge}=s;Q&&(g.value=Q.offsetWidth),ge&&(f.value=ge.offsetHeight)}function se(){e.scrollable&&(e.useUnifiedContainer?ne():(X(),ie()))}function ve(D){var Q;return!(!((Q=i.value)===null||Q===void 0)&&Q.contains(Im(D)))}function Te(D){D.preventDefault(),D.stopPropagation(),_=!0,Go("mousemove",window,Ce,!0),Go("mouseup",window,Ze,!0),R=v.value,B=n!=null&&n.value?window.innerWidth-D.clientX:D.clientX}function Ce(D){if(!_)return;O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x);const{value:Q}=m,{value:ge}=u,{value:Ee}=te;if(Q===null||ge===null)return;const lt=(n!=null&&n.value?window.innerWidth-D.clientX-B:D.clientX-B)*(ge-Q)/(Q-Ee),Tt=ge-Q;let ke=R+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;if(st){st.scrollLeft=ke*(n!=null&&n.value?-1:1);const{internalOnUpdateScrollLeft:jt}=e;jt&&jt(ke)}}function Ze(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,Ce,!0),lo("mouseup",window,Ze,!0),_=!1,se(),ve(D)&&M()}function Qe(D){D.preventDefault(),D.stopPropagation(),w=!0,Go("mousemove",window,nt,!0),Go("mouseup",window,it,!0),F=S.value,j=D.clientY}function nt(D){if(!w)return;O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x);const{value:Q}=p,{value:ge}=d,{value:Ee}=G;if(Q===null||ge===null)return;const lt=(D.clientY-j)*(ge-Q)/(Q-Ee),Tt=ge-Q;let ke=F+lt;ke=Math.min(Tt,ke),ke=Math.max(ke,0);const{value:st}=he;st&&(st.scrollTop=ke)}function it(D){D.preventDefault(),D.stopPropagation(),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0),w=!1,se(),ve(D)&&M()}sn(()=>{const{value:D}=Ve,{value:Q}=Fe,{value:ge}=t,{value:Ee}=c,{value:je}=s;Ee&&(D?Ee.classList.remove(`${ge}-scrollbar-rail--disabled`):Ee.classList.add(`${ge}-scrollbar-rail--disabled`)),je&&(Q?je.classList.remove(`${ge}-scrollbar-rail--disabled`):je.classList.add(`${ge}-scrollbar-rail--disabled`))}),Mo(()=>{e.container||se()}),nr(()=>{O!==void 0&&window.clearTimeout(O),x!==void 0&&window.clearTimeout(x),lo("mousemove",window,nt,!0),lo("mouseup",window,it,!0)});const Wt=Y(()=>{const{common:{cubicBezierEaseInOut:D},self:{color:Q,colorHover:ge,height:Ee,width:je,borderRadius:lt,railInsetHorizontalTop:Tt,railInsetHorizontalBottom:ke,railInsetVerticalRight:st,railInsetVerticalLeft:jt,railColor:_n}}=J.value,{top:Oi,right:sr,bottom:cr,left:Bi}=Vo(Tt),{top:Li,right:En,bottom:bo,left:C}=Vo(ke),{top:E,right:de,bottom:Ie,left:Oe}=Vo(n!=null&&n.value?_s(st):st),{top:Ae,right:oo,bottom:ro,left:no}=Vo(n!=null&&n.value?_s(jt):jt);return{"--n-scrollbar-bezier":D,"--n-scrollbar-color":Q,"--n-scrollbar-color-hover":ge,"--n-scrollbar-border-radius":lt,"--n-scrollbar-width":je,"--n-scrollbar-height":Ee,"--n-scrollbar-rail-top-horizontal-top":Oi,"--n-scrollbar-rail-right-horizontal-top":sr,"--n-scrollbar-rail-bottom-horizontal-top":cr,"--n-scrollbar-rail-left-horizontal-top":Bi,"--n-scrollbar-rail-top-horizontal-bottom":Li,"--n-scrollbar-rail-right-horizontal-bottom":En,"--n-scrollbar-rail-bottom-horizontal-bottom":bo,"--n-scrollbar-rail-left-horizontal-bottom":C,"--n-scrollbar-rail-top-vertical-right":E,"--n-scrollbar-rail-right-vertical-right":de,"--n-scrollbar-rail-bottom-vertical-right":Ie,"--n-scrollbar-rail-left-vertical-right":Oe,"--n-scrollbar-rail-top-vertical-left":Ae,"--n-scrollbar-rail-right-vertical-left":oo,"--n-scrollbar-rail-bottom-vertical-left":ro,"--n-scrollbar-rail-left-vertical-left":no,"--n-scrollbar-rail-color":_n}}),Ht=o?Fr("scrollbar",void 0,Wt,e):void 0;return Object.assign(Object.assign({},{scrollTo:rt,scrollBy:h,sync:se,syncUnifiedContainer:ne,handleMouseEnterWrapper:P,handleMouseLeaveWrapper:H}),{mergedClsPrefix:t,rtlEnabled:n,containerScrollTop:S,wrapperRef:i,containerRef:a,contentRef:l,yRailRef:s,xRailRef:c,needYBar:Fe,needXBar:Ve,yBarSizePx:le,xBarSizePx:N,yBarTopPx:ye,xBarLeftPx:Re,isShowXBar:qe,isShowYBar:gt,isIos:A,handleScroll:I,handleContentResize:Ge,handleContainerResize:Pt,handleYScrollMouseDown:Qe,handleXScrollMouseDown:Te,cssVars:o?void 0:Wt,themeClass:Ht==null?void 0:Ht.themeClass,onRender:Ht==null?void 0:Ht.onRender})},render(){var e;const{$slots:t,mergedClsPrefix:o,triggerDisplayManually:r,rtlEnabled:n,internalHoistYRail:i,yPlacement:a,xPlacement:l,xScrollable:s}=this;if(!this.scrollable)return(e=t.default)===null||e===void 0?void 0:e.call(t);const c=this.trigger==="none",d=(m,f)=>y("div",{ref:"yRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--vertical`,`${o}-scrollbar-rail--vertical--${a}`,m],"data-scrollbar-rail":!0,style:[f||"",this.verticalRailStyle],"aria-hidden":!0},y(c?Ms:un,c?null:{name:"fade-in-transition"},{default:()=>this.needYBar&&this.isShowYBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{height:this.yBarSizePx,top:this.yBarTopPx},onMousedown:this.handleYScrollMouseDown}):null})),u=()=>{var m,f;return(m=this.onRender)===null||m===void 0||m.call(this),y("div",Sd(this.$attrs,{role:"none",ref:"wrapperRef",class:[`${o}-scrollbar`,this.themeClass,n&&`${o}-scrollbar--rtl`],style:this.cssVars,onMouseenter:r?void 0:this.handleMouseEnterWrapper,onMouseleave:r?void 0:this.handleMouseLeaveWrapper}),[this.container?(f=t.default)===null||f===void 0?void 0:f.call(t):y("div",{role:"none",ref:"containerRef",class:[`${o}-scrollbar-container`,this.containerClass],style:this.containerStyle,onScroll:this.handleScroll,onWheel:this.onWheel},y(Fa,{onResize:this.handleContentResize},{default:()=>y("div",{ref:"contentRef",role:"none",style:[{width:this.xScrollable?"fit-content":null},this.contentStyle],class:[`${o}-scrollbar-content`,this.contentClass]},t)})),i?null:d(void 0,void 0),s&&y("div",{ref:"xRailRef",class:[`${o}-scrollbar-rail`,`${o}-scrollbar-rail--horizontal`,`${o}-scrollbar-rail--horizontal--${l}`],style:this.horizontalRailStyle,"data-scrollbar-rail":!0,"aria-hidden":!0},y(c?Ms:un,c?null:{name:"fade-in-transition"},{default:()=>this.needXBar&&this.isShowXBar&&!this.isIos?y("div",{class:`${o}-scrollbar-rail__scrollbar`,style:{width:this.xBarSizePx,right:n?this.xBarLeftPx:void 0,left:n?void 0:this.xBarLeftPx},onMousedown:this.handleXScrollMouseDown}):null}))])},p=this.container?u():y(Fa,{onResize:this.handleContainerResize},{default:u});return i?y(et,null,p,d(this.themeClass,this.cssVars)):p}}),xP=Hu,Hy={iconSizeTiny:"28px",iconSizeSmall:"34px",iconSizeMedium:"40px",iconSizeLarge:"46px",iconSizeHuge:"52px"};function ku(e){const{textColorDisabled:t,iconColor:o,textColor2:r,fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s}=e;return Object.assign(Object.assign({},Hy),{fontSizeTiny:n,fontSizeSmall:i,fontSizeMedium:a,fontSizeLarge:l,fontSizeHuge:s,textColor:t,iconColor:o,extraTextColor:r})}const xl={name:"Empty",common:Be,self:ku},ar={name:"Empty",common:W,self:ku},ky={height:"calc(var(--n-option-height) * 7.6)",paddingTiny:"4px 0",paddingSmall:"4px 0",paddingMedium:"4px 0",paddingLarge:"4px 0",paddingHuge:"4px 0",optionPaddingTiny:"0 12px",optionPaddingSmall:"0 12px",optionPaddingMedium:"0 12px",optionPaddingLarge:"0 12px",optionPaddingHuge:"0 12px",loadingSize:"18px"};function Du(e){const{borderRadius:t,popoverColor:o,textColor3:r,dividerColor:n,textColor2:i,primaryColorPressed:a,textColorDisabled:l,primaryColor:s,opacityDisabled:c,hoverColor:d,fontSizeTiny:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,fontSizeHuge:g,heightTiny:S,heightSmall:v,heightMedium:$,heightLarge:T,heightHuge:w}=e;return Object.assign(Object.assign({},ky),{optionFontSizeTiny:u,optionFontSizeSmall:p,optionFontSizeMedium:m,optionFontSizeLarge:f,optionFontSizeHuge:g,optionHeightTiny:S,optionHeightSmall:v,optionHeightMedium:$,optionHeightLarge:T,optionHeightHuge:w,borderRadius:t,color:o,groupHeaderTextColor:r,actionDividerColor:n,optionTextColor:i,optionTextColorPressed:a,optionTextColorDisabled:l,optionTextColorActive:s,optionOpacityDisabled:c,optionCheckColor:s,optionColorPending:d,optionColorActive:"rgba(0, 0, 0, 0)",optionColorActivePending:d,actionTextColor:i,loadingColor:s})}const Ou={name:"InternalSelectMenu",common:Be,peers:{Scrollbar:Rn,Empty:xl},self:Du},Fn={name:"InternalSelectMenu",common:W,peers:{Scrollbar:St,Empty:ar},self:Du},Dy={space:"6px",spaceArrow:"10px",arrowOffset:"10px",arrowOffsetVertical:"10px",arrowHeight:"6px",padding:"8px 14px"};function Bu(e){const{boxShadow2:t,popoverColor:o,textColor2:r,borderRadius:n,fontSize:i,dividerColor:a}=e;return Object.assign(Object.assign({},Dy),{fontSize:i,borderRadius:n,color:o,dividerColor:a,textColor:r,boxShadow:t})}const zr={name:"Popover",common:Be,self:Bu},lr={name:"Popover",common:W,self:Bu},Oy={closeIconSizeTiny:"12px",closeIconSizeSmall:"12px",closeIconSizeMedium:"14px",closeIconSizeLarge:"14px",closeSizeTiny:"16px",closeSizeSmall:"16px",closeSizeMedium:"18px",closeSizeLarge:"18px",padding:"0 7px",closeMargin:"0 0 0 4px"},Lu={name:"Tag",common:W,self(e){const{textColor2:t,primaryColorHover:o,primaryColorPressed:r,primaryColor:n,infoColor:i,successColor:a,warningColor:l,errorColor:s,baseColor:c,borderColor:d,tagColor:u,opacityDisabled:p,closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderRadiusSmall:$,fontSizeMini:T,fontSizeTiny:w,fontSizeSmall:_,fontSizeMedium:O,heightMini:x,heightTiny:F,heightSmall:R,heightMedium:B,buttonColor2Hover:j,buttonColor2Pressed:A,fontWeightStrong:J}=e;return Object.assign(Object.assign({},Oy),{closeBorderRadius:$,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,borderRadius:$,opacityDisabled:p,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:_,fontSizeLarge:O,fontWeightStrong:J,textColorCheckable:t,textColorHoverCheckable:t,textColorPressedCheckable:t,textColorChecked:c,colorCheckable:"#0000",colorHoverCheckable:j,colorPressedCheckable:A,colorChecked:n,colorCheckedHover:o,colorCheckedPressed:r,border:`1px solid ${d}`,textColor:t,color:u,colorBordered:"#0000",closeIconColor:m,closeIconColorHover:f,closeIconColorPressed:g,closeColorHover:S,closeColorPressed:v,borderPrimary:`1px solid ${K(n,{alpha:.3})}`,textColorPrimary:n,colorPrimary:K(n,{alpha:.16}),colorBorderedPrimary:"#0000",closeIconColorPrimary:Ne(n,{lightness:.7}),closeIconColorHoverPrimary:Ne(n,{lightness:.7}),closeIconColorPressedPrimary:Ne(n,{lightness:.7}),closeColorHoverPrimary:K(n,{alpha:.16}),closeColorPressedPrimary:K(n,{alpha:.12}),borderInfo:`1px solid ${K(i,{alpha:.3})}`,textColorInfo:i,colorInfo:K(i,{alpha:.16}),colorBorderedInfo:"#0000",closeIconColorInfo:Ne(i,{alpha:.7}),closeIconColorHoverInfo:Ne(i,{alpha:.7}),closeIconColorPressedInfo:Ne(i,{alpha:.7}),closeColorHoverInfo:K(i,{alpha:.16}),closeColorPressedInfo:K(i,{alpha:.12}),borderSuccess:`1px solid ${K(a,{alpha:.3})}`,textColorSuccess:a,colorSuccess:K(a,{alpha:.16}),colorBorderedSuccess:"#0000",closeIconColorSuccess:Ne(a,{alpha:.7}),closeIconColorHoverSuccess:Ne(a,{alpha:.7}),closeIconColorPressedSuccess:Ne(a,{alpha:.7}),closeColorHoverSuccess:K(a,{alpha:.16}),closeColorPressedSuccess:K(a,{alpha:.12}),borderWarning:`1px solid ${K(l,{alpha:.3})}`,textColorWarning:l,colorWarning:K(l,{alpha:.16}),colorBorderedWarning:"#0000",closeIconColorWarning:Ne(l,{alpha:.7}),closeIconColorHoverWarning:Ne(l,{alpha:.7}),closeIconColorPressedWarning:Ne(l,{alpha:.7}),closeColorHoverWarning:K(l,{alpha:.16}),closeColorPressedWarning:K(l,{alpha:.11}),borderError:`1px solid ${K(s,{alpha:.3})}`,textColorError:s,colorError:K(s,{alpha:.16}),colorBorderedError:"#0000",closeIconColorError:Ne(s,{alpha:.7}),closeIconColorHoverError:Ne(s,{alpha:.7}),closeIconColorPressedError:Ne(s,{alpha:.7}),closeColorHoverError:K(s,{alpha:.16}),closeColorPressedError:K(s,{alpha:.12})})}},By=He({name:"InternalSelectionSuffix",props:{clsPrefix:{type:String,required:!0},showArrow:{type:Boolean,default:void 0},showClear:{type:Boolean,default:void 0},loading:{type:Boolean,default:!1},onClear:Function},setup(e,{slots:t}){return()=>{const{clsPrefix:o}=e;return y(vl,{clsPrefix:o,class:`${o}-base-suffix`,strokeWidth:24,scale:.85,show:e.loading},{default:()=>e.showArrow?y(ka,{clsPrefix:o,show:e.showClear,onClear:e.onClear},{placeholder:()=>y(Tr,{clsPrefix:o,class:`${o}-base-suffix__arrow`},{default:()=>Qr(t.default,()=>[y(fy,null)])})}):null})}}}),Wu={paddingSingle:"0 26px 0 12px",paddingMultiple:"3px 26px 0 12px",clearSize:"16px",arrowSize:"16px"},Cl={name:"InternalSelection",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,iconColor:p,iconColorDisabled:m,clearColor:f,clearColorHover:g,clearColorPressed:S,placeholderColor:v,placeholderColorDisabled:$,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:_,fontSizeLarge:O,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,fontWeight:j}=e;return Object.assign(Object.assign({},Wu),{fontWeight:j,fontSizeTiny:T,fontSizeSmall:w,fontSizeMedium:_,fontSizeLarge:O,heightTiny:x,heightSmall:F,heightMedium:R,heightLarge:B,borderRadius:t,textColor:o,textColorDisabled:r,placeholderColor:v,placeholderColorDisabled:$,color:n,colorDisabled:i,colorActive:K(a,{alpha:.1}),border:"1px solid #0000",borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 8px 0 ${K(a,{alpha:.4})}`,boxShadowFocus:`0 0 8px 0 ${K(a,{alpha:.4})}`,caretColor:a,arrowColor:p,arrowColorDisabled:m,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.4})}`,colorActiveWarning:K(s,{alpha:.1}),caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 8px 0 ${K(d,{alpha:.4})}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.4})}`,colorActiveError:K(d,{alpha:.1}),caretColorError:d,clearColor:f,clearColorHover:g,clearColorPressed:S})}};function Ly(e){const{borderRadius:t,textColor2:o,textColorDisabled:r,inputColor:n,inputColorDisabled:i,primaryColor:a,primaryColorHover:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderColor:p,iconColor:m,iconColorDisabled:f,clearColor:g,clearColorHover:S,clearColorPressed:v,placeholderColor:$,placeholderColorDisabled:T,fontSizeTiny:w,fontSizeSmall:_,fontSizeMedium:O,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:B,heightLarge:j,fontWeight:A}=e;return Object.assign(Object.assign({},Wu),{fontSizeTiny:w,fontSizeSmall:_,fontSizeMedium:O,fontSizeLarge:x,heightTiny:F,heightSmall:R,heightMedium:B,heightLarge:j,borderRadius:t,fontWeight:A,textColor:o,textColorDisabled:r,placeholderColor:$,placeholderColorDisabled:T,color:n,colorDisabled:i,colorActive:n,border:`1px solid ${p}`,borderHover:`1px solid ${l}`,borderActive:`1px solid ${a}`,borderFocus:`1px solid ${l}`,boxShadowHover:"none",boxShadowActive:`0 0 0 2px ${K(a,{alpha:.2})}`,boxShadowFocus:`0 0 0 2px ${K(a,{alpha:.2})}`,caretColor:a,arrowColor:m,arrowColorDisabled:f,loadingColor:a,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,borderActiveWarning:`1px solid ${s}`,borderFocusWarning:`1px solid ${c}`,boxShadowHoverWarning:"none",boxShadowActiveWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,boxShadowFocusWarning:`0 0 0 2px ${K(s,{alpha:.2})}`,colorActiveWarning:n,caretColorWarning:s,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,borderActiveError:`1px solid ${d}`,borderFocusError:`1px solid ${u}`,boxShadowHoverError:"none",boxShadowActiveError:`0 0 0 2px ${K(d,{alpha:.2})}`,boxShadowFocusError:`0 0 0 2px ${K(d,{alpha:.2})}`,colorActiveError:n,caretColorError:d,clearColor:g,clearColorHover:S,clearColorPressed:v})}const Wy={name:"InternalSelection",common:Be,peers:{Popover:zr},self:Ly},{cubicBezierEaseInOut:xo}=ko;function jy({duration:e=".2s",delay:t=".1s"}={}){return[L("&.fade-in-width-expand-transition-leave-from, &.fade-in-width-expand-transition-enter-to",{opacity:1}),L("&.fade-in-width-expand-transition-leave-to, &.fade-in-width-expand-transition-enter-from",` opacity: 0!important; margin-left: 0!important; margin-right: 0!important; @@ -237,29 +237,29 @@ ${t} top: 0; bottom: 0; border-radius: inherit; -`),Vy=He({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){Mr("-base-wave",Ny,Dt(e,"clsPrefix"));const t=fe(null),o=fe(!1);let r=null;return nr(()=>{r!==null&&window.clearTimeout(r)}),{active:o,selfRef:t,play(){r!==null&&(window.clearTimeout(r),o.value=!1,r=null),nn(()=>{var n;(n=t.value)===null||n===void 0||n.offsetHeight,o.value=!0,r=window.setTimeout(()=>{o.value=!1,r=null},1e3)})}}},render(){const{clsPrefix:e}=this;return y("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),qy={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},Uy={name:"Alert",common:W,self(e){const{lineHeight:t,borderRadius:o,fontWeightStrong:r,dividerColor:n,inputColor:i,textColor1:a,textColor2:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,infoColorSuppl:m,successColorSuppl:f,warningColorSuppl:g,errorColorSuppl:S,fontSize:v}=e;return Object.assign(Object.assign({},qy),{fontSize:v,lineHeight:t,titleFontWeight:r,borderRadius:o,border:`1px solid ${n}`,color:i,titleTextColor:a,iconColor:l,contentTextColor:l,closeBorderRadius:o,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderInfo:`1px solid ${K(m,{alpha:.35})}`,colorInfo:K(m,{alpha:.25}),titleTextColorInfo:a,iconColorInfo:m,contentTextColorInfo:l,closeColorHoverInfo:s,closeColorPressedInfo:c,closeIconColorInfo:d,closeIconColorHoverInfo:u,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${K(f,{alpha:.35})}`,colorSuccess:K(f,{alpha:.25}),titleTextColorSuccess:a,iconColorSuccess:f,contentTextColorSuccess:l,closeColorHoverSuccess:s,closeColorPressedSuccess:c,closeIconColorSuccess:d,closeIconColorHoverSuccess:u,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${K(g,{alpha:.35})}`,colorWarning:K(g,{alpha:.25}),titleTextColorWarning:a,iconColorWarning:g,contentTextColorWarning:l,closeColorHoverWarning:s,closeColorPressedWarning:c,closeIconColorWarning:d,closeIconColorHoverWarning:u,closeIconColorPressedWarning:p,borderError:`1px solid ${K(S,{alpha:.35})}`,colorError:K(S,{alpha:.25}),titleTextColorError:a,iconColorError:S,contentTextColorError:l,closeColorHoverError:s,closeColorPressedError:c,closeIconColorError:d,closeIconColorHoverError:u,closeIconColorPressedError:p})}},{cubicBezierEaseInOut:qt,cubicBezierEaseOut:Gy,cubicBezierEaseIn:Ky}=ko;function Yy({overflow:e="hidden",duration:t=".3s",originalTransition:o="",leavingDelay:r="0s",foldPadding:n=!1,enterToProps:i=void 0,leaveToProps:a=void 0,reverse:l=!1}={}){const s=l?"leave":"enter",c=l?"enter":"leave";return[L(`&.fade-in-height-expand-transition-${c}-from, +`),Vy=He({name:"BaseWave",props:{clsPrefix:{type:String,required:!0}},setup(e){Er("-base-wave",Ny,Dt(e,"clsPrefix"));const t=fe(null),o=fe(!1);let r=null;return nr(()=>{r!==null&&window.clearTimeout(r)}),{active:o,selfRef:t,play(){r!==null&&(window.clearTimeout(r),o.value=!1,r=null),nn(()=>{var n;(n=t.value)===null||n===void 0||n.offsetHeight,o.value=!0,r=window.setTimeout(()=>{o.value=!1,r=null},1e3)})}}},render(){const{clsPrefix:e}=this;return y("div",{ref:"selfRef","aria-hidden":!0,class:[`${e}-base-wave`,this.active&&`${e}-base-wave--active`]})}}),Uy={iconMargin:"11px 8px 0 12px",iconMarginRtl:"11px 12px 0 8px",iconSize:"24px",closeIconSize:"16px",closeSize:"20px",closeMargin:"13px 14px 0 0",closeMarginRtl:"13px 0 0 14px",padding:"13px"},qy={name:"Alert",common:W,self(e){const{lineHeight:t,borderRadius:o,fontWeightStrong:r,dividerColor:n,inputColor:i,textColor1:a,textColor2:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,infoColorSuppl:m,successColorSuppl:f,warningColorSuppl:g,errorColorSuppl:S,fontSize:v}=e;return Object.assign(Object.assign({},Uy),{fontSize:v,lineHeight:t,titleFontWeight:r,borderRadius:o,border:`1px solid ${n}`,color:i,titleTextColor:a,iconColor:l,contentTextColor:l,closeBorderRadius:o,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderInfo:`1px solid ${K(m,{alpha:.35})}`,colorInfo:K(m,{alpha:.25}),titleTextColorInfo:a,iconColorInfo:m,contentTextColorInfo:l,closeColorHoverInfo:s,closeColorPressedInfo:c,closeIconColorInfo:d,closeIconColorHoverInfo:u,closeIconColorPressedInfo:p,borderSuccess:`1px solid ${K(f,{alpha:.35})}`,colorSuccess:K(f,{alpha:.25}),titleTextColorSuccess:a,iconColorSuccess:f,contentTextColorSuccess:l,closeColorHoverSuccess:s,closeColorPressedSuccess:c,closeIconColorSuccess:d,closeIconColorHoverSuccess:u,closeIconColorPressedSuccess:p,borderWarning:`1px solid ${K(g,{alpha:.35})}`,colorWarning:K(g,{alpha:.25}),titleTextColorWarning:a,iconColorWarning:g,contentTextColorWarning:l,closeColorHoverWarning:s,closeColorPressedWarning:c,closeIconColorWarning:d,closeIconColorHoverWarning:u,closeIconColorPressedWarning:p,borderError:`1px solid ${K(S,{alpha:.35})}`,colorError:K(S,{alpha:.25}),titleTextColorError:a,iconColorError:S,contentTextColorError:l,closeColorHoverError:s,closeColorPressedError:c,closeIconColorError:d,closeIconColorHoverError:u,closeIconColorPressedError:p})}},{cubicBezierEaseInOut:Ut,cubicBezierEaseOut:Gy,cubicBezierEaseIn:Ky}=ko;function Yy({overflow:e="hidden",duration:t=".3s",originalTransition:o="",leavingDelay:r="0s",foldPadding:n=!1,enterToProps:i=void 0,leaveToProps:a=void 0,reverse:l=!1}={}){const s=l?"leave":"enter",c=l?"enter":"leave";return[L(`&.fade-in-height-expand-transition-${c}-from, &.fade-in-height-expand-transition-${s}-to`,Object.assign(Object.assign({},i),{opacity:1})),L(`&.fade-in-height-expand-transition-${c}-to, &.fade-in-height-expand-transition-${s}-from`,Object.assign(Object.assign({},a),{opacity:0,marginTop:"0 !important",marginBottom:"0 !important",paddingTop:n?"0 !important":void 0,paddingBottom:n?"0 !important":void 0})),L(`&.fade-in-height-expand-transition-${c}-active`,` overflow: ${e}; transition: - max-height ${t} ${qt} ${r}, + max-height ${t} ${Ut} ${r}, opacity ${t} ${Gy} ${r}, - margin-top ${t} ${qt} ${r}, - margin-bottom ${t} ${qt} ${r}, - padding-top ${t} ${qt} ${r}, - padding-bottom ${t} ${qt} ${r} + margin-top ${t} ${Ut} ${r}, + margin-bottom ${t} ${Ut} ${r}, + padding-top ${t} ${Ut} ${r}, + padding-bottom ${t} ${Ut} ${r} ${o?`,${o}`:""} `),L(`&.fade-in-height-expand-transition-${s}-active`,` overflow: ${e}; transition: - max-height ${t} ${qt}, + max-height ${t} ${Ut}, opacity ${t} ${Ky}, - margin-top ${t} ${qt}, - margin-bottom ${t} ${qt}, - padding-top ${t} ${qt}, - padding-bottom ${t} ${qt} + margin-top ${t} ${Ut}, + margin-bottom ${t} ${Ut}, + padding-top ${t} ${Ut}, + padding-bottom ${t} ${Ut} ${o?`,${o}`:""} - `)]}const Xy={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"};function Jy(e){const{borderRadius:t,railColor:o,primaryColor:r,primaryColorHover:n,primaryColorPressed:i,textColor2:a}=e;return Object.assign(Object.assign({},Xy),{borderRadius:t,railColor:o,railColorActive:r,linkColor:K(r,{alpha:.15}),linkTextColor:a,linkTextColorHover:n,linkTextColorPressed:i,linkTextColorActive:r})}const Zy={name:"Anchor",common:W,self:Jy},Qy=Ei&&"chrome"in window;Ei&&navigator.userAgent.includes("Firefox");const ju=Ei&&navigator.userAgent.includes("Safari")&&!Qy,Nu={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},At={name:"Input",common:W,self(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderRadius:p,lineHeight:m,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:z,clearColor:B,clearColorHover:x,clearColorPressed:F,placeholderColor:R,placeholderColorDisabled:O,iconColor:j,iconColorDisabled:_,iconColorHover:J,iconColorPressed:G,fontWeight:le}=e;return Object.assign(Object.assign({},Nu),{fontWeight:le,countTextColorDisabled:r,countTextColor:o,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:z,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,lineHeight:m,lineHeightTextarea:m,borderRadius:p,iconSize:"16px",groupLabelColor:a,textColor:t,textColorDisabled:r,textDecorationColor:t,groupLabelTextColor:t,caretColor:n,placeholderColor:R,placeholderColorDisabled:O,color:a,colorDisabled:l,colorFocus:K(n,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${i}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`,loadingColor:n,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:K(s,{alpha:.1}),borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,colorFocusError:K(d,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.3})}`,caretColorError:d,clearColor:B,clearColorHover:x,clearColorPressed:F,iconColor:j,iconColorDisabled:_,iconColorHover:J,iconColorPressed:G,suffixTextColor:t})}};function e1(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,borderColor:s,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:p,borderRadius:m,lineHeight:f,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,heightTiny:T,heightSmall:w,heightMedium:z,heightLarge:B,actionColor:x,clearColor:F,clearColorHover:R,clearColorPressed:O,placeholderColor:j,placeholderColorDisabled:_,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,fontWeight:N}=e;return Object.assign(Object.assign({},Nu),{fontWeight:N,countTextColorDisabled:r,countTextColor:o,heightTiny:T,heightSmall:w,heightMedium:z,heightLarge:B,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,lineHeight:f,lineHeightTextarea:f,borderRadius:m,iconSize:"16px",groupLabelColor:x,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:n,placeholderColor:j,placeholderColorDisabled:_,color:a,colorDisabled:l,colorFocus:a,groupLabelBorder:`1px solid ${s}`,border:`1px solid ${s}`,borderHover:`1px solid ${i}`,borderDisabled:`1px solid ${s}`,borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 0 2px ${K(n,{alpha:.2})}`,loadingColor:n,loadingColorWarning:c,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:a,borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 0 2px ${K(c,{alpha:.2})}`,caretColorWarning:c,loadingColorError:u,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${p}`,colorFocusError:a,borderFocusError:`1px solid ${p}`,boxShadowFocusError:`0 0 0 2px ${K(u,{alpha:.2})}`,caretColorError:u,clearColor:F,clearColorHover:R,clearColorPressed:O,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,suffixTextColor:t})}const ki={name:"Input",common:Oe,self:e1},Vu="n-input",t1=pe("input",` + `)]}const Xy={linkFontSize:"13px",linkPadding:"0 0 0 16px",railWidth:"4px"};function Jy(e){const{borderRadius:t,railColor:o,primaryColor:r,primaryColorHover:n,primaryColorPressed:i,textColor2:a}=e;return Object.assign(Object.assign({},Xy),{borderRadius:t,railColor:o,railColorActive:r,linkColor:K(r,{alpha:.15}),linkTextColor:a,linkTextColorHover:n,linkTextColorPressed:i,linkTextColorActive:r})}const Zy={name:"Anchor",common:W,self:Jy},Qy=Ii&&"chrome"in window;Ii&&navigator.userAgent.includes("Firefox");const ju=Ii&&navigator.userAgent.includes("Safari")&&!Qy,Nu={paddingTiny:"0 8px",paddingSmall:"0 10px",paddingMedium:"0 12px",paddingLarge:"0 14px",clearSize:"16px"},zt={name:"Input",common:W,self(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,warningColor:s,warningColorHover:c,errorColor:d,errorColorHover:u,borderRadius:p,lineHeight:m,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:_,clearColor:O,clearColorHover:x,clearColorPressed:F,placeholderColor:R,placeholderColorDisabled:B,iconColor:j,iconColorDisabled:A,iconColorHover:J,iconColorPressed:G,fontWeight:le}=e;return Object.assign(Object.assign({},Nu),{fontWeight:le,countTextColorDisabled:r,countTextColor:o,heightTiny:$,heightSmall:T,heightMedium:w,heightLarge:_,fontSizeTiny:f,fontSizeSmall:g,fontSizeMedium:S,fontSizeLarge:v,lineHeight:m,lineHeightTextarea:m,borderRadius:p,iconSize:"16px",groupLabelColor:a,textColor:t,textColorDisabled:r,textDecorationColor:t,groupLabelTextColor:t,caretColor:n,placeholderColor:R,placeholderColorDisabled:B,color:a,colorDisabled:l,colorFocus:K(n,{alpha:.1}),groupLabelBorder:"1px solid #0000",border:"1px solid #0000",borderHover:`1px solid ${i}`,borderDisabled:"1px solid #0000",borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`,loadingColor:n,loadingColorWarning:s,borderWarning:`1px solid ${s}`,borderHoverWarning:`1px solid ${c}`,colorFocusWarning:K(s,{alpha:.1}),borderFocusWarning:`1px solid ${c}`,boxShadowFocusWarning:`0 0 8px 0 ${K(s,{alpha:.3})}`,caretColorWarning:s,loadingColorError:d,borderError:`1px solid ${d}`,borderHoverError:`1px solid ${u}`,colorFocusError:K(d,{alpha:.1}),borderFocusError:`1px solid ${u}`,boxShadowFocusError:`0 0 8px 0 ${K(d,{alpha:.3})}`,caretColorError:d,clearColor:O,clearColorHover:x,clearColorPressed:F,iconColor:j,iconColorDisabled:A,iconColorHover:J,iconColorPressed:G,suffixTextColor:t})}};function e1(e){const{textColor2:t,textColor3:o,textColorDisabled:r,primaryColor:n,primaryColorHover:i,inputColor:a,inputColorDisabled:l,borderColor:s,warningColor:c,warningColorHover:d,errorColor:u,errorColorHover:p,borderRadius:m,lineHeight:f,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,heightTiny:T,heightSmall:w,heightMedium:_,heightLarge:O,actionColor:x,clearColor:F,clearColorHover:R,clearColorPressed:B,placeholderColor:j,placeholderColorDisabled:A,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,fontWeight:N}=e;return Object.assign(Object.assign({},Nu),{fontWeight:N,countTextColorDisabled:r,countTextColor:o,heightTiny:T,heightSmall:w,heightMedium:_,heightLarge:O,fontSizeTiny:g,fontSizeSmall:S,fontSizeMedium:v,fontSizeLarge:$,lineHeight:f,lineHeightTextarea:f,borderRadius:m,iconSize:"16px",groupLabelColor:x,groupLabelTextColor:t,textColor:t,textColorDisabled:r,textDecorationColor:t,caretColor:n,placeholderColor:j,placeholderColorDisabled:A,color:a,colorDisabled:l,colorFocus:a,groupLabelBorder:`1px solid ${s}`,border:`1px solid ${s}`,borderHover:`1px solid ${i}`,borderDisabled:`1px solid ${s}`,borderFocus:`1px solid ${i}`,boxShadowFocus:`0 0 0 2px ${K(n,{alpha:.2})}`,loadingColor:n,loadingColorWarning:c,borderWarning:`1px solid ${c}`,borderHoverWarning:`1px solid ${d}`,colorFocusWarning:a,borderFocusWarning:`1px solid ${d}`,boxShadowFocusWarning:`0 0 0 2px ${K(c,{alpha:.2})}`,caretColorWarning:c,loadingColorError:u,borderError:`1px solid ${u}`,borderHoverError:`1px solid ${p}`,colorFocusError:a,borderFocusError:`1px solid ${p}`,boxShadowFocusError:`0 0 0 2px ${K(u,{alpha:.2})}`,caretColorError:u,clearColor:F,clearColorHover:R,clearColorPressed:B,iconColor:J,iconColorDisabled:G,iconColorHover:le,iconColorPressed:te,suffixTextColor:t})}const ki={name:"Input",common:Be,self:e1},Vu="n-input",t1=pe("input",` max-width: 100%; cursor: text; line-height: 1.5; @@ -492,8 +492,8 @@ ${t} border: var(--n-border-focus-${e}); `)])])]))]),o1=pe("input",[re("disabled",[V("input-el, textarea-el",` -webkit-text-fill-color: var(--n-text-color-disabled); - `)])]);function r1(e){let t=0;for(const o of e)t++;return t}function qn(e){return e===""||e==null}function n1(e){const t=fe(null);function o(){const{value:i}=e;if(!(i!=null&&i.focus)){n();return}const{selectionStart:a,selectionEnd:l,value:s}=i;if(a==null||l==null){n();return}t.value={start:a,end:l,beforeText:s.slice(0,a),afterText:s.slice(l)}}function r(){var i;const{value:a}=t,{value:l}=e;if(!a||!l)return;const{value:s}=l,{start:c,beforeText:d,afterText:u}=a;let p=s.length;if(s.endsWith(u))p=s.length-u.length;else if(s.startsWith(d))p=d.length;else{const m=d[c-1],f=s.indexOf(m,c-1);f!==-1&&(p=f+1)}(i=l.setSelectionRange)===null||i===void 0||i.call(l,p,p)}function n(){t.value=null}return Zt(e,n),{recordCursor:o,restoreCursor:r}}const Zs=He({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:o,maxlengthRef:r,mergedClsPrefixRef:n,countGraphemesRef:i}=Le(Vu),a=Y(()=>{const{value:l}=o;return l===null||Array.isArray(l)?0:(i.value||r1)(l)});return()=>{const{value:l}=r,{value:s}=o;return y("span",{class:`${n.value}-input-word-count`},Eb(t.default,{value:s===null||Array.isArray(s)?"":s},()=>[l===void 0?a.value:`${a.value} / ${l}`]))}}}),i1=Object.assign(Object.assign({},Ct.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),CP=He({name:"Input",props:i1,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:o,inlineThemeDisabled:r,mergedRtlRef:n}=Ao(e),i=Ct("Input","-input",t1,ki,e,t);ju&&Mr("-input-safari",o1,t);const a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=n1(p),f=fe(null),{localeRef:g}=ly("Input"),S=fe(e.defaultValue),v=Dt(e,"value"),$=Km(v,S),T=Zd(e),{mergedSizeRef:w,mergedDisabledRef:z,mergedStatusRef:B}=T,x=fe(!1),F=fe(!1),R=fe(!1),O=fe(!1);let j=null;const _=Y(()=>{const{placeholder:C,pair:M}=e;return M?Array.isArray(C)?C:C===void 0?["",""]:[C,C]:C===void 0?[g.value.placeholder]:[C]}),J=Y(()=>{const{value:C}=R,{value:M}=$,{value:de}=_;return!C&&(qn(M)||Array.isArray(M)&&qn(M[0]))&&de[0]}),G=Y(()=>{const{value:C}=R,{value:M}=$,{value:de}=_;return!C&&de[1]&&(qn(M)||Array.isArray(M)&&qn(M[1]))}),le=hn(()=>e.internalForceFocus||x.value),te=hn(()=>{if(z.value||e.readonly||!e.clearable||!le.value&&!F.value)return!1;const{value:C}=$,{value:M}=le;return e.pair?!!(Array.isArray(C)&&(C[0]||C[1]))&&(F.value||M):!!C&&(F.value||M)}),N=Y(()=>{const{showPasswordOn:C}=e;if(C)return C;if(e.showPasswordToggle)return"click"}),oe=fe(!1),ye=Y(()=>{const{textDecoration:C}=e;return C?Array.isArray(C)?C.map(M=>({textDecoration:M})):[{textDecoration:C}]:["",""]}),Pe=fe(void 0),Re=()=>{var C,M;if(e.type==="textarea"){const{autosize:de}=e;if(de&&(Pe.value=(M=(C=f.value)===null||C===void 0?void 0:C.$el)===null||M===void 0?void 0:M.offsetWidth),!l.value||typeof de=="boolean")return;const{paddingTop:Ee,paddingBottom:Be,lineHeight:_e}=window.getComputedStyle(l.value),oo=Number(Ee.slice(0,-2)),ro=Number(Be.slice(0,-2)),no=Number(_e.slice(0,-2)),{value:kr}=s;if(!kr)return;if(de.minRows){const Dr=Math.max(de.minRows,1),Wi=`${oo+ro+no*Dr}px`;kr.style.minHeight=Wi}if(de.maxRows){const Dr=`${oo+ro+no*de.maxRows}px`;kr.style.maxHeight=Dr}}},Fe=Y(()=>{const{maxlength:C}=e;return C===void 0?void 0:Number(C)});Io(()=>{const{value:C}=$;Array.isArray(C)||st(C)});const Ve=Sn().proxy;function Ue(C,M){const{onUpdateValue:de,"onUpdate:value":Ee,onInput:Be}=e,{nTriggerFormInput:_e}=T;de&&Ke(de,C,M),Ee&&Ke(Ee,C,M),Be&&Ke(Be,C,M),S.value=C,_e()}function gt(C,M){const{onChange:de}=e,{nTriggerFormChange:Ee}=T;de&&Ke(de,C,M),S.value=C,Ee()}function he(C){const{onBlur:M}=e,{nTriggerFormBlur:de}=T;M&&Ke(M,C),de()}function qe(C){const{onFocus:M}=e,{nTriggerFormFocus:de}=T;M&&Ke(M,C),de()}function rt(C){const{onClear:M}=e;M&&Ke(M,C)}function be(C){const{onInputBlur:M}=e;M&&Ke(M,C)}function Ge(C){const{onInputFocus:M}=e;M&&Ke(M,C)}function Pt(){const{onDeactivate:C}=e;C&&Ke(C)}function h(){const{onActivate:C}=e;C&&Ke(C)}function b(C){const{onClick:M}=e;M&&Ke(M,C)}function P(C){const{onWrapperFocus:M}=e;M&&Ke(M,C)}function H(C){const{onWrapperBlur:M}=e;M&&Ke(M,C)}function I(){R.value=!0}function k(C){R.value=!1,C.target===u.value?U(C,1):U(C,0)}function U(C,M=0,de="input"){const Ee=C.target.value;if(st(Ee),C instanceof InputEvent&&!C.isComposing&&(R.value=!1),e.type==="textarea"){const{value:_e}=f;_e&&_e.syncUnifiedContainer()}if(j=Ee,R.value)return;m.recordCursor();const Be=q(Ee);if(Be)if(!e.pair)de==="input"?Ue(Ee,{source:M}):gt(Ee,{source:M});else{let{value:_e}=$;Array.isArray(_e)?_e=[_e[0],_e[1]]:_e=["",""],_e[M]=Ee,de==="input"?Ue(_e,{source:M}):gt(_e,{source:M})}Ve.$forceUpdate(),Be||nn(m.restoreCursor)}function q(C){const{countGraphemes:M,maxlength:de,minlength:Ee}=e;if(M){let _e;if(de!==void 0&&(_e===void 0&&(_e=M(C)),_e>Number(de))||Ee!==void 0&&(_e===void 0&&(_e=M(C)),_e{Ee.preventDefault(),lo("mouseup",document,M)};if(Go("mouseup",document,M),N.value!=="mousedown")return;oe.value=!0;const de=()=>{oe.value=!1,lo("mouseup",document,de)};Go("mouseup",document,de)}function Ht(C){e.onKeyup&&Ke(e.onKeyup,C)}function at(C){switch(e.onKeydown&&Ke(e.onKeydown,C),C.key){case"Escape":Q();break;case"Enter":D(C);break}}function D(C){var M,de;if(e.passivelyActivated){const{value:Ee}=O;if(Ee){e.internalDeactivateOnEnter&&Q();return}C.preventDefault(),e.type==="textarea"?(M=l.value)===null||M===void 0||M.focus():(de=d.value)===null||de===void 0||de.focus()}}function Q(){e.passivelyActivated&&(O.value=!1,nn(()=>{var C;(C=a.value)===null||C===void 0||C.focus()}))}function ge(){var C,M,de;z.value||(e.passivelyActivated?(C=a.value)===null||C===void 0||C.focus():((M=l.value)===null||M===void 0||M.focus(),(de=d.value)===null||de===void 0||de.focus()))}function Me(){var C;!((C=a.value)===null||C===void 0)&&C.contains(document.activeElement)&&document.activeElement.blur()}function je(){var C,M;(C=l.value)===null||C===void 0||C.select(),(M=d.value)===null||M===void 0||M.select()}function lt(){z.value||(l.value?l.value.focus():d.value&&d.value.focus())}function Tt(){const{value:C}=a;C!=null&&C.contains(document.activeElement)&&C!==document.activeElement&&Q()}function ke(C){if(e.type==="textarea"){const{value:M}=l;M==null||M.scrollTo(C)}else{const{value:M}=d;M==null||M.scrollTo(C)}}function st(C){const{type:M,pair:de,autosize:Ee}=e;if(!de&&Ee)if(M==="textarea"){const{value:Be}=s;Be&&(Be.textContent=`${C??""}\r -`)}else{const{value:Be}=c;Be&&(C?Be.textContent=C:Be.innerHTML=" ")}}function jt(){Re()}const zn=fe({top:"0"});function Bi(C){var M;const{scrollTop:de}=C.target;zn.value.top=`${-de}px`,(M=f.value)===null||M===void 0||M.syncUnifiedContainer()}let sr=null;sn(()=>{const{autosize:C,type:M}=e;C&&M==="textarea"?sr=Zt($,de=>{!Array.isArray(de)&&de!==j&&st(de)}):sr==null||sr()});let cr=null;sn(()=>{e.type==="textarea"?cr=Zt($,C=>{var M;!Array.isArray(C)&&C!==j&&((M=f.value)===null||M===void 0||M.syncUnifiedContainer())}):cr==null||cr()}),po(Vu,{mergedValueRef:$,maxlengthRef:Fe,mergedClsPrefixRef:t,countGraphemesRef:Dt(e,"countGraphemes")});const Oi={wrapperElRef:a,inputElRef:d,textareaElRef:l,isCompositing:R,clear:Ce,focus:ge,blur:Me,select:je,deactivate:Tt,activate:lt,scrollTo:ke},Li=$n("Input",n,t),Mn=Y(()=>{const{value:C}=w,{common:{cubicBezierEaseInOut:M},self:{color:de,borderRadius:Ee,textColor:Be,caretColor:_e,caretColorError:oo,caretColorWarning:ro,textDecorationColor:no,border:kr,borderDisabled:Dr,borderHover:Wi,borderFocus:$f,placeholderColor:Rf,placeholderColorDisabled:Ff,lineHeightTextarea:_f,colorDisabled:Ef,colorFocus:zf,textColorDisabled:Mf,boxShadowFocus:If,iconSize:Af,colorFocusWarning:Hf,boxShadowFocusWarning:kf,borderWarning:Df,borderFocusWarning:Bf,borderHoverWarning:Of,colorFocusError:Lf,boxShadowFocusError:Wf,borderError:jf,borderFocusError:Nf,borderHoverError:Vf,clearSize:qf,clearColor:Uf,clearColorHover:Gf,clearColorPressed:Kf,iconColor:Yf,iconColorDisabled:Xf,suffixTextColor:Jf,countTextColor:Zf,countTextColorDisabled:Qf,iconColorHover:ep,iconColorPressed:tp,loadingColor:op,loadingColorError:rp,loadingColorWarning:np,fontWeight:ip,[ae("padding",C)]:ap,[ae("fontSize",C)]:lp,[ae("height",C)]:sp}}=i.value,{left:cp,right:dp}=Vo(ap);return{"--n-bezier":M,"--n-count-text-color":Zf,"--n-count-text-color-disabled":Qf,"--n-color":de,"--n-font-size":lp,"--n-font-weight":ip,"--n-border-radius":Ee,"--n-height":sp,"--n-padding-left":cp,"--n-padding-right":dp,"--n-text-color":Be,"--n-caret-color":_e,"--n-text-decoration-color":no,"--n-border":kr,"--n-border-disabled":Dr,"--n-border-hover":Wi,"--n-border-focus":$f,"--n-placeholder-color":Rf,"--n-placeholder-color-disabled":Ff,"--n-icon-size":Af,"--n-line-height-textarea":_f,"--n-color-disabled":Ef,"--n-color-focus":zf,"--n-text-color-disabled":Mf,"--n-box-shadow-focus":If,"--n-loading-color":op,"--n-caret-color-warning":ro,"--n-color-focus-warning":Hf,"--n-box-shadow-focus-warning":kf,"--n-border-warning":Df,"--n-border-focus-warning":Bf,"--n-border-hover-warning":Of,"--n-loading-color-warning":np,"--n-caret-color-error":oo,"--n-color-focus-error":Lf,"--n-box-shadow-focus-error":Wf,"--n-border-error":jf,"--n-border-focus-error":Nf,"--n-border-hover-error":Vf,"--n-loading-color-error":rp,"--n-clear-color":Uf,"--n-clear-size":qf,"--n-clear-color-hover":Gf,"--n-clear-color-pressed":Kf,"--n-icon-color":Yf,"--n-icon-color-hover":ep,"--n-icon-color-pressed":tp,"--n-icon-color-disabled":Xf,"--n-suffix-text-color":Jf}}),bo=r?Fr("input",Y(()=>{const{value:C}=w;return C[0]}),Mn,e):void 0;return Object.assign(Object.assign({},Oi),{wrapperElRef:a,inputElRef:d,inputMirrorElRef:c,inputEl2Ref:u,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:f,rtlEnabled:Li,uncontrolledValue:S,mergedValue:$,passwordVisible:oe,mergedPlaceholder:_,showPlaceholder1:J,showPlaceholder2:G,mergedFocus:le,isComposing:R,activated:O,showClearButton:te,mergedSize:w,mergedDisabled:z,textDecorationStyle:ye,mergedClsPrefix:t,mergedBordered:o,mergedShowPasswordOn:N,placeholderStyle:zn,mergedStatus:B,textAreaScrollContainerWidth:Pe,handleTextAreaScroll:Bi,handleCompositionStart:I,handleCompositionEnd:k,handleInput:U,handleInputBlur:A,handleInputFocus:E,handleWrapperBlur:ie,handleWrapperFocus:X,handleMouseEnter:Qe,handleMouseLeave:nt,handleMouseDown:Ze,handleChange:se,handleClick:ve,handleClear:Te,handlePasswordToggleClick:it,handlePasswordToggleMousedown:Wt,handleWrapperKeydown:at,handleWrapperKeyup:Ht,handleTextAreaMirrorResize:jt,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:r?void 0:Mn,themeClass:bo==null?void 0:bo.themeClass,onRender:bo==null?void 0:bo.onRender})},render(){var e,t;const{mergedClsPrefix:o,mergedStatus:r,themeClass:n,type:i,countGraphemes:a,onRender:l}=this,s=this.$slots;return l==null||l(),y("div",{ref:"wrapperElRef",class:[`${o}-input`,n,r&&`${o}-input--${r}-status`,{[`${o}-input--rtl`]:this.rtlEnabled,[`${o}-input--disabled`]:this.mergedDisabled,[`${o}-input--textarea`]:i==="textarea",[`${o}-input--resizable`]:this.resizable&&!this.autosize,[`${o}-input--autosize`]:this.autosize,[`${o}-input--round`]:this.round&&i!=="textarea",[`${o}-input--pair`]:this.pair,[`${o}-input--focus`]:this.mergedFocus,[`${o}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},y("div",{class:`${o}-input-wrapper`},$t(s.prefix,c=>c&&y("div",{class:`${o}-input__prefix`},c)),i==="textarea"?y(Hu,{ref:"textareaScrollbarInstRef",class:`${o}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var c,d;const{textAreaScrollContainerWidth:u}=this,p={width:this.autosize&&u&&`${u}px`};return y(et,null,y("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${o}-input__textarea-el`,(c=this.inputProps)===null||c===void 0?void 0:c.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(d=this.inputProps)===null||d===void 0?void 0:d.style,p],onBlur:this.handleInputBlur,onFocus:m=>{this.handleInputFocus(m,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`,style:[this.placeholderStyle,p],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?y(Fa,{onResize:this.handleTextAreaMirrorResize},{default:()=>y("div",{ref:"textareaMirrorElRef",class:`${o}-input__textarea-mirror`,key:"mirror"})}):null)}}):y("div",{class:`${o}-input__input`},y("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${o}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,0)},onInput:c=>{this.handleInput(c,0)},onChange:c=>{this.handleChange(c,0)}})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[0])):null,this.autosize?y("div",{class:`${o}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&$t(s.suffix,c=>c||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?y("div",{class:`${o}-input__suffix`},[$t(s["clear-icon-placeholder"],d=>(this.clearable||d)&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>d,icon:()=>{var u,p;return(p=(u=this.$slots)["clear-icon"])===null||p===void 0?void 0:p.call(u)}})),this.internalLoadingBeforeSuffix?null:c,this.loading!==void 0?y(Oy,{clsPrefix:o,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?c:null,this.showCount&&this.type!=="textarea"?y(Zs,null,{default:d=>{var u;return(u=s.count)===null||u===void 0?void 0:u.call(s,d)}}):null,this.mergedShowPasswordOn&&this.type==="password"?y("div",{class:`${o}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Qr(s["password-visible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(my,null)})]):Qr(s["password-invisible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(by,null)})])):null]):null)),this.pair?y("span",{class:`${o}-input__separator`},Qr(s.separator,()=>[this.separator])):null,this.pair?y("div",{class:`${o}-input-wrapper`},y("div",{class:`${o}-input__input`},y("input",{ref:"inputEl2Ref",type:this.type,class:`${o}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,1)},onInput:c=>{this.handleInput(c,1)},onChange:c=>{this.handleChange(c,1)}}),this.showPlaceholder2?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[1])):null),$t(s.suffix,c=>(this.clearable||c)&&y("div",{class:`${o}-input__suffix`},[this.clearable&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var d;return(d=s["clear-icon"])===null||d===void 0?void 0:d.call(s)},placeholder:()=>{var d;return(d=s["clear-icon-placeholder"])===null||d===void 0?void 0:d.call(s)}}),c]))):null,this.mergedBordered?y("div",{class:`${o}-input__border`}):null,this.mergedBordered?y("div",{class:`${o}-input__state-border`}):null,this.showCount&&i==="textarea"?y(Zs,null,{default:c=>{var d;const{renderCount:u}=this;return u?u(c):(d=s.count)===null||d===void 0?void 0:d.call(s,c)}}):null)}});function a1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const l1={name:"AutoComplete",common:W,peers:{InternalSelectMenu:Fn,Input:At},self:a1};function s1(e){const{borderRadius:t,avatarColor:o,cardColor:r,fontSize:n,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,modalColor:d,popoverColor:u}=e;return{borderRadius:t,fontSize:n,border:`2px solid ${r}`,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,color:ee(r,o),colorModal:ee(d,o),colorPopover:ee(u,o)}}const qu={name:"Avatar",common:W,self:s1};function c1(){return{gap:"-12px"}}const d1={name:"AvatarGroup",common:W,peers:{Avatar:qu},self:c1},u1={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},f1={name:"BackTop",common:W,self(e){const{popoverColor:t,textColor2:o,primaryColorHover:r,primaryColorPressed:n}=e;return Object.assign(Object.assign({},u1),{color:t,textColor:o,iconColor:o,iconColorHover:r,iconColorPressed:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},p1={name:"Badge",common:W,self(e){const{errorColorSuppl:t,infoColorSuppl:o,successColorSuppl:r,warningColorSuppl:n,fontFamily:i}=e;return{color:t,colorInfo:o,colorSuccess:r,colorError:t,colorWarning:n,fontSize:"12px",fontFamily:i}}},h1={fontWeightActive:"400"};function g1(e){const{fontSize:t,textColor3:o,textColor2:r,borderRadius:n,buttonColor2Hover:i,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},h1),{fontSize:t,itemLineHeight:"1.25",itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:r,itemTextColorActive:r,itemBorderRadius:n,itemColorHover:i,itemColorPressed:a,separatorColor:o})}const m1={name:"Breadcrumb",common:W,self:g1};function Lo(e){return ee(e,[255,255,255,.16])}function Un(e){return ee(e,[0,0,0,.12])}const b1="n-button-group",v1={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"};function Uu(e){const{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadius:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,textColor2:u,textColor3:p,primaryColorHover:m,primaryColorPressed:f,borderColor:g,primaryColor:S,baseColor:v,infoColor:$,infoColorHover:T,infoColorPressed:w,successColor:z,successColorHover:B,successColorPressed:x,warningColor:F,warningColorHover:R,warningColorPressed:O,errorColor:j,errorColorHover:_,errorColorPressed:J,fontWeight:G,buttonColor2:le,buttonColor2Hover:te,buttonColor2Pressed:N,fontWeightStrong:oe}=e;return Object.assign(Object.assign({},v1),{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadiusTiny:i,borderRadiusSmall:i,borderRadiusMedium:i,borderRadiusLarge:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:le,colorSecondaryHover:te,colorSecondaryPressed:N,colorTertiary:le,colorTertiaryHover:te,colorTertiaryPressed:N,colorQuaternary:"#0000",colorQuaternaryHover:te,colorQuaternaryPressed:N,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:u,textColorTertiary:p,textColorHover:m,textColorPressed:f,textColorFocus:m,textColorDisabled:u,textColorText:u,textColorTextHover:m,textColorTextPressed:f,textColorTextFocus:m,textColorTextDisabled:u,textColorGhost:u,textColorGhostHover:m,textColorGhostPressed:f,textColorGhostFocus:m,textColorGhostDisabled:u,border:`1px solid ${g}`,borderHover:`1px solid ${m}`,borderPressed:`1px solid ${f}`,borderFocus:`1px solid ${m}`,borderDisabled:`1px solid ${g}`,rippleColor:S,colorPrimary:S,colorHoverPrimary:m,colorPressedPrimary:f,colorFocusPrimary:m,colorDisabledPrimary:S,textColorPrimary:v,textColorHoverPrimary:v,textColorPressedPrimary:v,textColorFocusPrimary:v,textColorDisabledPrimary:v,textColorTextPrimary:S,textColorTextHoverPrimary:m,textColorTextPressedPrimary:f,textColorTextFocusPrimary:m,textColorTextDisabledPrimary:u,textColorGhostPrimary:S,textColorGhostHoverPrimary:m,textColorGhostPressedPrimary:f,textColorGhostFocusPrimary:m,textColorGhostDisabledPrimary:S,borderPrimary:`1px solid ${S}`,borderHoverPrimary:`1px solid ${m}`,borderPressedPrimary:`1px solid ${f}`,borderFocusPrimary:`1px solid ${m}`,borderDisabledPrimary:`1px solid ${S}`,rippleColorPrimary:S,colorInfo:$,colorHoverInfo:T,colorPressedInfo:w,colorFocusInfo:T,colorDisabledInfo:$,textColorInfo:v,textColorHoverInfo:v,textColorPressedInfo:v,textColorFocusInfo:v,textColorDisabledInfo:v,textColorTextInfo:$,textColorTextHoverInfo:T,textColorTextPressedInfo:w,textColorTextFocusInfo:T,textColorTextDisabledInfo:u,textColorGhostInfo:$,textColorGhostHoverInfo:T,textColorGhostPressedInfo:w,textColorGhostFocusInfo:T,textColorGhostDisabledInfo:$,borderInfo:`1px solid ${$}`,borderHoverInfo:`1px solid ${T}`,borderPressedInfo:`1px solid ${w}`,borderFocusInfo:`1px solid ${T}`,borderDisabledInfo:`1px solid ${$}`,rippleColorInfo:$,colorSuccess:z,colorHoverSuccess:B,colorPressedSuccess:x,colorFocusSuccess:B,colorDisabledSuccess:z,textColorSuccess:v,textColorHoverSuccess:v,textColorPressedSuccess:v,textColorFocusSuccess:v,textColorDisabledSuccess:v,textColorTextSuccess:z,textColorTextHoverSuccess:B,textColorTextPressedSuccess:x,textColorTextFocusSuccess:B,textColorTextDisabledSuccess:u,textColorGhostSuccess:z,textColorGhostHoverSuccess:B,textColorGhostPressedSuccess:x,textColorGhostFocusSuccess:B,textColorGhostDisabledSuccess:z,borderSuccess:`1px solid ${z}`,borderHoverSuccess:`1px solid ${B}`,borderPressedSuccess:`1px solid ${x}`,borderFocusSuccess:`1px solid ${B}`,borderDisabledSuccess:`1px solid ${z}`,rippleColorSuccess:z,colorWarning:F,colorHoverWarning:R,colorPressedWarning:O,colorFocusWarning:R,colorDisabledWarning:F,textColorWarning:v,textColorHoverWarning:v,textColorPressedWarning:v,textColorFocusWarning:v,textColorDisabledWarning:v,textColorTextWarning:F,textColorTextHoverWarning:R,textColorTextPressedWarning:O,textColorTextFocusWarning:R,textColorTextDisabledWarning:u,textColorGhostWarning:F,textColorGhostHoverWarning:R,textColorGhostPressedWarning:O,textColorGhostFocusWarning:R,textColorGhostDisabledWarning:F,borderWarning:`1px solid ${F}`,borderHoverWarning:`1px solid ${R}`,borderPressedWarning:`1px solid ${O}`,borderFocusWarning:`1px solid ${R}`,borderDisabledWarning:`1px solid ${F}`,rippleColorWarning:F,colorError:j,colorHoverError:_,colorPressedError:J,colorFocusError:_,colorDisabledError:j,textColorError:v,textColorHoverError:v,textColorPressedError:v,textColorFocusError:v,textColorDisabledError:v,textColorTextError:j,textColorTextHoverError:_,textColorTextPressedError:J,textColorTextFocusError:_,textColorTextDisabledError:u,textColorGhostError:j,textColorGhostHoverError:_,textColorGhostPressedError:J,textColorGhostFocusError:_,textColorGhostDisabledError:j,borderError:`1px solid ${j}`,borderHoverError:`1px solid ${_}`,borderPressedError:`1px solid ${J}`,borderFocusError:`1px solid ${_}`,borderDisabledError:`1px solid ${j}`,rippleColorError:j,waveOpacity:"0.6",fontWeight:G,fontWeightStrong:oe})}const _n={name:"Button",common:Oe,self:Uu},wt={name:"Button",common:W,self(e){const t=Uu(e);return t.waveOpacity="0.8",t.colorOpacitySecondary="0.16",t.colorOpacitySecondaryHover="0.2",t.colorOpacitySecondaryPressed="0.12",t}},x1=L([pe("button",` + `)])]);function r1(e){let t=0;for(const o of e)t++;return t}function Un(e){return e===""||e==null}function n1(e){const t=fe(null);function o(){const{value:i}=e;if(!(i!=null&&i.focus)){n();return}const{selectionStart:a,selectionEnd:l,value:s}=i;if(a==null||l==null){n();return}t.value={start:a,end:l,beforeText:s.slice(0,a),afterText:s.slice(l)}}function r(){var i;const{value:a}=t,{value:l}=e;if(!a||!l)return;const{value:s}=l,{start:c,beforeText:d,afterText:u}=a;let p=s.length;if(s.endsWith(u))p=s.length-u.length;else if(s.startsWith(d))p=d.length;else{const m=d[c-1],f=s.indexOf(m,c-1);f!==-1&&(p=f+1)}(i=l.setSelectionRange)===null||i===void 0||i.call(l,p,p)}function n(){t.value=null}return Zt(e,n),{recordCursor:o,restoreCursor:r}}const Zs=He({name:"InputWordCount",setup(e,{slots:t}){const{mergedValueRef:o,maxlengthRef:r,mergedClsPrefixRef:n,countGraphemesRef:i}=Le(Vu),a=Y(()=>{const{value:l}=o;return l===null||Array.isArray(l)?0:(i.value||r1)(l)});return()=>{const{value:l}=r,{value:s}=o;return y("span",{class:`${n.value}-input-word-count`},Ib(t.default,{value:s===null||Array.isArray(s)?"":s},()=>[l===void 0?a.value:`${a.value} / ${l}`]))}}}),i1=Object.assign(Object.assign({},Ct.props),{bordered:{type:Boolean,default:void 0},type:{type:String,default:"text"},placeholder:[Array,String],defaultValue:{type:[String,Array],default:null},value:[String,Array],disabled:{type:Boolean,default:void 0},size:String,rows:{type:[Number,String],default:3},round:Boolean,minlength:[String,Number],maxlength:[String,Number],clearable:Boolean,autosize:{type:[Boolean,Object],default:!1},pair:Boolean,separator:String,readonly:{type:[String,Boolean],default:!1},passivelyActivated:Boolean,showPasswordOn:String,stateful:{type:Boolean,default:!0},autofocus:Boolean,inputProps:Object,resizable:{type:Boolean,default:!0},showCount:Boolean,loading:{type:Boolean,default:void 0},allowInput:Function,renderCount:Function,onMousedown:Function,onKeydown:Function,onKeyup:[Function,Array],onInput:[Function,Array],onFocus:[Function,Array],onBlur:[Function,Array],onClick:[Function,Array],onChange:[Function,Array],onClear:[Function,Array],countGraphemes:Function,status:String,"onUpdate:value":[Function,Array],onUpdateValue:[Function,Array],textDecoration:[String,Array],attrSize:{type:Number,default:20},onInputBlur:[Function,Array],onInputFocus:[Function,Array],onDeactivate:[Function,Array],onActivate:[Function,Array],onWrapperFocus:[Function,Array],onWrapperBlur:[Function,Array],internalDeactivateOnEnter:Boolean,internalForceFocus:Boolean,internalLoadingBeforeSuffix:{type:Boolean,default:!0},showPasswordToggle:Boolean}),CP=He({name:"Input",props:i1,setup(e){const{mergedClsPrefixRef:t,mergedBorderedRef:o,inlineThemeDisabled:r,mergedRtlRef:n}=zo(e),i=Ct("Input","-input",t1,ki,e,t);ju&&Er("-input-safari",o1,t);const a=fe(null),l=fe(null),s=fe(null),c=fe(null),d=fe(null),u=fe(null),p=fe(null),m=n1(p),f=fe(null),{localeRef:g}=ly("Input"),S=fe(e.defaultValue),v=Dt(e,"value"),$=Km(v,S),T=Zd(e),{mergedSizeRef:w,mergedDisabledRef:_,mergedStatusRef:O}=T,x=fe(!1),F=fe(!1),R=fe(!1),B=fe(!1);let j=null;const A=Y(()=>{const{placeholder:C,pair:E}=e;return E?Array.isArray(C)?C:C===void 0?["",""]:[C,C]:C===void 0?[g.value.placeholder]:[C]}),J=Y(()=>{const{value:C}=R,{value:E}=$,{value:de}=A;return!C&&(Un(E)||Array.isArray(E)&&Un(E[0]))&&de[0]}),G=Y(()=>{const{value:C}=R,{value:E}=$,{value:de}=A;return!C&&de[1]&&(Un(E)||Array.isArray(E)&&Un(E[1]))}),le=hn(()=>e.internalForceFocus||x.value),te=hn(()=>{if(_.value||e.readonly||!e.clearable||!le.value&&!F.value)return!1;const{value:C}=$,{value:E}=le;return e.pair?!!(Array.isArray(C)&&(C[0]||C[1]))&&(F.value||E):!!C&&(F.value||E)}),N=Y(()=>{const{showPasswordOn:C}=e;if(C)return C;if(e.showPasswordToggle)return"click"}),oe=fe(!1),ye=Y(()=>{const{textDecoration:C}=e;return C?Array.isArray(C)?C.map(E=>({textDecoration:E})):[{textDecoration:C}]:["",""]}),Pe=fe(void 0),Re=()=>{var C,E;if(e.type==="textarea"){const{autosize:de}=e;if(de&&(Pe.value=(E=(C=f.value)===null||C===void 0?void 0:C.$el)===null||E===void 0?void 0:E.offsetWidth),!l.value||typeof de=="boolean")return;const{paddingTop:Ie,paddingBottom:Oe,lineHeight:Ae}=window.getComputedStyle(l.value),oo=Number(Ie.slice(0,-2)),ro=Number(Oe.slice(0,-2)),no=Number(Ae.slice(0,-2)),{value:kr}=s;if(!kr)return;if(de.minRows){const Dr=Math.max(de.minRows,1),Wi=`${oo+ro+no*Dr}px`;kr.style.minHeight=Wi}if(de.maxRows){const Dr=`${oo+ro+no*de.maxRows}px`;kr.style.maxHeight=Dr}}},Fe=Y(()=>{const{maxlength:C}=e;return C===void 0?void 0:Number(C)});Mo(()=>{const{value:C}=$;Array.isArray(C)||st(C)});const Ve=Sn().proxy;function qe(C,E){const{onUpdateValue:de,"onUpdate:value":Ie,onInput:Oe}=e,{nTriggerFormInput:Ae}=T;de&&Ke(de,C,E),Ie&&Ke(Ie,C,E),Oe&&Ke(Oe,C,E),S.value=C,Ae()}function gt(C,E){const{onChange:de}=e,{nTriggerFormChange:Ie}=T;de&&Ke(de,C,E),S.value=C,Ie()}function he(C){const{onBlur:E}=e,{nTriggerFormBlur:de}=T;E&&Ke(E,C),de()}function Ue(C){const{onFocus:E}=e,{nTriggerFormFocus:de}=T;E&&Ke(E,C),de()}function rt(C){const{onClear:E}=e;E&&Ke(E,C)}function be(C){const{onInputBlur:E}=e;E&&Ke(E,C)}function Ge(C){const{onInputFocus:E}=e;E&&Ke(E,C)}function Pt(){const{onDeactivate:C}=e;C&&Ke(C)}function h(){const{onActivate:C}=e;C&&Ke(C)}function b(C){const{onClick:E}=e;E&&Ke(E,C)}function P(C){const{onWrapperFocus:E}=e;E&&Ke(E,C)}function H(C){const{onWrapperBlur:E}=e;E&&Ke(E,C)}function M(){R.value=!0}function k(C){R.value=!1,C.target===u.value?q(C,1):q(C,0)}function q(C,E=0,de="input"){const Ie=C.target.value;if(st(Ie),C instanceof InputEvent&&!C.isComposing&&(R.value=!1),e.type==="textarea"){const{value:Ae}=f;Ae&&Ae.syncUnifiedContainer()}if(j=Ie,R.value)return;m.recordCursor();const Oe=U(Ie);if(Oe)if(!e.pair)de==="input"?qe(Ie,{source:E}):gt(Ie,{source:E});else{let{value:Ae}=$;Array.isArray(Ae)?Ae=[Ae[0],Ae[1]]:Ae=["",""],Ae[E]=Ie,de==="input"?qe(Ae,{source:E}):gt(Ae,{source:E})}Ve.$forceUpdate(),Oe||nn(m.restoreCursor)}function U(C){const{countGraphemes:E,maxlength:de,minlength:Ie}=e;if(E){let Ae;if(de!==void 0&&(Ae===void 0&&(Ae=E(C)),Ae>Number(de))||Ie!==void 0&&(Ae===void 0&&(Ae=E(C)),Ae{Ie.preventDefault(),lo("mouseup",document,E)};if(Go("mouseup",document,E),N.value!=="mousedown")return;oe.value=!0;const de=()=>{oe.value=!1,lo("mouseup",document,de)};Go("mouseup",document,de)}function Ht(C){e.onKeyup&&Ke(e.onKeyup,C)}function at(C){switch(e.onKeydown&&Ke(e.onKeydown,C),C.key){case"Escape":Q();break;case"Enter":D(C);break}}function D(C){var E,de;if(e.passivelyActivated){const{value:Ie}=B;if(Ie){e.internalDeactivateOnEnter&&Q();return}C.preventDefault(),e.type==="textarea"?(E=l.value)===null||E===void 0||E.focus():(de=d.value)===null||de===void 0||de.focus()}}function Q(){e.passivelyActivated&&(B.value=!1,nn(()=>{var C;(C=a.value)===null||C===void 0||C.focus()}))}function ge(){var C,E,de;_.value||(e.passivelyActivated?(C=a.value)===null||C===void 0||C.focus():((E=l.value)===null||E===void 0||E.focus(),(de=d.value)===null||de===void 0||de.focus()))}function Ee(){var C;!((C=a.value)===null||C===void 0)&&C.contains(document.activeElement)&&document.activeElement.blur()}function je(){var C,E;(C=l.value)===null||C===void 0||C.select(),(E=d.value)===null||E===void 0||E.select()}function lt(){_.value||(l.value?l.value.focus():d.value&&d.value.focus())}function Tt(){const{value:C}=a;C!=null&&C.contains(document.activeElement)&&C!==document.activeElement&&Q()}function ke(C){if(e.type==="textarea"){const{value:E}=l;E==null||E.scrollTo(C)}else{const{value:E}=d;E==null||E.scrollTo(C)}}function st(C){const{type:E,pair:de,autosize:Ie}=e;if(!de&&Ie)if(E==="textarea"){const{value:Oe}=s;Oe&&(Oe.textContent=`${C??""}\r +`)}else{const{value:Oe}=c;Oe&&(C?Oe.textContent=C:Oe.innerHTML=" ")}}function jt(){Re()}const _n=fe({top:"0"});function Oi(C){var E;const{scrollTop:de}=C.target;_n.value.top=`${-de}px`,(E=f.value)===null||E===void 0||E.syncUnifiedContainer()}let sr=null;sn(()=>{const{autosize:C,type:E}=e;C&&E==="textarea"?sr=Zt($,de=>{!Array.isArray(de)&&de!==j&&st(de)}):sr==null||sr()});let cr=null;sn(()=>{e.type==="textarea"?cr=Zt($,C=>{var E;!Array.isArray(C)&&C!==j&&((E=f.value)===null||E===void 0||E.syncUnifiedContainer())}):cr==null||cr()}),po(Vu,{mergedValueRef:$,maxlengthRef:Fe,mergedClsPrefixRef:t,countGraphemesRef:Dt(e,"countGraphemes")});const Bi={wrapperElRef:a,inputElRef:d,textareaElRef:l,isCompositing:R,clear:Ce,focus:ge,blur:Ee,select:je,deactivate:Tt,activate:lt,scrollTo:ke},Li=$n("Input",n,t),En=Y(()=>{const{value:C}=w,{common:{cubicBezierEaseInOut:E},self:{color:de,borderRadius:Ie,textColor:Oe,caretColor:Ae,caretColorError:oo,caretColorWarning:ro,textDecorationColor:no,border:kr,borderDisabled:Dr,borderHover:Wi,borderFocus:$f,placeholderColor:Rf,placeholderColorDisabled:Ff,lineHeightTextarea:Af,colorDisabled:If,colorFocus:_f,textColorDisabled:Ef,boxShadowFocus:Mf,iconSize:zf,colorFocusWarning:Hf,boxShadowFocusWarning:kf,borderWarning:Df,borderFocusWarning:Of,borderHoverWarning:Bf,colorFocusError:Lf,boxShadowFocusError:Wf,borderError:jf,borderFocusError:Nf,borderHoverError:Vf,clearSize:Uf,clearColor:qf,clearColorHover:Gf,clearColorPressed:Kf,iconColor:Yf,iconColorDisabled:Xf,suffixTextColor:Jf,countTextColor:Zf,countTextColorDisabled:Qf,iconColorHover:ep,iconColorPressed:tp,loadingColor:op,loadingColorError:rp,loadingColorWarning:np,fontWeight:ip,[ae("padding",C)]:ap,[ae("fontSize",C)]:lp,[ae("height",C)]:sp}}=i.value,{left:cp,right:dp}=Vo(ap);return{"--n-bezier":E,"--n-count-text-color":Zf,"--n-count-text-color-disabled":Qf,"--n-color":de,"--n-font-size":lp,"--n-font-weight":ip,"--n-border-radius":Ie,"--n-height":sp,"--n-padding-left":cp,"--n-padding-right":dp,"--n-text-color":Oe,"--n-caret-color":Ae,"--n-text-decoration-color":no,"--n-border":kr,"--n-border-disabled":Dr,"--n-border-hover":Wi,"--n-border-focus":$f,"--n-placeholder-color":Rf,"--n-placeholder-color-disabled":Ff,"--n-icon-size":zf,"--n-line-height-textarea":Af,"--n-color-disabled":If,"--n-color-focus":_f,"--n-text-color-disabled":Ef,"--n-box-shadow-focus":Mf,"--n-loading-color":op,"--n-caret-color-warning":ro,"--n-color-focus-warning":Hf,"--n-box-shadow-focus-warning":kf,"--n-border-warning":Df,"--n-border-focus-warning":Of,"--n-border-hover-warning":Bf,"--n-loading-color-warning":np,"--n-caret-color-error":oo,"--n-color-focus-error":Lf,"--n-box-shadow-focus-error":Wf,"--n-border-error":jf,"--n-border-focus-error":Nf,"--n-border-hover-error":Vf,"--n-loading-color-error":rp,"--n-clear-color":qf,"--n-clear-size":Uf,"--n-clear-color-hover":Gf,"--n-clear-color-pressed":Kf,"--n-icon-color":Yf,"--n-icon-color-hover":ep,"--n-icon-color-pressed":tp,"--n-icon-color-disabled":Xf,"--n-suffix-text-color":Jf}}),bo=r?Fr("input",Y(()=>{const{value:C}=w;return C[0]}),En,e):void 0;return Object.assign(Object.assign({},Bi),{wrapperElRef:a,inputElRef:d,inputMirrorElRef:c,inputEl2Ref:u,textareaElRef:l,textareaMirrorElRef:s,textareaScrollbarInstRef:f,rtlEnabled:Li,uncontrolledValue:S,mergedValue:$,passwordVisible:oe,mergedPlaceholder:A,showPlaceholder1:J,showPlaceholder2:G,mergedFocus:le,isComposing:R,activated:B,showClearButton:te,mergedSize:w,mergedDisabled:_,textDecorationStyle:ye,mergedClsPrefix:t,mergedBordered:o,mergedShowPasswordOn:N,placeholderStyle:_n,mergedStatus:O,textAreaScrollContainerWidth:Pe,handleTextAreaScroll:Oi,handleCompositionStart:M,handleCompositionEnd:k,handleInput:q,handleInputBlur:z,handleInputFocus:I,handleWrapperBlur:ie,handleWrapperFocus:X,handleMouseEnter:Qe,handleMouseLeave:nt,handleMouseDown:Ze,handleChange:se,handleClick:ve,handleClear:Te,handlePasswordToggleClick:it,handlePasswordToggleMousedown:Wt,handleWrapperKeydown:at,handleWrapperKeyup:Ht,handleTextAreaMirrorResize:jt,getTextareaScrollContainer:()=>l.value,mergedTheme:i,cssVars:r?void 0:En,themeClass:bo==null?void 0:bo.themeClass,onRender:bo==null?void 0:bo.onRender})},render(){var e,t;const{mergedClsPrefix:o,mergedStatus:r,themeClass:n,type:i,countGraphemes:a,onRender:l}=this,s=this.$slots;return l==null||l(),y("div",{ref:"wrapperElRef",class:[`${o}-input`,n,r&&`${o}-input--${r}-status`,{[`${o}-input--rtl`]:this.rtlEnabled,[`${o}-input--disabled`]:this.mergedDisabled,[`${o}-input--textarea`]:i==="textarea",[`${o}-input--resizable`]:this.resizable&&!this.autosize,[`${o}-input--autosize`]:this.autosize,[`${o}-input--round`]:this.round&&i!=="textarea",[`${o}-input--pair`]:this.pair,[`${o}-input--focus`]:this.mergedFocus,[`${o}-input--stateful`]:this.stateful}],style:this.cssVars,tabindex:!this.mergedDisabled&&this.passivelyActivated&&!this.activated?0:void 0,onFocus:this.handleWrapperFocus,onBlur:this.handleWrapperBlur,onClick:this.handleClick,onMousedown:this.handleMouseDown,onMouseenter:this.handleMouseEnter,onMouseleave:this.handleMouseLeave,onCompositionstart:this.handleCompositionStart,onCompositionend:this.handleCompositionEnd,onKeyup:this.handleWrapperKeyup,onKeydown:this.handleWrapperKeydown},y("div",{class:`${o}-input-wrapper`},$t(s.prefix,c=>c&&y("div",{class:`${o}-input__prefix`},c)),i==="textarea"?y(Hu,{ref:"textareaScrollbarInstRef",class:`${o}-input__textarea`,container:this.getTextareaScrollContainer,triggerDisplayManually:!0,useUnifiedContainer:!0,internalHoistYRail:!0},{default:()=>{var c,d;const{textAreaScrollContainerWidth:u}=this,p={width:this.autosize&&u&&`${u}px`};return y(et,null,y("textarea",Object.assign({},this.inputProps,{ref:"textareaElRef",class:[`${o}-input__textarea-el`,(c=this.inputProps)===null||c===void 0?void 0:c.class],autofocus:this.autofocus,rows:Number(this.rows),placeholder:this.placeholder,value:this.mergedValue,disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,readonly:this.readonly,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,style:[this.textDecorationStyle[0],(d=this.inputProps)===null||d===void 0?void 0:d.style,p],onBlur:this.handleInputBlur,onFocus:m=>{this.handleInputFocus(m,2)},onInput:this.handleInput,onChange:this.handleChange,onScroll:this.handleTextAreaScroll})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`,style:[this.placeholderStyle,p],key:"placeholder"},this.mergedPlaceholder[0]):null,this.autosize?y(Fa,{onResize:this.handleTextAreaMirrorResize},{default:()=>y("div",{ref:"textareaMirrorElRef",class:`${o}-input__textarea-mirror`,key:"mirror"})}):null)}}):y("div",{class:`${o}-input__input`},y("input",Object.assign({type:i==="password"&&this.mergedShowPasswordOn&&this.passwordVisible?"text":i},this.inputProps,{ref:"inputElRef",class:[`${o}-input__input-el`,(e=this.inputProps)===null||e===void 0?void 0:e.class],style:[this.textDecorationStyle[0],(t=this.inputProps)===null||t===void 0?void 0:t.style],tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[0],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[0]:this.mergedValue,readonly:this.readonly,autofocus:this.autofocus,size:this.attrSize,onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,0)},onInput:c=>{this.handleInput(c,0)},onChange:c=>{this.handleChange(c,0)}})),this.showPlaceholder1?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[0])):null,this.autosize?y("div",{class:`${o}-input__input-mirror`,key:"mirror",ref:"inputMirrorElRef"}," "):null),!this.pair&&$t(s.suffix,c=>c||this.clearable||this.showCount||this.mergedShowPasswordOn||this.loading!==void 0?y("div",{class:`${o}-input__suffix`},[$t(s["clear-icon-placeholder"],d=>(this.clearable||d)&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{placeholder:()=>d,icon:()=>{var u,p;return(p=(u=this.$slots)["clear-icon"])===null||p===void 0?void 0:p.call(u)}})),this.internalLoadingBeforeSuffix?null:c,this.loading!==void 0?y(By,{clsPrefix:o,loading:this.loading,showArrow:!1,showClear:!1,style:this.cssVars}):null,this.internalLoadingBeforeSuffix?c:null,this.showCount&&this.type!=="textarea"?y(Zs,null,{default:d=>{var u;return(u=s.count)===null||u===void 0?void 0:u.call(s,d)}}):null,this.mergedShowPasswordOn&&this.type==="password"?y("div",{class:`${o}-input__eye`,onMousedown:this.handlePasswordToggleMousedown,onClick:this.handlePasswordToggleClick},this.passwordVisible?Qr(s["password-visible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(my,null)})]):Qr(s["password-invisible-icon"],()=>[y(Tr,{clsPrefix:o},{default:()=>y(by,null)})])):null]):null)),this.pair?y("span",{class:`${o}-input__separator`},Qr(s.separator,()=>[this.separator])):null,this.pair?y("div",{class:`${o}-input-wrapper`},y("div",{class:`${o}-input__input`},y("input",{ref:"inputEl2Ref",type:this.type,class:`${o}-input__input-el`,tabindex:this.passivelyActivated&&!this.activated?-1:void 0,placeholder:this.mergedPlaceholder[1],disabled:this.mergedDisabled,maxlength:a?void 0:this.maxlength,minlength:a?void 0:this.minlength,value:Array.isArray(this.mergedValue)?this.mergedValue[1]:void 0,readonly:this.readonly,style:this.textDecorationStyle[1],onBlur:this.handleInputBlur,onFocus:c=>{this.handleInputFocus(c,1)},onInput:c=>{this.handleInput(c,1)},onChange:c=>{this.handleChange(c,1)}}),this.showPlaceholder2?y("div",{class:`${o}-input__placeholder`},y("span",null,this.mergedPlaceholder[1])):null),$t(s.suffix,c=>(this.clearable||c)&&y("div",{class:`${o}-input__suffix`},[this.clearable&&y(ka,{clsPrefix:o,show:this.showClearButton,onClear:this.handleClear},{icon:()=>{var d;return(d=s["clear-icon"])===null||d===void 0?void 0:d.call(s)},placeholder:()=>{var d;return(d=s["clear-icon-placeholder"])===null||d===void 0?void 0:d.call(s)}}),c]))):null,this.mergedBordered?y("div",{class:`${o}-input__border`}):null,this.mergedBordered?y("div",{class:`${o}-input__state-border`}):null,this.showCount&&i==="textarea"?y(Zs,null,{default:c=>{var d;const{renderCount:u}=this;return u?u(c):(d=s.count)===null||d===void 0?void 0:d.call(s,c)}}):null)}});function a1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const l1={name:"AutoComplete",common:W,peers:{InternalSelectMenu:Fn,Input:zt},self:a1};function s1(e){const{borderRadius:t,avatarColor:o,cardColor:r,fontSize:n,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,modalColor:d,popoverColor:u}=e;return{borderRadius:t,fontSize:n,border:`2px solid ${r}`,heightTiny:i,heightSmall:a,heightMedium:l,heightLarge:s,heightHuge:c,color:ee(r,o),colorModal:ee(d,o),colorPopover:ee(u,o)}}const Uu={name:"Avatar",common:W,self:s1};function c1(){return{gap:"-12px"}}const d1={name:"AvatarGroup",common:W,peers:{Avatar:Uu},self:c1},u1={width:"44px",height:"44px",borderRadius:"22px",iconSize:"26px"},f1={name:"BackTop",common:W,self(e){const{popoverColor:t,textColor2:o,primaryColorHover:r,primaryColorPressed:n}=e;return Object.assign(Object.assign({},u1),{color:t,textColor:o,iconColor:o,iconColorHover:r,iconColorPressed:n,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)"})}},p1={name:"Badge",common:W,self(e){const{errorColorSuppl:t,infoColorSuppl:o,successColorSuppl:r,warningColorSuppl:n,fontFamily:i}=e;return{color:t,colorInfo:o,colorSuccess:r,colorError:t,colorWarning:n,fontSize:"12px",fontFamily:i}}},h1={fontWeightActive:"400"};function g1(e){const{fontSize:t,textColor3:o,textColor2:r,borderRadius:n,buttonColor2Hover:i,buttonColor2Pressed:a}=e;return Object.assign(Object.assign({},h1),{fontSize:t,itemLineHeight:"1.25",itemTextColor:o,itemTextColorHover:r,itemTextColorPressed:r,itemTextColorActive:r,itemBorderRadius:n,itemColorHover:i,itemColorPressed:a,separatorColor:o})}const m1={name:"Breadcrumb",common:W,self:g1};function Lo(e){return ee(e,[255,255,255,.16])}function qn(e){return ee(e,[0,0,0,.12])}const b1="n-button-group",v1={paddingTiny:"0 6px",paddingSmall:"0 10px",paddingMedium:"0 14px",paddingLarge:"0 18px",paddingRoundTiny:"0 10px",paddingRoundSmall:"0 14px",paddingRoundMedium:"0 18px",paddingRoundLarge:"0 22px",iconMarginTiny:"6px",iconMarginSmall:"6px",iconMarginMedium:"6px",iconMarginLarge:"6px",iconSizeTiny:"14px",iconSizeSmall:"18px",iconSizeMedium:"18px",iconSizeLarge:"20px",rippleDuration:".6s"};function qu(e){const{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadius:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,textColor2:u,textColor3:p,primaryColorHover:m,primaryColorPressed:f,borderColor:g,primaryColor:S,baseColor:v,infoColor:$,infoColorHover:T,infoColorPressed:w,successColor:_,successColorHover:O,successColorPressed:x,warningColor:F,warningColorHover:R,warningColorPressed:B,errorColor:j,errorColorHover:A,errorColorPressed:J,fontWeight:G,buttonColor2:le,buttonColor2Hover:te,buttonColor2Pressed:N,fontWeightStrong:oe}=e;return Object.assign(Object.assign({},v1),{heightTiny:t,heightSmall:o,heightMedium:r,heightLarge:n,borderRadiusTiny:i,borderRadiusSmall:i,borderRadiusMedium:i,borderRadiusLarge:i,fontSizeTiny:a,fontSizeSmall:l,fontSizeMedium:s,fontSizeLarge:c,opacityDisabled:d,colorOpacitySecondary:"0.16",colorOpacitySecondaryHover:"0.22",colorOpacitySecondaryPressed:"0.28",colorSecondary:le,colorSecondaryHover:te,colorSecondaryPressed:N,colorTertiary:le,colorTertiaryHover:te,colorTertiaryPressed:N,colorQuaternary:"#0000",colorQuaternaryHover:te,colorQuaternaryPressed:N,color:"#0000",colorHover:"#0000",colorPressed:"#0000",colorFocus:"#0000",colorDisabled:"#0000",textColor:u,textColorTertiary:p,textColorHover:m,textColorPressed:f,textColorFocus:m,textColorDisabled:u,textColorText:u,textColorTextHover:m,textColorTextPressed:f,textColorTextFocus:m,textColorTextDisabled:u,textColorGhost:u,textColorGhostHover:m,textColorGhostPressed:f,textColorGhostFocus:m,textColorGhostDisabled:u,border:`1px solid ${g}`,borderHover:`1px solid ${m}`,borderPressed:`1px solid ${f}`,borderFocus:`1px solid ${m}`,borderDisabled:`1px solid ${g}`,rippleColor:S,colorPrimary:S,colorHoverPrimary:m,colorPressedPrimary:f,colorFocusPrimary:m,colorDisabledPrimary:S,textColorPrimary:v,textColorHoverPrimary:v,textColorPressedPrimary:v,textColorFocusPrimary:v,textColorDisabledPrimary:v,textColorTextPrimary:S,textColorTextHoverPrimary:m,textColorTextPressedPrimary:f,textColorTextFocusPrimary:m,textColorTextDisabledPrimary:u,textColorGhostPrimary:S,textColorGhostHoverPrimary:m,textColorGhostPressedPrimary:f,textColorGhostFocusPrimary:m,textColorGhostDisabledPrimary:S,borderPrimary:`1px solid ${S}`,borderHoverPrimary:`1px solid ${m}`,borderPressedPrimary:`1px solid ${f}`,borderFocusPrimary:`1px solid ${m}`,borderDisabledPrimary:`1px solid ${S}`,rippleColorPrimary:S,colorInfo:$,colorHoverInfo:T,colorPressedInfo:w,colorFocusInfo:T,colorDisabledInfo:$,textColorInfo:v,textColorHoverInfo:v,textColorPressedInfo:v,textColorFocusInfo:v,textColorDisabledInfo:v,textColorTextInfo:$,textColorTextHoverInfo:T,textColorTextPressedInfo:w,textColorTextFocusInfo:T,textColorTextDisabledInfo:u,textColorGhostInfo:$,textColorGhostHoverInfo:T,textColorGhostPressedInfo:w,textColorGhostFocusInfo:T,textColorGhostDisabledInfo:$,borderInfo:`1px solid ${$}`,borderHoverInfo:`1px solid ${T}`,borderPressedInfo:`1px solid ${w}`,borderFocusInfo:`1px solid ${T}`,borderDisabledInfo:`1px solid ${$}`,rippleColorInfo:$,colorSuccess:_,colorHoverSuccess:O,colorPressedSuccess:x,colorFocusSuccess:O,colorDisabledSuccess:_,textColorSuccess:v,textColorHoverSuccess:v,textColorPressedSuccess:v,textColorFocusSuccess:v,textColorDisabledSuccess:v,textColorTextSuccess:_,textColorTextHoverSuccess:O,textColorTextPressedSuccess:x,textColorTextFocusSuccess:O,textColorTextDisabledSuccess:u,textColorGhostSuccess:_,textColorGhostHoverSuccess:O,textColorGhostPressedSuccess:x,textColorGhostFocusSuccess:O,textColorGhostDisabledSuccess:_,borderSuccess:`1px solid ${_}`,borderHoverSuccess:`1px solid ${O}`,borderPressedSuccess:`1px solid ${x}`,borderFocusSuccess:`1px solid ${O}`,borderDisabledSuccess:`1px solid ${_}`,rippleColorSuccess:_,colorWarning:F,colorHoverWarning:R,colorPressedWarning:B,colorFocusWarning:R,colorDisabledWarning:F,textColorWarning:v,textColorHoverWarning:v,textColorPressedWarning:v,textColorFocusWarning:v,textColorDisabledWarning:v,textColorTextWarning:F,textColorTextHoverWarning:R,textColorTextPressedWarning:B,textColorTextFocusWarning:R,textColorTextDisabledWarning:u,textColorGhostWarning:F,textColorGhostHoverWarning:R,textColorGhostPressedWarning:B,textColorGhostFocusWarning:R,textColorGhostDisabledWarning:F,borderWarning:`1px solid ${F}`,borderHoverWarning:`1px solid ${R}`,borderPressedWarning:`1px solid ${B}`,borderFocusWarning:`1px solid ${R}`,borderDisabledWarning:`1px solid ${F}`,rippleColorWarning:F,colorError:j,colorHoverError:A,colorPressedError:J,colorFocusError:A,colorDisabledError:j,textColorError:v,textColorHoverError:v,textColorPressedError:v,textColorFocusError:v,textColorDisabledError:v,textColorTextError:j,textColorTextHoverError:A,textColorTextPressedError:J,textColorTextFocusError:A,textColorTextDisabledError:u,textColorGhostError:j,textColorGhostHoverError:A,textColorGhostPressedError:J,textColorGhostFocusError:A,textColorGhostDisabledError:j,borderError:`1px solid ${j}`,borderHoverError:`1px solid ${A}`,borderPressedError:`1px solid ${J}`,borderFocusError:`1px solid ${A}`,borderDisabledError:`1px solid ${j}`,rippleColorError:j,waveOpacity:"0.6",fontWeight:G,fontWeightStrong:oe})}const An={name:"Button",common:Be,self:qu},wt={name:"Button",common:W,self(e){const t=qu(e);return t.waveOpacity="0.8",t.colorOpacitySecondary="0.16",t.colorOpacitySecondaryHover="0.2",t.colorOpacitySecondaryPressed="0.12",t}},x1=L([pe("button",` margin: 0; font-weight: var(--n-font-weight); line-height: 1; @@ -534,7 +534,7 @@ ${t} animation-iteration-count: 1; animation-duration: var(--n-ripple-duration); animation-timing-function: var(--n-bezier-ease-out), var(--n-bezier-ease-out); - `,[re("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),Ei&&"MozBoxSizing"in document.createElement("div").style?L("&::moz-focus-inner",{border:0}):null,V("border, state-border",` + `,[re("active",{zIndex:1,animationName:"button-wave-spread, button-wave-opacity"})]),Ii&&"MozBoxSizing"in document.createElement("div").style?L("&::moz-focus-inner",{border:0}):null,V("border, state-border",` position: absolute; left: 0; top: 0; @@ -570,7 +570,7 @@ ${t} `,[L("~",[V("icon",{margin:"var(--n-icon-margin)",marginRight:0})])]),re("block",` display: flex; width: 100%; - `),re("dashed",[V("border, state-border",{borderStyle:"dashed !important"})]),re("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),L("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),L("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),C1=Object.assign(Object.assign({},Ct.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!ju}}),y1=He({name:"Button",props:C1,setup(e){const t=fe(null),o=fe(null),r=fe(!1),n=hn(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=Le(b1,{}),{mergedSizeRef:a}=Zd({},{defaultSize:"medium",mergedSize:w=>{const{size:z}=e;if(z)return z;const{size:B}=i;if(B)return B;const{mergedSize:x}=w||{};return x?x.value:"medium"}}),l=Y(()=>e.focusable&&!e.disabled),s=w=>{var z;l.value||w.preventDefault(),!e.nativeFocusBehavior&&(w.preventDefault(),!e.disabled&&l.value&&((z=t.value)===null||z===void 0||z.focus({preventScroll:!0})))},c=w=>{var z;if(!e.disabled&&!e.loading){const{onClick:B}=e;B&&Ke(B,w),e.text||(z=o.value)===null||z===void 0||z.play()}},d=w=>{switch(w.key){case"Enter":if(!e.keyboard)return;r.value=!1}},u=w=>{switch(w.key){case"Enter":if(!e.keyboard||e.loading){w.preventDefault();return}r.value=!0}},p=()=>{r.value=!1},{inlineThemeDisabled:m,mergedClsPrefixRef:f,mergedRtlRef:g}=Ao(e),S=Ct("Button","-button",x1,_n,e,f),v=$n("Button",g,f),$=Y(()=>{const w=S.value,{common:{cubicBezierEaseInOut:z,cubicBezierEaseOut:B},self:x}=w,{rippleDuration:F,opacityDisabled:R,fontWeight:O,fontWeightStrong:j}=x,_=a.value,{dashed:J,type:G,ghost:le,text:te,color:N,round:oe,circle:ye,textColor:Pe,secondary:Re,tertiary:Fe,quaternary:Ve,strong:Ue}=e,gt={"--n-font-weight":Ue?j:O};let he={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const qe=G==="tertiary",rt=G==="default",be=qe?"default":G;if(te){const A=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":A||x[ae("textColorText",be)],"--n-text-color-hover":A?Lo(A):x[ae("textColorTextHover",be)],"--n-text-color-pressed":A?Un(A):x[ae("textColorTextPressed",be)],"--n-text-color-focus":A?Lo(A):x[ae("textColorTextHover",be)],"--n-text-color-disabled":A||x[ae("textColorTextDisabled",be)]}}else if(le||J){const A=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":A||x[ae("textColorGhost",be)],"--n-text-color-hover":A?Lo(A):x[ae("textColorGhostHover",be)],"--n-text-color-pressed":A?Un(A):x[ae("textColorGhostPressed",be)],"--n-text-color-focus":A?Lo(A):x[ae("textColorGhostHover",be)],"--n-text-color-disabled":A||x[ae("textColorGhostDisabled",be)]}}else if(Re){const A=rt?x.textColor:qe?x.textColorTertiary:x[ae("color",be)],E=N||A,ie=G!=="default"&&G!=="tertiary";he={"--n-color":ie?K(E,{alpha:Number(x.colorOpacitySecondary)}):x.colorSecondary,"--n-color-hover":ie?K(E,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-pressed":ie?K(E,{alpha:Number(x.colorOpacitySecondaryPressed)}):x.colorSecondaryPressed,"--n-color-focus":ie?K(E,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-disabled":x.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":E,"--n-text-color-hover":E,"--n-text-color-pressed":E,"--n-text-color-focus":E,"--n-text-color-disabled":E}}else if(Fe||Ve){const A=rt?x.textColor:qe?x.textColorTertiary:x[ae("color",be)],E=N||A;Fe?(he["--n-color"]=x.colorTertiary,he["--n-color-hover"]=x.colorTertiaryHover,he["--n-color-pressed"]=x.colorTertiaryPressed,he["--n-color-focus"]=x.colorSecondaryHover,he["--n-color-disabled"]=x.colorTertiary):(he["--n-color"]=x.colorQuaternary,he["--n-color-hover"]=x.colorQuaternaryHover,he["--n-color-pressed"]=x.colorQuaternaryPressed,he["--n-color-focus"]=x.colorQuaternaryHover,he["--n-color-disabled"]=x.colorQuaternary),he["--n-ripple-color"]="#0000",he["--n-text-color"]=E,he["--n-text-color-hover"]=E,he["--n-text-color-pressed"]=E,he["--n-text-color-focus"]=E,he["--n-text-color-disabled"]=E}else he={"--n-color":N||x[ae("color",be)],"--n-color-hover":N?Lo(N):x[ae("colorHover",be)],"--n-color-pressed":N?Un(N):x[ae("colorPressed",be)],"--n-color-focus":N?Lo(N):x[ae("colorFocus",be)],"--n-color-disabled":N||x[ae("colorDisabled",be)],"--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":Pe||(N?x.textColorPrimary:qe?x.textColorTertiary:x[ae("textColor",be)]),"--n-text-color-hover":Pe||(N?x.textColorHoverPrimary:x[ae("textColorHover",be)]),"--n-text-color-pressed":Pe||(N?x.textColorPressedPrimary:x[ae("textColorPressed",be)]),"--n-text-color-focus":Pe||(N?x.textColorFocusPrimary:x[ae("textColorFocus",be)]),"--n-text-color-disabled":Pe||(N?x.textColorDisabledPrimary:x[ae("textColorDisabled",be)])};let Ge={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};te?Ge={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:Ge={"--n-border":x[ae("border",be)],"--n-border-hover":x[ae("borderHover",be)],"--n-border-pressed":x[ae("borderPressed",be)],"--n-border-focus":x[ae("borderFocus",be)],"--n-border-disabled":x[ae("borderDisabled",be)]};const{[ae("height",_)]:Pt,[ae("fontSize",_)]:h,[ae("padding",_)]:b,[ae("paddingRound",_)]:P,[ae("iconSize",_)]:H,[ae("borderRadius",_)]:I,[ae("iconMargin",_)]:k,waveOpacity:U}=x,q={"--n-width":ye&&!te?Pt:"initial","--n-height":te?"initial":Pt,"--n-font-size":h,"--n-padding":ye||te?"initial":oe?P:b,"--n-icon-size":H,"--n-icon-margin":k,"--n-border-radius":te?"initial":ye||oe?Pt:I};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":z,"--n-bezier-ease-out":B,"--n-ripple-duration":F,"--n-opacity-disabled":R,"--n-wave-opacity":U},gt),he),Ge),q)}),T=m?Fr("button",Y(()=>{let w="";const{dashed:z,type:B,ghost:x,text:F,color:R,round:O,circle:j,textColor:_,secondary:J,tertiary:G,quaternary:le,strong:te}=e;z&&(w+="a"),x&&(w+="b"),F&&(w+="c"),O&&(w+="d"),j&&(w+="e"),J&&(w+="f"),G&&(w+="g"),le&&(w+="h"),te&&(w+="i"),R&&(w+=`j${_s(R)}`),_&&(w+=`k${_s(_)}`);const{value:N}=a;return w+=`l${N[0]}`,w+=`m${B[0]}`,w}),$,e):void 0;return{selfElRef:t,waveElRef:o,mergedClsPrefix:f,mergedFocusable:l,mergedSize:a,showBorder:n,enterPressed:r,rtlEnabled:v,handleMousedown:s,handleKeydown:u,handleBlur:p,handleKeyup:d,handleClick:c,customColorCssVars:Y(()=>{const{color:w}=e;if(!w)return null;const z=Lo(w);return{"--n-border-color":w,"--n-border-color-hover":z,"--n-border-color-pressed":Un(w),"--n-border-color-focus":z,"--n-border-color-disabled":w}}),cssVars:m?void 0:$,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){const{mergedClsPrefix:e,tag:t,onRender:o}=this;o==null||o();const r=$t(this.$slots.default,n=>n&&y("span",{class:`${e}-button__content`},n));return y(t,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&r,y(zu,{width:!0},{default:()=>$t(this.$slots.icon,n=>(this.loading||this.renderIcon||n)&&y("span",{class:`${e}-button__icon`,style:{margin:zb(this.$slots.default)?"0":""}},y(Hi,null,{default:()=>this.loading?y(vl,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):y("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():n)})))}),this.iconPlacement==="left"&&r,this.text?null:y(Vy,{ref:"waveElRef",clsPrefix:e}),this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),yP=y1,S1={titleFontSize:"22px"};function w1(e){const{borderRadius:t,fontSize:o,lineHeight:r,textColor2:n,textColor1:i,textColorDisabled:a,dividerColor:l,fontWeightStrong:s,primaryColor:c,baseColor:d,hoverColor:u,cardColor:p,modalColor:m,popoverColor:f}=e;return Object.assign(Object.assign({},S1),{borderRadius:t,borderColor:ee(p,l),borderColorModal:ee(m,l),borderColorPopover:ee(f,l),textColor:n,titleFontWeight:s,titleTextColor:i,dayTextColor:a,fontSize:o,lineHeight:r,dateColorCurrent:c,dateTextColorCurrent:d,cellColorHover:ee(p,u),cellColorHoverModal:ee(m,u),cellColorHoverPopover:ee(f,u),cellColor:p,cellColorModal:m,cellColorPopover:f,barColor:c})}const P1={name:"Calendar",common:W,peers:{Button:wt},self:w1},T1={paddingSmall:"12px 16px 12px",paddingMedium:"19px 24px 20px",paddingLarge:"23px 32px 24px",paddingHuge:"27px 40px 28px",titleFontSizeSmall:"16px",titleFontSizeMedium:"18px",titleFontSizeLarge:"18px",titleFontSizeHuge:"18px",closeIconSize:"18px",closeSize:"22px"};function Gu(e){const{primaryColor:t,borderRadius:o,lineHeight:r,fontSize:n,cardColor:i,textColor2:a,textColor1:l,dividerColor:s,fontWeightStrong:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:m,closeColorPressed:f,modalColor:g,boxShadow1:S,popoverColor:v,actionColor:$}=e;return Object.assign(Object.assign({},T1),{lineHeight:r,color:i,colorModal:g,colorPopover:v,colorTarget:t,colorEmbedded:$,colorEmbeddedModal:$,colorEmbeddedPopover:$,textColor:a,titleTextColor:l,borderColor:s,actionColor:$,titleFontWeight:c,closeColorHover:m,closeColorPressed:f,closeBorderRadius:o,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,fontSizeSmall:n,fontSizeMedium:n,fontSizeLarge:n,fontSizeHuge:n,boxShadow:S,borderRadius:o})}const $1={common:Oe,self:Gu},Ku={name:"Card",common:W,self(e){const t=Gu(e),{cardColor:o,modalColor:r,popoverColor:n}=e;return t.colorEmbedded=o,t.colorEmbeddedModal=r,t.colorEmbeddedPopover=n,t}},R1=L([pe("card",` + `),re("dashed",[V("border, state-border",{borderStyle:"dashed !important"})]),re("disabled",{cursor:"not-allowed",opacity:"var(--n-opacity-disabled)"})]),L("@keyframes button-wave-spread",{from:{boxShadow:"0 0 0.5px 0 var(--n-ripple-color)"},to:{boxShadow:"0 0 0.5px 4.5px var(--n-ripple-color)"}}),L("@keyframes button-wave-opacity",{from:{opacity:"var(--n-wave-opacity)"},to:{opacity:0}})]),C1=Object.assign(Object.assign({},Ct.props),{color:String,textColor:String,text:Boolean,block:Boolean,loading:Boolean,disabled:Boolean,circle:Boolean,size:String,ghost:Boolean,round:Boolean,secondary:Boolean,tertiary:Boolean,quaternary:Boolean,strong:Boolean,focusable:{type:Boolean,default:!0},keyboard:{type:Boolean,default:!0},tag:{type:String,default:"button"},type:{type:String,default:"default"},dashed:Boolean,renderIcon:Function,iconPlacement:{type:String,default:"left"},attrType:{type:String,default:"button"},bordered:{type:Boolean,default:!0},onClick:[Function,Array],nativeFocusBehavior:{type:Boolean,default:!ju}}),y1=He({name:"Button",props:C1,setup(e){const t=fe(null),o=fe(null),r=fe(!1),n=hn(()=>!e.quaternary&&!e.tertiary&&!e.secondary&&!e.text&&(!e.color||e.ghost||e.dashed)&&e.bordered),i=Le(b1,{}),{mergedSizeRef:a}=Zd({},{defaultSize:"medium",mergedSize:w=>{const{size:_}=e;if(_)return _;const{size:O}=i;if(O)return O;const{mergedSize:x}=w||{};return x?x.value:"medium"}}),l=Y(()=>e.focusable&&!e.disabled),s=w=>{var _;l.value||w.preventDefault(),!e.nativeFocusBehavior&&(w.preventDefault(),!e.disabled&&l.value&&((_=t.value)===null||_===void 0||_.focus({preventScroll:!0})))},c=w=>{var _;if(!e.disabled&&!e.loading){const{onClick:O}=e;O&&Ke(O,w),e.text||(_=o.value)===null||_===void 0||_.play()}},d=w=>{switch(w.key){case"Enter":if(!e.keyboard)return;r.value=!1}},u=w=>{switch(w.key){case"Enter":if(!e.keyboard||e.loading){w.preventDefault();return}r.value=!0}},p=()=>{r.value=!1},{inlineThemeDisabled:m,mergedClsPrefixRef:f,mergedRtlRef:g}=zo(e),S=Ct("Button","-button",x1,An,e,f),v=$n("Button",g,f),$=Y(()=>{const w=S.value,{common:{cubicBezierEaseInOut:_,cubicBezierEaseOut:O},self:x}=w,{rippleDuration:F,opacityDisabled:R,fontWeight:B,fontWeightStrong:j}=x,A=a.value,{dashed:J,type:G,ghost:le,text:te,color:N,round:oe,circle:ye,textColor:Pe,secondary:Re,tertiary:Fe,quaternary:Ve,strong:qe}=e,gt={"--n-font-weight":qe?j:B};let he={"--n-color":"initial","--n-color-hover":"initial","--n-color-pressed":"initial","--n-color-focus":"initial","--n-color-disabled":"initial","--n-ripple-color":"initial","--n-text-color":"initial","--n-text-color-hover":"initial","--n-text-color-pressed":"initial","--n-text-color-focus":"initial","--n-text-color-disabled":"initial"};const Ue=G==="tertiary",rt=G==="default",be=Ue?"default":G;if(te){const z=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":"#0000","--n-text-color":z||x[ae("textColorText",be)],"--n-text-color-hover":z?Lo(z):x[ae("textColorTextHover",be)],"--n-text-color-pressed":z?qn(z):x[ae("textColorTextPressed",be)],"--n-text-color-focus":z?Lo(z):x[ae("textColorTextHover",be)],"--n-text-color-disabled":z||x[ae("textColorTextDisabled",be)]}}else if(le||J){const z=Pe||N;he={"--n-color":"#0000","--n-color-hover":"#0000","--n-color-pressed":"#0000","--n-color-focus":"#0000","--n-color-disabled":"#0000","--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":z||x[ae("textColorGhost",be)],"--n-text-color-hover":z?Lo(z):x[ae("textColorGhostHover",be)],"--n-text-color-pressed":z?qn(z):x[ae("textColorGhostPressed",be)],"--n-text-color-focus":z?Lo(z):x[ae("textColorGhostHover",be)],"--n-text-color-disabled":z||x[ae("textColorGhostDisabled",be)]}}else if(Re){const z=rt?x.textColor:Ue?x.textColorTertiary:x[ae("color",be)],I=N||z,ie=G!=="default"&&G!=="tertiary";he={"--n-color":ie?K(I,{alpha:Number(x.colorOpacitySecondary)}):x.colorSecondary,"--n-color-hover":ie?K(I,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-pressed":ie?K(I,{alpha:Number(x.colorOpacitySecondaryPressed)}):x.colorSecondaryPressed,"--n-color-focus":ie?K(I,{alpha:Number(x.colorOpacitySecondaryHover)}):x.colorSecondaryHover,"--n-color-disabled":x.colorSecondary,"--n-ripple-color":"#0000","--n-text-color":I,"--n-text-color-hover":I,"--n-text-color-pressed":I,"--n-text-color-focus":I,"--n-text-color-disabled":I}}else if(Fe||Ve){const z=rt?x.textColor:Ue?x.textColorTertiary:x[ae("color",be)],I=N||z;Fe?(he["--n-color"]=x.colorTertiary,he["--n-color-hover"]=x.colorTertiaryHover,he["--n-color-pressed"]=x.colorTertiaryPressed,he["--n-color-focus"]=x.colorSecondaryHover,he["--n-color-disabled"]=x.colorTertiary):(he["--n-color"]=x.colorQuaternary,he["--n-color-hover"]=x.colorQuaternaryHover,he["--n-color-pressed"]=x.colorQuaternaryPressed,he["--n-color-focus"]=x.colorQuaternaryHover,he["--n-color-disabled"]=x.colorQuaternary),he["--n-ripple-color"]="#0000",he["--n-text-color"]=I,he["--n-text-color-hover"]=I,he["--n-text-color-pressed"]=I,he["--n-text-color-focus"]=I,he["--n-text-color-disabled"]=I}else he={"--n-color":N||x[ae("color",be)],"--n-color-hover":N?Lo(N):x[ae("colorHover",be)],"--n-color-pressed":N?qn(N):x[ae("colorPressed",be)],"--n-color-focus":N?Lo(N):x[ae("colorFocus",be)],"--n-color-disabled":N||x[ae("colorDisabled",be)],"--n-ripple-color":N||x[ae("rippleColor",be)],"--n-text-color":Pe||(N?x.textColorPrimary:Ue?x.textColorTertiary:x[ae("textColor",be)]),"--n-text-color-hover":Pe||(N?x.textColorHoverPrimary:x[ae("textColorHover",be)]),"--n-text-color-pressed":Pe||(N?x.textColorPressedPrimary:x[ae("textColorPressed",be)]),"--n-text-color-focus":Pe||(N?x.textColorFocusPrimary:x[ae("textColorFocus",be)]),"--n-text-color-disabled":Pe||(N?x.textColorDisabledPrimary:x[ae("textColorDisabled",be)])};let Ge={"--n-border":"initial","--n-border-hover":"initial","--n-border-pressed":"initial","--n-border-focus":"initial","--n-border-disabled":"initial"};te?Ge={"--n-border":"none","--n-border-hover":"none","--n-border-pressed":"none","--n-border-focus":"none","--n-border-disabled":"none"}:Ge={"--n-border":x[ae("border",be)],"--n-border-hover":x[ae("borderHover",be)],"--n-border-pressed":x[ae("borderPressed",be)],"--n-border-focus":x[ae("borderFocus",be)],"--n-border-disabled":x[ae("borderDisabled",be)]};const{[ae("height",A)]:Pt,[ae("fontSize",A)]:h,[ae("padding",A)]:b,[ae("paddingRound",A)]:P,[ae("iconSize",A)]:H,[ae("borderRadius",A)]:M,[ae("iconMargin",A)]:k,waveOpacity:q}=x,U={"--n-width":ye&&!te?Pt:"initial","--n-height":te?"initial":Pt,"--n-font-size":h,"--n-padding":ye||te?"initial":oe?P:b,"--n-icon-size":H,"--n-icon-margin":k,"--n-border-radius":te?"initial":ye||oe?Pt:M};return Object.assign(Object.assign(Object.assign(Object.assign({"--n-bezier":_,"--n-bezier-ease-out":O,"--n-ripple-duration":F,"--n-opacity-disabled":R,"--n-wave-opacity":q},gt),he),Ge),U)}),T=m?Fr("button",Y(()=>{let w="";const{dashed:_,type:O,ghost:x,text:F,color:R,round:B,circle:j,textColor:A,secondary:J,tertiary:G,quaternary:le,strong:te}=e;_&&(w+="a"),x&&(w+="b"),F&&(w+="c"),B&&(w+="d"),j&&(w+="e"),J&&(w+="f"),G&&(w+="g"),le&&(w+="h"),te&&(w+="i"),R&&(w+=`j${As(R)}`),A&&(w+=`k${As(A)}`);const{value:N}=a;return w+=`l${N[0]}`,w+=`m${O[0]}`,w}),$,e):void 0;return{selfElRef:t,waveElRef:o,mergedClsPrefix:f,mergedFocusable:l,mergedSize:a,showBorder:n,enterPressed:r,rtlEnabled:v,handleMousedown:s,handleKeydown:u,handleBlur:p,handleKeyup:d,handleClick:c,customColorCssVars:Y(()=>{const{color:w}=e;if(!w)return null;const _=Lo(w);return{"--n-border-color":w,"--n-border-color-hover":_,"--n-border-color-pressed":qn(w),"--n-border-color-focus":_,"--n-border-color-disabled":w}}),cssVars:m?void 0:$,themeClass:T==null?void 0:T.themeClass,onRender:T==null?void 0:T.onRender}},render(){const{mergedClsPrefix:e,tag:t,onRender:o}=this;o==null||o();const r=$t(this.$slots.default,n=>n&&y("span",{class:`${e}-button__content`},n));return y(t,{ref:"selfElRef",class:[this.themeClass,`${e}-button`,`${e}-button--${this.type}-type`,`${e}-button--${this.mergedSize}-type`,this.rtlEnabled&&`${e}-button--rtl`,this.disabled&&`${e}-button--disabled`,this.block&&`${e}-button--block`,this.enterPressed&&`${e}-button--pressed`,!this.text&&this.dashed&&`${e}-button--dashed`,this.color&&`${e}-button--color`,this.secondary&&`${e}-button--secondary`,this.loading&&`${e}-button--loading`,this.ghost&&`${e}-button--ghost`],tabindex:this.mergedFocusable?0:-1,type:this.attrType,style:this.cssVars,disabled:this.disabled,onClick:this.handleClick,onBlur:this.handleBlur,onMousedown:this.handleMousedown,onKeyup:this.handleKeyup,onKeydown:this.handleKeydown},this.iconPlacement==="right"&&r,y(_u,{width:!0},{default:()=>$t(this.$slots.icon,n=>(this.loading||this.renderIcon||n)&&y("span",{class:`${e}-button__icon`,style:{margin:_b(this.$slots.default)?"0":""}},y(Hi,null,{default:()=>this.loading?y(vl,{clsPrefix:e,key:"loading",class:`${e}-icon-slot`,strokeWidth:20}):y("div",{key:"icon",class:`${e}-icon-slot`,role:"none"},this.renderIcon?this.renderIcon():n)})))}),this.iconPlacement==="left"&&r,this.text?null:y(Vy,{ref:"waveElRef",clsPrefix:e}),this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__border`,style:this.customColorCssVars}):null,this.showBorder?y("div",{"aria-hidden":!0,class:`${e}-button__state-border`,style:this.customColorCssVars}):null)}}),yP=y1,S1={titleFontSize:"22px"};function w1(e){const{borderRadius:t,fontSize:o,lineHeight:r,textColor2:n,textColor1:i,textColorDisabled:a,dividerColor:l,fontWeightStrong:s,primaryColor:c,baseColor:d,hoverColor:u,cardColor:p,modalColor:m,popoverColor:f}=e;return Object.assign(Object.assign({},S1),{borderRadius:t,borderColor:ee(p,l),borderColorModal:ee(m,l),borderColorPopover:ee(f,l),textColor:n,titleFontWeight:s,titleTextColor:i,dayTextColor:a,fontSize:o,lineHeight:r,dateColorCurrent:c,dateTextColorCurrent:d,cellColorHover:ee(p,u),cellColorHoverModal:ee(m,u),cellColorHoverPopover:ee(f,u),cellColor:p,cellColorModal:m,cellColorPopover:f,barColor:c})}const P1={name:"Calendar",common:W,peers:{Button:wt},self:w1},T1={paddingSmall:"12px 16px 12px",paddingMedium:"19px 24px 20px",paddingLarge:"23px 32px 24px",paddingHuge:"27px 40px 28px",titleFontSizeSmall:"16px",titleFontSizeMedium:"18px",titleFontSizeLarge:"18px",titleFontSizeHuge:"18px",closeIconSize:"18px",closeSize:"22px"};function Gu(e){const{primaryColor:t,borderRadius:o,lineHeight:r,fontSize:n,cardColor:i,textColor2:a,textColor1:l,dividerColor:s,fontWeightStrong:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeColorHover:m,closeColorPressed:f,modalColor:g,boxShadow1:S,popoverColor:v,actionColor:$}=e;return Object.assign(Object.assign({},T1),{lineHeight:r,color:i,colorModal:g,colorPopover:v,colorTarget:t,colorEmbedded:$,colorEmbeddedModal:$,colorEmbeddedPopover:$,textColor:a,titleTextColor:l,borderColor:s,actionColor:$,titleFontWeight:c,closeColorHover:m,closeColorPressed:f,closeBorderRadius:o,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,fontSizeSmall:n,fontSizeMedium:n,fontSizeLarge:n,fontSizeHuge:n,boxShadow:S,borderRadius:o})}const $1={common:Be,self:Gu},Ku={name:"Card",common:W,self(e){const t=Gu(e),{cardColor:o,modalColor:r,popoverColor:n}=e;return t.colorEmbedded=o,t.colorEmbeddedModal=r,t.colorEmbeddedPopover=n,t}},R1=L([pe("card",` font-size: var(--n-font-size); line-height: var(--n-line-height); display: flex; @@ -587,7 +587,7 @@ ${t} background-color .3s var(--n-bezier), box-shadow .3s var(--n-bezier), border-color .3s var(--n-bezier); - `,[_m({background:"var(--n-color-modal)"}),re("hoverable",[L("&:hover","box-shadow: var(--n-box-shadow);")]),re("content-segmented",[L(">",[V("content",{paddingTop:"var(--n-padding-bottom)"})])]),re("content-soft-segmented",[L(">",[V("content",` + `,[Am({background:"var(--n-color-modal)"}),re("hoverable",[L("&:hover","box-shadow: var(--n-box-shadow);")]),re("content-segmented",[L(">",[V("content",{paddingTop:"var(--n-padding-bottom)"})])]),re("content-soft-segmented",[L(">",[V("content",` margin: 0 var(--n-padding-left); padding: var(--n-padding-bottom) 0; `)])]),re("footer-segmented",[L(">",[V("footer",{paddingTop:"var(--n-padding-bottom)"})])]),re("footer-soft-segmented",[L(">",[V("footer",` @@ -656,7 +656,7 @@ ${t} background: var(--n-color-popover); `,[re("embedded",` background-color: var(--n-color-embedded-popover); - `)]))]),F1={title:[String,Function],contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],headerExtraClass:String,headerExtraStyle:[Object,String],footerClass:String,footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"},cover:Function,content:[String,Function],footer:Function,action:Function,headerExtra:Function},_1=Object.assign(Object.assign({},Ct.props),F1),SP=He({name:"Card",props:_1,setup(e){const t=()=>{const{onClose:c}=e;c&&Ke(c)},{inlineThemeDisabled:o,mergedClsPrefixRef:r,mergedRtlRef:n}=Ao(e),i=Ct("Card","-card",R1,$1,e,r),a=$n("Card",n,r),l=Y(()=>{const{size:c}=e,{self:{color:d,colorModal:u,colorTarget:p,textColor:m,titleTextColor:f,titleFontWeight:g,borderColor:S,actionColor:v,borderRadius:$,lineHeight:T,closeIconColor:w,closeIconColorHover:z,closeIconColorPressed:B,closeColorHover:x,closeColorPressed:F,closeBorderRadius:R,closeIconSize:O,closeSize:j,boxShadow:_,colorPopover:J,colorEmbedded:G,colorEmbeddedModal:le,colorEmbeddedPopover:te,[ae("padding",c)]:N,[ae("fontSize",c)]:oe,[ae("titleFontSize",c)]:ye},common:{cubicBezierEaseInOut:Pe}}=i.value,{top:Re,left:Fe,bottom:Ve}=Vo(N);return{"--n-bezier":Pe,"--n-border-radius":$,"--n-color":d,"--n-color-modal":u,"--n-color-popover":J,"--n-color-embedded":G,"--n-color-embedded-modal":le,"--n-color-embedded-popover":te,"--n-color-target":p,"--n-text-color":m,"--n-line-height":T,"--n-action-color":v,"--n-title-text-color":f,"--n-title-font-weight":g,"--n-close-icon-color":w,"--n-close-icon-color-hover":z,"--n-close-icon-color-pressed":B,"--n-close-color-hover":x,"--n-close-color-pressed":F,"--n-border-color":S,"--n-box-shadow":_,"--n-padding-top":Re,"--n-padding-bottom":Ve,"--n-padding-left":Fe,"--n-font-size":oe,"--n-title-font-size":ye,"--n-close-size":j,"--n-close-icon-size":O,"--n-close-border-radius":R}}),s=o?Fr("card",Y(()=>e.size[0]),l,e):void 0;return{rtlEnabled:a,mergedClsPrefix:r,mergedTheme:i,handleCloseClick:t,cssVars:o?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{segmented:e,bordered:t,hoverable:o,mergedClsPrefix:r,rtlEnabled:n,onRender:i,embedded:a,tag:l,$slots:s}=this;return i==null||i(),y(l,{class:[`${r}-card`,this.themeClass,a&&`${r}-card--embedded`,{[`${r}-card--rtl`]:n,[`${r}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${r}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${r}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${r}-card--bordered`]:t,[`${r}-card--hoverable`]:o}],style:this.cssVars,role:this.role},$t(s.cover,c=>{const d=this.cover?kt([this.cover()]):c;return d&&y("div",{class:`${r}-card-cover`,role:"none"},d)}),$t(s.header,c=>{const{title:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u||this.closable?y("div",{class:[`${r}-card-header`,this.headerClass],style:this.headerStyle,role:"heading"},y("div",{class:`${r}-card-header__main`,role:"heading"},u),$t(s["header-extra"],p=>{const m=this.headerExtra?kt([this.headerExtra()]):p;return m&&y("div",{class:[`${r}-card-header__extra`,this.headerExtraClass],style:this.headerExtraStyle},m)}),this.closable&&y(Eu,{clsPrefix:r,class:`${r}-card-header__close`,onClick:this.handleCloseClick,absolute:!0})):null}),$t(s.default,c=>{const{content:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u&&y("div",{class:[`${r}-card__content`,this.contentClass],style:this.contentStyle,role:"none"},u)}),$t(s.footer,c=>{const d=this.footer?kt([this.footer()]):c;return d&&y("div",{class:[`${r}-card__footer`,this.footerClass],style:this.footerStyle,role:"none"},d)}),$t(s.action,c=>{const d=this.action?kt([this.action()]):c;return d&&y("div",{class:`${r}-card__action`,role:"none"},d)}))}});function E1(){return{dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}}const z1={name:"Carousel",common:W,self:E1},M1={sizeSmall:"14px",sizeMedium:"16px",sizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"};function Yu(e){const{baseColor:t,inputColorDisabled:o,cardColor:r,modalColor:n,popoverColor:i,textColorDisabled:a,borderColor:l,primaryColor:s,textColor2:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadiusSmall:m,lineHeight:f}=e;return Object.assign(Object.assign({},M1),{labelLineHeight:f,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadius:m,color:t,colorChecked:s,colorDisabled:o,colorDisabledChecked:o,colorTableHeader:r,colorTableHeaderModal:n,colorTableHeaderPopover:i,checkMarkColor:t,checkMarkColorDisabled:a,checkMarkColorDisabledChecked:a,border:`1px solid ${l}`,borderDisabled:`1px solid ${l}`,borderDisabledChecked:`1px solid ${l}`,borderChecked:`1px solid ${s}`,borderFocus:`1px solid ${s}`,boxShadowFocus:`0 0 0 2px ${K(s,{alpha:.3})}`,textColor:c,textColorDisabled:a})}const I1={name:"Checkbox",common:Oe,self:Yu},Hr={name:"Checkbox",common:W,self(e){const{cardColor:t}=e,o=Yu(e);return o.color="#0000",o.checkMarkColor=t,o}};function A1(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n,textColor3:i,primaryColor:a,textColorDisabled:l,dividerColor:s,hoverColor:c,fontSizeMedium:d,heightMedium:u}=e;return{menuBorderRadius:t,menuColor:r,menuBoxShadow:o,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:i,optionHeight:u,optionFontSize:d,optionColorHover:c,optionTextColor:n,optionTextColorActive:a,optionTextColorDisabled:l,optionCheckMarkColor:a,loadingColor:a,columnWidth:"180px"}}const H1={name:"Cascader",common:W,peers:{InternalSelectMenu:Fn,InternalSelection:Cl,Scrollbar:St,Checkbox:Hr,Empty:xl},self:A1},Xu={name:"Code",common:W,self(e){const{textColor2:t,fontSize:o,fontWeightStrong:r,textColor3:n}=e;return{textColor:t,fontSize:o,fontWeightStrong:r,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:n}}};function k1(e){const{fontWeight:t,textColor1:o,textColor2:r,textColorDisabled:n,dividerColor:i,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:t,dividerColor:i,titleTextColor:o,titleTextColorDisabled:n,fontSize:a,textColor:r,arrowColor:r,arrowColorDisabled:n,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}}const D1={name:"Collapse",common:W,self:k1};function B1(e){const{cubicBezierEaseInOut:t}=e;return{bezier:t}}const O1={name:"CollapseTransition",common:W,self:B1};function L1(e){const{fontSize:t,boxShadow2:o,popoverColor:r,textColor2:n,borderRadius:i,borderColor:a,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}=e;return{panelFontSize:t,boxShadow:o,color:r,textColor:n,borderRadius:i,border:`1px solid ${a}`,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}}const W1={name:"ColorPicker",common:W,peers:{Input:At,Button:wt},self:L1},j1={abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,styleMountTarget:Object,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(_a("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},wP=He({name:"ConfigProvider",alias:["App"],props:j1,setup(e){const t=Le(Qt,null),o=Y(()=>{const{theme:g}=e;if(g===null)return;const S=t==null?void 0:t.mergedThemeRef.value;return g===void 0?S:S===void 0?g:Object.assign({},S,g)}),r=Y(()=>{const{themeOverrides:g}=e;if(g!==null){if(g===void 0)return t==null?void 0:t.mergedThemeOverridesRef.value;{const S=t==null?void 0:t.mergedThemeOverridesRef.value;return S===void 0?g:Vr({},S,g)}}}),n=hn(()=>{const{namespace:g}=e;return g===void 0?t==null?void 0:t.mergedNamespaceRef.value:g}),i=hn(()=>{const{bordered:g}=e;return g===void 0?t==null?void 0:t.mergedBorderedRef.value:g}),a=Y(()=>{const{icons:g}=e;return g===void 0?t==null?void 0:t.mergedIconsRef.value:g}),l=Y(()=>{const{componentOptions:g}=e;return g!==void 0?g:t==null?void 0:t.mergedComponentPropsRef.value}),s=Y(()=>{const{clsPrefix:g}=e;return g!==void 0?g:t?t.mergedClsPrefixRef.value:pi}),c=Y(()=>{var g;const{rtl:S}=e;if(S===void 0)return t==null?void 0:t.mergedRtlRef.value;const v={};for(const $ of S)v[$.name]=da($),(g=$.peers)===null||g===void 0||g.forEach(T=>{T.name in v||(v[T.name]=da(T))});return v}),d=Y(()=>e.breakpoints||(t==null?void 0:t.mergedBreakpointsRef.value)),u=e.inlineThemeDisabled||(t==null?void 0:t.inlineThemeDisabled),p=e.preflightStyleDisabled||(t==null?void 0:t.preflightStyleDisabled),m=e.styleMountTarget||(t==null?void 0:t.styleMountTarget),f=Y(()=>{const{value:g}=o,{value:S}=r,v=S&&Object.keys(S).length!==0,$=g==null?void 0:g.name;return $?v?`${$}-${fn(JSON.stringify(r.value))}`:$:v?fn(JSON.stringify(r.value)):""});return po(Qt,{mergedThemeHashRef:f,mergedBreakpointsRef:d,mergedRtlRef:c,mergedIconsRef:a,mergedComponentPropsRef:l,mergedBorderedRef:i,mergedNamespaceRef:n,mergedClsPrefixRef:s,mergedLocaleRef:Y(()=>{const{locale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedLocaleRef.value:g}),mergedDateLocaleRef:Y(()=>{const{dateLocale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedDateLocaleRef.value:g}),mergedHljsRef:Y(()=>{const{hljs:g}=e;return g===void 0?t==null?void 0:t.mergedHljsRef.value:g}),mergedKatexRef:Y(()=>{const{katex:g}=e;return g===void 0?t==null?void 0:t.mergedKatexRef.value:g}),mergedThemeRef:o,mergedThemeOverridesRef:r,inlineThemeDisabled:u||!1,preflightStyleDisabled:p||!1,styleMountTarget:m}),{mergedClsPrefix:s,mergedBordered:i,mergedNamespace:n,mergedTheme:o,mergedThemeOverrides:r}},render(){var e,t,o,r;return this.abstract?(r=(o=this.$slots).default)===null||r===void 0?void 0:r.call(o):y(this.as||this.tag,{class:`${this.mergedClsPrefix||pi}-config-provider`},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}}),Ju={name:"Popselect",common:W,peers:{Popover:lr,InternalSelectMenu:Fn}};function N1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const V1={name:"Popselect",common:Oe,peers:{Popover:Ar,InternalSelectMenu:Bu},self:N1};function Zu(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const q1={name:"Select",common:Oe,peers:{InternalSelection:Wy,InternalSelectMenu:Bu},self:Zu},Qu={name:"Select",common:W,peers:{InternalSelection:Cl,InternalSelectMenu:Fn},self:Zu},U1={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"};function ef(e){const{textColor2:t,primaryColor:o,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:i,textColorDisabled:a,borderColor:l,borderRadius:s,fontSizeTiny:c,fontSizeSmall:d,fontSizeMedium:u,heightTiny:p,heightSmall:m,heightMedium:f}=e;return Object.assign(Object.assign({},U1),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${l}`,buttonBorderHover:`1px solid ${l}`,buttonBorderPressed:`1px solid ${l}`,buttonIconColor:t,buttonIconColorHover:t,buttonIconColorPressed:t,itemTextColor:t,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:o,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:i,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${o}`,itemBorderDisabled:`1px solid ${l}`,itemBorderRadius:s,itemSizeSmall:p,itemSizeMedium:m,itemSizeLarge:f,itemFontSizeSmall:c,itemFontSizeMedium:d,itemFontSizeLarge:u,jumperFontSizeSmall:c,jumperFontSizeMedium:d,jumperFontSizeLarge:u,jumperTextColor:t,jumperTextColorDisabled:a})}const G1={name:"Pagination",common:Oe,peers:{Select:q1,Input:ki,Popselect:V1},self:ef},tf={name:"Pagination",common:W,peers:{Select:Qu,Input:At,Popselect:Ju},self(e){const{primaryColor:t,opacity3:o}=e,r=K(t,{alpha:Number(o)}),n=ef(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},K1={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function of(e){const{primaryColor:t,textColor2:o,dividerColor:r,hoverColor:n,popoverColor:i,invertedColor:a,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,heightSmall:p,heightMedium:m,heightLarge:f,heightHuge:g,textColor3:S,opacityDisabled:v}=e;return Object.assign(Object.assign({},K1),{optionHeightSmall:p,optionHeightMedium:m,optionHeightLarge:f,optionHeightHuge:g,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,optionTextColor:o,optionTextColorHover:o,optionTextColorActive:t,optionTextColorChildActive:t,color:i,dividerColor:r,suffixColor:o,prefixColor:o,optionColorHover:n,optionColorActive:K(t,{alpha:.1}),groupHeaderTextColor:S,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:a,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:t,optionColorActiveInverted:t,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:v})}const Y1={name:"Dropdown",common:Oe,peers:{Popover:Ar},self:of},yl={name:"Dropdown",common:W,peers:{Popover:lr},self(e){const{primaryColorSuppl:t,primaryColor:o,popoverColor:r}=e,n=of(e);return n.colorInverted=r,n.optionColorActive=K(o,{alpha:.15}),n.optionColorActiveInverted=t,n.optionColorHoverInverted=t,n}},rf={padding:"8px 14px"},Di={name:"Tooltip",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:r,textColor:n})}};function X1(e){const{borderRadius:t,boxShadow2:o,baseColor:r}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:ee(r,"rgba(0, 0, 0, .85)"),textColor:r})}const J1={name:"Tooltip",common:Oe,peers:{Popover:Ar},self:X1},nf={name:"Ellipsis",common:W,peers:{Tooltip:Di}},Z1={name:"Ellipsis",common:Oe,peers:{Tooltip:J1}},af={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},lf={name:"Radio",common:W,self(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:"#0000",colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:o,buttonColor:"#0000",buttonColorActive:o,buttonTextColor:a,buttonTextColorActive:r,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${o}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};function Q1(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:r,colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:t,buttonColor:r,buttonColorActive:r,buttonTextColor:a,buttonTextColorActive:o,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}const eS={name:"Radio",common:Oe,self:Q1},tS={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"};function sf(e){const{cardColor:t,modalColor:o,popoverColor:r,textColor2:n,textColor1:i,tableHeaderColor:a,tableColorHover:l,iconColor:s,primaryColor:c,fontWeightStrong:d,borderRadius:u,lineHeight:p,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,dividerColor:S,heightSmall:v,opacityDisabled:$,tableColorStriped:T}=e;return Object.assign(Object.assign({},tS),{actionDividerColor:S,lineHeight:p,borderRadius:u,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,borderColor:ee(t,S),tdColorHover:ee(t,l),tdColorSorting:ee(t,l),tdColorStriped:ee(t,T),thColor:ee(t,a),thColorHover:ee(ee(t,a),l),thColorSorting:ee(ee(t,a),l),tdColor:t,tdTextColor:n,thTextColor:i,thFontWeight:d,thButtonColorHover:l,thIconColor:s,thIconColorActive:c,borderColorModal:ee(o,S),tdColorHoverModal:ee(o,l),tdColorSortingModal:ee(o,l),tdColorStripedModal:ee(o,T),thColorModal:ee(o,a),thColorHoverModal:ee(ee(o,a),l),thColorSortingModal:ee(ee(o,a),l),tdColorModal:o,borderColorPopover:ee(r,S),tdColorHoverPopover:ee(r,l),tdColorSortingPopover:ee(r,l),tdColorStripedPopover:ee(r,T),thColorPopover:ee(r,a),thColorHoverPopover:ee(ee(r,a),l),thColorSortingPopover:ee(ee(r,a),l),tdColorPopover:r,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:c,loadingSize:v,opacityLoading:$})}const PP={name:"DataTable",common:Oe,peers:{Button:_n,Checkbox:I1,Radio:eS,Pagination:G1,Scrollbar:Rn,Empty:xl,Popover:Ar,Ellipsis:Z1,Dropdown:Y1},self:sf},oS={name:"DataTable",common:W,peers:{Button:wt,Checkbox:Hr,Radio:lf,Pagination:tf,Scrollbar:St,Empty:ar,Popover:lr,Ellipsis:nf,Dropdown:yl},self(e){const t=sf(e);return t.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",t.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",t}};function cf(e){const{textColorBase:t,opacity1:o,opacity2:r,opacity3:n,opacity4:i,opacity5:a}=e;return{color:t,opacity1Depth:o,opacity2Depth:r,opacity3Depth:n,opacity4Depth:i,opacity5Depth:a}}const TP={common:Oe,self:cf},rS={name:"Icon",common:W,self:cf},nS={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};function df(e){const{popoverColor:t,textColor2:o,primaryColor:r,hoverColor:n,dividerColor:i,opacityDisabled:a,boxShadow2:l,borderRadius:s,iconColor:c,iconColorDisabled:d}=e;return Object.assign(Object.assign({},nS),{panelColor:t,panelBoxShadow:l,panelDividerColor:i,itemTextColor:o,itemTextColorActive:r,itemColorHover:n,itemOpacityDisabled:a,itemBorderRadius:s,borderRadius:s,iconColor:c,iconColorDisabled:d})}const iS={name:"TimePicker",common:Oe,peers:{Scrollbar:Rn,Button:_n,Input:ki},self:df},uf={name:"TimePicker",common:W,peers:{Scrollbar:St,Button:wt,Input:At},self:df},aS={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarLeftPaddingWeek:"6px 12px 4px 12px",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0",calendarRightPaddingWeek:"0"};function ff(e){const{hoverColor:t,fontSize:o,textColor2:r,textColorDisabled:n,popoverColor:i,primaryColor:a,borderRadiusSmall:l,iconColor:s,iconColorDisabled:c,textColor1:d,dividerColor:u,boxShadow2:p,borderRadius:m,fontWeightStrong:f}=e;return Object.assign(Object.assign({},aS),{itemFontSize:o,calendarDaysFontSize:o,calendarTitleFontSize:o,itemTextColor:r,itemTextColorDisabled:n,itemTextColorActive:i,itemTextColorCurrent:a,itemColorIncluded:K(a,{alpha:.1}),itemColorHover:t,itemColorDisabled:t,itemColorActive:a,itemBorderRadius:l,panelColor:i,panelTextColor:r,arrowColor:s,calendarTitleTextColor:d,calendarTitleColorHover:t,calendarDaysTextColor:r,panelHeaderDividerColor:u,calendarDaysDividerColor:u,calendarDividerColor:u,panelActionDividerColor:u,panelBoxShadow:p,panelBorderRadius:m,calendarTitleFontWeight:f,scrollItemBorderRadius:m,iconColor:s,iconColorDisabled:c})}const $P={name:"DatePicker",common:Oe,peers:{Input:ki,Button:_n,TimePicker:iS,Scrollbar:Rn},self:ff},lS={name:"DatePicker",common:W,peers:{Input:At,Button:wt,TimePicker:uf,Scrollbar:St},self(e){const{popoverColor:t,hoverColor:o,primaryColor:r}=e,n=ff(e);return n.itemColorDisabled=ee(t,o),n.itemColorIncluded=K(r,{alpha:.15}),n.itemColorHover=ee(t,o),n}},sS={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"};function cS(e){const{tableHeaderColor:t,textColor2:o,textColor1:r,cardColor:n,modalColor:i,popoverColor:a,dividerColor:l,borderRadius:s,fontWeightStrong:c,lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m}=e;return Object.assign(Object.assign({},sS),{lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m,titleTextColor:r,thColor:ee(n,t),thColorModal:ee(i,t),thColorPopover:ee(a,t),thTextColor:r,thFontWeight:c,tdTextColor:o,tdColor:n,tdColorModal:i,tdColorPopover:a,borderColor:ee(n,l),borderColorModal:ee(i,l),borderColorPopover:ee(a,l),borderRadius:s})}const dS={name:"Descriptions",common:W,self:cS},uS={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px 26px 0 0",closeMarginIconTop:"10px 16px 0 0"};function fS(e){const{textColor1:t,textColor2:o,modalColor:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,infoColor:c,successColor:d,warningColor:u,errorColor:p,primaryColor:m,dividerColor:f,borderRadius:g,fontWeightStrong:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},uS),{fontSize:$,lineHeight:v,border:`1px solid ${f}`,titleTextColor:t,textColor:o,color:r,closeColorHover:l,closeColorPressed:s,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeBorderRadius:g,iconColor:m,iconColorInfo:c,iconColorSuccess:d,iconColorWarning:u,iconColorError:p,borderRadius:g,titleFontWeight:S})}const pf={name:"Dialog",common:W,peers:{Button:wt},self:fS};function pS(e){const{modalColor:t,textColor2:o,boxShadow3:r}=e;return{color:t,textColor:o,boxShadow:r}}const hS={name:"Modal",common:W,peers:{Scrollbar:St,Dialog:pf,Card:Ku},self:pS},gS={name:"LoadingBar",common:W,self(e){const{primaryColor:t}=e;return{colorError:"red",colorLoading:t,height:"2px"}}},mS="n-message-api",hf="n-message-provider",bS={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"};function gf(e){const{textColor2:t,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,infoColor:i,successColor:a,errorColor:l,warningColor:s,popoverColor:c,boxShadow2:d,primaryColor:u,lineHeight:p,borderRadius:m,closeColorHover:f,closeColorPressed:g}=e;return Object.assign(Object.assign({},bS),{closeBorderRadius:m,textColor:t,textColorInfo:t,textColorSuccess:t,textColorError:t,textColorWarning:t,textColorLoading:t,color:c,colorInfo:c,colorSuccess:c,colorError:c,colorWarning:c,colorLoading:c,boxShadow:d,boxShadowInfo:d,boxShadowSuccess:d,boxShadowError:d,boxShadowWarning:d,boxShadowLoading:d,iconColor:t,iconColorInfo:i,iconColorSuccess:a,iconColorWarning:s,iconColorError:l,iconColorLoading:u,closeColorHover:f,closeColorPressed:g,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,closeColorHoverInfo:f,closeColorPressedInfo:g,closeIconColorInfo:o,closeIconColorHoverInfo:r,closeIconColorPressedInfo:n,closeColorHoverSuccess:f,closeColorPressedSuccess:g,closeIconColorSuccess:o,closeIconColorHoverSuccess:r,closeIconColorPressedSuccess:n,closeColorHoverError:f,closeColorPressedError:g,closeIconColorError:o,closeIconColorHoverError:r,closeIconColorPressedError:n,closeColorHoverWarning:f,closeColorPressedWarning:g,closeIconColorWarning:o,closeIconColorHoverWarning:r,closeIconColorPressedWarning:n,closeColorHoverLoading:f,closeColorPressedLoading:g,closeIconColorLoading:o,closeIconColorHoverLoading:r,closeIconColorPressedLoading:n,loadingColor:u,lineHeight:p,borderRadius:m})}const vS={common:Oe,self:gf},xS={name:"Message",common:W,self:gf},mf={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},CS=L([pe("message-wrapper",` + `)]))]),F1={title:[String,Function],contentClass:String,contentStyle:[Object,String],headerClass:String,headerStyle:[Object,String],headerExtraClass:String,headerExtraStyle:[Object,String],footerClass:String,footerStyle:[Object,String],embedded:Boolean,segmented:{type:[Boolean,Object],default:!1},size:{type:String,default:"medium"},bordered:{type:Boolean,default:!0},closable:Boolean,hoverable:Boolean,role:String,onClose:[Function,Array],tag:{type:String,default:"div"},cover:Function,content:[String,Function],footer:Function,action:Function,headerExtra:Function},A1=Object.assign(Object.assign({},Ct.props),F1),SP=He({name:"Card",props:A1,setup(e){const t=()=>{const{onClose:c}=e;c&&Ke(c)},{inlineThemeDisabled:o,mergedClsPrefixRef:r,mergedRtlRef:n}=zo(e),i=Ct("Card","-card",R1,$1,e,r),a=$n("Card",n,r),l=Y(()=>{const{size:c}=e,{self:{color:d,colorModal:u,colorTarget:p,textColor:m,titleTextColor:f,titleFontWeight:g,borderColor:S,actionColor:v,borderRadius:$,lineHeight:T,closeIconColor:w,closeIconColorHover:_,closeIconColorPressed:O,closeColorHover:x,closeColorPressed:F,closeBorderRadius:R,closeIconSize:B,closeSize:j,boxShadow:A,colorPopover:J,colorEmbedded:G,colorEmbeddedModal:le,colorEmbeddedPopover:te,[ae("padding",c)]:N,[ae("fontSize",c)]:oe,[ae("titleFontSize",c)]:ye},common:{cubicBezierEaseInOut:Pe}}=i.value,{top:Re,left:Fe,bottom:Ve}=Vo(N);return{"--n-bezier":Pe,"--n-border-radius":$,"--n-color":d,"--n-color-modal":u,"--n-color-popover":J,"--n-color-embedded":G,"--n-color-embedded-modal":le,"--n-color-embedded-popover":te,"--n-color-target":p,"--n-text-color":m,"--n-line-height":T,"--n-action-color":v,"--n-title-text-color":f,"--n-title-font-weight":g,"--n-close-icon-color":w,"--n-close-icon-color-hover":_,"--n-close-icon-color-pressed":O,"--n-close-color-hover":x,"--n-close-color-pressed":F,"--n-border-color":S,"--n-box-shadow":A,"--n-padding-top":Re,"--n-padding-bottom":Ve,"--n-padding-left":Fe,"--n-font-size":oe,"--n-title-font-size":ye,"--n-close-size":j,"--n-close-icon-size":B,"--n-close-border-radius":R}}),s=o?Fr("card",Y(()=>e.size[0]),l,e):void 0;return{rtlEnabled:a,mergedClsPrefix:r,mergedTheme:i,handleCloseClick:t,cssVars:o?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender}},render(){const{segmented:e,bordered:t,hoverable:o,mergedClsPrefix:r,rtlEnabled:n,onRender:i,embedded:a,tag:l,$slots:s}=this;return i==null||i(),y(l,{class:[`${r}-card`,this.themeClass,a&&`${r}-card--embedded`,{[`${r}-card--rtl`]:n,[`${r}-card--content${typeof e!="boolean"&&e.content==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.content,[`${r}-card--footer${typeof e!="boolean"&&e.footer==="soft"?"-soft":""}-segmented`]:e===!0||e!==!1&&e.footer,[`${r}-card--action-segmented`]:e===!0||e!==!1&&e.action,[`${r}-card--bordered`]:t,[`${r}-card--hoverable`]:o}],style:this.cssVars,role:this.role},$t(s.cover,c=>{const d=this.cover?kt([this.cover()]):c;return d&&y("div",{class:`${r}-card-cover`,role:"none"},d)}),$t(s.header,c=>{const{title:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u||this.closable?y("div",{class:[`${r}-card-header`,this.headerClass],style:this.headerStyle,role:"heading"},y("div",{class:`${r}-card-header__main`,role:"heading"},u),$t(s["header-extra"],p=>{const m=this.headerExtra?kt([this.headerExtra()]):p;return m&&y("div",{class:[`${r}-card-header__extra`,this.headerExtraClass],style:this.headerExtraStyle},m)}),this.closable&&y(Iu,{clsPrefix:r,class:`${r}-card-header__close`,onClick:this.handleCloseClick,absolute:!0})):null}),$t(s.default,c=>{const{content:d}=this,u=d?kt(typeof d=="function"?[d()]:[d]):c;return u&&y("div",{class:[`${r}-card__content`,this.contentClass],style:this.contentStyle,role:"none"},u)}),$t(s.footer,c=>{const d=this.footer?kt([this.footer()]):c;return d&&y("div",{class:[`${r}-card__footer`,this.footerClass],style:this.footerStyle,role:"none"},d)}),$t(s.action,c=>{const d=this.action?kt([this.action()]):c;return d&&y("div",{class:`${r}-card__action`,role:"none"},d)}))}});function I1(){return{dotSize:"8px",dotColor:"rgba(255, 255, 255, .3)",dotColorActive:"rgba(255, 255, 255, 1)",dotColorFocus:"rgba(255, 255, 255, .5)",dotLineWidth:"16px",dotLineWidthActive:"24px",arrowColor:"#eee"}}const _1={name:"Carousel",common:W,self:I1},E1={sizeSmall:"14px",sizeMedium:"16px",sizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"};function Yu(e){const{baseColor:t,inputColorDisabled:o,cardColor:r,modalColor:n,popoverColor:i,textColorDisabled:a,borderColor:l,primaryColor:s,textColor2:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadiusSmall:m,lineHeight:f}=e;return Object.assign(Object.assign({},E1),{labelLineHeight:f,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,borderRadius:m,color:t,colorChecked:s,colorDisabled:o,colorDisabledChecked:o,colorTableHeader:r,colorTableHeaderModal:n,colorTableHeaderPopover:i,checkMarkColor:t,checkMarkColorDisabled:a,checkMarkColorDisabledChecked:a,border:`1px solid ${l}`,borderDisabled:`1px solid ${l}`,borderDisabledChecked:`1px solid ${l}`,borderChecked:`1px solid ${s}`,borderFocus:`1px solid ${s}`,boxShadowFocus:`0 0 0 2px ${K(s,{alpha:.3})}`,textColor:c,textColorDisabled:a})}const M1={name:"Checkbox",common:Be,self:Yu},Hr={name:"Checkbox",common:W,self(e){const{cardColor:t}=e,o=Yu(e);return o.color="#0000",o.checkMarkColor=t,o}};function z1(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n,textColor3:i,primaryColor:a,textColorDisabled:l,dividerColor:s,hoverColor:c,fontSizeMedium:d,heightMedium:u}=e;return{menuBorderRadius:t,menuColor:r,menuBoxShadow:o,menuDividerColor:s,menuHeight:"calc(var(--n-option-height) * 6.6)",optionArrowColor:i,optionHeight:u,optionFontSize:d,optionColorHover:c,optionTextColor:n,optionTextColorActive:a,optionTextColorDisabled:l,optionCheckMarkColor:a,loadingColor:a,columnWidth:"180px"}}const H1={name:"Cascader",common:W,peers:{InternalSelectMenu:Fn,InternalSelection:Cl,Scrollbar:St,Checkbox:Hr,Empty:xl},self:z1},Xu={name:"Code",common:W,self(e){const{textColor2:t,fontSize:o,fontWeightStrong:r,textColor3:n}=e;return{textColor:t,fontSize:o,fontWeightStrong:r,"mono-3":"#5c6370","hue-1":"#56b6c2","hue-2":"#61aeee","hue-3":"#c678dd","hue-4":"#98c379","hue-5":"#e06c75","hue-5-2":"#be5046","hue-6":"#d19a66","hue-6-2":"#e6c07b",lineNumberTextColor:n}}};function k1(e){const{fontWeight:t,textColor1:o,textColor2:r,textColorDisabled:n,dividerColor:i,fontSize:a}=e;return{titleFontSize:a,titleFontWeight:t,dividerColor:i,titleTextColor:o,titleTextColorDisabled:n,fontSize:a,textColor:r,arrowColor:r,arrowColorDisabled:n,itemMargin:"16px 0 0 0",titlePadding:"16px 0 0 0"}}const D1={name:"Collapse",common:W,self:k1};function O1(e){const{cubicBezierEaseInOut:t}=e;return{bezier:t}}const B1={name:"CollapseTransition",common:W,self:O1};function L1(e){const{fontSize:t,boxShadow2:o,popoverColor:r,textColor2:n,borderRadius:i,borderColor:a,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}=e;return{panelFontSize:t,boxShadow:o,color:r,textColor:n,borderRadius:i,border:`1px solid ${a}`,heightSmall:l,heightMedium:s,heightLarge:c,fontSizeSmall:d,fontSizeMedium:u,fontSizeLarge:p,dividerColor:m}}const W1={name:"ColorPicker",common:W,peers:{Input:zt,Button:wt},self:L1},j1={abstract:Boolean,bordered:{type:Boolean,default:void 0},clsPrefix:String,locale:Object,dateLocale:Object,namespace:String,rtl:Array,tag:{type:String,default:"div"},hljs:Object,katex:Object,theme:Object,themeOverrides:Object,componentOptions:Object,icons:Object,breakpoints:Object,preflightStyleDisabled:Boolean,styleMountTarget:Object,inlineThemeDisabled:{type:Boolean,default:void 0},as:{type:String,validator:()=>(Aa("config-provider","`as` is deprecated, please use `tag` instead."),!0),default:void 0}},wP=He({name:"ConfigProvider",alias:["App"],props:j1,setup(e){const t=Le(Qt,null),o=Y(()=>{const{theme:g}=e;if(g===null)return;const S=t==null?void 0:t.mergedThemeRef.value;return g===void 0?S:S===void 0?g:Object.assign({},S,g)}),r=Y(()=>{const{themeOverrides:g}=e;if(g!==null){if(g===void 0)return t==null?void 0:t.mergedThemeOverridesRef.value;{const S=t==null?void 0:t.mergedThemeOverridesRef.value;return S===void 0?g:Vr({},S,g)}}}),n=hn(()=>{const{namespace:g}=e;return g===void 0?t==null?void 0:t.mergedNamespaceRef.value:g}),i=hn(()=>{const{bordered:g}=e;return g===void 0?t==null?void 0:t.mergedBorderedRef.value:g}),a=Y(()=>{const{icons:g}=e;return g===void 0?t==null?void 0:t.mergedIconsRef.value:g}),l=Y(()=>{const{componentOptions:g}=e;return g!==void 0?g:t==null?void 0:t.mergedComponentPropsRef.value}),s=Y(()=>{const{clsPrefix:g}=e;return g!==void 0?g:t?t.mergedClsPrefixRef.value:pi}),c=Y(()=>{var g;const{rtl:S}=e;if(S===void 0)return t==null?void 0:t.mergedRtlRef.value;const v={};for(const $ of S)v[$.name]=da($),(g=$.peers)===null||g===void 0||g.forEach(T=>{T.name in v||(v[T.name]=da(T))});return v}),d=Y(()=>e.breakpoints||(t==null?void 0:t.mergedBreakpointsRef.value)),u=e.inlineThemeDisabled||(t==null?void 0:t.inlineThemeDisabled),p=e.preflightStyleDisabled||(t==null?void 0:t.preflightStyleDisabled),m=e.styleMountTarget||(t==null?void 0:t.styleMountTarget),f=Y(()=>{const{value:g}=o,{value:S}=r,v=S&&Object.keys(S).length!==0,$=g==null?void 0:g.name;return $?v?`${$}-${fn(JSON.stringify(r.value))}`:$:v?fn(JSON.stringify(r.value)):""});return po(Qt,{mergedThemeHashRef:f,mergedBreakpointsRef:d,mergedRtlRef:c,mergedIconsRef:a,mergedComponentPropsRef:l,mergedBorderedRef:i,mergedNamespaceRef:n,mergedClsPrefixRef:s,mergedLocaleRef:Y(()=>{const{locale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedLocaleRef.value:g}),mergedDateLocaleRef:Y(()=>{const{dateLocale:g}=e;if(g!==null)return g===void 0?t==null?void 0:t.mergedDateLocaleRef.value:g}),mergedHljsRef:Y(()=>{const{hljs:g}=e;return g===void 0?t==null?void 0:t.mergedHljsRef.value:g}),mergedKatexRef:Y(()=>{const{katex:g}=e;return g===void 0?t==null?void 0:t.mergedKatexRef.value:g}),mergedThemeRef:o,mergedThemeOverridesRef:r,inlineThemeDisabled:u||!1,preflightStyleDisabled:p||!1,styleMountTarget:m}),{mergedClsPrefix:s,mergedBordered:i,mergedNamespace:n,mergedTheme:o,mergedThemeOverrides:r}},render(){var e,t,o,r;return this.abstract?(r=(o=this.$slots).default)===null||r===void 0?void 0:r.call(o):y(this.as||this.tag,{class:`${this.mergedClsPrefix||pi}-config-provider`},(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e))}}),Ju={name:"Popselect",common:W,peers:{Popover:lr,InternalSelectMenu:Fn}};function N1(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const V1={name:"Popselect",common:Be,peers:{Popover:zr,InternalSelectMenu:Ou},self:N1};function Zu(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}const U1={name:"Select",common:Be,peers:{InternalSelection:Wy,InternalSelectMenu:Ou},self:Zu},Qu={name:"Select",common:W,peers:{InternalSelection:Cl,InternalSelectMenu:Fn},self:Zu},q1={itemPaddingSmall:"0 4px",itemMarginSmall:"0 0 0 8px",itemMarginSmallRtl:"0 8px 0 0",itemPaddingMedium:"0 4px",itemMarginMedium:"0 0 0 8px",itemMarginMediumRtl:"0 8px 0 0",itemPaddingLarge:"0 4px",itemMarginLarge:"0 0 0 8px",itemMarginLargeRtl:"0 8px 0 0",buttonIconSizeSmall:"14px",buttonIconSizeMedium:"16px",buttonIconSizeLarge:"18px",inputWidthSmall:"60px",selectWidthSmall:"unset",inputMarginSmall:"0 0 0 8px",inputMarginSmallRtl:"0 8px 0 0",selectMarginSmall:"0 0 0 8px",prefixMarginSmall:"0 8px 0 0",suffixMarginSmall:"0 0 0 8px",inputWidthMedium:"60px",selectWidthMedium:"unset",inputMarginMedium:"0 0 0 8px",inputMarginMediumRtl:"0 8px 0 0",selectMarginMedium:"0 0 0 8px",prefixMarginMedium:"0 8px 0 0",suffixMarginMedium:"0 0 0 8px",inputWidthLarge:"60px",selectWidthLarge:"unset",inputMarginLarge:"0 0 0 8px",inputMarginLargeRtl:"0 8px 0 0",selectMarginLarge:"0 0 0 8px",prefixMarginLarge:"0 8px 0 0",suffixMarginLarge:"0 0 0 8px"};function ef(e){const{textColor2:t,primaryColor:o,primaryColorHover:r,primaryColorPressed:n,inputColorDisabled:i,textColorDisabled:a,borderColor:l,borderRadius:s,fontSizeTiny:c,fontSizeSmall:d,fontSizeMedium:u,heightTiny:p,heightSmall:m,heightMedium:f}=e;return Object.assign(Object.assign({},q1),{buttonColor:"#0000",buttonColorHover:"#0000",buttonColorPressed:"#0000",buttonBorder:`1px solid ${l}`,buttonBorderHover:`1px solid ${l}`,buttonBorderPressed:`1px solid ${l}`,buttonIconColor:t,buttonIconColorHover:t,buttonIconColorPressed:t,itemTextColor:t,itemTextColorHover:r,itemTextColorPressed:n,itemTextColorActive:o,itemTextColorDisabled:a,itemColor:"#0000",itemColorHover:"#0000",itemColorPressed:"#0000",itemColorActive:"#0000",itemColorActiveHover:"#0000",itemColorDisabled:i,itemBorder:"1px solid #0000",itemBorderHover:"1px solid #0000",itemBorderPressed:"1px solid #0000",itemBorderActive:`1px solid ${o}`,itemBorderDisabled:`1px solid ${l}`,itemBorderRadius:s,itemSizeSmall:p,itemSizeMedium:m,itemSizeLarge:f,itemFontSizeSmall:c,itemFontSizeMedium:d,itemFontSizeLarge:u,jumperFontSizeSmall:c,jumperFontSizeMedium:d,jumperFontSizeLarge:u,jumperTextColor:t,jumperTextColorDisabled:a})}const G1={name:"Pagination",common:Be,peers:{Select:U1,Input:ki,Popselect:V1},self:ef},tf={name:"Pagination",common:W,peers:{Select:Qu,Input:zt,Popselect:Ju},self(e){const{primaryColor:t,opacity3:o}=e,r=K(t,{alpha:Number(o)}),n=ef(e);return n.itemBorderActive=`1px solid ${r}`,n.itemBorderDisabled="1px solid #0000",n}},K1={padding:"4px 0",optionIconSizeSmall:"14px",optionIconSizeMedium:"16px",optionIconSizeLarge:"16px",optionIconSizeHuge:"18px",optionSuffixWidthSmall:"14px",optionSuffixWidthMedium:"14px",optionSuffixWidthLarge:"16px",optionSuffixWidthHuge:"16px",optionIconSuffixWidthSmall:"32px",optionIconSuffixWidthMedium:"32px",optionIconSuffixWidthLarge:"36px",optionIconSuffixWidthHuge:"36px",optionPrefixWidthSmall:"14px",optionPrefixWidthMedium:"14px",optionPrefixWidthLarge:"16px",optionPrefixWidthHuge:"16px",optionIconPrefixWidthSmall:"36px",optionIconPrefixWidthMedium:"36px",optionIconPrefixWidthLarge:"40px",optionIconPrefixWidthHuge:"40px"};function of(e){const{primaryColor:t,textColor2:o,dividerColor:r,hoverColor:n,popoverColor:i,invertedColor:a,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,heightSmall:p,heightMedium:m,heightLarge:f,heightHuge:g,textColor3:S,opacityDisabled:v}=e;return Object.assign(Object.assign({},K1),{optionHeightSmall:p,optionHeightMedium:m,optionHeightLarge:f,optionHeightHuge:g,borderRadius:l,fontSizeSmall:s,fontSizeMedium:c,fontSizeLarge:d,fontSizeHuge:u,optionTextColor:o,optionTextColorHover:o,optionTextColorActive:t,optionTextColorChildActive:t,color:i,dividerColor:r,suffixColor:o,prefixColor:o,optionColorHover:n,optionColorActive:K(t,{alpha:.1}),groupHeaderTextColor:S,optionTextColorInverted:"#BBB",optionTextColorHoverInverted:"#FFF",optionTextColorActiveInverted:"#FFF",optionTextColorChildActiveInverted:"#FFF",colorInverted:a,dividerColorInverted:"#BBB",suffixColorInverted:"#BBB",prefixColorInverted:"#BBB",optionColorHoverInverted:t,optionColorActiveInverted:t,groupHeaderTextColorInverted:"#AAA",optionOpacityDisabled:v})}const Y1={name:"Dropdown",common:Be,peers:{Popover:zr},self:of},yl={name:"Dropdown",common:W,peers:{Popover:lr},self(e){const{primaryColorSuppl:t,primaryColor:o,popoverColor:r}=e,n=of(e);return n.colorInverted=r,n.optionColorActive=K(o,{alpha:.15}),n.optionColorActiveInverted=t,n.optionColorHoverInverted=t,n}},rf={padding:"8px 14px"},Di={name:"Tooltip",common:W,peers:{Popover:lr},self(e){const{borderRadius:t,boxShadow2:o,popoverColor:r,textColor2:n}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:r,textColor:n})}};function X1(e){const{borderRadius:t,boxShadow2:o,baseColor:r}=e;return Object.assign(Object.assign({},rf),{borderRadius:t,boxShadow:o,color:ee(r,"rgba(0, 0, 0, .85)"),textColor:r})}const J1={name:"Tooltip",common:Be,peers:{Popover:zr},self:X1},nf={name:"Ellipsis",common:W,peers:{Tooltip:Di}},Z1={name:"Ellipsis",common:Be,peers:{Tooltip:J1}},af={radioSizeSmall:"14px",radioSizeMedium:"16px",radioSizeLarge:"18px",labelPadding:"0 8px",labelFontWeight:"400"},lf={name:"Radio",common:W,self(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:"#0000",colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:o,buttonColor:"#0000",buttonColorActive:o,buttonTextColor:a,buttonTextColorActive:r,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:`inset 0 0 0 1px ${o}`,buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}};function Q1(e){const{borderColor:t,primaryColor:o,baseColor:r,textColorDisabled:n,inputColorDisabled:i,textColor2:a,opacityDisabled:l,borderRadius:s,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,heightSmall:p,heightMedium:m,heightLarge:f,lineHeight:g}=e;return Object.assign(Object.assign({},af),{labelLineHeight:g,buttonHeightSmall:p,buttonHeightMedium:m,buttonHeightLarge:f,fontSizeSmall:c,fontSizeMedium:d,fontSizeLarge:u,boxShadow:`inset 0 0 0 1px ${t}`,boxShadowActive:`inset 0 0 0 1px ${o}`,boxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.2})}`,boxShadowHover:`inset 0 0 0 1px ${o}`,boxShadowDisabled:`inset 0 0 0 1px ${t}`,color:r,colorDisabled:i,colorActive:"#0000",textColor:a,textColorDisabled:n,dotColorActive:o,dotColorDisabled:t,buttonBorderColor:t,buttonBorderColorActive:o,buttonBorderColorHover:t,buttonColor:r,buttonColorActive:r,buttonTextColor:a,buttonTextColorActive:o,buttonTextColorHover:o,opacityDisabled:l,buttonBoxShadowFocus:`inset 0 0 0 1px ${o}, 0 0 0 2px ${K(o,{alpha:.3})}`,buttonBoxShadowHover:"inset 0 0 0 1px #0000",buttonBoxShadow:"inset 0 0 0 1px #0000",buttonBorderRadius:s})}const eS={name:"Radio",common:Be,self:Q1},tS={thPaddingSmall:"8px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"8px",tdPaddingMedium:"12px",tdPaddingLarge:"12px",sorterSize:"15px",resizableContainerSize:"8px",resizableSize:"2px",filterSize:"15px",paginationMargin:"12px 0 0 0",emptyPadding:"48px 0",actionPadding:"8px 12px",actionButtonMargin:"0 8px 0 0"};function sf(e){const{cardColor:t,modalColor:o,popoverColor:r,textColor2:n,textColor1:i,tableHeaderColor:a,tableColorHover:l,iconColor:s,primaryColor:c,fontWeightStrong:d,borderRadius:u,lineHeight:p,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,dividerColor:S,heightSmall:v,opacityDisabled:$,tableColorStriped:T}=e;return Object.assign(Object.assign({},tS),{actionDividerColor:S,lineHeight:p,borderRadius:u,fontSizeSmall:m,fontSizeMedium:f,fontSizeLarge:g,borderColor:ee(t,S),tdColorHover:ee(t,l),tdColorSorting:ee(t,l),tdColorStriped:ee(t,T),thColor:ee(t,a),thColorHover:ee(ee(t,a),l),thColorSorting:ee(ee(t,a),l),tdColor:t,tdTextColor:n,thTextColor:i,thFontWeight:d,thButtonColorHover:l,thIconColor:s,thIconColorActive:c,borderColorModal:ee(o,S),tdColorHoverModal:ee(o,l),tdColorSortingModal:ee(o,l),tdColorStripedModal:ee(o,T),thColorModal:ee(o,a),thColorHoverModal:ee(ee(o,a),l),thColorSortingModal:ee(ee(o,a),l),tdColorModal:o,borderColorPopover:ee(r,S),tdColorHoverPopover:ee(r,l),tdColorSortingPopover:ee(r,l),tdColorStripedPopover:ee(r,T),thColorPopover:ee(r,a),thColorHoverPopover:ee(ee(r,a),l),thColorSortingPopover:ee(ee(r,a),l),tdColorPopover:r,boxShadowBefore:"inset -12px 0 8px -12px rgba(0, 0, 0, .18)",boxShadowAfter:"inset 12px 0 8px -12px rgba(0, 0, 0, .18)",loadingColor:c,loadingSize:v,opacityLoading:$})}const PP={name:"DataTable",common:Be,peers:{Button:An,Checkbox:M1,Radio:eS,Pagination:G1,Scrollbar:Rn,Empty:xl,Popover:zr,Ellipsis:Z1,Dropdown:Y1},self:sf},oS={name:"DataTable",common:W,peers:{Button:wt,Checkbox:Hr,Radio:lf,Pagination:tf,Scrollbar:St,Empty:ar,Popover:lr,Ellipsis:nf,Dropdown:yl},self(e){const t=sf(e);return t.boxShadowAfter="inset 12px 0 8px -12px rgba(0, 0, 0, .36)",t.boxShadowBefore="inset -12px 0 8px -12px rgba(0, 0, 0, .36)",t}};function cf(e){const{textColorBase:t,opacity1:o,opacity2:r,opacity3:n,opacity4:i,opacity5:a}=e;return{color:t,opacity1Depth:o,opacity2Depth:r,opacity3Depth:n,opacity4Depth:i,opacity5Depth:a}}const TP={common:Be,self:cf},rS={name:"Icon",common:W,self:cf},nS={itemFontSize:"12px",itemHeight:"36px",itemWidth:"52px",panelActionPadding:"8px 0"};function df(e){const{popoverColor:t,textColor2:o,primaryColor:r,hoverColor:n,dividerColor:i,opacityDisabled:a,boxShadow2:l,borderRadius:s,iconColor:c,iconColorDisabled:d}=e;return Object.assign(Object.assign({},nS),{panelColor:t,panelBoxShadow:l,panelDividerColor:i,itemTextColor:o,itemTextColorActive:r,itemColorHover:n,itemOpacityDisabled:a,itemBorderRadius:s,borderRadius:s,iconColor:c,iconColorDisabled:d})}const iS={name:"TimePicker",common:Be,peers:{Scrollbar:Rn,Button:An,Input:ki},self:df},uf={name:"TimePicker",common:W,peers:{Scrollbar:St,Button:wt,Input:zt},self:df},aS={itemSize:"24px",itemCellWidth:"38px",itemCellHeight:"32px",scrollItemWidth:"80px",scrollItemHeight:"40px",panelExtraFooterPadding:"8px 12px",panelActionPadding:"8px 12px",calendarTitlePadding:"0",calendarTitleHeight:"28px",arrowSize:"14px",panelHeaderPadding:"8px 12px",calendarDaysHeight:"32px",calendarTitleGridTempateColumns:"28px 28px 1fr 28px 28px",calendarLeftPaddingDate:"6px 12px 4px 12px",calendarLeftPaddingDatetime:"4px 12px",calendarLeftPaddingDaterange:"6px 12px 4px 12px",calendarLeftPaddingDatetimerange:"4px 12px",calendarLeftPaddingMonth:"0",calendarLeftPaddingYear:"0",calendarLeftPaddingQuarter:"0",calendarLeftPaddingMonthrange:"0",calendarLeftPaddingQuarterrange:"0",calendarLeftPaddingYearrange:"0",calendarLeftPaddingWeek:"6px 12px 4px 12px",calendarRightPaddingDate:"6px 12px 4px 12px",calendarRightPaddingDatetime:"4px 12px",calendarRightPaddingDaterange:"6px 12px 4px 12px",calendarRightPaddingDatetimerange:"4px 12px",calendarRightPaddingMonth:"0",calendarRightPaddingYear:"0",calendarRightPaddingQuarter:"0",calendarRightPaddingMonthrange:"0",calendarRightPaddingQuarterrange:"0",calendarRightPaddingYearrange:"0",calendarRightPaddingWeek:"0"};function ff(e){const{hoverColor:t,fontSize:o,textColor2:r,textColorDisabled:n,popoverColor:i,primaryColor:a,borderRadiusSmall:l,iconColor:s,iconColorDisabled:c,textColor1:d,dividerColor:u,boxShadow2:p,borderRadius:m,fontWeightStrong:f}=e;return Object.assign(Object.assign({},aS),{itemFontSize:o,calendarDaysFontSize:o,calendarTitleFontSize:o,itemTextColor:r,itemTextColorDisabled:n,itemTextColorActive:i,itemTextColorCurrent:a,itemColorIncluded:K(a,{alpha:.1}),itemColorHover:t,itemColorDisabled:t,itemColorActive:a,itemBorderRadius:l,panelColor:i,panelTextColor:r,arrowColor:s,calendarTitleTextColor:d,calendarTitleColorHover:t,calendarDaysTextColor:r,panelHeaderDividerColor:u,calendarDaysDividerColor:u,calendarDividerColor:u,panelActionDividerColor:u,panelBoxShadow:p,panelBorderRadius:m,calendarTitleFontWeight:f,scrollItemBorderRadius:m,iconColor:s,iconColorDisabled:c})}const $P={name:"DatePicker",common:Be,peers:{Input:ki,Button:An,TimePicker:iS,Scrollbar:Rn},self:ff},lS={name:"DatePicker",common:W,peers:{Input:zt,Button:wt,TimePicker:uf,Scrollbar:St},self(e){const{popoverColor:t,hoverColor:o,primaryColor:r}=e,n=ff(e);return n.itemColorDisabled=ee(t,o),n.itemColorIncluded=K(r,{alpha:.15}),n.itemColorHover=ee(t,o),n}},sS={thPaddingBorderedSmall:"8px 12px",thPaddingBorderedMedium:"12px 16px",thPaddingBorderedLarge:"16px 24px",thPaddingSmall:"0",thPaddingMedium:"0",thPaddingLarge:"0",tdPaddingBorderedSmall:"8px 12px",tdPaddingBorderedMedium:"12px 16px",tdPaddingBorderedLarge:"16px 24px",tdPaddingSmall:"0 0 8px 0",tdPaddingMedium:"0 0 12px 0",tdPaddingLarge:"0 0 16px 0"};function cS(e){const{tableHeaderColor:t,textColor2:o,textColor1:r,cardColor:n,modalColor:i,popoverColor:a,dividerColor:l,borderRadius:s,fontWeightStrong:c,lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m}=e;return Object.assign(Object.assign({},sS),{lineHeight:d,fontSizeSmall:u,fontSizeMedium:p,fontSizeLarge:m,titleTextColor:r,thColor:ee(n,t),thColorModal:ee(i,t),thColorPopover:ee(a,t),thTextColor:r,thFontWeight:c,tdTextColor:o,tdColor:n,tdColorModal:i,tdColorPopover:a,borderColor:ee(n,l),borderColorModal:ee(i,l),borderColorPopover:ee(a,l),borderRadius:s})}const dS={name:"Descriptions",common:W,self:cS},uS={titleFontSize:"18px",padding:"16px 28px 20px 28px",iconSize:"28px",actionSpace:"12px",contentMargin:"8px 0 16px 0",iconMargin:"0 4px 0 0",iconMarginIconTop:"4px 0 8px 0",closeSize:"22px",closeIconSize:"18px",closeMargin:"20px 26px 0 0",closeMarginIconTop:"10px 16px 0 0"};function fS(e){const{textColor1:t,textColor2:o,modalColor:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,infoColor:c,successColor:d,warningColor:u,errorColor:p,primaryColor:m,dividerColor:f,borderRadius:g,fontWeightStrong:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},uS),{fontSize:$,lineHeight:v,border:`1px solid ${f}`,titleTextColor:t,textColor:o,color:r,closeColorHover:l,closeColorPressed:s,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeBorderRadius:g,iconColor:m,iconColorInfo:c,iconColorSuccess:d,iconColorWarning:u,iconColorError:p,borderRadius:g,titleFontWeight:S})}const pf={name:"Dialog",common:W,peers:{Button:wt},self:fS};function pS(e){const{modalColor:t,textColor2:o,boxShadow3:r}=e;return{color:t,textColor:o,boxShadow:r}}const hS={name:"Modal",common:W,peers:{Scrollbar:St,Dialog:pf,Card:Ku},self:pS},gS={name:"LoadingBar",common:W,self(e){const{primaryColor:t}=e;return{colorError:"red",colorLoading:t,height:"2px"}}},mS="n-message-api",hf="n-message-provider",bS={margin:"0 0 8px 0",padding:"10px 20px",maxWidth:"720px",minWidth:"420px",iconMargin:"0 10px 0 0",closeMargin:"0 0 0 10px",closeSize:"20px",closeIconSize:"16px",iconSize:"20px",fontSize:"14px"};function gf(e){const{textColor2:t,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,infoColor:i,successColor:a,errorColor:l,warningColor:s,popoverColor:c,boxShadow2:d,primaryColor:u,lineHeight:p,borderRadius:m,closeColorHover:f,closeColorPressed:g}=e;return Object.assign(Object.assign({},bS),{closeBorderRadius:m,textColor:t,textColorInfo:t,textColorSuccess:t,textColorError:t,textColorWarning:t,textColorLoading:t,color:c,colorInfo:c,colorSuccess:c,colorError:c,colorWarning:c,colorLoading:c,boxShadow:d,boxShadowInfo:d,boxShadowSuccess:d,boxShadowError:d,boxShadowWarning:d,boxShadowLoading:d,iconColor:t,iconColorInfo:i,iconColorSuccess:a,iconColorWarning:s,iconColorError:l,iconColorLoading:u,closeColorHover:f,closeColorPressed:g,closeIconColor:o,closeIconColorHover:r,closeIconColorPressed:n,closeColorHoverInfo:f,closeColorPressedInfo:g,closeIconColorInfo:o,closeIconColorHoverInfo:r,closeIconColorPressedInfo:n,closeColorHoverSuccess:f,closeColorPressedSuccess:g,closeIconColorSuccess:o,closeIconColorHoverSuccess:r,closeIconColorPressedSuccess:n,closeColorHoverError:f,closeColorPressedError:g,closeIconColorError:o,closeIconColorHoverError:r,closeIconColorPressedError:n,closeColorHoverWarning:f,closeColorPressedWarning:g,closeIconColorWarning:o,closeIconColorHoverWarning:r,closeIconColorPressedWarning:n,closeColorHoverLoading:f,closeColorPressedLoading:g,closeIconColorLoading:o,closeIconColorHoverLoading:r,closeIconColorPressedLoading:n,loadingColor:u,lineHeight:p,borderRadius:m})}const vS={common:Be,self:gf},xS={name:"Message",common:W,self:gf},mf={icon:Function,type:{type:String,default:"info"},content:[String,Number,Function],showIcon:{type:Boolean,default:!0},closable:Boolean,keepAliveOnHover:Boolean,onClose:Function,onMouseenter:Function,onMouseleave:Function},CS=L([pe("message-wrapper",` margin: var(--n-margin); z-index: 0; transform-origin: top center; @@ -749,12 +749,12 @@ ${t} right: 12px; justify-content: flex-end; align-items: flex-end; - `)])]),yS={info:()=>y(vy,null),success:()=>y(xy,null),warning:()=>y(Cy,null),error:()=>y(gy,null),default:()=>null},SS=He({name:"Message",props:Object.assign(Object.assign({},mf),{render:Function}),setup(e){const{inlineThemeDisabled:t,mergedRtlRef:o}=Ao(e),{props:r,mergedClsPrefixRef:n}=Le(hf),i=$n("Message",o,n),a=Ct("Message","-message",CS,vS,r,n),l=Y(()=>{const{type:c}=e,{common:{cubicBezierEaseInOut:d},self:{padding:u,margin:p,maxWidth:m,iconMargin:f,closeMargin:g,closeSize:S,iconSize:v,fontSize:$,lineHeight:T,borderRadius:w,iconColorInfo:z,iconColorSuccess:B,iconColorWarning:x,iconColorError:F,iconColorLoading:R,closeIconSize:O,closeBorderRadius:j,[ae("textColor",c)]:_,[ae("boxShadow",c)]:J,[ae("color",c)]:G,[ae("closeColorHover",c)]:le,[ae("closeColorPressed",c)]:te,[ae("closeIconColor",c)]:N,[ae("closeIconColorPressed",c)]:oe,[ae("closeIconColorHover",c)]:ye}}=a.value;return{"--n-bezier":d,"--n-margin":p,"--n-padding":u,"--n-max-width":m,"--n-font-size":$,"--n-icon-margin":f,"--n-icon-size":v,"--n-close-icon-size":O,"--n-close-border-radius":j,"--n-close-size":S,"--n-close-margin":g,"--n-text-color":_,"--n-color":G,"--n-box-shadow":J,"--n-icon-color-info":z,"--n-icon-color-success":B,"--n-icon-color-warning":x,"--n-icon-color-error":F,"--n-icon-color-loading":R,"--n-close-color-hover":le,"--n-close-color-pressed":te,"--n-close-icon-color":N,"--n-close-icon-color-pressed":oe,"--n-close-icon-color-hover":ye,"--n-line-height":T,"--n-border-radius":w}}),s=t?Fr("message",Y(()=>e.type[0]),l,{}):void 0;return{mergedClsPrefix:n,rtlEnabled:i,messageProviderProps:r,handleClose(){var c;(c=e.onClose)===null||c===void 0||c.call(e)},cssVars:t?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender,placement:r.placement}},render(){const{render:e,type:t,closable:o,content:r,mergedClsPrefix:n,cssVars:i,themeClass:a,onRender:l,icon:s,handleClose:c,showIcon:d}=this;l==null||l();let u;return y("div",{class:[`${n}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):y("div",{class:[`${n}-message ${n}-message--${t}-type`,this.rtlEnabled&&`${n}-message--rtl`]},(u=wS(s,t,n))&&d?y("div",{class:`${n}-message__icon ${n}-message__icon--${t}-type`},y(Hi,null,{default:()=>u})):null,y("div",{class:`${n}-message__content`},_b(r)),o?y(Eu,{clsPrefix:n,class:`${n}-message__close`,onClick:c,absolute:!0}):null))}});function wS(e,t,o){if(typeof e=="function")return e();{const r=t==="loading"?y(vl,{clsPrefix:o,strokeWidth:24,scale:.85}):yS[t]();return r?y(Tr,{clsPrefix:o,key:t},{default:()=>r}):null}}const PS=He({name:"MessageEnvironment",props:Object.assign(Object.assign({},mf),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let t=null;const o=fe(!0);Io(()=>{r()});function r(){const{duration:d}=e;d&&(t=window.setTimeout(a,d))}function n(d){d.currentTarget===d.target&&t!==null&&(window.clearTimeout(t),t=null)}function i(d){d.currentTarget===d.target&&r()}function a(){const{onHide:d}=e;o.value=!1,t&&(window.clearTimeout(t),t=null),d&&d()}function l(){const{onClose:d}=e;d&&d(),a()}function s(){const{onAfterLeave:d,onInternalAfterLeave:u,onAfterHide:p,internalKey:m}=e;d&&d(),u&&u(m),p&&p()}function c(){a()}return{show:o,hide:a,handleClose:l,handleAfterLeave:s,handleMouseleave:i,handleMouseenter:n,deactivate:c}},render(){return y(zu,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?y(SS,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),TS=Object.assign(Object.assign({},Ct.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),RP=He({name:"MessageProvider",props:TS,setup(e){const{mergedClsPrefixRef:t}=Ao(e),o=fe([]),r=fe({}),n={create(s,c){return i(s,Object.assign({type:"default"},c))},info(s,c){return i(s,Object.assign(Object.assign({},c),{type:"info"}))},success(s,c){return i(s,Object.assign(Object.assign({},c),{type:"success"}))},warning(s,c){return i(s,Object.assign(Object.assign({},c),{type:"warning"}))},error(s,c){return i(s,Object.assign(Object.assign({},c),{type:"error"}))},loading(s,c){return i(s,Object.assign(Object.assign({},c),{type:"loading"}))},destroyAll:l};po(hf,{props:e,mergedClsPrefixRef:t}),po(mS,n);function i(s,c){const d=$a(),u=Ci(Object.assign(Object.assign({},c),{content:s,key:d,destroy:()=>{var m;(m=r.value[d])===null||m===void 0||m.hide()}})),{max:p}=e;return p&&o.value.length>=p&&o.value.shift(),o.value.push(u),u}function a(s){o.value.splice(o.value.findIndex(c=>c.key===s),1),delete r.value[s]}function l(){Object.values(r.value).forEach(s=>{s.hide()})}return Object.assign({mergedClsPrefix:t,messageRefs:r,messageList:o,handleAfterLeave:a},n)},render(){var e,t,o;return y(et,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),this.messageList.length?y(ch,{to:(o=this.to)!==null&&o!==void 0?o:"body"},y("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(r=>y(PS,Object.assign({ref:n=>{n&&(this.messageRefs[r.key]=n)},internalKey:r.key,onInternalAfterLeave:this.handleAfterLeave},Fb(r,["destroy"],void 0),{duration:r.duration===void 0?this.duration:r.duration,keepAliveOnHover:r.keepAliveOnHover===void 0?this.keepAliveOnHover:r.keepAliveOnHover,closable:r.closable===void 0?this.closable:r.closable}))))):null)}}),$S={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};function RS(e){const{textColor2:t,successColor:o,infoColor:r,warningColor:n,errorColor:i,popoverColor:a,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeColorHover:d,closeColorPressed:u,textColor1:p,textColor3:m,borderRadius:f,fontWeightStrong:g,boxShadow2:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},$S),{borderRadius:f,lineHeight:v,fontSize:$,headerFontWeight:g,iconColor:t,iconColorSuccess:o,iconColorInfo:r,iconColorWarning:n,iconColorError:i,color:a,textColor:t,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeBorderRadius:f,closeColorHover:d,closeColorPressed:u,headerTextColor:p,descriptionTextColor:m,actionTextColor:t,boxShadow:S})}const FS={name:"Notification",common:W,peers:{Scrollbar:St},self:RS};function _S(e){const{textColor1:t,dividerColor:o,fontWeightStrong:r}=e;return{textColor:t,color:o,fontWeight:r}}const ES={name:"Divider",common:W,self:_S};function zS(e){const{modalColor:t,textColor1:o,textColor2:r,boxShadow3:n,lineHeight:i,fontWeightStrong:a,dividerColor:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderRadius:m,primaryColorHover:f}=e;return{bodyPadding:"16px 24px",borderRadius:m,headerPadding:"16px 24px",footerPadding:"16px 24px",color:t,textColor:r,titleTextColor:o,titleFontSize:"18px",titleFontWeight:a,boxShadow:n,lineHeight:i,headerBorderBottom:`1px solid ${l}`,footerBorderTop:`1px solid ${l}`,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:c,closeBorderRadius:m,resizableTriggerColorHover:f}}const MS={name:"Drawer",common:W,peers:{Scrollbar:St},self:zS},IS={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},AS={name:"DynamicInput",common:W,peers:{Input:At,Button:wt},self(){return IS}},HS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},bf={name:"Space",self(){return HS}},kS={name:"DynamicTags",common:W,peers:{Input:At,Button:wt,Tag:Lu,Space:bf},self(){return{inputWidth:"64px"}}},DS={name:"Element",common:W},BS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},OS={name:"Flex",self(){return BS}},LS={name:"ButtonGroup",common:W},WS={feedbackPadding:"4px 0 0 2px",feedbackHeightSmall:"24px",feedbackHeightMedium:"24px",feedbackHeightLarge:"26px",feedbackFontSizeSmall:"13px",feedbackFontSizeMedium:"14px",feedbackFontSizeLarge:"14px",labelFontSizeLeftSmall:"14px",labelFontSizeLeftMedium:"14px",labelFontSizeLeftLarge:"15px",labelFontSizeTopSmall:"13px",labelFontSizeTopMedium:"14px",labelFontSizeTopLarge:"14px",labelHeightSmall:"24px",labelHeightMedium:"26px",labelHeightLarge:"28px",labelPaddingVertical:"0 0 6px 2px",labelPaddingHorizontal:"0 12px 0 0",labelTextAlignVertical:"left",labelTextAlignHorizontal:"right",labelFontWeight:"400"};function vf(e){const{heightSmall:t,heightMedium:o,heightLarge:r,textColor1:n,errorColor:i,warningColor:a,lineHeight:l,textColor3:s}=e;return Object.assign(Object.assign({},WS),{blankHeightSmall:t,blankHeightMedium:o,blankHeightLarge:r,lineHeight:l,labelTextColor:n,asteriskColor:i,feedbackTextColorError:i,feedbackTextColorWarning:a,feedbackTextColor:s})}const xf={common:Oe,self:vf},jS={name:"Form",common:W,self:vf},NS={name:"GradientText",common:W,self(e){const{primaryColor:t,successColor:o,warningColor:r,errorColor:n,infoColor:i,primaryColorSuppl:a,successColorSuppl:l,warningColorSuppl:s,errorColorSuppl:c,infoColorSuppl:d,fontWeightStrong:u}=e;return{fontWeight:u,rotate:"252deg",colorStartPrimary:t,colorEndPrimary:a,colorStartInfo:i,colorEndInfo:d,colorStartWarning:r,colorEndWarning:s,colorStartError:n,colorEndError:c,colorStartSuccess:o,colorEndSuccess:l}}},VS={name:"InputNumber",common:W,peers:{Button:wt,Input:At},self(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}},qS={name:"Layout",common:W,peers:{Scrollbar:St},self(e){const{textColor2:t,bodyColor:o,popoverColor:r,cardColor:n,dividerColor:i,scrollbarColor:a,scrollbarColorHover:l}=e;return{textColor:t,textColorInverted:t,color:o,colorEmbedded:o,headerColor:n,headerColorInverted:n,footerColor:n,footerColorInverted:n,headerBorderColor:i,headerBorderColorInverted:i,footerBorderColor:i,footerBorderColorInverted:i,siderBorderColor:i,siderBorderColorInverted:i,siderColor:n,siderColorInverted:n,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:r,siderToggleButtonIconColor:t,siderToggleButtonIconColorInverted:t,siderToggleBarColor:ee(o,a),siderToggleBarColorHover:ee(o,l),__invertScrollbar:"false"}}},US={name:"Row",common:W};function GS(e){const{textColor2:t,cardColor:o,modalColor:r,popoverColor:n,dividerColor:i,borderRadius:a,fontSize:l,hoverColor:s}=e;return{textColor:t,color:o,colorHover:s,colorModal:r,colorHoverModal:ee(r,s),colorPopover:n,colorHoverPopover:ee(n,s),borderColor:i,borderColorModal:ee(r,i),borderColorPopover:ee(n,i),borderRadius:a,fontSize:l}}const KS={name:"List",common:W,self:GS},YS={name:"Log",common:W,peers:{Scrollbar:St,Code:Xu},self(e){const{textColor2:t,inputColor:o,fontSize:r,primaryColor:n}=e;return{loaderFontSize:r,loaderTextColor:t,loaderColor:o,loaderBorder:"1px solid #0000",loadingColor:n}}},XS={name:"Mention",common:W,peers:{InternalSelectMenu:Fn,Input:At},self(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}};function JS(e,t,o,r){return{itemColorHoverInverted:"#0000",itemColorActiveInverted:t,itemColorActiveHoverInverted:t,itemColorActiveCollapsedInverted:t,itemTextColorInverted:e,itemTextColorHoverInverted:o,itemTextColorChildActiveInverted:o,itemTextColorChildActiveHoverInverted:o,itemTextColorActiveInverted:o,itemTextColorActiveHoverInverted:o,itemTextColorHorizontalInverted:e,itemTextColorHoverHorizontalInverted:o,itemTextColorChildActiveHorizontalInverted:o,itemTextColorChildActiveHoverHorizontalInverted:o,itemTextColorActiveHorizontalInverted:o,itemTextColorActiveHoverHorizontalInverted:o,itemIconColorInverted:e,itemIconColorHoverInverted:o,itemIconColorActiveInverted:o,itemIconColorActiveHoverInverted:o,itemIconColorChildActiveInverted:o,itemIconColorChildActiveHoverInverted:o,itemIconColorCollapsedInverted:e,itemIconColorHorizontalInverted:e,itemIconColorHoverHorizontalInverted:o,itemIconColorActiveHorizontalInverted:o,itemIconColorActiveHoverHorizontalInverted:o,itemIconColorChildActiveHorizontalInverted:o,itemIconColorChildActiveHoverHorizontalInverted:o,arrowColorInverted:e,arrowColorHoverInverted:o,arrowColorActiveInverted:o,arrowColorActiveHoverInverted:o,arrowColorChildActiveInverted:o,arrowColorChildActiveHoverInverted:o,groupTextColorInverted:r}}function ZS(e){const{borderRadius:t,textColor3:o,primaryColor:r,textColor2:n,textColor1:i,fontSize:a,dividerColor:l,hoverColor:s,primaryColorHover:c}=e;return Object.assign({borderRadius:t,color:"#0000",groupTextColor:o,itemColorHover:s,itemColorActive:K(r,{alpha:.1}),itemColorActiveHover:K(r,{alpha:.1}),itemColorActiveCollapsed:K(r,{alpha:.1}),itemTextColor:n,itemTextColorHover:n,itemTextColorActive:r,itemTextColorActiveHover:r,itemTextColorChildActive:r,itemTextColorChildActiveHover:r,itemTextColorHorizontal:n,itemTextColorHoverHorizontal:c,itemTextColorActiveHorizontal:r,itemTextColorActiveHoverHorizontal:r,itemTextColorChildActiveHorizontal:r,itemTextColorChildActiveHoverHorizontal:r,itemIconColor:i,itemIconColorHover:i,itemIconColorActive:r,itemIconColorActiveHover:r,itemIconColorChildActive:r,itemIconColorChildActiveHover:r,itemIconColorCollapsed:i,itemIconColorHorizontal:i,itemIconColorHoverHorizontal:c,itemIconColorActiveHorizontal:r,itemIconColorActiveHoverHorizontal:r,itemIconColorChildActiveHorizontal:r,itemIconColorChildActiveHoverHorizontal:r,itemHeight:"42px",arrowColor:n,arrowColorHover:n,arrowColorActive:r,arrowColorActiveHover:r,arrowColorChildActive:r,arrowColorChildActiveHover:r,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:a,dividerColor:l},JS("#BBB",r,"#FFF","#AAA"))}const QS={name:"Menu",common:W,peers:{Tooltip:Di,Dropdown:yl},self(e){const{primaryColor:t,primaryColorSuppl:o}=e,r=ZS(e);return r.itemColorActive=K(t,{alpha:.15}),r.itemColorActiveHover=K(t,{alpha:.15}),r.itemColorActiveCollapsed=K(t,{alpha:.15}),r.itemColorActiveInverted=o,r.itemColorActiveHoverInverted=o,r.itemColorActiveCollapsedInverted=o,r}},ew={titleFontSize:"18px",backSize:"22px"};function tw(e){const{textColor1:t,textColor2:o,textColor3:r,fontSize:n,fontWeightStrong:i,primaryColorHover:a,primaryColorPressed:l}=e;return Object.assign(Object.assign({},ew),{titleFontWeight:i,fontSize:n,titleTextColor:t,backColor:o,backColorHover:a,backColorPressed:l,subtitleTextColor:r})}const ow={name:"PageHeader",common:W,self:tw},rw={iconSize:"22px"};function Cf(e){const{fontSize:t,warningColor:o}=e;return Object.assign(Object.assign({},rw),{fontSize:t,iconColor:o})}const FP={name:"Popconfirm",common:Oe,peers:{Button:_n,Popover:Ar},self:Cf},nw={name:"Popconfirm",common:W,peers:{Button:wt,Popover:lr},self:Cf};function iw(e){const{infoColor:t,successColor:o,warningColor:r,errorColor:n,textColor2:i,progressRailColor:a,fontSize:l,fontWeight:s}=e;return{fontSize:l,fontSizeCircle:"28px",fontWeightCircle:s,railColor:a,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:t,iconColorInfo:t,iconColorSuccess:o,iconColorWarning:r,iconColorError:n,textColorCircle:i,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:i,fillColor:t,fillColorInfo:t,fillColorSuccess:o,fillColorWarning:r,fillColorError:n,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}}const yf={name:"Progress",common:W,self(e){const t=iw(e);return t.textColorLineInner="rgb(0, 0, 0)",t.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",t}},aw={name:"Rate",common:W,self(e){const{railColor:t}=e;return{itemColor:t,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},lw={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0};function sw(e){const{textColor2:t,textColor1:o,errorColor:r,successColor:n,infoColor:i,warningColor:a,lineHeight:l,fontWeightStrong:s}=e;return Object.assign(Object.assign({},lw),{lineHeight:l,titleFontWeight:s,titleTextColor:o,textColor:t,iconColorError:r,iconColorSuccess:n,iconColorInfo:i,iconColorWarning:a})}const cw={name:"Result",common:W,self:sw},dw={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},uw={name:"Slider",common:W,self(e){const t="0 2px 8px 0 rgba(0, 0, 0, 0.12)",{railColor:o,modalColor:r,primaryColorSuppl:n,popoverColor:i,textColor2:a,cardColor:l,borderRadius:s,fontSize:c,opacityDisabled:d}=e;return Object.assign(Object.assign({},dw),{fontSize:c,markFontSize:c,railColor:o,railColorHover:o,fillColor:n,fillColorHover:n,opacityDisabled:d,handleColor:"#FFF",dotColor:l,dotColorModal:r,dotColorPopover:i,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:i,indicatorBoxShadow:t,indicatorTextColor:a,indicatorBorderRadius:s,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}};function Sf(e){const{opacityDisabled:t,heightTiny:o,heightSmall:r,heightMedium:n,heightLarge:i,heightHuge:a,primaryColor:l,fontSize:s}=e;return{fontSize:s,textColor:l,sizeTiny:o,sizeSmall:r,sizeMedium:n,sizeLarge:i,sizeHuge:a,color:l,opacitySpinning:t}}const _P={common:Oe,self:Sf},fw={name:"Spin",common:W,self:Sf};function pw(e){const{textColor2:t,textColor3:o,fontSize:r,fontWeight:n}=e;return{labelFontSize:r,labelFontWeight:n,valueFontWeight:n,valueFontSize:"24px",labelTextColor:o,valuePrefixTextColor:t,valueSuffixTextColor:t,valueTextColor:t}}const hw={name:"Statistic",common:W,self:pw},gw={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};function mw(e){const{fontWeightStrong:t,baseColor:o,textColorDisabled:r,primaryColor:n,errorColor:i,textColor1:a,textColor2:l}=e;return Object.assign(Object.assign({},gw),{stepHeaderFontWeight:t,indicatorTextColorProcess:o,indicatorTextColorWait:r,indicatorTextColorFinish:n,indicatorTextColorError:i,indicatorBorderColorProcess:n,indicatorBorderColorWait:r,indicatorBorderColorFinish:n,indicatorBorderColorError:i,indicatorColorProcess:n,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:r,splitorColorWait:r,splitorColorFinish:n,splitorColorError:r,headerTextColorProcess:a,headerTextColorWait:r,headerTextColorFinish:r,headerTextColorError:i,descriptionTextColorProcess:l,descriptionTextColorWait:r,descriptionTextColorFinish:r,descriptionTextColorError:i})}const bw={name:"Steps",common:W,self:mw},vw={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},xw={name:"Switch",common:W,self(e){const{primaryColorSuppl:t,opacityDisabled:o,borderRadius:r,primaryColor:n,textColor2:i,baseColor:a}=e;return Object.assign(Object.assign({},vw),{iconColor:a,textColor:i,loadingColor:t,opacityDisabled:o,railColor:"rgba(255, 255, 255, .20)",railColorActive:t,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`})}},Cw={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};function yw(e){const{dividerColor:t,cardColor:o,modalColor:r,popoverColor:n,tableHeaderColor:i,tableColorStriped:a,textColor1:l,textColor2:s,borderRadius:c,fontWeightStrong:d,lineHeight:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f}=e;return Object.assign(Object.assign({},Cw),{fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,lineHeight:u,borderRadius:c,borderColor:ee(o,t),borderColorModal:ee(r,t),borderColorPopover:ee(n,t),tdColor:o,tdColorModal:r,tdColorPopover:n,tdColorStriped:ee(o,a),tdColorStripedModal:ee(r,a),tdColorStripedPopover:ee(n,a),thColor:ee(o,i),thColorModal:ee(r,i),thColorPopover:ee(n,i),thTextColor:l,tdTextColor:s,thFontWeight:d})}const Sw={name:"Table",common:W,self:yw},ww={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"};function Pw(e){const{textColor2:t,primaryColor:o,textColorDisabled:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,tabColor:c,baseColor:d,dividerColor:u,fontWeight:p,textColor1:m,borderRadius:f,fontSize:g,fontWeightStrong:S}=e;return Object.assign(Object.assign({},ww),{colorSegment:c,tabFontSizeCard:g,tabTextColorLine:m,tabTextColorActiveLine:o,tabTextColorHoverLine:o,tabTextColorDisabledLine:r,tabTextColorSegment:m,tabTextColorActiveSegment:t,tabTextColorHoverSegment:t,tabTextColorDisabledSegment:r,tabTextColorBar:m,tabTextColorActiveBar:o,tabTextColorHoverBar:o,tabTextColorDisabledBar:r,tabTextColorCard:m,tabTextColorHoverCard:m,tabTextColorActiveCard:o,tabTextColorDisabledCard:r,barColor:o,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,closeBorderRadius:f,tabColor:c,tabColorSegment:d,tabBorderColor:u,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:f,paneTextColor:t,fontWeightStrong:S})}const Tw={name:"Tabs",common:W,self(e){const t=Pw(e),{inputColor:o}=e;return t.colorSegment=o,t.tabColorSegment=o,t}};function $w(e){const{textColor1:t,textColor2:o,fontWeightStrong:r,fontSize:n}=e;return{fontSize:n,titleTextColor:t,textColor:o,titleFontWeight:r}}const Rw={name:"Thing",common:W,self:$w},Fw={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},_w={name:"Timeline",common:W,self(e){const{textColor3:t,infoColorSuppl:o,errorColorSuppl:r,successColorSuppl:n,warningColorSuppl:i,textColor1:a,textColor2:l,railColor:s,fontWeightStrong:c,fontSize:d}=e;return Object.assign(Object.assign({},Fw),{contentFontSize:d,titleFontWeight:c,circleBorder:`2px solid ${t}`,circleBorderInfo:`2px solid ${o}`,circleBorderError:`2px solid ${r}`,circleBorderSuccess:`2px solid ${n}`,circleBorderWarning:`2px solid ${i}`,iconColor:t,iconColorInfo:o,iconColorError:r,iconColorSuccess:n,iconColorWarning:i,titleTextColor:a,contentTextColor:l,metaTextColor:t,lineColor:s})}},Ew={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},zw={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:At,Empty:ar,Button:wt},self(e){const{fontWeight:t,fontSizeLarge:o,fontSizeMedium:r,fontSizeSmall:n,heightLarge:i,heightMedium:a,borderRadius:l,inputColor:s,tableHeaderColor:c,textColor1:d,textColorDisabled:u,textColor2:p,textColor3:m,hoverColor:f,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T,dividerColor:w}=e;return Object.assign(Object.assign({},Ew),{itemHeightSmall:a,itemHeightMedium:a,itemHeightLarge:i,fontSizeSmall:n,fontSizeMedium:r,fontSizeLarge:o,borderRadius:l,dividerColor:w,borderColor:"#0000",listColor:s,headerColor:c,titleTextColor:d,titleTextColorDisabled:u,extraTextColor:m,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:f,titleFontWeight:t,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T})}};function Mw(e){const{borderRadiusSmall:t,dividerColor:o,hoverColor:r,pressedColor:n,primaryColor:i,textColor3:a,textColor2:l,textColorDisabled:s,fontSize:c}=e;return{fontSize:c,lineHeight:"1.5",nodeHeight:"30px",nodeWrapperPadding:"3px 0",nodeBorderRadius:t,nodeColorHover:r,nodeColorPressed:n,nodeColorActive:K(i,{alpha:.1}),arrowColor:a,nodeTextColor:l,nodeTextColorDisabled:s,loadingColor:i,dropMarkColor:i,lineColor:o}}const wf={name:"Tree",common:W,peers:{Checkbox:Hr,Scrollbar:St,Empty:ar},self(e){const{primaryColor:t}=e,o=Mw(e);return o.nodeColorActive=K(t,{alpha:.15}),o}},Iw={name:"TreeSelect",common:W,peers:{Tree:wf,Empty:ar,InternalSelection:Cl}},Aw={headerFontSize1:"30px",headerFontSize2:"22px",headerFontSize3:"18px",headerFontSize4:"16px",headerFontSize5:"16px",headerFontSize6:"16px",headerMargin1:"28px 0 20px 0",headerMargin2:"28px 0 20px 0",headerMargin3:"28px 0 20px 0",headerMargin4:"28px 0 18px 0",headerMargin5:"28px 0 18px 0",headerMargin6:"28px 0 18px 0",headerPrefixWidth1:"16px",headerPrefixWidth2:"16px",headerPrefixWidth3:"12px",headerPrefixWidth4:"12px",headerPrefixWidth5:"12px",headerPrefixWidth6:"12px",headerBarWidth1:"4px",headerBarWidth2:"4px",headerBarWidth3:"3px",headerBarWidth4:"3px",headerBarWidth5:"3px",headerBarWidth6:"3px",pMargin:"16px 0 16px 0",liMargin:".25em 0 0 0",olPadding:"0 0 0 2em",ulPadding:"0 0 0 2em"};function Hw(e){const{primaryColor:t,textColor2:o,borderColor:r,lineHeight:n,fontSize:i,borderRadiusSmall:a,dividerColor:l,fontWeightStrong:s,textColor1:c,textColor3:d,infoColor:u,warningColor:p,errorColor:m,successColor:f,codeColor:g}=e;return Object.assign(Object.assign({},Aw),{aTextColor:t,blockquoteTextColor:o,blockquotePrefixColor:r,blockquoteLineHeight:n,blockquoteFontSize:i,codeBorderRadius:a,liTextColor:o,liLineHeight:n,liFontSize:i,hrColor:l,headerFontWeight:s,headerTextColor:c,pTextColor:o,pTextColor1Depth:c,pTextColor2Depth:o,pTextColor3Depth:d,pLineHeight:n,pFontSize:i,headerBarColor:t,headerBarColorPrimary:t,headerBarColorInfo:u,headerBarColorError:m,headerBarColorWarning:p,headerBarColorSuccess:f,textColor:o,textColor1Depth:c,textColor2Depth:o,textColor3Depth:d,textColorPrimary:t,textColorInfo:u,textColorSuccess:f,textColorWarning:p,textColorError:m,codeTextColor:o,codeColor:g,codeBorder:"1px solid #0000"})}const kw={name:"Typography",common:W,self:Hw};function Dw(e){const{iconColor:t,primaryColor:o,errorColor:r,textColor2:n,successColor:i,opacityDisabled:a,actionColor:l,borderColor:s,hoverColor:c,lineHeight:d,borderRadius:u,fontSize:p}=e;return{fontSize:p,lineHeight:d,borderRadius:u,draggerColor:l,draggerBorder:`1px dashed ${s}`,draggerBorderHover:`1px dashed ${o}`,itemColorHover:c,itemColorHoverError:K(r,{alpha:.06}),itemTextColor:n,itemTextColorError:r,itemTextColorSuccess:i,itemIconColor:t,itemDisabledOpacity:a,itemBorderImageCardError:`1px solid ${r}`,itemBorderImageCard:`1px solid ${s}`}}const Bw={name:"Upload",common:W,peers:{Button:wt,Progress:yf},self(e){const{errorColor:t}=e,o=Dw(e);return o.itemColorHoverError=K(t,{alpha:.09}),o}},Ow={name:"Watermark",common:W,self(e){const{fontFamily:t}=e;return{fontFamily:t}}},Lw={name:"FloatButton",common:W,self(e){const{popoverColor:t,textColor2:o,buttonColor2Hover:r,buttonColor2Pressed:n,primaryColor:i,primaryColorHover:a,primaryColorPressed:l,baseColor:s,borderRadius:c}=e;return{color:t,textColor:o,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)",colorHover:r,colorPressed:n,colorPrimary:i,colorPrimaryHover:a,colorPrimaryPressed:l,textColorPrimary:s,borderRadiusSquare:c}}},En="n-form",Pf="n-form-item-insts",Ww=pe("form",[re("inline",` + `)])]),yS={info:()=>y(vy,null),success:()=>y(xy,null),warning:()=>y(Cy,null),error:()=>y(gy,null),default:()=>null},SS=He({name:"Message",props:Object.assign(Object.assign({},mf),{render:Function}),setup(e){const{inlineThemeDisabled:t,mergedRtlRef:o}=zo(e),{props:r,mergedClsPrefixRef:n}=Le(hf),i=$n("Message",o,n),a=Ct("Message","-message",CS,vS,r,n),l=Y(()=>{const{type:c}=e,{common:{cubicBezierEaseInOut:d},self:{padding:u,margin:p,maxWidth:m,iconMargin:f,closeMargin:g,closeSize:S,iconSize:v,fontSize:$,lineHeight:T,borderRadius:w,iconColorInfo:_,iconColorSuccess:O,iconColorWarning:x,iconColorError:F,iconColorLoading:R,closeIconSize:B,closeBorderRadius:j,[ae("textColor",c)]:A,[ae("boxShadow",c)]:J,[ae("color",c)]:G,[ae("closeColorHover",c)]:le,[ae("closeColorPressed",c)]:te,[ae("closeIconColor",c)]:N,[ae("closeIconColorPressed",c)]:oe,[ae("closeIconColorHover",c)]:ye}}=a.value;return{"--n-bezier":d,"--n-margin":p,"--n-padding":u,"--n-max-width":m,"--n-font-size":$,"--n-icon-margin":f,"--n-icon-size":v,"--n-close-icon-size":B,"--n-close-border-radius":j,"--n-close-size":S,"--n-close-margin":g,"--n-text-color":A,"--n-color":G,"--n-box-shadow":J,"--n-icon-color-info":_,"--n-icon-color-success":O,"--n-icon-color-warning":x,"--n-icon-color-error":F,"--n-icon-color-loading":R,"--n-close-color-hover":le,"--n-close-color-pressed":te,"--n-close-icon-color":N,"--n-close-icon-color-pressed":oe,"--n-close-icon-color-hover":ye,"--n-line-height":T,"--n-border-radius":w}}),s=t?Fr("message",Y(()=>e.type[0]),l,{}):void 0;return{mergedClsPrefix:n,rtlEnabled:i,messageProviderProps:r,handleClose(){var c;(c=e.onClose)===null||c===void 0||c.call(e)},cssVars:t?void 0:l,themeClass:s==null?void 0:s.themeClass,onRender:s==null?void 0:s.onRender,placement:r.placement}},render(){const{render:e,type:t,closable:o,content:r,mergedClsPrefix:n,cssVars:i,themeClass:a,onRender:l,icon:s,handleClose:c,showIcon:d}=this;l==null||l();let u;return y("div",{class:[`${n}-message-wrapper`,a],onMouseenter:this.onMouseenter,onMouseleave:this.onMouseleave,style:[{alignItems:this.placement.startsWith("top")?"flex-start":"flex-end"},i]},e?e(this.$props):y("div",{class:[`${n}-message ${n}-message--${t}-type`,this.rtlEnabled&&`${n}-message--rtl`]},(u=wS(s,t,n))&&d?y("div",{class:`${n}-message__icon ${n}-message__icon--${t}-type`},y(Hi,null,{default:()=>u})):null,y("div",{class:`${n}-message__content`},Ab(r)),o?y(Iu,{clsPrefix:n,class:`${n}-message__close`,onClick:c,absolute:!0}):null))}});function wS(e,t,o){if(typeof e=="function")return e();{const r=t==="loading"?y(vl,{clsPrefix:o,strokeWidth:24,scale:.85}):yS[t]();return r?y(Tr,{clsPrefix:o,key:t},{default:()=>r}):null}}const PS=He({name:"MessageEnvironment",props:Object.assign(Object.assign({},mf),{duration:{type:Number,default:3e3},onAfterLeave:Function,onLeave:Function,internalKey:{type:String,required:!0},onInternalAfterLeave:Function,onHide:Function,onAfterHide:Function}),setup(e){let t=null;const o=fe(!0);Mo(()=>{r()});function r(){const{duration:d}=e;d&&(t=window.setTimeout(a,d))}function n(d){d.currentTarget===d.target&&t!==null&&(window.clearTimeout(t),t=null)}function i(d){d.currentTarget===d.target&&r()}function a(){const{onHide:d}=e;o.value=!1,t&&(window.clearTimeout(t),t=null),d&&d()}function l(){const{onClose:d}=e;d&&d(),a()}function s(){const{onAfterLeave:d,onInternalAfterLeave:u,onAfterHide:p,internalKey:m}=e;d&&d(),u&&u(m),p&&p()}function c(){a()}return{show:o,hide:a,handleClose:l,handleAfterLeave:s,handleMouseleave:i,handleMouseenter:n,deactivate:c}},render(){return y(_u,{appear:!0,onAfterLeave:this.handleAfterLeave,onLeave:this.onLeave},{default:()=>[this.show?y(SS,{content:this.content,type:this.type,icon:this.icon,showIcon:this.showIcon,closable:this.closable,onClose:this.handleClose,onMouseenter:this.keepAliveOnHover?this.handleMouseenter:void 0,onMouseleave:this.keepAliveOnHover?this.handleMouseleave:void 0}):null]})}}),TS=Object.assign(Object.assign({},Ct.props),{to:[String,Object],duration:{type:Number,default:3e3},keepAliveOnHover:Boolean,max:Number,placement:{type:String,default:"top"},closable:Boolean,containerClass:String,containerStyle:[String,Object]}),RP=He({name:"MessageProvider",props:TS,setup(e){const{mergedClsPrefixRef:t}=zo(e),o=fe([]),r=fe({}),n={create(s,c){return i(s,Object.assign({type:"default"},c))},info(s,c){return i(s,Object.assign(Object.assign({},c),{type:"info"}))},success(s,c){return i(s,Object.assign(Object.assign({},c),{type:"success"}))},warning(s,c){return i(s,Object.assign(Object.assign({},c),{type:"warning"}))},error(s,c){return i(s,Object.assign(Object.assign({},c),{type:"error"}))},loading(s,c){return i(s,Object.assign(Object.assign({},c),{type:"loading"}))},destroyAll:l};po(hf,{props:e,mergedClsPrefixRef:t}),po(mS,n);function i(s,c){const d=$a(),u=Ci(Object.assign(Object.assign({},c),{content:s,key:d,destroy:()=>{var m;(m=r.value[d])===null||m===void 0||m.hide()}})),{max:p}=e;return p&&o.value.length>=p&&o.value.shift(),o.value.push(u),u}function a(s){o.value.splice(o.value.findIndex(c=>c.key===s),1),delete r.value[s]}function l(){Object.values(r.value).forEach(s=>{s.hide()})}return Object.assign({mergedClsPrefix:t,messageRefs:r,messageList:o,handleAfterLeave:a},n)},render(){var e,t,o;return y(et,null,(t=(e=this.$slots).default)===null||t===void 0?void 0:t.call(e),this.messageList.length?y(ch,{to:(o=this.to)!==null&&o!==void 0?o:"body"},y("div",{class:[`${this.mergedClsPrefix}-message-container`,`${this.mergedClsPrefix}-message-container--${this.placement}`,this.containerClass],key:"message-container",style:this.containerStyle},this.messageList.map(r=>y(PS,Object.assign({ref:n=>{n&&(this.messageRefs[r.key]=n)},internalKey:r.key,onInternalAfterLeave:this.handleAfterLeave},Fb(r,["destroy"],void 0),{duration:r.duration===void 0?this.duration:r.duration,keepAliveOnHover:r.keepAliveOnHover===void 0?this.keepAliveOnHover:r.keepAliveOnHover,closable:r.closable===void 0?this.closable:r.closable}))))):null)}}),$S={closeMargin:"16px 12px",closeSize:"20px",closeIconSize:"16px",width:"365px",padding:"16px",titleFontSize:"16px",metaFontSize:"12px",descriptionFontSize:"12px"};function RS(e){const{textColor2:t,successColor:o,infoColor:r,warningColor:n,errorColor:i,popoverColor:a,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeColorHover:d,closeColorPressed:u,textColor1:p,textColor3:m,borderRadius:f,fontWeightStrong:g,boxShadow2:S,lineHeight:v,fontSize:$}=e;return Object.assign(Object.assign({},$S),{borderRadius:f,lineHeight:v,fontSize:$,headerFontWeight:g,iconColor:t,iconColorSuccess:o,iconColorInfo:r,iconColorWarning:n,iconColorError:i,color:a,textColor:t,closeIconColor:l,closeIconColorHover:s,closeIconColorPressed:c,closeBorderRadius:f,closeColorHover:d,closeColorPressed:u,headerTextColor:p,descriptionTextColor:m,actionTextColor:t,boxShadow:S})}const FS={name:"Notification",common:W,peers:{Scrollbar:St},self:RS};function AS(e){const{textColor1:t,dividerColor:o,fontWeightStrong:r}=e;return{textColor:t,color:o,fontWeight:r}}const IS={name:"Divider",common:W,self:AS};function _S(e){const{modalColor:t,textColor1:o,textColor2:r,boxShadow3:n,lineHeight:i,fontWeightStrong:a,dividerColor:l,closeColorHover:s,closeColorPressed:c,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,borderRadius:m,primaryColorHover:f}=e;return{bodyPadding:"16px 24px",borderRadius:m,headerPadding:"16px 24px",footerPadding:"16px 24px",color:t,textColor:r,titleTextColor:o,titleFontSize:"18px",titleFontWeight:a,boxShadow:n,lineHeight:i,headerBorderBottom:`1px solid ${l}`,footerBorderTop:`1px solid ${l}`,closeIconColor:d,closeIconColorHover:u,closeIconColorPressed:p,closeSize:"22px",closeIconSize:"18px",closeColorHover:s,closeColorPressed:c,closeBorderRadius:m,resizableTriggerColorHover:f}}const ES={name:"Drawer",common:W,peers:{Scrollbar:St},self:_S},MS={actionMargin:"0 0 0 20px",actionMarginRtl:"0 20px 0 0"},zS={name:"DynamicInput",common:W,peers:{Input:zt,Button:wt},self(){return MS}},HS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},bf={name:"Space",self(){return HS}},kS={name:"DynamicTags",common:W,peers:{Input:zt,Button:wt,Tag:Lu,Space:bf},self(){return{inputWidth:"64px"}}},DS={name:"Element",common:W},OS={gapSmall:"4px 8px",gapMedium:"8px 12px",gapLarge:"12px 16px"},BS={name:"Flex",self(){return OS}},LS={name:"ButtonGroup",common:W},WS={feedbackPadding:"4px 0 0 2px",feedbackHeightSmall:"24px",feedbackHeightMedium:"24px",feedbackHeightLarge:"26px",feedbackFontSizeSmall:"13px",feedbackFontSizeMedium:"14px",feedbackFontSizeLarge:"14px",labelFontSizeLeftSmall:"14px",labelFontSizeLeftMedium:"14px",labelFontSizeLeftLarge:"15px",labelFontSizeTopSmall:"13px",labelFontSizeTopMedium:"14px",labelFontSizeTopLarge:"14px",labelHeightSmall:"24px",labelHeightMedium:"26px",labelHeightLarge:"28px",labelPaddingVertical:"0 0 6px 2px",labelPaddingHorizontal:"0 12px 0 0",labelTextAlignVertical:"left",labelTextAlignHorizontal:"right",labelFontWeight:"400"};function vf(e){const{heightSmall:t,heightMedium:o,heightLarge:r,textColor1:n,errorColor:i,warningColor:a,lineHeight:l,textColor3:s}=e;return Object.assign(Object.assign({},WS),{blankHeightSmall:t,blankHeightMedium:o,blankHeightLarge:r,lineHeight:l,labelTextColor:n,asteriskColor:i,feedbackTextColorError:i,feedbackTextColorWarning:a,feedbackTextColor:s})}const xf={common:Be,self:vf},jS={name:"Form",common:W,self:vf},NS={name:"GradientText",common:W,self(e){const{primaryColor:t,successColor:o,warningColor:r,errorColor:n,infoColor:i,primaryColorSuppl:a,successColorSuppl:l,warningColorSuppl:s,errorColorSuppl:c,infoColorSuppl:d,fontWeightStrong:u}=e;return{fontWeight:u,rotate:"252deg",colorStartPrimary:t,colorEndPrimary:a,colorStartInfo:i,colorEndInfo:d,colorStartWarning:r,colorEndWarning:s,colorStartError:n,colorEndError:c,colorStartSuccess:o,colorEndSuccess:l}}},VS={name:"InputNumber",common:W,peers:{Button:wt,Input:zt},self(e){const{textColorDisabled:t}=e;return{iconColorDisabled:t}}},US={name:"Layout",common:W,peers:{Scrollbar:St},self(e){const{textColor2:t,bodyColor:o,popoverColor:r,cardColor:n,dividerColor:i,scrollbarColor:a,scrollbarColorHover:l}=e;return{textColor:t,textColorInverted:t,color:o,colorEmbedded:o,headerColor:n,headerColorInverted:n,footerColor:n,footerColorInverted:n,headerBorderColor:i,headerBorderColorInverted:i,footerBorderColor:i,footerBorderColorInverted:i,siderBorderColor:i,siderBorderColorInverted:i,siderColor:n,siderColorInverted:n,siderToggleButtonBorder:"1px solid transparent",siderToggleButtonColor:r,siderToggleButtonIconColor:t,siderToggleButtonIconColorInverted:t,siderToggleBarColor:ee(o,a),siderToggleBarColorHover:ee(o,l),__invertScrollbar:"false"}}},qS={name:"Row",common:W};function GS(e){const{textColor2:t,cardColor:o,modalColor:r,popoverColor:n,dividerColor:i,borderRadius:a,fontSize:l,hoverColor:s}=e;return{textColor:t,color:o,colorHover:s,colorModal:r,colorHoverModal:ee(r,s),colorPopover:n,colorHoverPopover:ee(n,s),borderColor:i,borderColorModal:ee(r,i),borderColorPopover:ee(n,i),borderRadius:a,fontSize:l}}const KS={name:"List",common:W,self:GS},YS={name:"Log",common:W,peers:{Scrollbar:St,Code:Xu},self(e){const{textColor2:t,inputColor:o,fontSize:r,primaryColor:n}=e;return{loaderFontSize:r,loaderTextColor:t,loaderColor:o,loaderBorder:"1px solid #0000",loadingColor:n}}},XS={name:"Mention",common:W,peers:{InternalSelectMenu:Fn,Input:zt},self(e){const{boxShadow2:t}=e;return{menuBoxShadow:t}}};function JS(e,t,o,r){return{itemColorHoverInverted:"#0000",itemColorActiveInverted:t,itemColorActiveHoverInverted:t,itemColorActiveCollapsedInverted:t,itemTextColorInverted:e,itemTextColorHoverInverted:o,itemTextColorChildActiveInverted:o,itemTextColorChildActiveHoverInverted:o,itemTextColorActiveInverted:o,itemTextColorActiveHoverInverted:o,itemTextColorHorizontalInverted:e,itemTextColorHoverHorizontalInverted:o,itemTextColorChildActiveHorizontalInverted:o,itemTextColorChildActiveHoverHorizontalInverted:o,itemTextColorActiveHorizontalInverted:o,itemTextColorActiveHoverHorizontalInverted:o,itemIconColorInverted:e,itemIconColorHoverInverted:o,itemIconColorActiveInverted:o,itemIconColorActiveHoverInverted:o,itemIconColorChildActiveInverted:o,itemIconColorChildActiveHoverInverted:o,itemIconColorCollapsedInverted:e,itemIconColorHorizontalInverted:e,itemIconColorHoverHorizontalInverted:o,itemIconColorActiveHorizontalInverted:o,itemIconColorActiveHoverHorizontalInverted:o,itemIconColorChildActiveHorizontalInverted:o,itemIconColorChildActiveHoverHorizontalInverted:o,arrowColorInverted:e,arrowColorHoverInverted:o,arrowColorActiveInverted:o,arrowColorActiveHoverInverted:o,arrowColorChildActiveInverted:o,arrowColorChildActiveHoverInverted:o,groupTextColorInverted:r}}function ZS(e){const{borderRadius:t,textColor3:o,primaryColor:r,textColor2:n,textColor1:i,fontSize:a,dividerColor:l,hoverColor:s,primaryColorHover:c}=e;return Object.assign({borderRadius:t,color:"#0000",groupTextColor:o,itemColorHover:s,itemColorActive:K(r,{alpha:.1}),itemColorActiveHover:K(r,{alpha:.1}),itemColorActiveCollapsed:K(r,{alpha:.1}),itemTextColor:n,itemTextColorHover:n,itemTextColorActive:r,itemTextColorActiveHover:r,itemTextColorChildActive:r,itemTextColorChildActiveHover:r,itemTextColorHorizontal:n,itemTextColorHoverHorizontal:c,itemTextColorActiveHorizontal:r,itemTextColorActiveHoverHorizontal:r,itemTextColorChildActiveHorizontal:r,itemTextColorChildActiveHoverHorizontal:r,itemIconColor:i,itemIconColorHover:i,itemIconColorActive:r,itemIconColorActiveHover:r,itemIconColorChildActive:r,itemIconColorChildActiveHover:r,itemIconColorCollapsed:i,itemIconColorHorizontal:i,itemIconColorHoverHorizontal:c,itemIconColorActiveHorizontal:r,itemIconColorActiveHoverHorizontal:r,itemIconColorChildActiveHorizontal:r,itemIconColorChildActiveHoverHorizontal:r,itemHeight:"42px",arrowColor:n,arrowColorHover:n,arrowColorActive:r,arrowColorActiveHover:r,arrowColorChildActive:r,arrowColorChildActiveHover:r,colorInverted:"#0000",borderColorHorizontal:"#0000",fontSize:a,dividerColor:l},JS("#BBB",r,"#FFF","#AAA"))}const QS={name:"Menu",common:W,peers:{Tooltip:Di,Dropdown:yl},self(e){const{primaryColor:t,primaryColorSuppl:o}=e,r=ZS(e);return r.itemColorActive=K(t,{alpha:.15}),r.itemColorActiveHover=K(t,{alpha:.15}),r.itemColorActiveCollapsed=K(t,{alpha:.15}),r.itemColorActiveInverted=o,r.itemColorActiveHoverInverted=o,r.itemColorActiveCollapsedInverted=o,r}},ew={titleFontSize:"18px",backSize:"22px"};function tw(e){const{textColor1:t,textColor2:o,textColor3:r,fontSize:n,fontWeightStrong:i,primaryColorHover:a,primaryColorPressed:l}=e;return Object.assign(Object.assign({},ew),{titleFontWeight:i,fontSize:n,titleTextColor:t,backColor:o,backColorHover:a,backColorPressed:l,subtitleTextColor:r})}const ow={name:"PageHeader",common:W,self:tw},rw={iconSize:"22px"};function Cf(e){const{fontSize:t,warningColor:o}=e;return Object.assign(Object.assign({},rw),{fontSize:t,iconColor:o})}const FP={name:"Popconfirm",common:Be,peers:{Button:An,Popover:zr},self:Cf},nw={name:"Popconfirm",common:W,peers:{Button:wt,Popover:lr},self:Cf};function iw(e){const{infoColor:t,successColor:o,warningColor:r,errorColor:n,textColor2:i,progressRailColor:a,fontSize:l,fontWeight:s}=e;return{fontSize:l,fontSizeCircle:"28px",fontWeightCircle:s,railColor:a,railHeight:"8px",iconSizeCircle:"36px",iconSizeLine:"18px",iconColor:t,iconColorInfo:t,iconColorSuccess:o,iconColorWarning:r,iconColorError:n,textColorCircle:i,textColorLineInner:"rgb(255, 255, 255)",textColorLineOuter:i,fillColor:t,fillColorInfo:t,fillColorSuccess:o,fillColorWarning:r,fillColorError:n,lineBgProcessing:"linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)"}}const yf={name:"Progress",common:W,self(e){const t=iw(e);return t.textColorLineInner="rgb(0, 0, 0)",t.lineBgProcessing="linear-gradient(90deg, rgba(255, 255, 255, .3) 0%, rgba(255, 255, 255, .5) 100%)",t}},aw={name:"Rate",common:W,self(e){const{railColor:t}=e;return{itemColor:t,itemColorActive:"#CCAA33",itemSize:"20px",sizeSmall:"16px",sizeMedium:"20px",sizeLarge:"24px"}}},lw={titleFontSizeSmall:"26px",titleFontSizeMedium:"32px",titleFontSizeLarge:"40px",titleFontSizeHuge:"48px",fontSizeSmall:"14px",fontSizeMedium:"14px",fontSizeLarge:"15px",fontSizeHuge:"16px",iconSizeSmall:"64px",iconSizeMedium:"80px",iconSizeLarge:"100px",iconSizeHuge:"125px",iconColor418:void 0,iconColor404:void 0,iconColor403:void 0,iconColor500:void 0};function sw(e){const{textColor2:t,textColor1:o,errorColor:r,successColor:n,infoColor:i,warningColor:a,lineHeight:l,fontWeightStrong:s}=e;return Object.assign(Object.assign({},lw),{lineHeight:l,titleFontWeight:s,titleTextColor:o,textColor:t,iconColorError:r,iconColorSuccess:n,iconColorInfo:i,iconColorWarning:a})}const cw={name:"Result",common:W,self:sw},dw={railHeight:"4px",railWidthVertical:"4px",handleSize:"18px",dotHeight:"8px",dotWidth:"8px",dotBorderRadius:"4px"},uw={name:"Slider",common:W,self(e){const t="0 2px 8px 0 rgba(0, 0, 0, 0.12)",{railColor:o,modalColor:r,primaryColorSuppl:n,popoverColor:i,textColor2:a,cardColor:l,borderRadius:s,fontSize:c,opacityDisabled:d}=e;return Object.assign(Object.assign({},dw),{fontSize:c,markFontSize:c,railColor:o,railColorHover:o,fillColor:n,fillColorHover:n,opacityDisabled:d,handleColor:"#FFF",dotColor:l,dotColorModal:r,dotColorPopover:i,handleBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowHover:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowActive:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",handleBoxShadowFocus:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",indicatorColor:i,indicatorBoxShadow:t,indicatorTextColor:a,indicatorBorderRadius:s,dotBorder:`2px solid ${o}`,dotBorderActive:`2px solid ${n}`,dotBoxShadow:""})}};function Sf(e){const{opacityDisabled:t,heightTiny:o,heightSmall:r,heightMedium:n,heightLarge:i,heightHuge:a,primaryColor:l,fontSize:s}=e;return{fontSize:s,textColor:l,sizeTiny:o,sizeSmall:r,sizeMedium:n,sizeLarge:i,sizeHuge:a,color:l,opacitySpinning:t}}const AP={common:Be,self:Sf},fw={name:"Spin",common:W,self:Sf};function pw(e){const{textColor2:t,textColor3:o,fontSize:r,fontWeight:n}=e;return{labelFontSize:r,labelFontWeight:n,valueFontWeight:n,valueFontSize:"24px",labelTextColor:o,valuePrefixTextColor:t,valueSuffixTextColor:t,valueTextColor:t}}const hw={name:"Statistic",common:W,self:pw},gw={stepHeaderFontSizeSmall:"14px",stepHeaderFontSizeMedium:"16px",indicatorIndexFontSizeSmall:"14px",indicatorIndexFontSizeMedium:"16px",indicatorSizeSmall:"22px",indicatorSizeMedium:"28px",indicatorIconSizeSmall:"14px",indicatorIconSizeMedium:"18px"};function mw(e){const{fontWeightStrong:t,baseColor:o,textColorDisabled:r,primaryColor:n,errorColor:i,textColor1:a,textColor2:l}=e;return Object.assign(Object.assign({},gw),{stepHeaderFontWeight:t,indicatorTextColorProcess:o,indicatorTextColorWait:r,indicatorTextColorFinish:n,indicatorTextColorError:i,indicatorBorderColorProcess:n,indicatorBorderColorWait:r,indicatorBorderColorFinish:n,indicatorBorderColorError:i,indicatorColorProcess:n,indicatorColorWait:"#0000",indicatorColorFinish:"#0000",indicatorColorError:"#0000",splitorColorProcess:r,splitorColorWait:r,splitorColorFinish:n,splitorColorError:r,headerTextColorProcess:a,headerTextColorWait:r,headerTextColorFinish:r,headerTextColorError:i,descriptionTextColorProcess:l,descriptionTextColorWait:r,descriptionTextColorFinish:r,descriptionTextColorError:i})}const bw={name:"Steps",common:W,self:mw},vw={buttonHeightSmall:"14px",buttonHeightMedium:"18px",buttonHeightLarge:"22px",buttonWidthSmall:"14px",buttonWidthMedium:"18px",buttonWidthLarge:"22px",buttonWidthPressedSmall:"20px",buttonWidthPressedMedium:"24px",buttonWidthPressedLarge:"28px",railHeightSmall:"18px",railHeightMedium:"22px",railHeightLarge:"26px",railWidthSmall:"32px",railWidthMedium:"40px",railWidthLarge:"48px"},xw={name:"Switch",common:W,self(e){const{primaryColorSuppl:t,opacityDisabled:o,borderRadius:r,primaryColor:n,textColor2:i,baseColor:a}=e;return Object.assign(Object.assign({},vw),{iconColor:a,textColor:i,loadingColor:t,opacityDisabled:o,railColor:"rgba(255, 255, 255, .20)",railColorActive:t,buttonBoxShadow:"0px 2px 4px 0 rgba(0, 0, 0, 0.4)",buttonColor:"#FFF",railBorderRadiusSmall:r,railBorderRadiusMedium:r,railBorderRadiusLarge:r,buttonBorderRadiusSmall:r,buttonBorderRadiusMedium:r,buttonBorderRadiusLarge:r,boxShadowFocus:`0 0 8px 0 ${K(n,{alpha:.3})}`})}},Cw={thPaddingSmall:"6px",thPaddingMedium:"12px",thPaddingLarge:"12px",tdPaddingSmall:"6px",tdPaddingMedium:"12px",tdPaddingLarge:"12px"};function yw(e){const{dividerColor:t,cardColor:o,modalColor:r,popoverColor:n,tableHeaderColor:i,tableColorStriped:a,textColor1:l,textColor2:s,borderRadius:c,fontWeightStrong:d,lineHeight:u,fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f}=e;return Object.assign(Object.assign({},Cw),{fontSizeSmall:p,fontSizeMedium:m,fontSizeLarge:f,lineHeight:u,borderRadius:c,borderColor:ee(o,t),borderColorModal:ee(r,t),borderColorPopover:ee(n,t),tdColor:o,tdColorModal:r,tdColorPopover:n,tdColorStriped:ee(o,a),tdColorStripedModal:ee(r,a),tdColorStripedPopover:ee(n,a),thColor:ee(o,i),thColorModal:ee(r,i),thColorPopover:ee(n,i),thTextColor:l,tdTextColor:s,thFontWeight:d})}const Sw={name:"Table",common:W,self:yw},ww={tabFontSizeSmall:"14px",tabFontSizeMedium:"14px",tabFontSizeLarge:"16px",tabGapSmallLine:"36px",tabGapMediumLine:"36px",tabGapLargeLine:"36px",tabGapSmallLineVertical:"8px",tabGapMediumLineVertical:"8px",tabGapLargeLineVertical:"8px",tabPaddingSmallLine:"6px 0",tabPaddingMediumLine:"10px 0",tabPaddingLargeLine:"14px 0",tabPaddingVerticalSmallLine:"6px 12px",tabPaddingVerticalMediumLine:"8px 16px",tabPaddingVerticalLargeLine:"10px 20px",tabGapSmallBar:"36px",tabGapMediumBar:"36px",tabGapLargeBar:"36px",tabGapSmallBarVertical:"8px",tabGapMediumBarVertical:"8px",tabGapLargeBarVertical:"8px",tabPaddingSmallBar:"4px 0",tabPaddingMediumBar:"6px 0",tabPaddingLargeBar:"10px 0",tabPaddingVerticalSmallBar:"6px 12px",tabPaddingVerticalMediumBar:"8px 16px",tabPaddingVerticalLargeBar:"10px 20px",tabGapSmallCard:"4px",tabGapMediumCard:"4px",tabGapLargeCard:"4px",tabGapSmallCardVertical:"4px",tabGapMediumCardVertical:"4px",tabGapLargeCardVertical:"4px",tabPaddingSmallCard:"8px 16px",tabPaddingMediumCard:"10px 20px",tabPaddingLargeCard:"12px 24px",tabPaddingSmallSegment:"4px 0",tabPaddingMediumSegment:"6px 0",tabPaddingLargeSegment:"8px 0",tabPaddingVerticalLargeSegment:"0 8px",tabPaddingVerticalSmallCard:"8px 12px",tabPaddingVerticalMediumCard:"10px 16px",tabPaddingVerticalLargeCard:"12px 20px",tabPaddingVerticalSmallSegment:"0 4px",tabPaddingVerticalMediumSegment:"0 6px",tabGapSmallSegment:"0",tabGapMediumSegment:"0",tabGapLargeSegment:"0",tabGapSmallSegmentVertical:"0",tabGapMediumSegmentVertical:"0",tabGapLargeSegmentVertical:"0",panePaddingSmall:"8px 0 0 0",panePaddingMedium:"12px 0 0 0",panePaddingLarge:"16px 0 0 0",closeSize:"18px",closeIconSize:"14px"};function Pw(e){const{textColor2:t,primaryColor:o,textColorDisabled:r,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,tabColor:c,baseColor:d,dividerColor:u,fontWeight:p,textColor1:m,borderRadius:f,fontSize:g,fontWeightStrong:S}=e;return Object.assign(Object.assign({},ww),{colorSegment:c,tabFontSizeCard:g,tabTextColorLine:m,tabTextColorActiveLine:o,tabTextColorHoverLine:o,tabTextColorDisabledLine:r,tabTextColorSegment:m,tabTextColorActiveSegment:t,tabTextColorHoverSegment:t,tabTextColorDisabledSegment:r,tabTextColorBar:m,tabTextColorActiveBar:o,tabTextColorHoverBar:o,tabTextColorDisabledBar:r,tabTextColorCard:m,tabTextColorHoverCard:m,tabTextColorActiveCard:o,tabTextColorDisabledCard:r,barColor:o,closeIconColor:n,closeIconColorHover:i,closeIconColorPressed:a,closeColorHover:l,closeColorPressed:s,closeBorderRadius:f,tabColor:c,tabColorSegment:d,tabBorderColor:u,tabFontWeightActive:p,tabFontWeight:p,tabBorderRadius:f,paneTextColor:t,fontWeightStrong:S})}const Tw={name:"Tabs",common:W,self(e){const t=Pw(e),{inputColor:o}=e;return t.colorSegment=o,t.tabColorSegment=o,t}};function $w(e){const{textColor1:t,textColor2:o,fontWeightStrong:r,fontSize:n}=e;return{fontSize:n,titleTextColor:t,textColor:o,titleFontWeight:r}}const Rw={name:"Thing",common:W,self:$w},Fw={titleMarginMedium:"0 0 6px 0",titleMarginLarge:"-2px 0 6px 0",titleFontSizeMedium:"14px",titleFontSizeLarge:"16px",iconSizeMedium:"14px",iconSizeLarge:"14px"},Aw={name:"Timeline",common:W,self(e){const{textColor3:t,infoColorSuppl:o,errorColorSuppl:r,successColorSuppl:n,warningColorSuppl:i,textColor1:a,textColor2:l,railColor:s,fontWeightStrong:c,fontSize:d}=e;return Object.assign(Object.assign({},Fw),{contentFontSize:d,titleFontWeight:c,circleBorder:`2px solid ${t}`,circleBorderInfo:`2px solid ${o}`,circleBorderError:`2px solid ${r}`,circleBorderSuccess:`2px solid ${n}`,circleBorderWarning:`2px solid ${i}`,iconColor:t,iconColorInfo:o,iconColorError:r,iconColorSuccess:n,iconColorWarning:i,titleTextColor:a,contentTextColor:l,metaTextColor:t,lineColor:s})}},Iw={extraFontSizeSmall:"12px",extraFontSizeMedium:"12px",extraFontSizeLarge:"14px",titleFontSizeSmall:"14px",titleFontSizeMedium:"16px",titleFontSizeLarge:"16px",closeSize:"20px",closeIconSize:"16px",headerHeightSmall:"44px",headerHeightMedium:"44px",headerHeightLarge:"50px"},_w={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:zt,Empty:ar,Button:wt},self(e){const{fontWeight:t,fontSizeLarge:o,fontSizeMedium:r,fontSizeSmall:n,heightLarge:i,heightMedium:a,borderRadius:l,inputColor:s,tableHeaderColor:c,textColor1:d,textColorDisabled:u,textColor2:p,textColor3:m,hoverColor:f,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T,dividerColor:w}=e;return Object.assign(Object.assign({},Iw),{itemHeightSmall:a,itemHeightMedium:a,itemHeightLarge:i,fontSizeSmall:n,fontSizeMedium:r,fontSizeLarge:o,borderRadius:l,dividerColor:w,borderColor:"#0000",listColor:s,headerColor:c,titleTextColor:d,titleTextColorDisabled:u,extraTextColor:m,extraTextColorDisabled:u,itemTextColor:p,itemTextColorDisabled:u,itemColorPending:f,titleFontWeight:t,closeColorHover:g,closeColorPressed:S,closeIconColor:v,closeIconColorHover:$,closeIconColorPressed:T})}};function Ew(e){const{borderRadiusSmall:t,dividerColor:o,hoverColor:r,pressedColor:n,primaryColor:i,textColor3:a,textColor2:l,textColorDisabled:s,fontSize:c}=e;return{fontSize:c,lineHeight:"1.5",nodeHeight:"30px",nodeWrapperPadding:"3px 0",nodeBorderRadius:t,nodeColorHover:r,nodeColorPressed:n,nodeColorActive:K(i,{alpha:.1}),arrowColor:a,nodeTextColor:l,nodeTextColorDisabled:s,loadingColor:i,dropMarkColor:i,lineColor:o}}const wf={name:"Tree",common:W,peers:{Checkbox:Hr,Scrollbar:St,Empty:ar},self(e){const{primaryColor:t}=e,o=Ew(e);return o.nodeColorActive=K(t,{alpha:.15}),o}},Mw={name:"TreeSelect",common:W,peers:{Tree:wf,Empty:ar,InternalSelection:Cl}},zw={headerFontSize1:"30px",headerFontSize2:"22px",headerFontSize3:"18px",headerFontSize4:"16px",headerFontSize5:"16px",headerFontSize6:"16px",headerMargin1:"28px 0 20px 0",headerMargin2:"28px 0 20px 0",headerMargin3:"28px 0 20px 0",headerMargin4:"28px 0 18px 0",headerMargin5:"28px 0 18px 0",headerMargin6:"28px 0 18px 0",headerPrefixWidth1:"16px",headerPrefixWidth2:"16px",headerPrefixWidth3:"12px",headerPrefixWidth4:"12px",headerPrefixWidth5:"12px",headerPrefixWidth6:"12px",headerBarWidth1:"4px",headerBarWidth2:"4px",headerBarWidth3:"3px",headerBarWidth4:"3px",headerBarWidth5:"3px",headerBarWidth6:"3px",pMargin:"16px 0 16px 0",liMargin:".25em 0 0 0",olPadding:"0 0 0 2em",ulPadding:"0 0 0 2em"};function Hw(e){const{primaryColor:t,textColor2:o,borderColor:r,lineHeight:n,fontSize:i,borderRadiusSmall:a,dividerColor:l,fontWeightStrong:s,textColor1:c,textColor3:d,infoColor:u,warningColor:p,errorColor:m,successColor:f,codeColor:g}=e;return Object.assign(Object.assign({},zw),{aTextColor:t,blockquoteTextColor:o,blockquotePrefixColor:r,blockquoteLineHeight:n,blockquoteFontSize:i,codeBorderRadius:a,liTextColor:o,liLineHeight:n,liFontSize:i,hrColor:l,headerFontWeight:s,headerTextColor:c,pTextColor:o,pTextColor1Depth:c,pTextColor2Depth:o,pTextColor3Depth:d,pLineHeight:n,pFontSize:i,headerBarColor:t,headerBarColorPrimary:t,headerBarColorInfo:u,headerBarColorError:m,headerBarColorWarning:p,headerBarColorSuccess:f,textColor:o,textColor1Depth:c,textColor2Depth:o,textColor3Depth:d,textColorPrimary:t,textColorInfo:u,textColorSuccess:f,textColorWarning:p,textColorError:m,codeTextColor:o,codeColor:g,codeBorder:"1px solid #0000"})}const kw={name:"Typography",common:W,self:Hw};function Dw(e){const{iconColor:t,primaryColor:o,errorColor:r,textColor2:n,successColor:i,opacityDisabled:a,actionColor:l,borderColor:s,hoverColor:c,lineHeight:d,borderRadius:u,fontSize:p}=e;return{fontSize:p,lineHeight:d,borderRadius:u,draggerColor:l,draggerBorder:`1px dashed ${s}`,draggerBorderHover:`1px dashed ${o}`,itemColorHover:c,itemColorHoverError:K(r,{alpha:.06}),itemTextColor:n,itemTextColorError:r,itemTextColorSuccess:i,itemIconColor:t,itemDisabledOpacity:a,itemBorderImageCardError:`1px solid ${r}`,itemBorderImageCard:`1px solid ${s}`}}const Ow={name:"Upload",common:W,peers:{Button:wt,Progress:yf},self(e){const{errorColor:t}=e,o=Dw(e);return o.itemColorHoverError=K(t,{alpha:.09}),o}},Bw={name:"Watermark",common:W,self(e){const{fontFamily:t}=e;return{fontFamily:t}}},Lw={name:"FloatButton",common:W,self(e){const{popoverColor:t,textColor2:o,buttonColor2Hover:r,buttonColor2Pressed:n,primaryColor:i,primaryColorHover:a,primaryColorPressed:l,baseColor:s,borderRadius:c}=e;return{color:t,textColor:o,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)",boxShadowHover:"0 2px 12px 0px rgba(0, 0, 0, .18)",boxShadowPressed:"0 2px 12px 0px rgba(0, 0, 0, .18)",colorHover:r,colorPressed:n,colorPrimary:i,colorPrimaryHover:a,colorPrimaryPressed:l,textColorPrimary:s,borderRadiusSquare:c}}},In="n-form",Pf="n-form-item-insts",Ww=pe("form",[re("inline",` width: 100%; display: inline-flex; align-items: flex-start; align-content: space-around; - `,[pe("form-item",{width:"auto",marginRight:"18px"},[L("&:last-child",{marginRight:0})])])]);var jw=function(e,t,o,r){function n(i){return i instanceof o?i:new o(function(a){a(i)})}return new(o||(o=Promise))(function(i,a){function l(d){try{c(r.next(d))}catch(u){a(u)}}function s(d){try{c(r.throw(d))}catch(u){a(u)}}function c(d){d.done?i(d.value):n(d.value).then(l,s)}c((r=r.apply(e,t||[])).next())})};const Nw=Object.assign(Object.assign({},Ct.props),{inline:Boolean,labelWidth:[Number,String],labelAlign:String,labelPlacement:{type:String,default:"top"},model:{type:Object,default:()=>{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),EP=He({name:"Form",props:Nw,setup(e){const{mergedClsPrefixRef:t}=Ao(e);Ct("Form","-form",Ww,xf,e,t);const o={},r=fe(void 0),n=s=>{const c=r.value;(c===void 0||s>=c)&&(r.value=s)};function i(s){return jw(this,arguments,void 0,function*(c,d=()=>!0){return yield new Promise((u,p)=>{const m=[];for(const f of Ms(o)){const g=o[f];for(const S of g)S.path&&m.push(S.internalValidate(null,d))}Promise.all(m).then(f=>{const g=f.some($=>!$.valid),S=[],v=[];f.forEach($=>{var T,w;!((T=$.errors)===null||T===void 0)&&T.length&&S.push($.errors),!((w=$.warnings)===null||w===void 0)&&w.length&&v.push($.warnings)}),c&&c(S.length?S:void 0,{warnings:v.length?v:void 0}),g?p(S.length?S:void 0):u({warnings:v.length?v:void 0})})})})}function a(){for(const s of Ms(o)){const c=o[s];for(const d of c)d.restoreValidation()}}return po(En,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:n}),po(Pf,{formItems:o}),Object.assign({validate:i,restoreValidation:a},{mergedClsPrefix:t})},render(){const{mergedClsPrefix:e}=this;return y("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ti(e,t,o){return qw()?ti=Reflect.construct.bind():ti=function(n,i,a){var l=[null];l.push.apply(l,i);var s=Function.bind.apply(n,l),c=new s;return a&&xn(c,a.prototype),c},ti.apply(null,arguments)}function Uw(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Ba(e){var t=typeof Map=="function"?new Map:void 0;return Ba=function(r){if(r===null||!Uw(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return ti(r,arguments,Da(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xn(n,r)},Ba(e)}var Gw=/%[sdj%]/g,Kw=function(){};function Oa(e){if(!e||!e.length)return null;var t={};return e.forEach(function(o){var r=o.field;t[r]=t[r]||[],t[r].push(o)}),t}function _t(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r=i)return l;switch(l){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch{return"[Circular]"}break;default:return l}});return a}return e}function Yw(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Je(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Yw(t)&&typeof e=="string"&&!e)}function Xw(e,t,o){var r=[],n=0,i=e.length;function a(l){r.push.apply(r,l||[]),n++,n===i&&o(r)}e.forEach(function(l){t(l,a)})}function Qs(e,t,o){var r=0,n=e.length;function i(a){if(a&&a.length){o(a);return}var l=r;r=r+1,l{}},rules:Object,disabled:Boolean,size:String,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:!0},onSubmit:{type:Function,default:e=>{e.preventDefault()}},showLabel:{type:Boolean,default:void 0},validateMessages:Object}),IP=He({name:"Form",props:Nw,setup(e){const{mergedClsPrefixRef:t}=zo(e);Ct("Form","-form",Ww,xf,e,t);const o={},r=fe(void 0),n=s=>{const c=r.value;(c===void 0||s>=c)&&(r.value=s)};function i(s){return jw(this,arguments,void 0,function*(c,d=()=>!0){return yield new Promise((u,p)=>{const m=[];for(const f of Es(o)){const g=o[f];for(const S of g)S.path&&m.push(S.internalValidate(null,d))}Promise.all(m).then(f=>{const g=f.some($=>!$.valid),S=[],v=[];f.forEach($=>{var T,w;!((T=$.errors)===null||T===void 0)&&T.length&&S.push($.errors),!((w=$.warnings)===null||w===void 0)&&w.length&&v.push($.warnings)}),c&&c(S.length?S:void 0,{warnings:v.length?v:void 0}),g?p(S.length?S:void 0):u({warnings:v.length?v:void 0})})})})}function a(){for(const s of Es(o)){const c=o[s];for(const d of c)d.restoreValidation()}}return po(In,{props:e,maxChildLabelWidthRef:r,deriveMaxChildLabelWidth:n}),po(Pf,{formItems:o}),Object.assign({validate:i,restoreValidation:a},{mergedClsPrefix:t})},render(){const{mergedClsPrefix:e}=this;return y("form",{class:[`${e}-form`,this.inline&&`${e}-form--inline`],onSubmit:this.onSubmit},this.$slots)}});function Ko(){return Ko=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function ti(e,t,o){return Uw()?ti=Reflect.construct.bind():ti=function(n,i,a){var l=[null];l.push.apply(l,i);var s=Function.bind.apply(n,l),c=new s;return a&&xn(c,a.prototype),c},ti.apply(null,arguments)}function qw(e){return Function.toString.call(e).indexOf("[native code]")!==-1}function Oa(e){var t=typeof Map=="function"?new Map:void 0;return Oa=function(r){if(r===null||!qw(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t<"u"){if(t.has(r))return t.get(r);t.set(r,n)}function n(){return ti(r,arguments,Da(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),xn(n,r)},Oa(e)}var Gw=/%[sdj%]/g,Kw=function(){};function Ba(e){if(!e||!e.length)return null;var t={};return e.forEach(function(o){var r=o.field;t[r]=t[r]||[],t[r].push(o)}),t}function At(e){for(var t=arguments.length,o=new Array(t>1?t-1:0),r=1;r=i)return l;switch(l){case"%s":return String(o[n++]);case"%d":return Number(o[n++]);case"%j":try{return JSON.stringify(o[n++])}catch{return"[Circular]"}break;default:return l}});return a}return e}function Yw(e){return e==="string"||e==="url"||e==="hex"||e==="email"||e==="date"||e==="pattern"}function Je(e,t){return!!(e==null||t==="array"&&Array.isArray(e)&&!e.length||Yw(t)&&typeof e=="string"&&!e)}function Xw(e,t,o){var r=[],n=0,i=e.length;function a(l){r.push.apply(r,l||[]),n++,n===i&&o(r)}e.forEach(function(l){t(l,a)})}function Qs(e,t,o){var r=0,n=e.length;function i(a){if(a&&a.length){o(a);return}var l=r;r=r+1,l()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},qr={integer:function(t){return qr.number(t)&&parseInt(t,10)===t},float:function(t){return qr.number(t)&&!qr.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!qr.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(rc.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(o2())},hex:function(t){return typeof t=="string"&&!!t.match(rc.hex)}},r2=function(t,o,r,n,i){if(t.required&&o===void 0){Tf(t,o,r,n,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=t.type;a.indexOf(l)>-1?qr[l](o)||n.push(_t(i.messages.types[l],t.fullField,t.type)):l&&typeof o!==t.type&&n.push(_t(i.messages.types[l],t.fullField,t.type))},n2=function(t,o,r,n,i){var a=typeof t.len=="number",l=typeof t.min=="number",s=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=o,u=null,p=typeof o=="number",m=typeof o=="string",f=Array.isArray(o);if(p?u="number":m?u="string":f&&(u="array"),!u)return!1;f&&(d=o.length),m&&(d=o.replace(c,"_").length),a?d!==t.len&&n.push(_t(i.messages[u].len,t.fullField,t.len)):l&&!s&&dt.max?n.push(_t(i.messages[u].max,t.fullField,t.max)):l&&s&&(dt.max)&&n.push(_t(i.messages[u].range,t.fullField,t.min,t.max))},ur="enum",i2=function(t,o,r,n,i){t[ur]=Array.isArray(t[ur])?t[ur]:[],t[ur].indexOf(o)===-1&&n.push(_t(i.messages[ur],t.fullField,t[ur].join(", ")))},a2=function(t,o,r,n,i){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(o)||n.push(_t(i.messages.pattern.mismatch,t.fullField,o,t.pattern));else if(typeof t.pattern=="string"){var a=new RegExp(t.pattern);a.test(o)||n.push(_t(i.messages.pattern.mismatch,t.fullField,o,t.pattern))}}},xe={required:Tf,whitespace:t2,type:r2,range:n2,enum:i2,pattern:a2},l2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i,"string"),Je(o,"string")||(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i),xe.pattern(t,o,n,a,i),t.whitespace===!0&&xe.whitespace(t,o,n,a,i))}r(a)},s2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},c2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o===""&&(o=void 0),Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},d2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},u2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),Je(o)||xe.type(t,o,n,a,i)}r(a)},f2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},p2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},h2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o==null&&!t.required)return r();xe.required(t,o,n,a,i,"array"),o!=null&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},g2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},m2="enum",b2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe[m2](t,o,n,a,i)}r(a)},v2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i),Je(o,"string")||xe.pattern(t,o,n,a,i)}r(a)},x2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"date")&&!t.required)return r();if(xe.required(t,o,n,a,i),!Je(o,"date")){var s;o instanceof Date?s=o:s=new Date(o),xe.type(t,s,n,a,i),s&&xe.range(t,s.getTime(),n,a,i)}}r(a)},C2=function(t,o,r,n,i){var a=[],l=Array.isArray(o)?"array":typeof o;xe.required(t,o,n,a,i,l),r(a)},aa=function(t,o,r,n,i){var a=t.type,l=[],s=t.required||!t.required&&n.hasOwnProperty(t.field);if(s){if(Je(o,a)&&!t.required)return r();xe.required(t,o,n,l,i,a),Je(o,a)||xe.type(t,o,n,l,i)}r(l)},y2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i)}r(a)},tn={string:l2,method:s2,number:c2,boolean:d2,regexp:u2,integer:f2,float:p2,array:h2,object:g2,enum:b2,pattern:v2,date:x2,url:aa,hex:aa,email:aa,required:C2,any:y2};function La(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Wa=La(),$r=function(){function e(o){this.rules=null,this._messages=Wa,this.define(o)}var t=e.prototype;return t.define=function(r){var n=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(i){var a=r[i];n.rules[i]=Array.isArray(a)?a:[a]})},t.messages=function(r){return r&&(this._messages=oc(La(),r)),this._messages},t.validate=function(r,n,i){var a=this;n===void 0&&(n={}),i===void 0&&(i=function(){});var l=r,s=n,c=i;if(typeof s=="function"&&(c=s,s={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,l),Promise.resolve(l);function d(g){var S=[],v={};function $(w){if(Array.isArray(w)){var z;S=(z=S).concat.apply(z,w)}else S.push(w)}for(var T=0;T()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+\.)+[a-zA-Z\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}))$/,hex:/^#?([a-f0-9]{6}|[a-f0-9]{3})$/i},Ur={integer:function(t){return Ur.number(t)&&parseInt(t,10)===t},float:function(t){return Ur.number(t)&&!Ur.integer(t)},array:function(t){return Array.isArray(t)},regexp:function(t){if(t instanceof RegExp)return!0;try{return!!new RegExp(t)}catch{return!1}},date:function(t){return typeof t.getTime=="function"&&typeof t.getMonth=="function"&&typeof t.getYear=="function"&&!isNaN(t.getTime())},number:function(t){return isNaN(t)?!1:typeof t=="number"},object:function(t){return typeof t=="object"&&!Ur.array(t)},method:function(t){return typeof t=="function"},email:function(t){return typeof t=="string"&&t.length<=320&&!!t.match(rc.email)},url:function(t){return typeof t=="string"&&t.length<=2048&&!!t.match(o2())},hex:function(t){return typeof t=="string"&&!!t.match(rc.hex)}},r2=function(t,o,r,n,i){if(t.required&&o===void 0){Tf(t,o,r,n,i);return}var a=["integer","float","array","regexp","object","method","email","number","date","url","hex"],l=t.type;a.indexOf(l)>-1?Ur[l](o)||n.push(At(i.messages.types[l],t.fullField,t.type)):l&&typeof o!==t.type&&n.push(At(i.messages.types[l],t.fullField,t.type))},n2=function(t,o,r,n,i){var a=typeof t.len=="number",l=typeof t.min=="number",s=typeof t.max=="number",c=/[\uD800-\uDBFF][\uDC00-\uDFFF]/g,d=o,u=null,p=typeof o=="number",m=typeof o=="string",f=Array.isArray(o);if(p?u="number":m?u="string":f&&(u="array"),!u)return!1;f&&(d=o.length),m&&(d=o.replace(c,"_").length),a?d!==t.len&&n.push(At(i.messages[u].len,t.fullField,t.len)):l&&!s&&dt.max?n.push(At(i.messages[u].max,t.fullField,t.max)):l&&s&&(dt.max)&&n.push(At(i.messages[u].range,t.fullField,t.min,t.max))},ur="enum",i2=function(t,o,r,n,i){t[ur]=Array.isArray(t[ur])?t[ur]:[],t[ur].indexOf(o)===-1&&n.push(At(i.messages[ur],t.fullField,t[ur].join(", ")))},a2=function(t,o,r,n,i){if(t.pattern){if(t.pattern instanceof RegExp)t.pattern.lastIndex=0,t.pattern.test(o)||n.push(At(i.messages.pattern.mismatch,t.fullField,o,t.pattern));else if(typeof t.pattern=="string"){var a=new RegExp(t.pattern);a.test(o)||n.push(At(i.messages.pattern.mismatch,t.fullField,o,t.pattern))}}},xe={required:Tf,whitespace:t2,type:r2,range:n2,enum:i2,pattern:a2},l2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i,"string"),Je(o,"string")||(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i),xe.pattern(t,o,n,a,i),t.whitespace===!0&&xe.whitespace(t,o,n,a,i))}r(a)},s2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},c2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o===""&&(o=void 0),Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},d2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},u2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),Je(o)||xe.type(t,o,n,a,i)}r(a)},f2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},p2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},h2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(o==null&&!t.required)return r();xe.required(t,o,n,a,i,"array"),o!=null&&(xe.type(t,o,n,a,i),xe.range(t,o,n,a,i))}r(a)},g2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe.type(t,o,n,a,i)}r(a)},m2="enum",b2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i),o!==void 0&&xe[m2](t,o,n,a,i)}r(a)},v2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"string")&&!t.required)return r();xe.required(t,o,n,a,i),Je(o,"string")||xe.pattern(t,o,n,a,i)}r(a)},x2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o,"date")&&!t.required)return r();if(xe.required(t,o,n,a,i),!Je(o,"date")){var s;o instanceof Date?s=o:s=new Date(o),xe.type(t,s,n,a,i),s&&xe.range(t,s.getTime(),n,a,i)}}r(a)},C2=function(t,o,r,n,i){var a=[],l=Array.isArray(o)?"array":typeof o;xe.required(t,o,n,a,i,l),r(a)},aa=function(t,o,r,n,i){var a=t.type,l=[],s=t.required||!t.required&&n.hasOwnProperty(t.field);if(s){if(Je(o,a)&&!t.required)return r();xe.required(t,o,n,l,i,a),Je(o,a)||xe.type(t,o,n,l,i)}r(l)},y2=function(t,o,r,n,i){var a=[],l=t.required||!t.required&&n.hasOwnProperty(t.field);if(l){if(Je(o)&&!t.required)return r();xe.required(t,o,n,a,i)}r(a)},tn={string:l2,method:s2,number:c2,boolean:d2,regexp:u2,integer:f2,float:p2,array:h2,object:g2,enum:b2,pattern:v2,date:x2,url:aa,hex:aa,email:aa,required:C2,any:y2};function La(){return{default:"Validation error on field %s",required:"%s is required",enum:"%s must be one of %s",whitespace:"%s cannot be empty",date:{format:"%s date %s is invalid for format %s",parse:"%s date could not be parsed, %s is invalid ",invalid:"%s date %s is invalid"},types:{string:"%s is not a %s",method:"%s is not a %s (function)",array:"%s is not an %s",object:"%s is not an %s",number:"%s is not a %s",date:"%s is not a %s",boolean:"%s is not a %s",integer:"%s is not an %s",float:"%s is not a %s",regexp:"%s is not a valid %s",email:"%s is not a valid %s",url:"%s is not a valid %s",hex:"%s is not a valid %s"},string:{len:"%s must be exactly %s characters",min:"%s must be at least %s characters",max:"%s cannot be longer than %s characters",range:"%s must be between %s and %s characters"},number:{len:"%s must equal %s",min:"%s cannot be less than %s",max:"%s cannot be greater than %s",range:"%s must be between %s and %s"},array:{len:"%s must be exactly %s in length",min:"%s cannot be less than %s in length",max:"%s cannot be greater than %s in length",range:"%s must be between %s and %s in length"},pattern:{mismatch:"%s value %s does not match pattern %s"},clone:function(){var t=JSON.parse(JSON.stringify(this));return t.clone=this.clone,t}}}var Wa=La(),$r=function(){function e(o){this.rules=null,this._messages=Wa,this.define(o)}var t=e.prototype;return t.define=function(r){var n=this;if(!r)throw new Error("Cannot configure a schema with no rules");if(typeof r!="object"||Array.isArray(r))throw new Error("Rules must be an object");this.rules={},Object.keys(r).forEach(function(i){var a=r[i];n.rules[i]=Array.isArray(a)?a:[a]})},t.messages=function(r){return r&&(this._messages=oc(La(),r)),this._messages},t.validate=function(r,n,i){var a=this;n===void 0&&(n={}),i===void 0&&(i=function(){});var l=r,s=n,c=i;if(typeof s=="function"&&(c=s,s={}),!this.rules||Object.keys(this.rules).length===0)return c&&c(null,l),Promise.resolve(l);function d(g){var S=[],v={};function $(w){if(Array.isArray(w)){var _;S=(_=S).concat.apply(_,w)}else S.push(w)}for(var T=0;Te.size!==void 0?e.size:(t==null?void 0:t.props.size)!==void 0?t.props.size:"medium")}}function T2(e){const t=Le(En,null),o=Y(()=>{const{labelPlacement:f}=e;return f!==void 0?f:t!=null&&t.props.labelPlacement?t.props.labelPlacement:"top"}),r=Y(()=>o.value==="left"&&(e.labelWidth==="auto"||(t==null?void 0:t.props.labelWidth)==="auto")),n=Y(()=>{if(o.value==="top")return;const{labelWidth:f}=e;if(f!==void 0&&f!=="auto")return oa(f);if(r.value){const g=t==null?void 0:t.maxChildLabelWidthRef.value;return g!==void 0?oa(g):void 0}if((t==null?void 0:t.props.labelWidth)!==void 0)return oa(t.props.labelWidth)}),i=Y(()=>{const{labelAlign:f}=e;if(f)return f;if(t!=null&&t.props.labelAlign)return t.props.labelAlign}),a=Y(()=>{var f;return[(f=e.labelProps)===null||f===void 0?void 0:f.style,e.labelStyle,{width:n.value}]}),l=Y(()=>{const{showRequireMark:f}=e;return f!==void 0?f:t==null?void 0:t.props.showRequireMark}),s=Y(()=>{const{requireMarkPlacement:f}=e;return f!==void 0?f:(t==null?void 0:t.props.requireMarkPlacement)||"right"}),c=fe(!1),d=fe(!1),u=Y(()=>{const{validationStatus:f}=e;if(f!==void 0)return f;if(c.value)return"error";if(d.value)return"warning"}),p=Y(()=>{const{showFeedback:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showFeedback)!==void 0?t.props.showFeedback:!0}),m=Y(()=>{const{showLabel:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showLabel)!==void 0?t.props.showLabel:!0});return{validationErrored:c,validationWarned:d,mergedLabelStyle:a,mergedLabelPlacement:o,mergedLabelAlign:i,mergedShowRequireMark:l,mergedRequireMarkPlacement:s,mergedValidationStatus:u,mergedShowFeedback:p,mergedShowLabel:m,isAutoLabelWidth:r}}function $2(e){const t=Le(En,null),o=Y(()=>{const{rulePath:a}=e;if(a!==void 0)return a;const{path:l}=e;if(l!==void 0)return l}),r=Y(()=>{const a=[],{rule:l}=e;if(l!==void 0&&(Array.isArray(l)?a.push(...l):a.push(l)),t){const{rules:s}=t.props,{value:c}=o;if(s!==void 0&&c!==void 0){const d=bu(s,c);d!==void 0&&(Array.isArray(d)?a.push(...d):a.push(d))}}return a}),n=Y(()=>r.value.some(a=>a.required)),i=Y(()=>n.value||e.required);return{mergedRules:r,mergedRequired:i}}var ic=function(e,t,o,r){function n(i){return i instanceof o?i:new o(function(a){a(i)})}return new(o||(o=Promise))(function(i,a){function l(d){try{c(r.next(d))}catch(u){a(u)}}function s(d){try{c(r.throw(d))}catch(u){a(u)}}function c(d){d.done?i(d.value):n(d.value).then(l,s)}c((r=r.apply(e,t||[])).next())})};const R2=Object.assign(Object.assign({},Ct.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object});function ac(e,t){return(...o)=>{try{const r=e(...o);return!t&&(typeof r=="boolean"||r instanceof Error||Array.isArray(r))||r!=null&&r.then?r:(r===void 0||_a("form-item/validate",`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(r){_a("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(r);return}}}const zP=He({name:"FormItem",props:R2,setup(e){Zm(Pf,"formItems",Dt(e,"path"));const{mergedClsPrefixRef:t,inlineThemeDisabled:o}=Ao(e),r=Le(En,null),n=P2(e),i=T2(e),{validationErrored:a,validationWarned:l}=i,{mergedRequired:s,mergedRules:c}=$2(e),{mergedSize:d}=n,{mergedLabelPlacement:u,mergedLabelAlign:p,mergedRequireMarkPlacement:m}=i,f=fe([]),g=fe($a()),S=r?Dt(r.props,"disabled"):fe(!1),v=Ct("Form","-form-item",w2,xf,e,t);Zt(Dt(e,"path"),()=>{e.ignorePathChange||$()});function $(){f.value=[],a.value=!1,l.value=!1,e.feedback&&(g.value=$a())}const T=(...G)=>ic(this,[...G],void 0,function*(le=null,te=()=>!0,N={suppressWarning:!0}){const{path:oe}=e;N?N.first||(N.first=e.first):N={};const{value:ye}=c,Pe=r?bu(r.props.model,oe||""):void 0,Re={},Fe={},Ve=(le?ye.filter(h=>Array.isArray(h.trigger)?h.trigger.includes(le):h.trigger===le):ye).filter(te).map((h,b)=>{const P=Object.assign({},h);if(P.validator&&(P.validator=ac(P.validator,!1)),P.asyncValidator&&(P.asyncValidator=ac(P.asyncValidator,!0)),P.renderMessage){const H=`__renderMessage__${b}`;Fe[H]=P.message,P.message=H,Re[H]=P.renderMessage}return P}),Ue=Ve.filter(h=>h.level!=="warning"),gt=Ve.filter(h=>h.level==="warning"),he={valid:!0,errors:void 0,warnings:void 0};if(!Ve.length)return he;const qe=oe??"__n_no_path__",rt=new $r({[qe]:Ue}),be=new $r({[qe]:gt}),{validateMessages:Ge}=(r==null?void 0:r.props)||{};Ge&&(rt.messages(Ge),be.messages(Ge));const Pt=h=>{f.value=h.map(b=>{const P=(b==null?void 0:b.message)||"";return{key:P,render:()=>P.startsWith("__renderMessage__")?Re[P]():P}}),h.forEach(b=>{var P;!((P=b.message)===null||P===void 0)&&P.startsWith("__renderMessage__")&&(b.message=Fe[b.message])})};if(Ue.length){const h=yield new Promise(b=>{rt.validate({[qe]:Pe},N,b)});h!=null&&h.length&&(he.valid=!1,he.errors=h,Pt(h))}if(gt.length&&!he.errors){const h=yield new Promise(b=>{be.validate({[qe]:Pe},N,b)});h!=null&&h.length&&(Pt(h),he.warnings=h)}return!he.errors&&!he.warnings?$():(a.value=!!he.errors,l.value=!!he.warnings),he});function w(){T("blur")}function z(){T("change")}function B(){T("focus")}function x(){T("input")}function F(G,le){return ic(this,void 0,void 0,function*(){let te,N,oe,ye;return typeof G=="string"?(te=G,N=le):G!==null&&typeof G=="object"&&(te=G.trigger,N=G.callback,oe=G.shouldRuleBeApplied,ye=G.options),yield new Promise((Pe,Re)=>{T(te,oe,ye).then(({valid:Fe,errors:Ve,warnings:Ue})=>{Fe?(N&&N(void 0,{warnings:Ue}),Pe({warnings:Ue})):(N&&N(Ve,{warnings:Ue}),Re(Ve))})})})}po(Ea,{path:Dt(e,"path"),disabled:S,mergedSize:n.mergedSize,mergedValidationStatus:i.mergedValidationStatus,restoreValidation:$,handleContentBlur:w,handleContentChange:z,handleContentFocus:B,handleContentInput:x});const R={validate:F,restoreValidation:$,internalValidate:T},O=fe(null);Io(()=>{if(!i.isAutoLabelWidth.value)return;const G=O.value;if(G!==null){const le=G.style.whiteSpace;G.style.whiteSpace="nowrap",G.style.width="",r==null||r.deriveMaxChildLabelWidth(Number(getComputedStyle(G).width.slice(0,-2))),G.style.whiteSpace=le}});const j=Y(()=>{var G;const{value:le}=d,{value:te}=u,N=te==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:oe},self:{labelTextColor:ye,asteriskColor:Pe,lineHeight:Re,feedbackTextColor:Fe,feedbackTextColorWarning:Ve,feedbackTextColorError:Ue,feedbackPadding:gt,labelFontWeight:he,[ae("labelHeight",le)]:qe,[ae("blankHeight",le)]:rt,[ae("feedbackFontSize",le)]:be,[ae("feedbackHeight",le)]:Ge,[ae("labelPadding",N)]:Pt,[ae("labelTextAlign",N)]:h,[ae(ae("labelFontSize",te),le)]:b}}=v.value;let P=(G=p.value)!==null&&G!==void 0?G:h;return te==="top"&&(P=P==="right"?"flex-end":"flex-start"),{"--n-bezier":oe,"--n-line-height":Re,"--n-blank-height":rt,"--n-label-font-size":b,"--n-label-text-align":P,"--n-label-height":qe,"--n-label-padding":Pt,"--n-label-font-weight":he,"--n-asterisk-color":Pe,"--n-label-text-color":ye,"--n-feedback-padding":gt,"--n-feedback-font-size":be,"--n-feedback-height":Ge,"--n-feedback-text-color":Fe,"--n-feedback-text-color-warning":Ve,"--n-feedback-text-color-error":Ue}}),_=o?Fr("form-item",Y(()=>{var G;return`${d.value[0]}${u.value[0]}${((G=p.value)===null||G===void 0?void 0:G[0])||""}`}),j,e):void 0,J=Y(()=>u.value==="left"&&m.value==="left"&&p.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:O,mergedClsPrefix:t,mergedRequired:s,feedbackId:g,renderExplains:f,reverseColSpace:J},i),n),R),{cssVars:o?void 0:j,themeClass:_==null?void 0:_.themeClass,onRender:_==null?void 0:_.onRender})},render(){const{$slots:e,mergedClsPrefix:t,mergedShowLabel:o,mergedShowRequireMark:r,mergedRequireMarkPlacement:n,onRender:i}=this,a=r!==void 0?r:this.mergedRequired;i==null||i();const l=()=>{const s=this.$slots.label?this.$slots.label():this.label;if(!s)return null;const c=y("span",{class:`${t}-form-item-label__text`},s),d=a?y("span",{class:`${t}-form-item-label__asterisk`},n!=="left"?" *":"* "):n==="right-hanging"&&y("span",{class:`${t}-form-item-label__asterisk-placeholder`}," *"),{labelProps:u}=this;return y("label",Object.assign({},u,{class:[u==null?void 0:u.class,`${t}-form-item-label`,`${t}-form-item-label--${n}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),n==="left"?[d,c]:[c,d])};return y("div",{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!o&&`${t}-form-item--no-label`],style:this.cssVars},o&&l(),y("div",{class:[`${t}-form-item-blank`,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`]},e),this.mergedShowFeedback?y("div",{key:this.feedbackId,style:this.feedbackStyle,class:[`${t}-form-item-feedback-wrapper`,this.feedbackClass]},y(un,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:s}=this;return $t(e.feedback,c=>{var d;const{feedback:u}=this,p=c||u?y("div",{key:"__feedback__",class:`${t}-form-item-feedback__line`},c||u):this.renderExplains.length?(d=this.renderExplains)===null||d===void 0?void 0:d.map(({key:m,render:f})=>y("div",{key:m,class:`${t}-form-item-feedback__line`},f())):null;return p?s==="warning"?y("div",{key:"controlled-warning",class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},p):s==="error"?y("div",{key:"controlled-error",class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},p):s==="success"?y("div",{key:"controlled-success",class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},p):y("div",{key:"controlled-default",class:`${t}-form-item-feedback`},p):null})}})):null)}});function F2(e){const{primaryColor:t,baseColor:o}=e;return{color:t,iconColor:o}}const _2={name:"IconWrapper",common:W,self:F2},E2={name:"Image",common:W,peers:{Tooltip:Di},self:e=>{const{textColor2:t}=e;return{toolbarIconColor:t,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},z2={extraFontSize:"12px",width:"440px"},M2={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:At,Empty:ar,Button:wt},self(e){const{iconColorDisabled:t,iconColor:o,fontWeight:r,fontSizeLarge:n,fontSizeMedium:i,fontSizeSmall:a,heightLarge:l,heightMedium:s,heightSmall:c,borderRadius:d,inputColor:u,tableHeaderColor:p,textColor1:m,textColorDisabled:f,textColor2:g,hoverColor:S}=e;return Object.assign(Object.assign({},z2),{itemHeightSmall:c,itemHeightMedium:s,itemHeightLarge:l,fontSizeSmall:a,fontSizeMedium:i,fontSizeLarge:n,borderRadius:d,borderColor:"#0000",listColor:u,headerColor:p,titleTextColor:m,titleTextColorDisabled:f,extraTextColor:g,filterDividerColor:"#0000",itemTextColor:g,itemTextColorDisabled:f,itemColorPending:S,titleFontWeight:r,iconColor:o,iconColorDisabled:t})}};function I2(){return{}}const A2={name:"Marquee",common:W,self:I2},H2={name:"QrCode",common:W,self:e=>({borderRadius:e.borderRadius})},k2={name:"Skeleton",common:W,self(e){const{heightSmall:t,heightMedium:o,heightLarge:r,borderRadius:n}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:n,heightSmall:t,heightMedium:o,heightLarge:r}}},D2={name:"Split",common:W},B2=()=>({}),O2={name:"Equation",common:W,self:B2},L2={name:"FloatButtonGroup",common:W,self(e){const{popoverColor:t,dividerColor:o,borderRadius:r}=e;return{color:t,buttonBorderColor:o,borderRadiusSquare:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},MP={name:"dark",common:W,Alert:Uy,Anchor:Zy,AutoComplete:l1,Avatar:qu,AvatarGroup:d1,BackTop:f1,Badge:p1,Breadcrumb:m1,Button:wt,ButtonGroup:LS,Calendar:P1,Card:Ku,Carousel:z1,Cascader:H1,Checkbox:Hr,Code:Xu,Collapse:D1,CollapseTransition:O1,ColorPicker:W1,DataTable:oS,DatePicker:lS,Descriptions:dS,Dialog:pf,Divider:ES,Drawer:MS,Dropdown:yl,DynamicInput:AS,DynamicTags:kS,Element:DS,Empty:ar,Ellipsis:nf,Equation:O2,Flex:OS,Form:jS,GradientText:NS,Icon:rS,IconWrapper:_2,Image:E2,Input:At,InputNumber:VS,LegacyTransfer:M2,Layout:qS,List:KS,LoadingBar:gS,Log:YS,Menu:QS,Mention:XS,Message:xS,Modal:hS,Notification:FS,PageHeader:ow,Pagination:tf,Popconfirm:nw,Popover:lr,Popselect:Ju,Progress:yf,QrCode:H2,Radio:lf,Rate:aw,Result:cw,Row:US,Scrollbar:St,Select:Qu,Skeleton:k2,Slider:uw,Space:bf,Spin:fw,Statistic:hw,Steps:bw,Switch:xw,Table:Sw,Tabs:Tw,Tag:Lu,Thing:Rw,TimePicker:uf,Timeline:_w,Tooltip:Di,Transfer:zw,Tree:wf,TreeSelect:Iw,Typography:kw,Upload:Bw,Watermark:Ow,Split:D2,FloatButton:Lw,FloatButtonGroup:L2,Marquee:A2};function Wo(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function IP(){const e=Wo("--bg","#0b1020"),t=Wo("--fg","#e2e8f0"),o=Wo("--fg-dim","#94a3b8"),r=Wo("--panel","#0f172a"),n=Wo("--border","#1e293b"),i=Wo("--accent","#60a5fa"),a=Wo("--bad","#f87171");return{common:{bodyColor:e,textColorBase:t,textColor1:t,textColor2:t,textColor3:o,primaryColor:i,primaryColorHover:i,primaryColorPressed:i,borderColor:n,cardColor:r,errorColor:a}}}const AP=Y(()=>Pn.value==="zh-CN"?{locale:Mb,dateLocale:qv}:{locale:Qd,dateLocale:tu});function HP(){return{t:fo,languageOptions:Gg,localePreference:Fi,resolvedLocale:Pn,setLocalePreference:Kg}}export{sP as $,Tn as A,y1 as B,fy as C,b1 as D,gy as E,et as F,_n as G,L as H,vy as I,pe as J,fP as K,V as L,gu as M,Eu as N,re as O,Po as P,Ke as Q,cC as R,Hu as S,ch as T,Ys as U,Fa as V,Cy as W,yP as X,K as Y,I1 as Z,pp as _,pt as a,Ei as a$,Ro as a0,_s as a1,ko as a2,By as a3,qy as a4,HS as a5,vw as a6,ee as a7,Y as a8,Qt as a9,$y as aA,nP as aB,oa as aC,bu as aD,Sn as aE,Fp as aF,Db as aG,hP as aH,Vo as aI,IP as aJ,hl as aK,Em as aL,y as aM,K2 as aN,TP as aO,vn as aP,iu as aQ,rP as aR,Le as aS,ki as aT,Rm as aU,Fm as aV,Bu as aW,Wy as aX,za as aY,Pr as aZ,ml as a_,oP as aa,yd as ab,va as ac,J2 as ad,Y2 as ae,$a as af,mP as ag,ae as ah,X2 as ai,xa as aj,vP as ak,ht as al,bn as am,MP as an,PP as ao,$P as ap,He as aq,ms as ar,Oe as as,Y1 as at,W2 as au,Z1 as av,xl as aw,hv as ax,Mi as ay,Yy as az,Sm as b,As as b$,uu as b0,au as b1,Mx as b2,lu as b3,iP as b4,Ym as b5,ir as b6,Er as b7,su as b8,gr as b9,FP as bA,Ar as bB,V1 as bC,po as bD,pP as bE,eS as bF,Ci as bG,el as bH,fe as bI,_b as bJ,G2 as bK,vh as bL,gP as bM,Ir as bN,Fs as bO,q2 as bP,U2 as bQ,Qr as bR,Eb as bS,$t as bT,ho as bU,_r as bV,lP as bW,q1 as bX,Kg as bY,_c as bZ,_P as b_,ot as ba,Bb as bb,zb as bc,pu as bd,Ms as be,aP as bf,da as bg,Sd as bh,mS as bi,AP as bj,nn as bk,Ga as bl,Ua as bm,lo as bn,Fb as bo,Go as bp,Kc as bq,Pi as br,nr as bs,Yc as bt,Io as bu,j2 as bv,Zc as bw,ba as bx,Tx as by,G1 as bz,Ho as c,fo as c0,Rb as c1,iS as c2,Hb as c3,Rp as c4,dC as c5,we as c6,Dt as c7,N2 as c8,d0 as c9,tP as cA,eP as cB,J1 as ca,Xp as cb,Ao as cc,Zd as cd,HP as ce,ly as cf,hn as cg,bP as ch,Km as ci,$n as cj,zi as ck,Mr as cl,Ct as cm,Fr as cn,Ag as co,Q2 as cp,Hg as cq,kg as cr,ls as cs,Z2 as ct,cP as cu,_a as cv,Zt as cw,sn as cx,lh as cy,V2 as cz,Tr as d,vl as e,Oy as f,SP as g,wP as h,zu as i,EP as j,zP as k,Hi as l,CP as m,RP as n,zr as o,xy as p,wr as q,$i as r,un as s,Is as t,xP as u,dP as v,Px as w,o0 as x,ry as y,uC as z}; + `),pe("form-item-feedback",{transition:"color .3s var(--n-bezier)",color:"var(--n-feedback-text-color)"},[re("warning",{color:"var(--n-feedback-text-color-warning)"}),re("error",{color:"var(--n-feedback-text-color-error)"}),S2({fromOffset:"-3px",enterDuration:".3s",leaveDuration:".2s"})])])]);function P2(e){const t=Le(In,null);return{mergedSize:Y(()=>e.size!==void 0?e.size:(t==null?void 0:t.props.size)!==void 0?t.props.size:"medium")}}function T2(e){const t=Le(In,null),o=Y(()=>{const{labelPlacement:f}=e;return f!==void 0?f:t!=null&&t.props.labelPlacement?t.props.labelPlacement:"top"}),r=Y(()=>o.value==="left"&&(e.labelWidth==="auto"||(t==null?void 0:t.props.labelWidth)==="auto")),n=Y(()=>{if(o.value==="top")return;const{labelWidth:f}=e;if(f!==void 0&&f!=="auto")return oa(f);if(r.value){const g=t==null?void 0:t.maxChildLabelWidthRef.value;return g!==void 0?oa(g):void 0}if((t==null?void 0:t.props.labelWidth)!==void 0)return oa(t.props.labelWidth)}),i=Y(()=>{const{labelAlign:f}=e;if(f)return f;if(t!=null&&t.props.labelAlign)return t.props.labelAlign}),a=Y(()=>{var f;return[(f=e.labelProps)===null||f===void 0?void 0:f.style,e.labelStyle,{width:n.value}]}),l=Y(()=>{const{showRequireMark:f}=e;return f!==void 0?f:t==null?void 0:t.props.showRequireMark}),s=Y(()=>{const{requireMarkPlacement:f}=e;return f!==void 0?f:(t==null?void 0:t.props.requireMarkPlacement)||"right"}),c=fe(!1),d=fe(!1),u=Y(()=>{const{validationStatus:f}=e;if(f!==void 0)return f;if(c.value)return"error";if(d.value)return"warning"}),p=Y(()=>{const{showFeedback:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showFeedback)!==void 0?t.props.showFeedback:!0}),m=Y(()=>{const{showLabel:f}=e;return f!==void 0?f:(t==null?void 0:t.props.showLabel)!==void 0?t.props.showLabel:!0});return{validationErrored:c,validationWarned:d,mergedLabelStyle:a,mergedLabelPlacement:o,mergedLabelAlign:i,mergedShowRequireMark:l,mergedRequireMarkPlacement:s,mergedValidationStatus:u,mergedShowFeedback:p,mergedShowLabel:m,isAutoLabelWidth:r}}function $2(e){const t=Le(In,null),o=Y(()=>{const{rulePath:a}=e;if(a!==void 0)return a;const{path:l}=e;if(l!==void 0)return l}),r=Y(()=>{const a=[],{rule:l}=e;if(l!==void 0&&(Array.isArray(l)?a.push(...l):a.push(l)),t){const{rules:s}=t.props,{value:c}=o;if(s!==void 0&&c!==void 0){const d=bu(s,c);d!==void 0&&(Array.isArray(d)?a.push(...d):a.push(d))}}return a}),n=Y(()=>r.value.some(a=>a.required)),i=Y(()=>n.value||e.required);return{mergedRules:r,mergedRequired:i}}var ic=function(e,t,o,r){function n(i){return i instanceof o?i:new o(function(a){a(i)})}return new(o||(o=Promise))(function(i,a){function l(d){try{c(r.next(d))}catch(u){a(u)}}function s(d){try{c(r.throw(d))}catch(u){a(u)}}function c(d){d.done?i(d.value):n(d.value).then(l,s)}c((r=r.apply(e,t||[])).next())})};const R2=Object.assign(Object.assign({},Ct.props),{label:String,labelWidth:[Number,String],labelStyle:[String,Object],labelAlign:String,labelPlacement:String,path:String,first:Boolean,rulePath:String,required:Boolean,showRequireMark:{type:Boolean,default:void 0},requireMarkPlacement:String,showFeedback:{type:Boolean,default:void 0},rule:[Object,Array],size:String,ignorePathChange:Boolean,validationStatus:String,feedback:String,feedbackClass:String,feedbackStyle:[String,Object],showLabel:{type:Boolean,default:void 0},labelProps:Object});function ac(e,t){return(...o)=>{try{const r=e(...o);return!t&&(typeof r=="boolean"||r instanceof Error||Array.isArray(r))||r!=null&&r.then?r:(r===void 0||Aa("form-item/validate",`You return a ${typeof r} typed value in the validator method, which is not recommended. Please use ${t?"`Promise`":"`boolean`, `Error` or `Promise`"} typed value instead.`),!0)}catch(r){Aa("form-item/validate","An error is catched in the validation, so the validation won't be done. Your callback in `validate` method of `n-form` or `n-form-item` won't be called in this validation."),console.error(r);return}}}const _P=He({name:"FormItem",props:R2,setup(e){Zm(Pf,"formItems",Dt(e,"path"));const{mergedClsPrefixRef:t,inlineThemeDisabled:o}=zo(e),r=Le(In,null),n=P2(e),i=T2(e),{validationErrored:a,validationWarned:l}=i,{mergedRequired:s,mergedRules:c}=$2(e),{mergedSize:d}=n,{mergedLabelPlacement:u,mergedLabelAlign:p,mergedRequireMarkPlacement:m}=i,f=fe([]),g=fe($a()),S=r?Dt(r.props,"disabled"):fe(!1),v=Ct("Form","-form-item",w2,xf,e,t);Zt(Dt(e,"path"),()=>{e.ignorePathChange||$()});function $(){f.value=[],a.value=!1,l.value=!1,e.feedback&&(g.value=$a())}const T=(...G)=>ic(this,[...G],void 0,function*(le=null,te=()=>!0,N={suppressWarning:!0}){const{path:oe}=e;N?N.first||(N.first=e.first):N={};const{value:ye}=c,Pe=r?bu(r.props.model,oe||""):void 0,Re={},Fe={},Ve=(le?ye.filter(h=>Array.isArray(h.trigger)?h.trigger.includes(le):h.trigger===le):ye).filter(te).map((h,b)=>{const P=Object.assign({},h);if(P.validator&&(P.validator=ac(P.validator,!1)),P.asyncValidator&&(P.asyncValidator=ac(P.asyncValidator,!0)),P.renderMessage){const H=`__renderMessage__${b}`;Fe[H]=P.message,P.message=H,Re[H]=P.renderMessage}return P}),qe=Ve.filter(h=>h.level!=="warning"),gt=Ve.filter(h=>h.level==="warning"),he={valid:!0,errors:void 0,warnings:void 0};if(!Ve.length)return he;const Ue=oe??"__n_no_path__",rt=new $r({[Ue]:qe}),be=new $r({[Ue]:gt}),{validateMessages:Ge}=(r==null?void 0:r.props)||{};Ge&&(rt.messages(Ge),be.messages(Ge));const Pt=h=>{f.value=h.map(b=>{const P=(b==null?void 0:b.message)||"";return{key:P,render:()=>P.startsWith("__renderMessage__")?Re[P]():P}}),h.forEach(b=>{var P;!((P=b.message)===null||P===void 0)&&P.startsWith("__renderMessage__")&&(b.message=Fe[b.message])})};if(qe.length){const h=yield new Promise(b=>{rt.validate({[Ue]:Pe},N,b)});h!=null&&h.length&&(he.valid=!1,he.errors=h,Pt(h))}if(gt.length&&!he.errors){const h=yield new Promise(b=>{be.validate({[Ue]:Pe},N,b)});h!=null&&h.length&&(Pt(h),he.warnings=h)}return!he.errors&&!he.warnings?$():(a.value=!!he.errors,l.value=!!he.warnings),he});function w(){T("blur")}function _(){T("change")}function O(){T("focus")}function x(){T("input")}function F(G,le){return ic(this,void 0,void 0,function*(){let te,N,oe,ye;return typeof G=="string"?(te=G,N=le):G!==null&&typeof G=="object"&&(te=G.trigger,N=G.callback,oe=G.shouldRuleBeApplied,ye=G.options),yield new Promise((Pe,Re)=>{T(te,oe,ye).then(({valid:Fe,errors:Ve,warnings:qe})=>{Fe?(N&&N(void 0,{warnings:qe}),Pe({warnings:qe})):(N&&N(Ve,{warnings:qe}),Re(Ve))})})})}po(Ia,{path:Dt(e,"path"),disabled:S,mergedSize:n.mergedSize,mergedValidationStatus:i.mergedValidationStatus,restoreValidation:$,handleContentBlur:w,handleContentChange:_,handleContentFocus:O,handleContentInput:x});const R={validate:F,restoreValidation:$,internalValidate:T},B=fe(null);Mo(()=>{if(!i.isAutoLabelWidth.value)return;const G=B.value;if(G!==null){const le=G.style.whiteSpace;G.style.whiteSpace="nowrap",G.style.width="",r==null||r.deriveMaxChildLabelWidth(Number(getComputedStyle(G).width.slice(0,-2))),G.style.whiteSpace=le}});const j=Y(()=>{var G;const{value:le}=d,{value:te}=u,N=te==="top"?"vertical":"horizontal",{common:{cubicBezierEaseInOut:oe},self:{labelTextColor:ye,asteriskColor:Pe,lineHeight:Re,feedbackTextColor:Fe,feedbackTextColorWarning:Ve,feedbackTextColorError:qe,feedbackPadding:gt,labelFontWeight:he,[ae("labelHeight",le)]:Ue,[ae("blankHeight",le)]:rt,[ae("feedbackFontSize",le)]:be,[ae("feedbackHeight",le)]:Ge,[ae("labelPadding",N)]:Pt,[ae("labelTextAlign",N)]:h,[ae(ae("labelFontSize",te),le)]:b}}=v.value;let P=(G=p.value)!==null&&G!==void 0?G:h;return te==="top"&&(P=P==="right"?"flex-end":"flex-start"),{"--n-bezier":oe,"--n-line-height":Re,"--n-blank-height":rt,"--n-label-font-size":b,"--n-label-text-align":P,"--n-label-height":Ue,"--n-label-padding":Pt,"--n-label-font-weight":he,"--n-asterisk-color":Pe,"--n-label-text-color":ye,"--n-feedback-padding":gt,"--n-feedback-font-size":be,"--n-feedback-height":Ge,"--n-feedback-text-color":Fe,"--n-feedback-text-color-warning":Ve,"--n-feedback-text-color-error":qe}}),A=o?Fr("form-item",Y(()=>{var G;return`${d.value[0]}${u.value[0]}${((G=p.value)===null||G===void 0?void 0:G[0])||""}`}),j,e):void 0,J=Y(()=>u.value==="left"&&m.value==="left"&&p.value==="left");return Object.assign(Object.assign(Object.assign(Object.assign({labelElementRef:B,mergedClsPrefix:t,mergedRequired:s,feedbackId:g,renderExplains:f,reverseColSpace:J},i),n),R),{cssVars:o?void 0:j,themeClass:A==null?void 0:A.themeClass,onRender:A==null?void 0:A.onRender})},render(){const{$slots:e,mergedClsPrefix:t,mergedShowLabel:o,mergedShowRequireMark:r,mergedRequireMarkPlacement:n,onRender:i}=this,a=r!==void 0?r:this.mergedRequired;i==null||i();const l=()=>{const s=this.$slots.label?this.$slots.label():this.label;if(!s)return null;const c=y("span",{class:`${t}-form-item-label__text`},s),d=a?y("span",{class:`${t}-form-item-label__asterisk`},n!=="left"?" *":"* "):n==="right-hanging"&&y("span",{class:`${t}-form-item-label__asterisk-placeholder`}," *"),{labelProps:u}=this;return y("label",Object.assign({},u,{class:[u==null?void 0:u.class,`${t}-form-item-label`,`${t}-form-item-label--${n}-mark`,this.reverseColSpace&&`${t}-form-item-label--reverse-columns-space`],style:this.mergedLabelStyle,ref:"labelElementRef"}),n==="left"?[d,c]:[c,d])};return y("div",{class:[`${t}-form-item`,this.themeClass,`${t}-form-item--${this.mergedSize}-size`,`${t}-form-item--${this.mergedLabelPlacement}-labelled`,this.isAutoLabelWidth&&`${t}-form-item--auto-label-width`,!o&&`${t}-form-item--no-label`],style:this.cssVars},o&&l(),y("div",{class:[`${t}-form-item-blank`,this.mergedValidationStatus&&`${t}-form-item-blank--${this.mergedValidationStatus}`]},e),this.mergedShowFeedback?y("div",{key:this.feedbackId,style:this.feedbackStyle,class:[`${t}-form-item-feedback-wrapper`,this.feedbackClass]},y(un,{name:"fade-down-transition",mode:"out-in"},{default:()=>{const{mergedValidationStatus:s}=this;return $t(e.feedback,c=>{var d;const{feedback:u}=this,p=c||u?y("div",{key:"__feedback__",class:`${t}-form-item-feedback__line`},c||u):this.renderExplains.length?(d=this.renderExplains)===null||d===void 0?void 0:d.map(({key:m,render:f})=>y("div",{key:m,class:`${t}-form-item-feedback__line`},f())):null;return p?s==="warning"?y("div",{key:"controlled-warning",class:`${t}-form-item-feedback ${t}-form-item-feedback--warning`},p):s==="error"?y("div",{key:"controlled-error",class:`${t}-form-item-feedback ${t}-form-item-feedback--error`},p):s==="success"?y("div",{key:"controlled-success",class:`${t}-form-item-feedback ${t}-form-item-feedback--success`},p):y("div",{key:"controlled-default",class:`${t}-form-item-feedback`},p):null})}})):null)}});function F2(e){const{primaryColor:t,baseColor:o}=e;return{color:t,iconColor:o}}const A2={name:"IconWrapper",common:W,self:F2},I2={name:"Image",common:W,peers:{Tooltip:Di},self:e=>{const{textColor2:t}=e;return{toolbarIconColor:t,toolbarColor:"rgba(0, 0, 0, .35)",toolbarBoxShadow:"none",toolbarBorderRadius:"24px"}}},_2={extraFontSize:"12px",width:"440px"},E2={name:"Transfer",common:W,peers:{Checkbox:Hr,Scrollbar:St,Input:zt,Empty:ar,Button:wt},self(e){const{iconColorDisabled:t,iconColor:o,fontWeight:r,fontSizeLarge:n,fontSizeMedium:i,fontSizeSmall:a,heightLarge:l,heightMedium:s,heightSmall:c,borderRadius:d,inputColor:u,tableHeaderColor:p,textColor1:m,textColorDisabled:f,textColor2:g,hoverColor:S}=e;return Object.assign(Object.assign({},_2),{itemHeightSmall:c,itemHeightMedium:s,itemHeightLarge:l,fontSizeSmall:a,fontSizeMedium:i,fontSizeLarge:n,borderRadius:d,borderColor:"#0000",listColor:u,headerColor:p,titleTextColor:m,titleTextColorDisabled:f,extraTextColor:g,filterDividerColor:"#0000",itemTextColor:g,itemTextColorDisabled:f,itemColorPending:S,titleFontWeight:r,iconColor:o,iconColorDisabled:t})}};function M2(){return{}}const z2={name:"Marquee",common:W,self:M2},H2={name:"QrCode",common:W,self:e=>({borderRadius:e.borderRadius})},k2={name:"Skeleton",common:W,self(e){const{heightSmall:t,heightMedium:o,heightLarge:r,borderRadius:n}=e;return{color:"rgba(255, 255, 255, 0.12)",colorEnd:"rgba(255, 255, 255, 0.18)",borderRadius:n,heightSmall:t,heightMedium:o,heightLarge:r}}},D2={name:"Split",common:W},O2=()=>({}),B2={name:"Equation",common:W,self:O2},L2={name:"FloatButtonGroup",common:W,self(e){const{popoverColor:t,dividerColor:o,borderRadius:r}=e;return{color:t,buttonBorderColor:o,borderRadiusSquare:r,boxShadow:"0 2px 8px 0px rgba(0, 0, 0, .12)"}}},EP={name:"dark",common:W,Alert:qy,Anchor:Zy,AutoComplete:l1,Avatar:Uu,AvatarGroup:d1,BackTop:f1,Badge:p1,Breadcrumb:m1,Button:wt,ButtonGroup:LS,Calendar:P1,Card:Ku,Carousel:_1,Cascader:H1,Checkbox:Hr,Code:Xu,Collapse:D1,CollapseTransition:B1,ColorPicker:W1,DataTable:oS,DatePicker:lS,Descriptions:dS,Dialog:pf,Divider:IS,Drawer:ES,Dropdown:yl,DynamicInput:zS,DynamicTags:kS,Element:DS,Empty:ar,Ellipsis:nf,Equation:B2,Flex:BS,Form:jS,GradientText:NS,Icon:rS,IconWrapper:A2,Image:I2,Input:zt,InputNumber:VS,LegacyTransfer:E2,Layout:US,List:KS,LoadingBar:gS,Log:YS,Menu:QS,Mention:XS,Message:xS,Modal:hS,Notification:FS,PageHeader:ow,Pagination:tf,Popconfirm:nw,Popover:lr,Popselect:Ju,Progress:yf,QrCode:H2,Radio:lf,Rate:aw,Result:cw,Row:qS,Scrollbar:St,Select:Qu,Skeleton:k2,Slider:uw,Space:bf,Spin:fw,Statistic:hw,Steps:bw,Switch:xw,Table:Sw,Tabs:Tw,Tag:Lu,Thing:Rw,TimePicker:uf,Timeline:Aw,Tooltip:Di,Transfer:_w,Tree:wf,TreeSelect:Mw,Typography:kw,Upload:Ow,Watermark:Bw,Split:D2,FloatButton:Lw,FloatButtonGroup:L2,Marquee:z2};function Wo(e,t){return typeof document>"u"?t:getComputedStyle(document.documentElement).getPropertyValue(e).trim()||t}function MP(){const e=Wo("--bg","#0b1020"),t=Wo("--fg","#e2e8f0"),o=Wo("--fg-dim","#94a3b8"),r=Wo("--panel","#0f172a"),n=Wo("--border","#1e293b"),i=Wo("--accent","#60a5fa"),a=Wo("--bad","#f87171");return{common:{bodyColor:e,textColorBase:t,textColor1:t,textColor2:t,textColor3:o,primaryColor:i,primaryColorHover:i,primaryColorPressed:i,borderColor:n,cardColor:r,errorColor:a}}}const zP=Y(()=>Pn.value==="zh-CN"?{locale:Eb,dateLocale:Uv}:{locale:Qd,dateLocale:tu});function HP(){return{t:fo,languageOptions:Gg,localePreference:Fi,resolvedLocale:Pn,setLocalePreference:Kg}}export{Ro as $,Tn as A,y1 as B,fy as C,An as D,gy as E,et as F,L as G,pe as H,vy as I,fP as J,V as K,re as L,gu as M,Iu as N,Po as O,Ke as P,cC as Q,K as R,Hu as S,ch as T,Ys as U,Fa as V,Cy as W,yP as X,M1 as Y,sP as Z,pp as _,pt as a,uu as a$,As as a0,ko as a1,Oy as a2,Uy as a3,HS as a4,vw as a5,ee as a6,Y as a7,Qt as a8,oP as a9,nP as aA,oa as aB,bu as aC,Sn as aD,Fp as aE,Db as aF,hP as aG,Vo as aH,MP as aI,hl as aJ,Im as aK,y as aL,K2 as aM,TP as aN,vn as aO,iu as aP,rP as aQ,Le as aR,ki as aS,Rm as aT,Fm as aU,Ou as aV,Wy as aW,_a as aX,Pr as aY,ml as aZ,Ii as a_,yd as aa,va as ab,J2 as ac,Y2 as ad,$a as ae,mP as af,ae as ag,X2 as ah,xa as ai,vP as aj,ht as ak,bn as al,EP as am,PP as an,$P as ao,He as ap,ms as aq,Be as ar,Y1 as as,W2 as at,Z1 as au,xl as av,hv as aw,Ei as ax,Yy as ay,$y as az,Sm as b,fo as b$,au as b0,Ex as b1,lu as b2,iP as b3,Ym as b4,ir as b5,Ir as b6,su as b7,gr as b8,ot as b9,zr as bA,V1 as bB,po as bC,pP as bD,eS as bE,Ci as bF,el as bG,fe as bH,Ab as bI,G2 as bJ,vh as bK,gP as bL,Mr as bM,Fs as bN,U2 as bO,q2 as bP,Qr as bQ,Ib as bR,$t as bS,ho as bT,Ar as bU,lP as bV,U1 as bW,Kg as bX,Ac as bY,AP as bZ,zs as b_,Ob as ba,_b as bb,pu as bc,Es as bd,aP as be,da as bf,Sd as bg,mS as bh,zP as bi,nn as bj,Ga as bk,qa as bl,lo as bm,Fb as bn,Go as bo,Kc as bp,Pi as bq,nr as br,Yc as bs,Mo as bt,j2 as bu,Zc as bv,ba as bw,Tx as bx,G1 as by,FP as bz,Ho as c,Rb as c0,iS as c1,Hb as c2,Rp as c3,dC as c4,we as c5,Dt as c6,N2 as c7,d0 as c8,J1 as c9,eP as cA,Xp as ca,zo as cb,Zd as cc,HP as cd,ly as ce,hn as cf,bP as cg,Km as ch,$n as ci,_i as cj,Er as ck,Ct as cl,Fr as cm,zg as cn,Q2 as co,Hg as cp,kg as cq,ls as cr,Z2 as cs,cP as ct,Aa as cu,Zt as cv,sn as cw,lh as cx,V2 as cy,tP as cz,Tr as d,vl as e,By as f,SP as g,wP as h,_u as i,IP as j,_P as k,Hi as l,CP as m,RP as n,_r as o,xy as p,wr as q,$i as r,un as s,Ms as t,xP as u,dP as v,Px as w,o0 as x,ry as y,uC as z}; diff --git a/internal/relay/web-dist/assets/version-DPtnfoOB.js b/internal/relay/web-dist/assets/version-Dm8mqW3q.js similarity index 62% rename from internal/relay/web-dist/assets/version-DPtnfoOB.js rename to internal/relay/web-dist/assets/version-Dm8mqW3q.js index 231695f1..4f65755e 100644 --- a/internal/relay/web-dist/assets/version-DPtnfoOB.js +++ b/internal/relay/web-dist/assets/version-Dm8mqW3q.js @@ -1 +1 @@ -import{a as t,A as e}from"./client-2UEf7AK8.js";import{c0 as n}from"./useI18n-CnvN0FfF.js";function s(r,o=n){return o("common.versionLabel",{version:r||"dev"})}async function c(){try{const{data:r}=await t("/api/version");return r.version}catch(r){if(!(r instanceof e))throw r;return"dev"}}export{c as fetchVersion,s as formatVersionLabel}; +import{a as t,A as e}from"./client-DMh7GjbV.js";import{b$ as n}from"./useI18n-lwZlSdSx.js";function s(r,o=n){return o("common.versionLabel",{version:r||"dev"})}async function c(){try{const{data:r}=await t("/api/version");return r.version}catch(r){if(!(r instanceof e))throw r;return"dev"}}export{c as fetchVersion,s as formatVersionLabel}; diff --git a/internal/relay/web-dist/firstrun.html b/internal/relay/web-dist/firstrun.html index 8749dca8..a34a83cb 100644 --- a/internal/relay/web-dist/firstrun.html +++ b/internal/relay/web-dist/firstrun.html @@ -7,13 +7,13 @@ AT Term · setup - - - - - - - + + + + + + + diff --git a/internal/relay/web-dist/index.html b/internal/relay/web-dist/index.html index 084389ae..dc4003b4 100644 --- a/internal/relay/web-dist/index.html +++ b/internal/relay/web-dist/index.html @@ -11,13 +11,13 @@ AT Term - - - - - - - + + + + + + +
diff --git a/internal/relay/web-dist/login.html b/internal/relay/web-dist/login.html index 143d1185..1ad31bd3 100644 --- a/internal/relay/web-dist/login.html +++ b/internal/relay/web-dist/login.html @@ -7,13 +7,13 @@ AT Term · sign in - - - - - - - + + + + + + + diff --git a/internal/relay/web-dist/setup.html b/internal/relay/web-dist/setup.html index 9e34574a..2f287308 100644 --- a/internal/relay/web-dist/setup.html +++ b/internal/relay/web-dist/setup.html @@ -10,10 +10,10 @@ AT Term · setup - - - - + + + + diff --git a/internal/relay/web-dist/signup.html b/internal/relay/web-dist/signup.html index d06721b3..1c988774 100644 --- a/internal/relay/web-dist/signup.html +++ b/internal/relay/web-dist/signup.html @@ -7,13 +7,13 @@ AT Term · sign up - - - - - - - + + + + + + + diff --git a/internal/relay/web-dist/sw.js b/internal/relay/web-dist/sw.js index d87edc61..82544e21 100644 --- a/internal/relay/web-dist/sw.js +++ b/internal/relay/web-dist/sw.js @@ -1 +1 @@ -if(!self.define){let s,e={};const i=(i,l)=>(i=new URL(i+".js",l).href,e[i]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=i,s.onload=e,document.head.appendChild(s)}else s=i,importScripts(i),e()}).then(()=>{let s=e[i];if(!s)throw new Error(`Module ${i} didn’t register its module`);return s}));self.define=(l,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>i(s,r),t={module:{uri:r},exports:u,require:o};e[r]=Promise.all(l.map(s=>t[s]||o(s))).then(s=>(n(...s),u))}}define(["./workbox-0bb07689"],function(s){"use strict";importScripts("notification-click.js"),self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"signup.html",revision:"efcbc3ed78de0fd9596b93c26a75099e"},{url:"setup.html",revision:"f3849509a31d45254d04fdcef2f0d54a"},{url:"notification-click.js",revision:"bb04a6b8230e48578719120cf2c820cf"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"},{url:"login.html",revision:"676de7509e32c504f712bc1513582a48"},{url:"index.html",revision:"ba1ef66733281d0eef68d7bf75de4582"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"firstrun.html",revision:"7a8b7fd8da8c255de785bf46446038c6"},{url:"assets/workbox-window.prod.es5-BqEJf4Xk.js",revision:null},{url:"assets/wasm_exec-vVX9mWnE.js",revision:null},{url:"assets/wasm_exec-BVJFcdQq.js",revision:null},{url:"assets/version-DPtnfoOB.js",revision:null},{url:"assets/useI18n-CnvN0FfF.js",revision:null},{url:"assets/toml-Bm5Em-hy.js",revision:null},{url:"assets/swift-BzpIVaGY.js",revision:null},{url:"assets/signup-zTxZ2Ho_.css",revision:null},{url:"assets/signup-AhbkM-pD.js",revision:null},{url:"assets/shell-CjFT_Tl9.js",revision:null},{url:"assets/setup-DC9JOQlN.js",revision:null},{url:"assets/setup-BisxzT2E.css",revision:null},{url:"assets/sessions-Uw5ok8wO.js",revision:null},{url:"assets/ruby-B2Rjki9n.js",revision:null},{url:"assets/pwa-C6kIEQJT.js",revision:null},{url:"assets/properties-C78fOPTZ.js",revision:null},{url:"assets/prefsSync-D8z1rJ8H.js",revision:null},{url:"assets/opaque-BH0YqBjY.js",revision:null},{url:"assets/mobile-guard-DNP_n6iV.js",revision:null},{url:"assets/mobile-guard-CPlabY_J.css",revision:null},{url:"assets/lua-VAEuO923.js",revision:null},{url:"assets/login-B2LUhNm2.css",revision:null},{url:"assets/login-6vnLvdhD.js",revision:null},{url:"assets/index-vv_fn0WP.js",revision:null},{url:"assets/index-sMVa0oql.js",revision:null},{url:"assets/index-q_Op_mkr.js",revision:null},{url:"assets/index-hbreRbwz.js",revision:null},{url:"assets/index-hP5cCp4S.js",revision:null},{url:"assets/index-arVCiUK9.css",revision:null},{url:"assets/index-Y0PF_oBA.js",revision:null},{url:"assets/index-LsOWRKMa.js",revision:null},{url:"assets/index-DW5ZYIIZ.js",revision:null},{url:"assets/index-D9YFpvOI.js",revision:null},{url:"assets/index-D8AWWFft.js",revision:null},{url:"assets/index-CsH7OxDu.js",revision:null},{url:"assets/index-CrP2n_El.js",revision:null},{url:"assets/index-CZ0p1U99.js",revision:null},{url:"assets/index-CH6joGJR.js",revision:null},{url:"assets/index-BfmBkV0O.js",revision:null},{url:"assets/index-Bc7PlSwi.js",revision:null},{url:"assets/index-BSlQSXjR.js",revision:null},{url:"assets/index-BH9vIdLD.js",revision:null},{url:"assets/index-BEPhTiWa.js",revision:null},{url:"assets/index-Ak5-vsum.js",revision:null},{url:"assets/firstrun-dxEwnRB_.css",revision:null},{url:"assets/firstrun-BkBSjRTR.js",revision:null},{url:"assets/dockerfile-ZL4hHokT.js",revision:null},{url:"assets/diff-DbItnlRl.js",revision:null},{url:"assets/clike-B9uivgTg.js",revision:null},{url:"assets/client-2UEf7AK8.js",revision:null},{url:"assets/auth-Dhl8fEWW.js",revision:null},{url:"assets/Switch-CpxGRRqY.js",revision:null},{url:"assets/FileExplorer-DKo_tolh.css",revision:null},{url:"assets/FileExplorer-BGCt84ef.js",revision:null},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"}],{}),s.cleanupOutdatedCaches()}); +if(!self.define){let s,e={};const l=(l,i)=>(l=new URL(l+".js",i).href,e[l]||new Promise(e=>{if("document"in self){const s=document.createElement("script");s.src=l,s.onload=e,document.head.appendChild(s)}else s=l,importScripts(l),e()}).then(()=>{let s=e[l];if(!s)throw new Error(`Module ${l} didn’t register its module`);return s}));self.define=(i,n)=>{const r=s||("document"in self?document.currentScript.src:"")||location.href;if(e[r])return;let u={};const o=s=>l(s,r),t={module:{uri:r},exports:u,require:o};e[r]=Promise.all(i.map(s=>t[s]||o(s))).then(s=>(n(...s),u))}}define(["./workbox-0bb07689"],function(s){"use strict";importScripts("notification-click.js"),self.skipWaiting(),s.clientsClaim(),s.precacheAndRoute([{url:"signup.html",revision:"24a20311f461b336be3112fdfcb43c24"},{url:"setup.html",revision:"19d5c9b75b6e902244f779e98a954175"},{url:"notification-click.js",revision:"bb04a6b8230e48578719120cf2c820cf"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"},{url:"login.html",revision:"e65764737341c2e2e90415287e07fea4"},{url:"index.html",revision:"17aeb57ee8b52532cc506cfdd251dbbb"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"firstrun.html",revision:"39d15aa3d9dc27af848e55302678a9ec"},{url:"assets/workbox-window.prod.es5-BqEJf4Xk.js",revision:null},{url:"assets/wasm_exec-vVX9mWnE.js",revision:null},{url:"assets/wasm_exec-BVJFcdQq.js",revision:null},{url:"assets/version-Dm8mqW3q.js",revision:null},{url:"assets/useI18n-lwZlSdSx.js",revision:null},{url:"assets/toml-Bm5Em-hy.js",revision:null},{url:"assets/swift-BzpIVaGY.js",revision:null},{url:"assets/signup-zTxZ2Ho_.css",revision:null},{url:"assets/signup-BXhwDxUo.js",revision:null},{url:"assets/shell-CjFT_Tl9.js",revision:null},{url:"assets/setup-WUaGlTjO.js",revision:null},{url:"assets/setup-BisxzT2E.css",revision:null},{url:"assets/sessions-RpM2fLHY.js",revision:null},{url:"assets/ruby-B2Rjki9n.js",revision:null},{url:"assets/pwa-BO-YW0rH.js",revision:null},{url:"assets/properties-C78fOPTZ.js",revision:null},{url:"assets/prefsSync-C5tz9Q-s.js",revision:null},{url:"assets/opaque-BH0YqBjY.js",revision:null},{url:"assets/mobile-guard-Cco5WjS8.js",revision:null},{url:"assets/mobile-guard-CPlabY_J.css",revision:null},{url:"assets/lua-VAEuO923.js",revision:null},{url:"assets/login-B2LUhNm2.css",revision:null},{url:"assets/login-B-BiQRGX.js",revision:null},{url:"assets/index-wpy5ZEXj.js",revision:null},{url:"assets/index-Z6WUIGxm.js",revision:null},{url:"assets/index-X9DIw5ut.js",revision:null},{url:"assets/index-OVPV9rln.js",revision:null},{url:"assets/index-DO3lkMm1.js",revision:null},{url:"assets/index-DL67eyEa.js",revision:null},{url:"assets/index-DKJlFFIC.js",revision:null},{url:"assets/index-DI-4cHpq.js",revision:null},{url:"assets/index-DDrs-wZn.js",revision:null},{url:"assets/index-DBbnF2NZ.css",revision:null},{url:"assets/index-D8AWWFft.js",revision:null},{url:"assets/index-Cnryh6X_.js",revision:null},{url:"assets/index-ChhOm7oD.js",revision:null},{url:"assets/index-Ccyjkum6.js",revision:null},{url:"assets/index-CWU_7NNG.js",revision:null},{url:"assets/index-CL_O9F0b.js",revision:null},{url:"assets/index-CC5g0Nm4.js",revision:null},{url:"assets/index-BTPAbX_e.js",revision:null},{url:"assets/index-BHEGRR_x.js",revision:null},{url:"assets/index-B2EmydOR.js",revision:null},{url:"assets/index-7QWmdym1.js",revision:null},{url:"assets/firstrun-dxEwnRB_.css",revision:null},{url:"assets/firstrun-BX3Qt0kf.js",revision:null},{url:"assets/dockerfile-ZL4hHokT.js",revision:null},{url:"assets/diff-DbItnlRl.js",revision:null},{url:"assets/clike-B9uivgTg.js",revision:null},{url:"assets/client-DMh7GjbV.js",revision:null},{url:"assets/auth-B3RxKR1W.js",revision:null},{url:"assets/Switch-DguIL3dU.js",revision:null},{url:"assets/FileExplorer-DTHAXsem.js",revision:null},{url:"assets/FileExplorer-DKo_tolh.css",revision:null},{url:"icon.png",revision:"9ee6de251ff079b039219fb78a2a1776"},{url:"icon.svg",revision:"2ef190cf56a973b4e843228dc551b92e"},{url:"manifest.webmanifest",revision:"ee62007ccffc3e46461d5812bb890bf8"}],{}),s.cleanupOutdatedCaches()}); diff --git a/web/src/shared/api/admin.ts b/web/src/shared/api/admin.ts index 9f3c03c2..c459b8a8 100644 --- a/web/src/shared/api/admin.ts +++ b/web/src/shared/api/admin.ts @@ -2,6 +2,7 @@ import { apiFetch } from './client' import type { AdminConfig, AdminConfigUpdate, + AdminHealthResponse, AdminTrafficResponse, AdminUserRow, FeishuAdminConfig, @@ -11,6 +12,7 @@ import type { InvitationRow, ResetPasswordResponse, TrafficView, + TrafficBucket, } from './types' // User listing + role + status (admin/api/users). @@ -108,13 +110,20 @@ export async function generateFeishuKey(): Promise { // server default to the last 7 days. export async function getTrafficStats(params: { view?: TrafficView + bucket?: TrafficBucket from?: string to?: string }): Promise { const q = new URLSearchParams() if (params.view) q.set('view', params.view) + if (params.bucket) q.set('bucket', params.bucket) if (params.from) q.set('from', params.from) if (params.to) q.set('to', params.to) const { data } = await apiFetch(`/admin/api/traffic?${q.toString()}`) return data } + +export async function getAdminHealth(): Promise { + const { data } = await apiFetch('/admin/api/health') + return data +} diff --git a/web/src/shared/api/types.ts b/web/src/shared/api/types.ts index 29e2dea7..5bb6ba4a 100644 --- a/web/src/shared/api/types.ts +++ b/web/src/shared/api/types.ts @@ -147,10 +147,12 @@ export type TaskState = | 'closed' export type TrafficView = 'detail' | 'group' | 'summary' +export type TrafficBucket = 'range' | 'day' export interface AdminTrafficRow { user_id: string email?: string + day?: string frame_type?: number frame_type_name?: string category?: string @@ -161,7 +163,20 @@ export interface AdminTrafficRow { export interface AdminTrafficResponse { view: TrafficView + bucket: TrafficBucket from: string to: string rows: AdminTrafficRow[] } + +export interface AdminHealthResponse { + version: string + uptime_seconds: number + https: boolean + active_uplinks: number + active_sessions: number + relay_instances: number + traffic_flush_interval_seconds: number + generated_at: string + health_check_warnings?: string[] +} diff --git a/web/src/shared/i18n/messages/en.ts b/web/src/shared/i18n/messages/en.ts index f691b7e8..cc61e3cb 100644 --- a/web/src/shared/i18n/messages/en.ts +++ b/web/src/shared/i18n/messages/en.ts @@ -2,6 +2,7 @@ export const en = { common: { appName: 'AT Term', cancel: 'Cancel', + close: 'Close', confirm: 'Confirm', copy: 'Copy', create: 'Create', @@ -167,9 +168,85 @@ export const en = { feishuTab: 'Feishu', trafficTab: 'Traffic', traffic: { - viewDetail: 'Detail', - viewGroup: 'Grouped', - viewSummary: 'Summary', + title: 'Traffic analysis', + timezone: 'Daily aggregation in UTC', + refresh: 'Refresh data', + platformScope: 'Platform scope', + platformStatus: 'Platform status', + globalRealtime: 'Global live data', + relayStatus: 'Relay status', + online: 'Online', + unknown: 'Unknown', + activeSessions: 'Active sessions', + relayInstances: 'Active relays', + activeUplinks: 'Active uplinks', + liveValue: 'Live on this node', + liveInstances: 'Heartbeat within 90s', + flushEvery: 'Traffic flushes every {seconds}s', + userScope: 'User scope', + userAnalysis: 'User traffic analysis', + range: 'Date range', + days: '{days} days', + allUsers: 'Users: all', + selectedUsers: 'Users: {selected}/{total}', + filterUsers: 'Filter users', + selectedCount: '{selected} / {total} selected', + clearAll: 'Clear all', + selectAll: 'Select all', + searchUsers: 'Search email or user ID', + selectOrSearchUser: 'Select or search user', + only: 'Only', + noUserMatch: 'No matching users', + restoreAll: 'Restore all', + done: 'Done', + noUsersSelected: 'No users selected', + restoreAllUsers: 'Restore all users', + selectedUserCount: '{count} users selected', + kpiTotal: 'Total traffic', + kpiOutbound: 'Outbound', + kpiInbound: 'Inbound', + kpiFrames: 'Frames', + trendNew: 'No prior data', + trendFlat: 'Flat', + coreAnalysis: 'Core analysis', + timelineTitle: 'User traffic timeline', + timelineScope: '{count} users', + view: 'View', + groupTimeline: 'Group timeline', + frameTimeline: 'Frame types', + directionTrend: 'Direction trend', + metric: 'Metric', + bytes: 'Bytes', + frames: 'Frames', + direction: { + all: 'All', + out: 'Outbound', + in: 'Inbound', + }, + multiUserMatrix: 'Multi-user matrix', + stackedTimeline: 'Single-user stacked', + bucketCount: '{count} daily buckets', + total: 'Total', + selectedAggregate: 'Selected users', + categorySummary: 'Category summary', + totalComposition: 'Traffic mix for selected users', + clear: 'Clear', + outIn: 'Out {out} · In {in}', + userDetail: 'User detail', + userCount: '{count} users', + totalTraffic: 'Total traffic', + share: 'Share', + periodTrend: 'vs prior', + activeDays: 'Active days', + viewUser: 'View {user}', + diagnostics: 'Traffic diagnostics', + diagnosticsRange: 'Last {days} days', + dailyActivity: 'Daily user activity', + frameDensity: 'Category frame density', + frameUnit: 'frame', + userTraffic: 'User traffic', + dailyTraffic: 'Daily traffic', + frameBreakdown: 'Frame type breakdown', colUser: 'User', colCategory: 'Category', colFrameType: 'Frame type', @@ -180,6 +257,14 @@ export const en = { dirOut: 'Out', empty: 'No traffic recorded for this range.', loadFailed: 'Failed to load traffic stats.', + categories: { + terminal: 'Terminal relay', + state: 'State sync', + filesystem: 'File browser', + service: 'Remote preview', + control: 'Control', + other: 'Other', + }, }, feishuConfig: { title: 'Feishu integration', diff --git a/web/src/shared/i18n/messages/zh-CN.ts b/web/src/shared/i18n/messages/zh-CN.ts index 6d6a876d..47b11a1d 100644 --- a/web/src/shared/i18n/messages/zh-CN.ts +++ b/web/src/shared/i18n/messages/zh-CN.ts @@ -4,6 +4,7 @@ export const zhCN = { common: { appName: 'AT Term', cancel: '取消', + close: '关闭', confirm: '确认', copy: '复制', create: '创建', @@ -169,9 +170,85 @@ export const zhCN = { feishuTab: '飞书', trafficTab: '流量', traffic: { - viewDetail: '明细', - viewGroup: '分组', - viewSummary: '汇总', + title: '流量分析', + timezone: '按 UTC 日聚合', + refresh: '刷新数据', + platformScope: '平台范围', + platformStatus: '平台状态', + globalRealtime: '全局实时', + relayStatus: 'Relay 状态', + online: '运行中', + unknown: '未知', + activeSessions: '在线会话', + relayInstances: '活跃 Relay', + activeUplinks: '在线 Uplink', + liveValue: '当前节点实时值', + liveInstances: '90 秒内有心跳', + flushEvery: '流量每 {seconds} 秒入库', + userScope: '用户范围', + userAnalysis: '用户流量分析', + range: '时间范围', + days: '{days} 天', + allUsers: '用户:全部', + selectedUsers: '用户:已选 {selected}/{total}', + filterUsers: '筛选用户', + selectedCount: '{selected} / {total} 已选', + clearAll: '取消全选', + selectAll: '全选', + searchUsers: '搜索邮箱或用户 ID', + selectOrSearchUser: '选择或搜索用户', + only: '仅看', + noUserMatch: '未找到匹配用户', + restoreAll: '恢复全部', + done: '完成', + noUsersSelected: '当前未选择用户', + restoreAllUsers: '恢复全部用户', + selectedUserCount: '已筛选 {count} 位用户', + kpiTotal: '总流量', + kpiOutbound: '出站流量', + kpiInbound: '入站流量', + kpiFrames: '帧数', + trendNew: '上期为 0', + trendFlat: '持平', + coreAnalysis: '核心分析', + timelineTitle: '用户时序流量', + timelineScope: '{count} 位用户', + view: '视图', + groupTimeline: '分组时序', + frameTimeline: '帧类型', + directionTrend: '方向走势', + metric: '指标', + bytes: '字节', + frames: '帧数', + direction: { + all: '全部', + out: '出站', + in: '入站', + }, + multiUserMatrix: '多用户矩阵', + stackedTimeline: '单用户堆叠', + bucketCount: '{count} 个日桶', + total: '合计', + selectedAggregate: '所选用户合计', + categorySummary: '类别摘要', + totalComposition: '所选用户的流量构成', + clear: '清除', + outIn: '出 {out} · 入 {in}', + userDetail: '用户明细', + userCount: '{count} 位用户', + totalTraffic: '总流量', + share: '占比', + periodTrend: '较上期', + activeDays: '活跃天数', + viewUser: '查看 {user}', + diagnostics: '流量诊断', + diagnosticsRange: '最近 {days} 天', + dailyActivity: '用户日活跃度', + frameDensity: '类别帧密度', + frameUnit: '帧', + userTraffic: '用户流量', + dailyTraffic: '每日流量', + frameBreakdown: '帧类型构成', colUser: '用户', colCategory: '类别', colFrameType: '帧类型', @@ -182,6 +259,14 @@ export const zhCN = { dirOut: '发送', empty: '该时间范围内暂无流量记录。', loadFailed: '加载流量统计失败。', + categories: { + terminal: '终端转发', + state: '状态同步', + filesystem: '文件浏览', + service: '远程预览', + control: '控制信令', + other: '其他', + }, }, feishuConfig: { title: '飞书集成', diff --git a/web/tests/unit/shared/api/admin.test.ts b/web/tests/unit/shared/api/admin.test.ts index 2a2ee162..c7d1bf66 100644 --- a/web/tests/unit/shared/api/admin.test.ts +++ b/web/tests/unit/shared/api/admin.test.ts @@ -8,6 +8,8 @@ import { promoteUser, demoteUser, getAdminConfig, + getAdminHealth, + getTrafficStats, setAdminConfig, } from '@shared/api/admin' import { clearRelayConfig, saveRelayConfig } from '@shared/api/relay-config' @@ -192,3 +194,30 @@ describe('admin /admin/api/config', () => { expect(JSON.parse(init.body as string)).toEqual({ rate_limit_per_minute: 200, max_connections_per_key: 32 }) }) }) + +describe('admin traffic dashboard APIs', () => { + beforeEach(() => { + clearRelayConfig() + saveRelayConfig({ baseURL: '', sessionToken: 'ses_test', expiresAt: null, allowInsecure: false }) + vi.restoreAllMocks() + }) + + it('requests daily detail traffic for the requested date range', async () => { + const response = { view: 'detail', bucket: 'day', from: '2026-09-01', to: '2026-09-14', rows: [] } + const fetchMock = vi.fn().mockResolvedValue(jsonResponse(200, response)) + vi.stubGlobal('fetch', fetchMock) + + await getTrafficStats({ view: 'detail', bucket: 'day', from: '2026-09-01', to: '2026-09-14' }) + + expect(fetchMock.mock.calls[0]![0]).toBe('/admin/api/traffic?view=detail&bucket=day&from=2026-09-01&to=2026-09-14') + }) + + it('loads platform health independently of user traffic', async () => { + const response = { active_sessions: 3, active_uplinks: 2, relay_instances: 1, traffic_flush_interval_seconds: 60 } + const fetchMock = vi.fn().mockResolvedValue(jsonResponse(200, response)) + vi.stubGlobal('fetch', fetchMock) + + expect(await getAdminHealth()).toEqual(response) + expect(fetchMock.mock.calls[0]![0]).toBe('/admin/api/health') + }) +})