gsintegrations 0.0.485 → 0.0.487
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/bundle.cjs.js +894 -103
- package/dist/bundle.cjs.js.map +2 -2
- package/dist/bundle.esm.js +894 -104
- package/dist/bundle.esm.js.map +2 -2
- package/dist/index.d.ts +98 -2
- package/dist/types/components/FormChatAssistant/FormChatAssistant.types.d.ts +2 -0
- package/dist/types/pages/ActivityDetailPage/ActivityDetailPage.d.ts +1 -0
- package/dist/types/pages/ActivityDetailPage/ActivityDetailPage.types.d.ts +8 -0
- package/dist/types/pages/ActivityDetailPage/useActivityDetailPage.d.ts +1 -0
- package/dist/types/pages/ActivityListPage/ActivityListPage.types.d.ts +8 -0
- package/dist/types/pages/ActivityListPage/useActivityListPage.d.ts +1 -0
- package/dist/types/pages/ActivityOnboardingPage/ActivityOnboarding.types.d.ts +8 -0
- package/dist/types/pages/EventDetailPage/EventDetailPage.d.ts +2 -0
- package/dist/types/pages/EventDetailPage/EventDetailPage.types.d.ts +27 -0
- package/dist/types/pages/EventDetailPage/useEventDetailPage.d.ts +2 -0
- package/dist/types/pages/EventOnboardingPage/EventOnboarding.types.d.ts +22 -0
- package/dist/types/pages/EventOnboardingPage/components/EventActivitySelectionStep.d.ts +1 -0
- package/dist/types/pages/EventsPage/EventsPage.types.d.ts +8 -0
- package/dist/types/pages/EventsPage/useEventsPage.d.ts +1 -0
- package/dist/types/pages/HomePage/HomePage.types.d.ts +12 -0
- package/dist/types/pages/NearbyTerreiroSearchPage/NearbyTerreiroSearchPage.d.ts +4 -0
- package/dist/types/pages/NearbyTerreiroSearchPage/NearbyTerreiroSearchPage.types.d.ts +42 -0
- package/dist/types/pages/NearbyTerreiroSearchPage/TerreiroLocationSearch.d.ts +8 -0
- package/dist/types/pages/NearbyTerreiroSearchPage/TerreiroResultMap.d.ts +16 -0
- package/dist/types/pages/NearbyTerreiroSearchPage/index.d.ts +3 -0
- package/dist/types/pages/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/bundle.cjs.js
CHANGED
|
@@ -58797,6 +58797,10 @@ var DeleteOutline = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
|
58797
58797
|
d: "M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM8 9h8v10H8zm7.5-5-1-1h-5l-1 1H5v2h14V4z"
|
|
58798
58798
|
}), 'DeleteOutline');
|
|
58799
58799
|
|
|
58800
|
+
var DirectionsOutlined = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
58801
|
+
d: "m22.43 10.59-9.01-9.01c-.75-.75-2.07-.76-2.83 0l-9 9c-.78.78-.78 2.04 0 2.82l9 9c.39.39.9.58 1.41.58.51 0 1.02-.19 1.41-.58l8.99-8.99c.79-.76.8-2.02.03-2.82m-10.42 10.4-9-9 9-9 9 9zM8 11v4h2v-3h4v2.5l3.5-3.5L14 7.5V10H9c-.55 0-1 .45-1 1"
|
|
58802
|
+
}), 'DirectionsOutlined');
|
|
58803
|
+
|
|
58800
58804
|
var DirectionsWalk = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
58801
58805
|
d: "M13.5 5.5c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2M9.8 8.9 7 23h2.1l1.8-8 2.1 2v6h2v-7.5l-2.1-2 .6-3C14.8 12 16.8 13 19 13v-2c-1.9 0-3.5-1-4.3-2.4l-1-1.6c-.4-.6-1-1-1.7-1-.3 0-.5.1-.8.1L6 8.3V13h2V9.6z"
|
|
58802
58806
|
}), 'DirectionsWalk');
|
|
@@ -59046,6 +59050,10 @@ var MoreVert = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
|
59046
59050
|
d: "M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"
|
|
59047
59051
|
}), 'MoreVert');
|
|
59048
59052
|
|
|
59053
|
+
var MyLocation = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
59054
|
+
d: "M12 8c-2.21 0-4 1.79-4 4s1.79 4 4 4 4-1.79 4-4-1.79-4-4-4m8.94 3c-.46-4.17-3.77-7.48-7.94-7.94V1h-2v2.06C6.83 3.52 3.52 6.83 3.06 11H1v2h2.06c.46 4.17 3.77 7.48 7.94 7.94V23h2v-2.06c4.17-.46 7.48-3.77 7.94-7.94H23v-2zM12 19c-3.87 0-7-3.13-7-7s3.13-7 7-7 7 3.13 7 7-3.13 7-7 7"
|
|
59055
|
+
}), 'MyLocation');
|
|
59056
|
+
|
|
59049
59057
|
var NavigateNext = createSvgIcon( /*#__PURE__*/require$$2$1.jsx("path", {
|
|
59050
59058
|
d: "M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"
|
|
59051
59059
|
}), 'NavigateNext');
|
|
@@ -126880,7 +126888,7 @@ const ActivityFormChatSummaryCard = ({ summary, confirmLabel = "Criar atividade"
|
|
|
126880
126888
|
React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Hor\u00E1rio", value: summary.isAllDay
|
|
126881
126889
|
? "Dia inteiro"
|
|
126882
126890
|
: `${formatTime$2(summary.startTime)} – ${formatTime$2(summary.endTime)}` }))) : null,
|
|
126883
|
-
summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_e = summary.checkinEndWindowMinutes) !== null && _e !== void 0 ? _e : 15} min depois` })) : null,
|
|
126891
|
+
summary.qrCheckinEnabled === false ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: "Desativado" })) : summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_e = summary.checkinEndWindowMinutes) !== null && _e !== void 0 ? _e : 15} min depois` })) : null,
|
|
126884
126892
|
React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$Z, { fontSize: "small" }), label: "Participantes", value: members }),
|
|
126885
126893
|
summary.minConfirmedMembers !== undefined ? (React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$Z, { fontSize: "small" }), label: "Qu\u00F3rum m\u00EDnimo", value: String(summary.minConfirmedMembers) })) : null,
|
|
126886
126894
|
React$1.createElement(SummaryRow$4, { icon: React$1.createElement(default_1$Y, { fontSize: "small" }), label: "Materiais", value: insumos })),
|
|
@@ -127028,7 +127036,7 @@ const EventFormChatSummaryCard = ({ summary, confirmLabel = "Criar evento", edit
|
|
|
127028
127036
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Hor\u00E1rio", value: summary.isAllDay
|
|
127029
127037
|
? "Dia inteiro"
|
|
127030
127038
|
: `${formatTime$1(summary.startTime)} – ${formatTime$1(summary.endTime)}` }))) : null,
|
|
127031
|
-
summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_g = summary.checkinEndWindowMinutes) !== null && _g !== void 0 ? _g : 15} min depois` })) : null,
|
|
127039
|
+
summary.qrCheckinEnabled === false ? (React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: "Desativado" })) : summary.checkinStartWindowMinutes !== undefined ? (React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$X, { fontSize: "small" }), label: "Check-in", value: `${summary.checkinStartWindowMinutes} min antes / ${(_g = summary.checkinEndWindowMinutes) !== null && _g !== void 0 ? _g : 15} min depois` })) : null,
|
|
127032
127040
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$14, { fontSize: "small" }), label: "Local", value: formatLocation(summary) }),
|
|
127033
127041
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$W, { fontSize: "small" }), label: "Atividades", value: activities }),
|
|
127034
127042
|
React$1.createElement(SummaryRow$3, { icon: React$1.createElement(default_1$Z, { fontSize: "small" }), label: "Participantes", value: members }),
|
|
@@ -133244,27 +133252,31 @@ const ActivityCheckinWindowStep = ({ formState, validationErrors, onChange, setF
|
|
|
133244
133252
|
});
|
|
133245
133253
|
}
|
|
133246
133254
|
}, [setFieldValue, onChange]);
|
|
133255
|
+
const checkinEnabled = formState.qrCheckinEnabled !== false;
|
|
133247
133256
|
return (React$1.createElement(Box$1, { sx: { p: { xs: 0.5, sm: 1 } } },
|
|
133248
|
-
React$1.createElement(
|
|
133249
|
-
|
|
133250
|
-
|
|
133251
|
-
|
|
133252
|
-
|
|
133253
|
-
|
|
133254
|
-
|
|
133255
|
-
|
|
133256
|
-
|
|
133257
|
-
|
|
133258
|
-
|
|
133259
|
-
|
|
133260
|
-
"
|
|
133261
|
-
|
|
133262
|
-
|
|
133263
|
-
|
|
133264
|
-
|
|
133265
|
-
|
|
133266
|
-
|
|
133267
|
-
|
|
133257
|
+
React$1.createElement(FormControlLabel$1, { control: React$1.createElement(Switch$1, { checked: checkinEnabled, onChange: (_, checked) => updateField("qrCheckinEnabled", checked), inputProps: { "aria-label": "Habilitar check-in" }, "data-testid": "activity-checkin-enabled-switch" }), label: "Habilitar check-in", sx: { mb: 2, ml: 0 } }),
|
|
133258
|
+
!checkinEnabled ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Esta atividade n\u00E3o ter\u00E1 check-in na porta. A janela e o QR ficam ocultos.")) : null,
|
|
133259
|
+
checkinEnabled ? (React$1.createElement(React$1.Fragment, null,
|
|
133260
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: { xs: 2, sm: 3 } } },
|
|
133261
|
+
"Configure o intervalo de tempo permitido para check-in. O check-in estar\u00E1 dispon\u00EDvel a partir de X minutos ",
|
|
133262
|
+
React$1.createElement("strong", null, "antes"),
|
|
133263
|
+
" da atividade at\u00E9 Y minutos",
|
|
133264
|
+
React$1.createElement("strong", null, " ap\u00F3s"),
|
|
133265
|
+
" o in\u00EDcio."),
|
|
133266
|
+
React$1.createElement(Alert$1, { severity: "info", icon: React$1.createElement(Info$1, null), sx: { mb: { xs: 2, sm: 3 } } },
|
|
133267
|
+
React$1.createElement(Typography$1, { variant: "body2" },
|
|
133268
|
+
React$1.createElement("strong", null, "Exemplo:"),
|
|
133269
|
+
" Com os valores padr\u00E3o (10 e 15), se a atividade come\u00E7a \u00E0s 19h, o check-in abrir\u00E1 \u00E0s 18h50 e fechar\u00E1 \u00E0s 19h15.")),
|
|
133270
|
+
React$1.createElement(Box$1, { sx: { mb: { xs: 2, sm: 3 } } },
|
|
133271
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinStartWindowMinutes", label: "Abrir check-in (minutos antes)", value: formState.checkinStartWindowMinutes, onChange: (value) => updateField("checkinStartWindowMinutes", value), error: validationErrors.checkinStartWindowMinutes, helperText: validationErrors.checkinStartWindowMinutes ||
|
|
133272
|
+
"Quantos minutos antes da atividade checar entrada (0-120)", fallbackValue: 10, presets: [10, 20, 30], min: 0, max: 120, "data-testid": "activity-checkin-start-window-input" })),
|
|
133273
|
+
React$1.createElement(Box$1, { sx: { mb: { xs: 2, sm: 3 } } },
|
|
133274
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinEndWindowMinutes", label: "Fechar check-in (minutos ap\u00F3s)", value: formState.checkinEndWindowMinutes, onChange: (value) => updateField("checkinEndWindowMinutes", value), error: validationErrors.checkinEndWindowMinutes, helperText: validationErrors.checkinEndWindowMinutes ||
|
|
133275
|
+
"Quantos minutos após o início da atividade checar entrada (0-120)", fallbackValue: 15, presets: [10, 20, 30], min: 0, max: 120, "data-testid": "activity-checkin-end-window-input" })),
|
|
133276
|
+
React$1.createElement(Box$1, { sx: { p: { xs: 1.5, sm: 2 }, bgcolor: "action.hover", borderRadius: RADIUS.default } },
|
|
133277
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
133278
|
+
React$1.createElement("strong", null, "Dica:"),
|
|
133279
|
+
" Para atividades ritualisticas, manter a precis\u00E3o \u00E9 importante. Use 10 minutos de abertura e 15 minutos de fechamento como padr\u00E3o para manter a disciplina energ\u00E9tica.")))) : null));
|
|
133268
133280
|
};
|
|
133269
133281
|
|
|
133270
133282
|
const MembersSelectionStep = ({ formState, validationErrors, onChange, availableMembers = [], }) => {
|
|
@@ -134066,6 +134078,7 @@ const TemplateSchema = objectType({
|
|
|
134066
134078
|
isTemplate: booleanType(),
|
|
134067
134079
|
});
|
|
134068
134080
|
const ActivityCheckinWindowSchema = objectType({
|
|
134081
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
134069
134082
|
checkinStartWindowMinutes: numberType()
|
|
134070
134083
|
.int()
|
|
134071
134084
|
.min(0, "Deve ser 0 ou maior")
|
|
@@ -134093,6 +134106,7 @@ objectType({
|
|
|
134093
134106
|
.int("Quórum mínimo deve ser um número inteiro")
|
|
134094
134107
|
.min(1, "Quórum mínimo deve ser pelo menos 1")
|
|
134095
134108
|
.optional(),
|
|
134109
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
134096
134110
|
checkinStartWindowMinutes: numberType()
|
|
134097
134111
|
.int()
|
|
134098
134112
|
.min(0)
|
|
@@ -134185,13 +134199,18 @@ const DEFAULT_FORM_STATE$4 = {
|
|
|
134185
134199
|
insumos: [],
|
|
134186
134200
|
isTemplate: false,
|
|
134187
134201
|
minConfirmedMembers: undefined,
|
|
134202
|
+
qrCheckinEnabled: true,
|
|
134188
134203
|
};
|
|
134189
134204
|
const useActivityOnboarding = (props) => {
|
|
134190
134205
|
const [isLoading, setIsLoading] = React$1.useState(false);
|
|
134191
134206
|
const [error, setError] = React$1.useState();
|
|
134192
134207
|
const formState = React$1.useMemo(() => {
|
|
134193
|
-
|
|
134194
|
-
|
|
134208
|
+
const base = props.initialData || DEFAULT_FORM_STATE$4;
|
|
134209
|
+
if (props.isPersonalProfile) {
|
|
134210
|
+
return Object.assign(Object.assign({}, base), { qrCheckinEnabled: false });
|
|
134211
|
+
}
|
|
134212
|
+
return base;
|
|
134213
|
+
}, [props.initialData, props.isPersonalProfile]);
|
|
134195
134214
|
const steps = React$1.useMemo(() => {
|
|
134196
134215
|
return [
|
|
134197
134216
|
{
|
|
@@ -134224,7 +134243,7 @@ const useActivityOnboarding = (props) => {
|
|
|
134224
134243
|
id: "checkin-window",
|
|
134225
134244
|
label: "Check-in",
|
|
134226
134245
|
title: "Configurar Check-in",
|
|
134227
|
-
description: "
|
|
134246
|
+
description: "Escolha se haverá check-in e, se houver, o período permitido",
|
|
134228
134247
|
component: ActivityCheckinWindowStep,
|
|
134229
134248
|
},
|
|
134230
134249
|
]),
|
|
@@ -134965,6 +134984,8 @@ const formatMinutesToHHMM$3 = (totalMinutes) => {
|
|
|
134965
134984
|
};
|
|
134966
134985
|
const getConfiguredCheckinWindow$1 = (activity) => {
|
|
134967
134986
|
var _a, _b, _c, _d;
|
|
134987
|
+
if (activity.qrCheckinEnabled === false)
|
|
134988
|
+
return null;
|
|
134968
134989
|
const startTime = (_b = (_a = activity.occurrences) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.startTime;
|
|
134969
134990
|
const startMinutes = parseTimeToMinutes$3(startTime);
|
|
134970
134991
|
if (startMinutes === null)
|
|
@@ -135269,26 +135290,27 @@ const ActivityDateTime = ({ activity, checkinWindow, formatDate, formatTime, the
|
|
|
135269
135290
|
? formatTime(occurrence.endTime)
|
|
135270
135291
|
: "Não definido"))))))) : (React$1.createElement(Box$1, { sx: { textAlign: "center", py: 2 } },
|
|
135271
135292
|
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Nenhuma data definida"))),
|
|
135272
|
-
React$1.createElement(
|
|
135273
|
-
React$1.createElement(
|
|
135274
|
-
|
|
135275
|
-
"
|
|
135276
|
-
|
|
135277
|
-
|
|
135278
|
-
React$1.createElement(
|
|
135279
|
-
|
|
135280
|
-
|
|
135281
|
-
|
|
135282
|
-
|
|
135283
|
-
|
|
135284
|
-
|
|
135285
|
-
|
|
135286
|
-
|
|
135287
|
-
|
|
135288
|
-
|
|
135289
|
-
|
|
135290
|
-
|
|
135291
|
-
|
|
135293
|
+
activity.qrCheckinEnabled !== false ? (React$1.createElement(React$1.Fragment, null,
|
|
135294
|
+
React$1.createElement(Box$1, { sx: { display: "flex", alignItems: "center", mt: 1 } },
|
|
135295
|
+
React$1.createElement(AccessTime, { sx: { mr: 1.5, color: "text.secondary" } }),
|
|
135296
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mr: 1 } },
|
|
135297
|
+
"Check-in v\u00E1lido: ",
|
|
135298
|
+
getCheckinSummary()),
|
|
135299
|
+
checkinWindow ? (React$1.createElement(Box$1, { component: "span" },
|
|
135300
|
+
React$1.createElement(Typography$1, { component: "span", variant: "caption", sx: {
|
|
135301
|
+
px: 1,
|
|
135302
|
+
py: 0.25,
|
|
135303
|
+
borderRadius: RADIUS.default,
|
|
135304
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
135305
|
+
color: checkinWindow.state === "active"
|
|
135306
|
+
? theme.palette.success.main
|
|
135307
|
+
: checkinWindow.state === "scheduled"
|
|
135308
|
+
? theme.palette.warning.main
|
|
135309
|
+
: checkinWindow.state === "closed"
|
|
135310
|
+
? theme.palette.error.main
|
|
135311
|
+
: theme.palette.text.secondary,
|
|
135312
|
+
} }, stateLabel[checkinWindow.state]))) : null),
|
|
135313
|
+
getCheckinExplanation() ? (React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary", sx: { mt: 0.5 } }, getCheckinExplanation())) : null)) : null)));
|
|
135292
135314
|
};
|
|
135293
135315
|
var ActivityDateTime$1 = React$1.memo(ActivityDateTime);
|
|
135294
135316
|
|
|
@@ -135874,6 +135896,7 @@ const ActivitySchema$3 = objectType({
|
|
|
135874
135896
|
title: stringType(),
|
|
135875
135897
|
description: stringType(),
|
|
135876
135898
|
isTemplate: booleanType(),
|
|
135899
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
135877
135900
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
135878
135901
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
135879
135902
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -135989,6 +136012,7 @@ const ActivityDetailSchema = objectType({
|
|
|
135989
136012
|
title: stringType(),
|
|
135990
136013
|
description: stringType(),
|
|
135991
136014
|
isTemplate: booleanType(),
|
|
136015
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
135992
136016
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
135993
136017
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
135994
136018
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -136397,7 +136421,9 @@ const ActivityDetailPage = (props) => {
|
|
|
136397
136421
|
const bTime = b.confirmedAt ? new Date(b.confirmedAt).getTime() : 0;
|
|
136398
136422
|
return bTime - aTime;
|
|
136399
136423
|
});
|
|
136400
|
-
const
|
|
136424
|
+
const checkinEnabled = data.activity.qrCheckinEnabled !== false;
|
|
136425
|
+
const canShowCheckinCta = checkinEnabled &&
|
|
136426
|
+
props.canScanCheckin &&
|
|
136401
136427
|
((_a = props.checkinWindow) === null || _a === void 0 ? void 0 : _a.state) === "active" &&
|
|
136402
136428
|
!(currentMember === null || currentMember === void 0 ? void 0 : currentMember.confirmedAt) &&
|
|
136403
136429
|
!props.isPersonalProfile;
|
|
@@ -136422,7 +136448,7 @@ const ActivityDetailPage = (props) => {
|
|
|
136422
136448
|
React$1.createElement(Stack$1, { spacing: LIST_GAP },
|
|
136423
136449
|
React$1.createElement(ActivityInfo$1, { activity: data.activity, canChangeStatus: props.canChangeStatus || false, canUseModel: props.canUseModel || false, statusOptions: statusOptions, onStatusChange: fns.handleChangeStatus, onUseModel: fns.handleUseModel, theme: theme }),
|
|
136424
136450
|
React$1.createElement(ActivityDateTime$1, { activity: data.activity, checkinWindow: props.checkinWindow, formatDate: data.formatDate, formatTime: data.formatTime, theme: theme }),
|
|
136425
|
-
props.canManageQr && !props.isPersonalProfile && (React$1.createElement(ActivityAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState })),
|
|
136451
|
+
checkinEnabled && props.canManageQr && !props.isPersonalProfile && (React$1.createElement(ActivityAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState })),
|
|
136426
136452
|
React$1.createElement(ActivityMediums$1, { activity: data.activity, onAddMedium: fns.handleAddMedium, isAdmin: data.isAdmin, theme: theme, currentMemberId: data.currentMemberId, onConfirmParticipation: fns.handleConfirmParticipation, onDeclineParticipation: fns.handleDeclineParticipation }),
|
|
136427
136453
|
attendanceMembers.length > 0 && (React$1.createElement(ConfirmedAttendanceCard$3, { attendanceMembers: attendanceMembers, theme: theme, formatConfirmedAt: formatConfirmedAt })),
|
|
136428
136454
|
React$1.createElement(ActivitySupplies$1, { activity: data.activity, onAddSupply: fns.handleAddSupply, theme: theme })))),
|
|
@@ -137271,6 +137297,7 @@ const EventSchema = objectType({
|
|
|
137271
137297
|
name: stringType().optional(),
|
|
137272
137298
|
description: stringType().optional(),
|
|
137273
137299
|
isTemplate: booleanType().optional(),
|
|
137300
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
137274
137301
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
137275
137302
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
137276
137303
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -137519,27 +137546,31 @@ const EventCheckinWindowStep = ({ formState, validationErrors, onChange, setFiel
|
|
|
137519
137546
|
onChange(createFieldEvent(name, value));
|
|
137520
137547
|
}
|
|
137521
137548
|
}, [setFieldValue, onChange]);
|
|
137549
|
+
const checkinEnabled = formState.qrCheckinEnabled !== false;
|
|
137522
137550
|
return (React$1.createElement(Box$1, { sx: { p: { xs: 0.5, sm: 1 } } },
|
|
137523
|
-
React$1.createElement(
|
|
137524
|
-
|
|
137525
|
-
|
|
137526
|
-
|
|
137527
|
-
|
|
137528
|
-
|
|
137529
|
-
|
|
137530
|
-
|
|
137531
|
-
|
|
137532
|
-
|
|
137533
|
-
|
|
137534
|
-
|
|
137535
|
-
"
|
|
137536
|
-
|
|
137537
|
-
|
|
137538
|
-
|
|
137539
|
-
|
|
137540
|
-
|
|
137541
|
-
|
|
137542
|
-
|
|
137551
|
+
React$1.createElement(FormControlLabel$1, { control: React$1.createElement(Switch$1, { checked: checkinEnabled, onChange: (_, checked) => updateField("qrCheckinEnabled", checked), inputProps: { "aria-label": "Habilitar check-in" }, "data-testid": "event-checkin-enabled-switch" }), label: "Habilitar check-in", sx: { mb: 2, ml: 0 } }),
|
|
137552
|
+
!checkinEnabled ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Este evento n\u00E3o ter\u00E1 check-in na porta. A janela e o QR ficam ocultos.")) : null,
|
|
137553
|
+
checkinEnabled ? (React$1.createElement(React$1.Fragment, null,
|
|
137554
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mb: 2.5 } },
|
|
137555
|
+
"Configure o intervalo de tempo permitido para check-in. O check-in estar\u00E1 dispon\u00EDvel a partir de X minutos ",
|
|
137556
|
+
React$1.createElement("strong", null, "antes"),
|
|
137557
|
+
" do evento at\u00E9 Y minutos",
|
|
137558
|
+
React$1.createElement("strong", null, " ap\u00F3s"),
|
|
137559
|
+
" o in\u00EDcio."),
|
|
137560
|
+
React$1.createElement(Alert$1, { severity: "info", icon: React$1.createElement(Info$1, null), sx: { mb: 2.5 } },
|
|
137561
|
+
React$1.createElement(Typography$1, { variant: "body2" },
|
|
137562
|
+
React$1.createElement("strong", null, "Exemplo:"),
|
|
137563
|
+
" Com os valores padr\u00E3o (10 e 15), se o evento come\u00E7a \u00E0s 19h, o check-in abrir\u00E1 \u00E0s 18h50 e fechar\u00E1 \u00E0s 19h15.")),
|
|
137564
|
+
React$1.createElement(Box$1, { sx: { mb: 2.5 } },
|
|
137565
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinStartWindowMinutes", label: "Abrir check-in (minutos antes)", value: formState.checkinStartWindowMinutes, onChange: (value) => updateField("checkinStartWindowMinutes", value), error: validationErrors.checkinStartWindowMinutes, helperText: validationErrors.checkinStartWindowMinutes ||
|
|
137566
|
+
"Quantos minutos antes do evento checar entrada (0-120)", fallbackValue: 10, min: 0, max: 120, "data-testid": "event-checkin-start-window-input" })),
|
|
137567
|
+
React$1.createElement(Box$1, { sx: { mb: 2.5 } },
|
|
137568
|
+
React$1.createElement(LabeledMinuteInput, { name: "checkinEndWindowMinutes", label: "Fechar check-in (minutos ap\u00F3s)", value: formState.checkinEndWindowMinutes, onChange: (value) => updateField("checkinEndWindowMinutes", value), error: validationErrors.checkinEndWindowMinutes, helperText: validationErrors.checkinEndWindowMinutes ||
|
|
137569
|
+
"Quantos minutos após o início do evento checar entrada (0-120)", fallbackValue: 15, min: 0, max: 120, "data-testid": "event-checkin-end-window-input" })),
|
|
137570
|
+
React$1.createElement(Box$1, { sx: { p: { xs: 1.5, sm: 2 }, bgcolor: "action.hover", borderRadius: RADIUS.default } },
|
|
137571
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" },
|
|
137572
|
+
React$1.createElement("strong", null, "Dica:"),
|
|
137573
|
+
" Para eventos grandes, aumentar o intervalo de abertura (e.g. 20 minutos antes) permite que mais pessoas cheguem a tempo. Para eventos pequenos, 10 e 15 minutos geralmente \u00E9 o ideal.")))) : null));
|
|
137543
137574
|
};
|
|
137544
137575
|
|
|
137545
137576
|
let googleMapsScriptPromise = null;
|
|
@@ -138584,7 +138615,7 @@ const EventReviewStep = ({ formState, availableActivities, }) => {
|
|
|
138584
138615
|
React$1.createElement(Typography$1, { variant: "h6", sx: { mb: 2, display: "flex", alignItems: "center" } },
|
|
138585
138616
|
React$1.createElement(AccessTime, { sx: { mr: 1 } }),
|
|
138586
138617
|
" Janela de Check-in"),
|
|
138587
|
-
!formState.isAllDay ? (React$1.createElement(React$1.Fragment, null,
|
|
138618
|
+
formState.qrCheckinEnabled === false ? (React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary" }, "Check-in desativado para este evento.")) : !formState.isAllDay ? (React$1.createElement(React$1.Fragment, null,
|
|
138588
138619
|
React$1.createElement(Typography$1, { variant: "body2", sx: { mb: 1 } },
|
|
138589
138620
|
React$1.createElement("strong", null, "Evento:"),
|
|
138590
138621
|
" ",
|
|
@@ -139443,7 +139474,7 @@ const EventActivitySelectionStep = ({ formState, validationErrors, onChange, ava
|
|
|
139443
139474
|
"):"),
|
|
139444
139475
|
React$1.createElement(Button$1, { variant: "text", size: "small", startIcon: React$1.createElement(Clear$1, null), onClick: handleClear, sx: { alignSelf: { xs: "stretch", sm: "flex-start" } } }, "Limpar todas")),
|
|
139445
139476
|
selectedActivities.map((activity) => {
|
|
139446
|
-
var _a, _b, _c, _d, _e, _f;
|
|
139477
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
139447
139478
|
return (React$1.createElement(Box$1, { key: activity.id, sx: {
|
|
139448
139479
|
mb: 1.5,
|
|
139449
139480
|
p: { xs: 1.25, sm: 1.5 },
|
|
@@ -139487,8 +139518,9 @@ const EventActivitySelectionStep = ({ formState, validationErrors, onChange, ava
|
|
|
139487
139518
|
} },
|
|
139488
139519
|
React$1.createElement(LabeledTimePicker, { label: "In\u00EDcio", value: activity.startTime || "", error: (_a = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _a === void 0 ? void 0 : _a.startTime, helperText: ((_b = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _b === void 0 ? void 0 : _b.startTime) || " ", onChange: (value) => handleActivityTimeChange(activity.id, "startTime", value), "data-testid": `event-activity-start-time-${activity.id}` }),
|
|
139489
139520
|
React$1.createElement(LabeledTimePicker, { label: "T\u00E9rmino", value: activity.endTime || "", error: (_c = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _c === void 0 ? void 0 : _c.endTime, helperText: ((_d = activityTimeValidation.errorsByActivityId[String(activity.id)]) === null || _d === void 0 ? void 0 : _d.endTime) || " ", onChange: (value) => handleActivityTimeChange(activity.id, "endTime", value), "data-testid": `event-activity-end-time-${activity.id}` }),
|
|
139490
|
-
|
|
139491
|
-
|
|
139521
|
+
((_e = availableActivities.find((item) => String(item.id) === String(activity.id))) === null || _e === void 0 ? void 0 : _e.qrCheckinEnabled) !== false ? (React$1.createElement(React$1.Fragment, null,
|
|
139522
|
+
React$1.createElement(TextField$1, { fullWidth: true, label: checkinOpenLabel, type: "number", size: "small", value: (_f = activity.checkinStartWindowMinutes) !== null && _f !== void 0 ? _f : 10, onChange: (e) => handleActivityCheckinWindowChange(activity.id, "checkinStartWindowMinutes", e.target.value), InputLabelProps: { shrink: true }, inputProps: { min: 0, max: 120 }, helperText: isMobile ? "Antes do início" : "Minutos antes do início" }),
|
|
139523
|
+
React$1.createElement(TextField$1, { fullWidth: true, label: checkinCloseLabel, type: "number", size: "small", value: (_g = activity.checkinEndWindowMinutes) !== null && _g !== void 0 ? _g : 15, onChange: (e) => handleActivityCheckinWindowChange(activity.id, "checkinEndWindowMinutes", e.target.value), InputLabelProps: { shrink: true }, inputProps: { min: 0, max: 120 }, helperText: isMobile ? "Após o início" : "Minutos após o início" }))) : null),
|
|
139492
139524
|
React$1.createElement(Box$1, { sx: {
|
|
139493
139525
|
display: "flex",
|
|
139494
139526
|
alignItems: { xs: "flex-start", sm: "center" },
|
|
@@ -139728,6 +139760,7 @@ const EventLocationSchema = objectType({
|
|
|
139728
139760
|
}
|
|
139729
139761
|
});
|
|
139730
139762
|
const EventCheckinWindowSchema = objectType({
|
|
139763
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
139731
139764
|
checkinStartWindowMinutes: numberType()
|
|
139732
139765
|
.int()
|
|
139733
139766
|
.min(0, "Deve ser 0 ou maior")
|
|
@@ -139780,6 +139813,7 @@ const ActivitySchema$1 = objectType({
|
|
|
139780
139813
|
durationMinutes: numberType().optional(),
|
|
139781
139814
|
startTime: stringType().optional(), // HH:MM — per-activity start time for the event
|
|
139782
139815
|
endTime: stringType().optional(), // HH:MM — per-activity end time for the event
|
|
139816
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
139783
139817
|
checkinStartWindowMinutes: numberType().int().min(0).max(120).optional(),
|
|
139784
139818
|
checkinEndWindowMinutes: numberType().int().min(0).max(120).optional(),
|
|
139785
139819
|
qrReleaseOffsetMinutes: numberType().int().min(0).max(180).optional(),
|
|
@@ -139839,6 +139873,7 @@ const EventFormValuesSchema = objectType({
|
|
|
139839
139873
|
insumos: arrayType(anyType()).optional(),
|
|
139840
139874
|
activities: arrayType(ActivitySchema$1).optional(), // Changed from activity to activities
|
|
139841
139875
|
requiredActivityIds: arrayType(stringType()).optional(),
|
|
139876
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
139842
139877
|
checkinStartWindowMinutes: numberType()
|
|
139843
139878
|
.int()
|
|
139844
139879
|
.min(0)
|
|
@@ -139956,6 +139991,7 @@ const DEFAULT_FORM_STATE$3 = {
|
|
|
139956
139991
|
isAllDay: false,
|
|
139957
139992
|
startTime: "",
|
|
139958
139993
|
endTime: "",
|
|
139994
|
+
qrCheckinEnabled: true,
|
|
139959
139995
|
checkinStartWindowMinutes: 10,
|
|
139960
139996
|
checkinEndWindowMinutes: 15,
|
|
139961
139997
|
location: {
|
|
@@ -139996,24 +140032,26 @@ const EMPTY_SCHEMA = objectType({});
|
|
|
139996
140032
|
* Computes the initial form state from props, applying terreiro address
|
|
139997
140033
|
* defaults when the location type is "in terreiro".
|
|
139998
140034
|
*/
|
|
139999
|
-
const buildInitialFormState = (initialData, isTerreiroAddressEmpty, knownLocations) => {
|
|
140035
|
+
const buildInitialFormState = (initialData, isTerreiroAddressEmpty, knownLocations, isPersonalProfile = false) => {
|
|
140000
140036
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
|
140001
140037
|
const baseState = initialData !== null && initialData !== void 0 ? initialData : DEFAULT_FORM_STATE$3;
|
|
140002
|
-
const
|
|
140038
|
+
const withCheckin = isPersonalProfile
|
|
140039
|
+
? Object.assign(Object.assign({}, baseState), { qrCheckinEnabled: false }) : baseState;
|
|
140040
|
+
const isCreateFlow = !withCheckin.id;
|
|
140003
140041
|
if (isCreateFlow) {
|
|
140004
140042
|
const fallback = (knownLocations && knownLocations[0]) || "Endereço do Terreiro";
|
|
140005
|
-
const existingKnownLocation = ((_c = (_b = (_a =
|
|
140006
|
-
return Object.assign(Object.assign({},
|
|
140043
|
+
const existingKnownLocation = ((_c = (_b = (_a = withCheckin.location) === null || _a === void 0 ? void 0 : _a.knownLocation) === null || _b === void 0 ? void 0 : _b.trim) === null || _c === void 0 ? void 0 : _c.call(_b)) || "";
|
|
140044
|
+
return Object.assign(Object.assign({}, withCheckin), { location: Object.assign(Object.assign({}, withCheckin.location), { isInTerreiro: !isTerreiroAddressEmpty, knownLocation: !isTerreiroAddressEmpty
|
|
140007
140045
|
? existingKnownLocation || fallback
|
|
140008
|
-
: (_e = (_d =
|
|
140046
|
+
: (_e = (_d = withCheckin.location) === null || _d === void 0 ? void 0 : _d.knownLocation) !== null && _e !== void 0 ? _e : "" }) });
|
|
140009
140047
|
}
|
|
140010
|
-
const shouldDefaultToTerreiro = (_g = (_f =
|
|
140048
|
+
const shouldDefaultToTerreiro = (_g = (_f = withCheckin.location) === null || _f === void 0 ? void 0 : _f.isInTerreiro) !== null && _g !== void 0 ? _g : true;
|
|
140011
140049
|
if (shouldDefaultToTerreiro && !isTerreiroAddressEmpty) {
|
|
140012
|
-
const existing = ((_k = (_j = (_h =
|
|
140050
|
+
const existing = ((_k = (_j = (_h = withCheckin.location) === null || _h === void 0 ? void 0 : _h.knownLocation) === null || _j === void 0 ? void 0 : _j.trim) === null || _k === void 0 ? void 0 : _k.call(_j)) || "";
|
|
140013
140051
|
const fallback = (knownLocations && knownLocations[0]) || "Endereço do Terreiro";
|
|
140014
|
-
return Object.assign(Object.assign({},
|
|
140052
|
+
return Object.assign(Object.assign({}, withCheckin), { location: Object.assign(Object.assign({}, withCheckin.location), { isInTerreiro: true, knownLocation: existing || fallback }) });
|
|
140015
140053
|
}
|
|
140016
|
-
return
|
|
140054
|
+
return withCheckin;
|
|
140017
140055
|
};
|
|
140018
140056
|
// ---------------------------------------------------------------------------
|
|
140019
140057
|
// Hook
|
|
@@ -140023,7 +140061,7 @@ const useEventOnboarding = (props) => {
|
|
|
140023
140061
|
const { initialData, isTerreiroAddressEmpty, knownLocations, createFromModel, availableActivities, canAddActivities = true, activityQuotaMessage, canCreateTemplates = true, templateQuotaMessage, availableMembers, availableInsumos, onComplete, onCancel, onStepChange: onStepChangeProp, onRequestAISuggestions, isAISuggestionsLoading = false, isPersonalProfile = false, enableGoogleAddress = false, googleMapsApiKey, googleCountryCode = "br", googleLanguage = "pt-BR", } = props;
|
|
140024
140062
|
const [isLoading, setIsLoading] = React$1.useState(false);
|
|
140025
140063
|
const [error, setError] = React$1.useState();
|
|
140026
|
-
const initialFormState = React$1.useMemo(() => buildInitialFormState(initialData, isTerreiroAddressEmpty, knownLocations), [initialData, isTerreiroAddressEmpty, knownLocations]);
|
|
140064
|
+
const initialFormState = React$1.useMemo(() => buildInitialFormState(initialData, isTerreiroAddressEmpty, knownLocations, isPersonalProfile), [initialData, isTerreiroAddressEmpty, knownLocations, isPersonalProfile]);
|
|
140027
140065
|
// -----------------------------------------------------------------------
|
|
140028
140066
|
// Step definitions — pure data, no inline wrapper components
|
|
140029
140067
|
// -----------------------------------------------------------------------
|
|
@@ -140066,7 +140104,7 @@ const useEventOnboarding = (props) => {
|
|
|
140066
140104
|
id: "checkin-window",
|
|
140067
140105
|
label: "Check-in",
|
|
140068
140106
|
title: "Configurar Check-in",
|
|
140069
|
-
description: "
|
|
140107
|
+
description: "Escolha se haverá check-in e, se houver, o período permitido",
|
|
140070
140108
|
component: EventCheckinWindowStep,
|
|
140071
140109
|
},
|
|
140072
140110
|
]),
|
|
@@ -140383,17 +140421,18 @@ const EventDateTime = ({ event, checkinWindow, formatDate, formatTime, theme, })
|
|
|
140383
140421
|
? formatTime(firstOccurrence.endTime)
|
|
140384
140422
|
: "Não definido"))),
|
|
140385
140423
|
isAllDay && (React$1.createElement(Chip$1, { label: "Dia inteiro", size: "small", color: "primary", variant: "outlined", sx: { mb: 1.5 } })),
|
|
140386
|
-
React$1.createElement(
|
|
140387
|
-
React$1.createElement(
|
|
140388
|
-
|
|
140389
|
-
|
|
140390
|
-
|
|
140391
|
-
|
|
140392
|
-
|
|
140393
|
-
"
|
|
140394
|
-
|
|
140395
|
-
|
|
140396
|
-
|
|
140424
|
+
event.qrCheckinEnabled !== false ? (React$1.createElement(React$1.Fragment, null,
|
|
140425
|
+
React$1.createElement(Box$1, { sx: { display: "flex", alignItems: "center", mb: 0.75 } },
|
|
140426
|
+
React$1.createElement(AccessTime, { sx: {
|
|
140427
|
+
mr: 1.5,
|
|
140428
|
+
color: "text.secondary",
|
|
140429
|
+
fontSize: { xs: 18, sm: 20 },
|
|
140430
|
+
} }),
|
|
140431
|
+
React$1.createElement(Typography$1, { variant: "body2", color: "text.secondary", sx: { mr: 1 } },
|
|
140432
|
+
"Check-in v\u00E1lido: ",
|
|
140433
|
+
getCheckinSummary()),
|
|
140434
|
+
checkinWindow ? (React$1.createElement(Chip$1, { label: stateLabel[checkinWindow.state], size: "small", color: stateColor[checkinWindow.state], variant: "outlined" })) : null),
|
|
140435
|
+
getCheckinExplanation() ? (React$1.createElement(Typography$1, { variant: "caption", color: "text.secondary" }, getCheckinExplanation())) : null)) : null)));
|
|
140397
140436
|
};
|
|
140398
140437
|
var EventDateTime$1 = React$1.memo(EventDateTime);
|
|
140399
140438
|
|
|
@@ -140924,7 +140963,9 @@ const EventActivities = ({ event, theme, formatDate, formatTime, canChangeActivi
|
|
|
140924
140963
|
} },
|
|
140925
140964
|
React$1.createElement(Typography$1, { variant: "h6", fontWeight: "medium" }, activity.title),
|
|
140926
140965
|
React$1.createElement(Box$1, { sx: { display: "flex", gap: 1, alignItems: "flex-start" } },
|
|
140927
|
-
!isModelEvent &&
|
|
140966
|
+
!isModelEvent &&
|
|
140967
|
+
onActivityQrOpen &&
|
|
140968
|
+
activity.qrCheckinEnabled !== false && (React$1.createElement(Box$1, { sx: {
|
|
140928
140969
|
display: "flex",
|
|
140929
140970
|
flexDirection: "column",
|
|
140930
140971
|
alignItems: "flex-end",
|
|
@@ -140981,6 +141022,7 @@ const EventActivities = ({ event, theme, formatDate, formatTime, canChangeActivi
|
|
|
140981
141022
|
? formatTime(activity.occurrences[0].endTime)
|
|
140982
141023
|
: "Não definido")))),
|
|
140983
141024
|
!isModelEvent &&
|
|
141025
|
+
activity.qrCheckinEnabled !== false &&
|
|
140984
141026
|
(() => {
|
|
140985
141027
|
var _a, _b, _c, _d;
|
|
140986
141028
|
const startMinutes = parseTimeToMinutes$2((_b = (_a = activity.occurrences) === null || _a === void 0 ? void 0 : _a[0]) === null || _b === void 0 ? void 0 : _b.startTime);
|
|
@@ -141457,6 +141499,7 @@ const TerreiroSchema = objectType({
|
|
|
141457
141499
|
const ActivitySchema = objectType({
|
|
141458
141500
|
id: stringType(),
|
|
141459
141501
|
requiredForConfirmation: booleanType().optional(),
|
|
141502
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
141460
141503
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
141461
141504
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
141462
141505
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -141483,6 +141526,7 @@ const EventDetailSchema = objectType({
|
|
|
141483
141526
|
name: stringType().optional(),
|
|
141484
141527
|
description: stringType().optional(),
|
|
141485
141528
|
isTemplate: booleanType().optional(),
|
|
141529
|
+
qrCheckinEnabled: booleanType().optional(),
|
|
141486
141530
|
qrReleaseOffsetMinutes: numberType().nullable().optional(),
|
|
141487
141531
|
qrCheckinGraceMinutes: numberType().nullable().optional(),
|
|
141488
141532
|
checkinStartWindowMinutes: numberType().nullable().optional(),
|
|
@@ -142010,7 +142054,9 @@ const EventDetailPage = (props) => {
|
|
|
142010
142054
|
}
|
|
142011
142055
|
const statusOptions = data.getStatusMenuOptions(data.event);
|
|
142012
142056
|
const currentMember = (_c = data.event.members) === null || _c === void 0 ? void 0 : _c.list.find((m) => m.id === data.currentMemberId);
|
|
142013
|
-
const
|
|
142057
|
+
const checkinEnabled = data.event.qrCheckinEnabled !== false;
|
|
142058
|
+
const canShowCheckinCta = checkinEnabled &&
|
|
142059
|
+
props.canScanCheckin &&
|
|
142014
142060
|
((_d = props.checkinWindow) === null || _d === void 0 ? void 0 : _d.state) === "active" &&
|
|
142015
142061
|
!(currentMember === null || currentMember === void 0 ? void 0 : currentMember.confirmedAt) &&
|
|
142016
142062
|
!props.isPersonalProfile;
|
|
@@ -142045,7 +142091,7 @@ const EventDetailPage = (props) => {
|
|
|
142045
142091
|
React$1.createElement(Stack$1, { spacing: LIST_GAP },
|
|
142046
142092
|
React$1.createElement(EventInfo$1, { event: data.event, canChangeStatus: props.canChangeStatus || false, canUseModel: props.canUseModel || false, statusOptions: statusOptions, onStatusChange: (status) => fns.handleChangeStatus(status), onUseModel: fns.handleUseModel, theme: theme }),
|
|
142047
142093
|
React$1.createElement(EventDateTime$1, { event: data.event, checkinWindow: props.checkinWindow, formatDate: data.formatDate, formatTime: data.formatTime, theme: theme }),
|
|
142048
|
-
props.canManageQr && (React$1.createElement(EventAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState, onCopyCode: fns.handleCopyCode })),
|
|
142094
|
+
props.canManageQr && checkinEnabled && (React$1.createElement(EventAttendanceQr, { attendanceQr: props.attendanceQr, onRefreshQrState: props.onRefreshQrState, onCopyCode: fns.handleCopyCode })),
|
|
142049
142095
|
props.canManageTickets && (React$1.createElement(EventPublicTickets$1, { onManageTickets: props.onManageTickets, theme: theme })),
|
|
142050
142096
|
data.event.address && (React$1.createElement(EventAddress$1, { event: data.event, theme: theme })),
|
|
142051
142097
|
data.event.activities && data.event.activities.count > 0 && (React$1.createElement(EventActivities$1, { event: data.event, theme: theme, formatDate: data.formatDate, formatTime: data.formatTime, activityAttendanceQrById: props.activityAttendanceQrById, canChangeActivityStatus: props.canChangeActivityStatus || false, getStatusMenuOptions: data.getActivityStatusMenuOptions, onChangeActivityStatus: fns.handleChangeActivityStatus, onBulkChangeActivityStatus: fns.handleBulkChangeActivityStatus, onActivityQrOpen: props.canManageQr ? setSelectedActivityQrId : undefined })),
|
|
@@ -143065,6 +143111,8 @@ const formatMinutesToHHMM$1 = (totalMinutes) => {
|
|
|
143065
143111
|
};
|
|
143066
143112
|
const getConfiguredCheckinWindow = (event) => {
|
|
143067
143113
|
var _a, _b, _c, _d, _e;
|
|
143114
|
+
if (event.qrCheckinEnabled === false)
|
|
143115
|
+
return null;
|
|
143068
143116
|
const startTime = (_c = (_b = (_a = event.occurrences) === null || _a === void 0 ? void 0 : _a.list) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.startTime;
|
|
143069
143117
|
const startMinutes = parseTimeToMinutes$1(startTime);
|
|
143070
143118
|
if (startMinutes === null)
|
|
@@ -147238,6 +147286,7 @@ const ACTION_ICON_MAP = {
|
|
|
147238
147286
|
"🧘": React$1.createElement(Spa, null),
|
|
147239
147287
|
"🎓": React$1.createElement(School$1, null),
|
|
147240
147288
|
"🌐": React$1.createElement(Public, null),
|
|
147289
|
+
place: React$1.createElement(Place, null),
|
|
147241
147290
|
social: React$1.createElement(Public, null),
|
|
147242
147291
|
public: React$1.createElement(Public, null),
|
|
147243
147292
|
};
|
|
@@ -147896,7 +147945,7 @@ function getEventCoordinates(event) {
|
|
|
147896
147945
|
return null;
|
|
147897
147946
|
}
|
|
147898
147947
|
|
|
147899
|
-
const CSS = /*#__PURE__*/Object.freeze({
|
|
147948
|
+
const CSS$1 = /*#__PURE__*/Object.freeze({
|
|
147900
147949
|
Translate: {
|
|
147901
147950
|
toString(transform) {
|
|
147902
147951
|
if (!transform) {
|
|
@@ -147931,7 +147980,7 @@ const CSS = /*#__PURE__*/Object.freeze({
|
|
|
147931
147980
|
return;
|
|
147932
147981
|
}
|
|
147933
147982
|
|
|
147934
|
-
return [CSS.Translate.toString(transform), CSS.Scale.toString(transform)].join(' ');
|
|
147983
|
+
return [CSS$1.Translate.toString(transform), CSS$1.Scale.toString(transform)].join(' ');
|
|
147935
147984
|
}
|
|
147936
147985
|
|
|
147937
147986
|
},
|
|
@@ -151770,7 +151819,7 @@ const defaultTransition = {
|
|
|
151770
151819
|
easing: 'ease'
|
|
151771
151820
|
};
|
|
151772
151821
|
const transitionProperty = 'transform';
|
|
151773
|
-
const disabledTransition = /*#__PURE__*/CSS.Transition.toString({
|
|
151822
|
+
const disabledTransition = /*#__PURE__*/CSS$1.Transition.toString({
|
|
151774
151823
|
property: transitionProperty,
|
|
151775
151824
|
duration: 0,
|
|
151776
151825
|
easing: 'linear'
|
|
@@ -152004,7 +152053,7 @@ function useSortable(_ref) {
|
|
|
152004
152053
|
}
|
|
152005
152054
|
|
|
152006
152055
|
if (isSorting || shouldAnimateLayoutChanges) {
|
|
152007
|
-
return CSS.Transition.toString({ ...transition,
|
|
152056
|
+
return CSS$1.Transition.toString({ ...transition,
|
|
152008
152057
|
property: transitionProperty
|
|
152009
152058
|
});
|
|
152010
152059
|
}
|
|
@@ -152691,7 +152740,7 @@ const SortableOrderRow = ({ widget, index, total, onMove }) => {
|
|
|
152691
152740
|
const theme = useTheme$1();
|
|
152692
152741
|
const { attributes, listeners, setNodeRef, setActivatorNodeRef, transform, transition, isDragging, } = useSortable({ id: widget.id });
|
|
152693
152742
|
return (React$1.createElement(Box$1, { ref: setNodeRef, style: {
|
|
152694
|
-
transform: CSS.Transform.toString(transform),
|
|
152743
|
+
transform: CSS$1.Transform.toString(transform),
|
|
152695
152744
|
transition,
|
|
152696
152745
|
}, sx: {
|
|
152697
152746
|
display: "flex",
|
|
@@ -153260,6 +153309,8 @@ const formatMinutesToHHMM = (totalMinutes) => {
|
|
|
153260
153309
|
};
|
|
153261
153310
|
const getCheckinWindowRange = (event) => {
|
|
153262
153311
|
var _a, _b;
|
|
153312
|
+
if (event.qrCheckinEnabled === false)
|
|
153313
|
+
return null;
|
|
153263
153314
|
const startMinutes = parseTimeToMinutes(event.time);
|
|
153264
153315
|
if (startMinutes === null)
|
|
153265
153316
|
return null;
|
|
@@ -155027,6 +155078,14 @@ const useHomePage = (props) => {
|
|
|
155027
155078
|
route: "/terreiro",
|
|
155028
155079
|
color: "primary",
|
|
155029
155080
|
},
|
|
155081
|
+
{
|
|
155082
|
+
id: "terreiro-search",
|
|
155083
|
+
title: "Terreiros",
|
|
155084
|
+
description: "Buscar casas próximas",
|
|
155085
|
+
icon: "place",
|
|
155086
|
+
route: "/terreiros/buscar",
|
|
155087
|
+
color: "primary",
|
|
155088
|
+
},
|
|
155030
155089
|
{
|
|
155031
155090
|
id: "mediums",
|
|
155032
155091
|
title: "Médiuns",
|
|
@@ -155162,6 +155221,7 @@ const useHomePage = (props) => {
|
|
|
155162
155221
|
// Admin + personal: include Social when feature enabled
|
|
155163
155222
|
return withSocialUnreadBadge(filterByIds(withSocialPersonalOnly(withIngressos([
|
|
155164
155223
|
"terreiro",
|
|
155224
|
+
"terreiro-search",
|
|
155165
155225
|
"activities",
|
|
155166
155226
|
"ritual-baths",
|
|
155167
155227
|
"inventory",
|
|
@@ -155173,6 +155233,7 @@ const useHomePage = (props) => {
|
|
|
155173
155233
|
// Admin + terreiro: no Social
|
|
155174
155234
|
return filterByIds(withIngressos([
|
|
155175
155235
|
"terreiro",
|
|
155236
|
+
"terreiro-search",
|
|
155176
155237
|
"mediums",
|
|
155177
155238
|
"activities",
|
|
155178
155239
|
"events",
|
|
@@ -155187,6 +155248,7 @@ const useHomePage = (props) => {
|
|
|
155187
155248
|
if (selectedTerreiro) {
|
|
155188
155249
|
const filtered = filterByIds(withIngressos([
|
|
155189
155250
|
"terreiro",
|
|
155251
|
+
"terreiro-search",
|
|
155190
155252
|
"mediums",
|
|
155191
155253
|
"activities",
|
|
155192
155254
|
"events",
|
|
@@ -155200,6 +155262,7 @@ const useHomePage = (props) => {
|
|
|
155200
155262
|
// Non-admin + personal profile: include Social when feature enabled
|
|
155201
155263
|
return withSocialUnreadBadge(filterByIds(withSocialPersonalOnly([
|
|
155202
155264
|
"terreiro",
|
|
155265
|
+
"terreiro-search",
|
|
155203
155266
|
"activities",
|
|
155204
155267
|
"ritual-baths",
|
|
155205
155268
|
"inventory",
|
|
@@ -161037,7 +161100,7 @@ const FormGrid$8 = styled$1(Grid$1)(({ theme }) => ({
|
|
|
161037
161100
|
const CEP_MIN_LENGTH = 8;
|
|
161038
161101
|
const ZIP_PLACEHOLDER = "00000-000";
|
|
161039
161102
|
const ADORNMENT_SPINNER_SIZE = 20;
|
|
161040
|
-
const GOOGLE_SEARCH_PLACEHOLDER = "Digite o endereço para buscar no Google";
|
|
161103
|
+
const GOOGLE_SEARCH_PLACEHOLDER$1 = "Digite o endereço para buscar no Google";
|
|
161041
161104
|
const AddressPage = (props) => {
|
|
161042
161105
|
const theme = useTheme$1();
|
|
161043
161106
|
const { data, fns } = useAddressPage(props);
|
|
@@ -161109,7 +161172,7 @@ const AddressPage = (props) => {
|
|
|
161109
161172
|
}
|
|
161110
161173
|
}, onChange: (_, newValue) => {
|
|
161111
161174
|
fns.handleGoogleSuggestionSelect(newValue);
|
|
161112
|
-
}, renderInput: (params) => (React$1.createElement(TextField$1, Object.assign({}, params, { label: "Buscar endere\u00E7o", placeholder: GOOGLE_SEARCH_PLACEHOLDER, fullWidth: true, "data-testid": "address-google-search", InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React$1.createElement(InputAdornment$1, { position: "start" },
|
|
161175
|
+
}, renderInput: (params) => (React$1.createElement(TextField$1, Object.assign({}, params, { label: "Buscar endere\u00E7o", placeholder: GOOGLE_SEARCH_PLACEHOLDER$1, fullWidth: true, "data-testid": "address-google-search", InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React$1.createElement(InputAdornment$1, { position: "start" },
|
|
161113
161176
|
React$1.createElement(LocationOn, { sx: { color: theme.palette.text.secondary } }))) }) }))) }),
|
|
161114
161177
|
data.googleSearchError && (React$1.createElement(Box$1, { sx: { mt: 1 } },
|
|
161115
161178
|
React$1.createElement(Alert$1, { severity: "warning" }, data.googleSearchError))),
|
|
@@ -181417,6 +181480,733 @@ const QrLandingPagePropsSchema = objectType({
|
|
|
181417
181480
|
.optional(),
|
|
181418
181481
|
});
|
|
181419
181482
|
|
|
181483
|
+
const GOOGLE_SEARCH_PLACEHOLDER = "Digite o endereço para buscar no Google";
|
|
181484
|
+
const MIN_SEARCH_LENGTH = 3;
|
|
181485
|
+
const TerreiroLocationSearch = ({ apiKey, onSelect, onUnavailable, }) => {
|
|
181486
|
+
const theme = useTheme$1();
|
|
181487
|
+
const onUnavailableRef = React$1.useRef(onUnavailable);
|
|
181488
|
+
const onSelectRef = React$1.useRef(onSelect);
|
|
181489
|
+
onUnavailableRef.current = onUnavailable;
|
|
181490
|
+
onSelectRef.current = onSelect;
|
|
181491
|
+
const servicesRef = React$1.useRef({});
|
|
181492
|
+
const [ready, setReady] = React$1.useState(false);
|
|
181493
|
+
const [loading, setLoading] = React$1.useState(false);
|
|
181494
|
+
const [inputValue, setInputValue] = React$1.useState("");
|
|
181495
|
+
const [suggestions, setSuggestions] = React$1.useState([]);
|
|
181496
|
+
const [error, setError] = React$1.useState(null);
|
|
181497
|
+
React$1.useEffect(() => {
|
|
181498
|
+
let cancelled = false;
|
|
181499
|
+
loadGoogleMapsPlacesScript(apiKey, "pt-BR", "BR")
|
|
181500
|
+
.then(() => {
|
|
181501
|
+
var _a, _b;
|
|
181502
|
+
if (cancelled)
|
|
181503
|
+
return;
|
|
181504
|
+
const places = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places;
|
|
181505
|
+
if (!(places === null || places === void 0 ? void 0 : places.AutocompleteService) || !(places === null || places === void 0 ? void 0 : places.PlacesService)) {
|
|
181506
|
+
onUnavailableRef.current();
|
|
181507
|
+
return;
|
|
181508
|
+
}
|
|
181509
|
+
servicesRef.current.autocompleteService = new places.AutocompleteService();
|
|
181510
|
+
const container = document.createElement("div");
|
|
181511
|
+
servicesRef.current.placesService = new places.PlacesService(container);
|
|
181512
|
+
setReady(true);
|
|
181513
|
+
})
|
|
181514
|
+
.catch(() => {
|
|
181515
|
+
if (!cancelled)
|
|
181516
|
+
onUnavailableRef.current();
|
|
181517
|
+
});
|
|
181518
|
+
return () => {
|
|
181519
|
+
cancelled = true;
|
|
181520
|
+
};
|
|
181521
|
+
}, [apiKey]);
|
|
181522
|
+
const search = (value) => {
|
|
181523
|
+
var _a, _b;
|
|
181524
|
+
const autocomplete = servicesRef.current.autocompleteService;
|
|
181525
|
+
const places = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places;
|
|
181526
|
+
if (!autocomplete || !places)
|
|
181527
|
+
return;
|
|
181528
|
+
if (value.trim().length < MIN_SEARCH_LENGTH) {
|
|
181529
|
+
setSuggestions([]);
|
|
181530
|
+
setError(null);
|
|
181531
|
+
return;
|
|
181532
|
+
}
|
|
181533
|
+
setLoading(true);
|
|
181534
|
+
setError(null);
|
|
181535
|
+
autocomplete.getPlacePredictions({
|
|
181536
|
+
input: value,
|
|
181537
|
+
componentRestrictions: { country: "br" },
|
|
181538
|
+
types: ["address"],
|
|
181539
|
+
}, (predictions, status) => {
|
|
181540
|
+
setLoading(false);
|
|
181541
|
+
if (status !== places.PlacesServiceStatus.OK) {
|
|
181542
|
+
setSuggestions([]);
|
|
181543
|
+
if (status !== places.PlacesServiceStatus.ZERO_RESULTS) {
|
|
181544
|
+
setError("Não foi possível buscar endereços no Google");
|
|
181545
|
+
}
|
|
181546
|
+
return;
|
|
181547
|
+
}
|
|
181548
|
+
setSuggestions((predictions !== null && predictions !== void 0 ? predictions : []).map((prediction) => ({
|
|
181549
|
+
description: prediction.description,
|
|
181550
|
+
placeId: prediction.place_id,
|
|
181551
|
+
})));
|
|
181552
|
+
});
|
|
181553
|
+
};
|
|
181554
|
+
const selectSuggestion = (suggestion) => {
|
|
181555
|
+
var _a, _b;
|
|
181556
|
+
if (!suggestion)
|
|
181557
|
+
return;
|
|
181558
|
+
const placesService = servicesRef.current.placesService;
|
|
181559
|
+
const places = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.places;
|
|
181560
|
+
if (!placesService || !places) {
|
|
181561
|
+
setError("Não foi possível carregar os detalhes do endereço");
|
|
181562
|
+
return;
|
|
181563
|
+
}
|
|
181564
|
+
setInputValue(suggestion.description);
|
|
181565
|
+
setLoading(true);
|
|
181566
|
+
setError(null);
|
|
181567
|
+
placesService.getDetails({
|
|
181568
|
+
placeId: suggestion.placeId,
|
|
181569
|
+
fields: ["address_components", "formatted_address"],
|
|
181570
|
+
}, (place, status) => {
|
|
181571
|
+
var _a;
|
|
181572
|
+
setLoading(false);
|
|
181573
|
+
if (status !== places.PlacesServiceStatus.OK || !place) {
|
|
181574
|
+
setError("Não foi possível obter detalhes do endereço");
|
|
181575
|
+
return;
|
|
181576
|
+
}
|
|
181577
|
+
const mapped = mapGooglePlaceToAddressForm({
|
|
181578
|
+
address_components: place.address_components,
|
|
181579
|
+
formatted_address: place.formatted_address,
|
|
181580
|
+
});
|
|
181581
|
+
if (!mapped.city) {
|
|
181582
|
+
setError("Não foi possível identificar a cidade deste endereço");
|
|
181583
|
+
return;
|
|
181584
|
+
}
|
|
181585
|
+
onSelectRef.current(mapped.city, (_a = mapped.state) !== null && _a !== void 0 ? _a : "");
|
|
181586
|
+
});
|
|
181587
|
+
};
|
|
181588
|
+
if (!ready)
|
|
181589
|
+
return null;
|
|
181590
|
+
return (React$1.createElement(Autocomplete$1, { options: suggestions, getOptionLabel: (option) => option.description, filterOptions: (options) => options, loading: loading, inputValue: inputValue, onInputChange: (_, value, reason) => {
|
|
181591
|
+
if (reason !== "input" && reason !== "clear")
|
|
181592
|
+
return;
|
|
181593
|
+
setInputValue(value);
|
|
181594
|
+
search(value);
|
|
181595
|
+
}, onChange: (_, value) => selectSuggestion(value), isOptionEqualToValue: (option, value) => option.placeId === value.placeId, noOptionsText: error !== null && error !== void 0 ? error : (inputValue.trim().length >= MIN_SEARCH_LENGTH
|
|
181596
|
+
? "Nenhum endereço encontrado para esta busca."
|
|
181597
|
+
: "Digite ao menos 3 caracteres"), renderInput: (params) => (React$1.createElement(TextField$1, Object.assign({}, params, { label: "Buscar endere\u00E7o", placeholder: GOOGLE_SEARCH_PLACEHOLDER, fullWidth: true, error: Boolean(error), helperText: error !== null && error !== void 0 ? error : undefined, inputProps: Object.assign(Object.assign({}, params.inputProps), { "data-testid": "terreiro-search-address" }), sx: {
|
|
181598
|
+
"& .MuiInputBase-input": { color: "text.primary" },
|
|
181599
|
+
"& .MuiInputBase-input::placeholder": { color: "text.secondary", opacity: 1 },
|
|
181600
|
+
}, InputProps: Object.assign(Object.assign({}, params.InputProps), { startAdornment: (React$1.createElement(InputAdornment$1, { position: "start" },
|
|
181601
|
+
React$1.createElement(LocationOn, { sx: { color: theme.palette.text.secondary } }))), endAdornment: (React$1.createElement(React$1.Fragment, null,
|
|
181602
|
+
loading ? React$1.createElement(CircularProgress$1, { size: 20 }) : null,
|
|
181603
|
+
params.InputProps.endAdornment)) }) }))) }));
|
|
181604
|
+
};
|
|
181605
|
+
|
|
181606
|
+
const BRAZIL_CENTER = { lat: -14.2, lng: -51.9 };
|
|
181607
|
+
const BRAZIL_ZOOM = 4;
|
|
181608
|
+
const SINGLE_RESULT_ZOOM = 15;
|
|
181609
|
+
const USER_LOCATION_ZOOM = 13;
|
|
181610
|
+
const PIN_ORANGE = "#BA4813";
|
|
181611
|
+
const PIN_COAL = "#201C10";
|
|
181612
|
+
const PIN_CREAM = "#F3E2B3";
|
|
181613
|
+
const mapColorScheme = (mode) => {
|
|
181614
|
+
var _a, _b;
|
|
181615
|
+
const scheme = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.ColorScheme;
|
|
181616
|
+
if (!scheme)
|
|
181617
|
+
return undefined;
|
|
181618
|
+
if (scheme.FOLLOW_SYSTEM)
|
|
181619
|
+
return scheme.FOLLOW_SYSTEM;
|
|
181620
|
+
return mode === "dark" ? scheme.DARK : scheme.LIGHT;
|
|
181621
|
+
};
|
|
181622
|
+
const finitePlaces = (results) => (results !== null && results !== void 0 ? results : []).filter((place) => Number.isFinite(place.latitude) && Number.isFinite(place.longitude));
|
|
181623
|
+
const pinIcon = (selected, mode) => {
|
|
181624
|
+
var _a, _b, _c;
|
|
181625
|
+
const maps = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps;
|
|
181626
|
+
const idleFill = mode === "dark" ? PIN_CREAM : PIN_COAL;
|
|
181627
|
+
const idleStroke = mode === "dark" ? PIN_COAL : PIN_CREAM;
|
|
181628
|
+
return {
|
|
181629
|
+
path: (_c = (_b = maps === null || maps === void 0 ? void 0 : maps.SymbolPath) === null || _b === void 0 ? void 0 : _b.CIRCLE) !== null && _c !== void 0 ? _c : 0,
|
|
181630
|
+
scale: selected ? 11 : 8,
|
|
181631
|
+
fillColor: selected ? PIN_ORANGE : idleFill,
|
|
181632
|
+
fillOpacity: 1,
|
|
181633
|
+
strokeColor: selected ? PIN_CREAM : idleStroke,
|
|
181634
|
+
strokeWeight: 2,
|
|
181635
|
+
};
|
|
181636
|
+
};
|
|
181637
|
+
const TerreiroResultMap = ({ apiKey, results, selectedPlaceId, userCoordinates, layoutKey = null, onSelectPlace, }) => {
|
|
181638
|
+
var _a, _b;
|
|
181639
|
+
const theme = useTheme$1();
|
|
181640
|
+
const mode = theme.palette.mode;
|
|
181641
|
+
const modeRef = React$1.useRef(mode);
|
|
181642
|
+
modeRef.current = mode;
|
|
181643
|
+
const containerRef = React$1.useRef(null);
|
|
181644
|
+
const mapRef = React$1.useRef(null);
|
|
181645
|
+
const markersRef = React$1.useRef(new Map());
|
|
181646
|
+
const onSelectRef = React$1.useRef(onSelectPlace);
|
|
181647
|
+
const resultsRef = React$1.useRef(results);
|
|
181648
|
+
const userCoordinatesRef = React$1.useRef(userCoordinates);
|
|
181649
|
+
const selectedPlaceIdRef = React$1.useRef(selectedPlaceId);
|
|
181650
|
+
const [mapReady, setMapReady] = React$1.useState(false);
|
|
181651
|
+
const [mapFailed, setMapFailed] = React$1.useState(!(apiKey === null || apiKey === void 0 ? void 0 : apiKey.trim()));
|
|
181652
|
+
const [mapEpoch, setMapEpoch] = React$1.useState(0);
|
|
181653
|
+
onSelectRef.current = onSelectPlace;
|
|
181654
|
+
resultsRef.current = results;
|
|
181655
|
+
userCoordinatesRef.current = userCoordinates;
|
|
181656
|
+
selectedPlaceIdRef.current = selectedPlaceId;
|
|
181657
|
+
const trimmedKey = (_a = apiKey === null || apiKey === void 0 ? void 0 : apiKey.trim()) !== null && _a !== void 0 ? _a : "";
|
|
181658
|
+
const resultSignature = (_b = results === null || results === void 0 ? void 0 : results.map((place) => `${place.placeId}:${place.latitude}:${place.longitude}`).join("|")) !== null && _b !== void 0 ? _b : "";
|
|
181659
|
+
const userLocationKey = userCoordinates
|
|
181660
|
+
? `${userCoordinates.latitude},${userCoordinates.longitude}`
|
|
181661
|
+
: "";
|
|
181662
|
+
React$1.useEffect(() => {
|
|
181663
|
+
if (!trimmedKey) {
|
|
181664
|
+
setMapFailed(true);
|
|
181665
|
+
setMapReady(false);
|
|
181666
|
+
return;
|
|
181667
|
+
}
|
|
181668
|
+
let cancelled = false;
|
|
181669
|
+
setMapFailed(false);
|
|
181670
|
+
loadGoogleMapsPlacesScript(trimmedKey, "pt-BR", "BR")
|
|
181671
|
+
.then(() => {
|
|
181672
|
+
var _a, _b, _c, _d;
|
|
181673
|
+
if (cancelled)
|
|
181674
|
+
return;
|
|
181675
|
+
if (!((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.Map) || !((_d = (_c = window.google) === null || _c === void 0 ? void 0 : _c.maps) === null || _d === void 0 ? void 0 : _d.Marker)) {
|
|
181676
|
+
setMapFailed(true);
|
|
181677
|
+
return;
|
|
181678
|
+
}
|
|
181679
|
+
setMapReady(true);
|
|
181680
|
+
})
|
|
181681
|
+
.catch(() => {
|
|
181682
|
+
if (!cancelled)
|
|
181683
|
+
setMapFailed(true);
|
|
181684
|
+
});
|
|
181685
|
+
return () => {
|
|
181686
|
+
cancelled = true;
|
|
181687
|
+
};
|
|
181688
|
+
}, [trimmedKey]);
|
|
181689
|
+
React$1.useEffect(() => {
|
|
181690
|
+
var _a, _b;
|
|
181691
|
+
if (!mapReady || !containerRef.current || !((_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.Map))
|
|
181692
|
+
return;
|
|
181693
|
+
const colorScheme = mapColorScheme(modeRef.current);
|
|
181694
|
+
const map = new window.google.maps.Map(containerRef.current, Object.assign({ center: BRAZIL_CENTER, zoom: BRAZIL_ZOOM, disableDefaultUI: true, zoomControl: true, clickableIcons: false, gestureHandling: "greedy", mapTypeControl: false, streetViewControl: false, fullscreenControl: false }, (colorScheme ? { colorScheme } : {})));
|
|
181695
|
+
mapRef.current = map;
|
|
181696
|
+
setMapEpoch((epoch) => epoch + 1);
|
|
181697
|
+
return () => {
|
|
181698
|
+
markersRef.current.forEach((marker) => marker.setMap(null));
|
|
181699
|
+
markersRef.current.clear();
|
|
181700
|
+
mapRef.current = null;
|
|
181701
|
+
};
|
|
181702
|
+
}, [mapReady]);
|
|
181703
|
+
React$1.useEffect(() => {
|
|
181704
|
+
var _a;
|
|
181705
|
+
const map = mapRef.current;
|
|
181706
|
+
const maps = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps;
|
|
181707
|
+
if (!mapReady || !map || !(maps === null || maps === void 0 ? void 0 : maps.Marker))
|
|
181708
|
+
return;
|
|
181709
|
+
const places = finitePlaces(resultsRef.current);
|
|
181710
|
+
const nextIds = new Set(places.map((place) => place.placeId));
|
|
181711
|
+
markersRef.current.forEach((marker, id) => {
|
|
181712
|
+
if (!nextIds.has(id)) {
|
|
181713
|
+
marker.setMap(null);
|
|
181714
|
+
markersRef.current.delete(id);
|
|
181715
|
+
}
|
|
181716
|
+
});
|
|
181717
|
+
places.forEach((place) => {
|
|
181718
|
+
const position = { lat: place.latitude, lng: place.longitude };
|
|
181719
|
+
const existing = markersRef.current.get(place.placeId);
|
|
181720
|
+
if (existing) {
|
|
181721
|
+
existing.setPosition(position);
|
|
181722
|
+
return;
|
|
181723
|
+
}
|
|
181724
|
+
const marker = new maps.Marker({
|
|
181725
|
+
map,
|
|
181726
|
+
position,
|
|
181727
|
+
title: place.name,
|
|
181728
|
+
icon: pinIcon(place.placeId === selectedPlaceIdRef.current, modeRef.current),
|
|
181729
|
+
});
|
|
181730
|
+
marker.addListener("click", () => onSelectRef.current(place.placeId));
|
|
181731
|
+
markersRef.current.set(place.placeId, marker);
|
|
181732
|
+
});
|
|
181733
|
+
if (places.length === 1) {
|
|
181734
|
+
map.setCenter({ lat: places[0].latitude, lng: places[0].longitude });
|
|
181735
|
+
map.setZoom(SINGLE_RESULT_ZOOM);
|
|
181736
|
+
return;
|
|
181737
|
+
}
|
|
181738
|
+
if (places.length > 1) {
|
|
181739
|
+
const bounds = new maps.LatLngBounds();
|
|
181740
|
+
places.forEach((place) => {
|
|
181741
|
+
bounds.extend({ lat: place.latitude, lng: place.longitude });
|
|
181742
|
+
});
|
|
181743
|
+
map.fitBounds(bounds, 48);
|
|
181744
|
+
return;
|
|
181745
|
+
}
|
|
181746
|
+
const coords = userCoordinatesRef.current;
|
|
181747
|
+
if (coords && Number.isFinite(coords.latitude) && Number.isFinite(coords.longitude)) {
|
|
181748
|
+
map.setCenter({ lat: coords.latitude, lng: coords.longitude });
|
|
181749
|
+
map.setZoom(USER_LOCATION_ZOOM);
|
|
181750
|
+
return;
|
|
181751
|
+
}
|
|
181752
|
+
map.setCenter(BRAZIL_CENTER);
|
|
181753
|
+
map.setZoom(BRAZIL_ZOOM);
|
|
181754
|
+
}, [mapEpoch, mapReady, resultSignature, userLocationKey]);
|
|
181755
|
+
React$1.useEffect(() => {
|
|
181756
|
+
var _a;
|
|
181757
|
+
const map = mapRef.current;
|
|
181758
|
+
if (!mapReady || !map)
|
|
181759
|
+
return;
|
|
181760
|
+
const scheme = mapColorScheme(mode);
|
|
181761
|
+
if (scheme)
|
|
181762
|
+
(_a = map.setOptions) === null || _a === void 0 ? void 0 : _a.call(map, { colorScheme: scheme });
|
|
181763
|
+
markersRef.current.forEach((marker, id) => {
|
|
181764
|
+
marker.setIcon(pinIcon(id === selectedPlaceId, mode));
|
|
181765
|
+
});
|
|
181766
|
+
if (!selectedPlaceId)
|
|
181767
|
+
return;
|
|
181768
|
+
const place = finitePlaces(resultsRef.current).find((item) => item.placeId === selectedPlaceId);
|
|
181769
|
+
if (!place)
|
|
181770
|
+
return;
|
|
181771
|
+
map.panTo({ lat: place.latitude, lng: place.longitude });
|
|
181772
|
+
}, [mapEpoch, mapReady, mode, resultSignature, selectedPlaceId]);
|
|
181773
|
+
React$1.useEffect(() => {
|
|
181774
|
+
var _a, _b, _c, _d;
|
|
181775
|
+
const map = mapRef.current;
|
|
181776
|
+
if (!mapReady || !map || layoutKey === null)
|
|
181777
|
+
return;
|
|
181778
|
+
(_d = (_c = (_b = (_a = window.google) === null || _a === void 0 ? void 0 : _a.maps) === null || _b === void 0 ? void 0 : _b.event) === null || _c === void 0 ? void 0 : _c.trigger) === null || _d === void 0 ? void 0 : _d.call(_c, map, "resize");
|
|
181779
|
+
}, [layoutKey, mapEpoch, mapReady]);
|
|
181780
|
+
const showPlaceholder = !trimmedKey || mapFailed || !mapReady;
|
|
181781
|
+
return (React$1.createElement(Box$1, { sx: { position: "absolute", inset: 0 } },
|
|
181782
|
+
React$1.createElement(Box$1, { ref: containerRef, role: "region", "aria-label": "Mapa de terreiros", "data-testid": "terreiro-search-map", sx: { position: "absolute", inset: 0, bgcolor: "background.default" } }),
|
|
181783
|
+
showPlaceholder ? (React$1.createElement(Box$1, { "aria-hidden": true, "data-testid": "terreiro-search-map-placeholder", sx: {
|
|
181784
|
+
position: "absolute",
|
|
181785
|
+
inset: 0,
|
|
181786
|
+
bgcolor: "background.default",
|
|
181787
|
+
zIndex: 1,
|
|
181788
|
+
} })) : null));
|
|
181789
|
+
};
|
|
181790
|
+
|
|
181791
|
+
const TRADITIONS = ["Umbanda", "Candomblé", "Omolocô", "Quimbanda"];
|
|
181792
|
+
const statusLabel = (status) => {
|
|
181793
|
+
if (status === "CLOSED_PERMANENTLY")
|
|
181794
|
+
return "Fechado permanentemente";
|
|
181795
|
+
if (status === "CLOSED_TEMPORARILY")
|
|
181796
|
+
return "Fechado temporariamente";
|
|
181797
|
+
return null;
|
|
181798
|
+
};
|
|
181799
|
+
const traditionPressed = (query, tradition) => query.trim().localeCompare(tradition, "pt-BR", { sensitivity: "accent" }) === 0;
|
|
181800
|
+
const floatingControlShadow = "0 4px 16px rgba(32, 28, 16, 0.12)";
|
|
181801
|
+
const PEEK_HEIGHT = 72;
|
|
181802
|
+
const TOP_CLEARANCE = 120;
|
|
181803
|
+
const DRAG_SLOP = 5;
|
|
181804
|
+
const maxSheetHeight = () => {
|
|
181805
|
+
const viewport = typeof window === "undefined" ? 800 : window.innerHeight;
|
|
181806
|
+
return Math.max(PEEK_HEIGHT, viewport - TOP_CLEARANCE);
|
|
181807
|
+
};
|
|
181808
|
+
const defaultOpenHeight = () => {
|
|
181809
|
+
const viewport = typeof window === "undefined" ? 800 : window.innerHeight;
|
|
181810
|
+
return Math.round(Math.min(Math.max(viewport * 0.4, PEEK_HEIGHT), maxSheetHeight()));
|
|
181811
|
+
};
|
|
181812
|
+
const focusRing = {
|
|
181813
|
+
"&:focus-visible": {
|
|
181814
|
+
outline: "2px solid",
|
|
181815
|
+
outlineColor: "primary.main",
|
|
181816
|
+
outlineOffset: 2,
|
|
181817
|
+
},
|
|
181818
|
+
};
|
|
181819
|
+
const ResultRow = ({ place, selected, onSelect, onOpenMaps }) => {
|
|
181820
|
+
const closedLabel = statusLabel(place.businessStatus);
|
|
181821
|
+
return (React$1.createElement(Box$1, { component: "li", "data-testid": `terreiro-search-result-${place.placeId}`, sx: {
|
|
181822
|
+
display: "flex",
|
|
181823
|
+
alignItems: "center",
|
|
181824
|
+
gap: 0.5,
|
|
181825
|
+
minHeight: 56,
|
|
181826
|
+
listStyle: "none",
|
|
181827
|
+
} },
|
|
181828
|
+
React$1.createElement(Box$1, { component: "button", type: "button", "aria-pressed": selected, onClick: () => onSelect(place.placeId), sx: Object.assign({ flex: 1, minWidth: 0, minHeight: 56, display: "flex", alignItems: "center", gap: 1.5, py: 1, px: 0, border: 0, background: "transparent", textAlign: "left", cursor: "pointer", color: "inherit" }, focusRing) },
|
|
181829
|
+
React$1.createElement(Box$1, { "aria-hidden": true, sx: {
|
|
181830
|
+
width: 40,
|
|
181831
|
+
height: 40,
|
|
181832
|
+
borderRadius: "50%",
|
|
181833
|
+
display: "grid",
|
|
181834
|
+
placeItems: "center",
|
|
181835
|
+
flexShrink: 0,
|
|
181836
|
+
bgcolor: (theme) => alpha(selected ? theme.palette.primary.main : theme.palette.text.primary, 0.12),
|
|
181837
|
+
color: selected ? "primary.main" : "text.primary",
|
|
181838
|
+
} },
|
|
181839
|
+
React$1.createElement(PlaceOutlined, { fontSize: "small" })),
|
|
181840
|
+
React$1.createElement(Box$1, { sx: { minWidth: 0 } },
|
|
181841
|
+
React$1.createElement(Typography$1, { sx: {
|
|
181842
|
+
fontWeight: 700,
|
|
181843
|
+
fontSize: 16,
|
|
181844
|
+
color: selected ? "primary.main" : "text.primary",
|
|
181845
|
+
} }, place.name),
|
|
181846
|
+
React$1.createElement(Typography$1, { sx: { fontSize: 13, color: "text.secondary" } }, place.formattedAddress),
|
|
181847
|
+
closedLabel ? (React$1.createElement(Typography$1, { sx: { fontSize: 12, color: "text.secondary" } }, closedLabel)) : null)),
|
|
181848
|
+
React$1.createElement(Link$1, { href: place.googleMapsUrl, target: "_blank", rel: "noopener noreferrer", "aria-label": "Ver no Google Maps", "data-testid": `terreiro-search-maps-${place.placeId}`, onClick: () => onOpenMaps(place), sx: Object.assign({ width: 44, height: 44, display: "inline-flex", alignItems: "center", justifyContent: "center", flexShrink: 0, color: "text.primary", borderRadius: "50%" }, focusRing) },
|
|
181849
|
+
React$1.createElement(DirectionsOutlined, null))));
|
|
181850
|
+
};
|
|
181851
|
+
const NearbyTerreiroSearchPage = ({ query, onQueryChange, city, onCityChange, state, onStateChange, locationMode, geolocationNotice, isLocating = false, isLoading = false, isLoadingMore = false, results, errorMessage, hasMore = false, onSearch, onUseMyLocation, onRetry, onLoadMore, onOpenMaps, onBack, googleMapsApiKey, userCoordinates, }) => {
|
|
181852
|
+
const theme = useTheme$1();
|
|
181853
|
+
const isWide = useMediaQuery(theme.breakpoints.up("sm"));
|
|
181854
|
+
const [locationOpen, setLocationOpen] = React$1.useState(false);
|
|
181855
|
+
const [addressSearchUnavailable, setAddressSearchUnavailable] = React$1.useState(false);
|
|
181856
|
+
const [selectedPlaceId, setSelectedPlaceId] = React$1.useState(null);
|
|
181857
|
+
const [sheetHeight, setSheetHeight] = React$1.useState(null);
|
|
181858
|
+
const hasSheetContent = isLoading || Boolean(errorMessage) || results !== null;
|
|
181859
|
+
const listVisible = Boolean(results && results.length > 0);
|
|
181860
|
+
const previousMode = React$1.useRef(locationMode);
|
|
181861
|
+
const lastOpenHeight = React$1.useRef(defaultOpenHeight());
|
|
181862
|
+
const dragOrigin = React$1.useRef(null);
|
|
181863
|
+
const dragMoved = React$1.useRef(false);
|
|
181864
|
+
const resolvedSheetHeight = sheetHeight !== null && sheetHeight !== void 0 ? sheetHeight : defaultOpenHeight();
|
|
181865
|
+
const sheetOpen = resolvedSheetHeight > PEEK_HEIGHT + DRAG_SLOP;
|
|
181866
|
+
React$1.useEffect(() => {
|
|
181867
|
+
if (!listVisible || sheetHeight !== null)
|
|
181868
|
+
return;
|
|
181869
|
+
const open = defaultOpenHeight();
|
|
181870
|
+
lastOpenHeight.current = open;
|
|
181871
|
+
setSheetHeight(open);
|
|
181872
|
+
}, [listVisible, sheetHeight]);
|
|
181873
|
+
const toggleSheet = () => {
|
|
181874
|
+
setSheetHeight((current) => {
|
|
181875
|
+
const height = current !== null && current !== void 0 ? current : defaultOpenHeight();
|
|
181876
|
+
if (height <= PEEK_HEIGHT + DRAG_SLOP) {
|
|
181877
|
+
const open = lastOpenHeight.current > PEEK_HEIGHT + DRAG_SLOP
|
|
181878
|
+
? lastOpenHeight.current
|
|
181879
|
+
: defaultOpenHeight();
|
|
181880
|
+
return Math.min(open, maxSheetHeight());
|
|
181881
|
+
}
|
|
181882
|
+
lastOpenHeight.current = height;
|
|
181883
|
+
return PEEK_HEIGHT;
|
|
181884
|
+
});
|
|
181885
|
+
};
|
|
181886
|
+
const onHandlePointerDown = (event) => {
|
|
181887
|
+
if (!listVisible)
|
|
181888
|
+
return;
|
|
181889
|
+
dragMoved.current = false;
|
|
181890
|
+
dragOrigin.current = {
|
|
181891
|
+
y: event.clientY,
|
|
181892
|
+
height: sheetHeight !== null && sheetHeight !== void 0 ? sheetHeight : defaultOpenHeight(),
|
|
181893
|
+
};
|
|
181894
|
+
if (event.currentTarget.setPointerCapture && Number.isFinite(event.pointerId)) {
|
|
181895
|
+
event.currentTarget.setPointerCapture(event.pointerId);
|
|
181896
|
+
}
|
|
181897
|
+
};
|
|
181898
|
+
const onHandlePointerMove = (event) => {
|
|
181899
|
+
const origin = dragOrigin.current;
|
|
181900
|
+
if (!origin)
|
|
181901
|
+
return;
|
|
181902
|
+
if (Math.abs(origin.y - event.clientY) > DRAG_SLOP)
|
|
181903
|
+
dragMoved.current = true;
|
|
181904
|
+
if (!dragMoved.current)
|
|
181905
|
+
return;
|
|
181906
|
+
const next = Math.min(maxSheetHeight(), Math.max(PEEK_HEIGHT, origin.height + (origin.y - event.clientY)));
|
|
181907
|
+
setSheetHeight(next);
|
|
181908
|
+
};
|
|
181909
|
+
const onHandlePointerUp = (event) => {
|
|
181910
|
+
if (!dragOrigin.current)
|
|
181911
|
+
return;
|
|
181912
|
+
dragOrigin.current = null;
|
|
181913
|
+
if (event.currentTarget.hasPointerCapture &&
|
|
181914
|
+
Number.isFinite(event.pointerId) &&
|
|
181915
|
+
event.currentTarget.hasPointerCapture(event.pointerId)) {
|
|
181916
|
+
event.currentTarget.releasePointerCapture(event.pointerId);
|
|
181917
|
+
}
|
|
181918
|
+
if (!dragMoved.current)
|
|
181919
|
+
return;
|
|
181920
|
+
setSheetHeight((current) => {
|
|
181921
|
+
if (current !== null && current > PEEK_HEIGHT + DRAG_SLOP) {
|
|
181922
|
+
lastOpenHeight.current = current;
|
|
181923
|
+
}
|
|
181924
|
+
return current;
|
|
181925
|
+
});
|
|
181926
|
+
};
|
|
181927
|
+
const onHandleClick = () => {
|
|
181928
|
+
if (!listVisible)
|
|
181929
|
+
return;
|
|
181930
|
+
if (dragMoved.current) {
|
|
181931
|
+
dragMoved.current = false;
|
|
181932
|
+
return;
|
|
181933
|
+
}
|
|
181934
|
+
toggleSheet();
|
|
181935
|
+
};
|
|
181936
|
+
const trimmedQuery = query.trim();
|
|
181937
|
+
const locationReady = locationMode === "geolocation" || city.trim().length >= 2;
|
|
181938
|
+
const canSearch = trimmedQuery.length >= 3 &&
|
|
181939
|
+
trimmedQuery.length <= 80 &&
|
|
181940
|
+
locationReady &&
|
|
181941
|
+
!isLoading &&
|
|
181942
|
+
!isLocating;
|
|
181943
|
+
React$1.useEffect(() => {
|
|
181944
|
+
if (previousMode.current !== "geolocation" && locationMode === "geolocation") {
|
|
181945
|
+
setLocationOpen(false);
|
|
181946
|
+
}
|
|
181947
|
+
previousMode.current = locationMode;
|
|
181948
|
+
}, [locationMode]);
|
|
181949
|
+
React$1.useEffect(() => {
|
|
181950
|
+
if (!selectedPlaceId)
|
|
181951
|
+
return;
|
|
181952
|
+
if (!(results === null || results === void 0 ? void 0 : results.some((place) => place.placeId === selectedPlaceId))) {
|
|
181953
|
+
setSelectedPlaceId(null);
|
|
181954
|
+
}
|
|
181955
|
+
}, [results, selectedPlaceId]);
|
|
181956
|
+
React$1.useEffect(() => {
|
|
181957
|
+
if (!selectedPlaceId || !listVisible)
|
|
181958
|
+
return;
|
|
181959
|
+
setSheetHeight((current) => {
|
|
181960
|
+
const height = current !== null && current !== void 0 ? current : defaultOpenHeight();
|
|
181961
|
+
if (height > PEEK_HEIGHT + DRAG_SLOP)
|
|
181962
|
+
return current;
|
|
181963
|
+
const open = lastOpenHeight.current > PEEK_HEIGHT + DRAG_SLOP
|
|
181964
|
+
? lastOpenHeight.current
|
|
181965
|
+
: defaultOpenHeight();
|
|
181966
|
+
return Math.min(open, maxSheetHeight());
|
|
181967
|
+
});
|
|
181968
|
+
let innerFrame = 0;
|
|
181969
|
+
const outerFrame = requestAnimationFrame(() => {
|
|
181970
|
+
innerFrame = requestAnimationFrame(() => {
|
|
181971
|
+
var _a;
|
|
181972
|
+
const row = (_a = document
|
|
181973
|
+
.getElementById("terreiro-search-sheet-body")) === null || _a === void 0 ? void 0 : _a.querySelector(`[data-testid="terreiro-search-result-${CSS.escape(selectedPlaceId)}"]`);
|
|
181974
|
+
if (row instanceof HTMLElement) {
|
|
181975
|
+
row.scrollIntoView({ block: "nearest" });
|
|
181976
|
+
}
|
|
181977
|
+
});
|
|
181978
|
+
});
|
|
181979
|
+
return () => {
|
|
181980
|
+
cancelAnimationFrame(outerFrame);
|
|
181981
|
+
cancelAnimationFrame(innerFrame);
|
|
181982
|
+
};
|
|
181983
|
+
}, [listVisible, selectedPlaceId]);
|
|
181984
|
+
const locationLabel = locationMode === "geolocation"
|
|
181985
|
+
? "Perto de mim"
|
|
181986
|
+
: city.trim()
|
|
181987
|
+
? state.trim()
|
|
181988
|
+
? `${city.trim()}, ${state.trim()}`
|
|
181989
|
+
: city.trim()
|
|
181990
|
+
: "Escolher cidade";
|
|
181991
|
+
const peekLabel = (() => {
|
|
181992
|
+
if (isLoading)
|
|
181993
|
+
return "Buscando terreiros...";
|
|
181994
|
+
if (errorMessage)
|
|
181995
|
+
return "Não foi possível buscar";
|
|
181996
|
+
if (results && results.length === 1)
|
|
181997
|
+
return "1 terreiro";
|
|
181998
|
+
if (results && results.length > 1)
|
|
181999
|
+
return `${results.length} terreiros`;
|
|
182000
|
+
if (results && results.length === 0)
|
|
182001
|
+
return "Nenhum terreiro";
|
|
182002
|
+
return "Busque para ver terreiros na região";
|
|
182003
|
+
})();
|
|
182004
|
+
const submitTradition = (tradition) => {
|
|
182005
|
+
onQueryChange(tradition);
|
|
182006
|
+
if (locationReady && !isLoading && !isLocating)
|
|
182007
|
+
onSearch(tradition);
|
|
182008
|
+
};
|
|
182009
|
+
const notice = geolocationNotice ? (React$1.createElement(Typography$1, { role: "status", variant: "body2", "data-testid": "terreiro-search-geo-notice", sx: {
|
|
182010
|
+
alignSelf: "flex-start",
|
|
182011
|
+
maxWidth: "100%",
|
|
182012
|
+
bgcolor: "background.paper",
|
|
182013
|
+
color: "text.secondary",
|
|
182014
|
+
borderRadius: 2,
|
|
182015
|
+
px: 1.5,
|
|
182016
|
+
py: 1,
|
|
182017
|
+
fontSize: 13,
|
|
182018
|
+
boxShadow: floatingControlShadow,
|
|
182019
|
+
} }, geolocationNotice)) : null;
|
|
182020
|
+
return (React$1.createElement(Box$1, { sx: {
|
|
182021
|
+
position: "relative",
|
|
182022
|
+
height: "100dvh",
|
|
182023
|
+
display: "flex",
|
|
182024
|
+
overflow: "hidden",
|
|
182025
|
+
bgcolor: "background.default",
|
|
182026
|
+
} },
|
|
182027
|
+
React$1.createElement(Box$1, { component: "section", "aria-label": "Resultados", "data-testid": "terreiro-search-sheet", style: listVisible ? { height: resolvedSheetHeight } : undefined, sx: {
|
|
182028
|
+
position: listVisible ? "absolute" : { xs: "absolute", sm: "relative" },
|
|
182029
|
+
left: 0,
|
|
182030
|
+
right: { xs: 0, sm: "auto" },
|
|
182031
|
+
bottom: 0,
|
|
182032
|
+
zIndex: 2,
|
|
182033
|
+
display: "flex",
|
|
182034
|
+
flexDirection: "column",
|
|
182035
|
+
width: { xs: "100%", sm: 400 },
|
|
182036
|
+
maxWidth: { sm: 400 },
|
|
182037
|
+
flexShrink: 0,
|
|
182038
|
+
height: listVisible ? undefined : { sm: "100%" },
|
|
182039
|
+
maxHeight: listVisible ? `calc(100dvh - ${TOP_CLEARANCE}px)` : "none",
|
|
182040
|
+
bgcolor: "background.paper",
|
|
182041
|
+
borderTopLeftRadius: listVisible || !isWide ? "20px" : 0,
|
|
182042
|
+
borderTopRightRadius: listVisible || !isWide ? "20px" : 0,
|
|
182043
|
+
borderRight: listVisible ? 0 : { sm: 1 },
|
|
182044
|
+
borderColor: "divider",
|
|
182045
|
+
boxShadow: listVisible || !isWide ? "0 -8px 24px rgba(32, 28, 16, 0.08)" : "none",
|
|
182046
|
+
} },
|
|
182047
|
+
listVisible ? (React$1.createElement(Box$1, { component: "button", type: "button", "aria-expanded": sheetOpen, "aria-controls": "terreiro-search-sheet-body", "data-testid": "terreiro-search-sheet-handle", onPointerDown: onHandlePointerDown, onPointerMove: onHandlePointerMove, onPointerUp: onHandlePointerUp, onClick: onHandleClick, sx: Object.assign({ width: "100%", border: 0, bgcolor: "transparent", cursor: "ns-resize", touchAction: "none", display: "flex", flexDirection: "column", alignItems: "center", gap: 0.75, pt: 1, pb: 1, px: 2, minHeight: 44, color: "text.primary" }, focusRing) },
|
|
182048
|
+
React$1.createElement(Box$1, { "aria-hidden": true, sx: {
|
|
182049
|
+
width: 36,
|
|
182050
|
+
height: 4,
|
|
182051
|
+
borderRadius: RADIUS.pill,
|
|
182052
|
+
bgcolor: (muiTheme) => alpha(muiTheme.palette.text.primary, 0.28),
|
|
182053
|
+
} }),
|
|
182054
|
+
React$1.createElement(Box$1, { component: "span", sx: { alignSelf: "flex-start", fontSize: 16, fontWeight: 800 } }, peekLabel))) : isWide ? (React$1.createElement(Typography$1, { sx: { px: 2, pt: 2, pb: 1, fontSize: 16, fontWeight: 800 } }, peekLabel)) : (React$1.createElement(Box$1, { sx: {
|
|
182055
|
+
width: "100%",
|
|
182056
|
+
display: "flex",
|
|
182057
|
+
flexDirection: "column",
|
|
182058
|
+
alignItems: "center",
|
|
182059
|
+
gap: 0.75,
|
|
182060
|
+
pt: 1,
|
|
182061
|
+
pb: 1,
|
|
182062
|
+
px: 2,
|
|
182063
|
+
minHeight: 44,
|
|
182064
|
+
color: "text.primary",
|
|
182065
|
+
} },
|
|
182066
|
+
React$1.createElement(Box$1, { "aria-hidden": true, sx: {
|
|
182067
|
+
width: 36,
|
|
182068
|
+
height: 4,
|
|
182069
|
+
borderRadius: RADIUS.pill,
|
|
182070
|
+
bgcolor: (muiTheme) => alpha(muiTheme.palette.text.primary, 0.28),
|
|
182071
|
+
} }),
|
|
182072
|
+
React$1.createElement(Box$1, { component: "span", sx: { alignSelf: "flex-start", fontSize: 16, fontWeight: 800 } }, peekLabel))),
|
|
182073
|
+
React$1.createElement(Box$1, { id: "terreiro-search-sheet-body", sx: {
|
|
182074
|
+
display: hasSheetContent ? "flex" : "none",
|
|
182075
|
+
flexDirection: "column",
|
|
182076
|
+
flex: 1,
|
|
182077
|
+
minHeight: 0,
|
|
182078
|
+
overflowY: "auto",
|
|
182079
|
+
px: 2,
|
|
182080
|
+
pb: 2,
|
|
182081
|
+
} },
|
|
182082
|
+
isLoading ? (React$1.createElement(Stack$1, { spacing: 1, "data-testid": "terreiro-search-loading" }, [0, 1, 2].map((item) => (React$1.createElement(Skeleton$1, { key: item, variant: "rectangular", height: 56 }))))) : null,
|
|
182083
|
+
!isLoading && errorMessage ? (React$1.createElement(Stack$1, { spacing: 1, "data-testid": "terreiro-search-error", role: "alert" },
|
|
182084
|
+
React$1.createElement(Typography$1, null, errorMessage),
|
|
182085
|
+
onRetry ? (React$1.createElement(Button$1, { type: "button", variant: "text", onClick: onRetry, "data-testid": "terreiro-search-retry", sx: {
|
|
182086
|
+
alignSelf: "flex-start",
|
|
182087
|
+
minHeight: 44,
|
|
182088
|
+
fontWeight: 700,
|
|
182089
|
+
color: "text.primary",
|
|
182090
|
+
} }, "Tentar de novo")) : null)) : null,
|
|
182091
|
+
!isLoading && !errorMessage && results && results.length === 0 ? (React$1.createElement(Stack$1, { spacing: 1, "data-testid": "terreiro-search-empty", sx: { py: 2 } },
|
|
182092
|
+
React$1.createElement(PlaceOutlined, { sx: { color: "text.primary" } }),
|
|
182093
|
+
React$1.createElement(Typography$1, { sx: { fontWeight: 700 } }, "Nenhum terreiro encontrado para esta busca na regi\u00E3o selecionada."),
|
|
182094
|
+
React$1.createElement(Typography$1, { sx: { fontSize: 13, color: "text.secondary" } }, "Ajuste o termo ou a cidade e busque de novo."))) : null,
|
|
182095
|
+
!isLoading && !errorMessage && results && results.length > 0 ? (React$1.createElement(Box$1, { component: "ul", sx: { m: 0, p: 0 } }, results.map((place) => (React$1.createElement(ResultRow, { key: place.placeId, place: place, selected: place.placeId === selectedPlaceId, onSelect: setSelectedPlaceId, onOpenMaps: onOpenMaps }))))) : null,
|
|
182096
|
+
!isLoading && !errorMessage && hasMore ? (React$1.createElement(Button$1, { type: "button", variant: "text", onClick: onLoadMore, disabled: isLoadingMore, "data-testid": "terreiro-search-load-more", sx: {
|
|
182097
|
+
alignSelf: "flex-start",
|
|
182098
|
+
mt: 0.5,
|
|
182099
|
+
minHeight: 44,
|
|
182100
|
+
fontWeight: 700,
|
|
182101
|
+
color: "text.primary",
|
|
182102
|
+
} }, isLoadingMore ? "Carregando..." : "Carregar mais")) : null)),
|
|
182103
|
+
React$1.createElement(Box$1, { sx: { position: "relative", flex: 1, minWidth: 0 } },
|
|
182104
|
+
React$1.createElement(TerreiroResultMap, { apiKey: googleMapsApiKey, results: results, selectedPlaceId: selectedPlaceId, userCoordinates: userCoordinates, layoutKey: listVisible ? resolvedSheetHeight : null, onSelectPlace: setSelectedPlaceId }),
|
|
182105
|
+
React$1.createElement(Box$1, { component: "form", onSubmit: (event) => {
|
|
182106
|
+
event.preventDefault();
|
|
182107
|
+
if (canSearch)
|
|
182108
|
+
onSearch(trimmedQuery);
|
|
182109
|
+
}, sx: {
|
|
182110
|
+
position: "absolute",
|
|
182111
|
+
top: 16,
|
|
182112
|
+
left: 16,
|
|
182113
|
+
right: 16,
|
|
182114
|
+
zIndex: 3,
|
|
182115
|
+
display: "flex",
|
|
182116
|
+
flexDirection: "column",
|
|
182117
|
+
gap: 1,
|
|
182118
|
+
} },
|
|
182119
|
+
React$1.createElement(Box$1, { sx: { display: "flex", alignItems: "center", gap: 1 } },
|
|
182120
|
+
onBack ? (React$1.createElement(IconButton$1, { type: "button", "aria-label": "Voltar", onClick: onBack, sx: Object.assign({ width: 44, height: 44, flexShrink: 0, bgcolor: "background.paper", color: "text.primary", boxShadow: floatingControlShadow, "&:hover": { bgcolor: "background.paper" } }, focusRing) },
|
|
182121
|
+
React$1.createElement(ArrowBack$1, null))) : null,
|
|
182122
|
+
React$1.createElement(Box$1, { sx: {
|
|
182123
|
+
flex: 1,
|
|
182124
|
+
minWidth: 0,
|
|
182125
|
+
display: "flex",
|
|
182126
|
+
alignItems: "center",
|
|
182127
|
+
minHeight: 44,
|
|
182128
|
+
pl: 2,
|
|
182129
|
+
pr: 0.5,
|
|
182130
|
+
bgcolor: "background.paper",
|
|
182131
|
+
borderRadius: RADIUS.pill,
|
|
182132
|
+
boxShadow: floatingControlShadow,
|
|
182133
|
+
} },
|
|
182134
|
+
React$1.createElement(InputBase$1, { value: query, onChange: (event) => onQueryChange(event.target.value), placeholder: "Umbanda, Candombl\u00E9...", fullWidth: true, inputProps: {
|
|
182135
|
+
"aria-label": "Tradição ou nome",
|
|
182136
|
+
maxLength: 80,
|
|
182137
|
+
"data-testid": "terreiro-search-query",
|
|
182138
|
+
}, sx: {
|
|
182139
|
+
fontSize: 16,
|
|
182140
|
+
color: "text.primary",
|
|
182141
|
+
"& input::placeholder": { color: "text.secondary", opacity: 1 },
|
|
182142
|
+
} }),
|
|
182143
|
+
query ? (React$1.createElement(IconButton$1, { type: "button", "aria-label": "Limpar busca", onClick: () => onQueryChange(""), sx: { width: 44, height: 44, flexShrink: 0, color: "text.primary" } },
|
|
182144
|
+
React$1.createElement(Close$1, null))) : null),
|
|
182145
|
+
React$1.createElement(IconButton$1, { type: "submit", "aria-label": "Buscar", disabled: !canSearch, "data-testid": "terreiro-search-submit", onClick: (event) => {
|
|
182146
|
+
event.preventDefault();
|
|
182147
|
+
if (canSearch)
|
|
182148
|
+
onSearch(trimmedQuery);
|
|
182149
|
+
}, sx: Object.assign({ width: 44, height: 44, flexShrink: 0, bgcolor: "primary.main", color: "primary.contrastText", boxShadow: floatingControlShadow, "&:hover": { bgcolor: "primary.dark" }, "&.Mui-disabled": {
|
|
182150
|
+
bgcolor: (muiTheme) => alpha(muiTheme.palette.primary.main, 0.38),
|
|
182151
|
+
color: "primary.contrastText",
|
|
182152
|
+
} }, focusRing) },
|
|
182153
|
+
React$1.createElement(Search$1, null))),
|
|
182154
|
+
React$1.createElement(Box$1, { role: "group", "aria-label": "Tradi\u00E7\u00F5es", sx: {
|
|
182155
|
+
display: "flex",
|
|
182156
|
+
gap: 1,
|
|
182157
|
+
overflowX: "auto",
|
|
182158
|
+
scrollbarWidth: "none",
|
|
182159
|
+
"&::-webkit-scrollbar": { display: "none" },
|
|
182160
|
+
} }, TRADITIONS.map((tradition) => {
|
|
182161
|
+
const pressed = traditionPressed(query, tradition);
|
|
182162
|
+
return (React$1.createElement(Button$1, { key: tradition, type: "button", variant: "outlined", "aria-pressed": pressed, onClick: () => submitTradition(tradition), sx: {
|
|
182163
|
+
flexShrink: 0,
|
|
182164
|
+
minHeight: 44,
|
|
182165
|
+
px: 2,
|
|
182166
|
+
borderRadius: RADIUS.pill,
|
|
182167
|
+
textTransform: "none",
|
|
182168
|
+
fontWeight: 600,
|
|
182169
|
+
bgcolor: "background.paper",
|
|
182170
|
+
borderColor: pressed ? "primary.main" : "divider",
|
|
182171
|
+
color: pressed ? "primary.main" : "text.primary",
|
|
182172
|
+
"&:hover": {
|
|
182173
|
+
bgcolor: "background.paper",
|
|
182174
|
+
borderColor: pressed ? "primary.main" : "divider",
|
|
182175
|
+
},
|
|
182176
|
+
} }, tradition));
|
|
182177
|
+
})),
|
|
182178
|
+
React$1.createElement(Button$1, { type: "button", variant: "outlined", "aria-expanded": locationOpen, "aria-haspopup": "dialog", onClick: () => setLocationOpen(true), startIcon: locationMode === "geolocation" ? React$1.createElement(MyLocation, null) : React$1.createElement(PlaceOutlined, null), sx: {
|
|
182179
|
+
alignSelf: "flex-start",
|
|
182180
|
+
minHeight: 44,
|
|
182181
|
+
maxWidth: "100%",
|
|
182182
|
+
borderRadius: RADIUS.pill,
|
|
182183
|
+
textTransform: "none",
|
|
182184
|
+
fontWeight: 600,
|
|
182185
|
+
bgcolor: "background.paper",
|
|
182186
|
+
borderColor: "divider",
|
|
182187
|
+
color: "text.primary",
|
|
182188
|
+
"&:hover": { bgcolor: "background.paper", borderColor: "divider" },
|
|
182189
|
+
} }, locationLabel),
|
|
182190
|
+
!locationOpen ? notice : null)),
|
|
182191
|
+
React$1.createElement(GenericDrawer, { open: locationOpen, onClose: () => setLocationOpen(false), "aria-label": "Local da busca" }, locationOpen ? (React$1.createElement(Stack$1, { spacing: 2, sx: { px: 2, pb: 3 } },
|
|
182192
|
+
React$1.createElement(Typography$1, { sx: { fontSize: 16, fontWeight: 800 } }, "Onde buscar"),
|
|
182193
|
+
(googleMapsApiKey === null || googleMapsApiKey === void 0 ? void 0 : googleMapsApiKey.trim()) && !addressSearchUnavailable ? (React$1.createElement(TerreiroLocationSearch, { apiKey: googleMapsApiKey.trim(), onUnavailable: () => setAddressSearchUnavailable(true), onSelect: (nextCity, nextState) => {
|
|
182194
|
+
onCityChange(nextCity);
|
|
182195
|
+
onStateChange(nextState);
|
|
182196
|
+
setLocationOpen(false);
|
|
182197
|
+
} })) : (React$1.createElement(Stack$1, { direction: "row", spacing: 1 },
|
|
182198
|
+
React$1.createElement(TextField$1, { label: "Cidade", value: city, onChange: (event) => onCityChange(event.target.value), inputProps: { "data-testid": "terreiro-search-city" }, fullWidth: true, sx: {
|
|
182199
|
+
"& .MuiInputBase-input": { color: "text.primary" },
|
|
182200
|
+
"& .MuiInputBase-input::placeholder": { color: "text.secondary", opacity: 1 },
|
|
182201
|
+
} }),
|
|
182202
|
+
React$1.createElement(TextField$1, { label: "UF", value: state, onChange: (event) => onStateChange(event.target.value.toUpperCase().slice(0, 2)), inputProps: { maxLength: 2, "data-testid": "terreiro-search-state" }, sx: {
|
|
182203
|
+
width: 88,
|
|
182204
|
+
"& .MuiInputBase-input": { color: "text.primary" },
|
|
182205
|
+
} }))),
|
|
182206
|
+
React$1.createElement(Button$1, { type: "button", variant: "text", onClick: onUseMyLocation, disabled: isLocating || isLoading, "data-testid": "terreiro-search-geolocation", sx: { alignSelf: "flex-start", minHeight: 44, fontWeight: 700, color: "text.primary" } }, isLocating ? "Buscando localização..." : "Usar minha localização"),
|
|
182207
|
+
notice)) : null)));
|
|
182208
|
+
};
|
|
182209
|
+
|
|
181420
182210
|
/**
|
|
181421
182211
|
* Convert the given array buffer into a Base64URL-encoded string. Ideal for converting various
|
|
181422
182212
|
* credential response ArrayBuffers to string for sending back to the server as JSON.
|
|
@@ -195061,6 +195851,7 @@ exports.MoonZodiacSchema = MoonZodiacSchema;
|
|
|
195061
195851
|
exports.MyPermissionsDetailedSchema = MyPermissionsDetailedSchema;
|
|
195062
195852
|
exports.MyPermissionsPage = MyPermissionsPage;
|
|
195063
195853
|
exports.MyPermissionsPagePropsSchema = MyPermissionsPagePropsSchema;
|
|
195854
|
+
exports.NearbyTerreiroSearchPage = NearbyTerreiroSearchPage;
|
|
195064
195855
|
exports.NotFoundPage = NotFoundPage;
|
|
195065
195856
|
exports.NotificationSettingsPage = NotificationSettingsPage;
|
|
195066
195857
|
exports.NotificationSettingsPagePropsSchema = NotificationSettingsPagePropsSchema;
|