@crowdin/app-project-module 3.2.2 → 3.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) hide show
  1. package/out/middlewares/integration-access-denied.d.ts +6 -2
  2. package/out/middlewares/integration-access-denied.js +25 -11
  3. package/out/modules/about.js +2 -10
  4. package/out/modules/api/api.js +7 -0
  5. package/out/modules/api/components.d.ts +6 -1
  6. package/out/modules/api/components.js +6 -1
  7. package/out/modules/integration/handlers/crowdin-update.js +33 -6
  8. package/out/modules/integration/handlers/integration-update.js +1 -1
  9. package/out/modules/integration/handlers/job-list.d.ts +8 -2
  10. package/out/modules/integration/handlers/job-list.js +30 -11
  11. package/out/modules/integration/handlers/main.js +15 -5
  12. package/out/modules/integration/types.d.ts +8 -0
  13. package/out/modules/integration/util/types.d.ts +2 -0
  14. package/out/static/css/styles.css +1 -1
  15. package/out/static/img/crowdin_small.svg +8 -7
  16. package/out/static/ui/about.bundle.js +11 -1
  17. package/out/static/ui/about.bundle.js.map +1 -1
  18. package/out/static/ui/error.bundle.js +8 -8
  19. package/out/static/ui/error.bundle.js.map +1 -1
  20. package/out/static/ui/form.bundle.js.map +1 -1
  21. package/out/static/ui/login.bundle.js +4 -4
  22. package/out/static/ui/login.bundle.js.map +1 -1
  23. package/out/static/ui/main.bundle.js +750 -687
  24. package/out/static/ui/main.bundle.js.map +1 -1
  25. package/out/static/ui/subscription.bundle.js +1 -1
  26. package/out/static/ui/subscription.bundle.js.map +1 -1
  27. package/out/storage/drizzle/index.js +6 -1
  28. package/out/util/index.d.ts +1 -0
  29. package/out/util/index.js +16 -1
  30. package/out/util/logo.d.ts +4 -0
  31. package/out/util/logo.js +47 -0
  32. package/out/util/static-files.d.ts +4 -1
  33. package/out/util/static-files.js +26 -4
  34. package/package.json +2 -1
@@ -18718,6 +18718,11 @@
18718
18718
  toast(message);
18719
18719
  }
18720
18720
  }
18721
+ function contactUser(userId) {
18722
+ AP.getContext(function (context) {
18723
+ AP.redirect(`${context.organization_id ? '/u' : ''}/messages/create/${userId}`);
18724
+ });
18725
+ }
18721
18726
  function reloadLocation() {
18722
18727
  ensureInitialized();
18723
18728
  window.location.href =
@@ -19057,7 +19062,7 @@
19057
19062
  */
19058
19063
 
19059
19064
 
19060
- const __iconData$E = {
19065
+ const __iconData$D = {
19061
19066
  name: "arrow-down",
19062
19067
  size: 24,
19063
19068
  node: [
@@ -19065,8 +19070,8 @@
19065
19070
  ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
19066
19071
  ]
19067
19072
  };
19068
- __iconData$E.node;
19069
- const ArrowDown = createLucideIcon(__iconData$E);
19073
+ __iconData$D.node;
19074
+ const ArrowDown = createLucideIcon(__iconData$D);
19070
19075
 
19071
19076
  /**
19072
19077
  * @license lucide-react v1.44.0 - ISC
@@ -19076,7 +19081,7 @@
19076
19081
  */
19077
19082
 
19078
19083
 
19079
- const __iconData$D = {
19084
+ const __iconData$C = {
19080
19085
  name: "arrow-left",
19081
19086
  size: 24,
19082
19087
  node: [
@@ -19084,8 +19089,8 @@
19084
19089
  ["path", { d: "M19 12H5", key: "x3x0zl" }]
19085
19090
  ]
19086
19091
  };
19087
- __iconData$D.node;
19088
- const ArrowLeft = createLucideIcon(__iconData$D);
19092
+ __iconData$C.node;
19093
+ const ArrowLeft = createLucideIcon(__iconData$C);
19089
19094
 
19090
19095
  /**
19091
19096
  * @license lucide-react v1.44.0 - ISC
@@ -19095,7 +19100,7 @@
19095
19100
  */
19096
19101
 
19097
19102
 
19098
- const __iconData$C = {
19103
+ const __iconData$B = {
19099
19104
  name: "arrow-up",
19100
19105
  size: 24,
19101
19106
  node: [
@@ -19103,8 +19108,8 @@
19103
19108
  ["path", { d: "M12 19V5", key: "x0mq9r" }]
19104
19109
  ]
19105
19110
  };
19106
- __iconData$C.node;
19107
- const ArrowUp = createLucideIcon(__iconData$C);
19111
+ __iconData$B.node;
19112
+ const ArrowUp = createLucideIcon(__iconData$B);
19108
19113
 
19109
19114
  /**
19110
19115
  * @license lucide-react v1.44.0 - ISC
@@ -19114,7 +19119,7 @@
19114
19119
  */
19115
19120
 
19116
19121
 
19117
- const __iconData$B = {
19122
+ const __iconData$A = {
19118
19123
  name: "ban",
19119
19124
  size: 24,
19120
19125
  node: [
@@ -19122,8 +19127,8 @@
19122
19127
  ["path", { d: "M4.929 4.929 19.07 19.071", key: "196cmz" }]
19123
19128
  ]
19124
19129
  };
19125
- __iconData$B.node;
19126
- const Ban = createLucideIcon(__iconData$B);
19130
+ __iconData$A.node;
19131
+ const Ban = createLucideIcon(__iconData$A);
19127
19132
 
19128
19133
  /**
19129
19134
  * @license lucide-react v1.44.0 - ISC
@@ -19133,13 +19138,13 @@
19133
19138
  */
19134
19139
 
19135
19140
 
19136
- const __iconData$A = {
19141
+ const __iconData$z = {
19137
19142
  name: "check",
19138
19143
  size: 24,
19139
19144
  node: [["path", { d: "M20 6 9 17l-5-5", key: "1gmf2c" }]]
19140
19145
  };
19141
- __iconData$A.node;
19142
- const Check = createLucideIcon(__iconData$A);
19146
+ __iconData$z.node;
19147
+ const Check = createLucideIcon(__iconData$z);
19143
19148
 
19144
19149
  /**
19145
19150
  * @license lucide-react v1.44.0 - ISC
@@ -19149,13 +19154,13 @@
19149
19154
  */
19150
19155
 
19151
19156
 
19152
- const __iconData$z = {
19157
+ const __iconData$y = {
19153
19158
  name: "chevron-down",
19154
19159
  size: 24,
19155
19160
  node: [["path", { d: "m6 9 6 6 6-6", key: "qrunsl" }]]
19156
19161
  };
19157
- __iconData$z.node;
19158
- const ChevronDown = createLucideIcon(__iconData$z);
19162
+ __iconData$y.node;
19163
+ const ChevronDown = createLucideIcon(__iconData$y);
19159
19164
 
19160
19165
  /**
19161
19166
  * @license lucide-react v1.44.0 - ISC
@@ -19165,13 +19170,13 @@
19165
19170
  */
19166
19171
 
19167
19172
 
19168
- const __iconData$y = {
19173
+ const __iconData$x = {
19169
19174
  name: "chevron-left",
19170
19175
  size: 24,
19171
19176
  node: [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]]
19172
19177
  };
19173
- __iconData$y.node;
19174
- const ChevronLeft = createLucideIcon(__iconData$y);
19178
+ __iconData$x.node;
19179
+ const ChevronLeft = createLucideIcon(__iconData$x);
19175
19180
 
19176
19181
  /**
19177
19182
  * @license lucide-react v1.44.0 - ISC
@@ -19181,13 +19186,13 @@
19181
19186
  */
19182
19187
 
19183
19188
 
19184
- const __iconData$x = {
19189
+ const __iconData$w = {
19185
19190
  name: "chevron-right",
19186
19191
  size: 24,
19187
19192
  node: [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]]
19188
19193
  };
19189
- __iconData$x.node;
19190
- const ChevronRight = createLucideIcon(__iconData$x);
19194
+ __iconData$w.node;
19195
+ const ChevronRight = createLucideIcon(__iconData$w);
19191
19196
 
19192
19197
  /**
19193
19198
  * @license lucide-react v1.44.0 - ISC
@@ -19197,13 +19202,13 @@
19197
19202
  */
19198
19203
 
19199
19204
 
19200
- const __iconData$w = {
19205
+ const __iconData$v = {
19201
19206
  name: "chevron-up",
19202
19207
  size: 24,
19203
19208
  node: [["path", { d: "m18 15-6-6-6 6", key: "153udz" }]]
19204
19209
  };
19205
- __iconData$w.node;
19206
- const ChevronUp = createLucideIcon(__iconData$w);
19210
+ __iconData$v.node;
19211
+ const ChevronUp = createLucideIcon(__iconData$v);
19207
19212
 
19208
19213
  /**
19209
19214
  * @license lucide-react v1.44.0 - ISC
@@ -19213,7 +19218,7 @@
19213
19218
  */
19214
19219
 
19215
19220
 
19216
- const __iconData$v = {
19221
+ const __iconData$u = {
19217
19222
  name: "chevrons-down",
19218
19223
  size: 24,
19219
19224
  node: [
@@ -19221,8 +19226,8 @@
19221
19226
  ["path", { d: "m7 13 5 5 5-5", key: "1d48rs" }]
19222
19227
  ]
19223
19228
  };
19224
- __iconData$v.node;
19225
- const ChevronsDown = createLucideIcon(__iconData$v);
19229
+ __iconData$u.node;
19230
+ const ChevronsDown = createLucideIcon(__iconData$u);
19226
19231
 
19227
19232
  /**
19228
19233
  * @license lucide-react v1.44.0 - ISC
@@ -19232,7 +19237,7 @@
19232
19237
  */
19233
19238
 
19234
19239
 
19235
- const __iconData$u = {
19240
+ const __iconData$t = {
19236
19241
  name: "chevrons-left",
19237
19242
  size: 24,
19238
19243
  node: [
@@ -19240,8 +19245,8 @@
19240
19245
  ["path", { d: "m18 17-5-5 5-5", key: "h8a8et" }]
19241
19246
  ]
19242
19247
  };
19243
- __iconData$u.node;
19244
- const ChevronsLeft = createLucideIcon(__iconData$u);
19248
+ __iconData$t.node;
19249
+ const ChevronsLeft = createLucideIcon(__iconData$t);
19245
19250
 
19246
19251
  /**
19247
19252
  * @license lucide-react v1.44.0 - ISC
@@ -19251,7 +19256,7 @@
19251
19256
  */
19252
19257
 
19253
19258
 
19254
- const __iconData$t = {
19259
+ const __iconData$s = {
19255
19260
  name: "chevrons-right",
19256
19261
  size: 24,
19257
19262
  node: [
@@ -19259,8 +19264,8 @@
19259
19264
  ["path", { d: "m13 17 5-5-5-5", key: "17xmmf" }]
19260
19265
  ]
19261
19266
  };
19262
- __iconData$t.node;
19263
- const ChevronsRight = createLucideIcon(__iconData$t);
19267
+ __iconData$s.node;
19268
+ const ChevronsRight = createLucideIcon(__iconData$s);
19264
19269
 
19265
19270
  /**
19266
19271
  * @license lucide-react v1.44.0 - ISC
@@ -19270,7 +19275,7 @@
19270
19275
  */
19271
19276
 
19272
19277
 
19273
- const __iconData$s = {
19278
+ const __iconData$r = {
19274
19279
  name: "circle-check",
19275
19280
  size: 24,
19276
19281
  node: [
@@ -19279,29 +19284,8 @@
19279
19284
  ],
19280
19285
  aliases: ["check-circle-2"]
19281
19286
  };
19282
- __iconData$s.node;
19283
- const CircleCheck = createLucideIcon(__iconData$s);
19284
-
19285
- /**
19286
- * @license lucide-react v1.44.0 - ISC
19287
- *
19288
- * This source code is licensed under the ISC license.
19289
- * See the LICENSE file in the root directory of this source tree.
19290
- */
19291
-
19292
-
19293
- const __iconData$r = {
19294
- name: "circle-user-round",
19295
- size: 24,
19296
- node: [
19297
- ["path", { d: "M17.925 20.056a6 6 0 0 0-11.851.001", key: "z69sun" }],
19298
- ["circle", { cx: "12", cy: "11", r: "4", key: "1gt34v" }],
19299
- ["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }]
19300
- ],
19301
- aliases: ["user-circle-2"]
19302
- };
19303
19287
  __iconData$r.node;
19304
- const CircleUserRound = createLucideIcon(__iconData$r);
19288
+ const CircleCheck = createLucideIcon(__iconData$r);
19305
19289
 
19306
19290
  /**
19307
19291
  * @license lucide-react v1.44.0 - ISC
@@ -19566,29 +19550,6 @@
19566
19550
 
19567
19551
 
19568
19552
  const __iconData$e = {
19569
- name: "languages",
19570
- size: 24,
19571
- node: [
19572
- ["path", { d: "m5 8 6 6", key: "1wu5hv" }],
19573
- ["path", { d: "m4 14 6-6 2-3", key: "1k1g8d" }],
19574
- ["path", { d: "M2 5h12", key: "or177f" }],
19575
- ["path", { d: "M7 2h1", key: "1t2jsx" }],
19576
- ["path", { d: "m22 22-5-10-5 10", key: "don7ne" }],
19577
- ["path", { d: "M14 18h6", key: "1m8k6r" }]
19578
- ]
19579
- };
19580
- __iconData$e.node;
19581
- const Languages = createLucideIcon(__iconData$e);
19582
-
19583
- /**
19584
- * @license lucide-react v1.44.0 - ISC
19585
- *
19586
- * This source code is licensed under the ISC license.
19587
- * See the LICENSE file in the root directory of this source tree.
19588
- */
19589
-
19590
-
19591
- const __iconData$d = {
19592
19553
  name: "link",
19593
19554
  size: 24,
19594
19555
  node: [
@@ -19596,8 +19557,8 @@
19596
19557
  ["path", { d: "M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71", key: "19qd67" }]
19597
19558
  ]
19598
19559
  };
19599
- __iconData$d.node;
19600
- const Link = createLucideIcon(__iconData$d);
19560
+ __iconData$e.node;
19561
+ const Link = createLucideIcon(__iconData$e);
19601
19562
 
19602
19563
  /**
19603
19564
  * @license lucide-react v1.44.0 - ISC
@@ -19607,7 +19568,7 @@
19607
19568
  */
19608
19569
 
19609
19570
 
19610
- const __iconData$c = {
19571
+ const __iconData$d = {
19611
19572
  name: "list",
19612
19573
  size: 24,
19613
19574
  node: [
@@ -19619,8 +19580,8 @@
19619
19580
  ["path", { d: "M8 19h13", key: "m83p4d" }]
19620
19581
  ]
19621
19582
  };
19622
- __iconData$c.node;
19623
- const List$1 = createLucideIcon(__iconData$c);
19583
+ __iconData$d.node;
19584
+ const List$1 = createLucideIcon(__iconData$d);
19624
19585
 
19625
19586
  /**
19626
19587
  * @license lucide-react v1.44.0 - ISC
@@ -19630,14 +19591,14 @@
19630
19591
  */
19631
19592
 
19632
19593
 
19633
- const __iconData$b = {
19594
+ const __iconData$c = {
19634
19595
  name: "loader-circle",
19635
19596
  size: 24,
19636
19597
  node: [["path", { d: "M21 12a9 9 0 1 1-6.219-8.56", key: "13zald" }]],
19637
19598
  aliases: ["loader-2"]
19638
19599
  };
19639
- __iconData$b.node;
19640
- const LoaderCircle = createLucideIcon(__iconData$b);
19600
+ __iconData$c.node;
19601
+ const LoaderCircle = createLucideIcon(__iconData$c);
19641
19602
 
19642
19603
  /**
19643
19604
  * @license lucide-react v1.44.0 - ISC
@@ -19647,7 +19608,7 @@
19647
19608
  */
19648
19609
 
19649
19610
 
19650
- const __iconData$a = {
19611
+ const __iconData$b = {
19651
19612
  name: "mail-plus",
19652
19613
  size: 24,
19653
19614
  node: [
@@ -19657,8 +19618,8 @@
19657
19618
  ["path", { d: "M16 19h6", key: "xwg31i" }]
19658
19619
  ]
19659
19620
  };
19660
- __iconData$a.node;
19661
- const MailPlus = createLucideIcon(__iconData$a);
19621
+ __iconData$b.node;
19622
+ const MailPlus = createLucideIcon(__iconData$b);
19662
19623
 
19663
19624
  /**
19664
19625
  * @license lucide-react v1.44.0 - ISC
@@ -19668,13 +19629,13 @@
19668
19629
  */
19669
19630
 
19670
19631
 
19671
- const __iconData$9 = {
19632
+ const __iconData$a = {
19672
19633
  name: "minus",
19673
19634
  size: 24,
19674
19635
  node: [["path", { d: "M5 12h14", key: "1ays0h" }]]
19675
19636
  };
19676
- __iconData$9.node;
19677
- const Minus = createLucideIcon(__iconData$9);
19637
+ __iconData$a.node;
19638
+ const Minus = createLucideIcon(__iconData$a);
19678
19639
 
19679
19640
  /**
19680
19641
  * @license lucide-react v1.44.0 - ISC
@@ -19684,7 +19645,7 @@
19684
19645
  */
19685
19646
 
19686
19647
 
19687
- const __iconData$8 = {
19648
+ const __iconData$9 = {
19688
19649
  name: "octagon-x",
19689
19650
  size: 24,
19690
19651
  node: [
@@ -19700,8 +19661,35 @@
19700
19661
  ],
19701
19662
  aliases: ["x-octagon"]
19702
19663
  };
19664
+ __iconData$9.node;
19665
+ const OctagonX = createLucideIcon(__iconData$9);
19666
+
19667
+ /**
19668
+ * @license lucide-react v1.44.0 - ISC
19669
+ *
19670
+ * This source code is licensed under the ISC license.
19671
+ * See the LICENSE file in the root directory of this source tree.
19672
+ */
19673
+
19674
+
19675
+ const __iconData$8 = {
19676
+ name: "refresh-cw-off",
19677
+ size: 24,
19678
+ node: [
19679
+ [
19680
+ "path",
19681
+ { d: "M21 8L18.74 5.74A9.75 9.75 0 0 0 12 3C11 3 10.03 3.16 9.13 3.47", key: "1krf6h" }
19682
+ ],
19683
+ ["path", { d: "M8 16H3v5", key: "1cv678" }],
19684
+ ["path", { d: "M3 12C3 9.51 4 7.26 5.64 5.64", key: "ruvoct" }],
19685
+ ["path", { d: "m3 16 2.26 2.26A9.75 9.75 0 0 0 12 21c2.49 0 4.74-1 6.36-2.64", key: "19q130" }],
19686
+ ["path", { d: "M21 12c0 1-.16 1.97-.47 2.87", key: "4w8emr" }],
19687
+ ["path", { d: "M21 3v5h-5", key: "1q7to0" }],
19688
+ ["path", { d: "M22 22 2 2", key: "1r8tn9" }]
19689
+ ]
19690
+ };
19703
19691
  __iconData$8.node;
19704
- const OctagonX = createLucideIcon(__iconData$8);
19692
+ const RefreshCwOff = createLucideIcon(__iconData$8);
19705
19693
 
19706
19694
  /**
19707
19695
  * @license lucide-react v1.44.0 - ISC
@@ -19803,413 +19791,97 @@
19803
19791
  node: [
19804
19792
  ["path", { d: "m21 21-4.34-4.34", key: "14j7rj" }],
19805
19793
  ["circle", { cx: "11", cy: "11", r: "8", key: "4ej97u" }]
19806
- ]
19807
- };
19808
- __iconData$3.node;
19809
- const Search = createLucideIcon(__iconData$3);
19810
-
19811
- /**
19812
- * @license lucide-react v1.44.0 - ISC
19813
- *
19814
- * This source code is licensed under the ISC license.
19815
- * See the LICENSE file in the root directory of this source tree.
19816
- */
19817
-
19818
-
19819
- const __iconData$2 = {
19820
- name: "trash",
19821
- size: 24,
19822
- node: [
19823
- ["path", { d: "M10 11v6", key: "nco0om" }],
19824
- ["path", { d: "M14 11v6", key: "outv1u" }],
19825
- ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
19826
- ["path", { d: "M3 6h18", key: "d0wm0j" }],
19827
- ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
19828
- ],
19829
- aliases: ["trash-2"]
19830
- };
19831
- __iconData$2.node;
19832
- const Trash = createLucideIcon(__iconData$2);
19833
-
19834
- /**
19835
- * @license lucide-react v1.44.0 - ISC
19836
- *
19837
- * This source code is licensed under the ISC license.
19838
- * See the LICENSE file in the root directory of this source tree.
19839
- */
19840
-
19841
-
19842
- const __iconData$1 = {
19843
- name: "triangle-alert",
19844
- size: 24,
19845
- node: [
19846
- [
19847
- "path",
19848
- {
19849
- d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
19850
- key: "wmoenq"
19851
- }
19852
- ],
19853
- ["path", { d: "M12 9v4", key: "juzpu7" }],
19854
- ["path", { d: "M12 17h.01", key: "p32p05" }]
19855
- ],
19856
- aliases: ["alert-triangle"]
19857
- };
19858
- __iconData$1.node;
19859
- const TriangleAlert = createLucideIcon(__iconData$1);
19860
-
19861
- /**
19862
- * @license lucide-react v1.44.0 - ISC
19863
- *
19864
- * This source code is licensed under the ISC license.
19865
- * See the LICENSE file in the root directory of this source tree.
19866
- */
19867
-
19868
-
19869
- const __iconData = {
19870
- name: "x",
19871
- size: 24,
19872
- node: [
19873
- ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
19874
- ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
19875
- ]
19876
- };
19877
- __iconData.node;
19878
- const X = createLucideIcon(__iconData);
19879
-
19880
- const Toaster = ({ ...props }) => {
19881
- const { theme = 'system' } = z();
19882
- return (jsxRuntimeExports.jsx(Toaster$1, { theme: theme, position: "bottom-center", className: "toaster group", icons: {
19883
- success: jsxRuntimeExports.jsx(CircleCheck, { className: "size-4" }),
19884
- info: jsxRuntimeExports.jsx(Info, { className: "size-4" }),
19885
- warning: jsxRuntimeExports.jsx(TriangleAlert, { className: "size-4" }),
19886
- error: jsxRuntimeExports.jsx(OctagonX, { className: "size-4" }),
19887
- loading: jsxRuntimeExports.jsx(LoaderCircle, { className: "size-4 animate-spin" }),
19888
- }, style: {
19889
- '--normal-bg': 'var(--popover)',
19890
- '--normal-text': 'var(--popover-foreground)',
19891
- '--normal-border': 'var(--border)',
19892
- '--border-radius': 'var(--radius)',
19893
- }, ...props }));
19894
- };
19895
-
19896
- const dependencyShowClassName = 'dependency-show';
19897
- const dependencySelector = '[data-dependency]';
19898
- const events = ['input', 'change'];
19899
- function containsDependencyField(nodes) {
19900
- return Array.from(nodes).some((node) => node instanceof Element &&
19901
- (node.matches(dependencySelector) || Boolean(node.querySelector(dependencySelector))));
19902
- }
19903
- function useFieldDependencies(refreshKey) {
19904
- const cleanupRef = reactExports.useRef(() => undefined);
19905
- const refreshDependencies = reactExports.useCallback(() => {
19906
- cleanupRef.current();
19907
- cleanupRef.current = initializeFieldDependencies();
19908
- }, []);
19909
- reactExports.useEffect(() => {
19910
- refreshDependencies();
19911
- // Radix unmounts closed dialogs and inactive tab panels, so dependent fields
19912
- // often mount long after this hook runs. Without rebinding they would keep
19913
- // their initial hidden state forever, with no listeners on their sources.
19914
- const observer = new MutationObserver((records) => {
19915
- const touchesDependencies = records.some((record) => containsDependencyField(record.addedNodes) || containsDependencyField(record.removedNodes));
19916
- if (touchesDependencies) {
19917
- refreshDependencies();
19918
- }
19919
- });
19920
- observer.observe(document.body, { childList: true, subtree: true });
19921
- return () => {
19922
- observer.disconnect();
19923
- cleanupRef.current();
19924
- cleanupRef.current = () => undefined;
19925
- };
19926
- }, [refreshDependencies, refreshKey]);
19927
- return refreshDependencies;
19928
- }
19929
- function initializeFieldDependencies(root = document) {
19930
- const cleanupCallbacks = [];
19931
- const fields = Array.from(root.querySelectorAll(dependencySelector));
19932
- fields.forEach((field) => {
19933
- const dependency = field.dataset.dependency;
19934
- if (!dependency) {
19935
- return;
19936
- }
19937
- try {
19938
- const conditions = JSON.parse(dependency);
19939
- applyDependencyState(field, conditions);
19940
- cleanupCallbacks.push(...bindDependencyListeners(field, conditions));
19941
- }
19942
- catch (e) {
19943
- console.error('[Dependencies] Error parsing conditions for field:', field, e);
19944
- }
19945
- });
19946
- return () => {
19947
- cleanupCallbacks.forEach((cleanup) => cleanup());
19948
- };
19949
- }
19950
- function bindDependencyListeners(field, conditions) {
19951
- const cleanupCallbacks = [];
19952
- conditions.forEach((rules) => {
19953
- Object.keys(rules).forEach((selector) => {
19954
- const element = document.querySelector(selector);
19955
- if (!element) {
19956
- return;
19957
- }
19958
- // Toggle controls never emit input/change; aria-checked is the only
19959
- // signal, and watching it also catches programmatic updates.
19960
- if (isToggleControl(element)) {
19961
- const observer = new MutationObserver(() => applyDependencyState(field, conditions));
19962
- observer.observe(element, { attributes: true, attributeFilter: ['aria-checked'] });
19963
- cleanupCallbacks.push(() => observer.disconnect());
19964
- return;
19965
- }
19966
- events.forEach((event) => {
19967
- const listener = () => applyDependencyState(field, conditions);
19968
- element.addEventListener(event, listener);
19969
- cleanupCallbacks.push(() => element.removeEventListener(event, listener));
19970
- });
19971
- });
19972
- });
19973
- return cleanupCallbacks;
19974
- }
19975
- function applyDependencyState(field, conditions) {
19976
- if (checkConditions(conditions)) {
19977
- field.classList.add(dependencyShowClassName);
19978
- }
19979
- else {
19980
- field.classList.remove(dependencyShowClassName);
19981
- }
19982
- }
19983
- function checkConditions(conditions) {
19984
- return conditions.every((conditionObj) => {
19985
- const selectors = Object.keys(conditionObj);
19986
- return selectors.every((selector) => evaluateDependencyRule(selector, conditionObj[selector]));
19987
- });
19988
- }
19989
- function evaluateDependencyRule(selector, condition) {
19990
- const type = condition.type;
19991
- const currentValue = getValue(selector);
19992
- const checkValue = typeof condition.value === 'undefined' ? false : condition.value;
19993
- let minValue = typeof condition.min === 'undefined' ? false : Number.parseInt(String(condition.min), 10);
19994
- let maxValue = typeof condition.max === 'undefined' ? false : Number.parseInt(String(condition.max), 10);
19995
- const allowEmpty = typeof condition.empty === 'undefined' ? false : condition.empty;
19996
- const isEmpty = !allowEmpty && currentValue.length < 1;
19997
- const likeSelector = typeof condition.like === 'undefined' ? false : condition.like;
19998
- const likeSelectorValue = getValue(likeSelector);
19999
- const regExpPattern = typeof condition.pattern === 'undefined' ? false : condition.pattern;
20000
- const regExpModifier = typeof condition.modifier === 'undefined' ? 'gi' : condition.modifier;
20001
- const sign = typeof condition.sign === 'undefined' ? false : condition.sign;
20002
- const strict = typeof condition.strict === 'undefined' ? false : condition.strict;
20003
- const emptyTypes = ['empty', 'blank'];
20004
- const notEmptyTypes = ['!empty', 'notEmpty', 'not-empty', 'notempty'];
20005
- const equalTypes = ['equal', '=', '==', '==='];
20006
- const notEqualTypes = ['!equal', '!=', '!==', '!===', 'notEqual', 'not-equal', 'notequal'];
20007
- const regularExpressionTypes = ['regexp', 'exp', 'expression', 'match'];
20008
- if (type && emptyTypes.includes(type)) {
20009
- return currentValue.length < 1;
20010
- }
20011
- if (type && notEmptyTypes.includes(type)) {
20012
- return currentValue.length > 0;
20013
- }
20014
- if (type && equalTypes.includes(type)) {
20015
- if (isEmpty) {
20016
- return false;
20017
- }
20018
- if (likeSelector) {
20019
- return strict
20020
- ? likeSelectorValue.every((value) => currentValue.includes(value))
20021
- : likeSelectorValue.some((value) => currentValue.includes(value));
20022
- }
20023
- if (strict) {
20024
- if (checkValue && Array.isArray(checkValue)) {
20025
- return checkValue.every((value) => currentValue.includes(value));
20026
- }
20027
- if (checkValue && !Array.isArray(checkValue)) {
20028
- return currentValue.includes(checkValue);
20029
- }
20030
- }
20031
- else {
20032
- if (checkValue && Array.isArray(checkValue)) {
20033
- return checkValue.some((value) => currentValue.includes(value));
20034
- }
20035
- if (checkValue && !Array.isArray(checkValue)) {
20036
- return currentValue.includes(checkValue);
20037
- }
20038
- }
20039
- }
20040
- if (type && notEqualTypes.includes(type)) {
20041
- if (isEmpty) {
20042
- return false;
20043
- }
20044
- if (likeSelector) {
20045
- return strict
20046
- ? likeSelectorValue.every((value) => !currentValue.includes(value))
20047
- : likeSelectorValue.some((value) => !currentValue.includes(value));
20048
- }
20049
- if (strict) {
20050
- if (checkValue && Array.isArray(checkValue)) {
20051
- return checkValue.every((value) => !currentValue.includes(value));
20052
- }
20053
- if (checkValue && !Array.isArray(checkValue)) {
20054
- return !currentValue.includes(checkValue);
20055
- }
20056
- }
20057
- else {
20058
- if (checkValue && Array.isArray(checkValue)) {
20059
- return checkValue.some((value) => !currentValue.includes(value));
20060
- }
20061
- if (checkValue && !Array.isArray(checkValue)) {
20062
- return !currentValue.includes(checkValue);
20063
- }
20064
- }
20065
- }
20066
- if (type && regularExpressionTypes.includes(type) && regExpPattern) {
20067
- if (isEmpty) {
20068
- return false;
20069
- }
20070
- const exp = new RegExp(regExpPattern, regExpModifier);
20071
- return currentValue.every((value) => exp.test(String(value)));
20072
- }
20073
- if (type === 'length') {
20074
- if (isEmpty) {
20075
- return false;
20076
- }
20077
- if (checkValue && Array.isArray(checkValue)) {
20078
- minValue = Number.parseInt(String(checkValue[0]), 10);
20079
- maxValue = typeof checkValue[1] === 'undefined' ? false : Number.parseInt(String(checkValue[1]), 10);
20080
- }
20081
- if (checkValue && !Array.isArray(checkValue)) {
20082
- minValue = Number.parseInt(String(checkValue), 10);
20083
- maxValue = false;
20084
- }
20085
- const minBoundary = minValue === false ? 0 : minValue;
20086
- const maxBoundary = maxValue === false ? 0 : maxValue;
20087
- return currentValue.every((value) => {
20088
- const valueLength = String(value).length;
20089
- if (!maxValue) {
20090
- return valueLength >= minBoundary;
20091
- }
20092
- if (!minValue) {
20093
- return valueLength <= maxBoundary;
20094
- }
20095
- return valueLength >= minBoundary && valueLength <= maxBoundary;
20096
- });
20097
- }
20098
- if (type === 'range') {
20099
- if (isEmpty) {
20100
- return false;
20101
- }
20102
- if (checkValue && Array.isArray(checkValue)) {
20103
- minValue = Number.parseInt(String(checkValue[0]), 10);
20104
- maxValue = typeof checkValue[1] === 'undefined' ? false : Number.parseInt(String(checkValue[1]), 10);
20105
- }
20106
- const minBoundary = minValue === false ? 0 : minValue;
20107
- const maxBoundary = maxValue === false ? 0 : maxValue;
20108
- return currentValue.every((value) => {
20109
- const numericValue = Number.parseInt(String(value), 10);
20110
- if (!maxValue) {
20111
- return numericValue > minBoundary;
20112
- }
20113
- if (!minValue) {
20114
- return numericValue < maxBoundary;
20115
- }
20116
- return numericValue > minBoundary && numericValue < maxBoundary;
20117
- });
20118
- }
20119
- if (type === 'compare' && sign && checkValue) {
20120
- if (isEmpty) {
20121
- return false;
20122
- }
20123
- const numericCheckValue = Number.parseInt(String(checkValue), 10);
20124
- switch (sign) {
20125
- case '<':
20126
- return currentValue.every((value) => Number.parseInt(String(value), 10) < numericCheckValue);
20127
- case '<=':
20128
- return currentValue.every((value) => Number.parseInt(String(value), 10) <= numericCheckValue);
20129
- case '>':
20130
- return currentValue.every((value) => Number.parseInt(String(value), 10) > numericCheckValue);
20131
- case '>=':
20132
- return currentValue.every((value) => Number.parseInt(String(value), 10) >= numericCheckValue);
20133
- case '=':
20134
- case '==':
20135
- return currentValue.every((value) => Number.parseInt(String(value), 10) === numericCheckValue);
20136
- }
20137
- }
20138
- return false;
20139
- }
20140
- // shadcn checkboxes and switches render as <button role="checkbox|switch">, which
20141
- // carries a static value="on" - the checked state only lives in aria-checked.
20142
- function isToggleControl(element) {
20143
- const role = element.getAttribute('role');
20144
- return role === 'checkbox' || role === 'switch';
20145
- }
20146
- function readElementValue(element) {
20147
- if (isToggleControl(element)) {
20148
- return element.getAttribute('aria-checked') === 'true';
20149
- }
20150
- if (element instanceof HTMLInputElement && element.type === 'checkbox') {
20151
- return element.checked;
20152
- }
20153
- return element.value;
20154
- }
20155
- function getValue(selector) {
20156
- const values = [];
20157
- const element = selector ? document.querySelector(selector) : null;
20158
- if (selector && element) {
20159
- const inputType = element.tagName.toLowerCase();
20160
- let currentSelector = selector;
20161
- if (inputType === 'select') {
20162
- currentSelector = `${selector} option:checked`;
20163
- }
20164
- document.querySelectorAll(currentSelector).forEach((match) => {
20165
- values.push(readElementValue(match));
20166
- });
20167
- }
20168
- return values.filter((value) => value !== '');
20169
- }
19794
+ ]
19795
+ };
19796
+ __iconData$3.node;
19797
+ const Search = createLucideIcon(__iconData$3);
20170
19798
 
20171
- function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
19799
+ /**
19800
+ * @license lucide-react v1.44.0 - ISC
19801
+ *
19802
+ * This source code is licensed under the ISC license.
19803
+ * See the LICENSE file in the root directory of this source tree.
19804
+ */
20172
19805
 
20173
- const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
20174
- const cx = clsx;
20175
- const cva = (base, config)=>(props)=>{
20176
- var _config_compoundVariants;
20177
- if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
20178
- const { variants, defaultVariants } = config;
20179
- const getVariantClassNames = Object.keys(variants).map((variant)=>{
20180
- const variantProp = props === null || props === void 0 ? void 0 : props[variant];
20181
- const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
20182
- if (variantProp === null) return null;
20183
- const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
20184
- return variants[variant][variantKey];
20185
- });
20186
- const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
20187
- let [key, value] = param;
20188
- if (value === undefined) {
20189
- return acc;
20190
- }
20191
- acc[key] = value;
20192
- return acc;
20193
- }, {});
20194
- const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
20195
- let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
20196
- return Object.entries(compoundVariantOptions).every((param)=>{
20197
- let [key, value] = param;
20198
- return Array.isArray(value) ? value.includes({
20199
- ...defaultVariants,
20200
- ...propsWithoutUndefined
20201
- }[key]) : ({
20202
- ...defaultVariants,
20203
- ...propsWithoutUndefined
20204
- })[key] === value;
20205
- }) ? [
20206
- ...acc,
20207
- cvClass,
20208
- cvClassName
20209
- ] : acc;
20210
- }, []);
20211
- return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
20212
- };
19806
+
19807
+ const __iconData$2 = {
19808
+ name: "trash",
19809
+ size: 24,
19810
+ node: [
19811
+ ["path", { d: "M10 11v6", key: "nco0om" }],
19812
+ ["path", { d: "M14 11v6", key: "outv1u" }],
19813
+ ["path", { d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6", key: "miytrc" }],
19814
+ ["path", { d: "M3 6h18", key: "d0wm0j" }],
19815
+ ["path", { d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2", key: "e791ji" }]
19816
+ ],
19817
+ aliases: ["trash-2"]
19818
+ };
19819
+ __iconData$2.node;
19820
+ const Trash = createLucideIcon(__iconData$2);
19821
+
19822
+ /**
19823
+ * @license lucide-react v1.44.0 - ISC
19824
+ *
19825
+ * This source code is licensed under the ISC license.
19826
+ * See the LICENSE file in the root directory of this source tree.
19827
+ */
19828
+
19829
+
19830
+ const __iconData$1 = {
19831
+ name: "triangle-alert",
19832
+ size: 24,
19833
+ node: [
19834
+ [
19835
+ "path",
19836
+ {
19837
+ d: "m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",
19838
+ key: "wmoenq"
19839
+ }
19840
+ ],
19841
+ ["path", { d: "M12 9v4", key: "juzpu7" }],
19842
+ ["path", { d: "M12 17h.01", key: "p32p05" }]
19843
+ ],
19844
+ aliases: ["alert-triangle"]
19845
+ };
19846
+ __iconData$1.node;
19847
+ const TriangleAlert = createLucideIcon(__iconData$1);
19848
+
19849
+ /**
19850
+ * @license lucide-react v1.44.0 - ISC
19851
+ *
19852
+ * This source code is licensed under the ISC license.
19853
+ * See the LICENSE file in the root directory of this source tree.
19854
+ */
19855
+
19856
+
19857
+ const __iconData = {
19858
+ name: "x",
19859
+ size: 24,
19860
+ node: [
19861
+ ["path", { d: "M18 6 6 18", key: "1bl5f8" }],
19862
+ ["path", { d: "m6 6 12 12", key: "d8bk6v" }]
19863
+ ]
19864
+ };
19865
+ __iconData.node;
19866
+ const X = createLucideIcon(__iconData);
19867
+
19868
+ const Toaster = ({ ...props }) => {
19869
+ const { theme = 'system' } = z();
19870
+ return (jsxRuntimeExports.jsx(Toaster$1, { theme: theme, position: "bottom-center", className: "toaster group", icons: {
19871
+ success: jsxRuntimeExports.jsx(CircleCheck, { className: "size-4" }),
19872
+ info: jsxRuntimeExports.jsx(Info, { className: "size-4" }),
19873
+ warning: jsxRuntimeExports.jsx(TriangleAlert, { className: "size-4" }),
19874
+ error: jsxRuntimeExports.jsx(OctagonX, { className: "size-4" }),
19875
+ loading: jsxRuntimeExports.jsx(LoaderCircle, { className: "size-4 animate-spin" }),
19876
+ }, style: {
19877
+ '--normal-bg': 'var(--popover)',
19878
+ '--normal-text': 'var(--popover-foreground)',
19879
+ '--normal-border': 'var(--border)',
19880
+ '--border-radius': 'var(--radius)',
19881
+ }, ...props }));
19882
+ };
19883
+
19884
+ function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
20213
19885
 
20214
19886
  /**
20215
19887
  * Concatenates two arrays faster than the array spread operator.
@@ -23494,6 +23166,322 @@
23494
23166
  return twMerge(clsx(inputs));
23495
23167
  }
23496
23168
 
23169
+ const dependencyShowClassName = 'dependency-show';
23170
+ const dependencySelector = '[data-dependency]';
23171
+ const events = ['input', 'change'];
23172
+ function containsDependencyField(nodes) {
23173
+ return Array.from(nodes).some((node) => node instanceof Element &&
23174
+ (node.matches(dependencySelector) || Boolean(node.querySelector(dependencySelector))));
23175
+ }
23176
+ function useFieldDependencies(refreshKey) {
23177
+ const cleanupRef = reactExports.useRef(() => undefined);
23178
+ const refreshDependencies = reactExports.useCallback(() => {
23179
+ cleanupRef.current();
23180
+ cleanupRef.current = initializeFieldDependencies();
23181
+ }, []);
23182
+ reactExports.useEffect(() => {
23183
+ refreshDependencies();
23184
+ // Radix unmounts closed dialogs and inactive tab panels, so dependent fields
23185
+ // often mount long after this hook runs. Without rebinding they would keep
23186
+ // their initial hidden state forever, with no listeners on their sources.
23187
+ const observer = new MutationObserver((records) => {
23188
+ const touchesDependencies = records.some((record) => containsDependencyField(record.addedNodes) || containsDependencyField(record.removedNodes));
23189
+ if (touchesDependencies) {
23190
+ refreshDependencies();
23191
+ }
23192
+ });
23193
+ observer.observe(document.body, { childList: true, subtree: true });
23194
+ return () => {
23195
+ observer.disconnect();
23196
+ cleanupRef.current();
23197
+ cleanupRef.current = () => undefined;
23198
+ };
23199
+ }, [refreshDependencies, refreshKey]);
23200
+ return refreshDependencies;
23201
+ }
23202
+ function initializeFieldDependencies(root = document) {
23203
+ const cleanupCallbacks = [];
23204
+ const fields = Array.from(root.querySelectorAll(dependencySelector));
23205
+ fields.forEach((field) => {
23206
+ const dependency = field.dataset.dependency;
23207
+ if (!dependency) {
23208
+ return;
23209
+ }
23210
+ try {
23211
+ const conditions = JSON.parse(dependency);
23212
+ applyDependencyState(field, conditions);
23213
+ cleanupCallbacks.push(...bindDependencyListeners(field, conditions));
23214
+ }
23215
+ catch (e) {
23216
+ console.error('[Dependencies] Error parsing conditions for field:', field, e);
23217
+ }
23218
+ });
23219
+ return () => {
23220
+ cleanupCallbacks.forEach((cleanup) => cleanup());
23221
+ };
23222
+ }
23223
+ function bindDependencyListeners(field, conditions) {
23224
+ const cleanupCallbacks = [];
23225
+ conditions.forEach((rules) => {
23226
+ Object.keys(rules).forEach((selector) => {
23227
+ const element = document.querySelector(selector);
23228
+ if (!element) {
23229
+ return;
23230
+ }
23231
+ // Toggle controls never emit input/change; aria-checked is the only
23232
+ // signal, and watching it also catches programmatic updates.
23233
+ if (isToggleControl(element)) {
23234
+ const observer = new MutationObserver(() => applyDependencyState(field, conditions));
23235
+ observer.observe(element, { attributes: true, attributeFilter: ['aria-checked'] });
23236
+ cleanupCallbacks.push(() => observer.disconnect());
23237
+ return;
23238
+ }
23239
+ events.forEach((event) => {
23240
+ const listener = () => applyDependencyState(field, conditions);
23241
+ element.addEventListener(event, listener);
23242
+ cleanupCallbacks.push(() => element.removeEventListener(event, listener));
23243
+ });
23244
+ });
23245
+ });
23246
+ return cleanupCallbacks;
23247
+ }
23248
+ function applyDependencyState(field, conditions) {
23249
+ if (checkConditions(conditions)) {
23250
+ field.classList.add(dependencyShowClassName);
23251
+ }
23252
+ else {
23253
+ field.classList.remove(dependencyShowClassName);
23254
+ }
23255
+ }
23256
+ function checkConditions(conditions) {
23257
+ return conditions.every((conditionObj) => {
23258
+ const selectors = Object.keys(conditionObj);
23259
+ return selectors.every((selector) => evaluateDependencyRule(selector, conditionObj[selector]));
23260
+ });
23261
+ }
23262
+ function evaluateDependencyRule(selector, condition) {
23263
+ const type = condition.type;
23264
+ const currentValue = getValue(selector);
23265
+ const checkValue = typeof condition.value === 'undefined' ? false : condition.value;
23266
+ let minValue = typeof condition.min === 'undefined' ? false : Number.parseInt(String(condition.min), 10);
23267
+ let maxValue = typeof condition.max === 'undefined' ? false : Number.parseInt(String(condition.max), 10);
23268
+ const allowEmpty = typeof condition.empty === 'undefined' ? false : condition.empty;
23269
+ const isEmpty = !allowEmpty && currentValue.length < 1;
23270
+ const likeSelector = typeof condition.like === 'undefined' ? false : condition.like;
23271
+ const likeSelectorValue = getValue(likeSelector);
23272
+ const regExpPattern = typeof condition.pattern === 'undefined' ? false : condition.pattern;
23273
+ const regExpModifier = typeof condition.modifier === 'undefined' ? 'gi' : condition.modifier;
23274
+ const sign = typeof condition.sign === 'undefined' ? false : condition.sign;
23275
+ const strict = typeof condition.strict === 'undefined' ? false : condition.strict;
23276
+ const emptyTypes = ['empty', 'blank'];
23277
+ const notEmptyTypes = ['!empty', 'notEmpty', 'not-empty', 'notempty'];
23278
+ const equalTypes = ['equal', '=', '==', '==='];
23279
+ const notEqualTypes = ['!equal', '!=', '!==', '!===', 'notEqual', 'not-equal', 'notequal'];
23280
+ const regularExpressionTypes = ['regexp', 'exp', 'expression', 'match'];
23281
+ if (type && emptyTypes.includes(type)) {
23282
+ return currentValue.length < 1;
23283
+ }
23284
+ if (type && notEmptyTypes.includes(type)) {
23285
+ return currentValue.length > 0;
23286
+ }
23287
+ if (type && equalTypes.includes(type)) {
23288
+ if (isEmpty) {
23289
+ return false;
23290
+ }
23291
+ if (likeSelector) {
23292
+ return strict
23293
+ ? likeSelectorValue.every((value) => currentValue.includes(value))
23294
+ : likeSelectorValue.some((value) => currentValue.includes(value));
23295
+ }
23296
+ if (strict) {
23297
+ if (checkValue && Array.isArray(checkValue)) {
23298
+ return checkValue.every((value) => currentValue.includes(value));
23299
+ }
23300
+ if (checkValue && !Array.isArray(checkValue)) {
23301
+ return currentValue.includes(checkValue);
23302
+ }
23303
+ }
23304
+ else {
23305
+ if (checkValue && Array.isArray(checkValue)) {
23306
+ return checkValue.some((value) => currentValue.includes(value));
23307
+ }
23308
+ if (checkValue && !Array.isArray(checkValue)) {
23309
+ return currentValue.includes(checkValue);
23310
+ }
23311
+ }
23312
+ }
23313
+ if (type && notEqualTypes.includes(type)) {
23314
+ if (isEmpty) {
23315
+ return false;
23316
+ }
23317
+ if (likeSelector) {
23318
+ return strict
23319
+ ? likeSelectorValue.every((value) => !currentValue.includes(value))
23320
+ : likeSelectorValue.some((value) => !currentValue.includes(value));
23321
+ }
23322
+ if (strict) {
23323
+ if (checkValue && Array.isArray(checkValue)) {
23324
+ return checkValue.every((value) => !currentValue.includes(value));
23325
+ }
23326
+ if (checkValue && !Array.isArray(checkValue)) {
23327
+ return !currentValue.includes(checkValue);
23328
+ }
23329
+ }
23330
+ else {
23331
+ if (checkValue && Array.isArray(checkValue)) {
23332
+ return checkValue.some((value) => !currentValue.includes(value));
23333
+ }
23334
+ if (checkValue && !Array.isArray(checkValue)) {
23335
+ return !currentValue.includes(checkValue);
23336
+ }
23337
+ }
23338
+ }
23339
+ if (type && regularExpressionTypes.includes(type) && regExpPattern) {
23340
+ if (isEmpty) {
23341
+ return false;
23342
+ }
23343
+ const exp = new RegExp(regExpPattern, regExpModifier);
23344
+ return currentValue.every((value) => exp.test(String(value)));
23345
+ }
23346
+ if (type === 'length') {
23347
+ if (isEmpty) {
23348
+ return false;
23349
+ }
23350
+ if (checkValue && Array.isArray(checkValue)) {
23351
+ minValue = Number.parseInt(String(checkValue[0]), 10);
23352
+ maxValue = typeof checkValue[1] === 'undefined' ? false : Number.parseInt(String(checkValue[1]), 10);
23353
+ }
23354
+ if (checkValue && !Array.isArray(checkValue)) {
23355
+ minValue = Number.parseInt(String(checkValue), 10);
23356
+ maxValue = false;
23357
+ }
23358
+ const minBoundary = minValue === false ? 0 : minValue;
23359
+ const maxBoundary = maxValue === false ? 0 : maxValue;
23360
+ return currentValue.every((value) => {
23361
+ const valueLength = String(value).length;
23362
+ if (!maxValue) {
23363
+ return valueLength >= minBoundary;
23364
+ }
23365
+ if (!minValue) {
23366
+ return valueLength <= maxBoundary;
23367
+ }
23368
+ return valueLength >= minBoundary && valueLength <= maxBoundary;
23369
+ });
23370
+ }
23371
+ if (type === 'range') {
23372
+ if (isEmpty) {
23373
+ return false;
23374
+ }
23375
+ if (checkValue && Array.isArray(checkValue)) {
23376
+ minValue = Number.parseInt(String(checkValue[0]), 10);
23377
+ maxValue = typeof checkValue[1] === 'undefined' ? false : Number.parseInt(String(checkValue[1]), 10);
23378
+ }
23379
+ const minBoundary = minValue === false ? 0 : minValue;
23380
+ const maxBoundary = maxValue === false ? 0 : maxValue;
23381
+ return currentValue.every((value) => {
23382
+ const numericValue = Number.parseInt(String(value), 10);
23383
+ if (!maxValue) {
23384
+ return numericValue > minBoundary;
23385
+ }
23386
+ if (!minValue) {
23387
+ return numericValue < maxBoundary;
23388
+ }
23389
+ return numericValue > minBoundary && numericValue < maxBoundary;
23390
+ });
23391
+ }
23392
+ if (type === 'compare' && sign && checkValue) {
23393
+ if (isEmpty) {
23394
+ return false;
23395
+ }
23396
+ const numericCheckValue = Number.parseInt(String(checkValue), 10);
23397
+ switch (sign) {
23398
+ case '<':
23399
+ return currentValue.every((value) => Number.parseInt(String(value), 10) < numericCheckValue);
23400
+ case '<=':
23401
+ return currentValue.every((value) => Number.parseInt(String(value), 10) <= numericCheckValue);
23402
+ case '>':
23403
+ return currentValue.every((value) => Number.parseInt(String(value), 10) > numericCheckValue);
23404
+ case '>=':
23405
+ return currentValue.every((value) => Number.parseInt(String(value), 10) >= numericCheckValue);
23406
+ case '=':
23407
+ case '==':
23408
+ return currentValue.every((value) => Number.parseInt(String(value), 10) === numericCheckValue);
23409
+ }
23410
+ }
23411
+ return false;
23412
+ }
23413
+ // shadcn checkboxes and switches render as <button role="checkbox|switch">, which
23414
+ // carries a static value="on" - the checked state only lives in aria-checked.
23415
+ function isToggleControl(element) {
23416
+ const role = element.getAttribute('role');
23417
+ return role === 'checkbox' || role === 'switch';
23418
+ }
23419
+ function readElementValue(element) {
23420
+ if (isToggleControl(element)) {
23421
+ return element.getAttribute('aria-checked') === 'true';
23422
+ }
23423
+ if (element instanceof HTMLInputElement && element.type === 'checkbox') {
23424
+ return element.checked;
23425
+ }
23426
+ return element.value;
23427
+ }
23428
+ function getValue(selector) {
23429
+ const values = [];
23430
+ const element = selector ? document.querySelector(selector) : null;
23431
+ if (selector && element) {
23432
+ const inputType = element.tagName.toLowerCase();
23433
+ let currentSelector = selector;
23434
+ if (inputType === 'select') {
23435
+ currentSelector = `${selector} option:checked`;
23436
+ }
23437
+ document.querySelectorAll(currentSelector).forEach((match) => {
23438
+ values.push(readElementValue(match));
23439
+ });
23440
+ }
23441
+ return values.filter((value) => value !== '');
23442
+ }
23443
+
23444
+ const falsyToString = (value)=>typeof value === "boolean" ? `${value}` : value === 0 ? "0" : value;
23445
+ const cx = clsx;
23446
+ const cva = (base, config)=>(props)=>{
23447
+ var _config_compoundVariants;
23448
+ if ((config === null || config === void 0 ? void 0 : config.variants) == null) return cx(base, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
23449
+ const { variants, defaultVariants } = config;
23450
+ const getVariantClassNames = Object.keys(variants).map((variant)=>{
23451
+ const variantProp = props === null || props === void 0 ? void 0 : props[variant];
23452
+ const defaultVariantProp = defaultVariants === null || defaultVariants === void 0 ? void 0 : defaultVariants[variant];
23453
+ if (variantProp === null) return null;
23454
+ const variantKey = falsyToString(variantProp) || falsyToString(defaultVariantProp);
23455
+ return variants[variant][variantKey];
23456
+ });
23457
+ const propsWithoutUndefined = props && Object.entries(props).reduce((acc, param)=>{
23458
+ let [key, value] = param;
23459
+ if (value === undefined) {
23460
+ return acc;
23461
+ }
23462
+ acc[key] = value;
23463
+ return acc;
23464
+ }, {});
23465
+ const getCompoundVariantClassNames = config === null || config === void 0 ? void 0 : (_config_compoundVariants = config.compoundVariants) === null || _config_compoundVariants === void 0 ? void 0 : _config_compoundVariants.reduce((acc, param)=>{
23466
+ let { class: cvClass, className: cvClassName, ...compoundVariantOptions } = param;
23467
+ return Object.entries(compoundVariantOptions).every((param)=>{
23468
+ let [key, value] = param;
23469
+ return Array.isArray(value) ? value.includes({
23470
+ ...defaultVariants,
23471
+ ...propsWithoutUndefined
23472
+ }[key]) : ({
23473
+ ...defaultVariants,
23474
+ ...propsWithoutUndefined
23475
+ })[key] === value;
23476
+ }) ? [
23477
+ ...acc,
23478
+ cvClass,
23479
+ cvClassName
23480
+ ] : acc;
23481
+ }, []);
23482
+ return cx(base, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
23483
+ };
23484
+
23497
23485
  const alertVariants = cva('relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current', {
23498
23486
  variants: {
23499
23487
  variant: {
@@ -23545,11 +23533,12 @@
23545
23533
  };
23546
23534
  function AppAlert({ title, variant = 'info', hideIcon = false, className, children, dangerouslySetInnerHTML, ...props }) {
23547
23535
  const Icon = variantIcons[variant];
23548
- return (jsxRuntimeExports.jsxs(Alert, { variant: variant === 'destructive' ? 'destructive' : 'default', className: cn(variantStyles[variant], className), ...props, children: [!hideIcon && jsxRuntimeExports.jsx(Icon, {}), title && jsxRuntimeExports.jsx(AlertTitle, { children: title }), dangerouslySetInnerHTML ? (jsxRuntimeExports.jsx(AlertDescription, { dangerouslySetInnerHTML: dangerouslySetInnerHTML })) : (jsxRuntimeExports.jsx(AlertDescription, { children: children }))] }));
23536
+ return (jsxRuntimeExports.jsxs(Alert, { variant: variant === 'destructive' ? 'destructive' : 'default', className: cn(variantStyles[variant], className), ...props, children: [!hideIcon && jsxRuntimeExports.jsx(Icon, {}), title && jsxRuntimeExports.jsx(AlertTitle, { children: title }), dangerouslySetInnerHTML ? (jsxRuntimeExports.jsx(AlertDescription, { className: "html-content block", dangerouslySetInnerHTML: dangerouslySetInnerHTML })) : (jsxRuntimeExports.jsx(AlertDescription, { children: children }))] }));
23549
23537
  }
23550
23538
 
23539
+ // Two brand files, each tuned for its own background, swapped by theme.
23551
23540
  function CrowdinMark({ className }) {
23552
- return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 248 248", className: className, fill: "none", "aria-hidden": "true", children: [jsxRuntimeExports.jsx("path", { d: "M163.024 177.312c-6 0-11.357-1.798-15.785-5.317-5.285-4.144-9.5-10.321-9.642-17.593-.072-3.675 3.928-3.675 3.928-3.675s6.5-.078 9.642-.078c3.143.078 4.071 4.457 4.214 5.551 1.214 9.853 6.785 14.153 11.071 16.108 2.571 1.173 1.928 4.848-3.428 5.004Z", fill: "currentColor" }), jsxRuntimeExports.jsx("path", { d: "M109.1 127.248c-5.284-.622-13.138-1.166-18.208-2.409-8.211-2.02-7.997-9.401-7.64-11.809.999-7.226 3.642-13.908 7.712-20.123 5.069-7.614 12.353-14.296 21.706-19.734 17.565-10.178 42.128-15.85 69.118-15.85 19.779 0 40.414 2.564 40.628 2.564 1.857.233 3.214 2.02 3.142 4.04-.071 2.02-1.499 3.574-3.356 3.73-2.999-.078-5.926-.078-8.711-.078-27.49 0-47.054 3.729-61.621 11.809-14.352 7.925-24.348 20.045-31.131 37.993-.714 1.553-3.071 10.799-11.639 9.867Z", fill: "currentColor" }), jsxRuntimeExports.jsx("path", { d: "M133.089 201.326c-13.638 0-26.495-5.889-36.226-16.645-8.239-9.107-13.212-18.293-14.135-30.07-.568-7.694 2.841-10.363 7.458-9.892 3.197.314 13.141.785 18.823 1.963 4.262.863 7.103 3.219 7.814 8.086 3.764 25.909 20.101 36.116 29.832 38.314 1.705.393 2.771 1.492 2.7 3.455-.071 1.884-1.35 3.454-3.055 3.768-4.333.707-8.879 1.021-13.211 1.021Z", fill: "currentColor" }), jsxRuntimeExports.jsx("path", { d: "M94.224 224.321c-9.677 0-19.141-1.539-21.844-2.025-11.385-2.026-20.92-5.51-29.103-10.696-19.568-12.397-31.38-34.274-32.803-60.203-.356-6.158-1.138-17.907 13.52-17.016 6.048.324 15.654 3.241 22.414 5.186 8.396 2.35 12.452 8.832 12.452 15.233 0 36.543 33.087 60.689 47.532 60.689 6.191 0 3.914 6.645 1.21 7.374-4.768 1.296-10.887 1.458-13.378 1.458Z", fill: "currentColor" }), jsxRuntimeExports.jsx("path", { d: "M43.75 116.947c-5.724-1.026-11.305-3.393-16.743-4.734-16.814-4.182-13.952-21.147-12.378-25.802 15.312-45.054 63.895-60.125 103.105-64.149 36.92-3.787 75.558-.868 111.548 9.153 2.934.789 12.021 2.998 6.797 8.443-3.291 3.392-16.099-.158-19.533-.395-21.108-1.578-42.001-1.815-63.037 1.42-22.252 3.393-45.148 10.416-63.537 25.25-8.872 7.18-16.671 16.333-21.895 27.143-1.359 2.84-2.432 5.681-3.362 8.522-.931 2.998-4.437 18.069-20.965 15.149Z", fill: "currentColor" }), jsxRuntimeExports.jsx("path", { d: "M137.892 125.638c3.151-14.1 17.152-36.444 60.485-34.903 9.941.309 5.391 7.089.49 6.935-24.502-.848-36.123 14.947-42.213 30.973-1.96 5.162-6.441 5.933-12.041 5.008-3.92-.693-8.191-1.155-6.721-8.013Z", fill: "currentColor" })] }));
23541
+ return (jsxRuntimeExports.jsxs("svg", { viewBox: "0 0 80 80", className: className, fill: "none", "aria-hidden": "true", children: [jsxRuntimeExports.jsxs("g", { className: "dark:hidden", children: [jsxRuntimeExports.jsx("path", { d: "M56.6667 80H23.3333C9.16667 80 0 70.8333 0 56.6667V23.0781C0 9.16667 9.16667 0 23.0781 0H56.6667C70.8333 0 80 9.16667 80 23.3333V56.6667C80 70.8333 70.8333 80 56.6667 80Z", fill: "#263238" }), jsxRuntimeExports.jsx("path", { d: "M51.3968 54.5041C49.9 54.5041 48.5662 54.0395 47.4621 53.1296C46.1432 52.0583 45.0947 50.4611 45.0576 48.5835C45.0391 47.6352 46.0357 47.6352 46.0357 47.6352C46.0357 47.6352 47.6548 47.616 48.4402 47.616C49.2257 47.6352 49.4554 48.7678 49.4924 49.052C49.7962 51.5976 51.1856 52.7072 52.2526 53.214C52.8936 53.5174 52.7342 54.4657 51.3968 54.508V54.5041Z", fill: "white" }), jsxRuntimeExports.jsx("path", { d: "M37.9552 41.5689C36.6363 41.4076 34.6801 41.2694 33.4167 40.9469C31.3679 40.4247 31.4234 38.5164 31.5124 37.8944C31.7606 36.0284 32.4201 34.3006 33.4352 32.6957C34.6986 30.7298 36.514 29.002 38.8481 27.5967C43.2274 24.9666 49.9385 23.3335 56.6667 23.3335C57.9136 23.3335 66.9908 23.3335 66.9908 25.2085C66.9908 26.2502 64.8949 26.1531 63.9824 26.1531C57.1283 26.1531 52.2489 27.1168 48.618 29.2055C45.0391 31.252 42.5456 34.3851 40.8562 39.0232C40.6784 39.4264 40.0893 41.8146 37.9552 41.5727V41.5689Z", fill: "white" }), jsxRuntimeExports.jsx("path", { d: "M43.9348 60.7086C40.5337 60.7815 37.3289 59.1881 34.9022 56.4083C32.846 54.0546 31.6085 51.6818 31.3788 48.637C31.238 46.6481 32.0865 45.9609 33.2387 46.0799C34.0352 46.1605 36.5138 46.2834 37.9328 46.5867C38.9962 46.8094 39.7038 47.4199 39.8816 48.6754C40.819 55.3716 44.8944 58.0055 47.3211 58.5738C47.7472 58.6736 48.0102 58.9578 47.9954 59.4684C47.9769 59.956 47.7064 60.6241 43.9385 60.7048L43.9348 60.7086Z", fill: "white" }), jsxRuntimeExports.jsx("path", { d: "M34.2464 66.6527C31.8345 66.7564 29.4744 66.2534 28.8001 66.1305C25.9622 65.6084 23.5836 64.7061 21.5459 63.3661C16.6665 60.1639 13.7211 54.5082 13.3691 47.812C13.2802 46.2224 13.0838 43.1853 16.7406 43.4157C18.2485 43.5002 20.6419 44.2527 22.3276 44.7557C24.4209 45.3624 25.4324 47.0364 25.4324 48.6913C25.4324 58.1327 33.3333 64.1667 37.0833 64.1667C37.9429 64.1667 38.3333 64.4452 38.3333 65C38.3333 65.4167 37.9439 66.4953 34.2501 66.6566L34.2464 66.6527Z", fill: "white" }), jsxRuntimeExports.jsx("path", { d: "M21.6602 38.9073C20.2338 38.6424 18.8408 38.0319 17.4848 37.6825C13.2908 36.6036 14.0058 32.2188 14.3986 31.017C18.2146 19.3755 30.3298 15.4822 40.1071 14.4417C49.3138 13.4626 58.9467 14.219 67.92 16.8068C68.561 16.9835 70.3282 17.425 69.9466 18.5001C69.565 19.5752 68.5017 18.8265 58.7133 18.6038C55.4863 18.5308 52.263 18.742 49.0286 19.2565C43.4786 20.1319 37.773 21.948 33.1863 25.7799C30.9744 27.6344 29.0293 29.9996 27.7289 32.7948C27.3881 33.5281 27.1213 34.2615 26.8916 34.9948C26.6582 35.7704 25.7838 39.6637 21.6639 38.9112L21.6602 38.9073Z", fill: "white" }), jsxRuntimeExports.jsx("path", { d: "M45.1315 41.1541C45.9169 37.5104 48.75 32.0831 59.5833 32.0831C60.8333 32.0831 61.25 32.4998 61.25 32.9165C61.25 33.3331 60.6669 33.7498 60 33.7498C53.4172 33.7498 51.3261 37.7906 49.8071 41.9297C49.3181 43.262 48.2029 43.4617 46.8061 43.2236C45.828 43.0432 44.7647 42.9241 45.1315 41.1541Z", fill: "white" })] }), jsxRuntimeExports.jsxs("g", { className: "hidden dark:block", children: [jsxRuntimeExports.jsx("path", { d: "M55.2553 80H24.7447C8.91588 80 0 70.916 0 55.2553V24.7447C0 9.08403 8.91588 0 24.7447 0H55.2553C71.4167 0 80 8.75146 80 24.7447V55.2553C80 71.2485 71.4167 80 55.2553 80Z", fill: "white" }), jsxRuntimeExports.jsx("path", { d: "M51.3959 54.5041C49.8991 54.5041 48.5653 54.0395 47.4613 53.1296C46.1423 52.0583 45.0938 50.4611 45.0568 48.5835C45.0382 47.6352 46.0349 47.6352 46.0349 47.6352C46.0349 47.6352 47.6539 47.616 48.4394 47.616C49.2248 47.6352 49.4545 48.7678 49.4916 49.052C49.7954 51.5976 51.1847 52.7072 52.2518 53.214C52.8927 53.5174 52.7334 54.4657 51.3959 54.508V54.5041Z", fill: "#263238" }), jsxRuntimeExports.jsx("path", { d: "M37.9549 41.5687C36.6359 41.4074 34.6797 41.2692 33.4163 40.9467C31.3675 40.4245 31.4231 38.5163 31.512 37.8943C31.7602 36.0282 32.4197 34.3004 33.4349 32.6955C34.6982 30.7296 36.5137 29.0018 38.8478 27.5966C43.227 24.9665 49.3512 23.4998 56.0794 23.4998C61.0107 23.4998 66.1568 24.164 66.2087 24.164C66.6718 24.2254 67.009 24.6862 66.9904 25.2084C66.9719 25.7305 66.6162 26.1299 66.1531 26.1721C65.4047 26.1529 64.6748 26.1529 63.982 26.1529C57.1279 26.1529 52.2485 27.1166 48.6177 29.2053C45.0387 31.2518 42.5453 34.3849 40.8558 39.0231C40.678 39.4262 40.0889 41.8144 37.9549 41.5725V41.5687Z", fill: "#263238" }), jsxRuntimeExports.jsx("path", { d: "M43.9348 60.709C40.5337 60.7819 37.3289 59.1885 34.9022 56.4087C32.846 54.055 31.6085 51.6822 31.3788 48.6374C31.238 46.6485 32.0865 45.9612 33.2387 46.0802C34.0352 46.1609 36.5138 46.2837 37.9328 46.5871C38.9962 46.8098 39.7038 47.4203 39.8816 48.6758C40.819 55.372 44.8944 58.0059 47.3211 58.5742C47.7472 58.674 48.0102 58.9581 47.9954 59.4688C47.9769 59.9564 47.7064 60.6245 43.9385 60.7051L43.9348 60.709Z", fill: "#263238" }), jsxRuntimeExports.jsx("path", { d: "M34.246 66.6527C31.8341 66.7564 29.4741 66.2534 28.7998 66.1305C25.9618 65.6084 23.5832 64.7061 21.5455 63.3661C16.6661 60.1639 13.7207 54.5082 13.3687 47.812C13.2798 46.2224 13.0835 43.1853 16.7402 43.4157C18.2481 43.5002 20.6415 44.2527 22.3273 44.7557C24.4205 45.3624 25.432 47.0364 25.432 48.6913C25.432 58.1327 33.6829 64.372 37.2841 64.372C38.1436 64.372 38.3474 64.9019 38.2436 65.4087C38.1621 65.8119 37.9435 66.4953 34.2497 66.6566L34.246 66.6527Z", fill: "#263238" }), jsxRuntimeExports.jsx("path", { d: "M21.6602 38.9077C20.2338 38.6428 18.8408 38.0323 17.4848 37.6829C13.2908 36.604 14.0058 32.2192 14.3986 31.0174C18.2147 19.3759 30.3298 15.4826 40.1071 14.442C49.3138 13.463 58.9467 14.2194 67.92 16.8072C68.561 16.9838 70.3282 17.4254 69.9466 18.5005C69.565 19.5755 68.5017 18.8268 58.7133 18.6041C55.4863 18.5312 52.263 18.7424 49.0286 19.2569C43.4786 20.1323 37.773 21.9484 33.1863 25.7803C30.9744 27.6348 29.0293 29.9999 27.7289 32.7951C27.3881 33.5285 27.1213 34.2618 26.8916 34.9952C26.6582 35.7708 25.7838 39.6641 21.6639 38.9115L21.6602 38.9077Z", fill: "#263238" }), jsxRuntimeExports.jsx("path", { d: "M45.1311 41.1543C45.9166 37.5105 49.4066 31.7358 60.2102 32.1351C62.6888 32.2158 61.5551 33.9666 60.3325 33.9282C54.223 33.7094 51.3258 37.7908 49.8068 41.9298C49.3177 43.2622 48.2025 43.4618 46.8058 43.2238C45.8277 43.0433 44.7643 42.9243 45.1311 41.1543Z", fill: "#263238" })] })] }));
23553
23542
  }
23554
23543
 
23555
23544
  var __defProp$D = Object.defineProperty;
@@ -26368,6 +26357,27 @@
26368
26357
  }
26369
26358
  );
26370
26359
  }, "Dialog");
26360
+ var TRIGGER_NAME$9 = "DialogTrigger";
26361
+ var DialogTrigger$1 = /* @__PURE__ */ reactExports.forwardRef(
26362
+ /* @__PURE__ */ __name$k(function DialogTrigger2(props, forwardedRef) {
26363
+ const { __scopeDialog, ...triggerProps } = props;
26364
+ const context = useDialogContext(TRIGGER_NAME$9, __scopeDialog);
26365
+ const composedTriggerRef = useComposedRefs(forwardedRef, context.triggerRef);
26366
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
26367
+ Primitive.button,
26368
+ {
26369
+ type: "button",
26370
+ "aria-haspopup": "dialog",
26371
+ "aria-expanded": context.open,
26372
+ "aria-controls": context.open ? context.contentId : void 0,
26373
+ "data-state": getState$4(context.open),
26374
+ ...triggerProps,
26375
+ ref: composedTriggerRef,
26376
+ onClick: composeEventHandlers(props.onClick, context.onOpenToggle)
26377
+ }
26378
+ );
26379
+ }, "DialogTrigger")
26380
+ );
26371
26381
  var PORTAL_NAME$4 = "DialogPortal";
26372
26382
  var [PortalProvider$4, usePortalContext$5] = createDialogContext(PORTAL_NAME$4, {
26373
26383
  forceMount: void 0
@@ -34232,7 +34242,7 @@ Defaulting to \`null\`.`;
34232
34242
  // Shared by both filter modes: RadioGroup's root defaults to `grid gap-3`, so
34233
34243
  // styling either list separately makes them drift apart.
34234
34244
  const FILTER_OPTION_LIST_CLASS = 'grid gap-1 p-3';
34235
- const FILTER_OPTION_CLASS = 'flex min-h-9 cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 hover:bg-accent';
34245
+ const FILTER_OPTION_CLASS = 'flex min-h-9 cursor-pointer items-center gap-3 rounded-md px-2 py-1.5 text-sm hover:bg-accent';
34236
34246
  function FilterOptionRow({ children }) {
34237
34247
  return jsxRuntimeExports.jsx("label", { className: FILTER_OPTION_CLASS, children: children });
34238
34248
  }
@@ -35890,7 +35900,7 @@ Defaulting to \`null\`.`;
35890
35900
  function FilesTreeSkeleton() {
35891
35901
  return (jsxRuntimeExports.jsx("div", { className: "space-y-1 p-2", "aria-hidden": "true", children: [72, 56, 64, 48, 60].map((width, index) => (jsxRuntimeExports.jsxs("div", { className: "flex h-10 items-center gap-3 px-2", style: { paddingLeft: 8 + index * 8 }, children: [jsxRuntimeExports.jsx(Skeleton, { className: "size-4" }), jsxRuntimeExports.jsx(Skeleton, { className: "size-4" }), jsxRuntimeExports.jsx(Skeleton, { className: "h-4", style: { width: `${width}%` } })] }, width))) }));
35892
35902
  }
35893
- function FilesTree({ id = 'files-tree', items, selectedIds, onSelectedIdsChange, openedFolderIds, onOpenedFolderIdsChange, disabled = false, loading = false, searchQuery = '', onItemOpenChange, assumeFoldersHaveChildren = false, isItemSelectable = selectAnyItem, onLoadMore, loadingItemIds = [], emptyTitle = 'No files found', emptyDescription = 'Try a different search or check the available files.', maxHeight = DEFAULT_MAX_HEIGHT, renderItemName, renderItemMeta, itemActions, }) {
35903
+ function FilesTree({ id = 'files-tree', items, selectedIds, onSelectedIdsChange, openedFolderIds, onOpenedFolderIdsChange, disabled = false, loading = false, searchQuery = '', onItemOpenChange, assumeFoldersHaveChildren = false, isItemSelectable = selectAnyItem, onLoadMore, loadingItemIds = [], emptyTitle = 'No files found', emptyDescription = 'Try a different search or check the available files.', maxHeight = DEFAULT_MAX_HEIGHT, fill = false, renderItemName, renderItemMeta, itemActions, }) {
35894
35904
  const model = reactExports.useMemo(() => buildFilesTreeModel(items), [items]);
35895
35905
  const isInteractionDisabled = disabled || loading;
35896
35906
  const { tree, items: headlessItems, getSelectionState, } = useFilesTree({
@@ -35916,7 +35926,9 @@ Defaulting to \`null\`.`;
35916
35926
  const allVisibleSelected = selectableVisibleIds.length > 0 && selectableVisibleIds.every((itemId) => getSelectionState(itemId) === true);
35917
35927
  const someVisibleSelected = selectableVisibleIds.some((itemId) => getSelectionState(itemId) !== false);
35918
35928
  const selectAllState = allVisibleSelected ? true : someVisibleSelected ? 'indeterminate' : false;
35919
- return (jsxRuntimeExports.jsxs("div", { id: id, className: cn('overflow-hidden rounded-md border bg-card text-card-foreground', disabled && 'opacity-50'), "aria-busy": loading || undefined, "data-disabled": isInteractionDisabled || undefined, children: [jsxRuntimeExports.jsxs("div", { className: "flex min-h-10 items-center gap-2 border-b px-3 text-xs font-medium text-muted-foreground", children: [jsxRuntimeExports.jsx("span", { className: "size-8 shrink-0", "aria-hidden": "true" }), jsxRuntimeExports.jsx(Checkbox, { checked: selectAllState, onCheckedChange: () => onSelectedIdsChange(toggleAllFilesTreeSelection(model, selectedIds, selectableVisibleIds, isItemSelectable)), disabled: isInteractionDisabled || selectableVisibleIds.length === 0, "aria-label": "Select all visible files" }), jsxRuntimeExports.jsx("span", { children: "Name" })] }), jsxRuntimeExports.jsx(ScrollArea, { style: { maxHeight }, className: "[&>[data-radix-scroll-area-viewport]]:max-h-[inherit]", children: loading ? (jsxRuntimeExports.jsx(FilesTreeSkeleton, {})) : headlessItems.length === 0 ? (jsxRuntimeExports.jsx(Empty, { className: "min-h-48 border-0", children: jsxRuntimeExports.jsxs(EmptyHeader, { children: [jsxRuntimeExports.jsx(EmptyMedia, { variant: "icon", children: jsxRuntimeExports.jsx(Folder, { "aria-hidden": "true" }) }), jsxRuntimeExports.jsx(EmptyTitle, { children: emptyTitle }), jsxRuntimeExports.jsx(EmptyDescription, { children: emptyDescription })] }) })) : (jsxRuntimeExports.jsx("div", { ...tree.getContainerProps('Files'), id: `${id}-tree`, "aria-multiselectable": "true", className: "p-1", children: headlessItems.map((headlessItem) => {
35929
+ return (jsxRuntimeExports.jsxs("div", { id: id, className: cn('text-card-foreground', fill && 'flex min-h-0 flex-1 flex-col', disabled && 'opacity-50'), "aria-busy": loading || undefined, "data-disabled": isInteractionDisabled || undefined, children: [jsxRuntimeExports.jsxs("div", { className: "flex min-h-10 shrink-0 items-center gap-2 border-y px-4 text-xs font-medium text-muted-foreground", children: [jsxRuntimeExports.jsx("span", { className: "size-8 shrink-0", "aria-hidden": "true" }), jsxRuntimeExports.jsx(Checkbox, { checked: selectAllState, onCheckedChange: () => onSelectedIdsChange(toggleAllFilesTreeSelection(model, selectedIds, selectableVisibleIds, isItemSelectable)), disabled: isInteractionDisabled || selectableVisibleIds.length === 0, "aria-label": "Select all visible files" }), jsxRuntimeExports.jsx("span", { children: "Name" })] }), jsxRuntimeExports.jsx(ScrollArea, { style: fill ? undefined : { maxHeight }, className: cn(fill
35930
+ ? 'min-h-0 flex-1 [&>[data-radix-scroll-area-viewport]]:h-full [&>[data-radix-scroll-area-viewport]>div]:h-full'
35931
+ : '[&>[data-radix-scroll-area-viewport]]:max-h-[inherit]'), children: loading ? (jsxRuntimeExports.jsx(FilesTreeSkeleton, {})) : headlessItems.length === 0 ? (jsxRuntimeExports.jsx(Empty, { className: cn('min-h-48 border-0', fill && 'h-full'), children: jsxRuntimeExports.jsxs(EmptyHeader, { children: [jsxRuntimeExports.jsx(EmptyMedia, { variant: "icon", children: jsxRuntimeExports.jsx(Folder, { "aria-hidden": "true" }) }), jsxRuntimeExports.jsx(EmptyTitle, { children: emptyTitle }), jsxRuntimeExports.jsx(EmptyDescription, { children: emptyDescription })] }) })) : (jsxRuntimeExports.jsx("div", { ...tree.getContainerProps('Files'), id: `${id}-tree`, "aria-multiselectable": "true", className: "px-2 py-1", children: headlessItems.map((headlessItem) => {
35920
35932
  var _a, _b, _c, _d, _e;
35921
35933
  const item = headlessItem.getItemData();
35922
35934
  const level = headlessItem.getItemMeta().level;
@@ -36030,6 +36042,30 @@ Defaulting to \`null\`.`;
36030
36042
  return (jsxRuntimeExports.jsx(Portal, { children: jsxRuntimeExports.jsxs(Content2, { "data-slot": "tooltip-content", sideOffset: sideOffset, className: cn('z-50 w-fit origin-(--radix-tooltip-content-transform-origin) animate-in rounded-md bg-foreground px-3 py-1.5 text-xs text-balance text-background fade-in-0 zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95', className), ...props, children: [children, jsxRuntimeExports.jsx(Arrow2, { className: "z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px] bg-foreground fill-foreground" })] }) }));
36031
36043
  }
36032
36044
 
36045
+ // Independent debounce timer per key; always fires the latest `fn`.
36046
+ function useKeyedDebounce(fn, delay) {
36047
+ const fnRef = reactExports.useRef(fn);
36048
+ reactExports.useLayoutEffect(() => {
36049
+ fnRef.current = fn;
36050
+ });
36051
+ const timers = reactExports.useRef(new Map());
36052
+ reactExports.useEffect(() => () => timers.current.forEach((timer) => clearTimeout(timer)), []);
36053
+ return reactExports.useMemo(() => {
36054
+ const cancel = (key) => {
36055
+ clearTimeout(timers.current.get(key));
36056
+ timers.current.delete(key);
36057
+ };
36058
+ const schedule = (key, ...args) => {
36059
+ cancel(key);
36060
+ timers.current.set(key, setTimeout(() => {
36061
+ timers.current.delete(key);
36062
+ fnRef.current(key, ...args);
36063
+ }, delay));
36064
+ };
36065
+ return { schedule, cancel };
36066
+ }, [delay]);
36067
+ }
36068
+
36033
36069
  const MOBILE_BREAKPOINT = 768;
36034
36070
  function useIsMobile() {
36035
36071
  const [isMobile, setIsMobile] = reactExports.useState(undefined);
@@ -36134,17 +36170,12 @@ Defaulting to \`null\`.`;
36134
36170
  function isFolder$1(e) {
36135
36171
  return !e.type && (e.nodeType === undefined || e.nodeType === FOLDER_TYPE || e.nodeType === BRANCH_TYPE);
36136
36172
  }
36137
- function openModal(modal) {
36138
- if (!modal) {
36139
- return;
36140
- }
36141
- modal.open();
36142
- }
36143
- function closeModal(modal) {
36144
- if (!modal) {
36145
- return;
36173
+ // Throws like the old `ref.current.x` access did, instead of silently skipping.
36174
+ function requireRef(ref) {
36175
+ if (!ref.current) {
36176
+ throw new Error('Component is not mounted');
36146
36177
  }
36147
- modal.close();
36178
+ return ref.current;
36148
36179
  }
36149
36180
  function normalizeMenuItems(value) {
36150
36181
  let parsed = value;
@@ -36162,6 +36193,7 @@ Defaulting to \`null\`.`;
36162
36193
  return parsed.filter((item) => Boolean(item) && typeof item.label === 'string' && typeof item.action === 'string');
36163
36194
  }
36164
36195
 
36196
+ const SEARCH_DEBOUNCE = 300;
36165
36197
  // Stable identity: an inline arrow would invalidate useFilesTree's memoised map.
36166
36198
  function isSelectableTreeItem(item) {
36167
36199
  return item.nodeType !== 'load-more';
@@ -36171,6 +36203,7 @@ Defaulting to \`null\`.`;
36171
36203
  selectedIds: [],
36172
36204
  openedIds: [],
36173
36205
  search: '',
36206
+ appliedSearch: '',
36174
36207
  loading: true,
36175
36208
  syncSettingsLoading: false,
36176
36209
  };
@@ -36337,9 +36370,6 @@ Defaulting to \`null\`.`;
36337
36370
  }
36338
36371
  return items.filter((item) => item.schedule && (all || isFile(item)) && !item.disabled);
36339
36372
  }
36340
- function parseBoolean(value) {
36341
- return value === true || value === 'true' || value === '';
36342
- }
36343
36373
  const SimpleIntegration = reactExports.forwardRef(function SimpleIntegration({ name, logo = 'logo.png', syncNewElements, withCronSync, webhooks, integrationOneLevelFetching, integrationSearchListener, filtering, integrationButtonMenuItems = [], crowdinButtonMenuItems = [], onRefreshFilesList, onFolderToggle, onUploadFilesToCrowdin, onUploadFilesToIntegration, onLoadMore, onIntegrationFilterChange, onIntegrationScheduleSync, onCrowdinScheduleSync, onIntegrationDisableSync, onCrowdinDisableSync, }, ref) {
36344
36374
  const [providers, setProviders] = reactExports.useState({
36345
36375
  crowdin: { ...INITIAL_PROVIDER_STATE },
@@ -36351,7 +36381,7 @@ Defaulting to \`null\`.`;
36351
36381
  // getCrowdinSelected has no deps, so it reads the current filter through a ref.
36352
36382
  const displayedLanguagesRef = reactExports.useRef([]);
36353
36383
  const [progresses, setProgresses] = reactExports.useState({});
36354
- const [process, setProcess] = reactExports.useState({ toCrowdin: false, toIntegration: false });
36384
+ const [syncProcess, setSyncProcess] = reactExports.useState({ toCrowdin: false, toIntegration: false });
36355
36385
  const [activeProvider, setActiveProvider] = reactExports.useState('crowdin');
36356
36386
  const isMobile = useIsMobile();
36357
36387
  const [loadMoreLoadingIds, setLoadMoreLoadingIds] = reactExports.useState([]);
@@ -36411,7 +36441,6 @@ Defaulting to \`null\`.`;
36411
36441
  getOpenedFolders: async () => providersRef.current[provider].openedIds,
36412
36442
  setOpenedFolders: async (ids) => setProvider(provider, { openedIds: ids.map(String) }),
36413
36443
  getFilesToDisplay: async () => providersRef.current[provider].items,
36414
- hasSearchText: async () => Boolean(providersRef.current[provider].search.trim()),
36415
36444
  setLoadMoreLoading: async (id, loading) => {
36416
36445
  const stringId = String(id);
36417
36446
  setLoadMoreLoadingIds((current) => loading
@@ -36450,24 +36479,10 @@ Defaulting to \`null\`.`;
36450
36479
  })),
36451
36480
  updateCrowdinFileData: async (items) => setProvider('crowdin', (state) => ({ ...state, items: updateItems(state.items, items) })),
36452
36481
  updateIntegrationFileData: async (items) => setProvider('integration', (state) => ({ ...state, items: updateItems(state.items, items) })),
36453
- querySelector: (selector) => selector === '#crowdin-files'
36454
- ? fileHandle('crowdin')
36455
- : selector === '#integration-files'
36456
- ? fileHandle('integration')
36457
- : null,
36458
- setAttribute: (attribute, value) => {
36459
- var _a;
36460
- const booleanValue = parseBoolean(value);
36461
- const mapping = {
36462
- 'is-crowdin-loading': () => setProvider('crowdin', { loading: booleanValue }),
36463
- 'is-integration-loading': () => setProvider('integration', { loading: booleanValue }),
36464
- 'is-crowdin-sync-settings-in-progress': () => setProvider('crowdin', { syncSettingsLoading: booleanValue }),
36465
- 'is-integration-sync-settings-in-progress': () => setProvider('integration', { syncSettingsLoading: booleanValue }),
36466
- 'is-to-crowdin-process': () => setProcess((current) => ({ ...current, toCrowdin: booleanValue })),
36467
- 'is-to-integration-process': () => setProcess((current) => ({ ...current, toIntegration: booleanValue })),
36468
- };
36469
- (_a = mapping[attribute]) === null || _a === void 0 ? void 0 : _a.call(mapping);
36470
- },
36482
+ getFilesHandle: fileHandle,
36483
+ setLoading: (provider, loading) => setProvider(provider, { loading }),
36484
+ setSyncSettingsInProgress: (provider, inProgress) => setProvider(provider, { syncSettingsLoading: inProgress }),
36485
+ setProcess: (next) => setSyncProcess((current) => ({ ...current, ...next })),
36471
36486
  }), [fileHandle, setProvider]);
36472
36487
  const displayedLanguages = reactExports.useMemo(() => filteredLanguageIds.length
36473
36488
  ? languages.filter((language) => filteredLanguageIds.includes(String(language.id)))
@@ -36558,7 +36573,7 @@ Defaulting to \`null\`.`;
36558
36573
  ? Object.keys(getCrowdinSelected()).length
36559
36574
  : selectedItems(provider).length;
36560
36575
  const syncDisabled = (provider) => selectedCount(provider) === 0;
36561
- const anyProcess = process.toCrowdin || process.toIntegration;
36576
+ const anyProcess = syncProcess.toCrowdin || syncProcess.toIntegration;
36562
36577
  const scheduleEnabled = (provider) => Boolean((withCronSync === null || withCronSync === void 0 ? void 0 : withCronSync[provider]) || (webhooks === null || webhooks === void 0 ? void 0 : webhooks[provider]));
36563
36578
  const upload = (provider, action, item) => {
36564
36579
  var _a, _b;
@@ -36725,6 +36740,22 @@ Defaulting to \`null\`.`;
36725
36740
  }
36726
36741
  return actions;
36727
36742
  };
36743
+ const applySearch = (provider, search) => {
36744
+ const isUnchanged = search.trim() === providersRef.current[provider].appliedSearch.trim();
36745
+ setProvider(provider, { search, appliedSearch: search });
36746
+ if (!isUnchanged && provider === 'integration' && integrationSearchListener) {
36747
+ onIntegrationFilterChange(search);
36748
+ }
36749
+ };
36750
+ const debouncedSearch = useKeyedDebounce(applySearch, SEARCH_DEBOUNCE);
36751
+ const changeSearch = (provider, search) => {
36752
+ setProvider(provider, { search });
36753
+ debouncedSearch.schedule(provider, search);
36754
+ };
36755
+ const clearSearch = (provider) => {
36756
+ debouncedSearch.cancel(provider);
36757
+ applySearch(provider, '');
36758
+ };
36728
36759
  const renderItemName = (provider) => (item) => {
36729
36760
  const source = item.original;
36730
36761
  if (provider !== 'crowdin' || !source.isLanguage) {
@@ -36741,25 +36772,14 @@ Defaulting to \`null\`.`;
36741
36772
  const isCrowdin = provider === 'crowdin';
36742
36773
  const displayItems = isCrowdin ? displayCrowdinItems : displayIntegrationItems;
36743
36774
  const providerName = isCrowdin ? 'Crowdin' : name;
36744
- const syncing = isCrowdin ? process.toIntegration : process.toCrowdin;
36775
+ const syncing = isCrowdin ? syncProcess.toIntegration : syncProcess.toCrowdin;
36745
36776
  const menuItems = isCrowdin ? normalizedCrowdinButtonMenuItems : normalizedIntegrationButtonMenuItems;
36746
36777
  // Derived, never stored: as state it went stale whenever items changed without a
36747
36778
  // selection change - disableSync cleared the markers but left the button live.
36748
36779
  const hasSyncOption = hasSyncMetadata(displayItems, state.selectedIds);
36749
- return (jsxRuntimeExports.jsxs("section", { className: "flex min-w-0 flex-col", "aria-label": `${providerName} files`, children: [jsxRuntimeExports.jsxs("header", { className: "flex min-h-16 items-start gap-3 px-4 pt-4", children: [isCrowdin ? (jsxRuntimeExports.jsx("span", { className: "mt-0.5 flex size-8 shrink-0 items-center justify-center text-foreground", children: jsxRuntimeExports.jsx(CrowdinMark, { className: "size-8" }) })) : (jsxRuntimeExports.jsx("img", { src: logo, alt: "", className: "mt-0.5 size-8 object-contain" })), jsxRuntimeExports.jsxs("div", { className: "min-w-0 flex-1", children: [jsxRuntimeExports.jsx("h2", { className: "truncate text-base font-semibold", children: providerName }), jsxRuntimeExports.jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: isCrowdin
36750
- ? `Select content for synchronization to ${name}`
36751
- : 'Select content for synchronization to Crowdin' })] }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": `Reload ${providerName} files`, title: `Reload ${providerName} files`, disabled: state.loading, onClick: () => onRefreshFilesList(isCrowdin ? { refreshCrowdin: true } : { refreshIntegration: true }), children: state.loading ? jsxRuntimeExports.jsx(Spinner, {}) : jsxRuntimeExports.jsx(RefreshCw, {}) })] }), jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap items-center gap-2 px-4 py-3", children: [jsxRuntimeExports.jsxs(InputGroup, { className: "min-w-52 flex-1 sm:max-w-80", children: [jsxRuntimeExports.jsx(InputGroupAddon, { children: jsxRuntimeExports.jsx(Search, {}) }), jsxRuntimeExports.jsx(InputGroupInput, { value: state.search, onChange: (event) => {
36752
- const search = event.target.value;
36753
- setProvider(provider, { search });
36754
- if (!isCrowdin && integrationSearchListener) {
36755
- onIntegrationFilterChange(search);
36756
- }
36757
- }, placeholder: isCrowdin ? 'Search Crowdin files' : `Search ${name} files`, "aria-label": isCrowdin ? 'Search Crowdin files' : `Search ${name} files` }), state.search && (jsxRuntimeExports.jsx(InputGroupAddon, { align: "inline-end", children: jsxRuntimeExports.jsx(InputGroupButton, { size: "icon-xs", "aria-label": "Clear search", onClick: () => {
36758
- setProvider(provider, { search: '' });
36759
- if (!isCrowdin && integrationSearchListener) {
36760
- onIntegrationFilterChange('');
36761
- }
36762
- }, children: jsxRuntimeExports.jsx(X, {}) }) }))] }), isCrowdin && (filtering === null || filtering === void 0 ? void 0 : filtering.crowdinLanguages) && languages.length > 0 && (jsxRuntimeExports.jsx(FilesFilter, { sections: languageFilterSections, values: { languages: filteredLanguageIds }, onValuesChange: (values) => { var _a; return setFilteredLanguageIds((_a = values.languages) !== null && _a !== void 0 ? _a : []); } })), !isCrowdin && integrationFilterSections.length > 0 && (jsxRuntimeExports.jsx(FilesFilter, { sections: integrationFilterSections, values: integrationFilterValues, onValuesChange: setIntegrationFilterValues })), jsxRuntimeExports.jsxs("div", { className: "ml-auto flex items-center gap-1", children: [scheduleEnabled(provider) && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [state.syncSettingsLoading && jsxRuntimeExports.jsx(Spinner, { className: "mx-1" }), hasSyncOption && (jsxRuntimeExports.jsxs(Button, { type: "button", variant: "ghost", size: "icon-sm", title: "Disable sync", disabled: state.syncSettingsLoading, onClick: () => disableSync(provider), children: [jsxRuntimeExports.jsx(Ban, {}), jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Disable sync" })] })), jsxRuntimeExports.jsxs(Button, { type: "button", variant: "ghost", size: "icon-sm", title: "Enable auto sync", disabled: syncDisabled(provider) || state.syncSettingsLoading, onClick: () => schedule(provider), children: [jsxRuntimeExports.jsx(RotateCw, {}), jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Enable auto sync" })] })] })), jsxRuntimeExports.jsxs(ButtonGroup, { children: [jsxRuntimeExports.jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: syncDisabled(provider) || anyProcess, onClick: () => upload(provider), children: [syncing && jsxRuntimeExports.jsx(Spinner, {}), "Sync to", isCrowdin ? (jsxRuntimeExports.jsx("img", { src: logo, alt: name, className: "size-4 object-contain" })) : (jsxRuntimeExports.jsx(CrowdinMark, { className: "size-4" }))] }), menuItems.length > 0 && (jsxRuntimeExports.jsxs(DropdownMenu, { children: [jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: jsxRuntimeExports.jsxs(Button, { variant: "outline", size: "icon-sm", disabled: syncDisabled(provider) || anyProcess, children: [jsxRuntimeExports.jsx(ChevronDown, {}), jsxRuntimeExports.jsx("span", { className: "sr-only", children: "More synchronization actions" })] }) }), jsxRuntimeExports.jsx(DropdownMenuContent, { align: "end", className: "max-w-80 min-w-60", children: menuItems.map((item) => (jsxRuntimeExports.jsx(DropdownMenuItem, { onClick: () => upload(provider, item.action), children: item.label }, item.action))) })] }))] })] })] }), jsxRuntimeExports.jsx("div", { className: "px-3 pb-3", children: jsxRuntimeExports.jsx(FilesTree, { id: `${provider}-files`, items: displayItems, selectedIds: state.selectedIds, onSelectedIdsChange: (selectedIds) => setProvider(provider, { selectedIds }), openedFolderIds: state.openedIds, onOpenedFolderIdsChange: (openedIds) => setProvider(provider, { openedIds }), onItemOpenChange: (item, isOpen) => {
36780
+ return (jsxRuntimeExports.jsxs("section", { className: "flex min-h-0 min-w-0 flex-1 flex-col", "aria-label": `${providerName} files`, children: [jsxRuntimeExports.jsxs("header", { className: "shrink-0 px-4 pt-4", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3", children: [isCrowdin ? (jsxRuntimeExports.jsx(CrowdinMark, { className: "size-8 shrink-0" })) : (jsxRuntimeExports.jsx("img", { src: logo, alt: "", className: "size-8 shrink-0 object-contain" })), jsxRuntimeExports.jsx("h2", { className: "min-w-0 flex-1 truncate text-base font-semibold", children: providerName }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", "aria-label": `Reload ${providerName} files`, title: `Reload ${providerName} files`, disabled: state.loading, onClick: () => onRefreshFilesList(isCrowdin ? { refreshCrowdin: true } : { refreshIntegration: true }), children: state.loading ? jsxRuntimeExports.jsx(Spinner, {}) : jsxRuntimeExports.jsx(RefreshCw, {}) })] }), jsxRuntimeExports.jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: isCrowdin
36781
+ ? `Select content for synchronization to ${name}`
36782
+ : 'Select content for synchronization to Crowdin' })] }), jsxRuntimeExports.jsxs("div", { className: "flex shrink-0 flex-wrap items-center gap-2 px-4 py-3", children: [jsxRuntimeExports.jsxs(InputGroup, { className: "min-w-52 flex-1 sm:max-w-80", children: [jsxRuntimeExports.jsx(InputGroupAddon, { children: jsxRuntimeExports.jsx(Search, {}) }), jsxRuntimeExports.jsx(InputGroupInput, { value: state.search, onChange: (event) => changeSearch(provider, event.target.value), placeholder: isCrowdin ? 'Search Crowdin files' : `Search ${name} files`, "aria-label": isCrowdin ? 'Search Crowdin files' : `Search ${name} files` }), state.search && (jsxRuntimeExports.jsx(InputGroupAddon, { align: "inline-end", children: jsxRuntimeExports.jsx(InputGroupButton, { size: "icon-xs", "aria-label": "Clear search", onClick: () => clearSearch(provider), children: jsxRuntimeExports.jsx(X, {}) }) }))] }), isCrowdin && (filtering === null || filtering === void 0 ? void 0 : filtering.crowdinLanguages) && languages.length > 0 && (jsxRuntimeExports.jsx(FilesFilter, { sections: languageFilterSections, values: { languages: filteredLanguageIds }, onValuesChange: (values) => { var _a; return setFilteredLanguageIds((_a = values.languages) !== null && _a !== void 0 ? _a : []); } })), !isCrowdin && integrationFilterSections.length > 0 && (jsxRuntimeExports.jsx(FilesFilter, { sections: integrationFilterSections, values: integrationFilterValues, onValuesChange: setIntegrationFilterValues })), jsxRuntimeExports.jsxs("div", { className: "ml-auto flex items-center gap-1", children: [scheduleEnabled(provider) && (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [state.syncSettingsLoading && jsxRuntimeExports.jsx(Spinner, { className: "mx-1" }), hasSyncOption && (jsxRuntimeExports.jsxs(Button, { type: "button", variant: "ghost", size: "icon-sm", title: "Disable Auto Sync", disabled: state.syncSettingsLoading, onClick: () => disableSync(provider), children: [jsxRuntimeExports.jsx(RefreshCwOff, {}), jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Disable Auto Sync" })] })), jsxRuntimeExports.jsxs(Button, { type: "button", variant: "ghost", size: "icon-sm", title: "Enable Auto Sync", disabled: syncDisabled(provider) || state.syncSettingsLoading, onClick: () => schedule(provider), children: [jsxRuntimeExports.jsx(RotateCw, {}), jsxRuntimeExports.jsx("span", { className: "sr-only", children: "Enable Auto Sync" })] })] })), jsxRuntimeExports.jsxs(ButtonGroup, { children: [jsxRuntimeExports.jsxs(Button, { type: "button", variant: "outline", size: "sm", disabled: syncDisabled(provider) || anyProcess, onClick: () => upload(provider), children: [syncing && jsxRuntimeExports.jsx(Spinner, {}), "Sync to", isCrowdin ? (jsxRuntimeExports.jsx("img", { src: logo, alt: name, className: "size-4 object-contain" })) : (jsxRuntimeExports.jsx(CrowdinMark, { className: "size-4" }))] }), menuItems.length > 0 && (jsxRuntimeExports.jsxs(DropdownMenu, { children: [jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: jsxRuntimeExports.jsxs(Button, { variant: "outline", size: "icon-sm", disabled: syncDisabled(provider) || anyProcess, children: [jsxRuntimeExports.jsx(ChevronDown, {}), jsxRuntimeExports.jsx("span", { className: "sr-only", children: "More synchronization actions" })] }) }), jsxRuntimeExports.jsx(DropdownMenuContent, { align: "end", className: "max-w-80 min-w-60", children: menuItems.map((item) => (jsxRuntimeExports.jsx(DropdownMenuItem, { onClick: () => upload(provider, item.action), children: item.label }, item.action))) })] }))] })] })] }), jsxRuntimeExports.jsx("div", { className: "flex min-h-0 flex-1 flex-col", children: jsxRuntimeExports.jsx(FilesTree, { id: `${provider}-files`, items: displayItems, selectedIds: state.selectedIds, onSelectedIdsChange: (selectedIds) => setProvider(provider, { selectedIds }), openedFolderIds: state.openedIds, onOpenedFolderIdsChange: (openedIds) => setProvider(provider, { openedIds }), onItemOpenChange: (item, isOpen) => {
36763
36783
  var _a;
36764
36784
  if (isOpen && (integrationOneLevelFetching || isCrowdin)) {
36765
36785
  onFolderToggle({
@@ -36770,13 +36790,13 @@ Defaulting to \`null\`.`;
36770
36790
  recursion: false,
36771
36791
  });
36772
36792
  }
36773
- }, assumeFoldersHaveChildren: !isCrowdin && Boolean(integrationOneLevelFetching), isItemSelectable: isSelectableTreeItem, onLoadMore: (item) => onLoadMore(item.original), loadingItemIds: loadMoreLoadingIds, searchQuery: state.search, loading: state.loading, maxHeight: "clamp(280px, 42vh, 440px)", emptyTitle: state.search ? 'No matching files' : `No ${providerName} files`, emptyDescription: isCrowdin
36793
+ }, assumeFoldersHaveChildren: !isCrowdin && Boolean(integrationOneLevelFetching), isItemSelectable: isSelectableTreeItem, onLoadMore: (item) => onLoadMore(item.original), loadingItemIds: loadMoreLoadingIds, searchQuery: state.appliedSearch, loading: state.loading, fill: true, emptyTitle: state.appliedSearch ? 'No matching files' : `No ${providerName} files`, emptyDescription: isCrowdin
36774
36794
  ? 'Select content on the right and sync it to Crowdin.'
36775
36795
  : 'Reload the file list or adjust your search.', renderItemName: renderItemName(provider), renderItemMeta: renderMeta(provider), itemActions: (item) => actionItems(provider, item.original) }) })] }));
36776
36796
  };
36777
36797
  // Exclusive, not CSS-toggled: each panel owns a tree keyed `${provider}-files`,
36778
36798
  // so mounting both layouts would duplicate those DOM ids.
36779
- return (jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 150, children: jsxRuntimeExports.jsx(Card, { className: "relative mt-3 gap-0 overflow-hidden py-0", children: isMobile ? (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("div", { className: "border-b p-3", children: jsxRuntimeExports.jsx(Tabs, { value: activeProvider, onValueChange: (value) => setActiveProvider(value), children: jsxRuntimeExports.jsxs(TabsList, { className: "w-full", children: [jsxRuntimeExports.jsxs(TabsTrigger, { value: "crowdin", className: "flex-1", children: [jsxRuntimeExports.jsx(Languages, {}), " Crowdin"] }), jsxRuntimeExports.jsxs(TabsTrigger, { value: "integration", className: "flex-1", children: [jsxRuntimeExports.jsx("img", { src: logo, alt: "", className: "size-4 object-contain" }), " ", name] })] }) }) }), panel(activeProvider)] })) : (jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 divide-x", children: [panel('crowdin'), panel('integration')] })) }) }));
36799
+ return (jsxRuntimeExports.jsx(TooltipProvider, { delayDuration: 150, children: jsxRuntimeExports.jsx(Card, { className: "relative mt-3 flex min-h-[480px] flex-1 flex-col gap-0 overflow-hidden py-0", children: isMobile ? (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("div", { className: "shrink-0 border-b p-3", children: jsxRuntimeExports.jsx(Tabs, { value: activeProvider, onValueChange: (value) => setActiveProvider(value), children: jsxRuntimeExports.jsxs(TabsList, { className: "w-full", children: [jsxRuntimeExports.jsxs(TabsTrigger, { value: "crowdin", className: "flex-1", children: [jsxRuntimeExports.jsx(CrowdinMark, { className: "size-4" }), " Crowdin"] }), jsxRuntimeExports.jsxs(TabsTrigger, { value: "integration", className: "flex-1", children: [jsxRuntimeExports.jsx("img", { src: logo, alt: "", className: "size-4 object-contain" }), " ", name] })] }) }) }), panel(activeProvider)] })) : (jsxRuntimeExports.jsxs("div", { className: "grid min-h-0 flex-1 grid-cols-2 divide-x", children: [panel('crowdin'), panel('integration')] })) }) }));
36780
36800
  });
36781
36801
 
36782
36802
  function Select({ ...props }) {
@@ -36833,11 +36853,11 @@ Defaulting to \`null\`.`;
36833
36853
  onSelect(error);
36834
36854
  }
36835
36855
  };
36836
- return (jsxRuntimeExports.jsxs("div", { "data-slot": "user-errors-table", className: "overflow-hidden rounded-lg border bg-card text-card-foreground", children: [jsxRuntimeExports.jsx("div", { "data-slot": "table-toolbar", className: "border-b p-4", children: jsxRuntimeExports.jsxs("div", { className: "relative max-w-md", children: [jsxRuntimeExports.jsx(Search, { className: "pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" }), jsxRuntimeExports.jsx(Input, { value: searchText, onChange: (event) => onOptionsChange({ searchText: event.target.value, currentPage: 1 }), className: "h-9 pl-9", placeholder: "Search by action or message", "aria-label": "Search error logs by action or message" })] }) }), jsxRuntimeExports.jsxs(Table, { children: [jsxRuntimeExports.jsx(TableHeader, { children: jsxRuntimeExports.jsxs(TableRow, { className: "hover:bg-transparent", children: [jsxRuntimeExports.jsx(TableHead, { className: "w-1/3 px-4", "aria-sort": isSortedAsc ? 'ascending' : 'descending', children: jsxRuntimeExports.jsxs(Button, { type: "button", variant: "ghost", className: "-ml-2", onClick: () => onOptionsChange({ isSortedAsc: !isSortedAsc, currentPage: 1 }), "aria-label": `Sort by date ${isSortedAsc ? 'descending' : 'ascending'}`, children: ["Date", isSortedAsc ? (jsxRuntimeExports.jsx(ArrowUp, { "aria-hidden": "true" })) : (jsxRuntimeExports.jsx(ArrowDown, { "aria-hidden": "true" }))] }) }), jsxRuntimeExports.jsx(TableHead, { className: "w-1/3 px-4", children: "Action" }), jsxRuntimeExports.jsx(TableHead, { className: "w-1/3 px-4", children: "Message" })] }) }), jsxRuntimeExports.jsx(TableBody, { "aria-busy": isLoading, children: isLoading ? (Array.from({ length: 3 }).map((_, index) => (jsxRuntimeExports.jsx(TableRow, { children: [0, 1, 2].map((cell) => (jsxRuntimeExports.jsxs(TableCell, { className: "h-12 px-4", children: [index === 0 && cell === 0 && (jsxRuntimeExports.jsx("span", { className: "sr-only", role: "status", children: "Loading error logs" })), jsxRuntimeExports.jsx("div", { className: "h-4 max-w-48 animate-pulse rounded bg-muted" })] }, cell))) }, index)))) : errors.length > 0 ? (errors.map((error) => (jsxRuntimeExports.jsxs(TableRow, { tabIndex: 0, className: "cursor-pointer focus-visible:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", onClick: () => onSelect(error), onKeyDown: (event) => handleRowKeyDown(event, error), "aria-label": `Open error details for ${error.action} on ${error.formattedDate}`, children: [jsxRuntimeExports.jsx(TableCell, { className: "h-12 px-4 font-medium whitespace-normal", children: error.formattedDate }), jsxRuntimeExports.jsx(TableCell, { className: "h-12 px-4 whitespace-normal", children: error.action }), jsxRuntimeExports.jsx(TableCell, { className: "h-12 max-w-0 px-4 whitespace-normal", children: jsxRuntimeExports.jsx("span", { className: "line-clamp-2 break-words", children: error.message }) })] }, error.id)))) : (jsxRuntimeExports.jsx(TableRow, { className: "hover:bg-transparent", children: jsxRuntimeExports.jsx(TableCell, { colSpan: 3, className: "h-32 text-center text-muted-foreground", children: searchText ? 'No error logs match your search.' : 'No error logs found.' }) })) })] }), jsxRuntimeExports.jsxs("div", { "data-slot": "table-pagination", className: "flex flex-col gap-3 border-t px-4 py-2 sm:flex-row sm:items-center sm:justify-end", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm", children: [jsxRuntimeExports.jsx("span", { className: "whitespace-nowrap text-muted-foreground", children: "Rows per page" }), jsxRuntimeExports.jsxs(Select, { value: String(rowsPerPage), onValueChange: (value) => onOptionsChange({ rowsPerPage: Number(value), currentPage: 1 }), children: [jsxRuntimeExports.jsx(SelectTrigger, { className: "w-18", "aria-label": "Rows per page", children: jsxRuntimeExports.jsx(SelectValue, {}) }), jsxRuntimeExports.jsx(SelectContent, { align: "end", children: rowsPerPageOptions.map((option) => (jsxRuntimeExports.jsx(SelectItem, { value: String(option), children: option }, option))) })] })] }), jsxRuntimeExports.jsxs("p", { className: "m-0 min-w-24 text-sm text-muted-foreground", "aria-live": "polite", children: [firstVisibleRow, "-", lastVisibleRow, " of ", total] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: 1 }), disabled: currentPage === 1, "aria-label": "Go to first page", children: jsxRuntimeExports.jsx(ChevronsLeft, {}) }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: Math.max(1, currentPage - 1) }), disabled: currentPage === 1, "aria-label": "Go to previous page", children: jsxRuntimeExports.jsx(ChevronLeft, {}) }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: Math.min(pageCount, currentPage + 1) }), disabled: currentPage === pageCount, "aria-label": "Go to next page", children: jsxRuntimeExports.jsx(ChevronRight, {}) }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: pageCount }), disabled: currentPage === pageCount, "aria-label": "Go to last page", children: jsxRuntimeExports.jsx(ChevronsRight, {}) })] })] })] }));
36856
+ return (jsxRuntimeExports.jsxs("div", { "data-slot": "user-errors-table", className: "overflow-hidden rounded-lg border bg-card text-card-foreground", children: [jsxRuntimeExports.jsx("div", { "data-slot": "table-toolbar", className: "border-b p-4", children: jsxRuntimeExports.jsxs("div", { className: "relative max-w-md", children: [jsxRuntimeExports.jsx(Search, { className: "pointer-events-none absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground" }), jsxRuntimeExports.jsx(Input, { value: searchText, onChange: (event) => onOptionsChange({ searchText: event.target.value, currentPage: 1 }), className: "h-9 pl-9", placeholder: "Search by action or message", "aria-label": "Search logs by action or message" })] }) }), jsxRuntimeExports.jsxs(Table, { children: [jsxRuntimeExports.jsx(TableHeader, { children: jsxRuntimeExports.jsxs(TableRow, { className: "hover:bg-transparent", children: [jsxRuntimeExports.jsx(TableHead, { className: "w-1/3 px-4", "aria-sort": isSortedAsc ? 'ascending' : 'descending', children: jsxRuntimeExports.jsxs(Button, { type: "button", variant: "ghost", className: "-ml-2", onClick: () => onOptionsChange({ isSortedAsc: !isSortedAsc, currentPage: 1 }), "aria-label": `Sort by date ${isSortedAsc ? 'descending' : 'ascending'}`, children: ["Date", isSortedAsc ? (jsxRuntimeExports.jsx(ArrowUp, { "aria-hidden": "true" })) : (jsxRuntimeExports.jsx(ArrowDown, { "aria-hidden": "true" }))] }) }), jsxRuntimeExports.jsx(TableHead, { className: "w-1/3 px-4", children: "Action" }), jsxRuntimeExports.jsx(TableHead, { className: "w-1/3 px-4", children: "Message" })] }) }), jsxRuntimeExports.jsx(TableBody, { "aria-busy": isLoading, children: isLoading ? (Array.from({ length: 3 }).map((_, index) => (jsxRuntimeExports.jsx(TableRow, { children: [0, 1, 2].map((cell) => (jsxRuntimeExports.jsxs(TableCell, { className: "h-12 px-4", children: [index === 0 && cell === 0 && (jsxRuntimeExports.jsx("span", { className: "sr-only", role: "status", children: "Loading logs" })), jsxRuntimeExports.jsx("div", { className: "h-4 max-w-48 animate-pulse rounded bg-muted" })] }, cell))) }, index)))) : errors.length > 0 ? (errors.map((error) => (jsxRuntimeExports.jsxs(TableRow, { tabIndex: 0, className: "cursor-pointer focus-visible:bg-muted/50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", onClick: () => onSelect(error), onKeyDown: (event) => handleRowKeyDown(event, error), "aria-label": `Open log details for ${error.action} on ${error.formattedDate}`, children: [jsxRuntimeExports.jsx(TableCell, { className: "h-12 px-4 font-medium whitespace-normal", children: error.formattedDate }), jsxRuntimeExports.jsx(TableCell, { className: "h-12 px-4 whitespace-normal", children: error.action }), jsxRuntimeExports.jsx(TableCell, { className: "h-12 max-w-0 px-4 whitespace-normal", children: jsxRuntimeExports.jsx("span", { className: "line-clamp-2 break-words", children: error.message }) })] }, error.id)))) : (jsxRuntimeExports.jsx(TableRow, { className: "hover:bg-transparent", children: jsxRuntimeExports.jsx(TableCell, { colSpan: 3, className: "h-32 text-center text-muted-foreground", children: searchText ? 'No logs match your search.' : 'No logs found.' }) })) })] }), jsxRuntimeExports.jsxs("div", { "data-slot": "table-pagination", className: "flex flex-col gap-3 border-t px-4 py-2 sm:flex-row sm:items-center sm:justify-end", children: [jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 text-sm", children: [jsxRuntimeExports.jsx("span", { className: "whitespace-nowrap text-muted-foreground", children: "Rows per page" }), jsxRuntimeExports.jsxs(Select, { value: String(rowsPerPage), onValueChange: (value) => onOptionsChange({ rowsPerPage: Number(value), currentPage: 1 }), children: [jsxRuntimeExports.jsx(SelectTrigger, { className: "w-18", "aria-label": "Rows per page", children: jsxRuntimeExports.jsx(SelectValue, {}) }), jsxRuntimeExports.jsx(SelectContent, { align: "end", children: rowsPerPageOptions.map((option) => (jsxRuntimeExports.jsx(SelectItem, { value: String(option), children: option }, option))) })] })] }), jsxRuntimeExports.jsxs("p", { className: "m-0 min-w-24 text-sm text-muted-foreground", "aria-live": "polite", children: [firstVisibleRow, "-", lastVisibleRow, " of ", total] }), jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: 1 }), disabled: currentPage === 1, "aria-label": "Go to first page", children: jsxRuntimeExports.jsx(ChevronsLeft, {}) }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: Math.max(1, currentPage - 1) }), disabled: currentPage === 1, "aria-label": "Go to previous page", children: jsxRuntimeExports.jsx(ChevronLeft, {}) }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: Math.min(pageCount, currentPage + 1) }), disabled: currentPage === pageCount, "aria-label": "Go to next page", children: jsxRuntimeExports.jsx(ChevronRight, {}) }), jsxRuntimeExports.jsx(Button, { type: "button", variant: "ghost", size: "icon", onClick: () => onOptionsChange({ currentPage: pageCount }), disabled: currentPage === pageCount, "aria-label": "Go to last page", children: jsxRuntimeExports.jsx(ChevronsRight, {}) })] })] })] }));
36837
36857
  };
36838
36858
 
36839
36859
  const IntegrationView = ({ appComponentRef, userErrors, isUserErrorsLoading, userErrorsTotal, userErrorsCurrentPage, userErrorsRowsPerPage, userErrorsSearchText, userErrorsIsSortedAsc, onSelectUserError, onUserErrorsOptionsChange, isErrorLogsVisible, ...integrationProps }) => {
36840
- return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("div", { style: { display: isErrorLogsVisible ? 'none' : undefined }, children: jsxRuntimeExports.jsx(SimpleIntegration, { ref: appComponentRef, ...integrationProps }) }), jsxRuntimeExports.jsxs("div", { id: "user-errors", style: { display: isErrorLogsVisible ? undefined : 'none' }, children: [jsxRuntimeExports.jsx(UserErrorsTable, { errors: userErrors, isLoading: isUserErrorsLoading, total: userErrorsTotal, currentPage: userErrorsCurrentPage, rowsPerPage: userErrorsRowsPerPage, searchText: userErrorsSearchText, isSortedAsc: userErrorsIsSortedAsc, onSelect: onSelectUserError, onOptionsChange: onUserErrorsOptionsChange }), jsxRuntimeExports.jsx(AppAlert, { className: "mt-4", children: "This table displays the most recent error logs from the past month. Logs older than one month will be automatically deleted." })] })] }));
36860
+ return (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx("div", { className: "flex min-h-0 flex-1 flex-col", style: { display: isErrorLogsVisible ? 'none' : undefined }, children: jsxRuntimeExports.jsx(SimpleIntegration, { ref: appComponentRef, ...integrationProps }) }), jsxRuntimeExports.jsxs("div", { id: "user-errors", style: { display: isErrorLogsVisible ? undefined : 'none' }, children: [jsxRuntimeExports.jsx(UserErrorsTable, { errors: userErrors, isLoading: isUserErrorsLoading, total: userErrorsTotal, currentPage: userErrorsCurrentPage, rowsPerPage: userErrorsRowsPerPage, searchText: userErrorsSearchText, isSortedAsc: userErrorsIsSortedAsc, onSelect: onSelectUserError, onOptionsChange: onUserErrorsOptionsChange }), jsxRuntimeExports.jsx(AppAlert, { className: "mt-4", children: "This table displays the most recent logs from the past month. Logs older than one month will be automatically deleted." })] })] }));
36841
36861
  };
36842
36862
 
36843
36863
  function Progress({ className, value, ...props }) {
@@ -36931,26 +36951,18 @@ Defaulting to \`null\`.`;
36931
36951
  }) }))] }));
36932
36952
  });
36933
36953
 
36934
- const TopBar = ({ notice, isNoticeVisible, checkSubscription, subscriptionInfo, isErrorLogsVisible, isManager, infoModal, hasSettings, isOwner, onCloseNotice, onShowIntegration, onShowErrorLogs, onShowPermissions, onOpenInfoModal, onOpenSettings, onLogout, }) => {
36954
+ const TopBar = ({ notice, isNoticeVisible, checkSubscription, subscriptionInfo, isErrorLogsVisible, isManager, infoModal, onCloseNotice, onShowIntegration, onShowErrorLogs, onShowPermissions, onOpenInfoModal, onOpenSettings, }) => {
36935
36955
  const isMobile = useIsMobile();
36936
36956
  const actions = [
36937
36957
  ...(isManager ? [{ key: 'share', label: 'Share', icon: Link, onClick: onShowPermissions }] : []),
36938
36958
  ...(infoModal ? [{ key: 'info', label: infoModal.title, icon: Info, onClick: onOpenInfoModal }] : []),
36939
- ...(hasSettings ? [{ key: 'settings', label: 'Settings', icon: Settings, onClick: onOpenSettings }] : []),
36940
- {
36941
- key: 'logout',
36942
- label: 'Log out',
36943
- icon: CircleUserRound,
36944
- onClick: onLogout,
36945
- disabled: !isOwner,
36946
- title: !isOwner ? 'Only the owner can log out' : undefined,
36947
- },
36959
+ { key: 'settings', label: 'Settings', icon: Settings, onClick: onOpenSettings },
36948
36960
  ];
36949
- return (jsxRuntimeExports.jsxs("div", { className: "mb-2.5 text-right", children: [notice && isNoticeVisible && (jsxRuntimeExports.jsxs(AppAlert, { id: "notice", title: notice.title, hideIcon: !notice.icon, variant: getAlertVariant(notice.type), className: "mb-3 pr-12 text-left", children: [jsxRuntimeExports.jsx("p", { className: "m-0", dangerouslySetInnerHTML: { __html: notice.content } }), notice.close && (jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "icon", "aria-label": "Close notice", onClick: () => onCloseNotice('notice'), className: "absolute right-1 top-1", children: jsxRuntimeExports.jsx(X, {}) }))] })), checkSubscription && subscriptionInfo && (jsxRuntimeExports.jsx(AppAlert, { id: "subscription-info", hideIcon: true, variant: "warning", className: "mb-3", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center", children: [jsxRuntimeExports.jsxs("p", { className: "m-0", children: ["Your trial expires in ", subscriptionInfo.daysLeft, " days."] }), jsxRuntimeExports.jsx(Button, { className: "ml-2", variant: "default", onClick: () => {
36961
+ return (jsxRuntimeExports.jsxs("div", { className: "mb-2.5 text-right", children: [notice && isNoticeVisible && (jsxRuntimeExports.jsxs(AppAlert, { id: "notice", title: notice.title, hideIcon: !notice.icon, variant: getAlertVariant(notice.type), className: "mb-3 pr-12 text-left", children: [jsxRuntimeExports.jsx("div", { className: "html-content", dangerouslySetInnerHTML: { __html: notice.content } }), notice.close && (jsxRuntimeExports.jsx(Button, { variant: "ghost", size: "icon", "aria-label": "Close notice", onClick: () => onCloseNotice('notice'), className: "absolute right-1 top-1", children: jsxRuntimeExports.jsx(X, {}) }))] })), checkSubscription && subscriptionInfo && (jsxRuntimeExports.jsx(AppAlert, { id: "subscription-info", hideIcon: true, variant: "warning", className: "mb-3", children: jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-center", children: [jsxRuntimeExports.jsxs("p", { className: "m-0", children: ["Your trial expires in ", subscriptionInfo.daysLeft, " days."] }), jsxRuntimeExports.jsx(Button, { className: "ml-2", variant: "default", onClick: () => {
36950
36962
  if (subscriptionInfo === null || subscriptionInfo === void 0 ? void 0 : subscriptionInfo.subscribeLink) {
36951
36963
  window.open(subscriptionInfo.subscribeLink, '_blank', 'noopener,noreferrer');
36952
36964
  }
36953
- }, children: "Subscribe" })] }) })), jsxRuntimeExports.jsxs("div", { id: "buttons", className: "flex w-full items-center gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "mr-auto shrink-0", children: [jsxRuntimeExports.jsx("span", { style: { display: isErrorLogsVisible ? undefined : 'none' }, children: jsxRuntimeExports.jsxs(Button, { id: "show-integration-btn", variant: "outline", onClick: onShowIntegration, children: [jsxRuntimeExports.jsx(ArrowLeft, {}), "Integration"] }) }), jsxRuntimeExports.jsx("span", { style: { display: isErrorLogsVisible ? 'none' : undefined }, children: jsxRuntimeExports.jsxs(Button, { id: "show-error-logs-btn", variant: "outline", onClick: onShowErrorLogs, children: [jsxRuntimeExports.jsx(List$1, {}), "Error logs"] }) })] }), isMobile ? (
36965
+ }, children: "Subscribe" })] }) })), jsxRuntimeExports.jsxs("div", { id: "buttons", className: "flex w-full items-center gap-2", children: [jsxRuntimeExports.jsxs("div", { className: "mr-auto shrink-0", children: [jsxRuntimeExports.jsx("span", { style: { display: isErrorLogsVisible ? undefined : 'none' }, children: jsxRuntimeExports.jsxs(Button, { id: "show-integration-btn", variant: "outline", onClick: onShowIntegration, children: [jsxRuntimeExports.jsx(ArrowLeft, {}), "Integration"] }) }), jsxRuntimeExports.jsx("span", { style: { display: isErrorLogsVisible ? 'none' : undefined }, children: jsxRuntimeExports.jsxs(Button, { id: "show-error-logs-btn", variant: "outline", onClick: onShowErrorLogs, children: [jsxRuntimeExports.jsx(List$1, {}), "Logs"] }) })] }), isMobile ? (
36954
36966
  // Labelled buttons cannot fit a phone width, and the row does not
36955
36967
  // wrap - left as-is they widen the whole page into a sideways scroll.
36956
36968
  jsxRuntimeExports.jsxs(DropdownMenu, { children: [jsxRuntimeExports.jsx(DropdownMenuTrigger, { asChild: true, children: jsxRuntimeExports.jsx(Button, { variant: "outline", size: "icon", "aria-label": "More actions", children: jsxRuntimeExports.jsx(Ellipsis, {}) }) }), jsxRuntimeExports.jsx(DropdownMenuContent, { align: "end", className: "max-w-[calc(100vw-2rem)] min-w-48", children: actions.map((action) => (jsxRuntimeExports.jsxs(DropdownMenuItem, { disabled: action.disabled, onClick: action.onClick, children: [jsxRuntimeExports.jsx(action.icon, {}), jsxRuntimeExports.jsx("span", { className: "truncate", children: action.label })] }, action.key))) })] })) : (actions.map((action) => (jsxRuntimeExports.jsxs(Button, { variant: "outline", className: "min-w-0", disabled: action.disabled, title: action.title, onClick: action.onClick, children: [jsxRuntimeExports.jsx(action.icon, {}), jsxRuntimeExports.jsx("span", { className: "truncate", children: action.label })] }, action.key))))] })] }));
@@ -36985,6 +36997,8 @@ Defaulting to \`null\`.`;
36985
36997
  const checkUsersSeqRef = reactExports.useRef(0);
36986
36998
  const permissionsOpenSeqRef = reactExports.useRef(0);
36987
36999
  const [isLoading, setIsLoading] = reactExports.useState(false);
37000
+ // Kept apart from isLoading: disabling the focused users input would hide it from assistive tech.
37001
+ const [isCheckingUsers, setIsCheckingUsers] = reactExports.useState(false);
36988
37002
  // Gates Save until the user list loads, so a failed load can't save an empty list.
36989
37003
  const [isPermissionsLoaded, setIsPermissionsLoaded] = reactExports.useState(false);
36990
37004
  const [permissionUserOptions, setPermissionUserOptions] = reactExports.useState([]);
@@ -37005,10 +37019,12 @@ Defaulting to \`null\`.`;
37005
37019
  setIsPermissionsConfirmVisible(true);
37006
37020
  }
37007
37021
  async function showPermissionsDialog() {
37008
- var _a;
37022
+ var _a, _b;
37009
37023
  hideConfirmUsersBlock();
37010
- openModal(permissionsModalRef.current);
37024
+ (_a = permissionsModalRef.current) === null || _a === void 0 ? void 0 : _a.open();
37011
37025
  setIsLoading(true);
37026
+ // The bumped sequence below stops a pending check from clearing this itself.
37027
+ setIsCheckingUsers(false);
37012
37028
  setPermissionsSelectedUsers([]);
37013
37029
  // Reset before the async load, so a change event mid-load can't act on the
37014
37030
  // previous session's state.
@@ -37040,7 +37056,7 @@ Defaulting to \`null\`.`;
37040
37056
  const validUserIds = new Set(users.map((user) => `${user.id}`));
37041
37057
  const storedManagers = parsedManagers.filter((id) => validUserIds.has(id));
37042
37058
  // Ids are compared as strings; a missing owner id must stay null, not become "undefined".
37043
- connectionOwnerIdRef.current = (_a = ownerId === null || ownerId === void 0 ? void 0 : ownerId.toString()) !== null && _a !== void 0 ? _a : null;
37059
+ connectionOwnerIdRef.current = (_b = ownerId === null || ownerId === void 0 ? void 0 : ownerId.toString()) !== null && _b !== void 0 ? _b : null;
37044
37060
  // Baseline for telling additions from removals: stored managers plus the owner
37045
37061
  // (who always has access). The acting user is deliberately NOT seeded.
37046
37062
  initialManagerIdsRef.current = new Set(storedManagers);
@@ -37085,13 +37101,14 @@ Defaulting to \`null\`.`;
37085
37101
  showToast("The integration owner can't be removed from the access list.");
37086
37102
  }
37087
37103
  setPermissionsSelectedUsers(selectedUsers);
37088
- setIsLoading(true);
37104
+ setIsCheckingUsers(true);
37089
37105
  // Stamped on every invocation, the empty-selection early-return included, so a
37090
37106
  // cleared selection also invalidates a validation still in flight.
37091
37107
  const seq = ++checkUsersSeqRef.current;
37108
+ const finishChecking = () => setTimeout(() => seq === checkUsersSeqRef.current && setIsCheckingUsers(false), 500);
37092
37109
  if (selectedUsers.length === 0) {
37093
37110
  hideConfirmUsersBlock();
37094
- setTimeout(() => setIsLoading(false), 500);
37111
+ finishChecking();
37095
37112
  return;
37096
37113
  }
37097
37114
  const user_ids = selectedUsers.filter((id) => parseInt(id));
@@ -37161,9 +37178,7 @@ Defaulting to \`null\`.`;
37161
37178
  }
37162
37179
  }
37163
37180
  finally {
37164
- if (seq === checkUsersSeqRef.current) {
37165
- setTimeout(() => setIsLoading(false), 500);
37166
- }
37181
+ finishChecking();
37167
37182
  }
37168
37183
  }
37169
37184
  function inviteUsers() {
@@ -37178,7 +37193,7 @@ Defaulting to \`null\`.`;
37178
37193
  !!actingUserId &&
37179
37194
  !permissionsSelectedUsers.some((id) => `${id}` === actingUserId);
37180
37195
  AP.inviteUsers({ user_ids, emails }, async (res) => {
37181
- var _a;
37196
+ var _a, _b;
37182
37197
  if (!res.success) {
37183
37198
  catchRejection(res, ((_a = res === null || res === void 0 ? void 0 : res.error) === null || _a === void 0 ? void 0 : _a.message) || "Can't invite users");
37184
37199
  setTimeout(() => setIsLoading(false), 500);
@@ -37197,7 +37212,7 @@ Defaulting to \`null\`.`;
37197
37212
  }
37198
37213
  showToast('Users successfully updated');
37199
37214
  hideConfirmUsersBlock();
37200
- closeModal(permissionsModalRef.current);
37215
+ (_b = permissionsModalRef.current) === null || _b === void 0 ? void 0 : _b.close();
37201
37216
  }
37202
37217
  catch (e) {
37203
37218
  catchRejection(e, (e === null || e === void 0 ? void 0 : e.error) || "Can't invite users");
@@ -37253,6 +37268,7 @@ Defaulting to \`null\`.`;
37253
37268
  }
37254
37269
  return {
37255
37270
  isLoading,
37271
+ isCheckingUsers,
37256
37272
  isPermissionsLoaded,
37257
37273
  permissionUserOptions,
37258
37274
  permissionsSelectedUsers,
@@ -37311,7 +37327,7 @@ Defaulting to \`null\`.`;
37311
37327
  found = selectedFiles.find((file) => file.node_type === FOLDER_TYPE || file.node_type === BRANCH_TYPE);
37312
37328
  }
37313
37329
  else {
37314
- const files = await appComponent.current.getCrowdinFilesData();
37330
+ const files = await requireRef(appComponent).getCrowdinFilesData();
37315
37331
  const folders = files.filter((file) => file.node_type === FOLDER_TYPE || file.node_type === BRANCH_TYPE);
37316
37332
  found = folders.find((folder) => selectedFiles.hasOwnProperty(folder.id));
37317
37333
  }
@@ -37326,11 +37342,11 @@ Defaulting to \`null\`.`;
37326
37342
  : [];
37327
37343
  }
37328
37344
  async function openScheduleModal(type, options = {}) {
37329
- var _a, _b, _c, _d;
37345
+ var _a, _b, _c, _d, _e;
37330
37346
  const { showAllFolderFiles = false, showNewFiles = true } = options;
37331
37347
  let newFileStatus = 'unChecked';
37332
37348
  const integrationSyncFolders = ((await ((_b = (_a = appComponent.current) === null || _a === void 0 ? void 0 : _a.getIntegrationScheduleSync) === null || _b === void 0 ? void 0 : _b.call(_a, true))) || []).filter((elements) => elements.node_type === FOLDER_TYPE);
37333
- const integrationFiles = (_c = appComponent.current) === null || _c === void 0 ? void 0 : _c.querySelector('#integration-files');
37349
+ const integrationFiles = (_c = appComponent.current) === null || _c === void 0 ? void 0 : _c.getFilesHandle('integration');
37334
37350
  const selectedIntegrationFolders = ((await ((_d = integrationFiles === null || integrationFiles === void 0 ? void 0 : integrationFiles.getSelected) === null || _d === void 0 ? void 0 : _d.call(integrationFiles, true))) || []).filter((elements) => elements.node_type === FOLDER_TYPE);
37335
37351
  for (let i = 0; i < selectedIntegrationFolders.length; i++) {
37336
37352
  const selectedElement = selectedIntegrationFolders[i];
@@ -37356,7 +37372,7 @@ Defaulting to \`null\`.`;
37356
37372
  allFolderFiles: false,
37357
37373
  });
37358
37374
  setIsScheduleSaveDisabled(false);
37359
- openModal(scheduleModalRef.current);
37375
+ (_e = scheduleModalRef.current) === null || _e === void 0 ? void 0 : _e.open();
37360
37376
  }
37361
37377
  function onChangeAutoSynchronizationOptions() {
37362
37378
  var _a, _b, _c;
@@ -37375,28 +37391,29 @@ Defaulting to \`null\`.`;
37375
37391
  setIsScheduleSaveDisabled(!nextState.newFiles && !nextState.selectedFiles && !nextState.allFolderFiles);
37376
37392
  }
37377
37393
  async function saveScheduleSync() {
37394
+ var _a;
37378
37395
  const { type, newFiles: newFile, selectedFiles, allFolderFiles } = scheduleModalState;
37379
37396
  if (type === 'crowdin') {
37380
- const crowdinFiles = await appComponent.current.getCrowdinFilesData();
37397
+ const crowdinFiles = await requireRef(appComponent).getCrowdinFilesData();
37381
37398
  const syncedFileIds = Object.keys(syncData.current);
37382
37399
  const crowdinFolderIds = crowdinFiles
37383
37400
  .filter((file) => file.node_type === FOLDER_TYPE || file.node_type === BRANCH_TYPE)
37384
37401
  .filter((file) => syncedFileIds.includes(String(file.id)))
37385
37402
  .map((file) => String(file.id));
37386
- appComponent.current.setCrowdinScheduleSync(syncData.current, newFile, selectedFiles);
37387
- const syncedFiles = await appComponent.current.getCrowdinScheduleSync(true);
37388
- appComponent.current.setAttribute('is-crowdin-sync-settings-in-progress', true);
37403
+ requireRef(appComponent).setCrowdinScheduleSync(syncData.current, newFile, selectedFiles);
37404
+ const syncedFiles = await requireRef(appComponent).getCrowdinScheduleSync(true);
37405
+ requireRef(appComponent).setSyncSettingsInProgress('crowdin', true);
37389
37406
  updateSyncSettings(syncedFiles, 'schedule', 'crowdin', [], crowdinFolderIds);
37390
37407
  }
37391
37408
  else if (type === 'integration') {
37392
37409
  if (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.integration) {
37393
- appComponent.current.setIntegrationScheduleSync(syncData.current, newFile, selectedFiles);
37410
+ requireRef(appComponent).setIntegrationScheduleSync(syncData.current, newFile, selectedFiles);
37394
37411
  }
37395
37412
  else {
37396
- appComponent.current.setIntegrationScheduleSync(syncData.current);
37413
+ requireRef(appComponent).setIntegrationScheduleSync(syncData.current);
37397
37414
  }
37398
- const syncedFiles = await appComponent.current.getIntegrationScheduleSync(true);
37399
- appComponent.current.setAttribute('is-integration-sync-settings-in-progress', true);
37415
+ const syncedFiles = await requireRef(appComponent).getIntegrationScheduleSync(true);
37416
+ requireRef(appComponent).setSyncSettingsInProgress('integration', true);
37400
37417
  if (integrationOneLevelFetching) {
37401
37418
  updateSyncSettings(syncedFiles, 'schedule', 'integration', selectedFiles ? getIntegrationFoldersToExpand(syncData.current, syncedFiles) : []);
37402
37419
  }
@@ -37412,7 +37429,7 @@ Defaulting to \`null\`.`;
37412
37429
  }
37413
37430
  }
37414
37431
  }
37415
- closeModal(scheduleModalRef.current);
37432
+ (_a = scheduleModalRef.current) === null || _a === void 0 ? void 0 : _a.close();
37416
37433
  }
37417
37434
  async function setIntegrationScheduleSync(e) {
37418
37435
  var _a;
@@ -37432,8 +37449,8 @@ Defaulting to \`null\`.`;
37432
37449
  await openScheduleModal('integration', { showNewFiles, showAllFolderFiles });
37433
37450
  return;
37434
37451
  }
37435
- appComponent.current.setIntegrationScheduleSync(e.detail);
37436
- syncedFiles = await appComponent.current.getIntegrationScheduleSync(true);
37452
+ requireRef(appComponent).setIntegrationScheduleSync(e.detail);
37453
+ syncedFiles = await requireRef(appComponent).getIntegrationScheduleSync(true);
37437
37454
  }
37438
37455
  else {
37439
37456
  syncData.current = e.detail;
@@ -37442,9 +37459,9 @@ Defaulting to \`null\`.`;
37442
37459
  await openScheduleModal('integration', { showNewFiles: false, showAllFolderFiles: true });
37443
37460
  return;
37444
37461
  }
37445
- syncedFiles = await appComponent.current.getIntegrationScheduleSync();
37462
+ syncedFiles = await requireRef(appComponent).getIntegrationScheduleSync();
37446
37463
  }
37447
- appComponent.current.setAttribute('is-integration-sync-settings-in-progress', true);
37464
+ requireRef(appComponent).setSyncSettingsInProgress('integration', true);
37448
37465
  if (integrationOneLevelFetching) {
37449
37466
  updateSyncSettings(syncedFiles, 'schedule', 'integration', getIntegrationFoldersToExpand(e.detail, syncedFiles));
37450
37467
  }
@@ -37475,13 +37492,13 @@ Defaulting to \`null\`.`;
37475
37492
  await openScheduleModal('crowdin');
37476
37493
  return;
37477
37494
  }
37478
- appComponent.current.setCrowdinScheduleSync(e.detail);
37479
- syncedFiles = await appComponent.current.getCrowdinScheduleSync(true);
37495
+ requireRef(appComponent).setCrowdinScheduleSync(e.detail);
37496
+ syncedFiles = await requireRef(appComponent).getCrowdinScheduleSync(true);
37480
37497
  }
37481
37498
  else {
37482
- syncedFiles = await appComponent.current.getCrowdinScheduleSync();
37499
+ syncedFiles = await requireRef(appComponent).getCrowdinScheduleSync();
37483
37500
  }
37484
- appComponent.current.setAttribute('is-crowdin-sync-settings-in-progress', true);
37501
+ requireRef(appComponent).setSyncSettingsInProgress('crowdin', true);
37485
37502
  updateSyncSettings(syncedFiles, 'schedule', 'crowdin');
37486
37503
  }
37487
37504
  async function disableIntegrationSync(e) {
@@ -37489,10 +37506,10 @@ Defaulting to \`null\`.`;
37489
37506
  showToast('Select templates which will be pushed to Crowdin');
37490
37507
  return;
37491
37508
  }
37492
- appComponent.current.setAttribute('is-integration-sync-settings-in-progress', true);
37509
+ requireRef(appComponent).setSyncSettingsInProgress('integration', true);
37493
37510
  const syncedFiles = (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.integration)
37494
- ? await appComponent.current.getIntegrationScheduleSync(true)
37495
- : await appComponent.current.getIntegrationScheduleSync();
37511
+ ? await requireRef(appComponent).getIntegrationScheduleSync(true)
37512
+ : await requireRef(appComponent).getIntegrationScheduleSync();
37496
37513
  updateSyncSettings(syncedFiles, 'schedule', 'integration');
37497
37514
  }
37498
37515
  async function disableCrowdinSync(e) {
@@ -37500,10 +37517,10 @@ Defaulting to \`null\`.`;
37500
37517
  showToast('Select templates which will be pushed to Crowdin');
37501
37518
  return;
37502
37519
  }
37503
- appComponent.current.setAttribute('is-crowdin-sync-settings-in-progress', true);
37520
+ requireRef(appComponent).setSyncSettingsInProgress('crowdin', true);
37504
37521
  const syncedFiles = (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.crowdin)
37505
- ? await appComponent.current.getCrowdinScheduleSync(true)
37506
- : await appComponent.current.getCrowdinScheduleSync();
37522
+ ? await requireRef(appComponent).getCrowdinScheduleSync(true)
37523
+ : await requireRef(appComponent).getCrowdinScheduleSync();
37507
37524
  updateSyncSettings(syncedFiles, 'schedule', 'crowdin');
37508
37525
  }
37509
37526
  return {
@@ -37579,7 +37596,7 @@ Defaulting to \`null\`.`;
37579
37596
  setTimeout(refreshDependencies, 100);
37580
37597
  }
37581
37598
  async function saveSettings() {
37582
- var _a, _b;
37599
+ var _a, _b, _c;
37583
37600
  setIsLoading(true);
37584
37601
  const configReq = {};
37585
37602
  for (const tab of configurationFields || []) {
@@ -37634,10 +37651,11 @@ Defaulting to \`null\`.`;
37634
37651
  showToast("Can't save settings");
37635
37652
  },
37636
37653
  onFinally: () => {
37654
+ var _a;
37637
37655
  setTimeout(() => setIsLoading(false), 500);
37638
37656
  setIsSettingsSaveDisabled(false);
37639
37657
  if (!isValidationError && !isSettingsSaveFailed) {
37640
- closeModal(settingsModalRef.current);
37658
+ (_a = settingsModalRef.current) === null || _a === void 0 ? void 0 : _a.close();
37641
37659
  if (reloadOnConfigSave) {
37642
37660
  getIntegrationData({ hardReload: true });
37643
37661
  getCrowdinData();
@@ -37677,7 +37695,7 @@ Defaulting to \`null\`.`;
37677
37695
  setTimeout(() => setIsLoading(false), 500);
37678
37696
  setIsSettingsSaveDisabled(false);
37679
37697
  if (!isValidationError) {
37680
- closeModal(settingsModalRef.current);
37698
+ (_c = settingsModalRef.current) === null || _c === void 0 ? void 0 : _c.close();
37681
37699
  if (reloadOnConfigSave) {
37682
37700
  getIntegrationData({ hardReload: true });
37683
37701
  getCrowdinData();
@@ -37724,6 +37742,8 @@ Defaulting to \`null\`.`;
37724
37742
  }, []);
37725
37743
  function handleRefreshFilesList(detail) {
37726
37744
  if (detail.refreshIntegration) {
37745
+ savedIntegrationData.current = null;
37746
+ currentOpenedFolders.current = null;
37727
37747
  getIntegrationData({ hardReload: true });
37728
37748
  }
37729
37749
  else if (detail.refreshCrowdin) {
@@ -37740,7 +37760,7 @@ Defaulting to \`null\`.`;
37740
37760
  }
37741
37761
  async function handleLoadMore(detail) {
37742
37762
  var _a;
37743
- const fileComponent = (_a = appComponent.current) === null || _a === void 0 ? void 0 : _a.querySelector('#integration-files');
37763
+ const fileComponent = (_a = appComponent.current) === null || _a === void 0 ? void 0 : _a.getFilesHandle('integration');
37744
37764
  if (!fileComponent) {
37745
37765
  return;
37746
37766
  }
@@ -37758,13 +37778,15 @@ Defaulting to \`null\`.`;
37758
37778
  }
37759
37779
  const isEmptySearch = !search || search.trim() === '';
37760
37780
  if (isEmptySearch && savedIntegrationData.current && hasLoadMoreElements.current) {
37761
- appComponent.current.setIntegrationFilesData(savedIntegrationData.current);
37762
- appComponent.current.setIntegrationOpenedFolders(currentOpenedFolders.current);
37781
+ requireRef(appComponent).setIntegrationFilesData(savedIntegrationData.current);
37782
+ requireRef(appComponent).setIntegrationOpenedFolders(currentOpenedFolders.current);
37783
+ savedIntegrationData.current = null;
37784
+ currentOpenedFolders.current = null;
37763
37785
  return;
37764
37786
  }
37765
- if (!isEmptySearch && hasLoadMoreElements.current) {
37766
- savedIntegrationData.current = await appComponent.current.getIntegrationFilesData();
37767
- currentOpenedFolders.current = await appComponent.current.getIntegrationOpenedFolders();
37787
+ if (!isEmptySearch && hasLoadMoreElements.current && !savedIntegrationData.current) {
37788
+ savedIntegrationData.current = await requireRef(appComponent).getIntegrationFilesData();
37789
+ currentOpenedFolders.current = await requireRef(appComponent).getIntegrationOpenedFolders();
37768
37790
  }
37769
37791
  getIntegrationData({ search });
37770
37792
  }
@@ -37791,7 +37813,7 @@ Defaulting to \`null\`.`;
37791
37813
  }
37792
37814
  async function getCrowdinData() {
37793
37815
  var _a, _b, _c, _d, _f;
37794
- (_a = appComponent.current) === null || _a === void 0 ? void 0 : _a.setAttribute('is-crowdin-loading', 'true');
37816
+ (_a = appComponent.current) === null || _a === void 0 ? void 0 : _a.setLoading('crowdin', true);
37795
37817
  try {
37796
37818
  const restParams = await checkOrigin();
37797
37819
  if (progressiveCrowdinFilesLoading) {
@@ -37833,7 +37855,7 @@ Defaulting to \`null\`.`;
37833
37855
  ]);
37834
37856
  const tree = files.map(transformCrowdinItemToTree);
37835
37857
  crowdinData.current = tree;
37836
- appComponent.current.setCrowdinFilesData(tree);
37858
+ requireRef(appComponent).setCrowdinFilesData(tree);
37837
37859
  project.current = projectData;
37838
37860
  const languagesSorted = project.current.targetLanguages
37839
37861
  .map((language) => ({
@@ -37846,7 +37868,7 @@ Defaulting to \`null\`.`;
37846
37868
  languagesSorted.push({ ...project.current.inContextPseudoLanguage, inContext: true });
37847
37869
  }
37848
37870
  setLanguagesForTranslation(languagesSorted);
37849
- appComponent.current.setCrowdinLanguagesData(languagesSorted);
37871
+ requireRef(appComponent).setCrowdinLanguagesData(languagesSorted);
37850
37872
  }
37851
37873
  if (withCronSync || webhooks) {
37852
37874
  await getSyncSettings('crowdin');
@@ -37856,12 +37878,12 @@ Defaulting to \`null\`.`;
37856
37878
  catchRejection(e, "Can't fetch Crowdin data");
37857
37879
  }
37858
37880
  finally {
37859
- appComponent.current.setAttribute('is-crowdin-loading', false);
37881
+ requireRef(appComponent).setLoading('crowdin', false);
37860
37882
  }
37861
37883
  }
37862
37884
  async function getIntegrationData({ hardReload = false, parentId = '', search = '', page = 0, recursion = false, paginationData } = {}, recursionState = null) {
37863
37885
  if (!paginationData) {
37864
- appComponent.current.setAttribute('is-integration-loading', true);
37886
+ requireRef(appComponent).setLoading('integration', true);
37865
37887
  }
37866
37888
  let recursionStateLocal = recursionState;
37867
37889
  try {
@@ -37876,12 +37898,14 @@ Defaulting to \`null\`.`;
37876
37898
  if ((!paginationData && !parentId && !search) || hardReload) {
37877
37899
  hasLoadMoreElements.current = tree.some((item) => item.node_type === 'load-more');
37878
37900
  }
37879
- const appIntegrationFiles = appComponent.current.querySelector('#integration-files');
37901
+ const appIntegrationFiles = requireRef(appComponent).getFilesHandle('integration');
37880
37902
  if (hardReload) {
37881
- appComponent.current.setIntegrationFilesData(tree);
37903
+ requireRef(appComponent).setIntegrationFilesData(tree);
37882
37904
  }
37883
37905
  else if (tree.length) {
37884
- appComponent.current.pushIntegrationFilesData(tree).then(async () => {
37906
+ requireRef(appComponent)
37907
+ .pushIntegrationFilesData(tree)
37908
+ .then(async () => {
37885
37909
  if (parentId) {
37886
37910
  const selection = await appIntegrationFiles.getSelected();
37887
37911
  const selectedIds = selection === null || selection === void 0 ? void 0 : selection.filter((node) => node).map(({ id }) => id.toString());
@@ -37896,7 +37920,7 @@ Defaulting to \`null\`.`;
37896
37920
  }
37897
37921
  if (search) {
37898
37922
  const openIds = files.filter((e) => !e.type).map((e) => e.id);
37899
- appComponent.current.setIntegrationOpenedFolders(openIds);
37923
+ requireRef(appComponent).setIntegrationOpenedFolders(openIds);
37900
37924
  }
37901
37925
  if (recursion) {
37902
37926
  if (!recursionStateLocal) {
@@ -37904,7 +37928,7 @@ Defaulting to \`null\`.`;
37904
37928
  openedFolders: new Set(),
37905
37929
  calls: 0,
37906
37930
  setLoading(isLoading) {
37907
- appComponent.current.setAttribute('is-integration-loading', isLoading);
37931
+ requireRef(appComponent).setLoading('integration', isLoading);
37908
37932
  },
37909
37933
  };
37910
37934
  recursionStateLocal.setLoading(true);
@@ -37914,8 +37938,8 @@ Defaulting to \`null\`.`;
37914
37938
  }
37915
37939
  const folderItems = files.filter(isFolder$1);
37916
37940
  folderItems.forEach((folder) => recursionStateLocal.openedFolders.add(folder.id));
37917
- const openedFoldersNow = await appComponent.current.getIntegrationOpenedFolders();
37918
- appComponent.current.setIntegrationOpenedFolders([
37941
+ const openedFoldersNow = await requireRef(appComponent).getIntegrationOpenedFolders();
37942
+ requireRef(appComponent).setIntegrationOpenedFolders([
37919
37943
  ...new Set([...openedFoldersNow, ...recursionStateLocal.openedFolders]),
37920
37944
  ]);
37921
37945
  if (folderItems.length > 0) {
@@ -37942,10 +37966,10 @@ Defaulting to \`null\`.`;
37942
37966
  }
37943
37967
  finally {
37944
37968
  if (!recursionStateLocal && !recursion) {
37945
- appComponent.current.setAttribute('is-integration-loading', false);
37969
+ requireRef(appComponent).setLoading('integration', false);
37946
37970
  }
37947
37971
  else if (recursionStateLocal && recursionStateLocal.calls === 0) {
37948
- appComponent.current.setAttribute('is-integration-loading', false);
37972
+ requireRef(appComponent).setLoading('integration', false);
37949
37973
  }
37950
37974
  }
37951
37975
  }
@@ -38006,18 +38030,18 @@ Defaulting to \`null\`.`;
38006
38030
  const res = await checkResponse(await fetch(`/api/sync-settings/${provider}` + restParams));
38007
38031
  if (provider === 'crowdin') {
38008
38032
  if (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.crowdin) {
38009
- appComponent.current.setCrowdinScheduleSync(res, true, true);
38033
+ requireRef(appComponent).setCrowdinScheduleSync(res, true, true);
38010
38034
  }
38011
38035
  else {
38012
- appComponent.current.setCrowdinScheduleSync(res);
38036
+ requireRef(appComponent).setCrowdinScheduleSync(res);
38013
38037
  }
38014
38038
  }
38015
38039
  else {
38016
38040
  if (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.integration) {
38017
- appComponent.current.setIntegrationScheduleSync(res, true, true);
38041
+ requireRef(appComponent).setIntegrationScheduleSync(res, true, true);
38018
38042
  }
38019
38043
  else {
38020
- appComponent.current.setIntegrationScheduleSync(res);
38044
+ requireRef(appComponent).setIntegrationScheduleSync(res);
38021
38045
  }
38022
38046
  }
38023
38047
  await applyAutoSyncPausedMarkers(provider, res);
@@ -38030,7 +38054,7 @@ Defaulting to \`null\`.`;
38030
38054
  try {
38031
38055
  const restParams = await checkOrigin();
38032
38056
  const res = await checkResponse(await fetch(`api/crowdin/file-progress/${fileId}` + restParams));
38033
- appComponent.current.addCrowdinFileProgress(Array.isArray(res) ? { [fileId]: res } : res);
38057
+ requireRef(appComponent).addCrowdinFileProgress(Array.isArray(res) ? { [fileId]: res } : res);
38034
38058
  }
38035
38059
  catch (e) {
38036
38060
  catchRejection(e, "Can't fetch file progress");
@@ -38069,7 +38093,7 @@ Defaulting to \`null\`.`;
38069
38093
  showToast('Select templates which will be pushed to Crowdin');
38070
38094
  return;
38071
38095
  }
38072
- appComponent.current.setAttribute('is-to-crowdin-process', true);
38096
+ requireRef(appComponent).setProcess({ toCrowdin: true });
38073
38097
  let req;
38074
38098
  if (integrationOneLevelFetching) {
38075
38099
  req = files.map((f) => ({
@@ -38108,7 +38132,7 @@ Defaulting to \`null\`.`;
38108
38132
  async function getActiveJobs() {
38109
38133
  try {
38110
38134
  const restParams = await checkOrigin();
38111
- const jobs = await checkResponse(await fetch(`api/all-jobs${restParams}`));
38135
+ const jobs = await checkResponse(await fetch(`api/all-jobs${restParams}&finished=false&limit=100`));
38112
38136
  if (!Array.isArray(jobs)) {
38113
38137
  return;
38114
38138
  }
@@ -38116,16 +38140,16 @@ Defaulting to \`null\`.`;
38116
38140
  switch (job.type) {
38117
38141
  case JOB_TYPE.updateCrowdin:
38118
38142
  case JOB_TYPE.updateTargetLanguages:
38119
- appComponent.current.setAttribute('is-to-crowdin-process', true);
38143
+ requireRef(appComponent).setProcess({ toCrowdin: true });
38120
38144
  break;
38121
38145
  case JOB_TYPE.updateIntegration:
38122
- appComponent.current.setAttribute('is-to-integration-process', true);
38146
+ requireRef(appComponent).setProcess({ toIntegration: true });
38123
38147
  break;
38124
38148
  case JOB_TYPE.crowdinSyncSettingsSave:
38125
- appComponent.current.setAttribute('is-crowdin-sync-settings-in-progress', true);
38149
+ requireRef(appComponent).setSyncSettingsInProgress('crowdin', true);
38126
38150
  break;
38127
38151
  case JOB_TYPE.integrationSyncSettingsSave:
38128
- appComponent.current.setAttribute('is-integration-sync-settings-in-progress', true);
38152
+ requireRef(appComponent).setSyncSettingsInProgress('integration', true);
38129
38153
  break;
38130
38154
  default:
38131
38155
  }
@@ -38159,24 +38183,24 @@ Defaulting to \`null\`.`;
38159
38183
  case JOB_TYPE.updateTargetLanguages:
38160
38184
  if (!onFinally) {
38161
38185
  onFinally = () => {
38162
- appComponent.current.setAttribute('is-to-crowdin-process', false);
38186
+ requireRef(appComponent).setProcess({ toCrowdin: false });
38163
38187
  getCrowdinData();
38164
38188
  };
38165
38189
  }
38166
38190
  break;
38167
38191
  case JOB_TYPE.updateIntegration:
38168
38192
  if (!onFinally) {
38169
- onFinally = () => appComponent.current.setAttribute('is-to-integration-process', false);
38193
+ onFinally = () => requireRef(appComponent).setProcess({ toIntegration: false });
38170
38194
  }
38171
38195
  break;
38172
38196
  case JOB_TYPE.crowdinSyncSettingsSave:
38173
38197
  if (!onFinally) {
38174
- onFinally = () => appComponent.current.setAttribute('is-crowdin-sync-settings-in-progress', false);
38198
+ onFinally = () => requireRef(appComponent).setSyncSettingsInProgress('crowdin', false);
38175
38199
  }
38176
38200
  break;
38177
38201
  case JOB_TYPE.integrationSyncSettingsSave:
38178
38202
  if (!onFinally) {
38179
- onFinally = () => appComponent.current.setAttribute('is-integration-sync-settings-in-progress', false);
38203
+ onFinally = () => requireRef(appComponent).setSyncSettingsInProgress('integration', false);
38180
38204
  }
38181
38205
  break;
38182
38206
  }
@@ -38255,7 +38279,7 @@ Defaulting to \`null\`.`;
38255
38279
  showToast(`Select files which will be uploaded to ${name}`);
38256
38280
  return;
38257
38281
  }
38258
- appComponent.current.setAttribute('is-to-integration-process', true);
38282
+ requireRef(appComponent).setProcess({ toIntegration: true });
38259
38283
  const req = {};
38260
38284
  Object.keys(files)
38261
38285
  .filter((id) => { var _a; return ((_a = crowdinData.current.find((c) => c.id === id)) === null || _a === void 0 ? void 0 : _a.node_type) === FILE_TYPE; })
@@ -38278,7 +38302,7 @@ Defaulting to \`null\`.`;
38278
38302
  showToast('Select files to sync');
38279
38303
  return;
38280
38304
  }
38281
- appComponent.current.setAttribute('is-to-crowdin-process', true);
38305
+ requireRef(appComponent).setProcess({ toCrowdin: true });
38282
38306
  const req = {};
38283
38307
  Object.keys(files)
38284
38308
  .filter((id) => { var _a; return ((_a = crowdinData.current.find((c) => c.id === id)) === null || _a === void 0 ? void 0 : _a.node_type) === FILE_TYPE; })
@@ -38301,7 +38325,7 @@ Defaulting to \`null\`.`;
38301
38325
  showToast('Select files to sync');
38302
38326
  return;
38303
38327
  }
38304
- appComponent.current.setAttribute('is-to-integration-process', true);
38328
+ requireRef(appComponent).setProcess({ toIntegration: true });
38305
38329
  const req = files
38306
38330
  .filter((f) => f.node_type !== FOLDER_TYPE)
38307
38331
  .map((f) => ({ name: f.name, id: f.id, type: f.type, parentId: f.parent_id }));
@@ -38319,6 +38343,7 @@ Defaulting to \`null\`.`;
38319
38343
  }
38320
38344
  }
38321
38345
  function openLanguageModal() {
38346
+ var _a;
38322
38347
  setLanguageModalState((state) => {
38323
38348
  var _a, _b;
38324
38349
  return ({
@@ -38326,9 +38351,10 @@ Defaulting to \`null\`.`;
38326
38351
  action: 'syncToCrowdin',
38327
38352
  });
38328
38353
  });
38329
- openModal(languageModal.current);
38354
+ (_a = languageModal.current) === null || _a === void 0 ? void 0 : _a.open();
38330
38355
  }
38331
38356
  function openLanguageModalForCrowdinFiles() {
38357
+ var _a;
38332
38358
  setLanguageModalState((state) => {
38333
38359
  var _a, _b;
38334
38360
  return ({
@@ -38336,22 +38362,24 @@ Defaulting to \`null\`.`;
38336
38362
  action: 'updateCrowdinTargetLanguages',
38337
38363
  });
38338
38364
  });
38339
- openModal(languageModal.current);
38365
+ (_a = languageModal.current) === null || _a === void 0 ? void 0 : _a.open();
38340
38366
  }
38341
38367
  async function uploadFilesToCrowdinWithExcludedLanguages() {
38368
+ var _a;
38342
38369
  const selectedLanguages = await languageSelectRef.current.getValue();
38343
- closeModal(languageModal.current);
38370
+ (_a = languageModal.current) === null || _a === void 0 ? void 0 : _a.close();
38344
38371
  uploadFilesToCrowdin({ detail: fileToSync.current }, selectedLanguages);
38345
38372
  }
38346
38373
  async function updateCrowdinFilesTargetLanguages() {
38374
+ var _a;
38347
38375
  const selectedLanguages = await languageSelectRef.current.getValue();
38348
- closeModal(languageModal.current);
38376
+ (_a = languageModal.current) === null || _a === void 0 ? void 0 : _a.close();
38349
38377
  const fileIds = Object.keys(crowdinFilesToUpdateTargetLanguages.current).map((id) => parseInt(id, 10));
38350
38378
  if (fileIds.length === 0) {
38351
38379
  showToast('Select files to update');
38352
38380
  return;
38353
38381
  }
38354
- appComponent.current.setAttribute('is-to-crowdin-process', true);
38382
+ requireRef(appComponent).setProcess({ toCrowdin: true });
38355
38383
  try {
38356
38384
  const restParams = await checkOrigin();
38357
38385
  const res = await checkResponse(await fetch(`api/crowdin/files-target-languages${restParams}`, {
@@ -38419,6 +38447,9 @@ Defaulting to \`null\`.`;
38419
38447
  function Dialog({ ...props }) {
38420
38448
  return jsxRuntimeExports.jsx(Dialog$1, { "data-slot": "dialog", ...props });
38421
38449
  }
38450
+ function DialogTrigger({ ...props }) {
38451
+ return jsxRuntimeExports.jsx(DialogTrigger$1, { "data-slot": "dialog-trigger", ...props });
38452
+ }
38422
38453
  function DialogPortal({ ...props }) {
38423
38454
  return jsxRuntimeExports.jsx(DialogPortal$1, { "data-slot": "dialog-portal", ...props });
38424
38455
  }
@@ -49134,7 +49165,7 @@ Defaulting to \`null\`.`;
49134
49165
  return reactExports.useRef(null);
49135
49166
  }
49136
49167
 
49137
- const AppDialog = reactExports.forwardRef(({ id, title, width = '70', showCloseButton = true, children, footer, className, onClose }, ref) => {
49168
+ const AppDialog = reactExports.forwardRef(({ id, title, description, width = '70', showCloseButton = true, children, footer, className, onClose }, ref) => {
49138
49169
  const [isOpen, setIsOpen] = reactExports.useState(false);
49139
49170
  const [portalContainer, setPortalContainer] = reactExports.useState(null);
49140
49171
  const contentRef = reactExports.useRef(null);
@@ -49158,7 +49189,7 @@ Defaulting to \`null\`.`;
49158
49189
  var _a;
49159
49190
  event.preventDefault();
49160
49191
  (_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.focus();
49161
- }, className: cn('max-h-[calc(100dvh-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] overflow-visible', widthClassName, className), children: jsxRuntimeExports.jsxs(ComboboxPortalContainerProvider, { container: portalContainer, children: [jsxRuntimeExports.jsxs(DialogHeader, { className: "shrink-0", children: [jsxRuntimeExports.jsx(DialogTitle, { children: title || 'Details' }), jsxRuntimeExports.jsx(DialogDescription, { className: "sr-only", children: typeof title === 'string' ? `${title} dialog` : 'Dialog details' })] }), jsxRuntimeExports.jsx(ScrollArea, { type: "auto", className: "-mr-6 -ml-1 h-full min-h-0 min-w-0", children: jsxRuntimeExports.jsx("div", { className: "min-w-0 overflow-x-hidden py-1 pr-6 pl-1", children: children }) }), footer && (jsxRuntimeExports.jsx(DialogFooter, { className: "mx-0 mb-0 shrink-0 rounded-none border-t-0 bg-transparent p-0", children: footer })), jsxRuntimeExports.jsx("div", { ref: setPortalContainer, className: "contents" })] }) }) }));
49192
+ }, className: cn('max-h-[calc(100dvh-2rem)] grid-rows-[auto_minmax(0,1fr)_auto] overflow-visible', widthClassName, className), children: jsxRuntimeExports.jsxs(ComboboxPortalContainerProvider, { container: portalContainer, children: [jsxRuntimeExports.jsxs(DialogHeader, { className: "shrink-0", children: [jsxRuntimeExports.jsx(DialogTitle, { children: title || 'Details' }), jsxRuntimeExports.jsx(DialogDescription, { className: cn(!description && 'sr-only'), children: description !== null && description !== void 0 ? description : (typeof title === 'string' ? `${title} dialog` : 'Dialog details') })] }), jsxRuntimeExports.jsx(ScrollArea, { type: "auto", className: "-mr-6 -ml-1 h-full min-h-0 min-w-0", children: jsxRuntimeExports.jsx("div", { className: "min-w-0 overflow-x-hidden py-1 pr-6 pl-1", children: children }) }), footer && (jsxRuntimeExports.jsx(DialogFooter, { className: "mx-0 mb-0 shrink-0 rounded-none border-t-0 bg-transparent p-0", children: footer })), jsxRuntimeExports.jsx("div", { ref: setPortalContainer, className: "contents" })] }) }) }));
49162
49193
  });
49163
49194
  AppDialog.displayName = 'AppDialog';
49164
49195
 
@@ -49265,14 +49296,14 @@ Defaulting to \`null\`.`;
49265
49296
  };
49266
49297
 
49267
49298
  const InfoModal = ({ modalRef, infoModal }) => {
49268
- return (jsxRuntimeExports.jsx(AppDialog, { ref: modalRef, id: "info-modal", width: "50", title: infoModal.title, children: jsxRuntimeExports.jsx("div", { dangerouslySetInnerHTML: { __html: infoModal.content } }) }));
49299
+ return (jsxRuntimeExports.jsx(AppDialog, { ref: modalRef, id: "info-modal", width: "50", title: infoModal.title, children: jsxRuntimeExports.jsx("div", { className: "html-content text-sm leading-relaxed", dangerouslySetInnerHTML: { __html: infoModal.content } }) }));
49269
49300
  };
49270
49301
 
49271
49302
  function Switch({ className, size = 'default', ...props }) {
49272
49303
  return (jsxRuntimeExports.jsx(Switch$1, { "data-slot": "switch", "data-size": size, className: cn('peer group/switch inline-flex shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-[1.15rem] data-[size=default]:w-8 data-[size=sm]:h-3.5 data-[size=sm]:w-6 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input dark:data-[state=unchecked]:bg-input/80', className), ...props, children: jsxRuntimeExports.jsx(SwitchThumb, { "data-slot": "switch-thumb", className: cn('pointer-events-none block rounded-full bg-background ring-0 transition-transform group-data-[size=default]/switch:size-4 group-data-[size=sm]/switch:size-3 data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0 dark:data-[state=checked]:bg-primary-foreground dark:data-[state=unchecked]:bg-foreground') }) }));
49273
49304
  }
49274
49305
 
49275
- const FieldShell = reactExports.forwardRef(({ label, helpText, helpTextHtml, htmlFor, errorText, className, children, ...props }, ref) => (jsxRuntimeExports.jsxs(Field, { ref: ref, "data-invalid": Boolean(errorText) || undefined, className: className, ...props, children: [label && jsxRuntimeExports.jsx(FieldLabel, { htmlFor: htmlFor, children: label }), children, helpText && jsxRuntimeExports.jsx(FieldDescription, { children: helpText }), helpTextHtml && jsxRuntimeExports.jsx(FieldDescription, { dangerouslySetInnerHTML: { __html: helpTextHtml } }), jsxRuntimeExports.jsx(FieldError, { errors: errorText ? [{ message: errorText }] : undefined })] })));
49306
+ const FieldShell = reactExports.forwardRef(({ label, helpText, helpTextHtml, htmlFor, errorText, className, children, ...props }, ref) => (jsxRuntimeExports.jsxs(Field, { ref: ref, "data-invalid": Boolean(errorText) || undefined, className: className, ...props, children: [label && jsxRuntimeExports.jsx(FieldLabel, { htmlFor: htmlFor, children: label }), children, helpText && jsxRuntimeExports.jsx(FieldDescription, { children: helpText }), helpTextHtml && (jsxRuntimeExports.jsx(FieldDescription, { className: "html-content [&>a]:no-underline [&>a:hover]:underline", dangerouslySetInnerHTML: { __html: helpTextHtml } })), jsxRuntimeExports.jsx(FieldError, { errors: errorText ? [{ message: errorText }] : undefined })] })));
49276
49307
  FieldShell.displayName = 'FieldShell';
49277
49308
  const FormInput = reactExports.forwardRef(({ id, label, helpText, helpTextHtml, containerClassName, errorText, withCopyButton, value, 'data-dependency': dataDependency, ...props }, ref) => (jsxRuntimeExports.jsx(FieldShell, { label: label, helpText: helpText, helpTextHtml: helpTextHtml, htmlFor: id, errorText: errorText, className: containerClassName, "data-dependency": dataDependency, children: jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [jsxRuntimeExports.jsx(Input, { ref: ref, id: id, value: value, "aria-invalid": Boolean(errorText) || undefined, ...props }), withCopyButton && (jsxRuntimeExports.jsx(Button, { type: "button", size: "icon", variant: "outline", "aria-label": `Copy ${label || 'value'}`, onClick: () => {
49278
49309
  var _a;
@@ -49414,8 +49445,10 @@ Defaulting to \`null\`.`;
49414
49445
  }
49415
49446
  return (jsxRuntimeExports.jsx("div", { className: row.isWarning ? 'mt-1 text-xs text-destructive' : 'mt-1 text-xs text-muted-foreground', children: row.description }));
49416
49447
  }
49417
- const PermissionsModal = ({ modalRef, isLoading, permissionUserOptions, selectedUsers, isConfirmVisible, permissionsSummary, hasOrganization, zenModeUrl, saveDisabled, onUsersChange, onSave, }) => {
49418
- return (jsxRuntimeExports.jsxs(AppDialog, { ref: modalRef, id: "permissions-modal", title: "Share", footer: jsxRuntimeExports.jsx(Button, { id: "confirm-users-btn", disabled: saveDisabled, onClick: onSave, children: "Save" }), children: [jsxRuntimeExports.jsx("div", { className: isLoading ? 'absolute inset-0 z-[4] flex items-center justify-center bg-background/30' : 'hidden', children: jsxRuntimeExports.jsx(Spinner, {}) }), jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsx(UsersMultiSelect, { options: permissionUserOptions, value: selectedUsers, disabled: isLoading, onValueChange: onUsersChange }), jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsx("div", { className: isConfirmVisible ? 'mt-4' : 'hidden', children: jsxRuntimeExports.jsxs(Table, { className: "min-w-[640px] table-fixed", children: [jsxRuntimeExports.jsx(TableHeader, { children: jsxRuntimeExports.jsxs(TableRow, { children: [jsxRuntimeExports.jsx(TableHead, { className: "w-[40%] px-4", children: "Access" }), jsxRuntimeExports.jsx(TableHead, { className: "w-[35%] px-4", children: "Users" }), jsxRuntimeExports.jsx(TableHead, { className: "w-[25%] px-4 text-right", children: "Upcoming changes" })] }) }), jsxRuntimeExports.jsxs(TableBody, { children: [hasOrganization && (jsxRuntimeExports.jsxs(TableRow, { children: [jsxRuntimeExports.jsxs(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: [jsxRuntimeExports.jsx("p", { className: "m-0 text-sm", children: "Registration in Organization" }), renderPermissionRowDescription(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.organization)] }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: renderPermissionUsers(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.organization) }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 text-right align-top", children: (permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.organization) &&
49448
+ const PermissionsModal = ({ modalRef, isLoading, isCheckingUsers = false, permissionUserOptions, selectedUsers, isConfirmVisible, permissionsSummary, hasOrganization, zenModeUrl, saveDisabled, onUsersChange, onSave, }) => {
49449
+ return (jsxRuntimeExports.jsxs(AppDialog, { ref: modalRef, id: "permissions-modal", title: "Share", description: "Invite people who manage content and give them access to this integration, so they can send new content for translation as soon as it's added.", footer: jsxRuntimeExports.jsx(Button, { id: "confirm-users-btn", disabled: saveDisabled, onClick: onSave, children: "Save" }), children: [jsxRuntimeExports.jsx("div", { className: isLoading || isCheckingUsers
49450
+ ? 'absolute inset-0 z-[4] flex items-center justify-center bg-background/30'
49451
+ : 'hidden', children: jsxRuntimeExports.jsx(Spinner, {}) }), jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsx(UsersMultiSelect, { options: permissionUserOptions, value: selectedUsers, disabled: isLoading, onValueChange: onUsersChange }), jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsx("div", { className: isConfirmVisible ? 'mt-4' : 'hidden', children: jsxRuntimeExports.jsxs(Table, { className: "min-w-[640px] table-fixed", children: [jsxRuntimeExports.jsx(TableHeader, { children: jsxRuntimeExports.jsxs(TableRow, { children: [jsxRuntimeExports.jsx(TableHead, { className: "w-[40%] px-4", children: "Access" }), jsxRuntimeExports.jsx(TableHead, { className: "w-[35%] px-4", children: "Users" }), jsxRuntimeExports.jsx(TableHead, { className: "w-[25%] px-4 text-right", children: "Upcoming changes" })] }) }), jsxRuntimeExports.jsxs(TableBody, { children: [hasOrganization && (jsxRuntimeExports.jsxs(TableRow, { children: [jsxRuntimeExports.jsxs(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: [jsxRuntimeExports.jsx("p", { className: "m-0 text-sm", children: "Registration in Organization" }), renderPermissionRowDescription(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.organization)] }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: renderPermissionUsers(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.organization) }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 text-right align-top", children: (permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.organization) &&
49419
49452
  renderPermissionStatus(permissionsSummary.organization.status) })] })), jsxRuntimeExports.jsxs(TableRow, { children: [jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: jsxRuntimeExports.jsx("p", { className: "m-0 text-sm", children: "Project Manager Access" }) }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: renderPermissionUsers(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.project) }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 text-right align-top", children: (permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.project) &&
49420
49453
  renderPermissionStatus(permissionsSummary.project.status) })] }), jsxRuntimeExports.jsxs(TableRow, { children: [jsxRuntimeExports.jsxs(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: [jsxRuntimeExports.jsx("p", { className: "m-0 text-sm", children: "Application Visibility Access" }), renderPermissionRowDescription(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.applicationSettings)] }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: renderPermissionUsers(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.applicationSettings) }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 text-right align-top", children: (permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.applicationSettings) &&
49421
49454
  renderPermissionStatus(permissionsSummary.applicationSettings.status) })] }), jsxRuntimeExports.jsxs(TableRow, { children: [jsxRuntimeExports.jsxs(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: [jsxRuntimeExports.jsx("p", { className: "m-0 text-sm", children: "Access to the Integration" }), jsxRuntimeExports.jsx("div", { className: "mt-1 text-xs text-muted-foreground", children: "This provides access to sync files and modify the current integration settings." })] }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 align-top", children: renderPermissionUsers(permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.applicationCredentials) }), jsxRuntimeExports.jsx(TableCell, { className: "whitespace-normal px-4 py-3 text-right align-top", children: (permissionsSummary === null || permissionsSummary === void 0 ? void 0 : permissionsSummary.applicationCredentials) &&
@@ -49429,7 +49462,7 @@ Defaulting to \`null\`.`;
49429
49462
  function renderConfigField(field, settingsFieldChange, registerSettingsField, fieldErrors, suffix = 'settings') {
49430
49463
  var _a;
49431
49464
  if (!field.key) {
49432
- return field.labelHtml ? (jsxRuntimeExports.jsx("p", { className: "m-0 text-sm leading-relaxed", ...(field.dependencySettings ? { 'data-dependency': field.dependencySettings } : {}), dangerouslySetInnerHTML: { __html: field.labelHtml } })) : (jsxRuntimeExports.jsx("p", { className: "m-0 text-sm leading-relaxed", ...(field.dependencySettings ? { 'data-dependency': field.dependencySettings } : {}), children: field.label }));
49465
+ return field.labelHtml ? (jsxRuntimeExports.jsx("div", { className: "html-content text-sm leading-relaxed", ...(field.dependencySettings ? { 'data-dependency': field.dependencySettings } : {}), dangerouslySetInnerHTML: { __html: field.labelHtml } })) : (jsxRuntimeExports.jsx("p", { className: "m-0 text-sm leading-relaxed", ...(field.dependencySettings ? { 'data-dependency': field.dependencySettings } : {}), children: field.label }));
49433
49466
  }
49434
49467
  const commonProps = {
49435
49468
  id: `${field.key}-${suffix}`,
@@ -49456,16 +49489,41 @@ Defaulting to \`null\`.`;
49456
49489
  return null;
49457
49490
  }
49458
49491
  }
49459
- const SettingsModal = ({ modalRef, isLoading, configurationFields, isSaveDisabled, settingsFieldChange, registerSettingsField, fieldErrors, onSave, }) => {
49460
- return (jsxRuntimeExports.jsxs(AppDialog, { ref: modalRef, id: "settings-modal", width: "65", title: "Settings", footer: jsxRuntimeExports.jsx(Button, { id: "settings-save-btn", disabled: isSaveDisabled, onClick: onSave, children: "Save" }), children: [jsxRuntimeExports.jsx("div", { className: isLoading ? 'absolute inset-0 z-[4] flex items-center justify-center bg-white/30' : 'hidden', children: jsxRuntimeExports.jsx(Spinner, {}) }), jsxRuntimeExports.jsx("div", { id: "modal-content", children: jsxRuntimeExports.jsxs(Tabs, { defaultValue: "tab-0", children: [jsxRuntimeExports.jsx(TabsList, { children: configurationFields.map((tab, tabIndex) => (jsxRuntimeExports.jsx(TabsTrigger, { value: `tab-${tabIndex}`, children: tab.name }, tab.name))) }), configurationFields.map((tab, tabIndex) => (
49461
- // The form is ref-driven, so an unmounted panel drops its fields from
49462
- // both fillSettingsForm and the save payload. forceMount also renders
49463
- // inactive panels *visible*, hence the explicit hiding.
49464
- jsxRuntimeExports.jsx(TabsContent, { value: `tab-${tabIndex}`, forceMount: true, className: "data-[state=inactive]:hidden", children: jsxRuntimeExports.jsx(FieldGroup, { children: tab.fields.map((field, fieldIndex) => (jsxRuntimeExports.jsx(reactExports.Fragment, { children: renderConfigField(field, settingsFieldChange, registerSettingsField, fieldErrors) }, field.key || `${tabIndex}-${fieldIndex}`))) }) }, tab.name)))] }) })] }));
49492
+ const DisconnectSection = ({ name, isOwner, owner, hasAutoSync, isDisconnecting, onDisconnect, }) => {
49493
+ const [isOpen, setIsOpen] = reactExports.useState(false);
49494
+ return (jsxRuntimeExports.jsxs("div", { id: "disconnect-section", className: "flex flex-col gap-4 rounded-lg border border-destructive/20 bg-destructive/5 p-4 sm:flex-row sm:items-center", children: [jsxRuntimeExports.jsx(TriangleAlert, { className: "hidden size-5 shrink-0 self-start text-destructive sm:block" }), jsxRuntimeExports.jsxs("div", { className: "flex min-w-0 flex-1 flex-col gap-1", children: [jsxRuntimeExports.jsx("p", { className: "m-0 text-sm font-medium text-destructive", children: "Disconnect integration" }), jsxRuntimeExports.jsx("p", { className: "m-0 text-sm text-muted-foreground", children: isOwner ? (`Disconnects ${name} and removes its saved settings for this project.${hasAutoSync ? ' Auto Sync will stop.' : ''}`) : owner ? (jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: ["Only the integration owner (", jsxRuntimeExports.jsx(Button, { type: "button", variant: "link", id: "integration-owner-link", className: "h-auto p-0 align-baseline font-normal", onClick: () => contactUser(owner.id), children: owner.name }), ") can disconnect it."] })) : ('Only the integration owner can disconnect it.') })] }), jsxRuntimeExports.jsxs(Dialog, { open: isOpen, onOpenChange: (open) => !isDisconnecting && setIsOpen(open), children: [jsxRuntimeExports.jsx(DialogTrigger, { asChild: true, children: jsxRuntimeExports.jsx(Button, { id: "disconnect-btn", variant: "destructive", disabled: !isOwner, className: "shrink-0 self-start sm:self-auto", children: "Disconnect" }) }), jsxRuntimeExports.jsxs(DialogContent, { role: "alertdialog", showCloseButton: false, className: "sm:max-w-md", children: [jsxRuntimeExports.jsxs(DialogHeader, { className: "items-center text-center sm:items-start sm:text-left", children: [jsxRuntimeExports.jsx("div", { className: "mb-2 flex size-10 items-center justify-center rounded-full bg-destructive/10", children: jsxRuntimeExports.jsx(TriangleAlert, { className: "size-5 text-destructive" }) }), jsxRuntimeExports.jsxs(DialogTitle, { children: ["Disconnect ", name, "?"] }), jsxRuntimeExports.jsxs(DialogDescription, { children: [name, " settings", hasAutoSync ? ', Auto Sync selections,' : '', " and logs for this project will be deleted. To use ", name, " again, you'll need to reconnect and set it up again."] })] }), jsxRuntimeExports.jsxs(DialogFooter, { children: [jsxRuntimeExports.jsx(Button, { variant: "outline", disabled: isDisconnecting, onClick: () => setIsOpen(false), children: "Cancel" }), jsxRuntimeExports.jsxs(Button, { id: "disconnect-confirm-btn", variant: "destructive", disabled: isDisconnecting, onClick: onDisconnect, children: [isDisconnecting && jsxRuntimeExports.jsx(Spinner, {}), "Disconnect"] })] })] })] })] }));
49495
+ };
49496
+ const SettingsModal = ({ modalRef, isLoading, configurationFields, isSaveDisabled, settingsFieldChange, registerSettingsField, fieldErrors, onSave, name, isOwner, owner, hasAutoSync, isDisconnecting, onDisconnect, }) => {
49497
+ const hasFields = configurationFields.length > 0;
49498
+ const disconnectSection = (jsxRuntimeExports.jsx(DisconnectSection, { name: name, isOwner: isOwner, owner: owner, hasAutoSync: hasAutoSync, isDisconnecting: isDisconnecting, onDisconnect: onDisconnect }));
49499
+ const contentRef = reactExports.useRef(null);
49500
+ const observerRef = reactExports.useRef(null);
49501
+ const [contentHeight, setContentHeight] = reactExports.useState();
49502
+ // Animate height on tab switch
49503
+ const measureRef = reactExports.useCallback((node) => {
49504
+ var _a;
49505
+ contentRef.current = node;
49506
+ (_a = observerRef.current) === null || _a === void 0 ? void 0 : _a.disconnect();
49507
+ setContentHeight(undefined);
49508
+ if (!node || typeof ResizeObserver === 'undefined') {
49509
+ return;
49510
+ }
49511
+ observerRef.current = new ResizeObserver(() => setContentHeight(node.offsetHeight));
49512
+ observerRef.current.observe(node);
49513
+ }, []);
49514
+ return (jsxRuntimeExports.jsxs(AppDialog, { ref: modalRef, id: "settings-modal", width: "65", title: "Settings", className: "top-[5dvh] max-h-[90dvh] translate-y-0", footer: hasFields && (jsxRuntimeExports.jsx(Button, { id: "settings-save-btn", disabled: isSaveDisabled, onClick: onSave, children: "Save" })), children: [jsxRuntimeExports.jsx("div", { className: isLoading ? 'absolute inset-0 z-[4] flex items-center justify-center bg-white/30' : 'hidden', children: jsxRuntimeExports.jsx(Spinner, {}) }), jsxRuntimeExports.jsx("div", { className: "-m-1 overflow-hidden transition-[height] duration-200 ease-out motion-reduce:transition-none", style: contentHeight === undefined ? undefined : { height: contentHeight }, children: jsxRuntimeExports.jsxs("div", { id: "modal-content", ref: measureRef, className: "p-1", children: [!hasFields && disconnectSection, jsxRuntimeExports.jsxs(Tabs, { className: hasFields ? undefined : 'hidden', defaultValue: "tab-0", onValueChange: () => {
49515
+ var _a;
49516
+ const viewport = (_a = contentRef.current) === null || _a === void 0 ? void 0 : _a.closest('[data-radix-scroll-area-viewport]');
49517
+ if (viewport) {
49518
+ viewport.scrollTop = 0;
49519
+ }
49520
+ }, children: [jsxRuntimeExports.jsx(TabsList, { children: configurationFields.map((tab, tabIndex) => (jsxRuntimeExports.jsx(TabsTrigger, { value: `tab-${tabIndex}`, children: tab.name }, tab.name))) }), configurationFields.map((tab, tabIndex) => (
49521
+ // forceMount: fields are ref-driven
49522
+ jsxRuntimeExports.jsxs(TabsContent, { value: `tab-${tabIndex}`, forceMount: true, className: "data-[state=inactive]:hidden", children: [jsxRuntimeExports.jsx(FieldGroup, { children: tab.fields.map((field, fieldIndex) => (jsxRuntimeExports.jsx(reactExports.Fragment, { children: renderConfigField(field, settingsFieldChange, registerSettingsField, fieldErrors) }, field.key || `${tabIndex}-${fieldIndex}`))) }), tabIndex === 0 && jsxRuntimeExports.jsx("div", { className: "mt-8", children: disconnectSection })] }, tab.name)))] })] }) })] }));
49465
49523
  };
49466
49524
 
49467
- const SubscriptionModal = ({ modalRef, subscriptionLink, name, onLogout }) => {
49468
- return (jsxRuntimeExports.jsx(AppDialog, { ref: modalRef, id: "subscription-modal", width: "50", showCloseButton: false, footer: jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Button, { variant: "default", onClick: () => { var _a; return window.open((_a = subscriptionLink.current) !== null && _a !== void 0 ? _a : '', '_blank', 'noopener,noreferrer'); }, children: "Subscribe" }), jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: () => window.open('https://crowdin.com/contacts', '_blank', 'noopener,noreferrer'), children: "Contact us" }), jsxRuntimeExports.jsx(Button, { variant: "secondary", onClick: onLogout, children: "Log out" })] }), children: jsxRuntimeExports.jsxs(AppAlert, { variant: "warning", children: ["Subscribe to continue using the ", name, " app."] }) }));
49525
+ const SubscriptionModal = ({ modalRef, subscriptionLink, name, isDisconnecting, onLogout, }) => {
49526
+ return (jsxRuntimeExports.jsx(AppDialog, { ref: modalRef, id: "subscription-modal", width: "50", showCloseButton: false, footer: jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [jsxRuntimeExports.jsx(Button, { variant: "default", onClick: () => { var _a; return window.open((_a = subscriptionLink.current) !== null && _a !== void 0 ? _a : '', '_blank', 'noopener,noreferrer'); }, children: "Subscribe" }), jsxRuntimeExports.jsx(Button, { variant: "outline", onClick: () => window.open('https://crowdin.com/contacts', '_blank', 'noopener,noreferrer'), children: "Contact us" }), jsxRuntimeExports.jsxs(Button, { variant: "secondary", disabled: isDisconnecting, onClick: onLogout, children: [isDisconnecting && jsxRuntimeExports.jsx(Spinner, {}), "Disconnect"] })] }), children: jsxRuntimeExports.jsxs(AppAlert, { variant: "warning", children: ["Subscribe to continue using the ", name, " app."] }) }));
49469
49527
  };
49470
49528
 
49471
49529
  function isJSON(string) {
@@ -49533,7 +49591,7 @@ Defaulting to \`null\`.`;
49533
49591
  const USER_ERRORS_PER_PAGE = 10;
49534
49592
  const USER_ERRORS_SEARCH_DEBOUNCE = 300;
49535
49593
  const MainPage = (props) => {
49536
- const { name, userId, notice, checkSubscription, isManager, isOwner, infoModal, configurationFields, config: configString, syncNewElements, withCronSync, webhooks, integrationOneLevelFetching, integrationSearchListener, excludedTargetLanguages, filtering, hasOrganization, zenModeUrl, asyncProgress = { checkInterval: 3000 }, reloadOnConfigSave, progressiveCrowdinFilesLoading, integrationButtonMenuItems, crowdinButtonMenuItems, } = props;
49594
+ const { name, userId, notice, checkSubscription, isManager, isOwner, owner, infoModal, configurationFields, config: configString, syncNewElements, withCronSync, webhooks, integrationOneLevelFetching, integrationSearchListener, excludedTargetLanguages, filtering, hasOrganization, zenModeUrl, asyncProgress = { checkInterval: 3000 }, reloadOnConfigSave, progressiveCrowdinFilesLoading, integrationButtonMenuItems, crowdinButtonMenuItems, } = props;
49537
49595
  const config = reactExports.useRef(configString ? JSON.parse(configString.replace(/\\n/g, '\\\\n')) : {});
49538
49596
  const appComponent = reactExports.useRef(null);
49539
49597
  const asyncProgressRef = reactExports.useRef(null);
@@ -49549,6 +49607,7 @@ Defaulting to \`null\`.`;
49549
49607
  const subscriptionLink = reactExports.useRef('');
49550
49608
  const refreshDependencies = useFieldDependencies(configurationFields);
49551
49609
  const [isNoticeVisible, setIsNoticeVisible] = reactExports.useState(false);
49610
+ const [isDisconnecting, setIsDisconnecting] = reactExports.useState(false);
49552
49611
  const [subscriptionInfo, setSubscriptionInfo] = reactExports.useState(null);
49553
49612
  const [isErrorLogsVisible, setIsErrorLogsVisible] = reactExports.useState(false);
49554
49613
  const [userErrors, setUserErrors] = reactExports.useState([]);
@@ -49599,14 +49658,12 @@ Defaulting to \`null\`.`;
49599
49658
  });
49600
49659
  reactExports.useEffect(() => {
49601
49660
  const handleKeydown = (event) => {
49661
+ var _a, _b, _c, _d;
49602
49662
  if (event.keyCode === 27) {
49603
- closeModal(permissionsModalRef.current);
49604
- closeModal(infoModalRef.current);
49605
- closeModal(settingsModalRef.current);
49606
- closeModal(scheduleModalRef.current);
49607
- if (syncOps.languageModalRef.current) {
49608
- closeModal(syncOps.languageModalRef.current);
49609
- }
49663
+ (_a = permissionsModalRef.current) === null || _a === void 0 ? void 0 : _a.close();
49664
+ (_b = infoModalRef.current) === null || _b === void 0 ? void 0 : _b.close();
49665
+ (_c = scheduleModalRef.current) === null || _c === void 0 ? void 0 : _c.close();
49666
+ (_d = syncOps.languageModalRef.current) === null || _d === void 0 ? void 0 : _d.close();
49610
49667
  }
49611
49668
  };
49612
49669
  document.body.addEventListener('keydown', handleKeydown);
@@ -49620,10 +49677,11 @@ Defaulting to \`null\`.`;
49620
49677
  // A 402 from any API call means the subscription lapsed: show the subscribe modal.
49621
49678
  reactExports.useEffect(() => {
49622
49679
  setPaymentRequiredHandler((subscribeLink) => {
49680
+ var _a;
49623
49681
  if (subscribeLink) {
49624
49682
  subscriptionLink.current = subscribeLink;
49625
49683
  }
49626
- openModal(subscriptionModal.current);
49684
+ (_a = subscriptionModal.current) === null || _a === void 0 ? void 0 : _a.open();
49627
49685
  });
49628
49686
  return () => setPaymentRequiredHandler(null);
49629
49687
  }, []);
@@ -49642,6 +49700,8 @@ Defaulting to \`null\`.`;
49642
49700
  }
49643
49701
  }
49644
49702
  async function integrationLogout() {
49703
+ // not reset on success: the page reloads
49704
+ setIsDisconnecting(true);
49645
49705
  try {
49646
49706
  const queryParams = await checkOrigin();
49647
49707
  await checkResponse(await fetch(`api/logout${queryParams}`, { method: 'POST' }));
@@ -49649,7 +49709,8 @@ Defaulting to \`null\`.`;
49649
49709
  localStorage.removeItem(`revised_${name}`);
49650
49710
  }
49651
49711
  catch (e) {
49652
- catchRejection(e, e.error || 'Looks like you are not logged in');
49712
+ setIsDisconnecting(false);
49713
+ catchRejection(e, e.error || "Can't disconnect the integration");
49653
49714
  }
49654
49715
  }
49655
49716
  function closeAlert(suffix) {
@@ -49678,7 +49739,7 @@ Defaulting to \`null\`.`;
49678
49739
  }
49679
49740
  catch (e) {
49680
49741
  if (requestId === userErrorsRequestId.current) {
49681
- catchRejection(e, "Can't fetch error logs");
49742
+ catchRejection(e, "Can't fetch logs");
49682
49743
  }
49683
49744
  }
49684
49745
  finally {
@@ -49712,10 +49773,11 @@ Defaulting to \`null\`.`;
49712
49773
  loadUserErrors({ currentPage, rowsPerPage, searchText, isSortedAsc });
49713
49774
  }
49714
49775
  async function openUserErrorDetail(item) {
49776
+ var _a, _b;
49715
49777
  // the list response carries no `data` - the heavy payload is loaded for this record only
49716
49778
  const requestId = ++userErrorDetailRequestId.current;
49717
49779
  setSelectedUserError({ ...item, data: null });
49718
- openModal(userErrorDetailModalRef.current);
49780
+ (_a = userErrorDetailModalRef.current) === null || _a === void 0 ? void 0 : _a.open();
49719
49781
  try {
49720
49782
  const restParams = await checkOrigin();
49721
49783
  const res = await checkResponse(await fetch(`api/user-errors/${item.id}` + restParams));
@@ -49727,7 +49789,7 @@ Defaulting to \`null\`.`;
49727
49789
  return;
49728
49790
  }
49729
49791
  catchRejection(e, "Can't fetch error log details");
49730
- closeModal(userErrorDetailModalRef.current);
49792
+ (_b = userErrorDetailModalRef.current) === null || _b === void 0 ? void 0 : _b.close();
49731
49793
  setSelectedUserError(null);
49732
49794
  }
49733
49795
  }
@@ -49744,10 +49806,11 @@ Defaulting to \`null\`.`;
49744
49806
  function showIntegration() {
49745
49807
  setIsErrorLogsVisible(false);
49746
49808
  }
49747
- return (jsxRuntimeExports.jsxs("div", { children: [jsxRuntimeExports.jsxs("div", { className: "mx-auto max-w-[1420px] px-6 py-4", children: [jsxRuntimeExports.jsx(TopBar, { notice: notice, isNoticeVisible: isNoticeVisible, checkSubscription: checkSubscription, subscriptionInfo: subscriptionInfo, isErrorLogsVisible: isErrorLogsVisible, isManager: isManager, infoModal: infoModal, hasSettings: !!configurationFields, isOwner: isOwner, onCloseNotice: closeAlert, onShowIntegration: showIntegration, onShowErrorLogs: showErrorLogs, onShowPermissions: permissions.showPermissionsDialog, onOpenInfoModal: () => openModal(infoModalRef.current), onOpenSettings: () => {
49748
- openModal(settingsModalRef.current);
49809
+ return (jsxRuntimeExports.jsxs("div", { className: cn('flex flex-col', isErrorLogsVisible ? 'min-h-full' : 'h-full'), children: [jsxRuntimeExports.jsxs("div", { className: "mx-auto flex min-h-0 w-full max-w-[1420px] flex-1 flex-col px-6 py-4", children: [jsxRuntimeExports.jsx(TopBar, { notice: notice, isNoticeVisible: isNoticeVisible, checkSubscription: checkSubscription, subscriptionInfo: subscriptionInfo, isErrorLogsVisible: isErrorLogsVisible, isManager: isManager, infoModal: infoModal, onCloseNotice: closeAlert, onShowIntegration: showIntegration, onShowErrorLogs: showErrorLogs, onShowPermissions: permissions.showPermissionsDialog, onOpenInfoModal: () => { var _a; return (_a = infoModalRef.current) === null || _a === void 0 ? void 0 : _a.open(); }, onOpenSettings: () => {
49810
+ var _a;
49811
+ (_a = settingsModalRef.current) === null || _a === void 0 ? void 0 : _a.open();
49749
49812
  setTimeout(settings.fillSettingsForm, 0);
49750
- }, onLogout: integrationLogout }), jsxRuntimeExports.jsx(IntegrationView, { appComponentRef: appComponent, userErrors: userErrors, isUserErrorsLoading: isUserErrorsLoading, userErrorsTotal: userErrorsTotal, userErrorsCurrentPage: userErrorsCurrentPage, userErrorsRowsPerPage: userErrorsRowsPerPage, userErrorsSearchText: userErrorsSearchText, userErrorsIsSortedAsc: userErrorsIsSortedAsc, onSelectUserError: openUserErrorDetail, onUserErrorsOptionsChange: onUserErrorsOptionsChange, name: name, isErrorLogsVisible: isErrorLogsVisible, syncNewElements: syncNewElements, withCronSync: withCronSync, webhooks: webhooks, integrationOneLevelFetching: integrationOneLevelFetching, integrationSearchListener: integrationSearchListener, filtering: filtering, integrationButtonMenuItems: integrationButtonMenuItems, crowdinButtonMenuItems: crowdinButtonMenuItems, onRefreshFilesList: syncOps.handleRefreshFilesList, onFolderToggle: syncOps.handleFolderToggle, onUploadFilesToCrowdin: (detail) => syncOps.uploadFilesToCrowdin({ detail }), onUploadFilesToIntegration: (detail) => syncOps.uploadFilesToIntegration({ detail }), onLoadMore: syncOps.handleLoadMore, onIntegrationFilterChange: syncOps.handleIntegrationFilterChange, onIntegrationScheduleSync: (detail) => schedule.setIntegrationScheduleSync({ detail }), onCrowdinScheduleSync: (detail) => schedule.setCrowdinScheduleSync({ detail }), onIntegrationDisableSync: (detail) => schedule.disableIntegrationSync({ detail }), onCrowdinDisableSync: (detail) => schedule.disableCrowdinSync({ detail }) })] }), jsxRuntimeExports.jsx(Toaster, {}), jsxRuntimeExports.jsx(AsyncProgress, { ref: asyncProgressRef, onCancelJob: syncOps.cancelJob }), jsxRuntimeExports.jsx(SubscriptionModal, { modalRef: subscriptionModal, subscriptionLink: subscriptionLink, name: name, onLogout: integrationLogout }), jsxRuntimeExports.jsx(PermissionsModal, { modalRef: permissionsModalRef, isLoading: permissions.isLoading, permissionUserOptions: permissions.permissionUserOptions, selectedUsers: permissions.permissionsSelectedUsers, isConfirmVisible: permissions.isPermissionsConfirmVisible, permissionsSummary: permissions.permissionsSummary, hasOrganization: hasOrganization, zenModeUrl: zenModeUrl, saveDisabled: !permissions.isPermissionsLoaded, onUsersChange: permissions.checkUsers, onSave: permissions.inviteUsers }), excludedTargetLanguages && (jsxRuntimeExports.jsx(ExcludedLanguagesModal, { modalRef: syncOps.languageModalRef, languageSelectRef: syncOps.languageSelectRef, languageModalState: syncOps.languageModalState, onUpdateTargetLanguages: syncOps.updateCrowdinFilesTargetLanguages, onSyncToCrowdin: syncOps.uploadFilesToCrowdinWithExcludedLanguages })), infoModal && jsxRuntimeExports.jsx(InfoModal, { modalRef: infoModalRef, infoModal: infoModal }), configurationFields && (jsxRuntimeExports.jsx(SettingsModal, { modalRef: settingsModalRef, isLoading: settings.isLoading, configurationFields: configurationFields, isSaveDisabled: settings.isSettingsSaveDisabled, settingsFieldChange: settings.settingsFieldChange, registerSettingsField: settings.registerSettingsField, fieldErrors: settings.fieldErrors, onSave: settings.saveSettings })), ((syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.crowdin) || (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.integration)) && (jsxRuntimeExports.jsx(ScheduleModal, { modalRef: scheduleModalRef, selectedFilesCheckboxRef: schedule.selectedFilesCheckboxRef, allFolderFilesCheckboxRef: schedule.allFolderFilesCheckboxRef, newFilesCheckboxRef: schedule.newFilesCheckboxRef, scheduleModalState: schedule.scheduleModalState, isSaveDisabled: schedule.isScheduleSaveDisabled, onChangeOptions: schedule.onChangeAutoSynchronizationOptions, onSave: schedule.saveScheduleSync })), jsxRuntimeExports.jsx(UserErrorDetailModal, { modalRef: userErrorDetailModalRef, selectedUserError: selectedUserError, onClose: onUserErrorDetailClose })] }));
49813
+ } }), jsxRuntimeExports.jsx(IntegrationView, { appComponentRef: appComponent, userErrors: userErrors, isUserErrorsLoading: isUserErrorsLoading, userErrorsTotal: userErrorsTotal, userErrorsCurrentPage: userErrorsCurrentPage, userErrorsRowsPerPage: userErrorsRowsPerPage, userErrorsSearchText: userErrorsSearchText, userErrorsIsSortedAsc: userErrorsIsSortedAsc, onSelectUserError: openUserErrorDetail, onUserErrorsOptionsChange: onUserErrorsOptionsChange, name: name, isErrorLogsVisible: isErrorLogsVisible, syncNewElements: syncNewElements, withCronSync: withCronSync, webhooks: webhooks, integrationOneLevelFetching: integrationOneLevelFetching, integrationSearchListener: integrationSearchListener, filtering: filtering, integrationButtonMenuItems: integrationButtonMenuItems, crowdinButtonMenuItems: crowdinButtonMenuItems, onRefreshFilesList: syncOps.handleRefreshFilesList, onFolderToggle: syncOps.handleFolderToggle, onUploadFilesToCrowdin: (detail) => syncOps.uploadFilesToCrowdin({ detail }), onUploadFilesToIntegration: (detail) => syncOps.uploadFilesToIntegration({ detail }), onLoadMore: syncOps.handleLoadMore, onIntegrationFilterChange: syncOps.handleIntegrationFilterChange, onIntegrationScheduleSync: (detail) => schedule.setIntegrationScheduleSync({ detail }), onCrowdinScheduleSync: (detail) => schedule.setCrowdinScheduleSync({ detail }), onIntegrationDisableSync: (detail) => schedule.disableIntegrationSync({ detail }), onCrowdinDisableSync: (detail) => schedule.disableCrowdinSync({ detail }) })] }), jsxRuntimeExports.jsx(Toaster, {}), jsxRuntimeExports.jsx(AsyncProgress, { ref: asyncProgressRef, onCancelJob: syncOps.cancelJob }), jsxRuntimeExports.jsx(SubscriptionModal, { modalRef: subscriptionModal, subscriptionLink: subscriptionLink, name: name, isDisconnecting: isDisconnecting, onLogout: integrationLogout }), jsxRuntimeExports.jsx(PermissionsModal, { modalRef: permissionsModalRef, isLoading: permissions.isLoading, isCheckingUsers: permissions.isCheckingUsers, permissionUserOptions: permissions.permissionUserOptions, selectedUsers: permissions.permissionsSelectedUsers, isConfirmVisible: permissions.isPermissionsConfirmVisible, permissionsSummary: permissions.permissionsSummary, hasOrganization: hasOrganization, zenModeUrl: zenModeUrl, saveDisabled: !permissions.isPermissionsLoaded, onUsersChange: permissions.checkUsers, onSave: permissions.inviteUsers }), excludedTargetLanguages && (jsxRuntimeExports.jsx(ExcludedLanguagesModal, { modalRef: syncOps.languageModalRef, languageSelectRef: syncOps.languageSelectRef, languageModalState: syncOps.languageModalState, onUpdateTargetLanguages: syncOps.updateCrowdinFilesTargetLanguages, onSyncToCrowdin: syncOps.uploadFilesToCrowdinWithExcludedLanguages })), infoModal && jsxRuntimeExports.jsx(InfoModal, { modalRef: infoModalRef, infoModal: infoModal }), jsxRuntimeExports.jsx(SettingsModal, { modalRef: settingsModalRef, isLoading: settings.isLoading, configurationFields: configurationFields !== null && configurationFields !== void 0 ? configurationFields : [], isSaveDisabled: settings.isSettingsSaveDisabled, settingsFieldChange: settings.settingsFieldChange, registerSettingsField: settings.registerSettingsField, fieldErrors: settings.fieldErrors, onSave: settings.saveSettings, name: name, isOwner: isOwner, owner: owner, hasAutoSync: !!(withCronSync || webhooks), isDisconnecting: isDisconnecting, onDisconnect: integrationLogout }), ((syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.crowdin) || (syncNewElements === null || syncNewElements === void 0 ? void 0 : syncNewElements.integration)) && (jsxRuntimeExports.jsx(ScheduleModal, { modalRef: scheduleModalRef, selectedFilesCheckboxRef: schedule.selectedFilesCheckboxRef, allFolderFilesCheckboxRef: schedule.allFolderFilesCheckboxRef, newFilesCheckboxRef: schedule.newFilesCheckboxRef, scheduleModalState: schedule.scheduleModalState, isSaveDisabled: schedule.isScheduleSaveDisabled, onChangeOptions: schedule.onChangeAutoSynchronizationOptions, onSave: schedule.saveScheduleSync })), jsxRuntimeExports.jsx(UserErrorDetailModal, { modalRef: userErrorDetailModalRef, selectedUserError: selectedUserError, onClose: onUserErrorDetailClose })] }));
49751
49814
  };
49752
49815
 
49753
49816
  initializeCrowdinIframeContext();