@plusrouter/ui 0.1.31 → 0.1.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  import { jsx as M, jsxs as u, Fragment as K } from "react/jsx-runtime";
2
2
  import N from "clsx";
3
3
  import { Globe as Pe, Moon as je, Sun as de, Store as Re, Sparkles as Be, Calendar as He, ChevronDown as Xe, List as Ve, ChevronRight as qe, Puzzle as Je, Plus as Fe, X as ie, Copy as Ke, RefreshCw as $e, Settings as eM, ChartColumn as MM, Wallet as sM, KeyRound as oM, BookOpen as uM, MessageSquare as lM, Terminal as tM, ArrowLeft as OM, Check as rM, Headphones as EM, Search as CM, Cpu as QM, Clock as bM, CreditCard as YM, Zap as hM } from "lucide-react";
4
- import { forwardRef as H, useContext as _M, createContext as aM, useId as J, cloneElement as UM, useRef as V, useState as Q, useMemo as _e } from "react";
4
+ import { forwardRef as X, useContext as _M, createContext as aM, useId as J, cloneElement as UM, useRef as H, useState as Q, useMemo as _e } from "react";
5
5
  import * as Le from "@radix-ui/react-avatar";
6
6
  import { Field as ke } from "@base-ui/react/field";
7
7
  import * as v from "@radix-ui/react-dialog";
@@ -3469,6 +3469,7 @@ const fM = "rp_styles-module_win_IAdJLhBx", GM = "rp_styles-module_hint_0XCf0ecy
3469
3469
  "rp-button--primary": "rp_Button-module_rp-button--primary_BVPMZxWQ",
3470
3470
  "rp-button--secondary": "rp_Button-module_rp-button--secondary_y2ayXGef",
3471
3471
  "rp-button--outline": "rp_Button-module_rp-button--outline_6TxY1eii",
3472
+ "rp-button--update": "rp_Button-module_rp-button--update_JV9wz2GC",
3472
3473
  "rp-button--danger": "rp_Button-module_rp-button--danger_zU9ZKyWX",
3473
3474
  "rp-button--ghost": "rp_Button-module_rp-button--ghost_eXWWJry9",
3474
3475
  "rp-button--text": "rp_Button-module_rp-button--text_oM5lujbh",
@@ -3501,7 +3502,7 @@ var Me = /* @__PURE__ */ ((e) => (e.Large = "large", e.Medium = "medium", e.Smal
3501
3502
  function GI(e) {
3502
3503
  return uw.includes(e);
3503
3504
  }
3504
- const lw = /* @__PURE__ */ new Set(["text", "icon", "update"]);
3505
+ const lw = /* @__PURE__ */ new Set(["text", "icon"]);
3505
3506
  function tw(e) {
3506
3507
  switch (e) {
3507
3508
  case x.Button_Link_Large_1:
@@ -3522,10 +3523,10 @@ function tw(e) {
3522
3523
  function rw(e) {
3523
3524
  return e === x.Button_Link_Extra_Small_1 || e === x.Button_Link_Extra_Small_2 ? Ne.Small : Ne.Medium;
3524
3525
  }
3525
- const h = H(
3526
+ const h = X(
3526
3527
  ({
3527
3528
  variant: e = "text",
3528
- textVariant: s = x.Button_Link_Medium_1,
3529
+ textVariant: s = x.Button_Link_Extra_Small_2,
3529
3530
  className: o,
3530
3531
  href: l,
3531
3532
  type: t = "button",
@@ -3901,7 +3902,7 @@ const ye = {
3901
3902
  "rp-dialog__description": "rp_Dialog-module_rp-dialog__description_IZoIvFxV",
3902
3903
  "rp-dialog__close": "rp_Dialog-module_rp-dialog__close_7FRDMOXe",
3903
3904
  "rp-dialog__footer": "rp_Dialog-module_rp-dialog__footer_hs5fP992"
3904
- }, dM = aM(!0), Ee = ({ modal: e = !0, ...s }) => /* @__PURE__ */ M(dM.Provider, { value: e, children: /* @__PURE__ */ M(v.Root, { modal: e, ...s }) }), iM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3905
+ }, dM = aM(!0), Ee = ({ modal: e = !0, ...s }) => /* @__PURE__ */ M(dM.Provider, { value: e, children: /* @__PURE__ */ M(v.Root, { modal: e, ...s }) }), iM = X(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3905
3906
  v.Trigger,
3906
3907
  {
3907
3908
  ref: o,
@@ -3910,7 +3911,7 @@ const ye = {
3910
3911
  }
3911
3912
  ));
3912
3913
  iM.displayName = v.Trigger.displayName;
3913
- const cw = v.Portal, LM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3914
+ const cw = v.Portal, LM = X(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3914
3915
  v.Overlay,
3915
3916
  {
3916
3917
  ref: o,
@@ -3919,7 +3920,7 @@ const cw = v.Portal, LM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3919
3920
  }
3920
3921
  ));
3921
3922
  LM.displayName = v.Overlay.displayName;
3922
- const DM = H(
3923
+ const DM = X(
3923
3924
  ({
3924
3925
  className: e,
3925
3926
  placement: s = "center",
@@ -3949,7 +3950,7 @@ const DM = H(
3949
3950
  }
3950
3951
  );
3951
3952
  DM.displayName = v.Content.displayName;
3952
- const yM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3953
+ const yM = X(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3953
3954
  v.Title,
3954
3955
  {
3955
3956
  ref: o,
@@ -3958,7 +3959,7 @@ const yM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3958
3959
  }
3959
3960
  ));
3960
3961
  yM.displayName = v.Title.displayName;
3961
- const mM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3962
+ const mM = X(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3962
3963
  v.Description,
3963
3964
  {
3964
3965
  ref: o,
@@ -3967,7 +3968,7 @@ const mM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3967
3968
  }
3968
3969
  ));
3969
3970
  mM.displayName = v.Description.displayName;
3970
- const wM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3971
+ const wM = X(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3971
3972
  v.Close,
3972
3973
  {
3973
3974
  ref: o,
@@ -3976,7 +3977,7 @@ const wM = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3976
3977
  }
3977
3978
  ));
3978
3979
  wM.displayName = v.Close.displayName;
3979
- const jw = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3980
+ const jw = X(({ className: e, ...s }, o) => /* @__PURE__ */ M(
3980
3981
  "div",
3981
3982
  {
3982
3983
  ref: o,
@@ -4023,7 +4024,7 @@ const jw = H(({ className: e, ...s }, o) => /* @__PURE__ */ M(
4023
4024
  label: l,
4024
4025
  className: t
4025
4026
  }) => {
4026
- const r = V([]);
4027
+ const r = H([]);
4027
4028
  return /* @__PURE__ */ M(
4028
4029
  "div",
4029
4030
  {
@@ -4114,21 +4115,21 @@ function eg({
4114
4115
  onClose: j,
4115
4116
  className: y
4116
4117
  }) {
4117
- const [d, L] = Q(s), [Y, O] = Q(o), [n, T] = Q(
4118
+ const [d, L] = Q(s), [Y, z] = Q(o), [O, w] = Q(
4118
4119
  s === "New ticket" || !!o
4119
- ), I = J(), z = V(null), C = V(null), b = e.filter(
4120
+ ), n = J(), T = H(null), C = H(null), b = e.filter(
4120
4121
  (k) => k.status === (d === "Archive" ? "resolved" : "active")
4121
4122
  ), W = b.find((k) => k.id === Y) ?? b[0];
4122
4123
  function P() {
4123
- T(!0), requestAnimationFrame(() => C.current?.focus());
4124
+ w(!0), requestAnimationFrame(() => C.current?.focus());
4124
4125
  }
4125
4126
  return /* @__PURE__ */ u(
4126
4127
  "section",
4127
4128
  {
4128
4129
  className: N(m.root, y),
4129
- "aria-labelledby": I,
4130
+ "aria-labelledby": n,
4130
4131
  "aria-busy": l,
4131
- "data-detail-open": n,
4132
+ "data-detail-open": O,
4132
4133
  children: [
4133
4134
  /* @__PURE__ */ u(
4134
4135
  "aside",
@@ -4136,10 +4137,10 @@ function eg({
4136
4137
  className: m.supportSidebar,
4137
4138
  "aria-label": "Support tickets",
4138
4139
  tabIndex: -1,
4139
- ref: z,
4140
+ ref: T,
4140
4141
  children: [
4141
4142
  /* @__PURE__ */ u("header", { className: m.sidebarHeader, children: [
4142
- /* @__PURE__ */ M("h2", { id: I, children: "Support" }),
4143
+ /* @__PURE__ */ M("h2", { id: n, children: "Support" }),
4143
4144
  j && /* @__PURE__ */ M(h, { variant: "icon", "aria-label": "Close support", onClick: j, children: /* @__PURE__ */ M(ie, { size: 18 }) })
4144
4145
  ] }),
4145
4146
  /* @__PURE__ */ M(
@@ -4148,7 +4149,7 @@ function eg({
4148
4149
  options: ["Active", "Archive"],
4149
4150
  value: d === "Archive" ? "Archive" : "Active",
4150
4151
  onChange: (k) => {
4151
- L(k), O(void 0);
4152
+ L(k), z(void 0);
4152
4153
  },
4153
4154
  label: "Ticket view"
4154
4155
  }
@@ -4170,7 +4171,7 @@ function eg({
4170
4171
  className: m.ticket,
4171
4172
  "aria-current": d !== "New ticket" && W?.id === k.id ? "true" : void 0,
4172
4173
  onClick: () => {
4173
- O(k.id), P();
4174
+ z(k.id), P();
4174
4175
  },
4175
4176
  children: [
4176
4177
  /* @__PURE__ */ u("span", { className: m.ticketMeta, children: [
@@ -4224,7 +4225,7 @@ function eg({
4224
4225
  {
4225
4226
  variant: "ghost",
4226
4227
  onClick: () => {
4227
- T(!1), requestAnimationFrame(() => z.current?.focus());
4228
+ w(!1), requestAnimationFrame(() => T.current?.focus());
4228
4229
  },
4229
4230
  children: [
4230
4231
  /* @__PURE__ */ M(OM, { size: 16, "aria-hidden": "true" }),
@@ -4277,11 +4278,11 @@ function BI({
4277
4278
  }) {
4278
4279
  const { onClose: a, className: j, ...y } = _, [d, L] = Q(
4279
4280
  o ?? !1
4280
- ), Y = s !== void 0, O = Y ? s : d;
4281
- function n(T) {
4282
- Y || L(T), l?.(T);
4281
+ ), Y = s !== void 0, z = Y ? s : d;
4282
+ function O(w) {
4283
+ Y || L(w), l?.(w);
4283
4284
  }
4284
- return /* @__PURE__ */ u(F.Root, { modal: e, open: O, onOpenChange: n, children: [
4285
+ return /* @__PURE__ */ u(F.Root, { modal: e, open: z, onOpenChange: O, children: [
4285
4286
  t ? /* @__PURE__ */ M(F.Trigger, { asChild: !0, children: t }) : null,
4286
4287
  /* @__PURE__ */ u(F.Portal, { children: [
4287
4288
  e && /* @__PURE__ */ M(F.Overlay, {}),
@@ -4299,7 +4300,7 @@ function BI({
4299
4300
  ...y,
4300
4301
  className: m.dialogSupport,
4301
4302
  onClose: () => {
4302
- a?.(), n(!1);
4303
+ a?.(), O(!1);
4303
4304
  }
4304
4305
  }
4305
4306
  )
@@ -4313,7 +4314,7 @@ function Mg({ onCreateTicket: e }) {
4313
4314
  const [s, o] = Q({
4314
4315
  subject: "",
4315
4316
  message: ""
4316
- }), [l, t] = Q(!1), r = V(!1), [_, a] = Q(""), [j, y] = Q(!1);
4317
+ }), [l, t] = Q(!1), r = H(!1), [_, a] = Q(""), [j, y] = Q(!1);
4317
4318
  return /* @__PURE__ */ u("div", { className: m.compose, children: [
4318
4319
  /* @__PURE__ */ M("h3", { children: "New ticket" }),
4319
4320
  /* @__PURE__ */ u(
@@ -4394,7 +4395,7 @@ function sg({
4394
4395
  onReply: s,
4395
4396
  onRate: o
4396
4397
  }) {
4397
- const [l, t] = Q(""), [r, _] = Q(!1), a = V(!1), [j, y] = Q(), [d, L] = Q(""), [Y, O] = Q(!1), n = J(), T = e.status === "resolved";
4398
+ const [l, t] = Q(""), [r, _] = Q(!1), a = H(!1), [j, y] = Q(), [d, L] = Q(""), [Y, z] = Q(!1), O = J(), w = e.status === "resolved";
4398
4399
  return /* @__PURE__ */ u(K, { children: [
4399
4400
  /* @__PURE__ */ u("header", { className: m.conversationHeader, children: [
4400
4401
  /* @__PURE__ */ u("div", { className: m.conversationMeta, children: [
@@ -4402,9 +4403,9 @@ function sg({
4402
4403
  "Ticket #",
4403
4404
  e.id
4404
4405
  ] }),
4405
- /* @__PURE__ */ u("span", { className: m.supportBadge, "data-resolved": T, children: [
4406
- T ? /* @__PURE__ */ M(rM, { size: 12, "aria-hidden": "true" }) : /* @__PURE__ */ M("span", { className: m.statusDot }),
4407
- T ? "Resolved" : "Open"
4406
+ /* @__PURE__ */ u("span", { className: m.supportBadge, "data-resolved": w, children: [
4407
+ w ? /* @__PURE__ */ M(rM, { size: 12, "aria-hidden": "true" }) : /* @__PURE__ */ M("span", { className: m.statusDot }),
4408
+ w ? "Resolved" : "Open"
4408
4409
  ] })
4409
4410
  ] }),
4410
4411
  /* @__PURE__ */ M("h3", { children: e.subject }),
@@ -4418,35 +4419,35 @@ function sg({
4418
4419
  "aria-label": "Conversation",
4419
4420
  tabIndex: 0,
4420
4421
  children: [
4421
- e.messages.map((I) => /* @__PURE__ */ u(
4422
+ e.messages.map((n) => /* @__PURE__ */ u(
4422
4423
  "article",
4423
4424
  {
4424
4425
  className: m.message,
4425
- "aria-label": `Message from ${I.author}`,
4426
+ "aria-label": `Message from ${n.author}`,
4426
4427
  children: [
4427
4428
  /* @__PURE__ */ M(
4428
4429
  pw,
4429
4430
  {
4430
4431
  className: N(
4431
4432
  m.avatar,
4432
- I.role === "support" && m.supportAvatar
4433
+ n.role === "support" && m.supportAvatar
4433
4434
  ),
4434
- children: /* @__PURE__ */ M(Nw, { children: I.role === "support" ? /* @__PURE__ */ M(EM, { size: 16, "aria-hidden": "true" }) : I.author.trim().slice(0, 2).toUpperCase() })
4435
+ children: /* @__PURE__ */ M(Nw, { children: n.role === "support" ? /* @__PURE__ */ M(EM, { size: 16, "aria-hidden": "true" }) : n.author.trim().slice(0, 2).toUpperCase() })
4435
4436
  }
4436
4437
  ),
4437
4438
  /* @__PURE__ */ u("div", { className: m.messageContent, children: [
4438
4439
  /* @__PURE__ */ u("div", { className: m.messageMeta, children: [
4439
- /* @__PURE__ */ M("strong", { children: I.author }),
4440
- I.role === "support" && /* @__PURE__ */ M("span", { className: m.staff, children: "Support" }),
4441
- /* @__PURE__ */ M("time", { dateTime: I.createdAt, children: I.timeLabel })
4440
+ /* @__PURE__ */ M("strong", { children: n.author }),
4441
+ n.role === "support" && /* @__PURE__ */ M("span", { className: m.staff, children: "Support" }),
4442
+ /* @__PURE__ */ M("time", { dateTime: n.createdAt, children: n.timeLabel })
4442
4443
  ] }),
4443
- /* @__PURE__ */ M("p", { children: I.body })
4444
+ /* @__PURE__ */ M("p", { children: n.body })
4444
4445
  ] })
4445
4446
  ]
4446
4447
  },
4447
- I.id
4448
+ n.id
4448
4449
  )),
4449
- T && /* @__PURE__ */ M(K, { children: /* @__PURE__ */ u("div", { className: m.rating, children: [
4450
+ w && /* @__PURE__ */ M(K, { children: /* @__PURE__ */ u("div", { className: m.rating, children: [
4450
4451
  /* @__PURE__ */ M("strong", { children: "How did we do?" }),
4451
4452
  /* @__PURE__ */ M(
4452
4453
  "div",
@@ -4454,20 +4455,20 @@ function sg({
4454
4455
  className: m.ratingOptions,
4455
4456
  role: "group",
4456
4457
  "aria-label": "Rate your support experience",
4457
- children: $w.map((I, z) => /* @__PURE__ */ M(
4458
+ children: $w.map((n, T) => /* @__PURE__ */ M(
4458
4459
  h,
4459
4460
  {
4460
4461
  variant: "secondary",
4461
- "aria-label": `${z + 1} — ${I}`,
4462
- "aria-pressed": j === z + 1,
4462
+ "aria-label": `${T + 1} — ${n}`,
4463
+ "aria-pressed": j === T + 1,
4463
4464
  disabled: !o || r || j !== void 0,
4464
4465
  onClick: async () => {
4465
4466
  if (!(!o || a.current)) {
4466
- a.current = !0, _(!0), L(""), O(!1);
4467
+ a.current = !0, _(!0), L(""), z(!1);
4467
4468
  try {
4468
- await o(e.id, z + 1), y(z + 1), L("Thank you for your feedback.");
4469
+ await o(e.id, T + 1), y(T + 1), L("Thank you for your feedback.");
4469
4470
  } catch {
4470
- O(!0), L(
4471
+ z(!0), L(
4471
4472
  "Your rating was not saved. Please try again."
4472
4473
  );
4473
4474
  } finally {
@@ -4475,9 +4476,9 @@ function sg({
4475
4476
  }
4476
4477
  }
4477
4478
  },
4478
- children: z + 1
4479
+ children: T + 1
4479
4480
  },
4480
- I
4481
+ n
4481
4482
  ))
4482
4483
  }
4483
4484
  ),
@@ -4490,18 +4491,18 @@ function sg({
4490
4491
  ]
4491
4492
  }
4492
4493
  ),
4493
- !T && /* @__PURE__ */ u(
4494
+ !w && /* @__PURE__ */ u(
4494
4495
  "form",
4495
4496
  {
4496
4497
  className: m.reply,
4497
4498
  "aria-label": "Reply to ticket",
4498
- onSubmit: async (I) => {
4499
- if (I.preventDefault(), !(!s || !l.trim() || a.current)) {
4500
- a.current = !0, _(!0), L(""), O(!1);
4499
+ onSubmit: async (n) => {
4500
+ if (n.preventDefault(), !(!s || !l.trim() || a.current)) {
4501
+ a.current = !0, _(!0), L(""), z(!1);
4501
4502
  try {
4502
4503
  await s(e.id, l.trim()), t(""), L("Reply sent.");
4503
4504
  } catch {
4504
- O(!0), L(
4505
+ z(!0), L(
4505
4506
  "Your reply was not sent. Your message is still here; please try again."
4506
4507
  );
4507
4508
  } finally {
@@ -4510,17 +4511,17 @@ function sg({
4510
4511
  }
4511
4512
  },
4512
4513
  children: [
4513
- /* @__PURE__ */ M("label", { htmlFor: n, children: "Your reply" }),
4514
+ /* @__PURE__ */ M("label", { htmlFor: O, children: "Your reply" }),
4514
4515
  /* @__PURE__ */ M(
4515
4516
  "textarea",
4516
4517
  {
4517
- id: n,
4518
+ id: O,
4518
4519
  className: m.textarea,
4519
4520
  rows: 3,
4520
4521
  maxLength: 5e3,
4521
4522
  value: l,
4522
4523
  disabled: r,
4523
- onChange: (I) => t(I.target.value)
4524
+ onChange: (n) => t(n.target.value)
4524
4525
  }
4525
4526
  ),
4526
4527
  /* @__PURE__ */ u("div", { className: m.formActions, children: [
@@ -4538,7 +4539,7 @@ function sg({
4538
4539
  ]
4539
4540
  }
4540
4541
  ),
4541
- T && /* @__PURE__ */ M("div", { className: m.resolvedFooter, children: "Open a new ticket for more help." }),
4542
+ w && /* @__PURE__ */ M("div", { className: m.resolvedFooter, children: "Open a new ticket for more help." }),
4542
4543
  /* @__PURE__ */ M("p", { className: m.feedback, role: Y ? "alert" : "status", children: d })
4543
4544
  ] });
4544
4545
  }
@@ -4613,22 +4614,22 @@ const ee = {
4613
4614
  [2.5, 0.1, 0.7, 12],
4614
4615
  [1.6, 1.8, 0.8, -8],
4615
4616
  [3.4, 2, 0.6, 18]
4616
- ].map(([O, n, T, I], z) => /* @__PURE__ */ M(
4617
+ ].map(([z, O, w, n], T) => /* @__PURE__ */ M(
4617
4618
  "g",
4618
4619
  {
4619
- transform: `translate(${O * d} ${n * d}) rotate(${I} ${d * T / 2} ${d * T / 2})`,
4620
+ transform: `translate(${z * d} ${O * d}) rotate(${n} ${d * w / 2} ${d * w / 2})`,
4620
4621
  children: /* @__PURE__ */ M(
4621
4622
  "svg",
4622
4623
  {
4623
- width: d * T,
4624
- height: d * T,
4624
+ width: d * w,
4625
+ height: d * w,
4625
4626
  viewBox: "0 0 100 100",
4626
4627
  className: ee["rp-card-pattern-icon"],
4627
4628
  children: t
4628
4629
  }
4629
4630
  )
4630
4631
  },
4631
- z
4632
+ T
4632
4633
  ))
4633
4634
  }
4634
4635
  ) }),
@@ -4640,7 +4641,7 @@ const ee = {
4640
4641
  ] }) : /* @__PURE__ */ M(s, { className: Y, ...j, children: l });
4641
4642
  };
4642
4643
  function A(e, s) {
4643
- const o = H(function({ size: t = 16, "aria-label": r, "aria-labelledby": _, ...a }, j) {
4644
+ const o = X(function({ size: t = 16, "aria-label": r, "aria-labelledby": _, ...a }, j) {
4644
4645
  const y = {
4645
4646
  width: t,
4646
4647
  height: t,
@@ -4923,7 +4924,7 @@ const HI = { Root: og, Control: ug }, lg = {
4923
4924
  }
4924
4925
  );
4925
4926
  function mg() {
4926
- const e = V(null);
4927
+ const e = H(null);
4927
4928
  return async (s, o) => {
4928
4929
  if (e.current) return;
4929
4930
  const l = () => ZM(s), t = o.ownerDocument, r = t.defaultView;
@@ -4978,17 +4979,17 @@ const wg = {
4978
4979
  popupTheme: L,
4979
4980
  popupAnchor: Y
4980
4981
  }) => {
4981
- const O = (n) => /* @__PURE__ */ u(
4982
+ const z = H(!1), O = (w) => /* @__PURE__ */ u(
4982
4983
  dg,
4983
4984
  {
4984
- value: n.value,
4985
- disabled: n.disabled,
4985
+ value: w.value,
4986
+ disabled: w.disabled,
4986
4987
  children: [
4987
- /* @__PURE__ */ M(ig, { children: n.label }),
4988
+ /* @__PURE__ */ M(ig, { children: w.label }),
4988
4989
  /* @__PURE__ */ M(Lg, {})
4989
4990
  ]
4990
4991
  },
4991
- n.value
4992
+ w.value
4992
4993
  );
4993
4994
  return /* @__PURE__ */ u(
4994
4995
  _g,
@@ -5003,8 +5004,14 @@ const wg = {
5003
5004
  className: N(wg["rp-select-trigger"], j),
5004
5005
  "aria-label": r,
5005
5006
  tabIndex: _,
5006
- onClick: (n) => {
5007
- n.detail > 0 && n.preventDefault();
5007
+ onPointerDownCapture: () => {
5008
+ z.current = !0;
5009
+ },
5010
+ onKeyDownCapture: () => {
5011
+ z.current = !1;
5012
+ },
5013
+ onClick: (w) => {
5014
+ w.detail > 0 && w.preventDefault();
5008
5015
  },
5009
5016
  children: [
5010
5017
  y ?? /* @__PURE__ */ M(pg, { placeholder: t }),
@@ -5020,12 +5027,21 @@ const wg = {
5020
5027
  align: d,
5021
5028
  sideOffset: 4,
5022
5029
  collisionPadding: 16,
5030
+ onPointerDownCapture: () => {
5031
+ z.current = !0;
5032
+ },
5033
+ onKeyDownCapture: () => {
5034
+ z.current = !1;
5035
+ },
5036
+ onCloseAutoFocus: (w) => {
5037
+ z.current && w.preventDefault();
5038
+ },
5023
5039
  children: /* @__PURE__ */ u(jg, { children: [
5024
5040
  /* @__PURE__ */ M(Ue, { children: o.map(O) }),
5025
- l.map((n) => /* @__PURE__ */ u(Ue, { children: [
5026
- /* @__PURE__ */ M(Dg, { children: n.label }),
5027
- n.options.map(O)
5028
- ] }, n.label))
5041
+ l.map((w) => /* @__PURE__ */ u(Ue, { children: [
5042
+ /* @__PURE__ */ M(Dg, { children: w.label }),
5043
+ w.options.map(O)
5044
+ ] }, w.label))
5029
5045
  ] })
5030
5046
  }
5031
5047
  ) })
@@ -5274,51 +5290,51 @@ const $I = ({
5274
5290
  sortBy: d,
5275
5291
  onSortChange: L,
5276
5292
  onSubscribe: Y,
5277
- onManage: O,
5278
- onConfigure: n,
5279
- creditsBalance: T,
5280
- onTopUp: I,
5281
- className: z
5293
+ onManage: z,
5294
+ onConfigure: O,
5295
+ creditsBalance: w,
5296
+ onTopUp: n,
5297
+ className: T
5282
5298
  }) => {
5283
- const C = s !== void 0, [b, W] = Q("all"), [P, k] = Q(""), [X, le] = Q("all"), [$, te] = Q("recommended"), w = t ?? b, E = _ ?? P, U = j ?? X, B = d ?? $, ge = (D) => {
5299
+ const C = s !== void 0, [b, W] = Q("all"), [P, k] = Q(""), [V, le] = Q("all"), [$, te] = Q("recommended"), g = t ?? b, E = _ ?? P, U = j ?? V, B = d ?? $, ge = (D) => {
5284
5300
  t === void 0 && W(D), r?.(D);
5285
5301
  }, Ie = (D) => {
5286
5302
  _ === void 0 && k(D), a?.(D);
5287
5303
  }, ne = (D) => {
5288
5304
  j === void 0 && le(D), y?.(D);
5289
5305
  }, AM = (D) => {
5290
- const g = D;
5291
- d === void 0 && te(g), L?.(g);
5292
- }, re = C ? o ?? pI : aI, Ae = re.map((D) => D.label), TM = re.find((D) => D.id === w)?.label ?? Ae[0] ?? "All", zM = _e(() => {
5293
- const D = s ?? l ?? [], g = Array.from(new Set(D.map((S) => S.provider)));
5306
+ const I = D;
5307
+ d === void 0 && te(I), L?.(I);
5308
+ }, re = C ? o ?? pI : aI, Ae = re.map((D) => D.label), TM = re.find((D) => D.id === g)?.label ?? Ae[0] ?? "All", zM = _e(() => {
5309
+ const D = s ?? l ?? [], I = Array.from(new Set(D.map((S) => S.provider)));
5294
5310
  return [
5295
5311
  { value: "all", label: "All providers" },
5296
- ...g.map((S) => ({ value: S, label: S }))
5312
+ ...I.map((S) => ({ value: S, label: S }))
5297
5313
  ];
5298
5314
  }, [s, l]), Te = _e(() => {
5299
5315
  if (!s) return [];
5300
5316
  let D = [...s];
5301
5317
  if (E.trim()) {
5302
- const g = E.toLowerCase();
5318
+ const I = E.toLowerCase();
5303
5319
  D = D.filter(
5304
- (S) => S.name.toLowerCase().includes(g) || S.id.toLowerCase().includes(g) || S.provider.toLowerCase().includes(g)
5320
+ (S) => S.name.toLowerCase().includes(I) || S.id.toLowerCase().includes(I) || S.provider.toLowerCase().includes(I)
5305
5321
  );
5306
5322
  }
5307
- return w !== "all" && (D = D.filter((g) => g.category === w)), U !== "all" && (D = D.filter((g) => g.provider === U)), D.sort((g, S) => B === "price-asc" ? ue(g.price, g.priceValue) - ue(S.price, S.priceValue) : B === "price-desc" ? ue(S.price, S.priceValue) - ue(g.price, g.priceValue) : (S.featured ? 1 : 0) - (g.featured ? 1 : 0)), D;
5308
- }, [s, E, w, U, B]), ze = _e(() => {
5323
+ return g !== "all" && (D = D.filter((I) => I.category === g)), U !== "all" && (D = D.filter((I) => I.provider === U)), D.sort((I, S) => B === "price-asc" ? ue(I.price, I.priceValue) - ue(S.price, S.priceValue) : B === "price-desc" ? ue(S.price, S.priceValue) - ue(I.price, I.priceValue) : (S.featured ? 1 : 0) - (I.featured ? 1 : 0)), D;
5324
+ }, [s, E, g, U, B]), ze = _e(() => {
5309
5325
  if (!l) return [];
5310
5326
  let D = [...l];
5311
5327
  if (E.trim()) {
5312
- const g = E.toLowerCase();
5328
+ const I = E.toLowerCase();
5313
5329
  D = D.filter(
5314
- (S) => S.name.toLowerCase().includes(g) || S.id.toLowerCase().includes(g) || S.provider.toLowerCase().includes(g) || S.description.toLowerCase().includes(g)
5330
+ (S) => S.name.toLowerCase().includes(I) || S.id.toLowerCase().includes(I) || S.provider.toLowerCase().includes(I) || S.description.toLowerCase().includes(I)
5315
5331
  );
5316
5332
  }
5317
- return w !== "all" && (D = D.filter((g) => g.category === w)), U !== "all" && (D = D.filter((g) => g.provider === U)), D.sort((g, S) => B === "speed" ? Number.parseInt(g.latency, 10) - Number.parseInt(S.latency, 10) : B === "recommended" ? (S.featured ? 1 : 0) - (g.featured ? 1 : 0) : 0), D;
5318
- }, [l, E, w, U, B]), kM = C ? Te : [], SM = C && Te.length === 0 || !C && ze.length === 0, xM = () => {
5333
+ return g !== "all" && (D = D.filter((I) => I.category === g)), U !== "all" && (D = D.filter((I) => I.provider === U)), D.sort((I, S) => B === "speed" ? Number.parseInt(I.latency, 10) - Number.parseInt(S.latency, 10) : B === "recommended" ? (S.featured ? 1 : 0) - (I.featured ? 1 : 0) : 0), D;
5334
+ }, [l, E, g, U, B]), kM = C ? Te : [], SM = C && Te.length === 0 || !C && ze.length === 0, xM = () => {
5319
5335
  Ie(""), ge("all"), ne("all");
5320
5336
  };
5321
- return /* @__PURE__ */ u("section", { className: N(c.shop, z), "aria-label": "Marketplace", children: [
5337
+ return /* @__PURE__ */ u("section", { className: N(c.shop, T), "aria-label": "Marketplace", children: [
5322
5338
  /* @__PURE__ */ M("header", { className: c.header, children: /* @__PURE__ */ M("h1", { className: c.title, children: e ?? (C ? "Subscriptions" : "Models") }) }),
5323
5339
  /* @__PURE__ */ u("div", { className: c.controls, children: [
5324
5340
  /* @__PURE__ */ u("div", { className: c.searchRow, children: [
@@ -5360,24 +5376,24 @@ const $I = ({
5360
5376
  options: Ae,
5361
5377
  value: TM,
5362
5378
  onChange: (D) => ge(
5363
- re.find((g) => g.label === D)?.id ?? D
5379
+ re.find((I) => I.label === D)?.id ?? D
5364
5380
  ),
5365
5381
  label: C ? "Subscription categories" : "Model categories",
5366
5382
  className: c.categories
5367
5383
  }
5368
5384
  ),
5369
- (T !== void 0 || I) && /* @__PURE__ */ u("div", { className: c.balance, children: [
5370
- T !== void 0 && /* @__PURE__ */ M("span", { className: c.balanceFigures, children: /* @__PURE__ */ u("span", { className: c.credits, children: [
5385
+ (w !== void 0 || n) && /* @__PURE__ */ u("div", { className: c.balance, children: [
5386
+ w !== void 0 && /* @__PURE__ */ M("span", { className: c.balanceFigures, children: /* @__PURE__ */ u("span", { className: c.credits, children: [
5371
5387
  /* @__PURE__ */ M(Z.Bolt, { size: 13 }),
5372
- T
5388
+ w
5373
5389
  ] }) }),
5374
- I && /* @__PURE__ */ u(
5390
+ n && /* @__PURE__ */ u(
5375
5391
  h,
5376
5392
  {
5377
5393
  variant: "primary",
5378
5394
  textVariant: x.Button_Link_Small_1,
5379
5395
  className: c.topUp,
5380
- onClick: I,
5396
+ onClick: n,
5381
5397
  children: [
5382
5398
  /* @__PURE__ */ M(Z.Plus, { size: 14 }),
5383
5399
  "Top up"
@@ -5393,7 +5409,7 @@ const $I = ({
5393
5409
  {
5394
5410
  account: D,
5395
5411
  onSubscribe: Y,
5396
- onManage: O
5412
+ onManage: z
5397
5413
  },
5398
5414
  D.id
5399
5415
  )) : ze.map((D) => /* @__PURE__ */ M(
@@ -5401,7 +5417,7 @@ const $I = ({
5401
5417
  {
5402
5418
  model: D,
5403
5419
  onSubscribe: Y,
5404
- onConfigure: n
5420
+ onConfigure: O
5405
5421
  },
5406
5422
  D.id
5407
5423
  )),
@@ -5703,28 +5719,28 @@ const i = {
5703
5719
  onResizeEnd: d,
5704
5720
  resizerLabel: L = "Sidebar width",
5705
5721
  className: Y,
5706
- style: O,
5707
- loadingLabel: n = "Loading navigation"
5722
+ style: z,
5723
+ loadingLabel: O = "Loading navigation"
5708
5724
  }) => {
5709
- const [T, I] = Q(r), z = t ?? T, C = V(z), b = V(null), [W, P] = Q(!1), k = (w) => {
5710
- const E = EI(w, _, a);
5711
- return C.current = E, t === void 0 && I(E), y?.(E), E;
5712
- }, X = (w) => {
5713
- w.button === 0 && (w.preventDefault(), w.currentTarget.setPointerCapture(w.pointerId), b.current = {
5714
- pointerId: w.pointerId,
5715
- startX: w.clientX,
5716
- startWidth: z
5717
- }, C.current = z, P(!0));
5718
- }, le = (w) => {
5725
+ const [w, n] = Q(r), T = t ?? w, C = H(T), b = H(null), [W, P] = Q(!1), k = (g) => {
5726
+ const E = EI(g, _, a);
5727
+ return C.current = E, t === void 0 && n(E), y?.(E), E;
5728
+ }, V = (g) => {
5729
+ g.button === 0 && (g.preventDefault(), g.currentTarget.setPointerCapture(g.pointerId), b.current = {
5730
+ pointerId: g.pointerId,
5731
+ startX: g.clientX,
5732
+ startWidth: T
5733
+ }, C.current = T, P(!0));
5734
+ }, le = (g) => {
5719
5735
  const E = b.current;
5720
- !E || E.pointerId !== w.pointerId || k(E.startWidth + (w.clientX - E.startX));
5721
- }, $ = (w) => {
5722
- b.current?.pointerId === w.pointerId && (b.current = null, w.currentTarget.hasPointerCapture(w.pointerId) && w.currentTarget.releasePointerCapture(w.pointerId), P(!1), d?.(C.current));
5723
- }, te = (w) => {
5724
- const E = w.shiftKey ? 32 : 8;
5736
+ !E || E.pointerId !== g.pointerId || k(E.startWidth + (g.clientX - E.startX));
5737
+ }, $ = (g) => {
5738
+ b.current?.pointerId === g.pointerId && (b.current = null, g.currentTarget.hasPointerCapture(g.pointerId) && g.currentTarget.releasePointerCapture(g.pointerId), P(!1), d?.(C.current));
5739
+ }, te = (g) => {
5740
+ const E = g.shiftKey ? 32 : 8;
5725
5741
  let U;
5726
- if (w.key === "ArrowLeft" ? U = z - E : w.key === "ArrowRight" ? U = z + E : w.key === "Home" ? U = _ : w.key === "End" && (U = a), U === void 0) return;
5727
- w.preventDefault();
5742
+ if (g.key === "ArrowLeft" ? U = T - E : g.key === "ArrowRight" ? U = T + E : g.key === "Home" ? U = _ : g.key === "End" && (U = a), U === void 0) return;
5743
+ g.preventDefault();
5728
5744
  const B = k(U);
5729
5745
  d?.(B);
5730
5746
  };
@@ -5738,12 +5754,12 @@ const i = {
5738
5754
  "data-resizable": j ? "" : void 0,
5739
5755
  "data-resizing": W ? "" : void 0,
5740
5756
  style: {
5741
- "--rp-side-nav-width": `${z}px`,
5742
- ...t !== void 0 || r !== Ge ? { "--rp-side-nav-width-narrow": `${z}px` } : {},
5743
- ...O
5757
+ "--rp-side-nav-width": `${T}px`,
5758
+ ...t !== void 0 || r !== Ge ? { "--rp-side-nav-width-narrow": `${T}px` } : {},
5759
+ ...z
5744
5760
  },
5745
5761
  children: [
5746
- /* @__PURE__ */ M(nM.Provider, { value: { collapsed: o }, children: l ? /* @__PURE__ */ M(CI, { label: n }) : e }),
5762
+ /* @__PURE__ */ M(nM.Provider, { value: { collapsed: o }, children: l ? /* @__PURE__ */ M(CI, { label: O }) : e }),
5747
5763
  j && !o ? /* @__PURE__ */ M(
5748
5764
  "div",
5749
5765
  {
@@ -5751,11 +5767,11 @@ const i = {
5751
5767
  role: "separator",
5752
5768
  "aria-orientation": "vertical",
5753
5769
  "aria-label": L,
5754
- "aria-valuenow": z,
5770
+ "aria-valuenow": T,
5755
5771
  "aria-valuemin": _,
5756
5772
  "aria-valuemax": a,
5757
5773
  tabIndex: 0,
5758
- onPointerDown: X,
5774
+ onPointerDown: V,
5759
5775
  onPointerMove: le,
5760
5776
  onPointerUp: $,
5761
5777
  onPointerCancel: $,
@@ -5854,14 +5870,14 @@ const i = {
5854
5870
  expanded: d = !1,
5855
5871
  controls: L,
5856
5872
  expandDirection: Y = "down",
5857
- title: O,
5858
- draggable: n = !1,
5859
- dragging: T = !1,
5860
- onDragStart: I,
5861
- onDragEnd: z,
5873
+ title: z,
5874
+ draggable: O = !1,
5875
+ dragging: w = !1,
5876
+ onDragStart: n,
5877
+ onDragEnd: T,
5862
5878
  className: C
5863
5879
  }) => {
5864
- const { collapsed: b } = _M(nM), W = O ?? (b && typeof e == "string" ? e : void 0), P = /* @__PURE__ */ u(K, { children: [
5880
+ const { collapsed: b } = _M(nM), W = z ?? (b && typeof e == "string" ? e : void 0), P = /* @__PURE__ */ u(K, { children: [
5865
5881
  s ? /* @__PURE__ */ M("span", { className: i["rp-side-nav__icon"], "aria-hidden": "true", children: s }) : null,
5866
5882
  /* @__PURE__ */ M("span", { className: i["rp-side-nav__label"], children: e }),
5867
5883
  o !== void 0 ? /* @__PURE__ */ M("span", { className: i["rp-side-nav__badge"], children: o }) : null,
@@ -5893,8 +5909,8 @@ const i = {
5893
5909
  i["rp-side-nav__item"],
5894
5910
  r && i["rp-side-nav__item--current"],
5895
5911
  l && i["rp-side-nav__item--dot"],
5896
- n && i["rp-side-nav__item--draggable"],
5897
- T && i["rp-side-nav__item--dragging"],
5912
+ O && i["rp-side-nav__item--draggable"],
5913
+ w && i["rp-side-nav__item--dragging"],
5898
5914
  C
5899
5915
  );
5900
5916
  return /* @__PURE__ */ M("li", { className: i["rp-side-nav__item-wrap"], children: a !== void 0 ? /* @__PURE__ */ M(
@@ -5908,15 +5924,15 @@ const i = {
5908
5924
  "aria-disabled": _ || void 0,
5909
5925
  tabIndex: _ ? -1 : void 0,
5910
5926
  title: W,
5911
- draggable: n || void 0,
5912
- onDragStart: I,
5913
- onDragEnd: z,
5914
- onClick: (X) => {
5927
+ draggable: O || void 0,
5928
+ onDragStart: n,
5929
+ onDragEnd: T,
5930
+ onClick: (V) => {
5915
5931
  if (_) {
5916
- X.preventDefault();
5932
+ V.preventDefault();
5917
5933
  return;
5918
5934
  }
5919
- j?.(X);
5935
+ j?.(V);
5920
5936
  },
5921
5937
  children: P
5922
5938
  }
@@ -5930,10 +5946,10 @@ const i = {
5930
5946
  "aria-controls": y && !b ? L : void 0,
5931
5947
  disabled: _,
5932
5948
  title: W,
5933
- draggable: n || void 0,
5934
- onDragStart: I,
5935
- onDragEnd: z,
5936
- onClick: (X) => j?.(X),
5949
+ draggable: O || void 0,
5950
+ onDragStart: n,
5951
+ onDragEnd: T,
5952
+ onClick: (V) => j?.(V),
5937
5953
  children: P
5938
5954
  }
5939
5955
  ) });