@geowiki/ui 0.15.1-dev.0 → 0.16.0-dev.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.
package/dist/index.mjs CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  __require,
6
6
  __spreadProps,
7
7
  __spreadValues
8
- } from "./chunk-5PBHZKXW.mjs";
8
+ } from "./chunk-J22S7K3T.mjs";
9
9
 
10
10
  // src/components/ui/alert-dialog.tsx
11
11
  import * as React2 from "react";
@@ -119,16 +119,19 @@ var getPages = (totalPages, currentPage) => {
119
119
  const hasRightSpill = totalPages - endPage > 1;
120
120
  const spillOffset = totalNumbers - (pages.length + 3);
121
121
  switch (true) {
122
+ // handle: (1) ... {6} [7] (8)
122
123
  case (hasLeftSpill && !hasRightSpill): {
123
124
  const extraPages = range(startPage - spillOffset, startPage - 1);
124
125
  pages = ["SPACER", ...extraPages, ...pages];
125
126
  break;
126
127
  }
128
+ // handle: (1) {2} [3] {4} ... (8)
127
129
  case (!hasLeftSpill && hasRightSpill): {
128
130
  const extraPages = range(endPage + 1, endPage + spillOffset);
129
131
  pages = [...pages, ...extraPages, "SPACER"];
130
132
  break;
131
133
  }
134
+ // handle: (1) ... {3} [4] {5} ... (8)
132
135
  case (hasLeftSpill && hasRightSpill):
133
136
  default: {
134
137
  pages = ["SPACER", ...pages, "SPACER"];
@@ -186,8 +189,7 @@ function parseTitle(title, type) {
186
189
  return parsedTitle.join("");
187
190
  }
188
191
  var isAdmin = (token) => {
189
- if (!token)
190
- return false;
192
+ if (!token) return false;
191
193
  try {
192
194
  const decodedToken = jwtDecode(token);
193
195
  return decodedToken.role.includes(USER_ROLE.ADMIN) || decodedToken.role.includes(USER_ROLE.FARMER_CLUSTER_ADMIN);
@@ -2248,8 +2250,7 @@ function toast(_a) {
2248
2250
  id,
2249
2251
  open: true,
2250
2252
  onOpenChange: (open) => {
2251
- if (!open)
2252
- dismiss();
2253
+ if (!open) dismiss();
2253
2254
  }
2254
2255
  })
2255
2256
  });
@@ -2398,8 +2399,7 @@ var NextImage = ({
2398
2399
  import classNames from "classnames";
2399
2400
  import { jsx as jsx36 } from "react/jsx-runtime";
2400
2401
  var HtmlLinkList = ({ links }) => {
2401
- if (!links)
2402
- return null;
2402
+ if (!links) return null;
2403
2403
  return /* @__PURE__ */ jsx36("div", { children: links == null ? void 0 : links.map((link) => {
2404
2404
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
2405
2405
  return /* @__PURE__ */ jsx36(
@@ -2421,7 +2421,7 @@ var HtmlLinkList = ({ links }) => {
2421
2421
  var HtmlLinkList_default = HtmlLinkList;
2422
2422
 
2423
2423
  // src/components/ui/footer.tsx
2424
- import { signIn } from "next-auth/react";
2424
+ import { signIn } from "@geowiki/core";
2425
2425
  import { jsx as jsx37, jsxs as jsxs13 } from "react/jsx-runtime";
2426
2426
  var Footer = ({ settings, sessionStatus }) => {
2427
2427
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
@@ -2448,13 +2448,7 @@ var Footer = ({ settings, sessionStatus }) => {
2448
2448
  Button,
2449
2449
  {
2450
2450
  className: "mr-2 link",
2451
- onClick: () => {
2452
- var _a2, _b2;
2453
- return signIn("openiddict", {
2454
- callbackUrl: ((_b2 = (_a2 = settings == null ? void 0 : settings.generalSettings.GeoWikiSettings) == null ? void 0 : _a2.Host) == null ? void 0 : _b2.Text) + "/api/auth/callback/openiddict",
2455
- redirect: false
2456
- });
2457
- },
2451
+ onClick: () => signIn(),
2458
2452
  children: "Facilitator Login"
2459
2453
  }
2460
2454
  ) : null : null
@@ -2570,12 +2564,10 @@ FormMessage.displayName = "FormMessage";
2570
2564
  import { useState as useState2 } from "react";
2571
2565
  import { Dialog as Dialog2 } from "@headlessui/react";
2572
2566
  import { Bars3Icon, XMarkIcon } from "@heroicons/react/24/outline";
2573
- import { signIn as signIn2, useSession } from "next-auth/react";
2574
- import { useRouter } from "next/router";
2567
+ import { signIn as signIn2, signOut, useSession } from "@geowiki/core";
2575
2568
  import { jsx as jsx39, jsxs as jsxs14 } from "react/jsx-runtime";
2576
2569
  var TopNavbar = ({ branding, mainMenu }) => {
2577
2570
  var session = useSession();
2578
- var router = useRouter();
2579
2571
  const [mobileMenuOpen, setMobileMenuOpen] = useState2(false);
2580
2572
  return /* @__PURE__ */ jsxs14("header", { className: "bg-white", children: [
2581
2573
  /* @__PURE__ */ jsxs14(
@@ -2614,7 +2606,7 @@ var TopNavbar = ({ branding, mainMenu }) => {
2614
2606
  Button,
2615
2607
  {
2616
2608
  className: "text-sm font-semibold leading-6",
2617
- onClick: () => signIn2("openiddict"),
2609
+ onClick: () => signIn2(),
2618
2610
  children: [
2619
2611
  "Login ",
2620
2612
  /* @__PURE__ */ jsx39("span", { "aria-hidden": "true", children: " \u2192" })
@@ -2625,7 +2617,7 @@ var TopNavbar = ({ branding, mainMenu }) => {
2625
2617
  Button,
2626
2618
  {
2627
2619
  className: "text-sm font-semibold leading-6",
2628
- onClick: () => router == null ? void 0 : router.push("/logout"),
2620
+ onClick: () => signOut(),
2629
2621
  children: [
2630
2622
  "Logout ",
2631
2623
  /* @__PURE__ */ jsx39("span", { "aria-hidden": "true", children: " \u2192" })
@@ -3053,8 +3045,7 @@ function toast2(_a) {
3053
3045
  id,
3054
3046
  open: true,
3055
3047
  onOpenChange: (open) => {
3056
- if (!open)
3057
- dismiss();
3048
+ if (!open) dismiss();
3058
3049
  }
3059
3050
  })
3060
3051
  });
@@ -3133,7 +3124,7 @@ var ProfileSettings = ({ data }) => {
3133
3124
  const { handleSubmit, register } = useForm();
3134
3125
  const { toast: toast4 } = useToast2();
3135
3126
  const queryClient = useQueryClient();
3136
- const onSubmit = (data2) => __async(void 0, null, function* () {
3127
+ const onSubmit = (data2) => __async(null, null, function* () {
3137
3128
  try {
3138
3129
  yield ProfileService.profileUpdate(data2);
3139
3130
  toast4({
@@ -3216,7 +3207,7 @@ var ChangePassword = () => {
3216
3207
  newPassword: "",
3217
3208
  confirmNewPassword: ""
3218
3209
  });
3219
- const onSubmit = (data) => __async(void 0, null, function* () {
3210
+ const onSubmit = (data) => __async(null, null, function* () {
3220
3211
  if (shouldDisabled()) {
3221
3212
  toast4({
3222
3213
  title: "Password Incorrect",
@@ -3977,7 +3968,7 @@ var AccountEdit = ({ data, open, setOpen }) => {
3977
3968
  const handleInputChange = () => {
3978
3969
  setShowSaving(false);
3979
3970
  };
3980
- const onSubmit = (data2) => __async(void 0, null, function* () {
3971
+ const onSubmit = (data2) => __async(null, null, function* () {
3981
3972
  try {
3982
3973
  yield ProfileService3.profileUpdate(data2);
3983
3974
  toast4({
@@ -4224,7 +4215,7 @@ var PasswordEdit = ({ open, setOpen }) => {
4224
4215
  setIsSaving(false);
4225
4216
  }
4226
4217
  }, [formValues, hasInteracted]);
4227
- const onSubmit = (data) => __async(void 0, null, function* () {
4218
+ const onSubmit = (data) => __async(null, null, function* () {
4228
4219
  try {
4229
4220
  setIsSaving(true);
4230
4221
  const requestBody = data;
@@ -4644,7 +4635,7 @@ var TestEmail = ({ onDismiss }) => {
4644
4635
  useEffect4(() => {
4645
4636
  setOpen(true);
4646
4637
  }, []);
4647
- const onSubmit = (data) => __async(void 0, null, function* () {
4638
+ const onSubmit = (data) => __async(null, null, function* () {
4648
4639
  try {
4649
4640
  const payload = data;
4650
4641
  yield EmailSettingsService.emailSettingsSendTestEmail(payload);
@@ -4733,7 +4724,7 @@ var Emailing = () => {
4733
4724
  },
4734
4725
  [emailSettingDto]
4735
4726
  );
4736
- const onSubmitEvent = () => __async(void 0, null, function* () {
4727
+ const onSubmitEvent = () => __async(null, null, function* () {
4737
4728
  try {
4738
4729
  yield EmailSettingsService2.emailSettingsUpdate(__spreadValues({}, emailSettingDto));
4739
4730
  toast4({
@@ -5120,7 +5111,7 @@ var AddTenant = () => {
5120
5111
  const { toast: toast4 } = useToast2();
5121
5112
  const { handleSubmit, register } = useForm7();
5122
5113
  const queryClient = useQueryClient5();
5123
- const onSubmit = (data) => __async(void 0, null, function* () {
5114
+ const onSubmit = (data) => __async(null, null, function* () {
5124
5115
  const newTenant = data;
5125
5116
  try {
5126
5117
  yield TenantService.tenantCreate(newTenant);
@@ -5225,7 +5216,7 @@ var TenantEdit = ({
5225
5216
  setEnableHost(true);
5226
5217
  }
5227
5218
  }, [tenantDto, (_a = tenantDto == null ? void 0 : tenantDto.extraProperties) == null ? void 0 : _a.Host]);
5228
- const onSubmit = (dto) => __async(void 0, null, function* () {
5219
+ const onSubmit = (dto) => __async(null, null, function* () {
5229
5220
  const tenant = dto;
5230
5221
  try {
5231
5222
  yield TenantService2.tenantUpdate(tenantId, tenant);
@@ -5372,7 +5363,7 @@ var FeatureList = ({ onDismiss, tenantId }) => {
5372
5363
  setEnableEmailSetting(value);
5373
5364
  }
5374
5365
  };
5375
- const onSubmit = () => __async(void 0, null, function* () {
5366
+ const onSubmit = () => __async(null, null, function* () {
5376
5367
  try {
5377
5368
  const featureUpdateDto = {};
5378
5369
  featureUpdateDto.features = [
@@ -5406,7 +5397,7 @@ var FeatureList = ({ onDismiss, tenantId }) => {
5406
5397
  }
5407
5398
  }
5408
5399
  });
5409
- const onResetToDefaultEvent = () => __async(void 0, null, function* () {
5400
+ const onResetToDefaultEvent = () => __async(null, null, function* () {
5410
5401
  try {
5411
5402
  yield FeaturesService.featuresDelete(PermissionProvider.T, tenantId);
5412
5403
  toast4({
@@ -5498,8 +5489,7 @@ import {
5498
5489
  import { Fragment as Fragment7, jsx as jsx65, jsxs as jsxs37 } from "react/jsx-runtime";
5499
5490
  var PermissionActions = ({ actions }) => {
5500
5491
  const renderElement = (action) => {
5501
- if (!action.showButton || action.visible)
5502
- return false;
5492
+ if (!action.showButton || action.visible) return false;
5503
5493
  return /* @__PURE__ */ jsx65(DropdownMenuItem2, { children: /* @__PURE__ */ jsxs37(Button, { variant: "secondary", onClick: action.callback, size: "sm", children: [
5504
5494
  action.icon === "permission" && /* @__PURE__ */ jsxs37("div", { className: "flex items-center space-x-1", children: [
5505
5495
  /* @__PURE__ */ jsx65(
@@ -5609,8 +5599,7 @@ var Pagination = ({
5609
5599
  variant: "default",
5610
5600
  disabled: !table.getCanPreviousPage(),
5611
5601
  onClick: () => {
5612
- if (!table.getCanPreviousPage())
5613
- return;
5602
+ if (!table.getCanPreviousPage()) return;
5614
5603
  table.setPageIndex(0);
5615
5604
  },
5616
5605
  children: /* @__PURE__ */ jsx66(ChevronDoubleLeftIcon, { width: 24, height: 24 })
@@ -5623,8 +5612,7 @@ var Pagination = ({
5623
5612
  variant: "default",
5624
5613
  disabled: !table.getCanPreviousPage(),
5625
5614
  onClick: () => {
5626
- if (!table.getCanPreviousPage())
5627
- return;
5615
+ if (!table.getCanPreviousPage()) return;
5628
5616
  table.previousPage();
5629
5617
  },
5630
5618
  children: /* @__PURE__ */ jsx66(ChevronLeftIcon2, { width: 24, height: 24 })
@@ -5681,8 +5669,7 @@ var TableView = ({
5681
5669
  return headerGroups.map((headerGroup) => {
5682
5670
  const headers = headerGroup.headers;
5683
5671
  return /* @__PURE__ */ jsx67("tr", { className: "first:hidden", children: headers.map((header) => {
5684
- if (header.isPlaceholder)
5685
- return false;
5672
+ if (header.isPlaceholder) return false;
5686
5673
  return /* @__PURE__ */ jsx67(
5687
5674
  "th",
5688
5675
  {
@@ -5750,7 +5737,7 @@ var DeleteTenant = ({
5750
5737
  }) => {
5751
5738
  const { toast: toast4 } = useToast2();
5752
5739
  const [open, setOpen] = useState16(false);
5753
- const onYesEvent = () => __async(void 0, null, function* () {
5740
+ const onYesEvent = () => __async(null, null, function* () {
5754
5741
  try {
5755
5742
  yield TenantService3.tenantDelete(tenantId);
5756
5743
  toast4({
@@ -5833,8 +5820,7 @@ var SearchInput = ({ onUpdate, value }) => {
5833
5820
  [onUpdate]
5834
5821
  );
5835
5822
  useEffect12(() => {
5836
- if (searchStr)
5837
- onUpdate(searchStr);
5823
+ if (searchStr) onUpdate(searchStr);
5838
5824
  }, [onUpdate, searchStr]);
5839
5825
  useEffect12(() => {
5840
5826
  var _a;
@@ -6008,7 +5994,7 @@ var AddUser = ({ showButtonAdd }) => {
6008
5994
  const { toast: toast4 } = useToast2();
6009
5995
  const queryClient = useQueryClient9();
6010
5996
  const { handleSubmit, register } = useForm10();
6011
- const onSubmit = (data) => __async(void 0, null, function* () {
5997
+ const onSubmit = (data) => __async(null, null, function* () {
6012
5998
  const user = data;
6013
5999
  user.isActive = isActive;
6014
6000
  user.lockoutEnabled = lockoutEnabled;
@@ -6128,7 +6114,7 @@ var DeleteUser = ({
6128
6114
  }) => {
6129
6115
  const { toast: toast4 } = useToast2();
6130
6116
  const [open, setOpen] = useState21(false);
6131
- const onYesEvent = () => __async(void 0, null, function* () {
6117
+ const onYesEvent = () => __async(null, null, function* () {
6132
6118
  try {
6133
6119
  yield UserService2.userDelete(userId);
6134
6120
  toast4({
@@ -6167,7 +6153,7 @@ var DeleteUser = ({
6167
6153
 
6168
6154
  // src/components/User/UserDropDown.tsx
6169
6155
  import Link3 from "next/link";
6170
- import { useSession as useSession2 } from "next-auth/react";
6156
+ import { useSession as useSession2 } from "@geowiki/core";
6171
6157
  import { useMemo as useMemo2 } from "react";
6172
6158
  import { v4 as v44 } from "uuid";
6173
6159
  import { useCurrentUser } from "@geowiki/core";
@@ -6392,6 +6378,13 @@ var TABS_NAME = {
6392
6378
  USERS_ROLE_ASSIGN: "user_role_assign",
6393
6379
  USERS_EVO_PROJECTS: "users_evo_projects"
6394
6380
  };
6381
+ function formatUserAlias(userName) {
6382
+ var _a, _b;
6383
+ const parts = userName.split("_");
6384
+ const first = ((_b = (_a = parts[0].at(0)) == null ? void 0 : _a.toUpperCase()) != null ? _b : "") + parts[0].substring(1);
6385
+ if (!parts[1]) return first;
6386
+ return first + "(" + parts[1].toUpperCase() + ")";
6387
+ }
6395
6388
  var UserEdit = ({ userDto, userId, onDismiss }) => {
6396
6389
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
6397
6390
  const [open, setOpen] = useState22(false);
@@ -6403,12 +6396,7 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
6403
6396
  const assignableRoles = useAssignableRoles();
6404
6397
  const [refreshData, setRefreshData] = useState22(true);
6405
6398
  const [updateUserProject, setUpdateUserProject] = useState22(false);
6406
- const [userAlias, setUserAlias] = useState22(() => {
6407
- var _a2;
6408
- var user_alias = userDto.userName.split("_");
6409
- var user_alias_name = ((_a2 = user_alias[0].at(0)) == null ? void 0 : _a2.toUpperCase()) + user_alias[0].substring(1, user_alias[0].length) + "(" + user_alias[1].toUpperCase() + ")";
6410
- return user_alias_name;
6411
- });
6399
+ const [userAlias, setUserAlias] = useState22(() => formatUserAlias(userDto.userName));
6412
6400
  const { theme } = useTheme();
6413
6401
  const { data: projects } = useProjects(evolandFeature, 0, 50);
6414
6402
  const { data: userCurrentProject } = useGetUserProject(
@@ -6458,24 +6446,17 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
6458
6446
  setRefreshData(false);
6459
6447
  };
6460
6448
  if ((updateUserRoleProjectResult == null ? void 0 : updateUserRoleProjectResult.success) == true) {
6461
- if (userAlias != "")
6462
- setUserAlias("");
6463
- if (userProjectRole.length != 0)
6464
- setUserProjectRole([]);
6449
+ if (userAlias != "") setUserAlias("");
6450
+ if (userProjectRole.length != 0) setUserProjectRole([]);
6465
6451
  }
6466
6452
  if (setUserDetail && setUserDetail.success == true) {
6467
- if (contractStartDate != "")
6468
- setContractStartDate("");
6469
- if (contractEndDate != "")
6470
- setContractEndDate("");
6453
+ if (contractStartDate != "") setContractStartDate("");
6454
+ if (contractEndDate != "") setContractEndDate("");
6471
6455
  setUpdateUserDetail(false);
6472
6456
  setRefreshData(false);
6473
6457
  }
6474
- const updateUserRoleProject = () => __async(void 0, null, function* () {
6475
- var _a2;
6476
- var user_alias = userDto.userName.split("_");
6477
- var user_alias_name = ((_a2 = user_alias[0].at(0)) == null ? void 0 : _a2.toUpperCase()) + user_alias[0].substring(1, user_alias[0].length) + "(" + user_alias[1].toUpperCase() + ")";
6478
- setUserAlias(user_alias_name);
6458
+ const updateUserRoleProject = () => __async(null, null, function* () {
6459
+ setUserAlias(formatUserAlias(userDto.userName));
6479
6460
  setUpdateUserProject(true);
6480
6461
  });
6481
6462
  const columns = [
@@ -6524,17 +6505,14 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
6524
6505
  const paginationComponentOptions = {
6525
6506
  noRowsPerPage: true
6526
6507
  };
6527
- const onSubmit = (data) => __async(void 0, null, function* () {
6508
+ const onSubmit = (data) => __async(null, null, function* () {
6528
6509
  const user = data;
6529
6510
  try {
6530
6511
  if (evolandFeature) {
6531
- if (!updateUserProject)
6532
- yield updateUserRoleProject();
6512
+ if (!updateUserProject) yield updateUserRoleProject();
6533
6513
  if (userCurrentProject && (userCurrentProject[0].contract_start_date != contractStartDate || userCurrentProject[0].contract_end_date != contractEndDate)) {
6534
- if (contractStartDate == "")
6535
- setContractStartDate(null);
6536
- if (contractEndDate == "")
6537
- setContractEndDate(null);
6514
+ if (contractStartDate == "") setContractStartDate(null);
6515
+ if (contractEndDate == "") setContractEndDate(null);
6538
6516
  if ((contractStartDate == "" || !contractStartDate) && contractEndDate || contractEndDate && contractStartDate && new Date(contractEndDate) < new Date(contractEndDate)) {
6539
6517
  alert("Please provide correct date");
6540
6518
  return;
@@ -6562,14 +6540,10 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
6562
6540
  });
6563
6541
  const onCloseEvent = () => {
6564
6542
  setOpen(false);
6565
- if (userAlias != "")
6566
- setUserAlias("");
6567
- if (userProjectRole.length != 0)
6568
- setUserProjectRole([]);
6569
- if (contractStartDate != "")
6570
- setContractStartDate("");
6571
- if (contractEndDate != "")
6572
- setContractEndDate("");
6543
+ if (userAlias != "") setUserAlias("");
6544
+ if (userProjectRole.length != 0) setUserProjectRole([]);
6545
+ if (contractStartDate != "") setContractStartDate("");
6546
+ if (contractEndDate != "") setContractEndDate("");
6573
6547
  onDismiss();
6574
6548
  };
6575
6549
  useEffect14(() => {
@@ -6601,7 +6575,7 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
6601
6575
  },
6602
6576
  [roles]
6603
6577
  );
6604
- const onRoleAssignedSaveEvent = (e) => __async(void 0, null, function* () {
6578
+ const onRoleAssignedSaveEvent = (e) => __async(null, null, function* () {
6605
6579
  var _a2;
6606
6580
  e.preventDefault();
6607
6581
  const updateUserDto = __spreadProps(__spreadValues({}, userDto), {
@@ -6686,8 +6660,7 @@ var UserEdit = ({ userDto, userId, onDismiss }) => {
6686
6660
  onChange: (e) => {
6687
6661
  if ((contractStartDate == "" || !contractStartDate) && e.target.value !== "" || new Date(contractStartDate) > new Date(e.target.value))
6688
6662
  alert("Please provide correct start date");
6689
- else
6690
- setContractEndDate(e.target.value);
6663
+ else setContractEndDate(e.target.value);
6691
6664
  }
6692
6665
  })
6693
6666
  )
@@ -7021,8 +6994,7 @@ var UserPermission = ({
7021
6994
  var _a;
7022
6995
  return (_a = g.permissions) == null ? void 0 : _a.every((p) => p.isGranted);
7023
6996
  }).every((e) => e);
7024
- if (hasAllPermissionGranted)
7025
- setHasAllGranted(hasAllPermissionGranted);
6997
+ if (hasAllPermissionGranted) setHasAllGranted(hasAllPermissionGranted);
7026
6998
  }
7027
6999
  }, [permissionGroups]);
7028
7000
  useEffect16(() => {
@@ -7086,7 +7058,7 @@ var UserPermission = ({
7086
7058
  [hasAllGranted, permissionGroups]
7087
7059
  );
7088
7060
  const onSubmit = useCallback7(
7089
- (e) => __async(void 0, null, function* () {
7061
+ (e) => __async(null, null, function* () {
7090
7062
  e.preventDefault();
7091
7063
  const payload = permissionGroups == null ? void 0 : permissionGroups.map(
7092
7064
  (p) => p.permissions.map((grant) => ({
@@ -7381,7 +7353,7 @@ var UserList = ({
7381
7353
  };
7382
7354
 
7383
7355
  // src/components/User/UserMenus.tsx
7384
- import { signIn as signIn3, useSession as useSession3 } from "next-auth/react";
7356
+ import { signIn as signIn3, useSession as useSession3 } from "@geowiki/core";
7385
7357
  import { getCookie } from "cookies-next";
7386
7358
  import { jsx as jsx82, jsxs as jsxs51 } from "react/jsx-runtime";
7387
7359
  var UserMenus = ({}) => {
@@ -7398,9 +7370,8 @@ var UserMenus = ({}) => {
7398
7370
  size: "sm",
7399
7371
  className: "w-full mt-2 sm:w-1/2 sm:mt-0",
7400
7372
  onClick: () => {
7401
- signIn3("openiddict", void 0, {
7373
+ signIn3(void 0, void 0, {
7402
7374
  __tenant: getCookie("__tenant")
7403
- // prompt: "login",
7404
7375
  });
7405
7376
  },
7406
7377
  children: "Login"
@@ -7430,7 +7401,7 @@ var DeleteRole = ({
7430
7401
  }) => {
7431
7402
  const { toast: toast4 } = useToast2();
7432
7403
  const [open, setOpen] = useState26(false);
7433
- const onYesEvent = () => __async(void 0, null, function* () {
7404
+ const onYesEvent = () => __async(null, null, function* () {
7434
7405
  try {
7435
7406
  yield RoleService.roleDelete(roleId);
7436
7407
  toast4({
@@ -7481,7 +7452,7 @@ var RoleEdit = ({ roleDto, roleId, onDismiss }) => {
7481
7452
  const { handleSubmit, register } = useForm12();
7482
7453
  const [isDefault, setIsDefault] = useState27(roleDto.isDefault);
7483
7454
  const [isPublic, setIsPublic] = useState27(roleDto.isPublic);
7484
- const onSubmit = (data) => __async(void 0, null, function* () {
7455
+ const onSubmit = (data) => __async(null, null, function* () {
7485
7456
  const role = data;
7486
7457
  role.isDefault = isDefault;
7487
7458
  role.isPublic = isPublic;
@@ -7633,8 +7604,7 @@ var RolePermission = ({ roleDto, onDismiss }) => {
7633
7604
  var _a;
7634
7605
  return (_a = g.permissions) == null ? void 0 : _a.every((p) => p.isGranted);
7635
7606
  }).every((e) => e);
7636
- if (hasAllPermissionGranted)
7637
- setHasAllGranted(hasAllPermissionGranted);
7607
+ if (hasAllPermissionGranted) setHasAllGranted(hasAllPermissionGranted);
7638
7608
  }
7639
7609
  }, [permissionGroups]);
7640
7610
  useEffect19(() => {
@@ -7698,7 +7668,7 @@ var RolePermission = ({ roleDto, onDismiss }) => {
7698
7668
  [hasAllGranted, permissionGroups]
7699
7669
  );
7700
7670
  const onSubmit = useCallback8(
7701
- (e) => __async(void 0, null, function* () {
7671
+ (e) => __async(null, null, function* () {
7702
7672
  e.preventDefault();
7703
7673
  const payload = permissionGroups == null ? void 0 : permissionGroups.map(
7704
7674
  (p) => p.permissions.map((grant) => ({
@@ -8005,7 +7975,7 @@ var AddRole = ({ showButtonAdd }) => {
8005
7975
  const { toast: toast4 } = useToast2();
8006
7976
  const { handleSubmit, register } = useForm13();
8007
7977
  const queryClient = useQueryClient14();
8008
- const onSubmit = (data) => __async(void 0, null, function* () {
7978
+ const onSubmit = (data) => __async(null, null, function* () {
8009
7979
  const newRole = data;
8010
7980
  newRole.isDefault = isDefault;
8011
7981
  newRole.isPublic = isPublic;
@@ -8273,7 +8243,7 @@ var AccordionContent2 = forwardRef40((_a, ref) => {
8273
8243
  AccordionContent2.displayName = AccordionPrimitive2.Content.displayName;
8274
8244
 
8275
8245
  // src/components/Admin/Sidebar.tsx
8276
- import { useRouter as useRouter2 } from "next/router";
8246
+ import { useRouter } from "next/router";
8277
8247
  import { useCallback as useCallback9 } from "react";
8278
8248
 
8279
8249
  // src/components/Shared/Image.tsx
@@ -8297,13 +8267,11 @@ import { useCurrentUser as useCurrentUser2 } from "@geowiki/core";
8297
8267
  import { Fragment as Fragment17, jsx as jsx93 } from "react/jsx-runtime";
8298
8268
  var RequireRole = ({ roles, children }) => {
8299
8269
  const currentUser = useCurrentUser2();
8300
- if (!currentUser)
8301
- return null;
8270
+ if (!currentUser) return null;
8302
8271
  if (!(roles == null ? void 0 : roles.some((role) => {
8303
8272
  var _a;
8304
8273
  return (_a = currentUser.roles) == null ? void 0 : _a.includes(role);
8305
- })))
8306
- return null;
8274
+ }))) return null;
8307
8275
  return /* @__PURE__ */ jsx93(Fragment17, { children });
8308
8276
  };
8309
8277
 
@@ -8461,14 +8429,13 @@ var Sidebar = ({
8461
8429
  generalSettings
8462
8430
  }) => {
8463
8431
  var _a, _b, _c, _d, _e, _f, _g, _h, _i;
8464
- const router = useRouter2();
8432
+ const router = useRouter();
8465
8433
  const { data: appConfig, isLoading: isAppConfigLoading } = useAppConfig2();
8466
8434
  const getDefaultValue = useCallback9(
8467
8435
  (menu) => {
8468
8436
  var _a2;
8469
8437
  const m = (_a2 = menu.children) == null ? void 0 : _a2.find((c) => c.link === (router == null ? void 0 : router.asPath));
8470
- if (m)
8471
- return menu.name;
8438
+ if (m) return menu.name;
8472
8439
  return "";
8473
8440
  },
8474
8441
  [router == null ? void 0 : router.asPath]
@@ -8561,11 +8528,11 @@ var Sidebar = ({
8561
8528
 
8562
8529
  // src/components/Layouts/AdminLayout.tsx
8563
8530
  import { Bars3Icon as Bars3Icon2, ChevronLeftIcon as ChevronLeftIcon4 } from "@heroicons/react/24/solid";
8564
- import { useCurrentUser as useCurrentUser3 } from "@geowiki/core";
8531
+ import { useCurrentUser as useCurrentUser3, useSession as useSession4 } from "@geowiki/core";
8565
8532
 
8566
8533
  // src/components/Shared/auth/AuthenticationFailure.tsx
8567
8534
  import { useEffect as useEffect20, useState as useState31 } from "react";
8568
- import { signIn as signIn4 } from "next-auth/react";
8535
+ import { signIn as signIn4 } from "@geowiki/core";
8569
8536
  import { jsx as jsx99, jsxs as jsxs61 } from "react/jsx-runtime";
8570
8537
  var AuthenticationFailure = ({}) => {
8571
8538
  const [open, setOpen] = useState31(false);
@@ -8593,7 +8560,7 @@ var AuthenticationFailure = ({}) => {
8593
8560
  Button,
8594
8561
  {
8595
8562
  onClick: () => {
8596
- signIn4("openiddict");
8563
+ signIn4();
8597
8564
  },
8598
8565
  variant: "default",
8599
8566
  children: "Login"
@@ -8613,11 +8580,12 @@ var AdminLayout = ({
8613
8580
  var _a, _b, _c, _d, _e;
8614
8581
  const [toggleSidebar, setToggleSidebar] = useState32(false);
8615
8582
  const currentUser = useCurrentUser3();
8583
+ const { status: sessionStatus } = useSession4();
8616
8584
  const cmsUrl = (_b = (_a = generalSettings == null ? void 0 : generalSettings.GeoWikiSettings) == null ? void 0 : _a.Host) == null ? void 0 : _b.Text;
8617
8585
  var favicon = (_e = (_d = (_c = generalSettings == null ? void 0 : generalSettings.GeoWikiSettings) == null ? void 0 : _c.FavIcon) == null ? void 0 : _d.Paths) == null ? void 0 : _e[0];
8618
8586
  const faviconPath = cmsUrl + "/media/" + favicon;
8619
8587
  return /* @__PURE__ */ jsxs62("main", { children: [
8620
- currentUser && !(currentUser == null ? void 0 : currentUser.isAuthenticated) && /* @__PURE__ */ jsx100(AuthenticationFailure, {}),
8588
+ sessionStatus === "unauthenticated" && currentUser && !(currentUser == null ? void 0 : currentUser.isAuthenticated) && /* @__PURE__ */ jsx100(AuthenticationFailure, {}),
8621
8589
  /* @__PURE__ */ jsx100(Head, { children: favicon && /* @__PURE__ */ jsx100("link", { rel: "icon", href: faviconPath }) }),
8622
8590
  /* @__PURE__ */ jsx100(
8623
8591
  Sidebar,
@@ -8856,8 +8824,7 @@ var CustomDropDown = (props) => {
8856
8824
  }
8857
8825
  return null;
8858
8826
  });
8859
- if (IsConfigSettingsLoaded)
8860
- return /* @__PURE__ */ jsx105(LoaderFull, {});
8827
+ if (IsConfigSettingsLoaded) return /* @__PURE__ */ jsx105(LoaderFull, {});
8861
8828
  return /* @__PURE__ */ jsx105(
8862
8829
  AsyncSelect,
8863
8830
  {
@@ -9000,11 +8967,9 @@ var CustomFilterSort = (props) => {
9000
8967
  LabelLookUp: item.LabelLookUp,
9001
8968
  Parameter: item.Parameter,
9002
8969
  onValueChange: (currentvalue) => {
9003
- if ((currentvalue == null ? void 0 : currentvalue.value) != void 0)
9004
- skip = 0;
8970
+ if ((currentvalue == null ? void 0 : currentvalue.value) != void 0) skip = 0;
9005
8971
  filterValues[item == null ? void 0 : item.Name.replace(new RegExp(" ", "g"), "")] = currentvalue == null ? void 0 : currentvalue.value;
9006
- if (!props.showButtons)
9007
- onSearch();
8972
+ if (!props.showButtons) onSearch();
9008
8973
  }
9009
8974
  },
9010
8975
  index
@@ -9074,8 +9039,7 @@ import { jsx as jsx107, jsxs as jsxs67 } from "react/jsx-runtime";
9074
9039
  var InfoCard = (props) => {
9075
9040
  var _a;
9076
9041
  var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = useConfigSettings2();
9077
- if (IsConfigSettingsLoaded)
9078
- return /* @__PURE__ */ jsx107(LoaderFull, {});
9042
+ if (IsConfigSettingsLoaded) return /* @__PURE__ */ jsx107(LoaderFull, {});
9079
9043
  return /* @__PURE__ */ jsx107(
9080
9044
  motion2.li,
9081
9045
  {
@@ -9490,8 +9454,7 @@ var CmsImage = ({
9490
9454
  showPlaceholder = true
9491
9455
  }) => {
9492
9456
  var { data: cmsImageUrl, isLoading } = useCmsImage(src);
9493
- if (isLoading)
9494
- return null;
9457
+ if (isLoading) return null;
9495
9458
  if (width && height) {
9496
9459
  if (!showPlaceholder)
9497
9460
  return /* @__PURE__ */ jsx120(
@@ -10486,8 +10449,8 @@ var RichTextContent = (props) => {
10486
10449
  const [hasContent, setHasContent] = useState36(
10487
10450
  props.defaultValue ? true : false
10488
10451
  );
10489
- const loadQuill = () => __async(void 0, null, function* () {
10490
- return new Promise((resolve) => __async(void 0, null, function* () {
10452
+ const loadQuill = () => __async(null, null, function* () {
10453
+ return new Promise((resolve) => __async(null, null, function* () {
10491
10454
  const Quill = yield __require("react-quill").Quill;
10492
10455
  const BlotFormatter = (yield __require("quill-blot-formatter")).default;
10493
10456
  resolve({ Quill, BlotFormatter });
@@ -10681,8 +10644,7 @@ var PrimaryButton = (props) => {
10681
10644
  import Link9 from "next/link";
10682
10645
  import { jsx as jsx144 } from "react/jsx-runtime";
10683
10646
  var ButtonList = ({ data }) => {
10684
- if (!data)
10685
- return null;
10647
+ if (!data) return null;
10686
10648
  return data == null ? void 0 : data.map((button) => {
10687
10649
  var _a;
10688
10650
  return /* @__PURE__ */ jsx144(Button, { children: /* @__PURE__ */ jsx144(
@@ -10705,11 +10667,11 @@ var FullPageLoader = ({ show }) => {
10705
10667
  };
10706
10668
 
10707
10669
  // src/components/Shared/Error.tsx
10708
- import { useRouter as useRouter3 } from "next/router";
10670
+ import { useRouter as useRouter2 } from "next/router";
10709
10671
  import Image4 from "next/image";
10710
10672
  import { jsx as jsx146, jsxs as jsxs90 } from "react/jsx-runtime";
10711
10673
  var Error2 = () => {
10712
- const router = useRouter3();
10674
+ const router = useRouter2();
10713
10675
  return /* @__PURE__ */ jsxs90("div", { className: "lg:px-24 lg:py-24 md:py-20 md:px-44 px-4 py-24 items-center flex justify-center flex-col-reverse lg:flex-row md:gap-28 gap-1 bg-base-200", children: [
10714
10676
  /* @__PURE__ */ jsx146("div", { className: "w-full xl:w-1/2 relative lg:pb-0", children: /* @__PURE__ */ jsx146("div", { className: "relative", children: /* @__PURE__ */ jsxs90("div", { className: "absolute", children: [
10715
10677
  /* @__PURE__ */ jsx146("h1", { className: "my-2 text-primary font-bold text-2xl", children: "Looks like you've found the doorway to the great nothing" }),
@@ -10894,7 +10856,7 @@ var NewsArticle = (props) => {
10894
10856
  };
10895
10857
 
10896
10858
  // src/components/News/NewsItemList.tsx
10897
- import { useRouter as useRouter4 } from "next/router";
10859
+ import { useRouter as useRouter3 } from "next/router";
10898
10860
  import { v4 as v49 } from "uuid";
10899
10861
  import { Fragment as Fragment20, jsx as jsx150, jsxs as jsxs94 } from "react/jsx-runtime";
10900
10862
  var NewsItemList = ({ newsItems }) => {
@@ -10903,7 +10865,7 @@ var NewsItemList = ({ newsItems }) => {
10903
10865
  { key: "en", value: "English" },
10904
10866
  { key: "fr", value: "Fran\xE7ais" }
10905
10867
  ];
10906
- const router = useRouter4();
10868
+ const router = useRouter3();
10907
10869
  const { lang } = router.query;
10908
10870
  var currentLang = "all";
10909
10871
  if (lang) {
@@ -11100,7 +11062,7 @@ import dynamic2 from "next/dynamic";
11100
11062
  import { useState as useState40 } from "react";
11101
11063
  import { jsx as jsx156, jsxs as jsxs98 } from "react/jsx-runtime";
11102
11064
  var MapWithNoSSR = dynamic2(
11103
- () => import("./cluster-map-OI3WRJJ7.mjs").then((x) => x.FarmerClusterMap),
11065
+ () => import("./cluster-map-CWAOD7E2.mjs").then((x) => x.FarmerClusterMap),
11104
11066
  {
11105
11067
  ssr: false
11106
11068
  }
@@ -11299,7 +11261,7 @@ import { useForm as useForm15 } from "react-hook-form";
11299
11261
  import { ProfileService as ProfileService5 } from "@geowiki/api-proxy";
11300
11262
  import Swal from "sweetalert2";
11301
11263
  import { EyeIcon, EyeSlashIcon } from "@heroicons/react/24/outline";
11302
- import { useRouter as useRouter5 } from "next/router";
11264
+ import { useRouter as useRouter4 } from "next/router";
11303
11265
  import { jsx as jsx160, jsxs as jsxs102 } from "react/jsx-runtime";
11304
11266
  var UpdatePassword = (props) => {
11305
11267
  const {
@@ -11312,7 +11274,7 @@ var UpdatePassword = (props) => {
11312
11274
  const [ConfirmPassword, setConfirmPassword] = useState41(false);
11313
11275
  const [CurrentPasswordType, setCurrentPasswordType] = useState41("password");
11314
11276
  const [NewPasswordType, setNewPasswordType] = useState41("password");
11315
- const router = useRouter5();
11277
+ const router = useRouter4();
11316
11278
  const onPasswordChange = (key, value) => {
11317
11279
  if (key !== "confirmnewPassword")
11318
11280
  setPasswordData(() => {
@@ -11329,7 +11291,7 @@ var UpdatePassword = (props) => {
11329
11291
  reset({ confirmnewPassword: null });
11330
11292
  }
11331
11293
  };
11332
- const onPasswordSubmit = () => __async(void 0, null, function* () {
11294
+ const onPasswordSubmit = () => __async(null, null, function* () {
11333
11295
  try {
11334
11296
  yield ProfileService5.profileChangePassword(PasswordData);
11335
11297
  Swal.fire({
@@ -11530,7 +11492,7 @@ var UpdateUserProfile = ({
11530
11492
  });
11531
11493
  });
11532
11494
  };
11533
- const onProfileSubmit = () => __async(void 0, null, function* () {
11495
+ const onProfileSubmit = () => __async(null, null, function* () {
11534
11496
  var result = yield ProfileService6.profileUpdate(UserData);
11535
11497
  if (result.name === UserData.name && result.surname === UserData.surname) {
11536
11498
  Swal2.fire({
@@ -11637,7 +11599,7 @@ import { toast as toast3 } from "react-toastify";
11637
11599
  import { jsx as jsx162, jsxs as jsxs104 } from "react/jsx-runtime";
11638
11600
  var SettingsItem = (props) => {
11639
11601
  const [value, setValue] = useState43(props.value);
11640
- const handleUpdateSettings = () => __async(void 0, null, function* () {
11602
+ const handleUpdateSettings = () => __async(null, null, function* () {
11641
11603
  try {
11642
11604
  yield SettingsService.settingsSetSettingForTenant(props.setting, value);
11643
11605
  toast3.success("Settings updated");
@@ -11683,8 +11645,7 @@ import { jsx as jsx163, jsxs as jsxs105 } from "react/jsx-runtime";
11683
11645
  var SettingsManagement = () => {
11684
11646
  var _a;
11685
11647
  var { data, isLoading } = useAppConfig3();
11686
- if (isLoading)
11687
- return /* @__PURE__ */ jsx163("div", { children: "Loading..." });
11648
+ if (isLoading) return /* @__PURE__ */ jsx163("div", { children: "Loading..." });
11688
11649
  const keys = Object == null ? void 0 : Object.keys((_a = data == null ? void 0 : data.setting) == null ? void 0 : _a.values);
11689
11650
  let settings = {
11690
11651
  GeoWiki: keys.filter((key) => key.startsWith("GeoWiki")),
@@ -11695,10 +11656,8 @@ var SettingsManagement = () => {
11695
11656
  return key.startsWith((_a2 = data == null ? void 0 : data.currentTenant) == null ? void 0 : _a2.name);
11696
11657
  })
11697
11658
  };
11698
- if (!data)
11699
- return /* @__PURE__ */ jsx163("div", { children: "no data" });
11700
- if (!keys)
11701
- return /* @__PURE__ */ jsx163("div", { children: "no keys" });
11659
+ if (!data) return /* @__PURE__ */ jsx163("div", { children: "no data" });
11660
+ if (!keys) return /* @__PURE__ */ jsx163("div", { children: "no keys" });
11702
11661
  return /* @__PURE__ */ jsx163("div", { children: /* @__PURE__ */ jsx163("div", { className: "w-full px-2 py-16 sm:px-0", children: /* @__PURE__ */ jsxs105(Tab.Group, { children: [
11703
11662
  /* @__PURE__ */ jsx163(Tab.List, { className: "flex p-1 space-x-1 rounded-xl", children: Object.keys(settings).map(
11704
11663
  (key) => settings[key].length > 0 && /* @__PURE__ */ jsx163(
@@ -12008,13 +11967,11 @@ var VersionDisplay = () => {
12008
11967
  const [version, setVersion] = useState44();
12009
11968
  useEffect25(() => {
12010
11969
  fetch("/version.json").then((res) => {
12011
- if (!res.ok)
12012
- throw new Error("Version file not found");
11970
+ if (!res.ok) throw new Error("Version file not found");
12013
11971
  return res.json();
12014
11972
  }).then((data) => setVersion(data.version)).catch(() => setVersion(void 0));
12015
11973
  }, []);
12016
- if (!version)
12017
- return null;
11974
+ if (!version) return null;
12018
11975
  return /* @__PURE__ */ jsxs108("div", { className: "text-grey text-sm lg:text-base font-normal leading-[130%]", children: [
12019
11976
  "Version: ",
12020
11977
  version
@@ -12154,7 +12111,7 @@ var DesignFooter = (props) => {
12154
12111
  // src/components/DesignElements/header.tsx
12155
12112
  import { useState as useState45 } from "react";
12156
12113
  import { Dialog as Dialog8, Popover as Popover3 } from "@headlessui/react";
12157
- import { signIn as signIn5, signOut } from "next-auth/react";
12114
+ import { signIn as signIn5, signOut as signOut2 } from "@geowiki/core";
12158
12115
  import { Bars3Icon as Bars3Icon3, XMarkIcon as XMarkIcon5 } from "@heroicons/react/24/outline";
12159
12116
  import { ChevronDownIcon as ChevronDownIcon2 } from "@heroicons/react/20/solid";
12160
12117
  import Link13 from "next/link";
@@ -12377,7 +12334,7 @@ var DesignHeader = ({
12377
12334
  {
12378
12335
  variant: "secondary",
12379
12336
  size: "sm",
12380
- onClick: () => signIn5("openiddict"),
12337
+ onClick: () => signIn5(),
12381
12338
  children: "Login"
12382
12339
  }
12383
12340
  ),
@@ -12403,11 +12360,7 @@ var DesignHeader = ({
12403
12360
  {
12404
12361
  variant: "secondary",
12405
12362
  size: "sm",
12406
- onClick: () => {
12407
- signOut({ redirect: false }).then(() => {
12408
- window.location.href = "/logout";
12409
- });
12410
- },
12363
+ onClick: () => signOut2(),
12411
12364
  children: "Logout"
12412
12365
  }
12413
12366
  )
@@ -12539,9 +12492,7 @@ var DesignHeader = ({
12539
12492
  className: "text-base font-medium text-gray-900 hover:text-gray-700 transition-colors duration-200",
12540
12493
  onClick: () => {
12541
12494
  setMobileMenuOpen(false);
12542
- signOut({ redirect: false }).then(() => {
12543
- window.location.href = "/logout";
12544
- });
12495
+ signOut2();
12545
12496
  },
12546
12497
  children: "Logout"
12547
12498
  }
@@ -12900,11 +12851,11 @@ var DesignResultTag = ({ tag, name }) => {
12900
12851
  };
12901
12852
 
12902
12853
  // src/components/DesignElements/sort.tsx
12903
- import { useRouter as useRouter6 } from "next/router";
12854
+ import { useRouter as useRouter5 } from "next/router";
12904
12855
  import { useState as useState48, useEffect as useEffect27 } from "react";
12905
12856
  import { jsx as jsx177, jsxs as jsxs117 } from "react/jsx-runtime";
12906
12857
  var DesignSort = ({ totalCount, name }) => {
12907
- const router = useRouter6();
12858
+ const router = useRouter5();
12908
12859
  const sortingTypes = ["Most recent", "Old to new"];
12909
12860
  const [value, setValue] = useState48("Most recent");
12910
12861
  useEffect27(() => {
@@ -12948,14 +12899,14 @@ var DesignSort = ({ totalCount, name }) => {
12948
12899
  // src/components/DesignElements/filterDropdown.tsx
12949
12900
  import { Disclosure as Disclosure2 } from "@headlessui/react";
12950
12901
  import { ChevronDown as ChevronDown6 } from "lucide-react";
12951
- import { useRouter as useRouter7 } from "next/router";
12902
+ import { useRouter as useRouter6 } from "next/router";
12952
12903
  import { Fragment as Fragment24, jsx as jsx178, jsxs as jsxs118 } from "react/jsx-runtime";
12953
12904
  var FilterDropdown = ({
12954
12905
  name,
12955
12906
  filterKey,
12956
12907
  sortItems
12957
12908
  }) => {
12958
- const router = useRouter7();
12909
+ const router = useRouter6();
12959
12910
  const filterValue = router.query[filterKey];
12960
12911
  const filterValues = (filterValue == null ? void 0 : filterValue.toString().split(",")) || [];
12961
12912
  const handleCheckboxChange = (e, selectedItem) => {
@@ -13398,8 +13349,7 @@ import { jsx as jsx188, jsxs as jsxs126 } from "react/jsx-runtime";
13398
13349
  var ListTagsGroup = ({ cluster }) => {
13399
13350
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u;
13400
13351
  var { data: ConfigSettings, isLoading: IsConfigSettingsLoaded } = useConfigSettings3();
13401
- if (IsConfigSettingsLoaded)
13402
- return /* @__PURE__ */ jsx188(LoaderFull, {});
13352
+ if (IsConfigSettingsLoaded) return /* @__PURE__ */ jsx188(LoaderFull, {});
13403
13353
  return /* @__PURE__ */ jsxs126("div", { className: "space-y-6 lg:space-y-10", children: [
13404
13354
  /* @__PURE__ */ jsx188(
13405
13355
  TagsGroup,
@@ -13567,8 +13517,7 @@ var ApiImage = ({
13567
13517
  height = 0
13568
13518
  }) => {
13569
13519
  var { data, isLoading } = useApiImage(imageId);
13570
- if (isLoading)
13571
- return null;
13520
+ if (isLoading) return null;
13572
13521
  if (width > 0 && height > 0) {
13573
13522
  return /* @__PURE__ */ jsx189(
13574
13523
  Image5,
@@ -13657,13 +13606,13 @@ var SignUpBanner = ({
13657
13606
  };
13658
13607
 
13659
13608
  // src/components/DesignElements/RoutePagination.tsx
13660
- import { useRouter as useRouter8 } from "next/router";
13609
+ import { useRouter as useRouter7 } from "next/router";
13661
13610
  import { jsx as jsx191 } from "react/jsx-runtime";
13662
13611
  var RoutePagination = ({
13663
13612
  pageSize,
13664
13613
  total
13665
13614
  }) => {
13666
- const router = useRouter8();
13615
+ const router = useRouter7();
13667
13616
  const { page } = router.query;
13668
13617
  const currentPage = parseInt(page) || 1;
13669
13618
  return /* @__PURE__ */ jsx191("div", { children: /* @__PURE__ */ jsx191(
@@ -13812,7 +13761,7 @@ import { useState as useState51 } from "react";
13812
13761
  import { Fragment as Fragment25 } from "react";
13813
13762
  import { Dialog as Dialog9, Transition as Transition6 } from "@headlessui/react";
13814
13763
  import { ArrowLeftIcon, CheckIcon as CheckIcon2 } from "@heroicons/react/24/outline";
13815
- import { useRouter as useRouter9 } from "next/router";
13764
+ import { useRouter as useRouter8 } from "next/router";
13816
13765
  import { v4 as v413 } from "uuid";
13817
13766
  import { jsx as jsx195, jsxs as jsxs131 } from "react/jsx-runtime";
13818
13767
  function MobileFilterPopupOpened({
@@ -13824,7 +13773,7 @@ function MobileFilterPopupOpened({
13824
13773
  routerFiltername,
13825
13774
  isMultiSelect
13826
13775
  }) {
13827
- const router = useRouter9();
13776
+ const router = useRouter8();
13828
13777
  const queryValue = router.query[routerFiltername];
13829
13778
  const checkValues = typeof queryValue === "string" ? queryValue.split(",") : Array.isArray(queryValue) ? queryValue : [];
13830
13779
  const handleShowResults = () => {
@@ -13948,7 +13897,7 @@ function MobileFilterPopupOpened({
13948
13897
  }
13949
13898
 
13950
13899
  // src/components/DesignElements/MobileFilterPopup.tsx
13951
- import { useRouter as useRouter10 } from "next/router";
13900
+ import { useRouter as useRouter9 } from "next/router";
13952
13901
  import { jsx as jsx196, jsxs as jsxs132 } from "react/jsx-runtime";
13953
13902
  function MobileFilterPopup({
13954
13903
  open,
@@ -13957,7 +13906,7 @@ function MobileFilterPopup({
13957
13906
  filters,
13958
13907
  isMultiSelect
13959
13908
  }) {
13960
- const router = useRouter10();
13909
+ const router = useRouter9();
13961
13910
  const [openStates, setOpenStates] = useState51(
13962
13911
  filters.reduce((acc, filter) => {
13963
13912
  acc[filter.filterName] = false;
@@ -14382,10 +14331,8 @@ var ClusterNews = ({
14382
14331
  path: clusterNewsItem.imageId === "00000000-0000-0000-0000-000000000000" ? "/assets/img/noImage.png" : clusterNewsItem.imageId
14383
14332
  };
14384
14333
  });
14385
- if (isLoading)
14386
- return /* @__PURE__ */ jsx204(LocalLoader, {});
14387
- if (publishedItems.length == 0)
14388
- return null;
14334
+ if (isLoading) return /* @__PURE__ */ jsx204(LocalLoader, {});
14335
+ if (publishedItems.length == 0) return null;
14389
14336
  return /* @__PURE__ */ jsx204(Fragment27, { children: !isLoading && /* @__PURE__ */ jsx204("div", { className: "bg-grey-lightest lg:mt-[100px]", children: /* @__PURE__ */ jsx204("div", { className: "bg-grey-lightest mx-5 lg:mx-12", children: /* @__PURE__ */ jsxs137("div", { className: "container mx-auto space-y-6 py-6 lg:space-y-10 lg:py-16 px-0 lg:px-10 ", children: [
14390
14337
  /* @__PURE__ */ jsxs137("div", { className: "lg:flex lg:justify-between lg:items-end", children: [
14391
14338
  /* @__PURE__ */ jsx204(H4Design, { className: "pb-4 lg:pb-0", children: "Cluster News" }),
@@ -14541,8 +14488,7 @@ import { useCountries } from "@geowiki/core";
14541
14488
  import { jsx as jsx208, jsxs as jsxs139 } from "react/jsx-runtime";
14542
14489
  var H3Clusters = ({ clusters }) => {
14543
14490
  const { data: countries, isLoading: isCountriesLoading } = useCountries();
14544
- if (isCountriesLoading)
14545
- return /* @__PURE__ */ jsx208("div", { children: "Loading..." });
14491
+ if (isCountriesLoading) return /* @__PURE__ */ jsx208("div", { children: "Loading..." });
14546
14492
  return /* @__PURE__ */ jsxs139("div", { className: "lg:container mx-auto space-y-6 lg:space-y-10 ", children: [
14547
14493
  /* @__PURE__ */ jsxs139("div", { className: "lg:flex lg:justify-between lg:items-end", children: [
14548
14494
  /* @__PURE__ */ jsx208(H4Design, { className: "pb-4 lg:pb-0", children: "Explore other Farmer Clusters" }),
@@ -15245,8 +15191,7 @@ var SubtitleH3Cluster4Column = ({
15245
15191
  4
15246
15192
  );
15247
15193
  const { data: countries, isLoading: isCountriesLoading } = useCountries2();
15248
- if (isClusterLoading || isCountriesLoading)
15249
- return /* @__PURE__ */ jsx224("div", { children: "Loading..." });
15194
+ if (isClusterLoading || isCountriesLoading) return /* @__PURE__ */ jsx224("div", { children: "Loading..." });
15250
15195
  return /* @__PURE__ */ jsxs154(
15251
15196
  "div",
15252
15197
  {
@@ -16873,7 +16818,7 @@ import { useState as useState56 } from "react";
16873
16818
  import { useForm as useForm18 } from "react-hook-form";
16874
16819
  import { zodResolver as zodResolver3 } from "@hookform/resolvers/zod";
16875
16820
  import * as z3 from "zod";
16876
- import { useRouter as useRouter11 } from "next/router";
16821
+ import { useRouter as useRouter10 } from "next/router";
16877
16822
  import { AccountService } from "@geowiki/api-proxy";
16878
16823
  import { useDefaultSettings } from "@geowiki/core";
16879
16824
  import { jsx as jsx265, jsxs as jsxs170 } from "react/jsx-runtime";
@@ -16897,7 +16842,7 @@ function RegisterForm({
16897
16842
  className
16898
16843
  }) {
16899
16844
  var _a, _b, _c, _d, _e, _f;
16900
- const router = useRouter11();
16845
+ const router = useRouter10();
16901
16846
  const [error, setError] = useState56(null);
16902
16847
  const [isLoading, setIsLoading] = useState56(false);
16903
16848
  const [success, setSuccess] = useState56(false);