@geowiki/core 0.15.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
@@ -274,7 +274,7 @@ import { ProjectService } from "@geowiki/evoland-api-proxy";
274
274
  var useEvolandWmsLayers = () => {
275
275
  return useQuery2({
276
276
  queryKey: [QueryNames.GetAvailableWmsLayers],
277
- queryFn: () => __async(void 0, null, function* () {
277
+ queryFn: () => __async(null, null, function* () {
278
278
  const data = yield ProjectService.getAvailableLayersAvailablelayersGet();
279
279
  return data;
280
280
  })
@@ -306,7 +306,7 @@ import {
306
306
  var useAppConfig = () => {
307
307
  return useQuery3({
308
308
  queryKey: [QueryConstants.GetAppConfig],
309
- queryFn: () => __async(void 0, null, function* () {
309
+ queryFn: () => __async(null, null, function* () {
310
310
  const data = yield AbpApplicationConfigurationService.abpApplicationConfigurationGet();
311
311
  return data;
312
312
  }),
@@ -321,7 +321,7 @@ import { keepPreviousData, useQuery as useQuery4 } from "@tanstack/react-query";
321
321
  var useAudience = () => {
322
322
  return useQuery4({
323
323
  queryKey: [QueryNames.GetAudience],
324
- queryFn: () => __async(void 0, null, function* () {
324
+ queryFn: () => __async(null, null, function* () {
325
325
  const data = yield ResourceService.resourceGetAvailableAudience();
326
326
  return data;
327
327
  }),
@@ -337,7 +337,7 @@ import { useQuery as useQuery5 } from "@tanstack/react-query";
337
337
  var useCluster = (id) => {
338
338
  return useQuery5({
339
339
  queryKey: [QueryNames.Cluster, id],
340
- queryFn: () => __async(void 0, null, function* () {
340
+ queryFn: () => __async(null, null, function* () {
341
341
  const data = yield ClusterService.clusterGet(id);
342
342
  return data;
343
343
  })
@@ -352,7 +352,7 @@ import { useQuery as useQuery6 } from "@tanstack/react-query";
352
352
  var useClusterFilterSettings = () => {
353
353
  return useQuery6({
354
354
  queryKey: [QueryNames.GetClusterFilterSettings],
355
- queryFn: () => __async(void 0, null, function* () {
355
+ queryFn: () => __async(null, null, function* () {
356
356
  var req = yield SettingsService.settingsGetSiteSettings("ClusterFilter");
357
357
  return req;
358
358
  })
@@ -361,7 +361,7 @@ var useClusterFilterSettings = () => {
361
361
  var useConfigSettings = () => {
362
362
  return useQuery6({
363
363
  queryKey: [QueryNames.GetConfig],
364
- queryFn: () => __async(void 0, null, function* () {
364
+ queryFn: () => __async(null, null, function* () {
365
365
  var req = yield SettingsService.settingsGetSiteSettings("Config");
366
366
  return req;
367
367
  })
@@ -374,7 +374,7 @@ import { useQuery as useQuery7 } from "@tanstack/react-query";
374
374
  var useClusterMapInfo = () => {
375
375
  return useQuery7({
376
376
  queryKey: [QueryNames.GetClusterForMap],
377
- queryFn: () => __async(void 0, null, function* () {
377
+ queryFn: () => __async(null, null, function* () {
378
378
  const data = yield ClusterService2.clusterGetMapInfo();
379
379
  return data;
380
380
  })
@@ -387,7 +387,7 @@ import { keepPreviousData as keepPreviousData2, useQuery as useQuery8 } from "@t
387
387
  var useClusters = (fetchAll = false, sort = "", skip = 0, take = 100) => {
388
388
  return useQuery8({
389
389
  queryKey: [QueryNames.Clusters, skip, take],
390
- queryFn: () => __async(void 0, null, function* () {
390
+ queryFn: () => __async(null, null, function* () {
391
391
  if (fetchAll) {
392
392
  const data = yield ClusterService3.clusterGetAllClusters(
393
393
  sort,
@@ -406,7 +406,7 @@ var useClusters = (fetchAll = false, sort = "", skip = 0, take = 100) => {
406
406
  var useAllNewsFromAllClusters = (sort = "", skip = 0, take = 100) => {
407
407
  return useQuery8({
408
408
  queryKey: [QueryNames.GetFarmerClusterNews, sort, skip, take],
409
- queryFn: () => __async(void 0, null, function* () {
409
+ queryFn: () => __async(null, null, function* () {
410
410
  const data = yield ClusterService3.clusterGetAllNewsFromAllClusters(
411
411
  sort,
412
412
  skip,
@@ -419,7 +419,7 @@ var useAllNewsFromAllClusters = (sort = "", skip = 0, take = 100) => {
419
419
 
420
420
  // src/hooks/useHosts.ts
421
421
  import { useQuery as useQuery9 } from "@tanstack/react-query";
422
- var getHosts = () => __async(void 0, null, function* () {
422
+ var getHosts = () => __async(null, null, function* () {
423
423
  const response = yield fetch("/api/hosts");
424
424
  if (!response.ok) {
425
425
  throw new Error("Failed to fetch hosts");
@@ -459,7 +459,7 @@ import { ClusterService as ClusterService4 } from "@geowiki/api-proxy";
459
459
  var useCountries = (fetchAll = false) => {
460
460
  return useQuery10({
461
461
  queryKey: [QueryNames.GetCountries, fetchAll],
462
- queryFn: () => __async(void 0, null, function* () {
462
+ queryFn: () => __async(null, null, function* () {
463
463
  const data = yield ClusterService4.clusterGetCountries(fetchAll);
464
464
  data.sort((a, b) => {
465
465
  if (!a.country || !b.country) {
@@ -510,7 +510,7 @@ var useFileUrl = () => {
510
510
  var useFileUpload = (formData) => {
511
511
  return useQuery11({
512
512
  queryKey: [QueryNames.FileUpload, formData],
513
- queryFn: () => __async(void 0, null, function* () {
513
+ queryFn: () => __async(null, null, function* () {
514
514
  const data = yield FileService.fileUpload(formData);
515
515
  return data;
516
516
  })
@@ -533,7 +533,7 @@ var useFilterClusters = (filter) => {
533
533
  filter.mainAgriculturalAreas,
534
534
  filter.sort
535
535
  ],
536
- queryFn: () => __async(void 0, null, function* () {
536
+ queryFn: () => __async(null, null, function* () {
537
537
  const data = yield ClusterService5.clusterFilter(filter);
538
538
  return data;
539
539
  })
@@ -546,7 +546,7 @@ import { useQuery as useQuery13 } from "@tanstack/react-query";
546
546
  var useGeoWikiSettings = () => {
547
547
  return useQuery13({
548
548
  queryKey: [QueryNames.GetAppSettings],
549
- queryFn: () => __async(void 0, null, function* () {
549
+ queryFn: () => __async(null, null, function* () {
550
550
  var req = yield SettingsService2.settingsGetSiteSettings("GeoWiki");
551
551
  return req;
552
552
  })
@@ -565,7 +565,7 @@ import { useQuery as useQuery14 } from "@tanstack/react-query";
565
565
  var useIntroTourSettings = () => {
566
566
  return useQuery14({
567
567
  queryKey: [QueryNames.GetIntroTour],
568
- queryFn: () => __async(void 0, null, function* () {
568
+ queryFn: () => __async(null, null, function* () {
569
569
  var req = yield SettingsService3.settingsGetSiteSettings("IntroTour");
570
570
  return req;
571
571
  })
@@ -602,7 +602,7 @@ import { keepPreviousData as keepPreviousData3, useQuery as useQuery15 } from "@
602
602
  var useLanguages = () => {
603
603
  return useQuery15({
604
604
  queryKey: [QueryNames.GetLanguages],
605
- queryFn: () => __async(void 0, null, function* () {
605
+ queryFn: () => __async(null, null, function* () {
606
606
  const data = yield ResourceService2.resourceGetAvailableLanguages();
607
607
  return data;
608
608
  }),
@@ -617,7 +617,7 @@ import { useQuery as useQuery16 } from "@tanstack/react-query";
617
617
  var useLayerInfo = (url, layerName) => {
618
618
  return useQuery16({
619
619
  queryKey: [QueryNames.GetUseLayerInfo, url, layerName],
620
- queryFn: () => __async(void 0, null, function* () {
620
+ queryFn: () => __async(null, null, function* () {
621
621
  var legendUrl = url + "?service=WMS&version=1.1.0&request=GetLegendGraphic&layer=" + layerName + "&format=application/json";
622
622
  var res = yield fetch(legendUrl);
623
623
  var data = yield res.json();
@@ -642,7 +642,7 @@ function useLocation() {
642
642
  var useLocationsForProject = (locationreq) => {
643
643
  return useQuery17({
644
644
  queryKey: [QueryConstants.GetLocations, locationreq],
645
- queryFn: () => __async(void 0, null, function* () {
645
+ queryFn: () => __async(null, null, function* () {
646
646
  return ProjectService2.searchLocationsLocationsPost(locationreq);
647
647
  })
648
648
  });
@@ -650,7 +650,7 @@ var useLocationsForProject = (locationreq) => {
650
650
  var useLocationBulkUpload = (uploadLocations, file, project_id, group_id) => {
651
651
  return useQuery17({
652
652
  queryKey: [QueryConstants.UploadLocations, uploadLocations, file, group_id],
653
- queryFn: () => __async(void 0, null, function* () {
653
+ queryFn: () => __async(null, null, function* () {
654
654
  try {
655
655
  const res = yield LocationService.bulkUploadLocationsUploadlocationsPost({ file, project_id, group_id });
656
656
  return res;
@@ -664,7 +664,7 @@ var useLocationBulkUpload = (uploadLocations, file, project_id, group_id) => {
664
664
  var useTaskBulkUpload = (uploadTasks, file, project_id) => {
665
665
  return useQuery17({
666
666
  queryKey: [QueryConstants.UploadTasks, uploadTasks, file],
667
- queryFn: () => __async(void 0, null, function* () {
667
+ queryFn: () => __async(null, null, function* () {
668
668
  try {
669
669
  return LocationService.uploadLocationTaskUploadlocationtaskPost({ file, project_id });
670
670
  } catch (error) {
@@ -677,7 +677,7 @@ var useTaskBulkUpload = (uploadTasks, file, project_id) => {
677
677
  var useReviewTaskBulkUpload = (uploadReviewTasks, file, project_id) => {
678
678
  return useQuery17({
679
679
  queryKey: [QueryConstants.UploadReviewTasks, uploadReviewTasks, file],
680
- queryFn: () => __async(void 0, null, function* () {
680
+ queryFn: () => __async(null, null, function* () {
681
681
  try {
682
682
  return LocationService.bulkUploadReviewTasksUploadreviewtasksPost({ file, project_id });
683
683
  } catch (error) {
@@ -710,7 +710,7 @@ import { NewsService } from "@geowiki/api-proxy";
710
710
  var useNews = (lang = "all", skip = 0, take = 100) => {
711
711
  return useQuery19({
712
712
  queryKey: [QueryNames.GetNews, lang, skip, take],
713
- queryFn: () => __async(void 0, null, function* () {
713
+ queryFn: () => __async(null, null, function* () {
714
714
  if (lang == "all") {
715
715
  const res2 = yield NewsService.newsGetExternalNews("", skip, take);
716
716
  return res2.items;
@@ -793,7 +793,7 @@ import { useQuery as useQuery20 } from "@tanstack/react-query";
793
793
  var usePublicationSettings = () => {
794
794
  return useQuery20({
795
795
  queryKey: [QueryNames.GetPublicationSettings],
796
- queryFn: () => __async(void 0, null, function* () {
796
+ queryFn: () => __async(null, null, function* () {
797
797
  var req = yield SettingsService5.settingsGetSiteSettings("Publication");
798
798
  return req;
799
799
  })
@@ -806,7 +806,7 @@ import { keepPreviousData as keepPreviousData5, useQuery as useQuery21 } from "@
806
806
  var useResource = (search = "", sort = "", skip = 0, take = 100) => {
807
807
  return useQuery21({
808
808
  queryKey: [QueryNames.GetResource, search, sort, skip, take],
809
- queryFn: () => __async(void 0, null, function* () {
809
+ queryFn: () => __async(null, null, function* () {
810
810
  if (search !== "") {
811
811
  const data2 = yield ResourceService3.resourceSearch(search);
812
812
  return data2;
@@ -838,7 +838,7 @@ var useResourceFilter = (filter) => {
838
838
  filter.sorting,
839
839
  filter.isFramework
840
840
  ],
841
- queryFn: () => __async(void 0, null, function* () {
841
+ queryFn: () => __async(null, null, function* () {
842
842
  const data = yield ResourceService4.resourceFilter(filter);
843
843
  return data;
844
844
  })
@@ -851,7 +851,7 @@ import { useQuery as useQuery23 } from "@tanstack/react-query";
851
851
  var useResourceType = () => {
852
852
  return useQuery23({
853
853
  queryKey: [QueryNames.GetResourceType],
854
- queryFn: () => __async(void 0, null, function* () {
854
+ queryFn: () => __async(null, null, function* () {
855
855
  var data = yield ResourceService5.resourceGetAvailableResourceType();
856
856
  return data;
857
857
  })
@@ -864,7 +864,7 @@ import { keepPreviousData as keepPreviousData6, useQuery as useQuery24 } from "@
864
864
  var useTopic = () => {
865
865
  return useQuery24({
866
866
  queryKey: [QueryNames.GetTopic],
867
- queryFn: () => __async(void 0, null, function* () {
867
+ queryFn: () => __async(null, null, function* () {
868
868
  var data = yield ResourceService6.resourceGetAvailableTopic();
869
869
  return data;
870
870
  }),
@@ -880,7 +880,7 @@ import { ProfileService } from "@geowiki/api-proxy";
880
880
  var useUserProfileGet = () => {
881
881
  return useQuery25({
882
882
  queryKey: [QueryNames.GetUserProfile],
883
- queryFn: () => __async(void 0, null, function* () {
883
+ queryFn: () => __async(null, null, function* () {
884
884
  var data = yield ProfileService.profileGet();
885
885
  return data;
886
886
  })
@@ -893,7 +893,7 @@ import { UserService } from "@geowiki/api-proxy";
893
893
  var useUsers = (pageIndex, pageSize, filter, sorting) => {
894
894
  return useQuery26({
895
895
  queryKey: [QueryConstants.GetUsers, pageIndex, pageSize, filter, sorting],
896
- queryFn: () => __async(void 0, null, function* () {
896
+ queryFn: () => __async(null, null, function* () {
897
897
  let skip = 0;
898
898
  if (pageIndex > 0) {
899
899
  skip = pageIndex * pageSize;
@@ -937,7 +937,7 @@ import { useQuery as useQuery27 } from "@tanstack/react-query";
937
937
  var useDefaultSettings = () => {
938
938
  return useQuery27({
939
939
  queryKey: [QueryNames.DefaultSettings],
940
- queryFn: () => __async(void 0, null, function* () {
940
+ queryFn: () => __async(null, null, function* () {
941
941
  const req = yield SettingsService6.settingsGetDefaultSiteSettings();
942
942
  return req;
943
943
  })
@@ -956,7 +956,7 @@ import { useQuery as useQuery28 } from "@tanstack/react-query";
956
956
  var useEmailing = () => {
957
957
  return useQuery28({
958
958
  queryKey: [QueryConstants.GetEmailing],
959
- queryFn: () => __async(void 0, null, function* () {
959
+ queryFn: () => __async(null, null, function* () {
960
960
  const data = yield EmailSettingsService.emailSettingsGet();
961
961
  return data;
962
962
  })
@@ -986,7 +986,7 @@ import { useQuery as useQuery29 } from "@tanstack/react-query";
986
986
  var useFeatures = (providerName, providerKey) => {
987
987
  return useQuery29({
988
988
  queryKey: [QueryConstants.GetFeatures, providerName, providerKey],
989
- queryFn: () => __async(void 0, null, function* () {
989
+ queryFn: () => __async(null, null, function* () {
990
990
  const data = yield FeaturesService.featuresGet(providerName, providerKey);
991
991
  return data;
992
992
  })
@@ -999,7 +999,7 @@ import { UserService as UserService2 } from "@geowiki/api-proxy";
999
999
  var useAssignableRoles = () => {
1000
1000
  return useQuery30({
1001
1001
  queryKey: [QueryConstants.GetAssignableRoles],
1002
- queryFn: () => __async(void 0, null, function* () {
1002
+ queryFn: () => __async(null, null, function* () {
1003
1003
  const data = yield UserService2.userGetAssignableRoles();
1004
1004
  return data;
1005
1005
  })
@@ -1012,7 +1012,7 @@ import { useQuery as useQuery31 } from "@tanstack/react-query";
1012
1012
  var useUserRoles = ({ userId }) => {
1013
1013
  return useQuery31({
1014
1014
  queryKey: [QueryConstants.GetUserRoles, userId],
1015
- queryFn: () => __async(void 0, null, function* () {
1015
+ queryFn: () => __async(null, null, function* () {
1016
1016
  const data = yield UserService3.userGetRoles(userId);
1017
1017
  return data;
1018
1018
  })
@@ -1027,7 +1027,7 @@ import { useQuery as useQuery32 } from "@tanstack/react-query";
1027
1027
  var usePermissions = (providerName, providerKey) => {
1028
1028
  return useQuery32({
1029
1029
  queryKey: [QueryConstants.GetPermissions, providerName, providerKey],
1030
- queryFn: () => __async(void 0, null, function* () {
1030
+ queryFn: () => __async(null, null, function* () {
1031
1031
  const data = yield PermissionsService.permissionsGet(
1032
1032
  providerName,
1033
1033
  providerKey
@@ -1043,7 +1043,7 @@ import { RoleService } from "@geowiki/api-proxy";
1043
1043
  var useRoles = (pageIndex, pageSize, filter, sorting) => {
1044
1044
  return useQuery33({
1045
1045
  queryKey: [QueryConstants.GetRoles, pageIndex, pageSize, filter, sorting],
1046
- queryFn: () => __async(void 0, null, function* () {
1046
+ queryFn: () => __async(null, null, function* () {
1047
1047
  let skip = 0;
1048
1048
  if (pageIndex > 0) {
1049
1049
  skip = pageIndex * pageSize;
@@ -1065,7 +1065,7 @@ import { useQuery as useQuery34 } from "@tanstack/react-query";
1065
1065
  var useProfile = () => {
1066
1066
  return useQuery34({
1067
1067
  queryKey: [QueryConstants.GetProfile],
1068
- queryFn: () => __async(void 0, null, function* () {
1068
+ queryFn: () => __async(null, null, function* () {
1069
1069
  const data = yield ProfileService2.profileGet();
1070
1070
  return data;
1071
1071
  })
@@ -1078,7 +1078,7 @@ import { TenantService } from "@geowiki/api-proxy";
1078
1078
  var useTenants = (pageIndex, pageSize, filter, sorting) => {
1079
1079
  return useQuery35({
1080
1080
  queryKey: [QueryConstants.GetTenants, pageIndex, pageSize, filter, sorting],
1081
- queryFn: () => __async(void 0, null, function* () {
1081
+ queryFn: () => __async(null, null, function* () {
1082
1082
  let skip = 0;
1083
1083
  if (pageIndex > 0) {
1084
1084
  skip = pageIndex * pageSize;
@@ -1100,7 +1100,7 @@ import { ProjectService as ProjectService3 } from "@geowiki/evoland-api-proxy";
1100
1100
  var useEvolandLabels = (projectId) => {
1101
1101
  return useQuery36({
1102
1102
  queryKey: [QueryNames.GetEvolandLabels, projectId],
1103
- queryFn: () => __async(void 0, null, function* () {
1103
+ queryFn: () => __async(null, null, function* () {
1104
1104
  const data = yield ProjectService3.getLabelsLabelsProjectIdProjectIdGet(projectId);
1105
1105
  return data;
1106
1106
  })
@@ -1114,7 +1114,7 @@ var useLookUp = (ServiceName, params, LookUpsClusterCountries, LookUpsClusterAct
1114
1114
  let result;
1115
1115
  return useQuery37({
1116
1116
  queryKey: [QueryNames.GetLookUp, ServiceName, params],
1117
- queryFn: () => __async(void 0, null, function* () {
1117
+ queryFn: () => __async(null, null, function* () {
1118
1118
  switch (ServiceName) {
1119
1119
  case LookUpsClusterCountries: {
1120
1120
  result = yield ClusterService6.clusterGetCountries(params);
@@ -1154,7 +1154,7 @@ import {
1154
1154
  var useProjects = (fetch2, start = 0, amount = 9) => {
1155
1155
  return useQuery38({
1156
1156
  queryKey: [QueryConstants.GetProjects, fetch2, start, amount],
1157
- queryFn: () => __async(void 0, null, function* () {
1157
+ queryFn: () => __async(null, null, function* () {
1158
1158
  if (fetch2)
1159
1159
  return ProjectService4.listProjectsListprojectsStartidxStartidxAmountAmountGet(
1160
1160
  start,
@@ -1166,7 +1166,7 @@ var useProjects = (fetch2, start = 0, amount = 9) => {
1166
1166
  var useProjectDetails = (projectId, update) => {
1167
1167
  return useQuery38({
1168
1168
  queryKey: [QueryConstants.GetProjectDetails, projectId, update],
1169
- queryFn: () => __async(void 0, null, function* () {
1169
+ queryFn: () => __async(null, null, function* () {
1170
1170
  return ProjectService4.projectInfoProjectinfoProjectIdProjectIdGet(
1171
1171
  projectId
1172
1172
  );
@@ -1176,7 +1176,7 @@ var useProjectDetails = (projectId, update) => {
1176
1176
  var useTasksPerLocation = (data) => {
1177
1177
  return useQuery38({
1178
1178
  queryKey: [QueryConstants.GetTasksPerLocation, data],
1179
- queryFn: () => __async(void 0, null, function* () {
1179
+ queryFn: () => __async(null, null, function* () {
1180
1180
  return ProjectService4.getTasksTasksGet(
1181
1181
  data.locationProjectId,
1182
1182
  data.taskForReview,
@@ -1204,7 +1204,7 @@ var useTasksPerLocation = (data) => {
1204
1204
  var useRandomTasksPerLocation = (data) => {
1205
1205
  return useQuery38({
1206
1206
  queryKey: [QueryConstants.GetTasksPerLocation, data],
1207
- queryFn: () => __async(void 0, null, function* () {
1207
+ queryFn: () => __async(null, null, function* () {
1208
1208
  return ProjectService4.getRandomTaskRandomtaskGet(
1209
1209
  data.locationProjectId,
1210
1210
  data.taskForReview,
@@ -1231,7 +1231,7 @@ var useRandomTasksPerLocation = (data) => {
1231
1231
  var useTaskComments = (taskIds) => {
1232
1232
  return useQuery38({
1233
1233
  queryKey: [QueryConstants.GetTaskComment, taskIds],
1234
- queryFn: () => __async(void 0, null, function* () {
1234
+ queryFn: () => __async(null, null, function* () {
1235
1235
  return TaskService.taskLatestComomentsTasklatestcommentPost({
1236
1236
  task_ids: taskIds
1237
1237
  });
@@ -1241,7 +1241,7 @@ var useTaskComments = (taskIds) => {
1241
1241
  var useGroupsInProject = (projectId, updateGroup) => {
1242
1242
  return useQuery38({
1243
1243
  queryKey: [QueryConstants.GetGroupsInProject, projectId, updateGroup],
1244
- queryFn: () => __async(void 0, null, function* () {
1244
+ queryFn: () => __async(null, null, function* () {
1245
1245
  return ProjectService4.getProjectGroupsProjectgroupsProjectIdProjectIdGet(
1246
1246
  projectId
1247
1247
  );
@@ -1251,7 +1251,7 @@ var useGroupsInProject = (projectId, updateGroup) => {
1251
1251
  var useProjectUsers = (projectId) => {
1252
1252
  return useQuery38({
1253
1253
  queryKey: [QueryConstants.GetProjectUsers, projectId],
1254
- queryFn: () => __async(void 0, null, function* () {
1254
+ queryFn: () => __async(null, null, function* () {
1255
1255
  return ProjectService4.projectAllUsersProjectusersProjectIdProjectIdGet(
1256
1256
  projectId
1257
1257
  );
@@ -1261,7 +1261,7 @@ var useProjectUsers = (projectId) => {
1261
1261
  var useTaskStatusList = () => {
1262
1262
  return useQuery38({
1263
1263
  queryKey: [QueryConstants.GetTaskStatusList],
1264
- queryFn: () => __async(void 0, null, function* () {
1264
+ queryFn: () => __async(null, null, function* () {
1265
1265
  return TaskService.getTaskStatusesTaskstatusesGet();
1266
1266
  })
1267
1267
  });
@@ -1274,7 +1274,7 @@ var useUpdateActiveGroupInProject = (projectId, groupId, update) => {
1274
1274
  groupId,
1275
1275
  update
1276
1276
  ],
1277
- queryFn: () => __async(void 0, null, function* () {
1277
+ queryFn: () => __async(null, null, function* () {
1278
1278
  if (update)
1279
1279
  return ProjectService4.selectProjectGroupProjectselectgroupPost({
1280
1280
  project_id: projectId,
@@ -1286,7 +1286,7 @@ var useUpdateActiveGroupInProject = (projectId, groupId, update) => {
1286
1286
  var useTaskAnnotation = (taskId) => {
1287
1287
  return useQuery38({
1288
1288
  queryKey: [QueryConstants.GetTaskAnnotation, taskId],
1289
- queryFn: () => __async(void 0, null, function* () {
1289
+ queryFn: () => __async(null, null, function* () {
1290
1290
  if (taskId !== null && taskId !== 0 && taskId !== void 0)
1291
1291
  return TaskService.getTaskAnnotationAssetTaskannotationTaskIdTaskIdGet(
1292
1292
  taskId
@@ -1297,7 +1297,7 @@ var useTaskAnnotation = (taskId) => {
1297
1297
  var useTaskMultipleAnnotations = (taskId) => {
1298
1298
  return useQuery38({
1299
1299
  queryKey: [QueryConstants.GetTaskMultipleAnnotations, taskId],
1300
- queryFn: () => __async(void 0, null, function* () {
1300
+ queryFn: () => __async(null, null, function* () {
1301
1301
  if (taskId !== null && taskId !== 0 && taskId !== void 0)
1302
1302
  return TaskService.getTaskAnnotationAssetsTaskannotationsTaskIdTaskIdGet(
1303
1303
  taskId
@@ -1308,7 +1308,7 @@ var useTaskMultipleAnnotations = (taskId) => {
1308
1308
  var useTaskSavedAnnotations = (taskId) => {
1309
1309
  return useQuery38({
1310
1310
  queryKey: [QueryConstants.GetTaskSavedAnnotations, taskId],
1311
- queryFn: () => __async(void 0, null, function* () {
1311
+ queryFn: () => __async(null, null, function* () {
1312
1312
  if (taskId !== null && taskId !== 0 && taskId !== void 0)
1313
1313
  return TaskService.getSavedAnnotationGetsavedannotationTaskIdTaskIdGet(
1314
1314
  taskId
@@ -1319,7 +1319,7 @@ var useTaskSavedAnnotations = (taskId) => {
1319
1319
  var useTaskDelete = (taskId, projectId, deleteTask) => {
1320
1320
  return useQuery38({
1321
1321
  queryKey: [QueryConstants.DeleteTask, taskId, projectId, deleteTask],
1322
- queryFn: () => __async(void 0, null, function* () {
1322
+ queryFn: () => __async(null, null, function* () {
1323
1323
  if (taskId !== null && taskId !== void 0 && taskId !== 0 && deleteTask === true)
1324
1324
  return TaskService.deleteTaskDeletetaskPost({
1325
1325
  project_id: projectId,
@@ -1337,7 +1337,7 @@ var useProjectStatisticsByUser = (projectId, startDate, endDate, filterUserId) =
1337
1337
  endDate,
1338
1338
  filterUserId
1339
1339
  ],
1340
- queryFn: () => __async(void 0, null, function* () {
1340
+ queryFn: () => __async(null, null, function* () {
1341
1341
  return StatisticService.getUserStatisticsUserstatisticsProjectIdProjectIdStartDateStartDateEndDateEndDateFilterUserIdFilterUserIdGet(
1342
1342
  projectId,
1343
1343
  endDate,
@@ -1356,7 +1356,7 @@ var useContractStatisticsByUser = (projectId, startDate, endDate, filterUserId)
1356
1356
  endDate,
1357
1357
  filterUserId
1358
1358
  ],
1359
- queryFn: () => __async(void 0, null, function* () {
1359
+ queryFn: () => __async(null, null, function* () {
1360
1360
  return StatisticService.getUserStatisticsUserstatisticsProjectIdProjectIdStartDateStartDateEndDateEndDateFilterUserIdFilterUserIdGet(
1361
1361
  projectId,
1362
1362
  endDate,
@@ -1375,7 +1375,7 @@ var useLatestTaskOnLocation = (locationId, projectId, referenceDate) => {
1375
1375
  projectId,
1376
1376
  referenceDate
1377
1377
  ],
1378
- queryFn: () => __async(void 0, null, function* () {
1378
+ queryFn: () => __async(null, null, function* () {
1379
1379
  return ProjectService4.locationLatestTaskLocationtaskLocationIdLocationIdProjectIdProjectIdReferenceDateReferenceDateGet(
1380
1380
  locationId,
1381
1381
  projectId,
@@ -1387,7 +1387,7 @@ var useLatestTaskOnLocation = (locationId, projectId, referenceDate) => {
1387
1387
  var useAssignProjectToUser = (userRoleRequest, update) => {
1388
1388
  return useQuery38({
1389
1389
  queryKey: [QueryConstants.GetProjectDetails, userRoleRequest, update],
1390
- queryFn: () => __async(void 0, null, function* () {
1390
+ queryFn: () => __async(null, null, function* () {
1391
1391
  if (update)
1392
1392
  return ProjectService4.setUserRoleSetuserrolePost(userRoleRequest);
1393
1393
  }),
@@ -1397,7 +1397,7 @@ var useAssignProjectToUser = (userRoleRequest, update) => {
1397
1397
  var useGetUserProject = (user_id, fetchData) => {
1398
1398
  return useQuery38({
1399
1399
  queryKey: [QueryConstants.GetUserProject, user_id, fetchData],
1400
- queryFn: () => __async(void 0, null, function* () {
1400
+ queryFn: () => __async(null, null, function* () {
1401
1401
  if (fetchData)
1402
1402
  return ProjectService4.getUserRoleProjectGetuserroleprojectUserIdUserIdGet(
1403
1403
  user_id
@@ -1408,7 +1408,7 @@ var useGetUserProject = (user_id, fetchData) => {
1408
1408
  var useUpdateUserDetail = (userDetailRequest, update) => {
1409
1409
  return useQuery38({
1410
1410
  queryKey: [QueryConstants.SetUserDetail, userDetailRequest, update],
1411
- queryFn: () => __async(void 0, null, function* () {
1411
+ queryFn: () => __async(null, null, function* () {
1412
1412
  if (update)
1413
1413
  return ProjectService4.setUserDetailSetuserdetailPost(userDetailRequest);
1414
1414
  })
@@ -1422,7 +1422,7 @@ var useProjectsPointsDownload = (projectId, download, userRole) => {
1422
1422
  download,
1423
1423
  userRole
1424
1424
  ],
1425
- queryFn: () => __async(void 0, null, function* () {
1425
+ queryFn: () => __async(null, null, function* () {
1426
1426
  if (userRole == "admin" && download)
1427
1427
  return ProjectService4.getLocationsSummaryLocationssummaryProjectIdProjectIdGet(
1428
1428
  projectId
@@ -1433,7 +1433,7 @@ var useProjectsPointsDownload = (projectId, download, userRole) => {
1433
1433
  var useQuestionnaire = (projectId) => {
1434
1434
  return useQuery38({
1435
1435
  queryKey: [QueryConstants.GetQuestionnaireForProject, projectId],
1436
- queryFn: () => __async(void 0, null, function* () {
1436
+ queryFn: () => __async(null, null, function* () {
1437
1437
  return QuestionService.getProjectQuestionsAnswersQuestionsAnswersProjectIdProjectIdGet(
1438
1438
  projectId
1439
1439
  );
@@ -1443,7 +1443,7 @@ var useQuestionnaire = (projectId) => {
1443
1443
  var useTaskAnswers = (taskId) => {
1444
1444
  return useQuery38({
1445
1445
  queryKey: [QueryConstants.GetTaskAnswers, taskId],
1446
- queryFn: () => __async(void 0, null, function* () {
1446
+ queryFn: () => __async(null, null, function* () {
1447
1447
  return TaskService.getTaskAnswersTaskanswersTaskIdTaskIdGet(taskId);
1448
1448
  })
1449
1449
  });
@@ -1451,7 +1451,7 @@ var useTaskAnswers = (taskId) => {
1451
1451
  var useProjectResultSet = (download, projectId, is_geo_json) => {
1452
1452
  return useQuery38({
1453
1453
  queryKey: [QueryConstants.GetProjectResultSet, download, projectId, is_geo_json],
1454
- queryFn: () => __async(void 0, null, function* () {
1454
+ queryFn: () => __async(null, null, function* () {
1455
1455
  return ProjectService4.projectResultSetProjectresultsetProjectIdProjectIdIsGeoJsonIsGeoJsonGet(projectId, is_geo_json);
1456
1456
  }),
1457
1457
  enabled: !!download && !!projectId
@@ -1463,7 +1463,7 @@ import { useQuery as useQuery39 } from "@tanstack/react-query";
1463
1463
  var useApiImage = (imageId) => {
1464
1464
  return useQuery39({
1465
1465
  queryKey: [QueryConstants.GetApiImage, imageId],
1466
- queryFn: () => __async(void 0, null, function* () {
1466
+ queryFn: () => __async(null, null, function* () {
1467
1467
  const res = yield fetch(`/api/api-image/${imageId}`);
1468
1468
  const data = yield res.json();
1469
1469
  return data.fileUrl;
@@ -1476,7 +1476,7 @@ import { useQuery as useQuery40 } from "@tanstack/react-query";
1476
1476
  var useCmsImage = (imageId) => {
1477
1477
  return useQuery40({
1478
1478
  queryKey: [QueryConstants.GetCmsImage, imageId],
1479
- queryFn: () => __async(void 0, null, function* () {
1479
+ queryFn: () => __async(null, null, function* () {
1480
1480
  const res = yield fetch(`/api/cms-image/${imageId}`);
1481
1481
  const data = yield res.json();
1482
1482
  return data.fileUrl;
@@ -1490,7 +1490,7 @@ import { useQuery as useQuery41 } from "@tanstack/react-query";
1490
1490
  var useClusterGetJoinRequests = (clusterId) => {
1491
1491
  return useQuery41({
1492
1492
  queryKey: [QueryNames.JoinRequests, clusterId],
1493
- queryFn: () => __async(void 0, null, function* () {
1493
+ queryFn: () => __async(null, null, function* () {
1494
1494
  const data = yield ClusterService7.clusterGetJoinRequests(clusterId);
1495
1495
  return data;
1496
1496
  })
@@ -1503,7 +1503,7 @@ import { useQuery as useQuery42 } from "@tanstack/react-query";
1503
1503
  var useClusterGetNews = (clusterId, newsId) => {
1504
1504
  return useQuery42({
1505
1505
  queryKey: [QueryNames.ClusterGetNews, clusterId, newsId],
1506
- queryFn: () => __async(void 0, null, function* () {
1506
+ queryFn: () => __async(null, null, function* () {
1507
1507
  const data = yield ClusterService8.clusterGetNews(clusterId, newsId);
1508
1508
  return data;
1509
1509
  })
@@ -1516,7 +1516,7 @@ import { useQuery as useQuery43 } from "@tanstack/react-query";
1516
1516
  var useClusterGetNewsNextPreviousStatus = (clusterId, newsId) => {
1517
1517
  return useQuery43({
1518
1518
  queryKey: [QueryNames.ClusterNewsNextPrevious, clusterId, newsId],
1519
- queryFn: () => __async(void 0, null, function* () {
1519
+ queryFn: () => __async(null, null, function* () {
1520
1520
  const data = yield ClusterService9.clusterGetNewsNextPreviousStatus(
1521
1521
  clusterId,
1522
1522
  newsId
@@ -1532,7 +1532,7 @@ import { useQuery as useQuery44 } from "@tanstack/react-query";
1532
1532
  var useClusterImages = (id) => {
1533
1533
  return useQuery44({
1534
1534
  queryKey: [QueryNames.ClusterImages, id],
1535
- queryFn: () => __async(void 0, null, function* () {
1535
+ queryFn: () => __async(null, null, function* () {
1536
1536
  const data = yield ClusterService10.clusterGetClusterImages(id);
1537
1537
  return data;
1538
1538
  })
@@ -1545,7 +1545,7 @@ import { useQuery as useQuery45 } from "@tanstack/react-query";
1545
1545
  var useClusterOverview = (id) => {
1546
1546
  return useQuery45({
1547
1547
  queryKey: [QueryNames.GetClusterOverview, id],
1548
- queryFn: () => __async(void 0, null, function* () {
1548
+ queryFn: () => __async(null, null, function* () {
1549
1549
  const data = yield ClusterService11.clusterGetClusterOverview(id);
1550
1550
  return data;
1551
1551
  })
@@ -1566,7 +1566,7 @@ var useClusterAllNews = (id, refresh, sorting, skipCount, maxResultCount, status
1566
1566
  refresh,
1567
1567
  status
1568
1568
  ],
1569
- queryFn: () => __async(void 0, null, function* () {
1569
+ queryFn: () => __async(null, null, function* () {
1570
1570
  const data = yield ClusterService12.clusterGetAllNews(
1571
1571
  id,
1572
1572
  sorting,
@@ -1585,7 +1585,7 @@ import { useQuery as useQuery47 } from "@tanstack/react-query";
1585
1585
  var useNewsFromAllClusters = (skip = 0, take = 10) => {
1586
1586
  return useQuery47({
1587
1587
  queryKey: [QueryNames.ClusterAllNews, skip, take],
1588
- queryFn: () => __async(void 0, null, function* () {
1588
+ queryFn: () => __async(null, null, function* () {
1589
1589
  const data = yield ClusterService13.clusterGetAllNewsFromAllClusters(
1590
1590
  "",
1591
1591
  skip,
@@ -1602,7 +1602,7 @@ import { useQuery as useQuery48 } from "@tanstack/react-query";
1602
1602
  var useClusterNewsWithId = (id) => {
1603
1603
  return useQuery48({
1604
1604
  queryKey: [QueryNames.ClusterNewsWithId, id],
1605
- queryFn: () => __async(void 0, null, function* () {
1605
+ queryFn: () => __async(null, null, function* () {
1606
1606
  const data = yield ClusterService14.clusterGetClusterNewsById(id);
1607
1607
  return data;
1608
1608
  })
@@ -1617,15 +1617,15 @@ import {
1617
1617
  QueryApiService,
1618
1618
  SettingsService as SettingsService7
1619
1619
  } from "@geowiki/cms-proxy";
1620
- var getGeoWikiSettings = () => __async(void 0, null, function* () {
1620
+ var getGeoWikiSettings = () => __async(null, null, function* () {
1621
1621
  const req = yield SettingsService7.settingsGetSiteSettings("GeoWiki");
1622
1622
  return req;
1623
1623
  });
1624
- var getDefaultSettings = () => __async(void 0, null, function* () {
1624
+ var getDefaultSettings = () => __async(null, null, function* () {
1625
1625
  const req = yield SettingsService7.settingsGetDefaultSiteSettings();
1626
1626
  return req;
1627
1627
  });
1628
- var getMenus = (displayName) => __async(void 0, null, function* () {
1628
+ var getMenus = (displayName) => __async(null, null, function* () {
1629
1629
  const req = yield getContentWithTypeAndDisplayName(
1630
1630
  "Menu",
1631
1631
  displayName
@@ -1633,7 +1633,7 @@ var getMenus = (displayName) => __async(void 0, null, function* () {
1633
1633
  const menus = req == null ? void 0 : req.items[0];
1634
1634
  return menus;
1635
1635
  });
1636
- var getPageContent = (displayName) => __async(void 0, null, function* () {
1636
+ var getPageContent = (displayName) => __async(null, null, function* () {
1637
1637
  const req = yield getContentWithTypeAndDisplayName(
1638
1638
  "Page",
1639
1639
  displayName
@@ -1641,27 +1641,27 @@ var getPageContent = (displayName) => __async(void 0, null, function* () {
1641
1641
  const page = req == null ? void 0 : req.items[0];
1642
1642
  return page;
1643
1643
  });
1644
- var getContentWithTypeAndDisplayName = (contentType, displayName) => __async(void 0, null, function* () {
1644
+ var getContentWithTypeAndDisplayName = (contentType, displayName) => __async(null, null, function* () {
1645
1645
  return QueryApiService.apiQueryGet(
1646
1646
  "GetContentByTypeAndDisplayText",
1647
1647
  `${JSON.stringify({ contenttype: contentType, displaytext: displayName })}`
1648
1648
  );
1649
1649
  });
1650
- var getContentWithSlug = (slug) => __async(void 0, null, function* () {
1650
+ var getContentWithSlug = (slug) => __async(null, null, function* () {
1651
1651
  const req = yield QueryApiService.apiQueryGet(
1652
1652
  "GetDocumentBySlug",
1653
1653
  `${JSON.stringify({ path: slug })}`
1654
1654
  );
1655
1655
  return req == null ? void 0 : req.items[0];
1656
1656
  });
1657
- var getContentsWithType = (contentType) => __async(void 0, null, function* () {
1657
+ var getContentsWithType = (contentType) => __async(null, null, function* () {
1658
1658
  const req = yield QueryApiService.apiQueryGet(
1659
1659
  "GetContentByType",
1660
1660
  `${JSON.stringify({ contenttype: contentType })}`
1661
1661
  );
1662
1662
  return req == null ? void 0 : req.items;
1663
1663
  });
1664
- var getPageProps = (ctx) => __async(void 0, null, function* () {
1664
+ var getPageProps = (ctx) => __async(null, null, function* () {
1665
1665
  var _a;
1666
1666
  var page = "index";
1667
1667
  const slugs = ctx.query.slug;
@@ -1679,7 +1679,7 @@ var getPageProps = (ctx) => __async(void 0, null, function* () {
1679
1679
  var useMapMenuItems = () => {
1680
1680
  return useQuery49({
1681
1681
  queryKey: [QueryNames.MapMenuItems],
1682
- queryFn: () => __async(void 0, null, function* () {
1682
+ queryFn: () => __async(null, null, function* () {
1683
1683
  const req = yield getContentsWithType("MapMenuItem");
1684
1684
  return req;
1685
1685
  })
@@ -1692,7 +1692,7 @@ import { useQuery as useQuery50 } from "@tanstack/react-query";
1692
1692
  var useClusterLinks = (id) => {
1693
1693
  return useQuery50({
1694
1694
  queryKey: [QueryNames.GetSocialLinks, id],
1695
- queryFn: () => __async(void 0, null, function* () {
1695
+ queryFn: () => __async(null, null, function* () {
1696
1696
  const data = yield ClusterService15.clusterGetLinksAndPartner(id);
1697
1697
  return data;
1698
1698
  })
@@ -1704,7 +1704,7 @@ import { useQuery as useQuery51 } from "@tanstack/react-query";
1704
1704
  var useCmsContentWithType = (contentType) => {
1705
1705
  return useQuery51({
1706
1706
  queryKey: [QueryNames.GetCmsContentWithType],
1707
- queryFn: () => __async(void 0, null, function* () {
1707
+ queryFn: () => __async(null, null, function* () {
1708
1708
  const req = yield getContentsWithType(contentType);
1709
1709
  return req;
1710
1710
  })
@@ -1717,7 +1717,7 @@ import { useQuery as useQuery52 } from "@tanstack/react-query";
1717
1717
  var useClusterNews = (id, sort = "", skip = 0, take = 100) => {
1718
1718
  return useQuery52({
1719
1719
  queryKey: [QueryNames.ClusterNews, id, sort, skip, take],
1720
- queryFn: () => __async(void 0, null, function* () {
1720
+ queryFn: () => __async(null, null, function* () {
1721
1721
  const data = yield ClusterService16.clusterGetClusterNews(
1722
1722
  id,
1723
1723
  sort,
@@ -1735,7 +1735,7 @@ import { useQuery as useQuery53 } from "@tanstack/react-query";
1735
1735
  var useClusterDescription = (id) => {
1736
1736
  return useQuery53({
1737
1737
  queryKey: [QueryNames.GetClusterDescription, id],
1738
- queryFn: () => __async(void 0, null, function* () {
1738
+ queryFn: () => __async(null, null, function* () {
1739
1739
  const data = yield ClusterService17.clusterGetClusterDescription(id);
1740
1740
  return data;
1741
1741
  })
@@ -1748,7 +1748,7 @@ import { useQuery as useQuery54 } from "@tanstack/react-query";
1748
1748
  var useClusterDetails = (id) => {
1749
1749
  return useQuery54({
1750
1750
  queryKey: [QueryNames.GetClusterDetails, id],
1751
- queryFn: () => __async(void 0, null, function* () {
1751
+ queryFn: () => __async(null, null, function* () {
1752
1752
  const data = yield ClusterService18.clusterGetClusterDetails(id);
1753
1753
  return data;
1754
1754
  })
@@ -1761,7 +1761,7 @@ import { useQuery as useQuery55 } from "@tanstack/react-query";
1761
1761
  var useClusterImagesAndVideos = (id) => {
1762
1762
  return useQuery55({
1763
1763
  queryKey: [QueryNames.GetImagesAndVideos, id],
1764
- queryFn: () => __async(void 0, null, function* () {
1764
+ queryFn: () => __async(null, null, function* () {
1765
1765
  const data = yield ClusterService19.clusterGetImagesAndVideos(id);
1766
1766
  return data;
1767
1767
  })
@@ -1770,7 +1770,7 @@ var useClusterImagesAndVideos = (id) => {
1770
1770
 
1771
1771
  // src/hooks/useHost.ts
1772
1772
  import { useQuery as useQuery56 } from "@tanstack/react-query";
1773
- var getHost = () => __async(void 0, null, function* () {
1773
+ var getHost = () => __async(null, null, function* () {
1774
1774
  const response = yield fetch("/api/host");
1775
1775
  if (!response.ok) {
1776
1776
  return Promise.reject(null);
@@ -1786,7 +1786,7 @@ function useHost() {
1786
1786
 
1787
1787
  // src/hooks/useHostManagement.ts
1788
1788
  import { useMutation, useQueryClient } from "@tanstack/react-query";
1789
- var createHost = (hostData) => __async(void 0, null, function* () {
1789
+ var createHost = (hostData) => __async(null, null, function* () {
1790
1790
  const response = yield fetch("/api/hosts", {
1791
1791
  method: "POST",
1792
1792
  headers: {
@@ -1799,7 +1799,7 @@ var createHost = (hostData) => __async(void 0, null, function* () {
1799
1799
  }
1800
1800
  return response.json();
1801
1801
  });
1802
- var updateHost = (_a) => __async(void 0, null, function* () {
1802
+ var updateHost = (_a) => __async(null, null, function* () {
1803
1803
  var _b = _a, {
1804
1804
  host
1805
1805
  } = _b, hostData = __objRest(_b, [
@@ -1817,7 +1817,7 @@ var updateHost = (_a) => __async(void 0, null, function* () {
1817
1817
  }
1818
1818
  return response.json();
1819
1819
  });
1820
- var deleteHost = (host) => __async(void 0, null, function* () {
1820
+ var deleteHost = (host) => __async(null, null, function* () {
1821
1821
  const response = yield fetch(`/api/hosts/${host}`, {
1822
1822
  method: "DELETE"
1823
1823
  });
@@ -2108,8 +2108,7 @@ var HostService = class {
2108
2108
  * Utility: Check if a path is protected for a host
2109
2109
  */
2110
2110
  static isPathProtected(hostInfo, path) {
2111
- if (!(hostInfo == null ? void 0 : hostInfo.protectedPaths))
2112
- return false;
2111
+ if (!(hostInfo == null ? void 0 : hostInfo.protectedPaths)) return false;
2113
2112
  return hostInfo.protectedPaths.some(
2114
2113
  (protectedPath) => path.startsWith(protectedPath)
2115
2114
  );
@@ -2169,8 +2168,7 @@ var HostService = class {
2169
2168
  * Utility: Get host info for current window location (client-side only)
2170
2169
  */
2171
2170
  static getCurrentHostInfo(hosts) {
2172
- if (typeof window === "undefined")
2173
- return void 0;
2171
+ if (typeof window === "undefined") return void 0;
2174
2172
  return hosts.find((h) => h.host === window.location.host);
2175
2173
  }
2176
2174
  /**
@@ -3051,6 +3049,79 @@ var trackMapEvent = {
3051
3049
  trackUmamiEvent("map_legend_interaction", { action }, session);
3052
3050
  }
3053
3051
  };
3052
+
3053
+ // src/auth/AuthContext.tsx
3054
+ import { createContext, useContext, useEffect as useEffect4, useMemo as useMemo2 } from "react";
3055
+ import { useQuery as useQuery57, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
3056
+ import { jsx } from "react/jsx-runtime";
3057
+ var SESSION_QUERY_KEY = ["geowiki-session"];
3058
+ var SessionContext = createContext({
3059
+ data: null,
3060
+ status: "loading",
3061
+ update: () => {
3062
+ }
3063
+ });
3064
+ function fetchSession() {
3065
+ return __async(this, null, function* () {
3066
+ try {
3067
+ const res = yield fetch("/api/auth/session");
3068
+ const json = yield res.json();
3069
+ if (json.accessToken) {
3070
+ return json;
3071
+ }
3072
+ return null;
3073
+ } catch (e) {
3074
+ return null;
3075
+ }
3076
+ });
3077
+ }
3078
+ function SessionProvider({
3079
+ children,
3080
+ session: initialSession,
3081
+ onSessionChange
3082
+ }) {
3083
+ const queryClient = useQueryClient2();
3084
+ const { data, isLoading } = useQuery57({
3085
+ queryKey: SESSION_QUERY_KEY,
3086
+ queryFn: fetchSession,
3087
+ initialData: initialSession != null ? initialSession : void 0,
3088
+ staleTime: 5 * 60 * 1e3,
3089
+ refetchOnWindowFocus: true,
3090
+ refetchInterval: 4 * 60 * 1e3
3091
+ });
3092
+ useEffect4(() => {
3093
+ onSessionChange == null ? void 0 : onSessionChange(data != null ? data : null);
3094
+ }, [data, onSessionChange]);
3095
+ const status = isLoading ? "loading" : data ? "authenticated" : "unauthenticated";
3096
+ const update = useMemo2(
3097
+ () => () => queryClient.invalidateQueries({ queryKey: SESSION_QUERY_KEY }),
3098
+ [queryClient]
3099
+ );
3100
+ const value = useMemo2(
3101
+ () => ({ data: data != null ? data : null, status, update }),
3102
+ [data, status, update]
3103
+ );
3104
+ return /* @__PURE__ */ jsx(SessionContext.Provider, { value, children });
3105
+ }
3106
+ function useSession() {
3107
+ return useContext(SessionContext);
3108
+ }
3109
+
3110
+ // src/auth/actions.ts
3111
+ function signIn(_provider, _options, params) {
3112
+ const url = new URL("/api/auth/login", window.location.origin);
3113
+ const currentPath = window.location.pathname;
3114
+ if (currentPath !== "/" && currentPath !== "/login") {
3115
+ url.searchParams.set("returnTo", currentPath);
3116
+ }
3117
+ if (params) {
3118
+ Object.entries(params).forEach(([k, v]) => url.searchParams.set(k, v));
3119
+ }
3120
+ window.location.href = url.toString();
3121
+ }
3122
+ function signOut() {
3123
+ window.location.href = "/api/auth/logout";
3124
+ }
3054
3125
  export {
3055
3126
  ActivityStatus,
3056
3127
  AdminMenus,
@@ -3081,6 +3152,8 @@ export {
3081
3152
  QuestionnaireType,
3082
3153
  ResourcesMenu,
3083
3154
  Responsive,
3155
+ SESSION_QUERY_KEY,
3156
+ SessionProvider,
3084
3157
  StyleType,
3085
3158
  TaskEventType,
3086
3159
  TaskState,
@@ -3123,6 +3196,8 @@ export {
3123
3196
  settingsStore,
3124
3197
  shimmer,
3125
3198
  showIntroTour,
3199
+ signIn,
3200
+ signOut,
3126
3201
  slideInLeft,
3127
3202
  slideInRight,
3128
3203
  slideInUp,
@@ -3223,6 +3298,7 @@ export {
3223
3298
  useResourceType,
3224
3299
  useReviewTaskBulkUpload,
3225
3300
  useRoles,
3301
+ useSession,
3226
3302
  useTaskAnnotation,
3227
3303
  useTaskAnswers,
3228
3304
  useTaskBulkUpload,